2 lines
6.0 MiB
Plaintext
2 lines
6.0 MiB
Plaintext
/*! For license information please see main.bundle.js.LICENSE.txt */
|
||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.MonacoPrompt=t():e.MonacoPrompt=t()}(self,(()=>(()=>{"use strict";var e={69:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .snippet-placeholder {\n\tmin-width: 2px;\n\toutline-style: solid;\n\toutline-width: 1px;\n\tbackground-color: var(--vscode-editor-snippetTabstopHighlightBackground, transparent);\n\toutline-color: var(--vscode-editor-snippetTabstopHighlightBorder, transparent);\n}\n\n.monaco-editor .finish-snippet-placeholder {\n\toutline-style: solid;\n\toutline-width: 1px;\n\tbackground-color: var(--vscode-editor-snippetFinalTabstopHighlightBackground, transparent);\n\toutline-color: var(--vscode-editor-snippetFinalTabstopHighlightBorder, transparent);\n}\n",""]);const a=r},140:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* Arrows */\n.monaco-scrollable-element > .scrollbar > .scra {\n\tcursor: pointer;\n\tfont-size: 11px !important;\n}\n\n.monaco-scrollable-element > .visible {\n\topacity: 1;\n\n\t/* Background rule added for IE9 - to allow clicks on dom node */\n\tbackground:rgba(0,0,0,0);\n\n\ttransition: opacity 100ms linear;\n\t/* In front of peek view */\n\tz-index: 11;\n}\n.monaco-scrollable-element > .invisible {\n\topacity: 0;\n\tpointer-events: none;\n}\n.monaco-scrollable-element > .invisible.fade {\n\ttransition: opacity 800ms linear;\n}\n\n/* Scrollable Content Inset Shadow */\n.monaco-scrollable-element > .shadow {\n\tposition: absolute;\n\tdisplay: none;\n}\n.monaco-scrollable-element > .shadow.top {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 3px;\n\theight: 3px;\n\twidth: 100%;\n\tbox-shadow: var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset;\n}\n.monaco-scrollable-element > .shadow.left {\n\tdisplay: block;\n\ttop: 3px;\n\tleft: 0;\n\theight: 100%;\n\twidth: 3px;\n\tbox-shadow: var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset;\n}\n.monaco-scrollable-element > .shadow.top-left-corner {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 0;\n\theight: 3px;\n\twidth: 3px;\n}\n.monaco-scrollable-element > .shadow.top.left {\n\tbox-shadow: var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset;\n}\n\n.monaco-scrollable-element > .scrollbar > .slider {\n\tbackground: var(--vscode-scrollbarSlider-background);\n}\n\n.monaco-scrollable-element > .scrollbar > .slider:hover {\n\tbackground: var(--vscode-scrollbarSlider-hoverBackground);\n}\n\n.monaco-scrollable-element > .scrollbar > .slider.active {\n\tbackground: var(--vscode-scrollbarSlider-activeBackground);\n}\n",""]);const a=r},206:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-count-badge {\n\tpadding: 3px 6px;\n\tborder-radius: 11px;\n\tfont-size: 11px;\n\tmin-width: 18px;\n\tmin-height: 18px;\n\tline-height: 11px;\n\tfont-weight: normal;\n\ttext-align: center;\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n}\n\n.monaco-count-badge.long {\n\tpadding: 2px 3px;\n\tborder-radius: 2px;\n\tmin-height: auto;\n\tline-height: normal;\n}\n",""]);const a=r},213:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n.monaco-editor .overlayWidgets {\n\tposition: absolute;\n\ttop: 0;\n\tleft:0;\n}",""]);const a=r},233:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/*\n\t@keyframes blink { 50% { border-color: orange; } }\n*/\n\n.monaco-editor {\n\t.inline-edits-view-indicator {\n\t\tdisplay: flex;\n\n\t\tz-index: 34; /* Below the find widget */\n\t\theight: 20px;\n\n\t\tcolor: var(--vscode-inlineEdit-gutterIndicator-primaryForeground);\n\t\tbackground-color: var(--vscode-inlineEdit-gutterIndicator-background);\n\t\tborder: 1px solid var(--vscode-inlineEdit-gutterIndicator-primaryBorder);\n\t\tborder-radius: 3px;\n\n\t\talign-items: center;\n\t\tpadding: 2px;\n\t\tpadding-right: 10px;\n\t\tmargin: 0 4px;\n\n\t\t/*\n\t\tanimation: blink 1s;\n\t\tanimation-iteration-count: 3;\n\t\t*/\n\n\t\topacity: 0;\n\n\t\t&.contained {\n\t\t\ttransition: opacity 0.2s ease-in-out;\n\t\t\ttransition-delay: 0.4s;\n\t\t}\n\n\t\t&.visible {\n\t\t\topacity: 1;\n\t\t}\n\n\t\t&.top {\n\t\t\topacity: 1;\n\n\t\t\t.icon {\n\t\t\t\ttransform: rotate(90deg);\n\t\t\t}\n\t\t}\n\n\t\t&.bottom {\n\t\t\topacity: 1;\n\n\t\t\t.icon {\n\t\t\t\ttransform: rotate(-90deg);\n\t\t\t}\n\t\t}\n\n\t\t.icon {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tmargin: 0 2px;\n\t\t\ttransform: none;\n\t\t\ttransition: transform 0.2s ease-in-out;\n\t\t\t.codicon {\n\t\t\t\tcolor: var(--vscode-inlineEdit-gutterIndicator-primaryForeground);\n\t\t\t}\n\t\t}\n\n\t\t.label {\n\t\t\tmargin: 0 2px;\n\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: center;\n\t\t\twidth: 100%;\n\t\t}\n\t}\n\n\t.inline-edits-view .editorContainer {\n\t\t.preview .monaco-editor {\n\t\t\t.view-overlays .current-line-exact {\n\t\t\t\tborder: none;\n\t\t\t}\n\n\t\t\t.current-line-margin {\n\t\t\t\tborder: none;\n\t\t\t}\n\t\t}\n\n\t\t.inline-edits-view-zone.diagonal-fill {\n\t\t\topacity: 0.5;\n\t\t}\n\t}\n\n\t.strike-through {\n\t\ttext-decoration: line-through;\n\t}\n\n\t.inlineCompletions-line-insert {\n\t\tbackground: var(--vscode-inlineEdit-modifiedChangedLineBackground);\n\t}\n\n\t.inlineCompletions-line-delete {\n\t\tbackground: var(--vscode-inlineEdit-originalChangedLineBackground);\n\t}\n\n\t.inlineCompletions-char-insert {\n\t\tbackground: var(--vscode-inlineEdit-modifiedChangedTextBackground);\n\t\tcursor: pointer;\n\t}\n\n\t.inlineCompletions-char-delete {\n\t\tbackground: var(--vscode-inlineEdit-originalChangedTextBackground);\n\t}\n\n\t.inlineCompletions-char-delete.diff-range-empty {\n\t\tmargin-left: -1px;\n\t\tborder-left: solid var(--vscode-inlineEdit-originalChangedTextBackground) 3px;\n\t}\n\n\t.inlineCompletions-char-insert.diff-range-empty {\n\t\tborder-left: solid var(--vscode-inlineEdit-modifiedChangedTextBackground) 3px;\n\t}\n\n\t.inlineCompletions-char-delete.single-line-inline { /* Editor Decoration */\n\t\tborder: 1px solid var(--vscode-editorHoverWidget-border);\n\t\tmargin: -2px 0 0 -2px;\n\t}\n\n\t.inlineCompletions-char-insert.single-line-inline { /* Inline Decoration */\n\t\tborder-top: 1px solid var(--vscode-inlineEdit-modifiedBorder); /* TODO: Do not set border inline but create overlaywidget (like deletion view) */\n\t\tborder-bottom: 1px solid var(--vscode-inlineEdit-modifiedBorder); /* TODO: Do not set border inline but create overlaywidget (like deletion view) */\n\t}\n\t.inlineCompletions-char-insert.single-line-inline.start {\n\t\tborder-top-left-radius: 4px;\n\t\tborder-bottom-left-radius: 4px;\n\t\tborder-left: 1px solid var(--vscode-inlineEdit-modifiedBorder); /* TODO: Do not set border inline but create overlaywidget (like deletion view) */\n\t}\n\t.inlineCompletions-char-insert.single-line-inline.end {\n\t\tborder-top-right-radius: 4px;\n\t\tborder-bottom-right-radius: 4px;\n\t\tborder-right: 1px solid var(--vscode-inlineEdit-modifiedBorder); /* TODO: Do not set border inline but create overlaywidget (like deletion view) */\n\t}\n\n\t.inlineCompletions-char-delete.single-line-inline.empty,\n\t.inlineCompletions-char-insert.single-line-inline.empty {\n\t\tdisplay: none;\n\t}\n\n\t.inlineCompletions.strike-through {\n\t\ttext-decoration-thickness: 1px;\n\t}\n\n\t/* line replacement bubbles */\n\n\t.inlineCompletions-modified-bubble {\n\t\tbackground: var(--vscode-inlineEdit-modifiedChangedTextBackground);\n\t}\n\n\t.inlineCompletions-original-bubble {\n\t\tbackground: var(--vscode-inlineEdit-originalChangedTextBackground);\n\t}\n\n\t.inlineCompletions-modified-bubble,\n\t.inlineCompletions-original-bubble {\n\t\tpointer-events: none;\n\t\tdisplay: inline-block;\n\t}\n\n\t.inline-edit.ghost-text,\n\t.inline-edit.ghost-text-decoration,\n\t.inline-edit.ghost-text-decoration-preview,\n\t.inline-edit.suggest-preview-text .ghost-text {\n\t\t&.syntax-highlighted {\n\t\t\topacity: 1 !important;\n\t\t}\n\t\tfont-style: normal !important;\n\t}\n\n\t.inline-edit.modified-background.ghost-text,\n\t.inline-edit.modified-background.ghost-text-decoration,\n\t.inline-edit.modified-background.ghost-text-decoration-preview,\n\t.inline-edit.modified-background.suggest-preview-text .ghost-text {\n\t\tbackground: var(--vscode-inlineEdit-modifiedChangedTextBackground) !important;\n\t\tdisplay: inline-block !important;\n\t}\n\n\t.inlineCompletions-original-lines {\n\t\tbackground: var(--vscode-editor-background);\n\t}\n}\n\n.monaco-menu-option {\n\tcolor: var(--vscode-editorActionList-foreground);\n\tfont-size: 13px;\n\tpadding: 0 4px;\n\tline-height: 28px;\n\tdisplay: flex;\n\tgap: 4px;\n\talign-items: center;\n\tborder-radius: 3px;\n\tcursor: pointer;\n\n\t.monaco-keybinding-key {\n\t\tfont-size: 13px;\n\t\topacity: 0.7;\n\t}\n\n\t&.active {\n\t\tbackground: var(--vscode-editorActionList-focusBackground);\n\t\tcolor: var(--vscode-editorActionList-focusForeground);\n\t\toutline: 1px solid var(--vscode-menu-selectionBorder, transparent);\n\t\toutline-offset: -1px;\n\n\t\t.monaco-keybinding-key {\n\t\t\tcolor: var(--vscode-editorActionList-focusForeground);\n\t\t}\n\t}\n}\n",""]);const a=r},245:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .hoverHighlight {\n\tbackground-color: var(--vscode-editor-hoverHighlightBackground);\n}\n\n.monaco-editor .monaco-resizable-hover {\n\tborder: 1px solid var(--vscode-editorHoverWidget-border);\n\tborder-radius: 3px;\n\tbox-sizing: content-box;\n}\n\n.monaco-editor .monaco-resizable-hover > .monaco-hover {\n\tborder: none;\n\tborder-radius: none;\n}\n\n.monaco-editor .monaco-hover {\n\tborder: 1px solid var(--vscode-editorHoverWidget-border);\n\tborder-radius: 3px;\n\tcolor: var(--vscode-editorHoverWidget-foreground);\n\tbackground-color: var(--vscode-editorHoverWidget-background);\n}\n\n.monaco-editor .monaco-hover a {\n\tcolor: var(--vscode-textLink-foreground);\n}\n\n.monaco-editor .monaco-hover a:hover {\n\tcolor: var(--vscode-textLink-activeForeground);\n}\n\n.monaco-editor .monaco-hover .hover-row {\n\tdisplay: flex;\n}\n\n.monaco-editor .monaco-hover .hover-row .hover-row-contents {\n\tmin-width: 0;\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.monaco-editor .monaco-hover .hover-row .verbosity-actions {\n\tborder-right: 1px solid var(--vscode-editorHoverWidget-border);\n\twidth: 22px;\n\toverflow-y: clip;\n}\n\n.monaco-editor .monaco-hover .hover-row .verbosity-actions-inner {\n\tdisplay: flex;\n\tflex-direction: column;\n\tpadding-left: 5px;\n\tpadding-right: 5px;\n\tjustify-content: flex-end;\n\tposition: relative;\n}\n\n.monaco-editor .monaco-hover .hover-row .verbosity-actions-inner .codicon {\n\tcursor: pointer;\n\tfont-size: 11px;\n}\n\n.monaco-editor .monaco-hover .hover-row .verbosity-actions-inner .codicon.enabled {\n\tcolor: var(--vscode-textLink-foreground);\n}\n\n.monaco-editor .monaco-hover .hover-row .verbosity-actions-inner .codicon.disabled {\n\topacity: 0.6;\n}\n\n.monaco-editor .monaco-hover .hover-row .actions {\n\tbackground-color: var(--vscode-editorHoverWidget-statusBarBackground);\n}\n\n.monaco-editor .monaco-hover code {\n\tbackground-color: var(--vscode-textCodeBlock-background);\n}\n",""]);const a=r},266:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-mouse-cursor-text {\n\tcursor: text;\n}\n",""]);const a=r},299:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .mwh {\n\tposition: absolute;\n\tcolor: var(--vscode-editorWhitespace-foreground) !important;\n}\n",""]);const a=r},346:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* Uncomment to see lines flashing when they're painted */\n/*.monaco-editor .view-lines > .view-line {\n\tbackground-color: none;\n\tanimation-name: flash-background;\n\tanimation-duration: 800ms;\n}\n@keyframes flash-background {\n\t0% { background-color: lightgreen; }\n\t100% { background-color: none }\n}*/\n\n.mtkcontrol {\n\tcolor: rgb(255, 255, 255) !important;\n\tbackground: rgb(150, 0, 0) !important;\n}\n\n.mtkoverflow {\n\tbackground-color: var(--vscode-button-background, --vscode-editor-background);\n\tcolor: var(--vscode-button-foreground, --vscode-editor-foreground);\n\tborder-width: 1px;\n\tborder-style: solid;\n\tborder-color: var(--vscode-contrastBorder);\n\tborder-radius: 2px;\n\tpadding: 4px;\n\tcursor: pointer;\n}\n.mtkoverflow:hover {\n\tbackground-color: var(--vscode-button-hoverBackground);\n}\n\n.monaco-editor.no-user-select .lines-content,\n.monaco-editor.no-user-select .view-line,\n.monaco-editor.no-user-select .view-lines {\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n/* Use user-select: text for lookup feature on macOS */\n/* https://github.com/microsoft/vscode/issues/85632 */\n.monaco-editor.mac .lines-content:hover,\n.monaco-editor.mac .view-line:hover,\n.monaco-editor.mac .view-lines:hover {\n\tuser-select: text;\n\t-webkit-user-select: text;\n\t-ms-user-select: text;\n}\n\n.monaco-editor.enable-user-select {\n\tuser-select: initial;\n\t-webkit-user-select: initial;\n}\n\n.monaco-editor .view-lines {\n\twhite-space: nowrap;\n}\n\n.monaco-editor .view-line {\n\tposition: absolute;\n\twidth: 100%;\n}\n\n.monaco-editor .mtkw {\n\tcolor: var(--vscode-editorWhitespace-foreground) !important;\n}\n\n.monaco-editor .mtkz {\n\tdisplay: inline-block;\n\tcolor: var(--vscode-editorWhitespace-foreground) !important;\n}\n\n/* TODO@tokenization bootstrap fix */\n/*.monaco-editor .view-line > span > span {\n\tfloat: none;\n\tmin-height: inherit;\n\tmargin-left: inherit;\n}*/\n",""]);const a=r},540:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},714:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.codicon-wrench-subaction {\n\topacity: 0.5;\n}\n\n@keyframes codicon-spin {\n\t100% {\n\t\ttransform:rotate(360deg);\n\t}\n}\n\n.codicon-sync.codicon-modifier-spin,\n.codicon-loading.codicon-modifier-spin,\n.codicon-gear.codicon-modifier-spin,\n.codicon-notebook-state-executing.codicon-modifier-spin {\n\t/* Use steps to throttle FPS to reduce CPU usage */\n\tanimation: codicon-spin 1.5s steps(30) infinite;\n}\n\n.codicon-modifier-disabled {\n\topacity: 0.4;\n}\n\n/* custom speed & easing for loading icon */\n.codicon-loading,\n.codicon-tree-item-loading::before {\n\tanimation-duration: 1s !important;\n\tanimation-timing-function: cubic-bezier(0.53, 0.21, 0.29, 0.67) !important;\n}\n",""]);const a=r},937:e=>{e.exports='data:image/svg+xml;utf8,%3Csvg viewBox="0 0 24 24" display="inline-block" height="1em" width="1em" vertical-align="text-bottom" xmlns="http://www.w3.org/2000/svg" %3E%3Cpath fill="currentColor" d="M9,20.42L2.79,14.21L5.62,11.38L9,14.77L18.88,4.88L21.71,7.71L9,20.42Z"/%3E%3C/svg%3E'},991:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,'/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .parameter-hints-widget {\n\t/* Must be higher than the sash\'s z-index and terminal canvases but lower than the suggest widget */\n\tz-index: 39;\n\tdisplay: flex;\n\tflex-direction: column;\n\tline-height: 1.5em;\n\tcursor: default;\n\tcolor: var(--vscode-editorHoverWidget-foreground);\n\tbackground-color: var(--vscode-editorHoverWidget-background);\n\tborder: 1px solid var(--vscode-editorHoverWidget-border);\n}\n\n.hc-black .monaco-editor .parameter-hints-widget,\n.hc-light .monaco-editor .parameter-hints-widget {\n\tborder-width: 2px;\n}\n\n.monaco-editor .parameter-hints-widget > .phwrapper {\n\tmax-width: 440px;\n\tdisplay: flex;\n\tflex-direction: row;\n}\n\n.monaco-editor .parameter-hints-widget.multiple {\n\tmin-height: 3.3em;\n\tpadding: 0;\n}\n\n.monaco-editor .parameter-hints-widget.multiple .body::before {\n\tcontent: "";\n\tdisplay: block;\n\theight: 100%;\n\tposition: absolute;\n\topacity: 0.5;\n\tborder-left: 1px solid var(--vscode-editorHoverWidget-border);\n}\n\n.monaco-editor .parameter-hints-widget p,\n.monaco-editor .parameter-hints-widget ul {\n\tmargin: 8px 0;\n}\n\n.monaco-editor .parameter-hints-widget .monaco-scrollable-element,\n.monaco-editor .parameter-hints-widget .body {\n\tdisplay: flex;\n\tflex: 1;\n\tflex-direction: column;\n\tmin-height: 100%;\n}\n\n.monaco-editor .parameter-hints-widget .signature {\n\tpadding: 4px 5px;\n\tposition: relative;\n}\n\n.monaco-editor .parameter-hints-widget .signature.has-docs::after {\n\tcontent: "";\n\tdisplay: block;\n\tposition: absolute;\n\tleft: 0;\n\twidth: 100%;\n\tpadding-top: 4px;\n\topacity: 0.5;\n\tborder-bottom: 1px solid var(--vscode-editorHoverWidget-border);\n}\n\n.monaco-editor .parameter-hints-widget .code {\n\tfont-family: var(--vscode-parameterHintsWidget-editorFontFamily), var(--vscode-parameterHintsWidget-editorFontFamilyDefault);\n}\n\n.monaco-editor .parameter-hints-widget .docs {\n\tpadding: 0 10px 0 5px;\n\twhite-space: pre-wrap;\n}\n\n.monaco-editor .parameter-hints-widget .docs.empty {\n\tdisplay: none;\n}\n\n.monaco-editor .parameter-hints-widget .docs a {\n\tcolor: var(--vscode-textLink-foreground);\n}\n\n.monaco-editor .parameter-hints-widget .docs a:hover {\n\tcolor: var(--vscode-textLink-activeForeground);\n\tcursor: pointer;\n}\n\n.monaco-editor .parameter-hints-widget .docs .markdown-docs {\n\twhite-space: initial;\n}\n\n.monaco-editor .parameter-hints-widget .docs code {\n\tfont-family: var(--monaco-monospace-font);\n\tborder-radius: 3px;\n\tpadding: 0 0.4em;\n\tbackground-color: var(--vscode-textCodeBlock-background);\n}\n\n.monaco-editor .parameter-hints-widget .docs .monaco-tokenized-source,\n.monaco-editor .parameter-hints-widget .docs .code {\n\twhite-space: pre-wrap;\n}\n\n.monaco-editor .parameter-hints-widget .controls {\n\tdisplay: none;\n\tflex-direction: column;\n\talign-items: center;\n\tmin-width: 22px;\n\tjustify-content: flex-end;\n}\n\n.monaco-editor .parameter-hints-widget.multiple .controls {\n\tdisplay: flex;\n\tpadding: 0 2px;\n}\n\n.monaco-editor .parameter-hints-widget.multiple .button {\n\twidth: 16px;\n\theight: 16px;\n\tbackground-repeat: no-repeat;\n\tcursor: pointer;\n}\n\n.monaco-editor .parameter-hints-widget .button.previous {\n\tbottom: 24px;\n}\n\n.monaco-editor .parameter-hints-widget .overloads {\n\ttext-align: center;\n\theight: 12px;\n\tline-height: 12px;\n\tfont-family: var(--monaco-monospace-font);\n}\n\n.monaco-editor .parameter-hints-widget .signature .parameter.active {\n\tcolor: var(--vscode-editorHoverWidget-highlightForeground);\n\tfont-weight: bold;\n}\n\n.monaco-editor .parameter-hints-widget .documentation-parameter > .parameter {\n\tfont-weight: bold;\n\tmargin-right: 0.5em;\n}\n',""]);const a=r},996:e=>{e.exports='data:image/svg+xml;utf8,%3Csvg viewBox="0 0 24 24" display="inline-block" height="1em" width="1em" vertical-align="text-bottom" xmlns="http://www.w3.org/2000/svg" %3E%3Cpath fill="currentColor" d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"/%3E%3C/svg%3E'},1029:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .codicon.codicon-symbol-array,\n.monaco-workbench .codicon.codicon-symbol-array { color: var(--vscode-symbolIcon-arrayForeground); }\n.monaco-editor .codicon.codicon-symbol-boolean,\n.monaco-workbench .codicon.codicon-symbol-boolean { color: var(--vscode-symbolIcon-booleanForeground); }\n.monaco-editor .codicon.codicon-symbol-class,\n.monaco-workbench .codicon.codicon-symbol-class { color: var(--vscode-symbolIcon-classForeground); }\n.monaco-editor .codicon.codicon-symbol-method,\n.monaco-workbench .codicon.codicon-symbol-method { color: var(--vscode-symbolIcon-methodForeground); }\n.monaco-editor .codicon.codicon-symbol-color,\n.monaco-workbench .codicon.codicon-symbol-color { color: var(--vscode-symbolIcon-colorForeground); }\n.monaco-editor .codicon.codicon-symbol-constant,\n.monaco-workbench .codicon.codicon-symbol-constant { color: var(--vscode-symbolIcon-constantForeground); }\n.monaco-editor .codicon.codicon-symbol-constructor,\n.monaco-workbench .codicon.codicon-symbol-constructor { color: var(--vscode-symbolIcon-constructorForeground); }\n.monaco-editor .codicon.codicon-symbol-value,\n.monaco-workbench .codicon.codicon-symbol-value,\n.monaco-editor .codicon.codicon-symbol-enum,\n.monaco-workbench .codicon.codicon-symbol-enum { color: var(--vscode-symbolIcon-enumeratorForeground); }\n.monaco-editor .codicon.codicon-symbol-enum-member,\n.monaco-workbench .codicon.codicon-symbol-enum-member { color: var(--vscode-symbolIcon-enumeratorMemberForeground); }\n.monaco-editor .codicon.codicon-symbol-event,\n.monaco-workbench .codicon.codicon-symbol-event { color: var(--vscode-symbolIcon-eventForeground); }\n.monaco-editor .codicon.codicon-symbol-field,\n.monaco-workbench .codicon.codicon-symbol-field { color: var(--vscode-symbolIcon-fieldForeground); }\n.monaco-editor .codicon.codicon-symbol-file,\n.monaco-workbench .codicon.codicon-symbol-file { color: var(--vscode-symbolIcon-fileForeground); }\n.monaco-editor .codicon.codicon-symbol-folder,\n.monaco-workbench .codicon.codicon-symbol-folder { color: var(--vscode-symbolIcon-folderForeground); }\n.monaco-editor .codicon.codicon-symbol-function,\n.monaco-workbench .codicon.codicon-symbol-function { color: var(--vscode-symbolIcon-functionForeground); }\n.monaco-editor .codicon.codicon-symbol-interface,\n.monaco-workbench .codicon.codicon-symbol-interface { color: var(--vscode-symbolIcon-interfaceForeground); }\n.monaco-editor .codicon.codicon-symbol-key,\n.monaco-workbench .codicon.codicon-symbol-key { color: var(--vscode-symbolIcon-keyForeground); }\n.monaco-editor .codicon.codicon-symbol-keyword,\n.monaco-workbench .codicon.codicon-symbol-keyword { color: var(--vscode-symbolIcon-keywordForeground); }\n.monaco-editor .codicon.codicon-symbol-module,\n.monaco-workbench .codicon.codicon-symbol-module { color: var(--vscode-symbolIcon-moduleForeground); }\n.monaco-editor .codicon.codicon-symbol-namespace,\n.monaco-workbench .codicon.codicon-symbol-namespace { color: var(--vscode-symbolIcon-namespaceForeground); }\n.monaco-editor .codicon.codicon-symbol-null,\n.monaco-workbench .codicon.codicon-symbol-null { color: var(--vscode-symbolIcon-nullForeground); }\n.monaco-editor .codicon.codicon-symbol-number,\n.monaco-workbench .codicon.codicon-symbol-number { color: var(--vscode-symbolIcon-numberForeground); }\n.monaco-editor .codicon.codicon-symbol-object,\n.monaco-workbench .codicon.codicon-symbol-object { color: var(--vscode-symbolIcon-objectForeground); }\n.monaco-editor .codicon.codicon-symbol-operator,\n.monaco-workbench .codicon.codicon-symbol-operator { color: var(--vscode-symbolIcon-operatorForeground); }\n.monaco-editor .codicon.codicon-symbol-package,\n.monaco-workbench .codicon.codicon-symbol-package { color: var(--vscode-symbolIcon-packageForeground); }\n.monaco-editor .codicon.codicon-symbol-property,\n.monaco-workbench .codicon.codicon-symbol-property { color: var(--vscode-symbolIcon-propertyForeground); }\n.monaco-editor .codicon.codicon-symbol-reference,\n.monaco-workbench .codicon.codicon-symbol-reference { color: var(--vscode-symbolIcon-referenceForeground); }\n.monaco-editor .codicon.codicon-symbol-snippet,\n.monaco-workbench .codicon.codicon-symbol-snippet { color: var(--vscode-symbolIcon-snippetForeground); }\n.monaco-editor .codicon.codicon-symbol-string,\n.monaco-workbench .codicon.codicon-symbol-string { color: var(--vscode-symbolIcon-stringForeground); }\n.monaco-editor .codicon.codicon-symbol-struct,\n.monaco-workbench .codicon.codicon-symbol-struct { color: var(--vscode-symbolIcon-structForeground); }\n.monaco-editor .codicon.codicon-symbol-text,\n.monaco-workbench .codicon.codicon-symbol-text { color: var(--vscode-symbolIcon-textForeground); }\n.monaco-editor .codicon.codicon-symbol-type-parameter,\n.monaco-workbench .codicon.codicon-symbol-type-parameter { color: var(--vscode-symbolIcon-typeParameterForeground); }\n.monaco-editor .codicon.codicon-symbol-unit,\n.monaco-workbench .codicon.codicon-symbol-unit { color: var(--vscode-symbolIcon-unitForeground); }\n.monaco-editor .codicon.codicon-symbol-variable,\n.monaco-workbench .codicon.codicon-symbol-variable { color: var(--vscode-symbolIcon-variableForeground); }\n",""]);const a=r},1067:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .view-overlays .current-line {\n\tdisplay: block;\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\tbox-sizing: border-box;\n}\n\n.monaco-editor .margin-view-overlays .current-line {\n\tdisplay: block;\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\tbox-sizing: border-box;\n}\n\n.monaco-editor .margin-view-overlays .current-line.current-line-margin.current-line-margin-both {\n\tborder-right: 0;\n}\n",""]);const a=r},1113:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},1177:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n.monaco-editor .detected-link,\n.monaco-editor .detected-link-active {\n\ttext-decoration: underline;\n\ttext-underline-position: under;\n}\n\n.monaco-editor .detected-link-active {\n\tcursor: pointer;\n\tcolor: var(--vscode-editorLink-activeForeground) !important;\n}\n",""]);const a=r},1255:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/*\n\tKeeping name short for faster parsing.\n\tcmdr = core margin decorations rendering (div)\n*/\n.monaco-editor .margin-view-overlays .cmdr {\n\tposition: absolute;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n}",""]);const a=r},1336:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.quick-input-widget {\n\tfont-size: 13px;\n}\n\n.quick-input-widget .monaco-highlighted-label .highlight,\n.quick-input-widget .monaco-highlighted-label .highlight {\n\tcolor: #0066BF;\n}\n\n.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight,\n.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight {\n\tcolor: #9DDDFF;\n}\n\n.vs-dark .quick-input-widget .monaco-highlighted-label .highlight,\n.vs-dark .quick-input-widget .monaco-highlighted-label .highlight {\n\tcolor: #0097fb;\n}\n\n.hc-black .quick-input-widget .monaco-highlighted-label .highlight,\n.hc-black .quick-input-widget .monaco-highlighted-label .highlight {\n\tcolor: #F38518;\n}\n\n.hc-light .quick-input-widget .monaco-highlighted-label .highlight,\n.hc-light .quick-input-widget .monaco-highlighted-label .highlight {\n\tcolor: #0F4A85;\n}\n\n.monaco-keybinding > .monaco-keybinding-key {\n\tbackground-color: rgba(221, 221, 221, 0.4);\n\tborder: solid 1px rgba(204, 204, 204, 0.4);\n\tborder-bottom-color: rgba(187, 187, 187, 0.4);\n\tbox-shadow: inset 0 -1px 0 rgba(187, 187, 187, 0.4);\n\tcolor: #555;\n}\n\n.hc-black .monaco-keybinding > .monaco-keybinding-key {\n\tbackground-color: transparent;\n\tborder: solid 1px rgb(111, 195, 223);\n\tbox-shadow: none;\n\tcolor: #fff;\n}\n\n.hc-light .monaco-keybinding > .monaco-keybinding-key {\n\tbackground-color: transparent;\n\tborder: solid 1px #0F4A85;\n\tbox-shadow: none;\n\tcolor: #292929;\n}\n\n.vs-dark .monaco-keybinding > .monaco-keybinding-key {\n\tbackground-color: rgba(128, 128, 128, 0.17);\n\tborder: solid 1px rgba(51, 51, 51, 0.6);\n\tborder-bottom-color: rgba(68, 68, 68, 0.6);\n\tbox-shadow: inset 0 -1px 0 rgba(68, 68, 68, 0.6);\n\tcolor: #ccc;\n}\n",""]);const a=r},1366:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-inputbox {\n\tposition: relative;\n\tdisplay: block;\n\tpadding: 0;\n\tbox-sizing:\tborder-box;\n\tborder-radius: 2px;\n\n\t/* Customizable */\n\tfont-size: inherit;\n}\n\n.monaco-inputbox > .ibwrapper > .input,\n.monaco-inputbox > .ibwrapper > .mirror {\n\n\t/* Customizable */\n\tpadding: 4px 6px;\n}\n\n.monaco-inputbox > .ibwrapper {\n\tposition: relative;\n\twidth: 100%;\n}\n\n.monaco-inputbox > .ibwrapper > .input {\n\tdisplay: inline-block;\n\tbox-sizing:\tborder-box;\n\twidth: 100%;\n\theight: 100%;\n\tline-height: inherit;\n\tborder: none;\n\tfont-family: inherit;\n\tfont-size: inherit;\n\tresize: none;\n\tcolor: inherit;\n}\n\n.monaco-inputbox > .ibwrapper > input {\n\ttext-overflow: ellipsis;\n}\n\n.monaco-inputbox > .ibwrapper > textarea.input {\n\tdisplay: block;\n\tscrollbar-width: none; /* Firefox: hide scrollbars */\n\toutline: none;\n}\n\n.monaco-inputbox > .ibwrapper > textarea.input::-webkit-scrollbar {\n\tdisplay: none; /* Chrome + Safari: hide scrollbar */\n}\n\n.monaco-inputbox > .ibwrapper > textarea.input.empty {\n\twhite-space: nowrap;\n}\n\n.monaco-inputbox > .ibwrapper > .mirror {\n\tposition: absolute;\n\tdisplay: inline-block;\n\twidth: 100%;\n\ttop: 0;\n\tleft: 0;\n\tbox-sizing: border-box;\n\twhite-space: pre-wrap;\n\tvisibility: hidden;\n\tword-wrap: break-word;\n}\n\n/* Context view */\n\n.monaco-inputbox-container {\n\ttext-align: right;\n}\n\n.monaco-inputbox-container .monaco-inputbox-message {\n\tdisplay: inline-block;\n\toverflow: hidden;\n\ttext-align: left;\n\twidth: 100%;\n\tbox-sizing:\tborder-box;\n\tpadding: 0.4em;\n\tfont-size: 12px;\n\tline-height: 17px;\n\tmargin-top: -1px;\n\tword-wrap: break-word;\n}\n\n/* Action bar support */\n.monaco-inputbox .monaco-action-bar {\n\tposition: absolute;\n\tright: 2px;\n\ttop: 4px;\n}\n\n.monaco-inputbox .monaco-action-bar .action-item {\n\tmargin-left: 2px;\n}\n\n.monaco-inputbox .monaco-action-bar .action-item .codicon {\n\tbackground-repeat: no-repeat;\n\twidth: 16px;\n\theight: 16px;\n}\n",""]);const a=r},1446:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.quick-input-widget {\n\tfont-size: 13px;\n}\n\n.quick-input-widget .monaco-highlighted-label .highlight,\n.quick-input-widget .monaco-highlighted-label .highlight {\n\tcolor: #0066BF;\n}\n\n.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight,\n.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight {\n\tcolor: #9DDDFF;\n}\n\n.vs-dark .quick-input-widget .monaco-highlighted-label .highlight,\n.vs-dark .quick-input-widget .monaco-highlighted-label .highlight {\n\tcolor: #0097fb;\n}\n\n.hc-black .quick-input-widget .monaco-highlighted-label .highlight,\n.hc-black .quick-input-widget .monaco-highlighted-label .highlight {\n\tcolor: #F38518;\n}\n\n.hc-light .quick-input-widget .monaco-highlighted-label .highlight,\n.hc-light .quick-input-widget .monaco-highlighted-label .highlight {\n\tcolor: #0F4A85;\n}\n\n.monaco-keybinding > .monaco-keybinding-key {\n\tbackground-color: rgba(221, 221, 221, 0.4);\n\tborder: solid 1px rgba(204, 204, 204, 0.4);\n\tborder-bottom-color: rgba(187, 187, 187, 0.4);\n\tbox-shadow: inset 0 -1px 0 rgba(187, 187, 187, 0.4);\n\tcolor: #555;\n}\n\n.hc-black .monaco-keybinding > .monaco-keybinding-key {\n\tbackground-color: transparent;\n\tborder: solid 1px rgb(111, 195, 223);\n\tbox-shadow: none;\n\tcolor: #fff;\n}\n\n.hc-light .monaco-keybinding > .monaco-keybinding-key {\n\tbackground-color: transparent;\n\tborder: solid 1px #0F4A85;\n\tbox-shadow: none;\n\tcolor: #292929;\n}\n\n.vs-dark .monaco-keybinding > .monaco-keybinding-key {\n\tbackground-color: rgba(128, 128, 128, 0.17);\n\tborder: solid 1px rgba(51, 51, 51, 0.6);\n\tborder-bottom-color: rgba(68, 68, 68, 0.6);\n\tbox-shadow: inset 0 -1px 0 rgba(68, 68, 68, 0.6);\n\tcolor: #ccc;\n}\n",""]);const a=r},1452:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.context-view {\n\tposition: absolute;\n}\n\n.context-view.fixed {\n\tall: initial;\n\tfont-family: inherit;\n\tfont-size: 13px;\n\tposition: fixed;\n\tcolor: inherit;\n}\n",""]);const a=r},1469:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .monaco-decoration-css-rule-extractor {\n\tvisibility: hidden;\n\tpointer-events: none;\n}\n",""]);const a=r},1503:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .goto-definition-link {\n\ttext-decoration: underline;\n\tcursor: pointer;\n\tcolor: var(--vscode-editorLink-activeForeground) !important;\n}\n",""]);const a=r},1516:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,'/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-table {\n\tdisplay: flex;\n\tflex-direction: column;\n\tposition: relative;\n\theight: 100%;\n\twidth: 100%;\n\twhite-space: nowrap;\n\toverflow: hidden;\n}\n\n.monaco-table > .monaco-split-view2 {\n\tborder-bottom: 1px solid transparent;\n}\n\n.monaco-table > .monaco-list {\n\tflex: 1;\n}\n\n.monaco-table-tr {\n\tdisplay: flex;\n\theight: 100%;\n}\n\n.monaco-table-th {\n\twidth: 100%;\n\theight: 100%;\n\tfont-weight: bold;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.monaco-table-th,\n.monaco-table-td {\n\tbox-sizing: border-box;\n\tflex-shrink: 0;\n\toverflow: hidden;\n\twhite-space: nowrap;\n\ttext-overflow: ellipsis;\n}\n\n.monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {\n\tcontent: "";\n\tposition: absolute;\n\tleft: calc(var(--vscode-sash-size) / 2);\n\twidth: 0;\n\tborder-left: 1px solid transparent;\n}\n\n.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2,\n.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {\n\ttransition: border-color 0.2s ease-out;\n}\n',""]);const a=r},1601:e=>{e.exports=function(e){return e[1]}},1637:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .view-ruler {\n\tposition: absolute;\n\ttop: 0;\n\tbox-shadow: 1px 0 0 0 var(--vscode-editorRuler-foreground) inset;\n}\n",""]);const a=r},1644:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/* ---------- Find input ---------- */\n\n.monaco-findInput {\n\tposition: relative;\n}\n\n.monaco-findInput .monaco-inputbox {\n\tfont-size: 13px;\n\twidth: 100%;\n}\n\n.monaco-findInput > .controls {\n\tposition: absolute;\n\ttop: 3px;\n\tright: 2px;\n}\n\n.vs .monaco-findInput.disabled {\n\tbackground-color: #E1E1E1;\n}\n\n/* Theming */\n.vs-dark .monaco-findInput.disabled {\n\tbackground-color: #333;\n}\n\n/* Highlighting */\n.monaco-findInput.highlight-0 .controls,\n.hc-light .monaco-findInput.highlight-0 .controls {\n\tanimation: monaco-findInput-highlight-0 100ms linear 0s;\n}\n\n.monaco-findInput.highlight-1 .controls,\n.hc-light .monaco-findInput.highlight-1 .controls {\n\tanimation: monaco-findInput-highlight-1 100ms linear 0s;\n}\n\n.hc-black .monaco-findInput.highlight-0 .controls,\n.vs-dark .monaco-findInput.highlight-0 .controls {\n\tanimation: monaco-findInput-highlight-dark-0 100ms linear 0s;\n}\n\n.hc-black .monaco-findInput.highlight-1 .controls,\n.vs-dark .monaco-findInput.highlight-1 .controls {\n\tanimation: monaco-findInput-highlight-dark-1 100ms linear 0s;\n}\n\n@keyframes monaco-findInput-highlight-0 {\n\t0% { background: rgba(253, 255, 0, 0.8); }\n\t100% { background: transparent; }\n}\n@keyframes monaco-findInput-highlight-1 {\n\t0% { background: rgba(253, 255, 0, 0.8); }\n\t/* Made intentionally different such that the CSS minifier does not collapse the two animations into a single one*/\n\t99% { background: transparent; }\n}\n\n@keyframes monaco-findInput-highlight-dark-0 {\n\t0% { background: rgba(255, 255, 255, 0.44); }\n\t100% { background: transparent; }\n}\n@keyframes monaco-findInput-highlight-dark-1 {\n\t0% { background: rgba(255, 255, 255, 0.44); }\n\t/* Made intentionally different such that the CSS minifier does not collapse the two animations into a single one*/\n\t99% { background: transparent; }\n}\n",""]);const a=r},1684:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-count-badge {\n\tpadding: 3px 6px;\n\tborder-radius: 11px;\n\tfont-size: 11px;\n\tmin-width: 18px;\n\tmin-height: 18px;\n\tline-height: 11px;\n\tfont-weight: normal;\n\ttext-align: center;\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n}\n\n.monaco-count-badge.long {\n\tpadding: 2px 3px;\n\tborder-radius: 2px;\n\tmin-height: auto;\n\tline-height: normal;\n}\n",""]);const a=r},1727:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .codelens-decoration {\n\toverflow: hidden;\n\tdisplay: inline-flex !important; /* !important to override inline display:block style */\n\talign-items: center;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n\tcolor: var(--vscode-editorCodeLens-foreground);\n\tline-height: var(--vscode-editorCodeLens-lineHeight);\n\tfont-size: var(--vscode-editorCodeLens-fontSize);\n\tpadding-right: calc(var(--vscode-editorCodeLens-fontSize)*0.5);\n\tfont-feature-settings: var(--vscode-editorCodeLens-fontFeatureSettings);\n\tfont-family: var(--vscode-editorCodeLens-fontFamily), var(--vscode-editorCodeLens-fontFamilyDefault);\n}\n\n.monaco-editor .codelens-decoration > span,\n.monaco-editor .codelens-decoration > a {\n\tuser-select: none;\n\t-webkit-user-select: none;\n\twhite-space: nowrap;\n\tvertical-align: sub;\n\tdisplay: inline-flex;\n\talign-items: center;\n}\n\n.monaco-editor .codelens-decoration > a {\n\ttext-decoration: none;\n}\n\n.monaco-editor .codelens-decoration > a:hover {\n\tcursor: pointer;\n\tcolor: var(--vscode-editorLink-activeForeground) !important;\n}\n\n.monaco-editor .codelens-decoration > a:hover .codicon {\n\tcolor: var(--vscode-editorLink-activeForeground) !important;\n}\n\n.monaco-editor .codelens-decoration .codicon[class*='codicon-'] {\n\tvertical-align: middle;\n\tcolor: currentColor !important;\n\tcolor: var(--vscode-editorCodeLens-foreground);\n\tline-height: var(--vscode-editorCodeLens-lineHeight);\n\tfont-size: var(--vscode-editorCodeLens-fontSize);\n}\n\n\n.monaco-editor .codelens-decoration > a:hover .codicon::before {\n\tcursor: pointer;\n}\n\n@keyframes fadein {\n\t0% { opacity: 0;}\n\t100% { opacity: 1;}\n}\n\n.monaco-editor .codelens-decoration.fadein {\n\tanimation: fadein 0.1s linear;\n}\n",""]);const a=r},1788:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* marker zone */\n\n.monaco-editor .peekview-widget .head .peekview-title .severity-icon {\n\tdisplay: inline-block;\n\tvertical-align: text-top;\n\tmargin-right: 4px;\n}\n\n.monaco-editor .marker-widget {\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.monaco-editor .marker-widget > .stale {\n\topacity: 0.6;\n\tfont-style: italic;\n}\n\n.monaco-editor .marker-widget .title {\n\tdisplay: inline-block;\n\tpadding-right: 5px;\n}\n\n.monaco-editor .marker-widget .descriptioncontainer {\n\tposition: absolute;\n\twhite-space: pre;\n\tuser-select: text;\n\t-webkit-user-select: text;\n\tpadding: 8px 12px 0 20px;\n}\n\n.monaco-editor .marker-widget .descriptioncontainer .message {\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.monaco-editor .marker-widget .descriptioncontainer .message .details {\n\tpadding-left: 6px;\n}\n\n.monaco-editor .marker-widget .descriptioncontainer .message .source,\n.monaco-editor .marker-widget .descriptioncontainer .message span.code {\n\topacity: 0.6;\n}\n\n.monaco-editor .marker-widget .descriptioncontainer .message a.code-link {\n\topacity: 0.6;\n\tcolor: inherit;\n}\n\n.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:before {\n\tcontent: '(';\n}\n\n.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:after {\n\tcontent: ')';\n}\n\n.monaco-editor .marker-widget .descriptioncontainer .message a.code-link > span {\n\ttext-decoration: underline;\n\t/** Hack to force underline to show **/\n\tborder-bottom: 1px solid transparent;\n\ttext-underline-position: under;\n\tcolor: var(--vscode-textLink-activeForeground);\n}\n\n.monaco-editor .marker-widget .descriptioncontainer .filename {\n\tcursor: pointer;\n\tcolor: var(--vscode-textLink-activeForeground);\n}\n",""]);const a=r},1921:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .diff-hidden-lines-widget {\n\twidth: 100%;\n}\n\n.monaco-editor .diff-hidden-lines {\n\theight: 0px; /* The children each have a fixed height, the transform confuses the browser */\n\ttransform: translate(0px, -10px);\n\tfont-size: 13px;\n\tline-height: 14px;\n}\n\n.monaco-editor .diff-hidden-lines:not(.dragging) .top:hover,\n.monaco-editor .diff-hidden-lines:not(.dragging) .bottom:hover,\n.monaco-editor .diff-hidden-lines .top.dragging,\n.monaco-editor .diff-hidden-lines .bottom.dragging {\n\tbackground-color: var(--vscode-focusBorder);\n}\n\n.monaco-editor .diff-hidden-lines .top,\n.monaco-editor .diff-hidden-lines .bottom {\n\ttransition: background-color 0.1s ease-out;\n\theight: 4px;\n\tbackground-color: transparent;\n\tbackground-clip: padding-box;\n\tborder-bottom: 2px solid transparent;\n\tborder-top: 4px solid transparent;\n\t/*cursor: n-resize;*/\n}\n\n.monaco-editor.draggingUnchangedRegion.canMoveTop:not(.canMoveBottom) *,\n.monaco-editor .diff-hidden-lines .top.canMoveTop:not(.canMoveBottom),\n.monaco-editor .diff-hidden-lines .bottom.canMoveTop:not(.canMoveBottom) {\n\tcursor: n-resize !important;\n}\n\n.monaco-editor.draggingUnchangedRegion:not(.canMoveTop).canMoveBottom *,\n.monaco-editor .diff-hidden-lines .top:not(.canMoveTop).canMoveBottom,\n.monaco-editor .diff-hidden-lines .bottom:not(.canMoveTop).canMoveBottom {\n\tcursor: s-resize !important;\n}\n\n.monaco-editor.draggingUnchangedRegion.canMoveTop.canMoveBottom *,\n.monaco-editor .diff-hidden-lines .top.canMoveTop.canMoveBottom,\n.monaco-editor .diff-hidden-lines .bottom.canMoveTop.canMoveBottom {\n\tcursor: ns-resize !important;\n}\n\n.monaco-editor .diff-hidden-lines .top {\n\ttransform: translate(0px, 4px);\n}\n\n.monaco-editor .diff-hidden-lines .bottom {\n\ttransform: translate(0px, -6px);\n}\n\n.monaco-editor .diff-unchanged-lines {\n\tbackground: var(--vscode-diffEditor-unchangedCodeBackground);\n}\n\n.monaco-editor .noModificationsOverlay {\n\tz-index: 1;\n\tbackground: var(--vscode-editor-background);\n\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n}\n\n\n.monaco-editor .diff-hidden-lines .center {\n\tbackground: var(--vscode-diffEditor-unchangedRegionBackground);\n\tcolor: var(--vscode-diffEditor-unchangedRegionForeground);\n\toverflow: hidden;\n\tdisplay: block;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n\n\theight: 24px;\n\tbox-shadow: inset 0 -5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow), inset 0 5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow);\n}\n\n.monaco-editor .diff-hidden-lines .center span.codicon {\n\tvertical-align: middle;\n}\n\n.monaco-editor .diff-hidden-lines .center a:hover .codicon {\n\tcursor: pointer;\n\tcolor: var(--vscode-editorLink-activeForeground) !important;\n}\n\n.monaco-editor .diff-hidden-lines div.breadcrumb-item {\n\tcursor: pointer;\n}\n\n.monaco-editor .diff-hidden-lines div.breadcrumb-item:hover {\n\tcolor: var(--vscode-editorLink-activeForeground);\n}\n\n.monaco-editor .movedOriginal {\n\tborder: 2px solid var(--vscode-diffEditor-move-border);\n}\n\n.monaco-editor .movedModified {\n\tborder: 2px solid var(--vscode-diffEditor-move-border);\n}\n\n.monaco-editor .movedOriginal.currentMove, .monaco-editor .movedModified.currentMove {\n\tborder: 2px solid var(--vscode-diffEditor-moveActive-border);\n}\n\n.monaco-diff-editor .moved-blocks-lines path.currentMove {\n\tstroke: var(--vscode-diffEditor-moveActive-border);\n}\n\n.monaco-diff-editor .moved-blocks-lines path {\n\tpointer-events: visiblestroke;\n}\n\n.monaco-diff-editor .moved-blocks-lines .arrow {\n\tfill: var(--vscode-diffEditor-move-border);\n}\n\n.monaco-diff-editor .moved-blocks-lines .arrow.currentMove {\n\tfill: var(--vscode-diffEditor-moveActive-border);\n}\n\n.monaco-diff-editor .moved-blocks-lines .arrow-rectangle {\n\tfill: var(--vscode-editor-background);\n}\n\n.monaco-diff-editor .moved-blocks-lines {\n\tposition: absolute;\n\tpointer-events: none;\n}\n\n.monaco-diff-editor .moved-blocks-lines path {\n\tfill: none;\n\tstroke: var(--vscode-diffEditor-move-border);\n\tstroke-width: 2;\n}\n\n.monaco-editor .char-delete.diff-range-empty {\n\tmargin-left: -1px;\n\tborder-left: solid var(--vscode-diffEditor-removedTextBackground) 3px;\n}\n\n.monaco-editor .char-insert.diff-range-empty {\n\tborder-left: solid var(--vscode-diffEditor-insertedTextBackground) 3px;\n}\n\n.monaco-editor .fold-unchanged {\n\tcursor: pointer;\n}\n\n.monaco-diff-editor .diff-moved-code-block {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\tmargin-top: -4px;\n}\n\n.monaco-diff-editor .diff-moved-code-block .action-bar .action-label.codicon {\n\twidth: 12px;\n\theight: 12px;\n\tfont-size: 12px;\n}\n\n/* ---------- DiffEditor ---------- */\n\n.monaco-diff-editor .diffOverview {\n\tz-index: 9;\n}\n\n.monaco-diff-editor .diffOverview .diffViewport {\n\tz-index: 10;\n}\n\n/* colors not externalized: using transparancy on background */\n.monaco-diff-editor.vs\t\t\t.diffOverview { background: rgba(0, 0, 0, 0.03); }\n.monaco-diff-editor.vs-dark\t\t.diffOverview { background: rgba(255, 255, 255, 0.01); }\n\n.monaco-scrollable-element.modified-in-monaco-diff-editor.vs\t\t.scrollbar { background: rgba(0,0,0,0); }\n.monaco-scrollable-element.modified-in-monaco-diff-editor.vs-dark\t.scrollbar { background: rgba(0,0,0,0); }\n.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-black\t.scrollbar { background: none; }\n.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-light\t.scrollbar { background: none; }\n\n.monaco-scrollable-element.modified-in-monaco-diff-editor .slider {\n\tz-index: 10;\n}\n.modified-in-monaco-diff-editor\t\t\t\t.slider.active { background: rgba(171, 171, 171, .4); }\n.modified-in-monaco-diff-editor.hc-black\t.slider.active { background: none; }\n.modified-in-monaco-diff-editor.hc-light\t.slider.active { background: none; }\n\n/* ---------- Diff ---------- */\n\n.monaco-editor .insert-sign,\n.monaco-diff-editor .insert-sign,\n.monaco-editor .delete-sign,\n.monaco-diff-editor .delete-sign {\n\tfont-size: 11px !important;\n\topacity: 0.7 !important;\n\tdisplay: flex !important;\n\talign-items: center;\n}\n.monaco-editor.hc-black .insert-sign,\n.monaco-diff-editor.hc-black .insert-sign,\n.monaco-editor.hc-black .delete-sign,\n.monaco-diff-editor.hc-black .delete-sign,\n.monaco-editor.hc-light .insert-sign,\n.monaco-diff-editor.hc-light .insert-sign,\n.monaco-editor.hc-light .delete-sign,\n.monaco-diff-editor.hc-light .delete-sign {\n\topacity: 1;\n}\n\n.monaco-editor .inline-deleted-margin-view-zone {\n\ttext-align: right;\n}\n.monaco-editor .inline-added-margin-view-zone {\n\ttext-align: right;\n}\n\n.monaco-editor .arrow-revert-change {\n\tz-index: 10;\n\tposition: absolute;\n}\n\n.monaco-editor .arrow-revert-change:hover {\n\tcursor: pointer;\n}\n\n/* ---------- Inline Diff ---------- */\n\n.monaco-editor .view-zones .view-lines .view-line span {\n\tdisplay: inline-block;\n}\n\n.monaco-editor .margin-view-zones .lightbulb-glyph:hover {\n\tcursor: pointer;\n}\n\n.monaco-editor .char-insert, .monaco-diff-editor .char-insert {\n\tbackground-color: var(--vscode-diffEditor-insertedTextBackground);\n}\n\n.monaco-editor .line-insert, .monaco-diff-editor .line-insert {\n\tbackground-color: var(--vscode-diffEditor-insertedLineBackground, var(--vscode-diffEditor-insertedTextBackground));\n}\n\n.monaco-editor .line-insert,\n.monaco-editor .char-insert {\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-diffEditor-insertedTextBorder);\n}\n.monaco-editor.hc-black .line-insert, .monaco-editor.hc-light .line-insert,\n.monaco-editor.hc-black .char-insert, .monaco-editor.hc-light .char-insert {\n\tborder-style: dashed;\n}\n\n.monaco-editor .line-delete,\n.monaco-editor .char-delete {\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-diffEditor-removedTextBorder);\n}\n.monaco-editor.hc-black .line-delete, .monaco-editor.hc-light .line-delete,\n.monaco-editor.hc-black .char-delete, .monaco-editor.hc-light .char-delete {\n\tborder-style: dashed;\n}\n\n.monaco-editor .inline-added-margin-view-zone,\n.monaco-editor .gutter-insert, .monaco-diff-editor .gutter-insert {\n\tbackground-color: var(--vscode-diffEditorGutter-insertedLineBackground, var(--vscode-diffEditor-insertedLineBackground), var(--vscode-diffEditor-insertedTextBackground));\n}\n\n.monaco-editor .char-delete, .monaco-diff-editor .char-delete, .monaco-editor .inline-deleted-text {\n\tbackground-color: var(--vscode-diffEditor-removedTextBackground);\n}\n\n.monaco-editor .inline-deleted-text {\n\ttext-decoration: line-through;\n}\n\n.monaco-editor .line-delete, .monaco-diff-editor .line-delete {\n\tbackground-color: var(--vscode-diffEditor-removedLineBackground, var(--vscode-diffEditor-removedTextBackground));\n}\n\n.monaco-editor .inline-deleted-margin-view-zone,\n.monaco-editor .gutter-delete, .monaco-diff-editor .gutter-delete {\n\tbackground-color: var(--vscode-diffEditorGutter-removedLineBackground, var(--vscode-diffEditor-removedLineBackground), var(--vscode-diffEditor-removedTextBackground));\n}\n\n.monaco-diff-editor.side-by-side .editor.modified {\n\tbox-shadow: -6px 0 5px -5px var(--vscode-scrollbar-shadow);\n\tborder-left: 1px solid var(--vscode-diffEditor-border);\n}\n\n.monaco-diff-editor.side-by-side .editor.original {\n\tbox-shadow: 6px 0 5px -5px var(--vscode-scrollbar-shadow);\n\tborder-right: 1px solid var(--vscode-diffEditor-border);\n}\n\n.monaco-diff-editor .diffViewport {\n\tbackground: var(--vscode-scrollbarSlider-background);\n}\n\n.monaco-diff-editor .diffViewport:hover {\n\tbackground: var(--vscode-scrollbarSlider-hoverBackground);\n}\n\n.monaco-diff-editor .diffViewport:active {\n\tbackground: var(--vscode-scrollbarSlider-activeBackground);\n}\n\n.monaco-editor .diagonal-fill {\n\tbackground-image: linear-gradient(\n\t\t-45deg,\n\t\tvar(--vscode-diffEditor-diagonalFill) 12.5%,\n\t\t#0000 12.5%, #0000 50%,\n\t\tvar(--vscode-diffEditor-diagonalFill) 50%, var(--vscode-diffEditor-diagonalFill) 62.5%,\n\t\t#0000 62.5%, #0000 100%\n\t);\n\tbackground-size: 8px 8px;\n}\n\n.monaco-diff-editor .gutter {\n\tposition: relative;\n\toverflow: hidden;\n\tflex-shrink: 0;\n\tflex-grow: 0;\n\n\t& > div {\n\t\tposition: absolute;\n\t}\n\n\t.gutterItem {\n\t\topacity: 0;\n\t\ttransition: opacity 0.7s;\n\n\t\t&.showAlways {\n\t\t\topacity: 1;\n\t\t\ttransition: none;\n\t\t}\n\n\t\t&.noTransition {\n\t\t\ttransition: none;\n\t\t}\n\t}\n\n\t&:hover .gutterItem {\n\t\topacity: 1;\n\t\ttransition: opacity 0.1s ease-in-out;\n\t}\n\n\t.gutterItem {\n\t\t.background {\n\t\t\tposition: absolute;\n\t\t\theight: 100%;\n\t\t\tleft: 50%;\n\t\t\twidth: 1px;\n\n\t\t\tborder-left: 2px var(--vscode-menu-separatorBackground) solid;\n\t\t}\n\n\t\t.buttons {\n\t\t\tposition: absolute;\n\t\t\t/*height: 100%;*/\n\t\t\twidth: 100%;\n\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: center;\n\t\t\talign-items: center;\n\n\t\t\t.monaco-toolbar {\n\t\t\t\theight: fit-content;\n\t\t\t\t.monaco-action-bar {\n\t\t\t\t\tline-height: 1;\n\n\t\t\t\t\t.actions-container {\n\t\t\t\t\t\twidth: fit-content;\n\t\t\t\t\t\tborder-radius: 4px;\n\t\t\t\t\t\tbackground: var(--vscode-editorGutter-itemBackground);\n\n\t\t\t\t\t\t.action-item {\n\t\t\t\t\t\t\t&:hover {\n\t\t\t\t\t\t\t\tbackground: var(--vscode-toolbar-hoverBackground);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t.action-label {\n\t\t\t\t\t\t\t\tcolor: var(--vscode-editorGutter-itemGlyphForeground);\n\t\t\t\t\t\t\t\tpadding: 1px 2px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n.monaco-diff-editor .diff-hidden-lines-compact {\n\tdisplay: flex;\n\theight: 11px;\n\t.line-left, .line-right {\n\t\theight: 1px;\n\t\tborder-top: 1px solid;\n\t\tborder-color: var(--vscode-editorCodeLens-foreground);\n\t\topacity: 0.5;\n\t\tmargin: auto;\n\t\twidth: 100%;\n\t}\n\n\t.line-left {\n\t\twidth: 20px;\n\t}\n\n\t.text {\n\t\tcolor: var(--vscode-editorCodeLens-foreground);\n\t\ttext-wrap: nowrap;\n\t\tfont-size: 11px;\n\t\tline-height: 11px;\n\t\tmargin: 0 4px;\n\t}\n}\n",""]);const a=r},1937:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-tl-row {\n\tdisplay: flex;\n\theight: 100%;\n\talign-items: center;\n\tposition: relative;\n}\n\n.monaco-tl-row.disabled {\n\tcursor: default;\n}\n.monaco-tl-indent {\n\theight: 100%;\n\tposition: absolute;\n\ttop: 0;\n\tleft: 16px;\n\tpointer-events: none;\n}\n\n.hide-arrows .monaco-tl-indent {\n\tleft: 12px;\n}\n\n.monaco-tl-indent > .indent-guide {\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n\theight: 100%;\n\tborder-left: 1px solid transparent;\n}\n\n.monaco-tl-indent > .indent-guide {\n\ttransition: border-color 0.1s linear;\n}\n\n.monaco-tl-twistie,\n.monaco-tl-contents {\n\theight: 100%;\n}\n\n.monaco-tl-twistie {\n\tfont-size: 10px;\n\ttext-align: right;\n\tpadding-right: 6px;\n\tflex-shrink: 0;\n\twidth: 16px;\n\tdisplay: flex !important;\n\talign-items: center;\n\tjustify-content: center;\n\ttransform: translateX(3px);\n}\n\n.monaco-tl-contents {\n\tflex: 1;\n\toverflow: hidden;\n}\n\n.monaco-tl-twistie::before {\n\tborder-radius: 20px;\n}\n\n.monaco-tl-twistie.collapsed::before {\n\ttransform: rotate(-90deg);\n}\n\n.monaco-tl-twistie.codicon-tree-item-loading::before {\n\t/* Use steps to throttle FPS to reduce CPU usage */\n\tanimation: codicon-spin 1.25s steps(30) infinite;\n}\n\n.monaco-tree-type-filter {\n\tposition: absolute;\n\ttop: 0;\n\tdisplay: flex;\n\tpadding: 3px;\n\ttransition: top 0.3s;\n\tmax-width: 200px;\n\tz-index: 100;\n\tmargin: 0 6px;\n}\n\n.monaco-tree-type-filter.disabled {\n\ttop: -40px !important;\n}\n\n.monaco-tree-type-filter-grab {\n\tdisplay: flex !important;\n\talign-items: center;\n\tjustify-content: center;\n\tcursor: grab;\n\tmargin-right: 2px;\n}\n\n.monaco-tree-type-filter-grab.grabbing {\n\tcursor: grabbing;\n}\n\n.monaco-tree-type-filter-input {\n\tflex: 1;\n}\n\n.monaco-tree-type-filter-input .monaco-inputbox {\n\theight: 23px;\n}\n\n.monaco-tree-type-filter-input .monaco-inputbox > .ibwrapper > .input,\n.monaco-tree-type-filter-input .monaco-inputbox > .ibwrapper > .mirror {\n\tpadding: 2px 4px;\n}\n\n.monaco-tree-type-filter-input .monaco-findInput > .controls {\n\ttop: 2px;\n}\n\n.monaco-tree-type-filter-actionbar {\n\tmargin-left: 4px;\n}\n\n.monaco-tree-type-filter-actionbar .monaco-action-bar .action-label {\n\tpadding: 2px;\n}\n",""]);const a=r},1962:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* Arrows */\n.monaco-scrollable-element > .scrollbar > .scra {\n\tcursor: pointer;\n\tfont-size: 11px !important;\n}\n\n.monaco-scrollable-element > .visible {\n\topacity: 1;\n\n\t/* Background rule added for IE9 - to allow clicks on dom node */\n\tbackground:rgba(0,0,0,0);\n\n\ttransition: opacity 100ms linear;\n}\n.monaco-scrollable-element > .invisible {\n\topacity: 0;\n\tpointer-events: none;\n}\n.monaco-scrollable-element > .invisible.fade {\n\ttransition: opacity 800ms linear;\n}\n\n/* Scrollable Content Inset Shadow */\n.monaco-scrollable-element > .shadow {\n\tposition: absolute;\n\tdisplay: none;\n}\n.monaco-scrollable-element > .shadow.top {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 3px;\n\theight: 3px;\n\twidth: 100%;\n\tbox-shadow: var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset;\n}\n.monaco-scrollable-element > .shadow.left {\n\tdisplay: block;\n\ttop: 3px;\n\tleft: 0;\n\theight: 100%;\n\twidth: 3px;\n\tbox-shadow: var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset;\n}\n.monaco-scrollable-element > .shadow.top-left-corner {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 0;\n\theight: 3px;\n\twidth: 3px;\n}\n.monaco-scrollable-element > .shadow.top.left {\n\tbox-shadow: var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset;\n}\n\n.monaco-scrollable-element > .scrollbar > .slider {\n\tbackground: var(--vscode-scrollbarSlider-background);\n}\n\n.monaco-scrollable-element > .scrollbar > .slider:hover {\n\tbackground: var(--vscode-scrollbarSlider-hoverBackground);\n}\n\n.monaco-scrollable-element > .scrollbar > .slider.active {\n\tbackground: var(--vscode-scrollbarSlider-activeBackground);\n}\n",""]);const a=r},1963:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,'/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-tl-row {\n\tdisplay: flex;\n\theight: 100%;\n\talign-items: center;\n\tposition: relative;\n}\n\n.monaco-tl-row.disabled {\n\tcursor: default;\n}\n.monaco-tl-indent {\n\theight: 100%;\n\tposition: absolute;\n\ttop: 0;\n\tleft: 16px;\n\tpointer-events: none;\n}\n\n.hide-arrows .monaco-tl-indent {\n\tleft: 12px;\n}\n\n.monaco-tl-indent > .indent-guide {\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n\theight: 100%;\n\tborder-left: 1px solid transparent;\n\topacity: 0;\n}\n\n.monaco-workbench:not(.reduce-motion) .monaco-tl-indent > .indent-guide {\n\ttransition: opacity 0.1s linear;\n}\n\n.monaco-tl-twistie,\n.monaco-tl-contents {\n\theight: 100%;\n}\n\n.monaco-tl-twistie {\n\tfont-size: 10px;\n\ttext-align: right;\n\tpadding-right: 6px;\n\tflex-shrink: 0;\n\twidth: 16px;\n\tdisplay: flex !important;\n\talign-items: center;\n\tjustify-content: center;\n\ttransform: translateX(3px);\n}\n\n.monaco-tl-contents {\n\tflex: 1;\n\toverflow: hidden;\n}\n\n.monaco-tl-twistie::before {\n\tborder-radius: 20px;\n}\n\n.monaco-tl-twistie.collapsed::before {\n\ttransform: rotate(-90deg);\n}\n\n.monaco-tl-twistie.codicon-tree-item-loading::before {\n\t/* Use steps to throttle FPS to reduce CPU usage */\n\tanimation: codicon-spin 1.25s steps(30) infinite;\n}\n\n.monaco-tree-type-filter {\n\tposition: absolute;\n\ttop: 0;\n\tright: 0;\n\tdisplay: flex;\n\tpadding: 3px;\n\tmax-width: 200px;\n\tz-index: 100;\n\tmargin: 0 10px 0 6px;\n\tborder: 1px solid var(--vscode-widget-border);\n\tborder-bottom-left-radius: 4px;\n\tborder-bottom-right-radius: 4px;\n}\n\n.monaco-workbench:not(.reduce-motion) .monaco-tree-type-filter {\n\ttransition: top 0.3s;\n}\n\n.monaco-tree-type-filter.disabled {\n\ttop: -40px !important;\n}\n\n.monaco-tree-type-filter-input {\n\tflex: 1;\n}\n\n.monaco-tree-type-filter-input .monaco-inputbox {\n\theight: 23px;\n}\n\n.monaco-tree-type-filter-input .monaco-inputbox > .ibwrapper > .input,\n.monaco-tree-type-filter-input .monaco-inputbox > .ibwrapper > .mirror {\n\tpadding: 2px 4px;\n}\n\n.monaco-tree-type-filter-input .monaco-findInput > .controls {\n\ttop: 2px;\n}\n\n.monaco-tree-type-filter-actionbar {\n\tmargin-left: 4px;\n}\n\n.monaco-tree-type-filter-actionbar .monaco-action-bar .action-label {\n\tpadding: 2px;\n}\n\n.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container{\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 0;\n\tz-index: 13; /* Settings editor uses z-index: 12 */\n\n\t/* Backup color in case the tree does not provide the background color */\n\tbackground-color: var(--vscode-sideBar-background);\n}\n\n.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row.monaco-list-row{\n\tposition: absolute;\n\twidth: 100%;\n\topacity: 1 !important; /* Settings editor uses opacity < 1 */\n\toverflow: hidden;\n\n\t/* Backup color in case the tree does not provide the background color */\n\tbackground-color: var(--vscode-sideBar-background);\n}\n\n.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row:hover{\n\tbackground-color: var(--vscode-list-hoverBackground) !important;\n\tcursor: pointer;\n}\n\n.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container.empty,\n.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container.empty .monaco-tree-sticky-container-shadow {\n\tdisplay: none;\n}\n\n.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow {\n\tposition: absolute;\n\tbottom: -3px;\n\tleft: 0px;\n\theight: 0px; /* heigt is 3px and only set when there is a treeStickyScrollShadow color */\n\twidth: 100%;\n}\n\n.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container[tabindex="0"]:focus{\n\toutline: none;\n}\n',""]);const a=r},1968:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-keybinding {\n\tdisplay: flex;\n\talign-items: center;\n\tline-height: 10px;\n}\n\n.monaco-keybinding > .monaco-keybinding-key {\n\tdisplay: inline-block;\n\tborder-style: solid;\n\tborder-width: 1px;\n\tborder-radius: 3px;\n\tvertical-align: middle;\n\tfont-size: 11px;\n\tpadding: 3px 5px;\n\tmargin: 0 2px;\n}\n\n.monaco-keybinding > .monaco-keybinding-key:first-child {\n\tmargin-left: 0;\n}\n\n.monaco-keybinding > .monaco-keybinding-key:last-child {\n\tmargin-right: 0;\n}\n\n.monaco-keybinding > .monaco-keybinding-key-separator {\n\tdisplay: inline-block;\n}\n\n.monaco-keybinding > .monaco-keybinding-key-chord-separator {\n\twidth: 6px;\n}\n",""]);const a=r},2035:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .blockDecorations-container {\n\tposition: absolute;\n\ttop: 0;\n\tpointer-events: none;\n}\n\n.monaco-editor .blockDecorations-block {\n\tposition: absolute;\n\tbox-sizing: border-box;\n}\n",""]);const a=r},2124:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-progress-container {\n\twidth: 100%;\n\theight: 5px;\n\toverflow: hidden; /* keep progress bit in bounds */\n}\n\n.monaco-progress-container .progress-bit {\n\twidth: 2%;\n\theight: 5px;\n\tposition: absolute;\n\tleft: 0;\n\tdisplay: none;\n}\n\n.monaco-progress-container.active .progress-bit {\n\tdisplay: inherit;\n}\n\n.monaco-progress-container.discrete .progress-bit {\n\tleft: 0;\n\ttransition: width 100ms linear;\n}\n\n.monaco-progress-container.discrete.done .progress-bit {\n\twidth: 100%;\n}\n\n.monaco-progress-container.infinite .progress-bit {\n\tanimation-name: progress;\n\tanimation-duration: 4s;\n\tanimation-iteration-count: infinite;\n\ttransform: translate3d(0px, 0px, 0px);\n\tanimation-timing-function: linear;\n}\n\n.monaco-progress-container.infinite.infinite-long-running .progress-bit {\n\t/*\n\t\tThe more smooth `linear` timing function can cause\n\t\thigher GPU consumption as indicated in\n\t\thttps://github.com/microsoft/vscode/issues/97900 &\n\t\thttps://github.com/microsoft/vscode/issues/138396\n\t*/\n\tanimation-timing-function: steps(100);\n}\n\n/**\n * The progress bit has a width: 2% (1/50) of the parent container. The animation moves it from 0% to 100% of\n * that container. Since translateX is relative to the progress bit size, we have to multiple it with\n * its relative size to the parent container:\n * parent width: 5000%\n * bit width: 100%\n * translateX should be as follow:\n * 50%: 5000% * 50% - 50% (set to center) = 2450%\n * 100%: 5000% * 100% - 100% (do not overflow) = 4900%\n */\n@keyframes progress { from { transform: translateX(0%) scaleX(1) } 50% { transform: translateX(2500%) scaleX(3) } to { transform: translateX(4900%) scaleX(1) } }\n",""]);const a=r},2171:(e,t,i)=>{i.d(t,{A:()=>u});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s),a=i(4417),l=i.n(a),d=new URL(i(6499),i.b),h=r()(o()),c=l()(d);h.push([e.id,`/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n@font-face {\n\tfont-family: "codicon";\n\tfont-display: block;\n\tsrc: url(${c}) format("truetype");\n}\n\n.codicon[class*='codicon-'] {\n\tfont: normal normal normal 16px/1 codicon;\n\tdisplay: inline-block;\n\ttext-decoration: none;\n\ttext-rendering: auto;\n\ttext-align: center;\n\ttext-transform: none;\n\t-webkit-font-smoothing: antialiased;\n\t-moz-osx-font-smoothing: grayscale;\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n/* icon rules are dynamically created by the platform theme service (see iconsStyleSheet.ts) */\n`,""]);const u=h},2180:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-diff-editor .diff-review {\n\tposition: absolute;\n\n}\n\n.monaco-component.diff-review {\n\tuser-select: none;\n\t-webkit-user-select: none;\n\tz-index: 99;\n\n\n\t.diff-review-line-number {\n\t\ttext-align: right;\n\t\tdisplay: inline-block;\n\t\tcolor: var(--vscode-editorLineNumber-foreground);\n\t}\n\n\t.diff-review-summary {\n\t\tpadding-left: 10px;\n\t}\n\n\t.diff-review-shadow {\n\t\tposition: absolute;\n\t\tbox-shadow: var(--vscode-scrollbar-shadow) 0 -6px 6px -6px inset;\n\t}\n\n\t.diff-review-row {\n\t\twhite-space: pre;\n\t}\n\n\t.diff-review-table {\n\t\tdisplay: table;\n\t\tmin-width: 100%;\n\t}\n\n\t.diff-review-row {\n\t\tdisplay: table-row;\n\t\twidth: 100%;\n\t}\n\n\t.diff-review-spacer {\n\t\tdisplay: inline-block;\n\t\twidth: 10px;\n\t\tvertical-align: middle;\n\t}\n\n\t.diff-review-spacer > .codicon {\n\t\tfont-size: 9px !important;\n\t}\n\n\t.diff-review-actions {\n\t\tdisplay: inline-block;\n\t\tposition: absolute;\n\t\tright: 10px;\n\t\ttop: 2px;\n\t\tz-index: 100;\n\t}\n\n\t.diff-review-actions .action-label {\n\t\twidth: 16px;\n\t\theight: 16px;\n\t\tmargin: 2px 0;\n\t}\n\n\t.revertButton {\n\t\tcursor: pointer;\n\t}\n\n\t.action-label {\n\t\tbackground: var(--vscode-editorActionList-background);\n\t}\n}\n",""]);const a=r},2289:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n.monaco-editor .cursors-layer {\n\tposition: absolute;\n\ttop: 0;\n}\n\n.monaco-editor .cursors-layer > .cursor {\n\tposition: absolute;\n\toverflow: hidden;\n\tbox-sizing: border-box;\n}\n\n/* -- smooth-caret-animation -- */\n.monaco-editor .cursors-layer.cursor-smooth-caret-animation > .cursor {\n\ttransition: all 80ms;\n}\n\n/* -- block-outline-style -- */\n.monaco-editor .cursors-layer.cursor-block-outline-style > .cursor {\n\tbackground: transparent !important;\n\tborder-style: solid;\n\tborder-width: 1px;\n}\n\n/* -- underline-style -- */\n.monaco-editor .cursors-layer.cursor-underline-style > .cursor {\n\tborder-bottom-width: 2px;\n\tborder-bottom-style: solid;\n\tbackground: transparent !important;\n}\n\n/* -- underline-thin-style -- */\n.monaco-editor .cursors-layer.cursor-underline-thin-style > .cursor {\n\tborder-bottom-width: 1px;\n\tborder-bottom-style: solid;\n\tbackground: transparent !important;\n}\n\n@keyframes monaco-cursor-smooth {\n\t0%,\n\t20% {\n\t\topacity: 1;\n\t}\n\t60%,\n\t100% {\n\t\topacity: 0;\n\t}\n}\n\n@keyframes monaco-cursor-phase {\n\t0%,\n\t20% {\n\t\topacity: 1;\n\t}\n\t90%,\n\t100% {\n\t\topacity: 0;\n\t}\n}\n\n@keyframes monaco-cursor-expand {\n\t0%,\n\t20% {\n\t\ttransform: scaleY(1);\n\t}\n\t80%,\n\t100% {\n\t\ttransform: scaleY(0);\n\t}\n}\n\n.cursor-smooth {\n\tanimation: monaco-cursor-smooth 0.5s ease-in-out 0s 20 alternate;\n}\n\n.cursor-phase {\n\tanimation: monaco-cursor-phase 0.5s ease-in-out 0s 20 alternate;\n}\n\n.cursor-expand > .cursor {\n\tanimation: monaco-cursor-expand 0.5s ease-in-out 0s 20 alternate;\n}\n",""]);const a=r},2460:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-split-view2 {\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n}\n\n.monaco-split-view2 > .sash-container {\n\tposition: absolute;\n\twidth: 100%;\n\theight: 100%;\n\tpointer-events: none;\n}\n\n.monaco-split-view2 > .sash-container > .monaco-sash {\n\tpointer-events: initial;\n}\n\n.monaco-split-view2 > .monaco-scrollable-element {\n\twidth: 100%;\n\theight: 100%;\n}\n\n.monaco-split-view2 > .monaco-scrollable-element > .split-view-container {\n\twidth: 100%;\n\theight: 100%;\n\twhite-space: nowrap;\n\tposition: relative;\n}\n\n.monaco-split-view2 > .monaco-scrollable-element > .split-view-container > .split-view-view {\n\twhite-space: initial;\n\tposition: absolute;\n}\n\n.monaco-split-view2 > .monaco-scrollable-element > .split-view-container > .split-view-view:not(.visible) {\n\tdisplay: none;\n}\n\n.monaco-split-view2.vertical > .monaco-scrollable-element > .split-view-container > .split-view-view {\n\twidth: 100%;\n}\n\n.monaco-split-view2.horizontal > .monaco-scrollable-element > .split-view-container > .split-view-view {\n\theight: 100%;\n}\n\n.monaco-split-view2.separator-border > .monaco-scrollable-element > .split-view-container > .split-view-view:not(:first-child)::before {\n\tcontent: ' ';\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tz-index: 20;\n\tpointer-events: none;\n\tbackground-color: var(--separator-border);\n}\n\n.monaco-split-view2.separator-border.horizontal > .monaco-scrollable-element > .split-view-container > .split-view-view:not(:first-child)::before {\n\theight: 100%;\n\twidth: 1px;\n}\n\n.monaco-split-view2.separator-border.vertical > .monaco-scrollable-element > .split-view-container > .split-view-view:not(:first-child)::before {\n\theight: 1px;\n\twidth: 100%;\n}\n",""]);const a=r},2516:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-custom-toggle {\n\tmargin-left: 2px;\n\tfloat: left;\n\tcursor: pointer;\n\toverflow: hidden;\n\twidth: 20px;\n\theight: 20px;\n\tborder-radius: 3px;\n\tborder: 1px solid transparent;\n\tpadding: 1px;\n\tbox-sizing:\tborder-box;\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.monaco-custom-toggle:hover {\n\tbackground-color: var(--vscode-inputOption-hoverBackground);\n}\n\n.hc-black .monaco-custom-toggle:hover,\n.hc-light .monaco-custom-toggle:hover {\n\tborder: 1px dashed var(--vscode-focusBorder);\n}\n\n.hc-black .monaco-custom-toggle,\n.hc-light .monaco-custom-toggle {\n\tbackground: none;\n}\n\n.hc-black .monaco-custom-toggle:hover,\n.hc-light .monaco-custom-toggle:hover {\n\tbackground: none;\n}\n\n.monaco-custom-toggle.monaco-checkbox {\n\theight: 18px;\n\twidth: 18px;\n\tborder: 1px solid transparent;\n\tborder-radius: 3px;\n\tmargin-right: 9px;\n\tmargin-left: 0px;\n\tpadding: 0px;\n\topacity: 1;\n\tbackground-size: 16px !important;\n}\n\n.monaco-action-bar .checkbox-action-item {\n\tdisplay: flex;\n\talign-items: center;\n\tborder-radius: 2px;\n\tpadding-right: 2px;\n}\n\n.monaco-action-bar .checkbox-action-item:hover {\n\tbackground-color: var(--vscode-toolbar-hoverBackground);\n}\n\n.monaco-action-bar .checkbox-action-item > .monaco-custom-toggle.monaco-checkbox {\n\tmargin-right: 4px;\n}\n\n.monaco-action-bar .checkbox-action-item > .checkbox-label {\n\tfont-size: 12px;\n}\n",""]);const a=r},2561:e=>{e.exports='data:image/svg+xml;utf8,%3Csvg viewBox="0 0 24 24" display="inline-block" height="1em" width="1em" vertical-align="text-bottom" xmlns="http://www.w3.org/2000/svg" %3E%3Cpath fill="currentColor" d="M12 3.7c4.6 0 8.3 3.7 8.3 8.3s-3.7 8.3-8.3 8.3-8.3-3.7-8.3-8.3S7.4 3.7 12 3.7z"/%3E%3C/svg%3E'},2699:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .native-edit-context {\n\tmargin: 0;\n\tpadding: 0;\n\tposition: absolute;\n\toverflow-y: scroll;\n\tscrollbar-width: none;\n\tz-index: -10;\n\twhite-space: pre-wrap;\n}\n\n.monaco-editor .ime-text-area {\n\tmin-width: 0;\n\tmin-height: 0;\n\tmargin: 0;\n\tpadding: 0;\n\tposition: absolute;\n\toutline: none !important;\n\tresize: none;\n\tborder: none;\n\toverflow: hidden;\n\tcolor: transparent;\n\tbackground-color: transparent;\n\tz-index: -10;\n}\n\n.monaco-editor .edit-context-composition-none {\n\tbackground-color: transparent;\n\tborder-bottom: none;\n}\n\n.monaco-editor :not(.hc-black, .hc-light) .edit-context-composition-secondary {\n\tborder-bottom: 1px solid var(--vscode-editor-compositionBorder);\n}\n\n.monaco-editor :not(.hc-black, .hc-light) .edit-context-composition-primary {\n\tborder-bottom: 2px solid var(--vscode-editor-compositionBorder);\n}\n\n.monaco-editor :is(.hc-black, .hc-light) .edit-context-composition-secondary {\n\tborder: 1px solid var(--vscode-editor-compositionBorder);\n}\n\n.monaco-editor :is(.hc-black, .hc-light) .edit-context-composition-primary {\n\tborder: 2px solid var(--vscode-editor-compositionBorder);\n}\n",""]);const a=r},2755:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .selection-anchor {\n\tbackground-color: #007ACC;\n\twidth: 2px !important;\n}\n",""]);const a=r},2829:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-action-bar .action-item.menu-entry .action-label.icon {\n\twidth: 16px;\n\theight: 16px;\n\tbackground-repeat: no-repeat;\n\tbackground-position: 50%;\n\tbackground-size: 16px;\n}\n\n.monaco-dropdown-with-default {\n\tdisplay: flex !important;\n\tflex-direction: row;\n\tborder-radius: 5px;\n}\n\n.monaco-dropdown-with-default > .action-container > .action-label {\n\tmargin-right: 0;\n}\n\n.monaco-dropdown-with-default > .action-container.menu-entry > .action-label.icon {\n\twidth: 16px;\n\theight: 16px;\n\tbackground-repeat: no-repeat;\n\tbackground-position: 50%;\n\tbackground-size: 16px;\n}\n\n.monaco-dropdown-with-default > .dropdown-action-container > .monaco-dropdown > .dropdown-label .codicon[class*='codicon-'] {\n\tfont-size: 12px;\n\tpadding-left: 0px;\n\tpadding-right: 0px;\n\tline-height: 16px;\n\tmargin-left: -3px;\n}\n\n.monaco-dropdown-with-default > .dropdown-action-container > .monaco-dropdown > .dropdown-label > .action-label {\n\tdisplay: block;\n\tbackground-size: 16px;\n\tbackground-position: center center;\n\tbackground-repeat: no-repeat;\n}\n",""]);const a=r},2889:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n.monaco-editor .zone-widget {\n\tposition: absolute;\n\tz-index: 10;\n}\n\n\n.monaco-editor .zone-widget .zone-widget-container {\n\tborder-top-style: solid;\n\tborder-bottom-style: solid;\n\tborder-top-width: 0;\n\tborder-bottom-width: 0;\n\tposition: relative;\n}\n",""]);const a=r},2931:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .tokens-inspect-widget {\n\tz-index: 50;\n\tuser-select: text;\n\t-webkit-user-select: text;\n\tpadding: 10px;\n\tcolor: var(--vscode-editorHoverWidget-foreground);\n\tbackground-color: var(--vscode-editorHoverWidget-background);\n\tborder: 1px solid var(--vscode-editorHoverWidget-border);\n}\n.monaco-editor.hc-black .tokens-inspect-widget, .monaco-editor.hc-light .tokens-inspect-widget {\n\tborder-width: 2px;\n}\n\n.monaco-editor .tokens-inspect-widget .tokens-inspect-separator {\n\theight: 1px;\n\tborder: 0;\n\tbackground-color: var(--vscode-editorHoverWidget-border);\n}\n\n.monaco-editor .tokens-inspect-widget .tm-token {\n\tfont-family: var(--monaco-monospace-font);\n}\n\n.monaco-editor .tokens-inspect-widget .tm-token-length {\n\tfont-weight: normal;\n\tfont-size: 60%;\n\tfloat: right;\n}\n\n.monaco-editor .tokens-inspect-widget .tm-metadata-table {\n\twidth: 100%;\n}\n\n.monaco-editor .tokens-inspect-widget .tm-metadata-value {\n\tfont-family: var(--monaco-monospace-font);\n\ttext-align: right;\n}\n\n.monaco-editor .tokens-inspect-widget .tm-token-type {\n\tfont-family: var(--monaco-monospace-font);\n}\n",""]);const a=r},3093:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/*\n\tKeeping name short for faster parsing.\n\tcdr = core decorations rendering (div)\n*/\n.monaco-editor .lines-content .cdr {\n\tposition: absolute;\n\theight: 100%;\n}\n",""]);const a=r},3113:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* Uncomment to see lines flashing when they're painted */\n/*.monaco-editor .view-lines > .view-line {\n\tbackground-color: none;\n\tanimation-name: flash-background;\n\tanimation-duration: 800ms;\n}\n@keyframes flash-background {\n\t0% { background-color: lightgreen; }\n\t100% { background-color: none }\n}*/\n\n.mtkcontrol {\n\tcolor: rgb(255, 255, 255) !important;\n\tbackground: rgb(150, 0, 0) !important;\n}\n\n.mtkoverflow {\n\tbackground-color: var(--vscode-button-background, var(--vscode-editor-background));\n\tcolor: var(--vscode-button-foreground, var(--vscode-editor-foreground));\n\tborder-width: 1px;\n\tborder-style: solid;\n\tborder-color: var(--vscode-contrastBorder);\n\tborder-radius: 2px;\n\tpadding: 4px;\n\tcursor: pointer;\n}\n.mtkoverflow:hover {\n\tbackground-color: var(--vscode-button-hoverBackground);\n}\n\n.monaco-editor.no-user-select .lines-content,\n.monaco-editor.no-user-select .view-line,\n.monaco-editor.no-user-select .view-lines {\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n/* Use user-select: text for lookup feature on macOS */\n/* https://github.com/microsoft/vscode/issues/85632 */\n.monaco-editor.mac .lines-content:hover,\n.monaco-editor.mac .view-line:hover,\n.monaco-editor.mac .view-lines:hover {\n\tuser-select: text;\n\t-webkit-user-select: text;\n\t-ms-user-select: text;\n}\n\n.monaco-editor.enable-user-select {\n\tuser-select: initial;\n\t-webkit-user-select: initial;\n}\n\n.monaco-editor .view-lines {\n\twhite-space: nowrap;\n}\n\n.monaco-editor .view-line {\n\tbox-sizing: border-box;\n\tposition: absolute;\n\twidth: 100%;\n}\n\n/* There are view-lines in view-zones. We have to make sure this rule does not apply to them, as they don't set a line height */\n.monaco-editor .lines-content > .view-lines > .view-line > span {\n\ttop: 0;\n\tbottom: 0;\n\tposition: absolute;\n}\n\n.monaco-editor .mtkw {\n\tcolor: var(--vscode-editorWhitespace-foreground) !important;\n}\n\n.monaco-editor .mtkz {\n\tdisplay: inline-block;\n\tcolor: var(--vscode-editorWhitespace-foreground) !important;\n}\n\n/* TODO@tokenization bootstrap fix */\n/*.monaco-editor .view-line > span > span {\n\tfloat: none;\n\tmin-height: inherit;\n\tmargin-left: inherit;\n}*/\n",""]);const a=r},3267:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .zone-widget .codicon.codicon-error,\n.markers-panel .marker-icon.error, .markers-panel .marker-icon .codicon.codicon-error,\n.text-search-provider-messages .providerMessage .codicon.codicon-error,\n.extensions-viewlet > .extensions .codicon.codicon-error,\n.extension-editor .codicon.codicon-error,\n.chat-attached-context-attachment .codicon.codicon-error {\n\tcolor: var(--vscode-problemsErrorIcon-foreground);\n}\n\n.monaco-editor .zone-widget .codicon.codicon-warning,\n.markers-panel .marker-icon.warning, .markers-panel .marker-icon .codicon.codicon-warning,\n.text-search-provider-messages .providerMessage .codicon.codicon-warning,\n.extensions-viewlet > .extensions .codicon.codicon-warning,\n.extension-editor .codicon.codicon-warning,\n.preferences-editor .codicon.codicon-warning {\n\tcolor: var(--vscode-problemsWarningIcon-foreground);\n}\n\n.monaco-editor .zone-widget .codicon.codicon-info,\n.markers-panel .marker-icon.info, .markers-panel .marker-icon .codicon.codicon-info,\n.text-search-provider-messages .providerMessage .codicon.codicon-info,\n.extensions-viewlet > .extensions .codicon.codicon-info,\n.extension-editor .codicon.codicon-info {\n\tcolor: var(--vscode-problemsInfoIcon-foreground);\n}\n",""]);const a=r},3293:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .linked-editing-decoration {\n\tbackground-color: var(--vscode-editor-linkedEditingBackground);\n\n\t/* Ensure decoration is visible even if range is empty */\n\tmin-width: 1px;\n}\n",""]);const a=r},3313:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/*\n\tKeeping name short for faster parsing.\n\tcmdr = core margin decorations rendering (div)\n*/\n.monaco-editor .margin-view-overlays .cmdr {\n\tposition: absolute;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n}",""]);const a=r},3326:e=>{e.exports='data:image/svg+xml;utf8,%3Csvg viewBox="0 0 24 24" display="inline-block" height="1em" width="1em" vertical-align="text-bottom" xmlns="http://www.w3.org/2000/svg" %3E%3Cpath fill="currentColor" d="M20 14H4V10H20"/%3E%3C/svg%3E'},3327:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .margin-view-overlays .line-numbers {\n\tfont-variant-numeric: tabular-nums;\n\tposition: absolute;\n\ttext-align: right;\n\tdisplay: inline-block;\n\tvertical-align: middle;\n\tbox-sizing: border-box;\n\tcursor: default;\n\theight: 100%;\n}\n\n.monaco-editor .relative-current-line-number {\n\ttext-align: left;\n\tdisplay: inline-block;\n\twidth: 100%;\n}\n\n.monaco-editor .margin-view-overlays .line-numbers.lh-odd {\n\tmargin-top: 1px;\n}\n\n.monaco-editor .line-numbers {\n\tcolor: var(--vscode-editorLineNumber-foreground);\n}\n\n.monaco-editor .line-numbers.active-line-number {\n\tcolor: var(--vscode-editorLineNumber-activeForeground);\n}\n",""]);const a=r},3345:(e,t,i)=>{i.d(t,{A:()=>u});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s),a=i(4417),l=i.n(a),d=new URL(i(8968),i.b),h=r()(o()),c=l()(d);h.push([e.id,`/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.colorpicker-widget {\n\theight: 190px;\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n/* Decoration */\n\n.colorpicker-color-decoration,\n.hc-light .colorpicker-color-decoration {\n\tborder: solid 0.1em #000;\n\tbox-sizing: border-box;\n\tmargin: 0.1em 0.2em 0 0.2em;\n\twidth: 0.8em;\n\theight: 0.8em;\n\tline-height: 0.8em;\n\tdisplay: inline-block;\n\tcursor: pointer;\n}\n\n.hc-black .colorpicker-color-decoration,\n.vs-dark .colorpicker-color-decoration {\n\tborder: solid 0.1em #eee;\n}\n\n/* Header */\n\n.colorpicker-header {\n\tdisplay: flex;\n\theight: 24px;\n\tposition: relative;\n\tbackground: url(${c});\n\tbackground-size: 9px 9px;\n\timage-rendering: pixelated;\n}\n\n.colorpicker-header .picked-color {\n\twidth: 240px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tline-height: 24px;\n\tcursor: pointer;\n\tcolor: white;\n\tflex: 1;\n\twhite-space: nowrap;\n\toverflow: hidden;\n}\n\n.colorpicker-header .picked-color .picked-color-presentation {\n\twhite-space: nowrap;\n\tmargin-left: 5px;\n\tmargin-right: 5px;\n}\n\n.colorpicker-header .picked-color .codicon {\n\tcolor: inherit;\n\tfont-size: 14px;\n}\n\n.colorpicker-header .picked-color.light {\n\tcolor: black;\n}\n\n.colorpicker-header .original-color {\n\twidth: 74px;\n\tz-index: inherit;\n\tcursor: pointer;\n}\n\n.standalone-colorpicker {\n\tcolor: var(--vscode-editorHoverWidget-foreground);\n\tbackground-color: var(--vscode-editorHoverWidget-background);\n\tborder: 1px solid var(--vscode-editorHoverWidget-border);\n}\n\n.colorpicker-header.standalone-colorpicker {\n\tborder-bottom: none;\n}\n\n.colorpicker-header .close-button {\n\tcursor: pointer;\n\tbackground-color: var(--vscode-editorHoverWidget-background);\n\tborder-left: 1px solid var(--vscode-editorHoverWidget-border);\n}\n\n.colorpicker-header .close-button-inner-div {\n\twidth: 100%;\n\theight: 100%;\n\ttext-align: center;\n}\n\n.colorpicker-header .close-button-inner-div:hover {\n\tbackground-color: var(--vscode-toolbar-hoverBackground);\n}\n\n.colorpicker-header .close-icon {\n\tpadding: 3px;\n}\n\n/* Body */\n\n.colorpicker-body {\n\tdisplay: flex;\n\tpadding: 8px;\n\tposition: relative;\n}\n\n.colorpicker-body .saturation-wrap {\n\toverflow: hidden;\n\theight: 150px;\n\tposition: relative;\n\tmin-width: 220px;\n\tflex: 1;\n}\n\n.colorpicker-body .saturation-box {\n\theight: 150px;\n\tposition: absolute;\n}\n\n.colorpicker-body .saturation-selection {\n\twidth: 9px;\n\theight: 9px;\n\tmargin: -5px 0 0 -5px;\n\tborder: 1px solid rgb(255, 255, 255);\n\tborder-radius: 100%;\n\tbox-shadow: 0px 0px 2px rgba(0, 0, 0, 0.8);\n\tposition: absolute;\n}\n\n.colorpicker-body .strip {\n\twidth: 25px;\n\theight: 150px;\n}\n\n.colorpicker-body .standalone-strip {\n\twidth: 25px;\n\theight: 122px;\n}\n\n.colorpicker-body .hue-strip {\n\tposition: relative;\n\tmargin-left: 8px;\n\tcursor: grab;\n\tbackground: linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);\n}\n\n.colorpicker-body .opacity-strip {\n\tposition: relative;\n\tmargin-left: 8px;\n\tcursor: grab;\n\tbackground: url(${c});\n\tbackground-size: 9px 9px;\n\timage-rendering: pixelated;\n}\n\n.colorpicker-body .strip.grabbing {\n\tcursor: grabbing;\n}\n\n.colorpicker-body .slider {\n\tposition: absolute;\n\ttop: 0;\n\tleft: -2px;\n\twidth: calc(100% + 4px);\n\theight: 4px;\n\tbox-sizing: border-box;\n\tborder: 1px solid rgba(255, 255, 255, 0.71);\n\tbox-shadow: 0px 0px 1px rgba(0, 0, 0, 0.85);\n}\n\n.colorpicker-body .strip .overlay {\n\theight: 150px;\n\tpointer-events: none;\n}\n\n.colorpicker-body .standalone-strip .standalone-overlay {\n\theight: 122px;\n\tpointer-events: none;\n}\n\n.standalone-colorpicker-body {\n\tdisplay: block;\n\tborder: 1px solid transparent;\n\tborder-bottom: 1px solid var(--vscode-editorHoverWidget-border);\n\toverflow: hidden;\n}\n\n.colorpicker-body .insert-button {\n\tposition: absolute;\n\theight: 20px;\n\twidth: 58px;\n\tpadding: 0px;\n\tright: 8px;\n\tbottom: 8px;\n\tbackground: var(--vscode-button-background);\n\tcolor: var(--vscode-button-foreground);\n\tborder-radius: 2px;\n\tborder: none;\n\tcursor: pointer;\n}\n\n.colorpicker-body .insert-button:hover{\n\tbackground: var(--vscode-button-hoverBackground);\n}\n`,""]);const u=h},3377:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-workbench .workbench-hover {\n\tposition: relative;\n\tfont-size: 13px;\n\tline-height: 19px;\n\t/* Must be higher than sash's z-index and terminal canvases */\n\tz-index: 40;\n\toverflow: hidden;\n\tmax-width: 700px;\n\tbackground: var(--vscode-editorHoverWidget-background);\n\tborder: 1px solid var(--vscode-editorHoverWidget-border);\n\tborder-radius: 5px;\n\tcolor: var(--vscode-editorHoverWidget-foreground);\n\tbox-shadow: 0 2px 8px var(--vscode-widget-shadow);\n}\n\n.monaco-workbench .workbench-hover .monaco-action-bar .action-item .codicon {\n\t/* Given our font-size, adjust action icons accordingly */\n\twidth: 13px;\n\theight: 13px;\n}\n\n.monaco-workbench .workbench-hover hr {\n\tborder-bottom: none;\n}\n\n.monaco-workbench .workbench-hover.compact {\n\tfont-size: 12px;\n}\n\n.monaco-workbench .workbench-hover.compact .monaco-action-bar .action-item .codicon {\n\t/* Given our font-size, adjust action icons accordingly */\n\twidth: 12px;\n\theight: 12px;\n}\n\n.monaco-workbench .workbench-hover.compact .hover-contents {\n\tpadding: 2px 8px;\n}\n\n.monaco-workbench .workbench-hover-container.locked .workbench-hover {\n\toutline: 1px solid var(--vscode-editorHoverWidget-border);\n}\n.monaco-workbench .workbench-hover-container:focus-within.locked .workbench-hover {\n\toutline-color: var(--vscode-focusBorder);\n}\n\n.monaco-workbench .workbench-hover-pointer {\n\tposition: absolute;\n\t/* Must be higher than workbench hover z-index */\n\tz-index: 41;\n\tpointer-events: none;\n}\n\n.monaco-workbench .workbench-hover-pointer:after {\n\tcontent: '';\n\tposition: absolute;\n\twidth: 5px;\n\theight: 5px;\n\tbackground-color: var(--vscode-editorHoverWidget-background);\n\tborder-right: 1px solid var(--vscode-editorHoverWidget-border);\n\tborder-bottom: 1px solid var(--vscode-editorHoverWidget-border);\n}\n.monaco-workbench .workbench-hover-container:not(:focus-within).locked .workbench-hover-pointer:after {\n\twidth: 4px;\n\theight: 4px;\n\tborder-right-width: 2px;\n\tborder-bottom-width: 2px;\n}\n.monaco-workbench .workbench-hover-container:focus-within .workbench-hover-pointer:after {\n\tborder-right: 1px solid var(--vscode-focusBorder);\n\tborder-bottom: 1px solid var(--vscode-focusBorder);\n}\n\n.monaco-workbench .workbench-hover-pointer.left { left: -3px; }\n.monaco-workbench .workbench-hover-pointer.right { right: 3px; }\n.monaco-workbench .workbench-hover-pointer.top { top: -3px; }\n.monaco-workbench .workbench-hover-pointer.bottom { bottom: 3px; }\n\n.monaco-workbench .workbench-hover-pointer.left:after {\n\ttransform: rotate(135deg);\n}\n\n.monaco-workbench .workbench-hover-pointer.right:after {\n\ttransform: rotate(315deg);\n}\n\n.monaco-workbench .workbench-hover-pointer.top:after {\n\ttransform: rotate(225deg);\n}\n\n.monaco-workbench .workbench-hover-pointer.bottom:after {\n\ttransform: rotate(45deg);\n}\n\n.monaco-workbench .workbench-hover a {\n\tcolor: var(--vscode-textLink-foreground);\n}\n\n.monaco-workbench .workbench-hover a:focus {\n\toutline: 1px solid;\n\toutline-offset: -1px;\n\ttext-decoration: underline;\n\toutline-color: var(--vscode-focusBorder);\n}\n\n.monaco-workbench .workbench-hover a.codicon:focus,\n.monaco-workbench .workbench-hover a.monaco-button:focus {\n\ttext-decoration: none;\n}\n\n.monaco-workbench .workbench-hover a:hover,\n.monaco-workbench .workbench-hover a:active {\n\tcolor: var(--vscode-textLink-activeForeground);\n}\n\n.monaco-workbench .workbench-hover code {\n\tbackground: var(--vscode-textCodeBlock-background);\n}\n\n.monaco-workbench .workbench-hover .hover-row .actions {\n\tbackground: var(--vscode-editorHoverWidget-statusBarBackground);\n}\n\n.monaco-workbench .workbench-hover.right-aligned {\n\t/* The context view service wraps strangely when it's right up against the edge without this */\n\tleft: 1px;\n}\n\n.monaco-workbench .workbench-hover.right-aligned .hover-row.status-bar .actions {\n\tflex-direction: row-reverse;\n}\n\n.monaco-workbench .workbench-hover.right-aligned .hover-row.status-bar .actions .action-container {\n\tmargin-right: 0;\n\tmargin-left: 16px;\n}\n",""]);const a=r},3413:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .margin-view-overlays .gpu-mark {\n\tposition: absolute;\n\ttop: 0;\n\tbottom: 0;\n\tleft: 0;\n\twidth: 100%;\n\tdisplay: inline-block;\n\tborder-left: solid 2px var(--vscode-editorWarning-foreground);\n\topacity: 0.2;\n\ttransition: background-color 0.1s linear;\n}\n\n.monaco-editor .margin-view-overlays .gpu-mark:hover {\n\tbackground-color: var(--vscode-editorWarning-foreground)\n}\n",""]);const a=r},3452:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,'/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n\n/* Default standalone editor fonts */\n.monaco-editor {\n\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;\n\t--monaco-monospace-font: "SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item .action-menu-item:focus .action-label {\n\tstroke-width: 1.2px;\n}\n\n.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,\n.monaco-editor.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,\n.monaco-editor.hc-light .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label {\n\tstroke-width: 1.2px;\n}\n\n.monaco-hover p {\n\tmargin: 0;\n}\n\n/* See https://github.com/microsoft/monaco-editor/issues/2168#issuecomment-780078600 */\n.monaco-aria-container {\n\tposition: absolute !important;\n\ttop: 0; /* avoid being placed underneath a sibling element */\n\theight: 1px;\n\twidth: 1px;\n\tmargin: -1px;\n\toverflow: hidden;\n\tpadding: 0;\n\tclip: rect(1px, 1px, 1px, 1px);\n\tclip-path: inset(50%);\n}\n\n/*.monaco-editor.vs [tabindex="0"]:focus {\n\toutline: 1px solid rgba(0, 122, 204, 0.4);\n\toutline-offset: -1px;\n\topacity: 1 !important;\n}\n\n.monaco-editor.vs-dark [tabindex="0"]:focus {\n\toutline: 1px solid rgba(14, 99, 156, 0.6);\n\toutline-offset: -1px;\n\topacity: 1 !important;\n}*/\n',""]);const a=r},3462:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,".index__inner___epnFX {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n}\n\n.index__main___FoijY {\n flex-grow: 1;\n overflow-y: auto;\n}\n\n.index__header___LlNrw {\n display: flex;\n justify-content: start;\n flex-wrap: wrap;\n}\n\n.index__footer___hVbYe {\n height: 1.5em;\n}\n\n.index__monaco___x5J_G {\n height: 100%;\n}\n\n.index__status___mW72Q {\n}\n\n.index__ms-choice___x3ep0 {\n height: 100%;\n line-height: normal;\n}\n\n.index__find-lines-table___XYmFv {\n border-spacing: 0;\n}\n.index__find-line-number___YqxOF {\n text-align: right;\n vertical-align: text-top;\n white-space: nowrap;\n padding: 0;\n padding-right: 1rem;\n opacity: 0.5;\n}\n\n.index__find-line-active___aDGI4 {\n background-color: rgba(255, 255, 192, 0.1)\n}\n\n.index__find-line-content___W7Sz9 {\n overflow-wrap: anywhere;\n}",""]),r.locals={inner:"index__inner___epnFX",main:"index__main___FoijY",header:"index__header___LlNrw",footer:"index__footer___hVbYe",monaco:"index__monaco___x5J_G",status:"index__status___mW72Q","ms-choice":"index__ms-choice___x3ep0","find-lines-table":"index__find-lines-table___XYmFv","find-line-number":"index__find-line-number___YqxOF","find-line-active":"index__find-line-active___aDGI4","find-line-content":"index__find-line-content___W7Sz9"};const a=r},3474:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-split-view2 {\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n}\n\n.monaco-split-view2 > .sash-container {\n\tposition: absolute;\n\twidth: 100%;\n\theight: 100%;\n\tpointer-events: none;\n}\n\n.monaco-split-view2 > .sash-container > .monaco-sash {\n\tpointer-events: initial;\n}\n\n.monaco-split-view2 > .monaco-scrollable-element {\n\twidth: 100%;\n\theight: 100%;\n}\n\n.monaco-split-view2 > .monaco-scrollable-element > .split-view-container {\n\twidth: 100%;\n\theight: 100%;\n\twhite-space: nowrap;\n\tposition: relative;\n}\n\n.monaco-split-view2 > .monaco-scrollable-element > .split-view-container > .split-view-view {\n\twhite-space: initial;\n\tposition: absolute;\n}\n\n.monaco-split-view2 > .monaco-scrollable-element > .split-view-container > .split-view-view:not(.visible) {\n\tdisplay: none;\n}\n\n.monaco-split-view2.vertical > .monaco-scrollable-element > .split-view-container > .split-view-view {\n\twidth: 100%;\n}\n\n.monaco-split-view2.horizontal > .monaco-scrollable-element > .split-view-container > .split-view-view {\n\theight: 100%;\n}\n\n.monaco-split-view2.separator-border > .monaco-scrollable-element > .split-view-container > .split-view-view:not(:first-child)::before {\n\tcontent: ' ';\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tz-index: 5;\n\tpointer-events: none;\n\tbackground-color: var(--separator-border);\n}\n\n.monaco-split-view2.separator-border.horizontal > .monaco-scrollable-element > .split-view-container > .split-view-view:not(:first-child)::before {\n\theight: 100%;\n\twidth: 1px;\n}\n\n.monaco-split-view2.separator-border.vertical > .monaco-scrollable-element > .split-view-container > .split-view-view:not(:first-child)::before {\n\theight: 1px;\n\twidth: 100%;\n}\n",""]);const a=r},3614:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,'/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n\n/* Default standalone editor fonts */\n.monaco-editor {\n\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;\n\t--monaco-monospace-font: "SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item .action-menu-item:focus .action-label {\n\tstroke-width: 1.2px;\n}\n\n.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,\n.monaco-editor.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,\n.monaco-editor.hc-light .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label {\n\tstroke-width: 1.2px;\n}\n\n.monaco-hover p {\n\tmargin: 0;\n}\n\n/* See https://github.com/microsoft/monaco-editor/issues/2168#issuecomment-780078600 */\n.monaco-aria-container {\n\tposition: absolute !important;\n\ttop: 0; /* avoid being placed underneath a sibling element */\n\theight: 1px;\n\twidth: 1px;\n\tmargin: -1px;\n\toverflow: hidden;\n\tpadding: 0;\n\tclip: rect(1px, 1px, 1px, 1px);\n\tclip-path: inset(50%);\n}\n\n.monaco-editor .synthetic-focus, .monaco-diff-editor .synthetic-focus,\n.monaco-editor [tabindex="0"]:focus, .monaco-diff-editor [tabindex="0"]:focus,\n.monaco-editor [tabindex="-1"]:focus, .monaco-diff-editor [tabindex="-1"]:focus,\n.monaco-editor button:focus, .monaco-diff-editor button:focus,\n.monaco-editor input[type=button]:focus, .monaco-diff-editor input[type=button]:focus,\n.monaco-editor input[type=checkbox]:focus, .monaco-diff-editor input[type=checkbox]:focus,\n.monaco-editor input[type=search]:focus, .monaco-diff-editor input[type=search]:focus,\n.monaco-editor input[type=text]:focus, .monaco-diff-editor input[type=text]:focus,\n.monaco-editor select:focus, .monaco-diff-editor select:focus,\n.monaco-editor textarea:focus, .monaco-diff-editor textarea:focus {\n\toutline-width: 1px;\n\toutline-style: solid;\n\toutline-offset: -1px;\n\toutline-color: var(--vscode-focusBorder);\n\topacity: 1\n}\n',""]);const a=r},3717:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor {\n\t.scroll-editor-on-middle-click-dot {\n\t\tcursor: all-scroll;\n\t\tposition: absolute;\n\t\tz-index: 1;\n\t\tbackground-color: var(--vscode-editor-foreground, white);\n\t\tborder: 1px solid var(--vscode-editor-background, black);\n\t\topacity: 0.5;\n\t\twidth: 5px;\n\t\theight: 5px;\n\t\tborder-radius: 50%;\n\t\ttransform: translate(-50%, -50%);\n\n\t\t&.hidden {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t&.scroll-editor-on-middle-click-editor * {\n\t\tcursor: all-scroll;\n\t}\n}\n",""]);const a=r},3777:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .lines-content .core-guide {\n\tposition: absolute;\n\tbox-sizing: border-box;\n\theight: 100%;\n}\n",""]);const a=r},3953:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* Use custom CSS vars to expose padding into parent select for padding calculation */\n.monaco-select-box-dropdown-padding {\n\t--dropdown-padding-top: 1px;\n\t--dropdown-padding-bottom: 1px;\n}\n\n.hc-black .monaco-select-box-dropdown-padding,\n.hc-light .monaco-select-box-dropdown-padding {\n\t--dropdown-padding-top: 3px;\n\t--dropdown-padding-bottom: 4px;\n}\n\n.monaco-select-box-dropdown-container {\n\tdisplay: none;\n\tbox-sizing:\tborder-box;\n}\n\n.monaco-select-box-dropdown-container > .select-box-details-pane > .select-box-description-markdown * {\n\tmargin: 0;\n}\n\n.monaco-select-box-dropdown-container > .select-box-details-pane > .select-box-description-markdown a:focus {\n\toutline: 1px solid -webkit-focus-ring-color;\n\toutline-offset: -1px;\n}\n\n.monaco-select-box-dropdown-container > .select-box-details-pane > .select-box-description-markdown code {\n\tline-height: 15px; /** For some reason, this is needed, otherwise <code> will take up 20px height */\n\tfont-family: var(--monaco-monospace-font);\n}\n\n\n.monaco-select-box-dropdown-container.visible {\n\tdisplay: flex;\n\tflex-direction: column;\n\ttext-align: left;\n\twidth: 1px;\n\toverflow: hidden;\n\tborder-bottom-left-radius: 3px;\n\tborder-bottom-right-radius: 3px;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container {\n\tflex: 0 0 auto;\n\talign-self: flex-start;\n\tpadding-top: var(--dropdown-padding-top);\n\tpadding-bottom: var(--dropdown-padding-bottom);\n\tpadding-left: 1px;\n\tpadding-right: 1px;\n\twidth: 100%;\n\toverflow: hidden;\n\tbox-sizing:\tborder-box;\n}\n\n.monaco-select-box-dropdown-container > .select-box-details-pane {\n\tpadding: 5px;\n}\n\n.hc-black .monaco-select-box-dropdown-container > .select-box-dropdown-list-container {\n\tpadding-top: var(--dropdown-padding-top);\n\tpadding-bottom: var(--dropdown-padding-bottom);\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row {\n\tcursor: pointer;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row > .option-text {\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\tpadding-left: 3.5px;\n\twhite-space: nowrap;\n\tfloat: left;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row > .option-detail {\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\tpadding-left: 3.5px;\n\twhite-space: nowrap;\n\tfloat: left;\n\topacity: 0.7;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row > .option-decorator-right {\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\tpadding-right: 10px;\n\twhite-space: nowrap;\n\tfloat: right;\n}\n\n\n/* Accepted CSS hiding technique for accessibility reader text */\n/* https://webaim.org/techniques/css/invisiblecontent/ */\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row > .visually-hidden {\n\t\tposition: absolute;\n\t\tleft: -10000px;\n\t\ttop: auto;\n\t\twidth: 1px;\n\t\theight: 1px;\n\t\toverflow: hidden;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-container-width-control {\n\tflex: 1 1 auto;\n\talign-self: flex-start;\n\topacity: 0;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-container-width-control > .width-control-div {\n\toverflow: hidden;\n\tmax-height: 0px;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-container-width-control > .width-control-div > .option-text-width-control {\n\tpadding-left: 4px;\n\tpadding-right: 8px;\n\twhite-space: nowrap;\n}\n",""]);const a=r},4072:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-aria-container {\n\tposition: absolute; /* try to hide from window but not from screen readers */\n\tleft:-999em;\n}",""]);const a=r},4085:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .suggest-preview-additional-widget {\n\twhite-space: nowrap;\n}\n\n.monaco-editor .suggest-preview-additional-widget .content-spacer {\n\tcolor: transparent;\n\twhite-space: pre;\n}\n\n.monaco-editor .suggest-preview-additional-widget .button {\n\tdisplay: inline-block;\n\tcursor: pointer;\n\ttext-decoration: underline;\n\ttext-underline-position: under;\n}\n\n.monaco-editor .ghost-text-hidden {\n\topacity: 0;\n\tfont-size: 0;\n}\n\n.monaco-editor .ghost-text-decoration,\n.monaco-editor .suggest-preview-text .ghost-text {\n\tfont-style: italic;\n}\n\n.monaco-editor .suggest-preview-text.clickable .view-line {\n\tz-index: 1;\n}\n\n.monaco-editor .ghost-text-decoration.clickable,\n.monaco-editor .ghost-text-decoration-preview.clickable,\n.monaco-editor .suggest-preview-text.clickable .ghost-text {\n\tcursor: pointer;\n}\n\n.monaco-editor .inline-completion-text-to-replace {\n\ttext-decoration: underline;\n\ttext-underline-position: under;\n}\n\n.monaco-editor .ghost-text-decoration,\n.monaco-editor .ghost-text-decoration-preview,\n.monaco-editor .suggest-preview-text .ghost-text {\n\t&.syntax-highlighted {\n\t\topacity: 0.7;\n\t}\n\t&:not(.syntax-highlighted) {\n\t\tcolor: var(--vscode-editorGhostText-foreground);\n\t}\n\tbackground-color: var(--vscode-editorGhostText-background);\n\tborder: 1px solid var(--vscode-editorGhostText-border);\n}\n\n.monaco-editor .ghost-text-decoration.warning,\n.monaco-editor .ghost-text-decoration-preview.warning,\n.monaco-editor .suggest-preview-text .ghost-text.warning {\n\tbackground: var(--monaco-editor-warning-decoration) repeat-x bottom left;\n\tborder-bottom: 4px double var(--vscode-editorWarning-border);\n}\n\n.ghost-text-view-warning-widget-icon {\n\t.codicon {\n\t\tcolor: var(--vscode-editorWarning-foreground) !important;\n\t}\n}\n\n.monaco-editor {\n\t.edits-fadeout-decoration {\n\t\topacity: var(--animation-opacity, 1);\n\t\tbackground-color: var(--vscode-inlineEdit-modifiedChangedTextBackground);\n\t}\n}\n",""]);const a=r},4153:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .margin {\n\tbackground-color: var(--vscode-editorGutter-background);\n}\n",""]);const a=r},4166:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n:root {\n\t--vscode-sash-size: 4px;\n\t--vscode-sash-hover-size: 4px;\n}\n\n.monaco-sash {\n\tposition: absolute;\n\tz-index: 35;\n\ttouch-action: none;\n}\n\n.monaco-sash.disabled {\n\tpointer-events: none;\n}\n\n.monaco-sash.mac.vertical {\n\tcursor: col-resize;\n}\n\n.monaco-sash.vertical.minimum {\n\tcursor: e-resize;\n}\n\n.monaco-sash.vertical.maximum {\n\tcursor: w-resize;\n}\n\n.monaco-sash.mac.horizontal {\n\tcursor: row-resize;\n}\n\n.monaco-sash.horizontal.minimum {\n\tcursor: s-resize;\n}\n\n.monaco-sash.horizontal.maximum {\n\tcursor: n-resize;\n}\n\n.monaco-sash.disabled {\n\tcursor: default !important;\n\tpointer-events: none !important;\n}\n\n.monaco-sash.vertical {\n\tcursor: ew-resize;\n\ttop: 0;\n\twidth: var(--vscode-sash-size);\n\theight: 100%;\n}\n\n.monaco-sash.horizontal {\n\tcursor: ns-resize;\n\tleft: 0;\n\twidth: 100%;\n\theight: var(--vscode-sash-size);\n}\n\n.monaco-sash:not(.disabled) > .orthogonal-drag-handle {\n\tcontent: \" \";\n\theight: calc(var(--vscode-sash-size) * 2);\n\twidth: calc(var(--vscode-sash-size) * 2);\n\tz-index: 100;\n\tdisplay: block;\n\tcursor: all-scroll;\n\tposition: absolute;\n}\n\n.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)\n\t> .orthogonal-drag-handle.start,\n.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)\n\t> .orthogonal-drag-handle.end {\n\tcursor: nwse-resize;\n}\n\n.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)\n\t> .orthogonal-drag-handle.end,\n.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)\n\t> .orthogonal-drag-handle.start {\n\tcursor: nesw-resize;\n}\n\n.monaco-sash.vertical > .orthogonal-drag-handle.start {\n\tleft: calc(var(--vscode-sash-size) * -0.5);\n\ttop: calc(var(--vscode-sash-size) * -1);\n}\n.monaco-sash.vertical > .orthogonal-drag-handle.end {\n\tleft: calc(var(--vscode-sash-size) * -0.5);\n\tbottom: calc(var(--vscode-sash-size) * -1);\n}\n.monaco-sash.horizontal > .orthogonal-drag-handle.start {\n\ttop: calc(var(--vscode-sash-size) * -0.5);\n\tleft: calc(var(--vscode-sash-size) * -1);\n}\n.monaco-sash.horizontal > .orthogonal-drag-handle.end {\n\ttop: calc(var(--vscode-sash-size) * -0.5);\n\tright: calc(var(--vscode-sash-size) * -1);\n}\n\n.monaco-sash:before {\n\tcontent: '';\n\tpointer-events: none;\n\tposition: absolute;\n\twidth: 100%;\n\theight: 100%;\n\tbackground: transparent;\n}\n\n.monaco-workbench:not(.reduce-motion) .monaco-sash:before {\n\ttransition: background-color 0.1s ease-out;\n}\n\n.monaco-sash.hover:before,\n.monaco-sash.active:before {\n\tbackground: var(--vscode-sash-hoverBorder);\n}\n\n.monaco-sash.vertical:before {\n\twidth: var(--vscode-sash-hover-size);\n\tleft: calc(50% - (var(--vscode-sash-hover-size) / 2));\n}\n\n.monaco-sash.horizontal:before {\n\theight: var(--vscode-sash-hover-size);\n\ttop: calc(50% - (var(--vscode-sash-hover-size) / 2));\n}\n\n.pointer-events-disabled {\n\tpointer-events: none !important;\n}\n\n/** Debug **/\n\n.monaco-sash.debug {\n\tbackground: cyan;\n}\n\n.monaco-sash.debug.disabled {\n\tbackground: rgba(0, 255, 255, 0.2);\n}\n\n.monaco-sash.debug:not(.disabled) > .orthogonal-drag-handle {\n\tbackground: red;\n}\n",""]);const a=r},4169:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .lightBulbWidget {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.monaco-editor .lightBulbWidget:hover{\n\tcursor: pointer;\n}\n\n.monaco-editor .lightBulbWidget.codicon-light-bulb,\n.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle {\n\tcolor: var(--vscode-editorLightBulb-foreground);\n}\n\n.monaco-editor .lightBulbWidget.codicon-lightbulb-autofix,\n.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle-autofix {\n\tcolor: var(--vscode-editorLightBulbAutoFix-foreground, var(--vscode-editorLightBulb-foreground));\n}\n\n.monaco-editor .lightBulbWidget.codicon-sparkle-filled {\n\tcolor: var(--vscode-editorLightBulbAi-foreground, var(--vscode-icon-foreground));\n}\n\n.monaco-editor .lightBulbWidget:before {\n\tposition: relative;\n\tz-index: 2;\n}\n\n.monaco-editor .lightBulbWidget:after {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tcontent: '';\n\tdisplay: block;\n\twidth: 100%;\n\theight: 100%;\n\topacity: 0.3;\n\tz-index: 1;\n}\n\n/* gutter decoration */\n.monaco-editor .glyph-margin-widgets .cgmr[class*=\"codicon-gutter-lightbulb\"] {\n\tdisplay: block;\n\tcursor: pointer;\n}\n\n.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb,\n.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-sparkle {\n\tcolor: var(--vscode-editorLightBulb-foreground);\n}\n\n.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-auto-fix,\n.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-aifix-auto-fix {\n\tcolor: var(--vscode-editorLightBulbAutoFix-foreground, var(--vscode-editorLightBulb-foreground));\n}\n\n.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-sparkle-filled {\n\tcolor: var(--vscode-editorLightBulbAi-foreground, var(--vscode-icon-foreground));\n}\n",""]);const a=r},4214:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-drag-image {\n\tdisplay: inline-block;\n\tpadding: 1px 7px;\n\tborder-radius: 10px;\n\tfont-size: 12px;\n\tposition: absolute;\n\tz-index: 1000;\n\n\t/* Default styles */\n\tbackground-color: var(--vscode-list-activeSelectionBackground);\n\tcolor: var(--vscode-list-activeSelectionForeground);\n\toutline: 1px solid var(--vscode-list-focusOutline);\n\toutline-offset: -1px;\n\n\t/*\n\t * Browsers apply an effect to the drag image when the div becomes too\n\t * large which makes them unreadable. Use max width so it does not happen\n\t */\n\tmax-width: 120px;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n",""]);const a=r},4234:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,'/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-table {\n\tdisplay: flex;\n\tflex-direction: column;\n\tposition: relative;\n\theight: 100%;\n\twidth: 100%;\n\twhite-space: nowrap;\n\toverflow: hidden;\n}\n\n.monaco-table > .monaco-split-view2 {\n\tborder-bottom: 1px solid transparent;\n}\n\n.monaco-table > .monaco-list {\n\tflex: 1;\n}\n\n.monaco-table-tr {\n\tdisplay: flex;\n\theight: 100%;\n}\n\n.monaco-table-th {\n\twidth: 100%;\n\theight: 100%;\n\tfont-weight: bold;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.monaco-table-th,\n.monaco-table-td {\n\tbox-sizing: border-box;\n\tflex-shrink: 0;\n\toverflow: hidden;\n\twhite-space: nowrap;\n\ttext-overflow: ellipsis;\n}\n\n.monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {\n\tcontent: "";\n\tposition: absolute;\n\tleft: calc(var(--vscode-sash-size) / 2);\n\twidth: 0;\n\tborder-left: 1px solid transparent;\n}\n\n.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2,\n.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {\n\ttransition: border-color 0.2s ease-out;\n}\n',""]);const a=r},4318:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-list {\n\tposition: relative;\n\theight: 100%;\n\twidth: 100%;\n\twhite-space: nowrap;\n}\n\n.monaco-list.mouse-support {\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.monaco-list > .monaco-scrollable-element {\n\theight: 100%;\n}\n\n.monaco-list-rows {\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n}\n\n.monaco-list.horizontal-scrolling .monaco-list-rows {\n\twidth: auto;\n\tmin-width: 100%;\n}\n\n.monaco-list-row {\n\tposition: absolute;\n\tbox-sizing: border-box;\n\toverflow: hidden;\n\twidth: 100%;\n}\n\n.monaco-list.mouse-support .monaco-list-row {\n\tcursor: pointer;\n\ttouch-action: none;\n}\n\n/* for OS X ballistic scrolling */\n.monaco-list-row.scrolling {\n\tdisplay: none !important;\n}\n\n/* Focus */\n.monaco-list.element-focused,\n.monaco-list.selection-single,\n.monaco-list.selection-multiple {\n\toutline: 0 !important;\n}\n\n/* Dnd */\n.monaco-drag-image {\n\tdisplay: inline-block;\n\tpadding: 1px 7px;\n\tborder-radius: 10px;\n\tfont-size: 12px;\n\tposition: absolute;\n\tz-index: 1000;\n}\n\n/* Filter */\n\n.monaco-list-type-filter-message {\n\tposition: absolute;\n\tbox-sizing: border-box;\n\twidth: 100%;\n\theight: 100%;\n\ttop: 0;\n\tleft: 0;\n\tpadding: 40px 1em 1em 1em;\n\ttext-align: center;\n\twhite-space: normal;\n\topacity: 0.7;\n\tpointer-events: none;\n}\n\n.monaco-list-type-filter-message:empty {\n\tdisplay: none;\n}\n",""]);const a=r},4335:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* -------------------- IE10 remove auto clear button -------------------- */\n\n::-ms-clear {\n\tdisplay: none;\n}\n\n/* All widgets */\n/* I am not a big fan of this rule */\n.monaco-editor .editor-widget input {\n\tcolor: inherit;\n}\n\n/* -------------------- Editor -------------------- */\n\n.monaco-editor {\n\tposition: relative;\n\toverflow: visible;\n\t-webkit-text-size-adjust: 100%;\n\tcolor: var(--vscode-editor-foreground);\n\tbackground-color: var(--vscode-editor-background);\n}\n.monaco-editor-background {\n\tbackground-color: var(--vscode-editor-background);\n}\n.monaco-editor .rangeHighlight {\n\tbackground-color: var(--vscode-editor-rangeHighlightBackground);\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-editor-rangeHighlightBorder);\n}\n.monaco-editor.hc-black .rangeHighlight, .monaco-editor.hc-light .rangeHighlight {\n\tborder-style: dotted;\n}\n.monaco-editor .symbolHighlight {\n\tbackground-color: var(--vscode-editor-symbolHighlightBackground);\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-editor-symbolHighlightBorder);\n}\n.monaco-editor.hc-black .symbolHighlight, .monaco-editor.hc-light .symbolHighlight {\n\tborder-style: dotted;\n}\n\n/* -------------------- Misc -------------------- */\n\n.monaco-editor .overflow-guard {\n\tposition: relative;\n\toverflow: hidden;\n}\n\n.monaco-editor .view-overlays {\n\tposition: absolute;\n\ttop: 0;\n}\n\n/*\n.monaco-editor .auto-closed-character {\n\topacity: 0.3;\n}\n*/\n\n\n.monaco-editor .squiggly-error {\n\tborder-bottom: 4px double var(--vscode-editorError-border);\n}\n.monaco-editor .squiggly-error::before {\n\tdisplay: block;\n\tcontent: '';\n\twidth: 100%;\n\theight: 100%;\n\tbackground: var(--vscode-editorError-background);\n}\n.monaco-editor .squiggly-warning {\n\tborder-bottom: 4px double var(--vscode-editorWarning-border);\n}\n.monaco-editor .squiggly-warning::before {\n\tdisplay: block;\n\tcontent: '';\n\twidth: 100%;\n\theight: 100%;\n\tbackground: var(--vscode-editorWarning-background);\n}\n.monaco-editor .squiggly-info {\n\tborder-bottom: 4px double var(--vscode-editorInfo-border);\n}\n.monaco-editor .squiggly-info::before {\n\tdisplay: block;\n\tcontent: '';\n\twidth: 100%;\n\theight: 100%;\n\tbackground: var(--vscode-editorInfo-background);\n}\n.monaco-editor .squiggly-hint {\n\tborder-bottom: 2px dotted var(--vscode-editorHint-border);\n}\n.monaco-editor.showUnused .squiggly-unnecessary {\n\tborder-bottom: 2px dashed var(--vscode-editorUnnecessaryCode-border);\n}\n.monaco-editor.showDeprecated .squiggly-inline-deprecated {\n\ttext-decoration: line-through;\n\ttext-decoration-color: var(--vscode-editor-foreground, inherit);\n}\n",""]);const a=r},4402:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-text-button {\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\twidth: 100%;\n\tpadding: 4px;\n\tborder-radius: 2px;\n\ttext-align: center;\n\tcursor: pointer;\n\tjustify-content: center;\n\talign-items: center;\n\tborder: 1px solid var(--vscode-button-border, transparent);\n\tline-height: 18px;\n}\n\n.monaco-text-button:focus {\n\toutline-offset: 2px !important;\n}\n\n.monaco-text-button:hover {\n\ttext-decoration: none !important;\n}\n\n.monaco-button.disabled:focus,\n.monaco-button.disabled {\n\topacity: 0.4 !important;\n\tcursor: default;\n}\n\n.monaco-text-button .codicon {\n\tmargin: 0 0.2em;\n\tcolor: inherit !important;\n}\n\n.monaco-text-button.monaco-text-button-with-short-label {\n\tflex-direction: row;\n\tflex-wrap: wrap;\n\tpadding: 0 4px;\n\toverflow: hidden;\n\theight: 28px;\n}\n\n.monaco-text-button.monaco-text-button-with-short-label > .monaco-button-label {\n\tflex-basis: 100%;\n}\n\n.monaco-text-button.monaco-text-button-with-short-label > .monaco-button-label-short {\n\tflex-grow: 1;\n\twidth: 0;\n\toverflow: hidden;\n}\n\n.monaco-text-button.monaco-text-button-with-short-label > .monaco-button-label,\n.monaco-text-button.monaco-text-button-with-short-label > .monaco-button-label-short {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tfont-weight: normal;\n\tfont-style: inherit;\n\tpadding: 4px 0;\n}\n\n.monaco-button-dropdown {\n\tdisplay: flex;\n\tcursor: pointer;\n}\n\n.monaco-button-dropdown.disabled {\n\tcursor: default;\n}\n\n.monaco-button-dropdown > .monaco-button:focus {\n\toutline-offset: -1px !important;\n}\n\n.monaco-button-dropdown.disabled > .monaco-button.disabled,\n.monaco-button-dropdown.disabled > .monaco-button.disabled:focus,\n.monaco-button-dropdown.disabled > .monaco-button-dropdown-separator {\n\topacity: 0.4 !important;\n}\n\n.monaco-button-dropdown > .monaco-button.monaco-text-button {\n\tborder-right-width: 0 !important;\n}\n\n.monaco-button-dropdown .monaco-button-dropdown-separator {\n\tpadding: 4px 0;\n\tcursor: default;\n}\n\n.monaco-button-dropdown .monaco-button-dropdown-separator > div {\n\theight: 100%;\n\twidth: 1px;\n}\n\n.monaco-button-dropdown > .monaco-button.monaco-dropdown-button {\n\tborder-left-width: 0 !important;\n\tborder-radius: 0 2px 2px 0;\n}\n\n.monaco-button-dropdown > .monaco-button.monaco-text-button {\n\tborder-radius: 2px 0 0 2px;\n}\n\n.monaco-description-button {\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tmargin: 4px 5px; /* allows button focus outline to be visible */\n}\n\n.monaco-description-button .monaco-button-description {\n\tfont-style: italic;\n\tfont-size: 11px;\n\tpadding: 4px 20px;\n}\n\n.monaco-description-button .monaco-button-label,\n.monaco-description-button .monaco-button-description {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n}\n\n.monaco-description-button .monaco-button-label > .codicon,\n.monaco-description-button .monaco-button-description > .codicon {\n\tmargin: 0 0.2em;\n\tcolor: inherit !important;\n}\n",""]);const a=r},4417:e=>{e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},4566:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-action-bar {\n\twhite-space: nowrap;\n\theight: 100%;\n}\n\n.monaco-action-bar .actions-container {\n\tdisplay: flex;\n\tmargin: 0 auto;\n\tpadding: 0;\n\theight: 100%;\n\twidth: 100%;\n\talign-items: center;\n}\n\n.monaco-action-bar.vertical .actions-container {\n\tdisplay: inline-block;\n}\n\n.monaco-action-bar .action-item {\n\tdisplay: block;\n\talign-items: center;\n\tjustify-content: center;\n\tcursor: pointer;\n\tposition: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */\n}\n\n.monaco-action-bar .action-item.disabled {\n\tcursor: default;\n}\n\n.monaco-action-bar .action-item .icon,\n.monaco-action-bar .action-item .codicon {\n\tdisplay: block;\n}\n\n.monaco-action-bar .action-item .codicon {\n\tdisplay: flex;\n\talign-items: center;\n\twidth: 16px;\n\theight: 16px;\n}\n\n.monaco-action-bar .action-label {\n\tdisplay: flex;\n\tfont-size: 11px;\n\tpadding: 3px;\n\tborder-radius: 5px;\n}\n\n.monaco-action-bar .action-item.disabled .action-label:not(.icon) ,\n.monaco-action-bar .action-item.disabled .action-label:not(.icon)::before,\n.monaco-action-bar .action-item.disabled .action-label:not(.icon):hover {\n\tcolor: var(--vscode-disabledForeground);\n}\n\n/* Unable to change color of SVGs, hence opacity is used */\n.monaco-action-bar .action-item.disabled .action-label.icon ,\n.monaco-action-bar .action-item.disabled .action-label.icon::before,\n.monaco-action-bar .action-item.disabled .action-label.icon:hover {\n\topacity: 0.6;\n}\n\n/* Vertical actions */\n\n.monaco-action-bar.vertical {\n\ttext-align: left;\n}\n\n.monaco-action-bar.vertical .action-item {\n\tdisplay: block;\n}\n\n.monaco-action-bar.vertical .action-label.separator {\n\tdisplay: block;\n\tborder-bottom: 1px solid var(--vscode-disabledForeground);\n\tpadding-top: 1px;\n\tmargin-left: .8em;\n\tmargin-right: .8em;\n}\n\n.monaco-action-bar .action-item .action-label.separator {\n\twidth: 1px;\n\theight: 16px;\n\tmargin: 5px 4px !important;\n\tcursor: default;\n\tmin-width: 1px;\n\tpadding: 0;\n\tbackground-color: var(--vscode-disabledForeground);\n}\n\n.secondary-actions .monaco-action-bar .action-label {\n\tmargin-left: 6px;\n}\n\n/* Action Items */\n.monaco-action-bar .action-item.select-container {\n\toverflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */\n\tflex: 1;\n\tmax-width: 170px;\n\tmin-width: 60px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin-right: 10px;\n}\n\n.monaco-action-bar .action-item.action-dropdown-item {\n\tdisplay: flex;\n}\n\n.monaco-action-bar .action-item.action-dropdown-item > .action-dropdown-item-separator {\n\tdisplay: flex;\n\talign-items: center;\n\tcursor: default;\n}\n\n.monaco-action-bar .action-item.action-dropdown-item > .action-dropdown-item-separator > div {\n\twidth: 1px;\n}\n",""]);const a=r},4646:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-link {\n\tcolor: var(--vscode-textLink-foreground);\n}\n\n.monaco-link:hover {\n\tcolor: var(--vscode-textLink-activeForeground);\n}\n\n",""]);const a=r},4747:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .view-ruler {\n\tposition: absolute;\n\ttop: 0;\n\tbox-shadow: 1px 0 0 0 var(--vscode-editorRuler-foreground) inset;\n}\n",""]);const a=r},4978:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-progress-container {\n\twidth: 100%;\n\theight: 2px;\n\toverflow: hidden; /* keep progress bit in bounds */\n}\n\n.monaco-progress-container .progress-bit {\n\twidth: 2%;\n\theight: 2px;\n\tposition: absolute;\n\tleft: 0;\n\tdisplay: none;\n}\n\n.monaco-progress-container.active .progress-bit {\n\tdisplay: inherit;\n}\n\n.monaco-progress-container.discrete .progress-bit {\n\tleft: 0;\n\ttransition: width 100ms linear;\n}\n\n.monaco-progress-container.discrete.done .progress-bit {\n\twidth: 100%;\n}\n\n.monaco-progress-container.infinite .progress-bit {\n\tanimation-name: progress;\n\tanimation-duration: 4s;\n\tanimation-iteration-count: infinite;\n\ttransform: translate3d(0px, 0px, 0px);\n\tanimation-timing-function: linear;\n}\n\n.monaco-progress-container.infinite.infinite-long-running .progress-bit {\n\t/*\n\t\tThe more smooth `linear` timing function can cause\n\t\thigher GPU consumption as indicated in\n\t\thttps://github.com/microsoft/vscode/issues/97900 &\n\t\thttps://github.com/microsoft/vscode/issues/138396\n\t*/\n\tanimation-timing-function: steps(100);\n}\n\n/**\n * The progress bit has a width: 2% (1/50) of the parent container. The animation moves it from 0% to 100% of\n * that container. Since translateX is relative to the progress bit size, we have to multiple it with\n * its relative size to the parent container:\n * parent width: 5000%\n * bit width: 100%\n * translateX should be as follow:\n * 50%: 5000% * 50% - 50% (set to center) = 2450%\n * 100%: 5000% * 100% - 100% (do not overflow) = 4900%\n */\n@keyframes progress { from { transform: translateX(0%) scaleX(1) } 50% { transform: translateX(2500%) scaleX(3) } to { transform: translateX(4900%) scaleX(1) } }\n",""]);const a=r},5038:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-aria-container {\n\tposition: absolute; /* try to hide from window but not from screen readers */\n\tleft:-999em;\n}",""]);const a=r},5056:(e,t,i)=>{e.exports=function(e){var t=i.nc;t&&e.setAttribute("nonce",t)}},5070:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-select-box {\n\twidth: 100%;\n\tcursor: pointer;\n\tborder-radius: 2px;\n}\n\n.monaco-select-box-dropdown-container {\n\tfont-size: 13px;\n\tfont-weight: normal;\n\ttext-transform: none;\n}\n\n/** Actions */\n\n.monaco-action-bar .action-item.select-container {\n\tcursor: default;\n}\n\n.monaco-action-bar .action-item .monaco-select-box {\n\tcursor: pointer;\n\tmin-width: 100px;\n\tmin-height: 18px;\n\tpadding: 2px 23px 2px 8px;\n}\n\n.mac .monaco-action-bar .action-item .monaco-select-box {\n\tfont-size: 11px;\n\tborder-radius: 3px;\n\tmin-height: 24px;\n}\n",""]);const a=r},5071:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.floating-menu-overlay-widget {\n\tpadding: 0px;\n\tcolor: var(--vscode-button-foreground);\n\tbackground-color: var(--vscode-button-background);\n\tborder-radius: 2px;\n\tborder: 1px solid var(--vscode-contrastBorder);\n\tdisplay: flex;\n\talign-items: center;\n\tz-index: 10;\n\tbox-shadow: 0 2px 8px var(--vscode-widget-shadow);\n\toverflow: hidden;\n\n\t.action-item > .action-label {\n\t\tpadding: 5px;\n\t\tfont-size: 12px;\n\t\tborder-radius: 2px;\n\t}\n\n\t.action-item > .action-label.codicon {\n\t\tcolor: var(--vscode-button-foreground);\n\t}\n\n\t.action-item > .action-label.codicon:not(.separator) {\n\t\tpadding-top: 6px;\n\t\tpadding-bottom: 6px;\n\t}\n\n\t.action-item:first-child > .action-label {\n\t\tpadding-left: 7px;\n\t}\n\n\t.action-item:last-child > .action-label {\n\t\tpadding-right: 7px;\n\t}\n\n\t.action-item .action-label.separator {\n\t\tbackground-color: var(--vscode-menu-separatorBackground);\n\t}\n}\n",""]);const a=r},5072:e=>{var t=[];function i(e){for(var i=-1,n=0;n<t.length;n++)if(t[n].identifier===e){i=n;break}return i}function n(e,n){for(var s={},r=[],a=0;a<e.length;a++){var l=e[a],d=n.base?l[0]+n.base:l[0],h=s[d]||0,c="".concat(d," ").concat(h);s[d]=h+1;var u=i(c),g={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==u)t[u].references++,t[u].updater(g);else{var p=o(g,n);n.byIndex=a,t.splice(a,0,{identifier:c,updater:p,references:1})}r.push(c)}return r}function o(e,t){var i=t.domAPI(t);return i.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;i.update(e=t)}else i.remove()}}e.exports=function(e,o){var s=n(e=e||[],o=o||{});return function(e){e=e||[];for(var r=0;r<s.length;r++){var a=i(s[r]);t[a].references--}for(var l=n(e,o),d=0;d<s.length;d++){var h=i(s[d]);0===t[h].references&&(t[h].updater(),t.splice(h,1))}s=l}}},5277:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n.monaco-editor .lines-decorations {\n\tposition: absolute;\n\ttop: 0;\n\tbackground: white;\n}\n\n/*\n\tKeeping name short for faster parsing.\n\tcldr = core lines decorations rendering (div)\n*/\n.monaco-editor .margin-view-overlays .cldr {\n\tposition: absolute;\n\theight: 100%;\n}",""]);const a=r},5395:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* Find widget */\n.monaco-editor .find-widget {\n\tposition: absolute;\n\tz-index: 35;\n\theight: 33px;\n\toverflow: hidden;\n\tline-height: 19px;\n\ttransition: transform 200ms linear;\n\tpadding: 0 4px;\n\tbox-sizing: border-box;\n\ttransform: translateY(calc(-100% - 10px)); /* shadow (10px) */\n\tbox-shadow: 0 0 8px 2px var(--vscode-widget-shadow);\n\tcolor: var(--vscode-editorWidget-foreground);\n\tborder-left: 1px solid var(--vscode-widget-border);\n\tborder-right: 1px solid var(--vscode-widget-border);\n\tborder-bottom: 1px solid var(--vscode-widget-border);\n\tborder-bottom-left-radius: 4px;\n\tborder-bottom-right-radius: 4px;\n\tbackground-color: var(--vscode-editorWidget-background);\n}\n\n.monaco-workbench.reduce-motion .monaco-editor .find-widget {\n\ttransition: transform 0ms linear;\n}\n\n.monaco-editor .find-widget textarea {\n\tmargin: 0px;\n}\n\n.monaco-editor .find-widget.hiddenEditor {\n\tdisplay: none;\n}\n\n/* Find widget when replace is toggled on */\n.monaco-editor .find-widget.replaceToggled > .replace-part {\n\tdisplay: flex;\n}\n\n.monaco-editor .find-widget.visible {\n\ttransform: translateY(0);\n}\n\n/* This outline-color rule is used to override the outline color for synthetic-focus find input. */\n.monaco-editor .find-widget .monaco-inputbox.synthetic-focus {\n\toutline: 1px solid -webkit-focus-ring-color;\n\toutline-offset: -1px;\n\toutline-color: var(--vscode-focusBorder);\n}\n\n.monaco-editor .find-widget .monaco-inputbox .input {\n\tbackground-color: transparent;\n\tmin-height: 0;\n}\n\n.monaco-editor .find-widget .monaco-findInput .input {\n\tfont-size: 13px;\n}\n\n.monaco-editor .find-widget > .find-part,\n.monaco-editor .find-widget > .replace-part {\n\tmargin: 3px 25px 0 17px;\n\tfont-size: 12px;\n\tdisplay: flex;\n}\n\n.monaco-editor .find-widget > .find-part .monaco-inputbox,\n.monaco-editor .find-widget > .replace-part .monaco-inputbox {\n\tmin-height: 25px;\n}\n\n\n.monaco-editor .find-widget > .replace-part .monaco-inputbox > .ibwrapper > .mirror {\n\tpadding-right: 22px;\n}\n\n.monaco-editor .find-widget > .find-part .monaco-inputbox > .ibwrapper > .input,\n.monaco-editor .find-widget > .find-part .monaco-inputbox > .ibwrapper > .mirror,\n.monaco-editor .find-widget > .replace-part .monaco-inputbox > .ibwrapper > .input,\n.monaco-editor .find-widget > .replace-part .monaco-inputbox > .ibwrapper > .mirror {\n\tpadding-top: 2px;\n\tpadding-bottom: 2px;\n}\n\n.monaco-editor .find-widget > .find-part .find-actions {\n\theight: 25px;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-editor .find-widget > .replace-part .replace-actions {\n\theight: 25px;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-editor .find-widget .monaco-findInput {\n\tvertical-align: middle;\n\tdisplay: flex;\n\tflex:1;\n}\n\n.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element {\n\t/* Make sure textarea inherits the width correctly */\n\twidth: 100%;\n}\n\n.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element .scrollbar.vertical {\n\t/* Hide vertical scrollbar */\n\topacity: 0;\n}\n\n.monaco-editor .find-widget .matchesCount {\n\tdisplay: flex;\n\tflex: initial;\n\tmargin: 0 0 0 3px;\n\tpadding: 2px 0 0 2px;\n\theight: 25px;\n\tvertical-align: middle;\n\tbox-sizing: border-box;\n\ttext-align: center;\n\tline-height: 23px;\n}\n\n.monaco-editor .find-widget .button {\n\twidth: 16px;\n\theight: 16px;\n\tpadding: 3px;\n\tborder-radius: 5px;\n\tdisplay: flex;\n\tflex: initial;\n\tmargin-left: 3px;\n\tbackground-position: center center;\n\tbackground-repeat: no-repeat;\n\tcursor: pointer;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n/* find in selection button */\n.monaco-editor .find-widget .codicon-find-selection {\n\twidth: 22px;\n\theight: 22px;\n\tpadding: 3px;\n\tborder-radius: 5px;\n}\n\n.monaco-editor .find-widget .button.left {\n\tmargin-left: 0;\n\tmargin-right: 3px;\n}\n\n.monaco-editor .find-widget .button.wide {\n\twidth: auto;\n\tpadding: 1px 6px;\n\ttop: -1px;\n}\n\n.monaco-editor .find-widget .button.toggle {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 3px;\n\twidth: 18px;\n\theight: 100%;\n\tborder-radius: 0;\n\tbox-sizing: border-box;\n}\n\n.monaco-editor .find-widget .button.toggle.disabled {\n\tdisplay: none;\n}\n\n.monaco-editor .find-widget .disabled {\n\tcolor: var(--vscode-disabledForeground);\n\tcursor: default;\n}\n\n.monaco-editor .find-widget > .replace-part {\n\tdisplay: none;\n}\n\n.monaco-editor .find-widget > .replace-part > .monaco-findInput {\n\tposition: relative;\n\tdisplay: flex;\n\tvertical-align: middle;\n\tflex: auto;\n\tflex-grow: 0;\n\tflex-shrink: 0;\n}\n\n.monaco-editor .find-widget > .replace-part > .monaco-findInput > .controls {\n\tposition: absolute;\n\ttop: 3px;\n\tright: 2px;\n}\n\n/* REDUCED */\n.monaco-editor .find-widget.reduced-find-widget .matchesCount {\n\tdisplay:none;\n}\n\n/* NARROW (SMALLER THAN REDUCED) */\n.monaco-editor .find-widget.narrow-find-widget {\n\tmax-width: 257px !important;\n}\n\n/* COLLAPSED (SMALLER THAN NARROW) */\n.monaco-editor .find-widget.collapsed-find-widget {\n\tmax-width: 170px !important;\n}\n\n.monaco-editor .find-widget.collapsed-find-widget .button.previous,\n.monaco-editor .find-widget.collapsed-find-widget .button.next,\n.monaco-editor .find-widget.collapsed-find-widget .button.replace,\n.monaco-editor .find-widget.collapsed-find-widget .button.replace-all,\n.monaco-editor .find-widget.collapsed-find-widget > .find-part .monaco-findInput .controls {\n\tdisplay:none;\n}\n\n.monaco-editor .find-widget.no-results .matchesCount {\n\tcolor: var(--vscode-errorForeground);\n}\n\n.monaco-editor .findMatch {\n\tanimation-duration: 0;\n\tanimation-name: inherit !important;\n\tbackground-color: var(--vscode-editor-findMatchHighlightBackground);\n}\n\n.monaco-editor .currentFindMatch {\n\tbackground-color: var(--vscode-editor-findMatchBackground);\n\tborder: 2px solid var(--vscode-editor-findMatchBorder);\n\tpadding: 1px;\n\tbox-sizing: border-box;\n}\n\n.monaco-editor .findScope {\n\tbackground-color: var(--vscode-editor-findRangeHighlightBackground);\n}\n\n.monaco-editor .find-widget .monaco-sash {\n\tleft: 0 !important;\n\tbackground-color: var(--vscode-editorWidget-resizeBorder, var(--vscode-editorWidget-border));\n}\n\n.monaco-editor.hc-black .find-widget .button:before {\n\tposition: relative;\n\ttop: 1px;\n\tleft: 2px;\n}\n\n/* Action bars */\n.monaco-editor .find-widget .button:not(.disabled):hover,\n.monaco-editor .find-widget .codicon-find-selection:hover {\n\tbackground-color: var(--vscode-toolbar-hoverBackground) !important;\n}\n\n.monaco-editor.findMatch {\n\tbackground-color: var(--vscode-editor-findMatchHighlightBackground);\n}\n\n.monaco-editor.currentFindMatch {\n\tbackground-color: var(--vscode-editor-findMatchBackground);\n}\n\n.monaco-editor.findScope {\n\tbackground-color: var(--vscode-editor-findRangeHighlightBackground);\n}\n\n.monaco-editor.findMatch {\n\tbackground-color: var(--vscode-editorWidget-background);\n}\n\n/* Close button position. */\n.monaco-editor .find-widget > .button.codicon-widget-close {\n\tposition: absolute;\n\ttop: 5px;\n\tright: 4px;\n}\n",""]);const a=r},5405:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,'/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n.monaco-editor .margin-view-overlays .codicon-folding-manual-collapsed,\n.monaco-editor .margin-view-overlays .codicon-folding-manual-expanded,\n.monaco-editor .margin-view-overlays .codicon-folding-expanded,\n.monaco-editor .margin-view-overlays .codicon-folding-collapsed {\n\tcursor: pointer;\n\topacity: 0;\n\ttransition: opacity 0.5s;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tfont-size: 140%;\n\tmargin-left: 2px;\n}\n\n.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-collapsed,\n.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-expanded,\n.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-expanded,\n.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-collapsed {\n\ttransition: initial;\n}\n\n.monaco-editor .margin-view-overlays:hover .codicon,\n.monaco-editor .margin-view-overlays .codicon.codicon-folding-collapsed,\n.monaco-editor .margin-view-overlays .codicon.codicon-folding-manual-collapsed,\n.monaco-editor .margin-view-overlays .codicon.alwaysShowFoldIcons {\n\topacity: 1;\n}\n\n.monaco-editor .inline-folded:after {\n\tcolor: var(--vscode-editor-foldPlaceholderForeground);\n\tmargin: 0.1em 0.2em 0 0.2em;\n\tcontent: "\\22EF"; /* ellipses unicode character */\n\tdisplay: inline;\n\tline-height: 1em;\n\tcursor: pointer;\n}\n\n.monaco-editor .folded-background {\n\tbackground-color: var(--vscode-editor-foldBackground);\n}\n\n.monaco-editor .cldr.codicon.codicon-folding-expanded,\n.monaco-editor .cldr.codicon.codicon-folding-collapsed,\n.monaco-editor .cldr.codicon.codicon-folding-manual-expanded,\n.monaco-editor .cldr.codicon.codicon-folding-manual-collapsed {\n\tcolor: var(--vscode-editorGutter-foldingControlForeground) !important;\n}\n',""]);const a=r},5422:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-keybinding {\n\tdisplay: flex;\n\talign-items: center;\n\tline-height: 10px;\n}\n\n.monaco-keybinding > .monaco-keybinding-key {\n\tdisplay: inline-block;\n\tborder-style: solid;\n\tborder-width: 1px;\n\tborder-radius: 3px;\n\tvertical-align: middle;\n\tfont-size: 11px;\n\tpadding: 3px 5px;\n\tmargin: 0 2px;\n}\n\n.monaco-keybinding > .monaco-keybinding-key:first-child {\n\tmargin-left: 0;\n}\n\n.monaco-keybinding > .monaco-keybinding-key:last-child {\n\tmargin-right: 0;\n}\n\n.monaco-keybinding > .monaco-keybinding-key-separator {\n\tdisplay: inline-block;\n}\n\n.monaco-keybinding > .monaco-keybinding-key-chord-separator {\n\twidth: 6px;\n}\n",""]);const a=r},5669:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .findOptionsWidget {\n\tbackground-color: var(--vscode-editorWidget-background);\n\tcolor: var(--vscode-editorWidget-foreground);\n\tbox-shadow: 0 0 8px 2px var(--vscode-widget-shadow);\n\tborder: 2px solid var(--vscode-contrastBorder);\n}\n",""]);const a=r},6049:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* -------------------- IE10 remove auto clear button -------------------- */\n\n::-ms-clear {\n\tdisplay: none;\n}\n\n/* All widgets */\n/* I am not a big fan of this rule */\n.monaco-editor .editor-widget input {\n\tcolor: inherit;\n}\n\n/* -------------------- Editor -------------------- */\n\n.monaco-editor {\n\tposition: relative;\n\toverflow: visible;\n\t-webkit-text-size-adjust: 100%;\n\tcolor: var(--vscode-editor-foreground);\n\tbackground-color: var(--vscode-editor-background);\n\toverflow-wrap: initial;\n}\n.monaco-editor-background {\n\tbackground-color: var(--vscode-editor-background);\n}\n.monaco-editor .rangeHighlight {\n\tbackground-color: var(--vscode-editor-rangeHighlightBackground);\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-editor-rangeHighlightBorder);\n}\n.monaco-editor.hc-black .rangeHighlight, .monaco-editor.hc-light .rangeHighlight {\n\tborder-style: dotted;\n}\n.monaco-editor .symbolHighlight {\n\tbackground-color: var(--vscode-editor-symbolHighlightBackground);\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-editor-symbolHighlightBorder);\n}\n.monaco-editor.hc-black .symbolHighlight, .monaco-editor.hc-light .symbolHighlight {\n\tborder-style: dotted;\n}\n\n.monaco-editor .editorCanvas {\n\tposition: absolute;\n\twidth: 100%;\n\theight: 100%;\n\tz-index: 0;\n\tpointer-events: none;\n}\n\n/* -------------------- Misc -------------------- */\n\n.monaco-editor .overflow-guard {\n\tposition: relative;\n\toverflow: hidden;\n}\n\n.monaco-editor .view-overlays {\n\tposition: absolute;\n\ttop: 0;\n}\n\n.monaco-editor .view-overlays > div, .monaco-editor .margin-view-overlays > div {\n\tposition: absolute;\n\twidth: 100%;\n}\n\n/*\n.monaco-editor .auto-closed-character {\n\topacity: 0.3;\n}\n*/\n\n\n.monaco-editor .squiggly-error {\n\tborder-bottom: 4px double var(--vscode-editorError-border);\n}\n.monaco-editor .squiggly-error::before {\n\tdisplay: block;\n\tcontent: '';\n\twidth: 100%;\n\theight: 100%;\n\tbackground: var(--vscode-editorError-background);\n}\n.monaco-editor .squiggly-warning {\n\tborder-bottom: 4px double var(--vscode-editorWarning-border);\n}\n.monaco-editor .squiggly-warning::before {\n\tdisplay: block;\n\tcontent: '';\n\twidth: 100%;\n\theight: 100%;\n\tbackground: var(--vscode-editorWarning-background);\n}\n.monaco-editor .squiggly-info {\n\tborder-bottom: 4px double var(--vscode-editorInfo-border);\n}\n.monaco-editor .squiggly-info::before {\n\tdisplay: block;\n\tcontent: '';\n\twidth: 100%;\n\theight: 100%;\n\tbackground: var(--vscode-editorInfo-background);\n}\n.monaco-editor .squiggly-hint {\n\tborder-bottom: 2px dotted var(--vscode-editorHint-border);\n}\n.monaco-editor.showUnused .squiggly-unnecessary {\n\tborder-bottom: 2px dashed var(--vscode-editorUnnecessaryCode-border);\n}\n.monaco-editor.showDeprecated .squiggly-inline-deprecated {\n\ttext-decoration: line-through;\n\ttext-decoration-color: var(--vscode-editor-foreground, inherit);\n}\n",""]);const a=r},6060:e=>{e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjQzVDNUM1Ii8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="},6065:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.editor-banner {\n\tbox-sizing: border-box;\n\tcursor: default;\n\twidth: 100%;\n\tfont-size: 12px;\n\tdisplay: flex;\n\toverflow: visible;\n\n\theight: 26px;\n\n\tbackground: var(--vscode-banner-background);\n}\n\n\n.editor-banner .icon-container {\n\tdisplay: flex;\n\tflex-shrink: 0;\n\talign-items: center;\n\tpadding: 0 6px 0 10px;\n}\n\n.editor-banner .icon-container.custom-icon {\n\tbackground-repeat: no-repeat;\n\tbackground-position: center center;\n\tbackground-size: 16px;\n\twidth: 16px;\n\tpadding: 0;\n\tmargin: 0 6px 0 10px;\n}\n\n.editor-banner .message-container {\n\tdisplay: flex;\n\talign-items: center;\n\tline-height: 26px;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n\toverflow: hidden;\n}\n\n.editor-banner .message-container p {\n\tmargin-block-start: 0;\n\tmargin-block-end: 0;\n}\n\n.editor-banner .message-actions-container {\n\tflex-grow: 1;\n\tflex-shrink: 0;\n\tline-height: 26px;\n\tmargin: 0 4px;\n}\n\n.editor-banner .message-actions-container a.monaco-button {\n\twidth: inherit;\n\tmargin: 2px 8px;\n\tpadding: 0px 12px;\n}\n\n.editor-banner .message-actions-container a {\n\tpadding: 3px;\n\tmargin-left: 12px;\n\ttext-decoration: underline;\n}\n\n.editor-banner .action-container {\n\tpadding: 0 10px 0 6px;\n}\n\n.editor-banner {\n\tbackground-color: var(--vscode-banner-background);\n}\n\n.editor-banner,\n.editor-banner .action-container .codicon,\n.editor-banner .message-actions-container .monaco-link {\n\tcolor: var(--vscode-banner-foreground);\n}\n\n.editor-banner .icon-container .codicon {\n\tcolor: var(--vscode-banner-iconForeground);\n}\n",""]);const a=r},6288:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-action-bar {\n\twhite-space: nowrap;\n\theight: 100%;\n}\n\n.monaco-action-bar .actions-container {\n\tdisplay: flex;\n\tmargin: 0 auto;\n\tpadding: 0;\n\theight: 100%;\n\twidth: 100%;\n\talign-items: center;\n}\n\n.monaco-action-bar.vertical .actions-container {\n\tdisplay: inline-block;\n}\n\n.monaco-action-bar .action-item {\n\tdisplay: block;\n\talign-items: center;\n\tjustify-content: center;\n\tcursor: pointer;\n\tposition: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */\n}\n\n.monaco-action-bar .action-item.disabled {\n\tcursor: default;\n}\n\n.monaco-action-bar .action-item .icon,\n.monaco-action-bar .action-item .codicon {\n\tdisplay: block;\n}\n\n.monaco-action-bar .action-item .codicon {\n\tdisplay: flex;\n\talign-items: center;\n\twidth: 16px;\n\theight: 16px;\n}\n\n.monaco-action-bar .action-label {\n\tdisplay: flex;\n\tfont-size: 11px;\n\tpadding: 3px;\n\tborder-radius: 5px;\n}\n\n.monaco-action-bar .action-item.disabled .action-label,\n.monaco-action-bar .action-item.disabled .action-label::before,\n.monaco-action-bar .action-item.disabled .action-label:hover {\n\topacity: 0.6;\n}\n\n/* Vertical actions */\n\n.monaco-action-bar.vertical {\n\ttext-align: left;\n}\n\n.monaco-action-bar.vertical .action-item {\n\tdisplay: block;\n}\n\n.monaco-action-bar.vertical .action-label.separator {\n\tdisplay: block;\n\tborder-bottom: 1px solid #bbb;\n\tpadding-top: 1px;\n\tmargin-left: .8em;\n\tmargin-right: .8em;\n}\n\n.monaco-action-bar .action-item .action-label.separator {\n\twidth: 1px;\n\theight: 16px;\n\tmargin: 5px 4px !important;\n\tcursor: default;\n\tmin-width: 1px;\n\tpadding: 0;\n\tbackground-color: #bbb;\n}\n\n.secondary-actions .monaco-action-bar .action-label {\n\tmargin-left: 6px;\n}\n\n/* Action Items */\n.monaco-action-bar .action-item.select-container {\n\toverflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */\n\tflex: 1;\n\tmax-width: 170px;\n\tmin-width: 60px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin-right: 10px;\n}\n\n.monaco-action-bar .action-item.action-dropdown-item {\n\tdisplay: flex;\n}\n\n.monaco-action-bar .action-item.action-dropdown-item > .action-dropdown-item-separator {\n\tdisplay: flex;\n\talign-items: center;\n\tcursor: default;\n}\n\n.monaco-action-bar .action-item.action-dropdown-item > .action-dropdown-item-separator > div {\n\twidth: 1px;\n}\n",""]);const a=r},6312:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-select-box {\n\twidth: 100%;\n\tcursor: pointer;\n\tborder-radius: 2px;\n}\n\n.monaco-select-box-dropdown-container {\n\tfont-size: 13px;\n\tfont-weight: normal;\n\ttext-transform: none;\n}\n\n/** Actions */\n\n.monaco-action-bar .action-item.select-container {\n\tcursor: default;\n}\n\n.monaco-action-bar .action-item .monaco-select-box {\n\tcursor: pointer;\n\tmin-width: 100px;\n\tmin-height: 18px;\n\tpadding: 2px 23px 2px 8px;\n}\n\n.mac .monaco-action-bar .action-item .monaco-select-box {\n\tfont-size: 11px;\n\tborder-radius: 5px;\n}\n",""]);const a=r},6314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var i="",n=void 0!==t[5];return t[4]&&(i+="@supports (".concat(t[4],") {")),t[2]&&(i+="@media ".concat(t[2]," {")),n&&(i+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),i+=e(t),n&&(i+="}"),t[2]&&(i+="}"),t[4]&&(i+="}"),i})).join("")},t.i=function(e,i,n,o,s){"string"==typeof e&&(e=[[null,e,void 0]]);var r={};if(n)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(r[l]=!0)}for(var d=0;d<e.length;d++){var h=[].concat(e[d]);n&&r[h[0]]||(void 0!==s&&(void 0===h[5]||(h[1]="@layer".concat(h[5].length>0?" ".concat(h[5]):""," {").concat(h[1],"}")),h[5]=s),i&&(h[2]?(h[1]="@media ".concat(h[2]," {").concat(h[1],"}"),h[2]=i):h[2]=i),o&&(h[4]?(h[1]="@supports (".concat(h[4],") {").concat(h[1],"}"),h[4]=o):h[4]="".concat(o)),t.push(h))}},t}},6378:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* -- zone widget */\n.monaco-editor .zone-widget .zone-widget-container.reference-zone-widget {\n\tborder-top-width: 1px;\n\tborder-bottom-width: 1px;\n}\n\n.monaco-editor .reference-zone-widget .inline {\n\tdisplay: inline-block;\n\tvertical-align: top;\n}\n\n.monaco-editor .reference-zone-widget .messages {\n\theight: 100%;\n\twidth: 100%;\n\ttext-align: center;\n\tpadding: 3em 0;\n}\n\n.monaco-editor .reference-zone-widget .ref-tree {\n\tline-height: 23px;\n\tbackground-color: var(--vscode-peekViewResult-background);\n\tcolor: var(--vscode-peekViewResult-lineForeground);\n}\n\n.monaco-editor .reference-zone-widget .ref-tree .reference {\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n}\n\n.monaco-editor .reference-zone-widget .ref-tree .reference-file {\n\tdisplay: inline-flex;\n\twidth: 100%;\n\theight: 100%;\n\tcolor: var(--vscode-peekViewResult-fileForeground);\n}\n\n.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .selected .reference-file {\n\tcolor: inherit !important;\n}\n\n.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows > .monaco-list-row.selected:not(.highlighted) {\n\tbackground-color: var(--vscode-peekViewResult-selectionBackground);\n\tcolor: var(--vscode-peekViewResult-selectionForeground) !important;\n}\n\n.monaco-editor .reference-zone-widget .ref-tree .reference-file .count {\n\tmargin-right: 12px;\n\tmargin-left: auto;\n}\n\n.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight {\n\tbackground-color: var(--vscode-peekViewResult-matchHighlightBackground);\n}\n\n.monaco-editor .reference-zone-widget .preview .reference-decoration {\n\tbackground-color: var(--vscode-peekViewEditor-matchHighlightBackground);\n\tborder: 2px solid var(--vscode-peekViewEditor-matchHighlightBorder);\n\tbox-sizing: border-box;\n}\n\n.monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background,\n.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input {\n\tbackground-color: var(--vscode-peekViewEditor-background);\n}\n\n.monaco-editor .reference-zone-widget .preview .monaco-editor .margin {\n\tbackground-color: var(--vscode-peekViewEditorGutter-background);\n}\n\n/* High Contrast Theming */\n\n.monaco-editor.hc-black .reference-zone-widget .ref-tree .reference-file,\n.monaco-editor.hc-light .reference-zone-widget .ref-tree .reference-file {\n\tfont-weight: bold;\n}\n\n.monaco-editor.hc-black .reference-zone-widget .ref-tree .referenceMatch .highlight,\n.monaco-editor.hc-light .reference-zone-widget .ref-tree .referenceMatch .highlight {\n\tborder: 1px dotted var(--vscode-contrastActiveBorder, transparent);\n\tbox-sizing: border-box;\n}\n",""]);const a=r},6437:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n\n.monaco-editor.vs .valueSetReplacement {\n\toutline: solid 2px var(--vscode-editorBracketMatch-border);\n}\n",""]);const a=r},6458:(e,t,i)=>{i.d(t,{A:()=>w});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s),a=i(4417),l=i.n(a),d=new URL(i(996),i.b),h=new URL(i(6889),i.b),c=new URL(i(937),i.b),u=new URL(i(3326),i.b),g=new URL(i(2561),i.b),p=r()(o()),m=l()(d),f=l()(h),_=l()(c),v=l()(u),b=l()(g);p.push([e.id,`/*!\n * Multiple-Select-Vanilla styling\n * @author zhixin wen <wenzhixin2010@gmail.com>\n * @contributor Ghislain B.\n */.ms-dark-mode{--ms-checkbox-color: rgb(26.2195121951, 188.7804878049, 174.3597560976);--ms-checkbox-hover-color: rgb(28.0853658537, 202.2146341463, 186.7676829268);--ms-checkbox-icon-container-border: 1px solid #797979;--ms-choice-border: 1px solid #757575;--ms-choice-bgcolor: #262b2f;--ms-choice-color: #d4d4d4;--ms-choice-focus-border-color: rgb(23.1097560976, 166.3902439024, 153.6798780488);--ms-choice-focus-box-shadow: 0 0 0 2px rgba(20, 144, 133, 0.2);--ms-drop-background: #2a2f34;--ms-drop-border: 1px solid #585858;--ms-drop-color: #cccccc;--ms-drop-hide-radio-hover-bgcolor: rgb(16.8902439024, 121.6097560976, 112.3201219512);--ms-drop-option-divider-border-top: 1px solid #696969;--ms-drop-scrollbar-color: #828282 #424242;--ms-icon-color: #bcbcbc;--ms-icon-color-hover: #d0d0d0;--ms-option-highlight-bg-color: rgb(13.7804878049, 99.2195121951, 91.6402439024);--ms-ok-button-bg-color: #262b2f;--ms-ok-button-bg-hover-color: #24282c;--ms-ok-button-border-color: #4a4a4a;--ms-ok-button-text-color: rgb(23.1097560976, 166.3902439024, 153.6798780488);--ms-ok-button-text-hover-color: rgb(23.1097560976, 166.3902439024, 153.6798780488);--ms-optgroup-color: #fff;--ms-search-input-bg-color: #2f353a;--ms-search-input-color: #d4d4d4;--ms-search-input-border: 1px solid #757575;--ms-select-all-border-bottom: 1px solid #5d5d5d;--ms-select-all-text-color: #fff;--ms-select-all-text-font-weight: bold}/*!\n * Multiple-Select-Vanilla styling\n * @author zhixin wen <wenzhixin2010@gmail.com>\n * @contributor Ghislain B.\n */.ms-icon-caret{--ms-icon-caret-icon-svg: url(${m});-webkit-mask:var(--ms-icon-caret-icon-svg) no-repeat;mask:var(--ms-icon-caret-icon-svg) no-repeat;mask-size:100% 100%;-webkit-mask-size:100% 100%}.ms-icon-close{--ms-icon-close-icon-svg: url(${f});-webkit-mask:var(--ms-icon-close-icon-svg) no-repeat;mask:var(--ms-icon-close-icon-svg) no-repeat;mask-size:100% 100%;-webkit-mask-size:100% 100%}.ms-icon-check{--ms-icon-check-icon-svg: url(${_});-webkit-mask:var(--ms-icon-check-icon-svg) no-repeat;mask:var(--ms-icon-check-icon-svg) no-repeat;mask-size:100% 100%;-webkit-mask-size:100% 100%}.ms-icon-minus{--ms-icon-minus-icon-svg: url(${v});-webkit-mask:var(--ms-icon-minus-icon-svg) no-repeat;mask:var(--ms-icon-minus-icon-svg) no-repeat;mask-size:100% 100%;-webkit-mask-size:100% 100%}.ms-icon-radio{--ms-icon-radio-icon-svg: url(${b});-webkit-mask:var(--ms-icon-radio-icon-svg) no-repeat;mask:var(--ms-icon-radio-icon-svg) no-repeat;mask-size:100% 100%;-webkit-mask-size:100% 100%}.ms-parent .ms-icon,.ms-drop .ms-icon{display:inline-block;background-color:currentColor;flex-shrink:0;color:var(--ms-icon-color, #444);font-size:var(--ms-icon-size, 1em);height:var(--ms-icon-size, 1em);width:var(--ms-icon-size, 1em)}.ms-parent .ms-icon:hover,.ms-drop .ms-icon:hover{color:var(--ms-icon-color-hover, #303030)}.ms-parent .ms-select-all,.ms-parent li:not(.hide-radio),.ms-drop .ms-select-all,.ms-drop li:not(.hide-radio){cursor:pointer}.ms-parent .ms-select-all.disabled,.ms-parent li:not(.hide-radio).disabled,.ms-drop .ms-select-all.disabled,.ms-drop li:not(.hide-radio).disabled{cursor:default}.ms-parent .ms-select-all .icon-checkbox-container,.ms-parent li:not(.hide-radio) .icon-checkbox-container,.ms-drop .ms-select-all .icon-checkbox-container,.ms-drop li:not(.hide-radio) .icon-checkbox-container{display:inline-flex;align-items:center;justify-content:center;height:var(--ms-checkbox-icon-container-height, 1.05rem);width:var(--ms-checkbox-icon-container-width, 1.05rem);border:var(--ms-checkbox-icon-container-border, 1px solid #d0d0d0);border-radius:.125rem}.ms-parent .ms-select-all .icon-checkbox-container div,.ms-parent li:not(.hide-radio) .icon-checkbox-container div,.ms-drop .ms-select-all .icon-checkbox-container div,.ms-drop li:not(.hide-radio) .icon-checkbox-container div{font-size:14px;color:var(--ms-checkbox-color, #149085)}.ms-parent .ms-select-all .icon-checkbox-container div:hover,.ms-parent li:not(.hide-radio) .icon-checkbox-container div:hover,.ms-drop .ms-select-all .icon-checkbox-container div:hover,.ms-drop li:not(.hide-radio) .icon-checkbox-container div:hover{color:var(--ms-checkbox-hover-color, rgb(18.1341463415, 130.5658536585, 120.5920731707))}.ms-parent .ms-select-all .icon-checkbox-container div.ms-icon-uncheck,.ms-parent li:not(.hide-radio) .icon-checkbox-container div.ms-icon-uncheck,.ms-drop .ms-select-all .icon-checkbox-container div.ms-icon-uncheck,.ms-drop li:not(.hide-radio) .icon-checkbox-container div.ms-icon-uncheck{visibility:hidden}.ms-parent .ms-select-all .icon-checkbox-container.radio,.ms-parent li:not(.hide-radio) .icon-checkbox-container.radio,.ms-drop .ms-select-all .icon-checkbox-container.radio,.ms-drop li:not(.hide-radio) .icon-checkbox-container.radio{border-radius:50%}.ms-parent .ms-select-all .icon-checkbox-container+span,.ms-parent li:not(.hide-radio) .icon-checkbox-container+span,.ms-drop .ms-select-all .icon-checkbox-container+span,.ms-drop li:not(.hide-radio) .icon-checkbox-container+span{display:inline-flex;align-items:center;column-gap:var(--ms-label-column-gap, 0);padding-left:var(--ms-label-text-padding-left, 8px)}.ms-offscreen{clip:rect(0 0 0 0) !important;width:1px !important;height:1px !important;border:0 !important;margin:0 !important;padding:0 !important;overflow:hidden !important;position:absolute !important;outline:0 !important;left:auto !important;top:auto !important}.ms-parent{display:inline-block;position:relative;vertical-align:middle}.ms-choice{display:flex;align-items:center;cursor:pointer;width:100%;height:26px;overflow:hidden;padding:var(--ms-choice-padding, 0 6px 0 8px);background-color:var(--ms-choice-bgcolor, #fff);border:var(--ms-choice-border, 1px solid #d0d0d0);border-radius:var(--ms-choice-border-radius, 4px);line-height:var(--ms-choice-line-height, 26px);color:var(--ms-choice-color, #444);text-align:var(--ms-choice-text-align, left);outline:var(--ms-drop-outline, 0);text-decoration:none;user-select:none;white-space:nowrap}.ms-choice:focus{border-color:var(--ms-choice-focus-border-color, rgb(219.8780487805, 250.1219512195, 247.4390243902));box-shadow:var(--ms-choice-focus-box-shadow, 0 0 0 1.5px rgba(20, 144, 133, 0.35))}.ms-choice.disabled{border:var(--ms-choice-disabled-border, 1px solid #ddd);background-color:var(--ms-choice-disabled-bgcolor, #f4f4f4);background-image:none;cursor:default}.ms-choice>span{display:flex;flex:1;align-items:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;column-gap:var(--ms-label-column-gap, 0)}.ms-choice>span.ms-placeholder{color:var(--ms-placeholder-color, #999)}.ms-choice>div.ms-icon-close{margin-right:2px}.ms-choice>div.ms-icon-caret{height:var(--ms-chevron-icon-size, 1.2em);width:var(--ms-chevron-icon-size, 1.2em)}.ms-choice>div.ms-icon-caret.open{transform:scaleY(-1)}.ms-drop{width:auto;min-width:100%;overflow:hidden;display:none;position:absolute;background:var(--ms-drop-background, #fff);border:var(--ms-drop-border, 1px solid #d0d0d0);border-radius:var(--ms-drop-border-radius, 4px);color:var(--ms-drop-color, #000);margin-top:var(--ms-drop-margin-top, -1px);padding:var(--ms-drop-padding, 0);z-index:var(--ms-drop-zindex, 1050)}.ms-drop.bottom{top:100%;box-shadow:var(--ms-drop-bottom-box-shadow, 0 4px 5px rgba(0, 0, 0, 0.15))}.ms-drop.top{bottom:100%;box-shadow:var(--ms-drop-top-box-shadow, 0 -4px 5px rgba(0, 0, 0, 0.15))}.ms-drop .ms-select-all{border-bottom:var(--ms-select-all-border-bottom, 1px solid #ddd);line-height:var(--ms-select-all-line-height, 18px);padding:var(--ms-select-all-padding, 4px);width:100%}.ms-drop .ms-select-all:hover{background-color:var(--ms-select-all-text-hover-color, transparent)}.ms-drop .ms-select-all.highlighted{background-color:var(--ms-option-highlight-bg-color, rgba(20, 144, 133, 0.08))}.ms-drop .ms-select-all label{display:inline-flex;align-items:center;font-weight:var(--ms-select-all-text-font-weight, normal);padding:var(--ms-select-all-label-padding, 4px);border:var(--ms-select-all-label-border, 1px solid transparent);color:var(--ms-select-all-text-color, rgb(16.8902439024, 121.6097560976, 112.3201219512));width:100%}.ms-drop .ms-select-all label:hover{cursor:pointer;border:var(--ms-select-all-label-hover-border, 1px solid transparent)}.ms-drop .ms-select-all label input{opacity:0;width:0;margin-left:0}.ms-drop .ms-select-all label div{display:inline-flex}.ms-drop .ms-ok-button{cursor:pointer;display:block;padding:var(--ms-ok-button-padding, 0);width:var(--ms-ok-button-width, 100%);height:var(--ms-ok-button-height, 26px);border-color:var(--ms-ok-button-border-color, #ccc);border-radius:var(--ms-ok-button-border-radius, 0 0 4px 4px);border-width:var(--ms-ok-button-border-width, 1px 0 0 0);text-align:var(--ms-ok-button-text-align, center);color:var(--ms-ok-button-text-color, #149085);font-weight:var(--ms-ok-button-font-weight, 600);background-color:var(--ms-ok-button-bg-color, #fff)}.ms-drop .ms-ok-button:hover{background-color:var(--ms-ok-button-bg-hover-color, #f9f9f9);color:var(--ms-ok-button-text-hover-color, rgb(16.8902439024, 121.6097560976, 112.3201219512))}.ms-search{display:flex;align-items:center;justify-content:center;box-sizing:border-box;position:relative;white-space:nowrap;width:100%;margin:var(--ms-search-margin, 0);min-height:var(--ms-search-min-height, 26px);padding:var(--ms-search-padding, 4px);z-index:var(--ms-search-zindex, 10000)}.ms-search input{box-shadow:none;font-family:sans-serif;height:auto !important;width:100%;color:var(--ms-search-input-color, #444);background-color:var(--ms-search-input-bg-color, #fff);border:var(--ms-search-input-border, 1px solid #b9b9b9);border-radius:var(--ms-search-input-border-radius, 5px);min-height:var(--ms-search-input-min-height, 24px);outline:var(--ms-search-input-outline, 0);padding:var(--ms-search-input-padding, 0 5px);margin:var(--ms-search-input-margin, 0)}.ms-search input::placeholder{color:var(--ms-search-input-placeholder, #999)}.ms-search span.ms-icon-close{cursor:pointer;height:var(--ms-icon-size, 1em);margin:var(--ms-search-icon-close-margin, 0 4px 0 7px)}.ms-drop ul{overflow:auto;outline:var(--ms-drop-outline, 0);margin:var(--ms-drop-list-margin, 0px);padding:var(--ms-drop-list-padding, 0px);scrollbar-color:var(--ms-drop-scrollbar-color, #c1c1c1 #f1f1f1)}.ms-drop ul>li{cursor:pointer;background-image:none;list-style:none;position:static;align-items:var(--ms-drop-list-item-align-items, center);display:var(--ms-drop-list-item-display, flex);padding:var(--ms-drop-list-item-padding, 0.25rem 8px)}.ms-drop ul>li .disabled{cursor:default;font-weight:normal !important;opacity:var(--ms-drop-list-item-disabled-opacity, 0.35);filter:var(--ms-drop-list-item-disabled-filter, Alpha(Opacity=35))}.ms-drop ul>li.multiple{display:block;float:left}.ms-drop ul>li.group{clear:both}.ms-drop ul>li.multiple label{width:100%;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ms-drop ul>li label{cursor:pointer;display:flex;align-items:center;font-weight:normal;position:relative;white-space:nowrap;flex:0 0 100%;margin-bottom:var(--ms-label-margin-bottom, 0);min-height:var(--ms-label-min-height, 1.25rem);padding:var(--ms-label-padding, 0 0 0 2px)}.ms-drop ul>li label.optgroup{color:var(--ms-optgroup-color, #000);font-weight:var(--ms-drop-optgroup-font-weight, bold)}.ms-drop ul>li.hide-radio{padding:var(--ms-drop-hide-radio-padding, 0)}.ms-drop ul>li.hide-radio:focus,.ms-drop ul>li.hide-radio:hover{background-color:var(--ms-drop-hide-radio-hover-bgcolor, #f8f9fa)}.ms-drop ul>li.hide-radio.selected{color:var(--ms-drop-hide-radio-selected-color, #fff);background-color:var(--ms-drop-hide-radio-selected-bgcolor, #149085)}.ms-drop ul>li.hide-radio label{margin-bottom:var(--ms-drop-hide-radio-label-margin-bottom, 0);padding:var(--ms-drop-hide-radio-label-padding, 5px 8px)}.ms-drop ul>li.hide-radio input{display:none}.ms-drop ul>li.option-level-1 label{padding-left:var(--ms-drop-list-item-level1-padding-left, 8px)}.ms-drop ul>li.option-divider{padding:var(--ms-drop-option-divider-padding, 0);border-top:var(--ms-drop-option-divider-border-top, 1px solid #e9ecef)}.ms-drop ul>li.highlighted{background-color:var(--ms-option-highlight-bg-color, rgba(20, 144, 133, 0.08))}.ms-drop input[type=radio],.ms-drop input[type=checkbox]{opacity:0;width:0;position:absolute;margin-left:var(--ms-drop-input-margin-left, -1.25rem);margin-top:var(--ms-drop-input-margin-top, 0.3rem);accent-color:var(--ms-checkbox-color, #149085)}.ms-drop input:focus{outline:var(--ms-input-focus-outline, none)}.ms-drop .ms-no-results{display:none}.ms-drop .ms-infinite-option{height:var(--ms-infinite-empty-option-height, 20px)}\n`,""]);const w=p},6493:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* START cover the case that slider is visible on mouseover */\n.monaco-editor .minimap.slider-mouseover .minimap-slider {\n\topacity: 0;\n\ttransition: opacity 100ms linear;\n}\n.monaco-editor .minimap.slider-mouseover:hover .minimap-slider {\n\topacity: 1;\n}\n.monaco-editor .minimap.slider-mouseover .minimap-slider.active {\n\topacity: 1;\n}\n/* END cover the case that slider is visible on mouseover */\n.monaco-editor .minimap-slider .minimap-slider-horizontal {\n\tbackground: var(--vscode-minimapSlider-background);\n}\n.monaco-editor .minimap-slider:hover .minimap-slider-horizontal {\n\tbackground: var(--vscode-minimapSlider-hoverBackground);\n}\n.monaco-editor .minimap-slider.active .minimap-slider-horizontal {\n\tbackground: var(--vscode-minimapSlider-activeBackground);\n}\n.monaco-editor .minimap-shadow-visible {\n\tbox-shadow: var(--vscode-scrollbar-shadow) -6px 0 6px -6px inset;\n}\n.monaco-editor .minimap-shadow-hidden {\n\tposition: absolute;\n\twidth: 0;\n}\n.monaco-editor .minimap-shadow-visible {\n\tposition: absolute;\n\tleft: -6px;\n\twidth: 6px;\n\tpointer-events: none;\n}\n.monaco-editor.no-minimap-shadow .minimap-shadow-visible {\n\tposition: absolute;\n\tleft: -1px;\n\twidth: 1px;\n}\n\n/* 0.5s fade in/out for the minimap */\n.minimap.minimap-autohide-mouseover,\n.minimap.minimap-autohide-scroll {\n\topacity: 0;\n\ttransition: opacity 0.5s;\n}\n.minimap.minimap-autohide-scroll{\n\tpointer-events: none;\n}\n.minimap.minimap-autohide-mouseover:hover,\n.minimap.minimap-autohide-scroll.active {\n\topacity: 1;\n\tpointer-events: auto;\n}\n\n.monaco-editor .minimap {\n\tz-index: 5;\n}\n",""]);const a=r},6499:(e,t,i)=>{e.exports=i.p+"codicon.ttf"},6514:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-component.multiDiffEditor {\n\tbackground: var(--vscode-multiDiffEditor-background);\n\n\tposition: relative;\n\n\theight: 100%;\n\twidth: 100%;\n\n\toverflow-y: hidden;\n\n\t> div {\n\t\tposition: absolute;\n\t\ttop: 0px;\n\t\tleft: 0px;\n\n\t\theight: 100%;\n\t\twidth: 100%;\n\n\t\t&.placeholder {\n\t\t\tvisibility: hidden;\n\n\t\t\t&.visible {\n\t\t\t\tvisibility: visible;\n\t\t\t}\n\n\t\t\tdisplay: grid;\n\t\t\tplace-items: center;\n\t\t\tplace-content: center;\n\t\t}\n\t}\n\n\t.active {\n\t\t--vscode-multiDiffEditor-border: var(--vscode-focusBorder);\n\t}\n\n\t.multiDiffEntry {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tflex: 1;\n\t\toverflow: hidden;\n\n\n\t\t.collapse-button {\n\t\t\tmargin: 0 5px;\n\t\t\tcursor: pointer;\n\n\t\t\ta {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\t\t}\n\n\t\t.header {\n\t\t\tz-index: 1000;\n\t\t\tbackground: var(--vscode-editor-background);\n\n\t\t\t&:not(.collapsed) .header-content {\n\t\t\t\tborder-bottom: 1px solid var(--vscode-sideBarSectionHeader-border);\n\t\t\t}\n\n\t\t\t.header-content {\n\t\t\t\tmargin: 8px 0px 0px 0px;\n\t\t\t\tpadding: 4px 5px;\n\n\t\t\t\tborder-top: 1px solid var(--vscode-multiDiffEditor-border);\n\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\n\t\t\t\tcolor: var(--vscode-foreground);\n\t\t\t\tbackground: var(--vscode-multiDiffEditor-headerBackground);\n\n\t\t\t\t&.shadow {\n\t\t\t\t\tbox-shadow: var(--vscode-scrollbar-shadow) 0px 6px 6px -6px;\n\t\t\t\t}\n\n\t\t\t\t.file-path {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex: 1;\n\t\t\t\t\tmin-width: 0;\n\n\t\t\t\t\t.title {\n\t\t\t\t\t\tfont-size: 14px;\n\t\t\t\t\t\tline-height: 22px;\n\n\t\t\t\t\t\t&.original {\n\t\t\t\t\t\t\tflex: 1;\n\t\t\t\t\t\t\tmin-width: 0;\n\t\t\t\t\t\t\ttext-overflow: ellipsis;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t.status {\n\t\t\t\t\t\tfont-weight: 600;\n\t\t\t\t\t\topacity: 0.75;\n\t\t\t\t\t\tmargin: 0px 10px;\n\t\t\t\t\t\tline-height: 22px;\n\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t\tTODO@hediet: move colors from git extension to core!\n\t\t\t\t\t\t&.renamed {\n\t\t\t\t\t\t\tcolor: v ar(--vscode-gitDecoration-renamedResourceForeground);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t&.deleted {\n\t\t\t\t\t\t\tcolor: v ar(--vscode-gitDecoration-deletedResourceForeground);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t&.added {\n\t\t\t\t\t\t\tcolor: v ar(--vscode-gitDecoration-addedResourceForeground);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t*/\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t.actions {\n\t\t\t\t\tpadding: 0 8px;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t}\n\n\t\t.editorParent {\n\t\t\tflex: 1;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\n\t\t\tborder-bottom: 1px solid var(--vscode-multiDiffEditor-border);\n\t\t\toverflow: hidden;\n\t\t}\n\n\t\t.editorContainer {\n\t\t\tflex: 1;\n\t\t}\n\t}\n}\n",""]);const a=r},6610:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/* ---------- DiffEditor ---------- */\n\n.monaco-diff-editor .diffOverview {\n\tz-index: 9;\n}\n\n.monaco-diff-editor .diffOverview .diffViewport {\n\tz-index: 10;\n}\n\n/* colors not externalized: using transparancy on background */\n.monaco-diff-editor.vs\t\t\t.diffOverview { background: rgba(0, 0, 0, 0.03); }\n.monaco-diff-editor.vs-dark\t\t.diffOverview { background: rgba(255, 255, 255, 0.01); }\n\n.monaco-scrollable-element.modified-in-monaco-diff-editor.vs\t\t.scrollbar { background: rgba(0,0,0,0); }\n.monaco-scrollable-element.modified-in-monaco-diff-editor.vs-dark\t.scrollbar { background: rgba(0,0,0,0); }\n.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-black\t.scrollbar { background: none; }\n.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-light\t.scrollbar { background: none; }\n\n.monaco-scrollable-element.modified-in-monaco-diff-editor .slider {\n\tz-index: 10;\n}\n.modified-in-monaco-diff-editor\t\t\t\t.slider.active { background: rgba(171, 171, 171, .4); }\n.modified-in-monaco-diff-editor.hc-black\t.slider.active { background: none; }\n.modified-in-monaco-diff-editor.hc-light\t.slider.active { background: none; }\n\n/* ---------- Diff ---------- */\n\n.monaco-editor .insert-sign,\n.monaco-diff-editor .insert-sign,\n.monaco-editor .delete-sign,\n.monaco-diff-editor .delete-sign {\n\tfont-size: 11px !important;\n\topacity: 0.7 !important;\n\tdisplay: flex !important;\n\talign-items: center;\n}\n.monaco-editor.hc-black .insert-sign,\n.monaco-diff-editor.hc-black .insert-sign,\n.monaco-editor.hc-black .delete-sign,\n.monaco-diff-editor.hc-black .delete-sign,\n.monaco-editor.hc-light .insert-sign,\n.monaco-diff-editor.hc-light .insert-sign,\n.monaco-editor.hc-light .delete-sign,\n.monaco-diff-editor.hc-light .delete-sign {\n\topacity: 1;\n}\n\n.monaco-editor .inline-deleted-margin-view-zone {\n\ttext-align: right;\n}\n.monaco-editor .inline-added-margin-view-zone {\n\ttext-align: right;\n}\n\n.monaco-editor .arrow-revert-change {\n\tz-index: 10;\n\tposition: absolute;\n}\n\n.monaco-editor .arrow-revert-change:hover {\n\tcursor: pointer;\n}\n\n/* ---------- Inline Diff ---------- */\n\n.monaco-editor .view-zones .view-lines .view-line span {\n\tdisplay: inline-block;\n}\n\n.monaco-editor .margin-view-zones .lightbulb-glyph:hover {\n\tcursor: pointer;\n}\n\n.monaco-editor .char-insert, .monaco-diff-editor .char-insert {\n\tbackground-color: var(--vscode-diffEditor-insertedTextBackground);\n}\n\n.monaco-editor .line-insert, .monaco-diff-editor .line-insert {\n\tbackground-color: var(--vscode-diffEditor-insertedLineBackground, --vscode-diffEditor-insertedTextBackground);\n}\n\n.monaco-editor .line-insert,\n.monaco-editor .char-insert {\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-diffEditor-insertedTextBorder);\n}\n.monaco-editor.hc-black .line-insert, .monaco-editor.hc-light .line-insert,\n.monaco-editor.hc-black .char-insert, .monaco-editor.hc-light .char-insert {\n\tborder-style: dashed;\n}\n\n.monaco-editor .line-delete,\n.monaco-editor .char-delete {\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-diffEditor-removedTextBorder);\n}\n.monaco-editor.hc-black .line-delete, .monaco-editor.hc-light .line-delete,\n.monaco-editor.hc-black .char-delete, .monaco-editor.hc-light .char-delete {\n\tborder-style: dashed;\n}\n\n.monaco-editor .inline-added-margin-view-zone,\n.monaco-editor .gutter-insert, .monaco-diff-editor .gutter-insert {\n\tbackground-color: var(--vscode-diffEditorGutter-insertedLineBackground, --vscode-diffEditor-insertedLineBackground, --vscode-diffEditor-insertedTextBackground);\n}\n\n.monaco-editor .char-delete, .monaco-diff-editor .char-delete {\n\tbackground-color: var(--vscode-diffEditor-removedTextBackground);\n}\n\n.monaco-editor .line-delete, .monaco-diff-editor .line-delete {\n\tbackground-color: var(--vscode-diffEditor-removedLineBackground, --vscode-diffEditor-removedTextBackground);\n}\n\n.monaco-editor .inline-deleted-margin-view-zone,\n.monaco-editor .gutter-delete, .monaco-diff-editor .gutter-delete {\n\tbackground-color: var(--vscode-diffEditorGutter-removedLineBackground, --vscode-diffEditor-removedLineBackground, --vscode-diffEditor-removedTextBackground);\n}\n\n.monaco-diff-editor.side-by-side .editor.modified {\n\tbox-shadow: -6px 0 5px -5px var(--vscode-scrollbar-shadow);\n\tborder-left: 1px solid var(--vscode-diffEditor-border);\n}\n\n.monaco-diff-editor .diffViewport {\n\tbackground: var(--vscode-scrollbarSlider-background);\n}\n\n.monaco-diff-editor .diffViewport:hover {\n\tbackground: var(--vscode-scrollbarSlider-hoverBackground);\n}\n\n.monaco-diff-editor .diffViewport:active {\n\tbackground: var(--vscode-scrollbarSlider-activeBackground);\n}\n",""]);const a=r},6745:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,'/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.action-widget {\n\tfont-size: 13px;\n\tborder-radius: 0;\n\tmin-width: 100px;\n\tmax-width: 80vw;\n\tz-index: 40;\n\tdisplay: block;\n\twidth: 100%;\n\tborder: 1px solid var(--vscode-menu-border) !important;\n\tborder-radius: 5px;\n\tbackground-color: var(--vscode-menu-background);\n\tcolor: var(--vscode-menu-foreground);\n\tpadding: 4px;\n\tbox-shadow: 0 2px 8px var(--vscode-widget-shadow);\n}\n\n.context-view-block {\n\tposition: fixed;\n\tcursor: initial;\n\tleft: 0;\n\ttop: 0;\n\twidth: 100%;\n\theight: 100%;\n\tz-index: -1;\n}\n\n.context-view-pointerBlock {\n\tposition: fixed;\n\tcursor: initial;\n\tleft: 0;\n\ttop: 0;\n\twidth: 100%;\n\theight: 100%;\n\tz-index: 2;\n}\n\n.action-widget .monaco-list {\n\tuser-select: none;\n\t-webkit-user-select: none;\n\tborder: none !important;\n\tborder-width: 0 !important;\n}\n\n.action-widget .monaco-list:focus:before {\n\toutline: 0 !important;\n}\n\n.action-widget .monaco-list .monaco-scrollable-element {\n\toverflow: visible;\n}\n\n/** Styles for each row in the list element **/\n.action-widget .monaco-list .monaco-list-row {\n\tpadding: 0 4px 0 4px;\n\twhite-space: nowrap;\n\tcursor: pointer;\n\ttouch-action: none;\n\twidth: 100%;\n\tborder-radius: 3px;\n}\n\n.action-widget .monaco-list .monaco-list-row.action.focused:not(.option-disabled) {\n\tbackground-color: var(--vscode-list-activeSelectionBackground) !important;\n\tcolor: var(--vscode-list-activeSelectionForeground);\n\toutline: 1px solid var(--vscode-menu-selectionBorder, transparent);\n\toutline-offset: -1px;\n}\n\n.action-widget .monaco-list-row.group-header {\n\tcolor: var(--vscode-descriptionForeground) !important;\n\tfont-weight: 600;\n\tfont-size: 13px;\n}\n\n.action-widget .monaco-list-row.group-header:not(:first-of-type) {\n\tmargin-top: 2px;\n}\n\n.action-widget .monaco-scrollable-element .monaco-list-rows .monaco-list-row.separator {\n\tborder-top: 1px solid var(--vscode-editorHoverWidget-border);\n\tcolor: var(--vscode-descriptionForeground);\n\tfont-size: 12px;\n\tpadding: 0;\n\tmargin: 4px 0 0 0;\n\tcursor: default;\n\tuser-select: none;\n\tborder-radius: 0;\n}\n\n.action-widget .monaco-scrollable-element .monaco-list-rows .monaco-list-row.separator.focused {\n\toutline: 0 solid;\n\tbackground-color: transparent;\n\tborder-radius: 0;\n}\n\n.action-widget .monaco-list-row.separator:first-of-type {\n\tborder-top: none;\n\tmargin-top: 0;\n}\n\n.action-widget .monaco-list .group-header,\n.action-widget .monaco-list .option-disabled,\n.action-widget .monaco-list .option-disabled:before,\n.action-widget .monaco-list .option-disabled .focused,\n.action-widget .monaco-list .option-disabled .focused:before {\n\tcursor: default !important;\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\tuser-select: none;\n\tbackground-color: transparent !important;\n\toutline: 0 solid !important;\n}\n\n.action-widget .monaco-list-row.action {\n\tdisplay: flex;\n\tgap: 4px;\n\talign-items: center;\n}\n\n.action-widget .monaco-list-row.action.option-disabled,\n.action-widget .monaco-list:focus .monaco-list-row.focused.action.option-disabled,\n.action-widget .monaco-list-row.action.option-disabled .codicon,\n.action-widget .monaco-list:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused).option-disabled {\n\tcolor: var(--vscode-disabledForeground);\n}\n\n\n.action-widget .monaco-list-row.action:not(.option-disabled) .codicon {\n\tcolor: inherit;\n}\n\n.action-widget .monaco-list-row.action .title {\n\tflex: 1;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.action-widget .monaco-list-row.action .monaco-keybinding > .monaco-keybinding-key {\n\t\tbackground-color: var(--vscode-keybindingLabel-background);\n\t\tcolor: var(--vscode-keybindingLabel-foreground);\n\t\tborder-style: solid;\n\t\tborder-width: 1px;\n\t\tborder-radius: 3px;\n\t\tborder-color: var(--vscode-keybindingLabel-border);\n\t\tborder-bottom-color: var(--vscode-keybindingLabel-bottomBorder);\n\t\tbox-shadow: inset 0 -1px 0 var(--vscode-widget-shadow);\n}\n\n/* Action bar */\n\n.action-widget .action-widget-action-bar {\n\tbackground-color: var(--vscode-menu-background);\n\tborder-top: 1px solid var(--vscode-menu-border);\n\tmargin-top: 2px;\n}\n\n.action-widget .action-widget-action-bar::before {\n\tdisplay: block;\n\tcontent: "";\n\twidth: 100%;\n}\n\n.action-widget .action-widget-action-bar .actions-container {\n\tpadding: 4px 8px 2px 24px;\n}\n\n.action-widget-action-bar .action-label {\n\tcolor: var(--vscode-textLink-activeForeground);\n\tfont-size: 13px;\n\tline-height: 22px;\n\tpadding: 0;\n\tpointer-events: all;\n}\n\n.action-widget-action-bar .action-item {\n\tmargin-right: 16px;\n\tpointer-events: none;\n}\n\n.action-widget-action-bar .action-label:hover {\n\tbackground-color: transparent !important;\n}\n\n.monaco-action-bar .actions-container.highlight-toggled .action-label.checked {\n\t/* The important gives this rule precedence over the hover rule. */\n\tbackground: var(--vscode-actionBar-toggledBackground) !important;\n}\n\n.action-widget .monaco-list .monaco-list-row .description {\n\topacity: 0.7;\n\tmargin-left: 0.5em;\n}\n',""]);const a=r},6835:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .rendered-markdown kbd {\n\tbackground-color: var(--vscode-keybindingLabel-background);\n\tcolor: var(--vscode-keybindingLabel-foreground);\n\tborder-style: solid;\n\tborder-width: 1px;\n\tborder-radius: 3px;\n\tborder-color: var(--vscode-keybindingLabel-border);\n\tborder-bottom-color: var(--vscode-keybindingLabel-bottomBorder);\n\tbox-shadow: inset 0 -1px 0 var(--vscode-widget-shadow);\n\tvertical-align: middle;\n\tpadding: 1px 3px;\n}\n\n.rendered-markdown li:has(input[type=checkbox]) {\n\tlist-style-type: none;\n}\n",""]);const a=r},6851:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .scroll-decoration {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\theight: 6px;\n\tbox-shadow: var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset;\n}\n",""]);const a=r},6889:e=>{e.exports='data:image/svg+xml;utf8,%3Csvg viewBox="0 0 24 24" display="inline-block" height="1em" width="1em" vertical-align="text-bottom" xmlns="http://www.w3.org/2000/svg" %3E%3Cpath fill="currentColor" d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"/%3E%3C/svg%3E'},6953:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .margin-view-overlays .line-numbers {\n\tbottom: 0;\n\tfont-variant-numeric: tabular-nums;\n\tposition: absolute;\n\ttext-align: right;\n\tdisplay: inline-block;\n\tvertical-align: middle;\n\tbox-sizing: border-box;\n\tcursor: default;\n}\n\n.monaco-editor .relative-current-line-number {\n\ttext-align: left;\n\tdisplay: inline-block;\n\twidth: 100%;\n}\n\n.monaco-editor .margin-view-overlays .line-numbers.lh-odd {\n\tmargin-top: 1px;\n}\n\n.monaco-editor .line-numbers {\n\tcolor: var(--vscode-editorLineNumber-foreground);\n}\n\n.monaco-editor .line-numbers.active-line-number {\n\tcolor: var(--vscode-editorLineNumber-activeForeground);\n}\n",""]);const a=r},7147:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n.monaco-editor .overlayWidgets {\n\tposition: absolute;\n\ttop: 0;\n\tleft:0;\n}",""]);const a=r},7160:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* Suggest widget*/\n\n.monaco-editor .suggest-widget {\n\twidth: 430px;\n\tz-index: 40;\n\tdisplay: flex;\n\tflex-direction: column;\n\tborder-radius: 3px;\n}\n\n.monaco-editor .suggest-widget.message {\n\tflex-direction: row;\n\talign-items: center;\n}\n\n.monaco-editor .suggest-widget,\n.monaco-editor .suggest-details {\n\tflex: 0 1 auto;\n\twidth: 100%;\n\tborder-style: solid;\n\tborder-width: 1px;\n\tborder-color: var(--vscode-editorSuggestWidget-border);\n\tbackground-color: var(--vscode-editorSuggestWidget-background);\n}\n\n.monaco-editor.hc-black .suggest-widget,\n.monaco-editor.hc-black .suggest-details,\n.monaco-editor.hc-light .suggest-widget,\n.monaco-editor.hc-light .suggest-details {\n\tborder-width: 2px;\n}\n\n/* Styles for status bar part */\n\n\n.monaco-editor .suggest-widget .suggest-status-bar {\n\tbox-sizing: border-box;\n\tdisplay: none;\n\tflex-flow: row nowrap;\n\tjustify-content: space-between;\n\twidth: 100%;\n\tfont-size: 80%;\n\tpadding: 0 4px 0 4px;\n\tborder-top: 1px solid var(--vscode-editorSuggestWidget-border);\n\toverflow: hidden;\n}\n\n.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar {\n\tdisplay: flex;\n}\n\n.monaco-editor .suggest-widget .suggest-status-bar .left {\n\tpadding-right: 8px;\n}\n\n.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-label {\n\tcolor: var(--vscode-editorSuggestWidgetStatus-foreground);\n}\n\n.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-item:not(:last-of-type) .action-label {\n\tmargin-right: 0;\n}\n\n.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-item:not(:last-of-type) .action-label::after {\n\tcontent: ', ';\n\tmargin-right: 0.3em;\n}\n\n.monaco-editor .suggest-widget.with-status-bar .monaco-list .monaco-list-row > .contents > .main > .right > .readMore,\n.monaco-editor .suggest-widget.with-status-bar .monaco-list .monaco-list-row.focused.string-label > .contents > .main > .right > .readMore {\n\tdisplay: none;\n}\n\n.monaco-editor .suggest-widget.with-status-bar:not(.docs-side) .monaco-list .monaco-list-row:hover > .contents > .main > .right.can-expand-details > .details-label {\n\twidth: 100%;\n}\n\n/* Styles for Message element for when widget is loading or is empty */\n\n.monaco-editor .suggest-widget > .message {\n\tpadding-left: 22px;\n}\n\n/** Styles for the list element **/\n\n.monaco-editor .suggest-widget > .tree {\n\theight: 100%;\n\twidth: 100%;\n}\n\n.monaco-editor .suggest-widget .monaco-list {\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n/** Styles for each row in the list element **/\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row {\n\tdisplay: flex;\n\t-mox-box-sizing: border-box;\n\tbox-sizing: border-box;\n\tpadding-right: 10px;\n\tbackground-repeat: no-repeat;\n\tbackground-position: 2px 2px;\n\twhite-space: nowrap;\n\tcursor: pointer;\n\ttouch-action: none;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused {\n\tcolor: var(--vscode-editorSuggestWidget-selectedForeground);\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused .codicon {\n\tcolor: var(--vscode-editorSuggestWidget-selectedIconForeground);\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents {\n\tflex: 1;\n\theight: 100%;\n\toverflow: hidden;\n\tpadding-left: 2px;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main {\n\tdisplay: flex;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: pre;\n\tjustify-content: space-between;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .left,\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .right {\n\tdisplay: flex;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.focused) > .contents > .main .monaco-icon-label {\n\tcolor: var(--vscode-editorSuggestWidget-foreground);\n}\n\n.monaco-editor .suggest-widget:not(.frozen) .monaco-highlighted-label .highlight {\n\tfont-weight: bold;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main .monaco-highlighted-label .highlight {\n\tcolor: var(--vscode-editorSuggestWidget-highlightForeground);\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused > .contents > .main .monaco-highlighted-label .highlight {\n\tcolor: var(--vscode-editorSuggestWidget-focusHighlightForeground);\n}\n\n/** ReadMore Icon styles **/\n\n.monaco-editor .suggest-details > .monaco-scrollable-element > .body > .header > .codicon-close,\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .right > .readMore::before {\n\tcolor: inherit;\n\topacity: 1;\n\tfont-size: 14px;\n\tcursor: pointer;\n}\n\n.monaco-editor .suggest-details > .monaco-scrollable-element > .body > .header > .codicon-close {\n\tposition: absolute;\n\ttop: 6px;\n\tright: 2px;\n}\n\n.monaco-editor .suggest-details > .monaco-scrollable-element > .body > .header > .codicon-close:hover,\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .right > .readMore:hover {\n\topacity: 1;\n}\n\n/** signature, qualifier, type/details opacity **/\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .right > .details-label {\n\topacity: 0.7;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .left > .signature-label {\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\topacity: 0.6;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .left > .qualifier-label {\n\tmargin-left: 12px;\n\topacity: 0.4;\n\tfont-size: 85%;\n\tline-height: initial;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\talign-self: center;\n}\n\n/** Type Info and icon next to the label in the focused completion item **/\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .right > .details-label {\n\tfont-size: 85%;\n\tmargin-left: 1.1em;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .right > .details-label > .monaco-tokenized-source {\n\tdisplay: inline;\n}\n\n/** Details: if using CompletionItem#details, show on focus **/\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .right > .details-label {\n\tdisplay: none;\n}\n\n.monaco-editor .suggest-widget:not(.shows-details) .monaco-list .monaco-list-row.focused > .contents > .main > .right > .details-label {\n\tdisplay: inline;\n}\n\n/** Details: if using CompletionItemLabel#details, always show **/\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.string-label) > .contents > .main > .right > .details-label,\n.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row.focused:not(.string-label) > .contents > .main > .right > .details-label {\n\tdisplay: inline;\n}\n\n/** Ellipsis on hover **/\n\n.monaco-editor .suggest-widget:not(.docs-side) .monaco-list .monaco-list-row.focused:hover > .contents > .main > .right.can-expand-details > .details-label {\n\twidth: calc(100% - 26px);\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .left {\n\tflex-shrink: 1;\n\tflex-grow: 1;\n\toverflow: hidden;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .left > .monaco-icon-label {\n\tflex-shrink: 0;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.string-label) > .contents > .main > .left > .monaco-icon-label {\n\tmax-width: 100%;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row.string-label > .contents > .main > .left > .monaco-icon-label {\n\tflex-shrink: 1;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .right {\n\toverflow: hidden;\n\tflex-shrink: 4;\n\tmax-width: 70%;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .right > .readMore {\n\tdisplay: inline-block;\n\tposition: absolute;\n\tright: 10px;\n\twidth: 18px;\n\theight: 18px;\n\tvisibility: hidden;\n}\n\n/** Do NOT display ReadMore when docs is side/below **/\n\n.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row > .contents > .main > .right > .readMore {\n\tdisplay: none !important;\n}\n\n/** Do NOT display ReadMore when using plain CompletionItemLabel (details/documentation might not be resolved) **/\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row.string-label > .contents > .main > .right > .readMore {\n\tdisplay: none;\n}\n\n/** Focused item can show ReadMore, but can't when docs is side/below **/\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused.string-label > .contents > .main > .right > .readMore {\n\tdisplay: inline-block;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused:hover > .contents > .main > .right > .readMore {\n\tvisibility: visible;\n}\n\n/** Styles for each row in the list **/\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated {\n\topacity: 0.66;\n\ttext-decoration: unset;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated > .monaco-icon-label-container > .monaco-icon-name-container {\n\ttext-decoration: line-through;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label::before {\n\theight: 100%;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon {\n\tdisplay: block;\n\theight: 16px;\n\twidth: 16px;\n\tmargin-left: 2px;\n\tbackground-repeat: no-repeat;\n\tbackground-size: 80%;\n\tbackground-position: center;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon.hide {\n\tdisplay: none;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon {\n\tdisplay: flex;\n\talign-items: center;\n\tmargin-right: 4px;\n}\n\n.monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .icon,\n.monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .suggest-icon::before {\n\tdisplay: none;\n}\n\n.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon.customcolor .colorspan {\n\tmargin: 0 0 0 0.3em;\n\tborder: 0.1em solid #000;\n\twidth: 0.7em;\n\theight: 0.7em;\n\tdisplay: inline-block;\n}\n\n/** Styles for the docs of the completion item in focus **/\n\n.monaco-editor .suggest-details-container {\n\tz-index: 41;\n}\n\n.monaco-editor .suggest-details {\n\tdisplay: flex;\n\tflex-direction: column;\n\tcursor: default;\n\tcolor: var(--vscode-editorSuggestWidget-foreground);\n}\n\n.monaco-editor .suggest-details:focus {\n\tborder-color: var(--vscode-focusBorder);\n}\n\n.monaco-editor .suggest-details a {\n\tcolor: var(--vscode-textLink-foreground);\n}\n\n.monaco-editor .suggest-details a:hover {\n\tcolor: var(--vscode-textLink-activeForeground);\n}\n\n.monaco-editor .suggest-details code {\n\tbackground-color: var(--vscode-textCodeBlock-background);\n}\n\n.monaco-editor .suggest-details.no-docs {\n\tdisplay: none;\n}\n\n.monaco-editor .suggest-details > .monaco-scrollable-element {\n\tflex: 1;\n}\n\n.monaco-editor .suggest-details > .monaco-scrollable-element > .body {\n\tbox-sizing: border-box;\n\theight: 100%;\n\twidth: 100%;\n}\n\n.monaco-editor .suggest-details > .monaco-scrollable-element > .body > .header > .type {\n\tflex: 2;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\topacity: 0.7;\n\twhite-space: pre;\n\tmargin: 0 24px 0 0;\n\tpadding: 4px 0 4px 5px;\n}\n\n.monaco-editor .suggest-details.detail-and-doc > .monaco-scrollable-element > .body > .header > .type {\n\tpadding-bottom: 12px;\n}\n\n.monaco-editor .suggest-details > .monaco-scrollable-element > .body > .header > .type.auto-wrap {\n\twhite-space: normal;\n\tword-break: break-all;\n}\n\n.monaco-editor .suggest-details > .monaco-scrollable-element > .body > .docs {\n\tmargin: 0;\n\tpadding: 4px 5px;\n\twhite-space: pre-wrap;\n}\n\n.monaco-editor .suggest-details.no-type > .monaco-scrollable-element > .body > .docs {\n\tmargin-right: 24px;\n\toverflow: hidden;\n}\n\n.monaco-editor .suggest-details > .monaco-scrollable-element > .body > .docs.markdown-docs {\n\tpadding: 0;\n\twhite-space: initial;\n\tmin-height: calc(1rem + 8px);\n}\n\n.monaco-editor .suggest-details > .monaco-scrollable-element > .body > .docs.markdown-docs > div,\n.monaco-editor .suggest-details > .monaco-scrollable-element > .body > .docs.markdown-docs > span:not(:empty) {\n\tpadding: 4px 5px;\n}\n\n.monaco-editor .suggest-details > .monaco-scrollable-element > .body > .docs.markdown-docs > div > p:first-child {\n\tmargin-top: 0;\n}\n\n.monaco-editor .suggest-details > .monaco-scrollable-element > .body > .docs.markdown-docs > div > p:last-child {\n\tmargin-bottom: 0;\n}\n\n.monaco-editor .suggest-details > .monaco-scrollable-element > .body > .docs.markdown-docs .monaco-tokenized-source {\n\twhite-space: pre;\n}\n\n.monaco-editor .suggest-details > .monaco-scrollable-element > .body > .docs .code {\n\twhite-space: pre-wrap;\n\tword-wrap: break-word;\n}\n\n.monaco-editor .suggest-details > .monaco-scrollable-element > .body > .docs.markdown-docs .codicon {\n\tvertical-align: sub;\n}\n\n.monaco-editor .suggest-details > .monaco-scrollable-element > .body > p:empty {\n\tdisplay: none;\n}\n\n.monaco-editor .suggest-details code {\n\tborder-radius: 3px;\n\tpadding: 0 0.4em;\n}\n\n.monaco-editor .suggest-details ul {\n\tpadding-left: 20px;\n}\n\n.monaco-editor .suggest-details ol {\n\tpadding-left: 20px;\n}\n\n.monaco-editor .suggest-details p code {\n\tfont-family: var(--monaco-monospace-font);\n}\n",""]);const a=r},7161:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .blockDecorations-container {\n\tposition: absolute;\n\ttop: 0;\n}\n\n.monaco-editor .blockDecorations-block {\n\tposition: absolute;\n\tbox-sizing: border-box;\n}\n",""]);const a=r},7184:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-inputbox {\n\tposition: relative;\n\tdisplay: block;\n\tpadding: 0;\n\tbox-sizing:\tborder-box;\n\tborder-radius: 2px;\n\n\t/* Customizable */\n\tfont-size: inherit;\n}\n\n.monaco-inputbox > .ibwrapper > .input,\n.monaco-inputbox > .ibwrapper > .mirror {\n\n\t/* Customizable */\n\tpadding: 4px 6px;\n}\n\n.monaco-inputbox > .ibwrapper {\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n}\n\n.monaco-inputbox > .ibwrapper > .input {\n\tdisplay: inline-block;\n\tbox-sizing:\tborder-box;\n\twidth: 100%;\n\theight: 100%;\n\tline-height: inherit;\n\tborder: none;\n\tfont-family: inherit;\n\tfont-size: inherit;\n\tresize: none;\n\tcolor: inherit;\n}\n\n.monaco-inputbox > .ibwrapper > input {\n\ttext-overflow: ellipsis;\n}\n\n.monaco-inputbox > .ibwrapper > textarea.input {\n\tdisplay: block;\n\tscrollbar-width: none; /* Firefox: hide scrollbars */\n\toutline: none;\n}\n\n.monaco-inputbox > .ibwrapper > textarea.input::-webkit-scrollbar {\n\tdisplay: none; /* Chrome + Safari: hide scrollbar */\n}\n\n.monaco-inputbox > .ibwrapper > textarea.input.empty {\n\twhite-space: nowrap;\n}\n\n.monaco-inputbox > .ibwrapper > .mirror {\n\tposition: absolute;\n\tdisplay: inline-block;\n\twidth: 100%;\n\ttop: 0;\n\tleft: 0;\n\tbox-sizing: border-box;\n\twhite-space: pre-wrap;\n\tvisibility: hidden;\n\tword-wrap: break-word;\n}\n\n/* Context view */\n\n.monaco-inputbox-container {\n\ttext-align: right;\n}\n\n.monaco-inputbox-container .monaco-inputbox-message {\n\tdisplay: inline-block;\n\toverflow: hidden;\n\ttext-align: left;\n\twidth: 100%;\n\tbox-sizing:\tborder-box;\n\tpadding: 0.4em;\n\tfont-size: 12px;\n\tline-height: 17px;\n\tmargin-top: -1px;\n\tword-wrap: break-word;\n}\n\n/* Action bar support */\n.monaco-inputbox .monaco-action-bar {\n\tposition: absolute;\n\tright: 2px;\n\ttop: 4px;\n}\n\n.monaco-inputbox .monaco-action-bar .action-item {\n\tmargin-left: 2px;\n}\n\n.monaco-inputbox .monaco-action-bar .action-item .codicon {\n\tbackground-repeat: no-repeat;\n\twidth: 16px;\n\theight: 16px;\n}\n",""]);const a=r},7201:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .monaco-editor-overlaymessage {\n\tpadding-bottom: 8px;\n\tz-index: 10000;\n}\n\n.monaco-editor .monaco-editor-overlaymessage.below {\n\tpadding-bottom: 0;\n\tpadding-top: 8px;\n\tz-index: 10000;\n}\n\n@keyframes fadeIn {\n\tfrom { opacity: 0; }\n\tto { opacity: 1; }\n}\n.monaco-editor .monaco-editor-overlaymessage.fadeIn {\n\tanimation: fadeIn 150ms ease-out;\n}\n\n@keyframes fadeOut {\n\tfrom { opacity: 1; }\n\tto { opacity: 0; }\n}\n.monaco-editor .monaco-editor-overlaymessage.fadeOut {\n\tanimation: fadeOut 100ms ease-out;\n}\n\n.monaco-editor .monaco-editor-overlaymessage .message {\n\tpadding: 2px 4px;\n\tcolor: var(--vscode-editorHoverWidget-foreground);\n\tbackground-color: var(--vscode-editorHoverWidget-background);\n\tborder: 1px solid var(--vscode-inputValidation-infoBorder);\n\tborder-radius: 3px;\n}\n\n.monaco-editor .monaco-editor-overlaymessage .message p {\n\tmargin-block: 0px;\n}\n\n.monaco-editor .monaco-editor-overlaymessage .message a {\n\tcolor: var(--vscode-textLink-foreground);\n}\n\n.monaco-editor .monaco-editor-overlaymessage .message a:hover {\n\tcolor: var(--vscode-textLink-activeForeground);\n}\n\n.monaco-editor.hc-black .monaco-editor-overlaymessage .message,\n.monaco-editor.hc-light .monaco-editor-overlaymessage .message {\n\tborder-width: 2px;\n}\n\n.monaco-editor .monaco-editor-overlaymessage .anchor {\n\twidth: 0 !important;\n\theight: 0 !important;\n\tborder-color: transparent;\n\tborder-style: solid;\n\tz-index: 1000;\n\tborder-width: 8px;\n\tposition: absolute;\n\tleft: 2px;\n}\n\n.monaco-editor .monaco-editor-overlaymessage .anchor.top {\n\tborder-bottom-color: var(--vscode-inputValidation-infoBorder);\n}\n\n.monaco-editor .monaco-editor-overlaymessage .anchor.below {\n\tborder-top-color: var(--vscode-inputValidation-infoBorder);\n}\n\n.monaco-editor .monaco-editor-overlaymessage:not(.below) .anchor.top,\n.monaco-editor .monaco-editor-overlaymessage.below .anchor.below {\n\tdisplay: none;\n}\n\n.monaco-editor .monaco-editor-overlaymessage.below .anchor.top {\n\tdisplay: inherit;\n\ttop: -8px;\n}\n",""]);const a=r},7340:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-list {\n\tposition: relative;\n\theight: 100%;\n\twidth: 100%;\n\twhite-space: nowrap;\n}\n\n.monaco-list.mouse-support {\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.monaco-list > .monaco-scrollable-element {\n\theight: 100%;\n}\n\n.monaco-list-rows {\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n}\n\n.monaco-list.horizontal-scrolling .monaco-list-rows {\n\twidth: auto;\n\tmin-width: 100%;\n}\n\n.monaco-list-row {\n\tposition: absolute;\n\tbox-sizing: border-box;\n\toverflow: hidden;\n\twidth: 100%;\n}\n\n.monaco-list.mouse-support .monaco-list-row {\n\tcursor: pointer;\n\ttouch-action: none;\n}\n\n/* Make sure the scrollbar renders above overlays (sticky scroll) */\n.monaco-list .monaco-scrollable-element > .scrollbar.vertical,\n.monaco-pane-view > .monaco-split-view2.vertical > .monaco-scrollable-element > .scrollbar.vertical {\n\tz-index: 14;\n}\n\n/* for OS X ballistic scrolling */\n.monaco-list-row.scrolling {\n\tdisplay: none !important;\n}\n\n/* Focus */\n.monaco-list.element-focused,\n.monaco-list.selection-single,\n.monaco-list.selection-multiple {\n\toutline: 0 !important;\n}\n\n/* Filter */\n\n.monaco-list-type-filter-message {\n\tposition: absolute;\n\tbox-sizing: border-box;\n\twidth: 100%;\n\theight: 100%;\n\ttop: 0;\n\tleft: 0;\n\tpadding: 40px 1em 1em 1em;\n\ttext-align: center;\n\twhite-space: normal;\n\topacity: 0.7;\n\tpointer-events: none;\n}\n\n.monaco-list-type-filter-message:empty {\n\tdisplay: none;\n}\n",""]);const a=r},7375:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n.monaco-editor .lines-decorations {\n\tposition: absolute;\n\ttop: 0;\n\tbackground: white;\n}\n\n/*\n\tKeeping name short for faster parsing.\n\tcldr = core lines decorations rendering (div)\n*/\n.monaco-editor .margin-view-overlays .cldr {\n\tposition: absolute;\n\theight: 100%;\n}",""]);const a=r},7492:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.quick-input-widget {\n\tposition: absolute;\n\twidth: 600px;\n\tz-index: 2550;\n\tleft: 50%;\n\t-webkit-app-region: no-drag;\n\tborder-radius: 6px;\n}\n\n.quick-input-titlebar {\n\tcursor: grab;\n\tdisplay: flex;\n\talign-items: center;\n\tborder-top-right-radius: 5px;\n\tborder-top-left-radius: 5px;\n}\n\n.quick-input-left-action-bar {\n\tdisplay: flex;\n\tmargin-left: 4px;\n\tflex: 1;\n}\n\n/* give some space between input and action bar */\n.quick-input-inline-action-bar > .actions-container > .action-item:first-child {\n\tmargin-left: 5px;\n}\n\n/* center horizontally */\n.quick-input-inline-action-bar > .actions-container > .action-item {\n\tmargin-top: 2px;\n}\n\n.quick-input-title {\n\tcursor: grab;\n\tpadding: 3px 0px;\n\ttext-align: center;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n}\n\n.quick-input-right-action-bar {\n\tdisplay: flex;\n\tmargin-right: 4px;\n\tflex: 1;\n}\n\n.quick-input-right-action-bar > .actions-container {\n\tjustify-content: flex-end;\n}\n\n.quick-input-right-action-bar > .actions-container > .action-item {\n\tmargin-left: 4px;\n}\n\n.quick-input-titlebar .monaco-action-bar .action-label.codicon {\n\tbackground-position: center;\n\tbackground-repeat: no-repeat;\n\tpadding: 2px;\n}\n\n.quick-input-description {\n\tmargin: 6px 6px 6px 11px;\n}\n\n.quick-input-header .quick-input-description {\n\tmargin: 4px 2px;\n\tflex: 1;\n}\n\n.quick-input-header {\n\tcursor: grab;\n\tdisplay: flex;\n\tpadding: 6px 6px 2px 6px;\n}\n\n.quick-input-widget.hidden-input .quick-input-header {\n\t/* reduce margins and paddings when input box hidden */\n\tpadding: 0;\n\tmargin-bottom: 0;\n}\n\n.quick-input-and-message {\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex-grow: 1;\n\tmin-width: 0;\n\tposition: relative;\n}\n\n.quick-input-check-all {\n\talign-self: center;\n\tmargin: 0;\n}\n\n.quick-input-widget .quick-input-header .monaco-checkbox {\n\tmargin-top: 6px;\n}\n\n.quick-input-filter {\n\tflex-grow: 1;\n\tdisplay: flex;\n\tposition: relative;\n}\n\n.quick-input-box {\n\tflex-grow: 1;\n}\n\n.quick-input-widget.show-checkboxes .quick-input-box,\n.quick-input-widget.show-checkboxes .quick-input-message {\n\tmargin-left: 5px;\n}\n\n.quick-input-visible-count {\n\tposition: absolute;\n\tleft: -10000px;\n}\n\n.quick-input-count {\n\talign-self: center;\n\tposition: absolute;\n\tright: 4px;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.quick-input-count .monaco-count-badge {\n\tvertical-align: middle;\n\tpadding: 2px 4px;\n\tborder-radius: 2px;\n\tmin-height: auto;\n\tline-height: normal;\n}\n\n.quick-input-action {\n\tmargin-left: 6px;\n}\n\n.quick-input-action .monaco-text-button {\n\tfont-size: 11px;\n\tpadding: 0 6px;\n\tdisplay: flex;\n\theight: 25px;\n\talign-items: center;\n}\n\n.quick-input-message {\n\tmargin-top: -1px;\n\tpadding: 5px;\n\toverflow-wrap: break-word;\n}\n\n.quick-input-message > .codicon {\n\tmargin: 0 0.2em;\n\tvertical-align: text-bottom;\n}\n\n/* Links in descriptions & validations */\n.quick-input-message a {\n\tcolor: inherit;\n}\n\n.quick-input-progress.monaco-progress-container {\n\tposition: relative;\n}\n\n.quick-input-list {\n\tline-height: 22px;\n}\n\n.quick-input-widget.hidden-input .quick-input-list {\n\tmargin-top: 4px;\n\t/* reduce margins when input box hidden */\n\tpadding-bottom: 4px;\n}\n\n.quick-input-list .monaco-list {\n\toverflow: hidden;\n\tmax-height: calc(20 * 22px);\n\tpadding-bottom: 5px;\n}\n\n.quick-input-list .monaco-scrollable-element {\n\tpadding: 0px 6px;\n}\n\n.quick-input-list .quick-input-list-entry {\n\tbox-sizing: border-box;\n\toverflow: hidden;\n\tdisplay: flex;\n\tpadding: 0 6px;\n}\n\n.quick-input-list .quick-input-list-entry.quick-input-list-separator-border {\n\tborder-top-width: 1px;\n\tborder-top-style: solid;\n}\n\n.quick-input-list .monaco-list-row {\n\tborder-radius: 3px;\n}\n\n.quick-input-list .monaco-list-row[data-index=\"0\"] .quick-input-list-entry.quick-input-list-separator-border {\n\tborder-top-style: none;\n}\n\n.quick-input-list .quick-input-list-label {\n\toverflow: hidden;\n\tdisplay: flex;\n\theight: 100%;\n\tflex: 1;\n}\n\n.quick-input-widget .monaco-checkbox {\n\tmargin-right: 0;\n}\n\n.quick-input-widget .quick-input-list .monaco-checkbox,\n.quick-input-widget .quick-input-tree .monaco-checkbox {\n\tmargin-top: 4px;\n}\n\n.quick-input-list .quick-input-list-icon {\n\tbackground-size: 16px;\n\tbackground-position: left center;\n\tbackground-repeat: no-repeat;\n\tpadding-right: 6px;\n\twidth: 16px;\n\theight: 22px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.quick-input-list .quick-input-list-rows {\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tdisplay: flex;\n\tflex-direction: column;\n\theight: 100%;\n\tflex: 1;\n\tmargin-left: 5px;\n}\n\n.quick-input-list .quick-input-list-rows > .quick-input-list-row {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.quick-input-list .quick-input-list-rows > .quick-input-list-row .monaco-icon-label,\n.quick-input-list .quick-input-list-rows > .quick-input-list-row .monaco-icon-label .monaco-icon-label-container > .monaco-icon-name-container {\n\tflex: 1;\n\t/* make sure the icon label grows within the row */\n}\n\n.quick-input-list .quick-input-list-rows > .quick-input-list-row .codicon[class*='codicon-'] {\n\tvertical-align: text-bottom;\n}\n\n.quick-input-list .quick-input-list-rows .monaco-highlighted-label > span {\n\topacity: 1;\n}\n\n.quick-input-list .quick-input-list-entry .quick-input-list-entry-keybinding {\n\tmargin-right: 8px;\n\t/* separate from the separator label or scrollbar if any */\n}\n\n.quick-input-list .quick-input-list-label-meta {\n\topacity: 0.7;\n\tline-height: normal;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n}\n\n/* preserve list-like styling instead of tree-like styling */\n.quick-input-list .monaco-list .monaco-list-row .monaco-highlighted-label .highlight {\n\tfont-weight: bold;\n\tbackground-color: unset;\n\tcolor: var(--vscode-list-highlightForeground) !important;\n}\n\n/* preserve list-like styling instead of tree-like styling */\n.quick-input-list .monaco-list .monaco-list-row.focused .monaco-highlighted-label .highlight {\n\tcolor: var(--vscode-list-focusHighlightForeground) !important;\n}\n\n.quick-input-list .quick-input-list-entry .quick-input-list-separator {\n\tmargin-right: 4px;\n\t/* separate from keybindings or actions */\n}\n\n.quick-input-list .quick-input-list-entry-action-bar {\n\tdisplay: flex;\n\tflex: 0;\n\toverflow: visible;\n}\n\n.quick-input-list .quick-input-list-entry-action-bar .action-label {\n\t/*\n\t * By default, actions in the quick input action bar are hidden\n\t * until hovered over them or selected.\n\t */\n\tdisplay: none;\n}\n\n.quick-input-list .quick-input-list-entry-action-bar .action-label.codicon {\n\tmargin-right: 4px;\n\tpadding: 2px;\n}\n\n.quick-input-list .quick-input-list-entry-action-bar {\n\tmargin-top: 1px;\n}\n\n.quick-input-list .quick-input-list-entry-action-bar {\n\tmargin-right: 4px;\n\t/* separate from scrollbar */\n}\n\n.quick-input-list .quick-input-list-entry .quick-input-list-entry-action-bar .action-label.always-visible,\n.quick-input-list .quick-input-list-entry:hover .quick-input-list-entry-action-bar .action-label,\n.quick-input-list .quick-input-list-entry.focus-inside .quick-input-list-entry-action-bar .action-label,\n.quick-input-list .monaco-list-row.focused .quick-input-list-entry-action-bar .action-label,\n.quick-input-list .monaco-list-row.passive-focused .quick-input-list-entry-action-bar .action-label {\n\tdisplay: flex;\n}\n\n.quick-input-list > .monaco-list:focus .monaco-list-row.focused {\n\toutline: 1px solid var(--vscode-list-focusOutline) !important;\n\toutline-offset: -1px;\n}\n\n.quick-input-list > .monaco-list:focus .monaco-list-row.focused .quick-input-list-entry.quick-input-list-separator-border {\n\tborder-color: transparent;\n}\n\n/* focused items in quick pick */\n.quick-input-list .monaco-list-row.focused .monaco-keybinding-key,\n.quick-input-list .monaco-list-row.focused .quick-input-list-entry .quick-input-list-separator {\n\tcolor: inherit\n}\n\n.quick-input-list .monaco-list-row.focused .monaco-keybinding-key {\n\tbackground: none;\n}\n\n.quick-input-list .quick-input-list-separator-as-item {\n\tpadding: 4px 6px;\n\tfont-size: 12px;\n}\n\n/* Quick input separators as full-row item */\n.quick-input-list .quick-input-list-separator-as-item .label-name {\n\tfont-weight: 600;\n}\n\n.quick-input-list .quick-input-list-separator-as-item .label-description {\n\t/* Override default description opacity so we don't have a contrast ratio issue. */\n\topacity: 1 !important;\n}\n\n/* Hide border when the item becomes the sticky one */\n.quick-input-list .monaco-tree-sticky-row .quick-input-list-entry.quick-input-list-separator-as-item.quick-input-list-separator-border {\n\tborder-top-style: none;\n}\n\n/* Give sticky row the same padding as the scrollable list */\n.quick-input-list .monaco-tree-sticky-row {\n\tpadding: 0 5px;\n}\n\n/* Hide the twistie containers so that there isn't blank indent */\n.quick-input-list .monaco-tl-twistie {\n\tdisplay: none !important;\n}\n\n/* Tree */\n\n.quick-input-tree .monaco-list {\n\toverflow: hidden;\n\tmax-height: calc(20 * 22px);\n\tpadding-bottom: 5px;\n}\n\n.quick-input-tree .quick-input-tree-entry {\n\tbox-sizing: border-box;\n\toverflow: hidden;\n\tdisplay: flex;\n\tpadding: 0 6px;\n}\n\n.quick-input-tree .quick-input-tree-label {\n\toverflow: hidden;\n\tdisplay: flex;\n\theight: 100%;\n\tflex: 1;\n}\n\n.quick-input-tree .quick-input-tree-icon {\n\tbackground-size: 16px;\n\tbackground-position: left center;\n\tbackground-repeat: no-repeat;\n\tpadding-right: 6px;\n\twidth: 16px;\n\theight: 22px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.quick-input-tree .quick-input-tree-rows {\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tdisplay: flex;\n\tflex-direction: column;\n\theight: 100%;\n\tflex: 1;\n\tmargin-left: 5px;\n}\n\n.quick-input-tree .quick-input-tree-rows > .quick-input-tree-row {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.quick-input-tree .quick-input-tree-rows > .quick-input-tree-row .monaco-icon-label,\n.quick-input-tree .quick-input-tree-rows > .quick-input-tree-row .monaco-icon-label .monaco-icon-label-container > .monaco-icon-name-container {\n\tflex: 1;\n\t/* make sure the icon label grows within the row */\n}\n\n.quick-input-tree .quick-input-tree-rows > .quick-input-tree-row .codicon[class*='codicon-'] {\n\tvertical-align: text-bottom;\n}\n\n.quick-input-tree .quick-input-tree-rows .monaco-highlighted-label > span {\n\topacity: 1;\n}\n\n.quick-input-tree .quick-input-tree-entry-action-bar {\n\tdisplay: flex;\n\tflex: 0;\n\toverflow: visible;\n}\n\n.quick-input-tree .quick-input-tree-entry-action-bar .action-label {\n\t/*\n\t * By default, actions in the quick input action bar are hidden\n\t * until hovered over them or selected.\n\t */\n\tdisplay: none;\n}\n\n.quick-input-tree .quick-input-tree-entry-action-bar .action-label.codicon {\n\tmargin-right: 4px;\n\tpadding: 2px;\n}\n\n.quick-input-tree .quick-input-tree-entry-action-bar {\n\tmargin-top: 1px;\n}\n\n.quick-input-tree .quick-input-tree-entry-action-bar {\n\tmargin-right: 4px;\n\t/* separate from scrollbar */\n}\n\n.quick-input-tree .quick-input-tree-entry .quick-input-tree-entry-action-bar .action-label.always-visible,\n.quick-input-tree .quick-input-tree-entry:hover .quick-input-tree-entry-action-bar .action-label,\n.quick-input-tree .quick-input-tree-entry.focus-inside .quick-input-tree-entry-action-bar .action-label,\n.quick-input-tree .monaco-list-row.focused .quick-input-tree-entry-action-bar .action-label,\n.quick-input-tree .monaco-list-row.passive-focused .quick-input-tree-entry-action-bar .action-label {\n\tdisplay: flex;\n}\n\n.quick-input-tree > .monaco-list:focus .monaco-list-row.focused {\n\toutline: 1px solid var(--vscode-list-focusOutline) !important;\n\toutline-offset: -1px;\n}\n",""]);const a=r},7536:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n:root {\n\t--vscode-sash-size: 4px;\n}\n\n.monaco-sash {\n\tposition: absolute;\n\tz-index: 35;\n\ttouch-action: none;\n}\n\n.monaco-sash.disabled {\n\tpointer-events: none;\n}\n\n.monaco-sash.mac.vertical {\n\tcursor: col-resize;\n}\n\n.monaco-sash.vertical.minimum {\n\tcursor: e-resize;\n}\n\n.monaco-sash.vertical.maximum {\n\tcursor: w-resize;\n}\n\n.monaco-sash.mac.horizontal {\n\tcursor: row-resize;\n}\n\n.monaco-sash.horizontal.minimum {\n\tcursor: s-resize;\n}\n\n.monaco-sash.horizontal.maximum {\n\tcursor: n-resize;\n}\n\n.monaco-sash.disabled {\n\tcursor: default !important;\n\tpointer-events: none !important;\n}\n\n.monaco-sash.vertical {\n\tcursor: ew-resize;\n\ttop: 0;\n\twidth: var(--vscode-sash-size);\n\theight: 100%;\n}\n\n.monaco-sash.horizontal {\n\tcursor: ns-resize;\n\tleft: 0;\n\twidth: 100%;\n\theight: var(--vscode-sash-size);\n}\n\n.monaco-sash:not(.disabled) > .orthogonal-drag-handle {\n\tcontent: \" \";\n\theight: calc(var(--vscode-sash-size) * 2);\n\twidth: calc(var(--vscode-sash-size) * 2);\n\tz-index: 100;\n\tdisplay: block;\n\tcursor: all-scroll;\n\tposition: absolute;\n}\n\n.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)\n\t> .orthogonal-drag-handle.start,\n.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)\n\t> .orthogonal-drag-handle.end {\n\tcursor: nwse-resize;\n}\n\n.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)\n\t> .orthogonal-drag-handle.end,\n.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)\n\t> .orthogonal-drag-handle.start {\n\tcursor: nesw-resize;\n}\n\n.monaco-sash.vertical > .orthogonal-drag-handle.start {\n\tleft: calc(var(--vscode-sash-size) * -0.5);\n\ttop: calc(var(--vscode-sash-size) * -1);\n}\n.monaco-sash.vertical > .orthogonal-drag-handle.end {\n\tleft: calc(var(--vscode-sash-size) * -0.5);\n\tbottom: calc(var(--vscode-sash-size) * -1);\n}\n.monaco-sash.horizontal > .orthogonal-drag-handle.start {\n\ttop: calc(var(--vscode-sash-size) * -0.5);\n\tleft: calc(var(--vscode-sash-size) * -1);\n}\n.monaco-sash.horizontal > .orthogonal-drag-handle.end {\n\ttop: calc(var(--vscode-sash-size) * -0.5);\n\tright: calc(var(--vscode-sash-size) * -1);\n}\n\n.monaco-sash:before {\n\tcontent: '';\n\tpointer-events: none;\n\tposition: absolute;\n\twidth: 100%;\n\theight: 100%;\n\ttransition: background-color 0.1s ease-out;\n\tbackground: transparent;\n}\n\n.monaco-sash.hover:before,\n.monaco-sash.active:before {\n\tbackground: var(--vscode-sash-hoverBorder);\n}\n\n.monaco-sash.vertical:before {\n\twidth: var(--vscode-sash-hover-size);\n\tleft: calc(50% - (var(--vscode-sash-hover-size) / 2));\n}\n\n.monaco-sash.horizontal:before {\n\theight: var(--vscode-sash-hover-size);\n\ttop: calc(50% - (var(--vscode-sash-hover-size) / 2));\n}\n\n.pointer-events-disabled {\n\tpointer-events: none !important;\n}\n\n/** Debug **/\n\n.monaco-sash.debug {\n\tbackground: cyan;\n}\n\n.monaco-sash.debug.disabled {\n\tbackground: rgba(0, 255, 255, 0.2);\n}\n\n.monaco-sash.debug:not(.disabled) > .orthogonal-drag-handle {\n\tbackground: red;\n}\n",""]);const a=r},7568:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-dropdown {\n\theight: 100%;\n\tpadding: 0;\n}\n\n.monaco-dropdown > .dropdown-label {\n\tcursor: pointer;\n\theight: 100%;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.monaco-dropdown > .dropdown-label > .action-label.disabled {\n\tcursor: default;\n}\n\n.monaco-dropdown-with-primary {\n\tdisplay: flex !important;\n\tflex-direction: row;\n\tborder-radius: 5px;\n}\n\n.monaco-dropdown-with-primary > .action-container > .action-label {\n\tmargin-right: 0;\n}\n\n.monaco-dropdown-with-primary > .dropdown-action-container > .monaco-dropdown > .dropdown-label .codicon[class*='codicon-'] {\n\tfont-size: 12px;\n\tpadding-left: 0px;\n\tpadding-right: 0px;\n\tline-height: 16px;\n\tmargin-left: -3px;\n}\n\n.monaco-dropdown-with-primary > .dropdown-action-container > .monaco-dropdown > .dropdown-label > .action-label {\n\tdisplay: block;\n\tbackground-size: 16px;\n\tbackground-position: center center;\n\tbackground-repeat: no-repeat;\n}\n",""]);const a=r},7584:e=>{e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjNDI0MjQyIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="},7619:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* Use custom CSS vars to expose padding into parent select for padding calculation */\n.monaco-select-box-dropdown-padding {\n\t--dropdown-padding-top: 1px;\n\t--dropdown-padding-bottom: 1px;\n}\n\n.hc-black .monaco-select-box-dropdown-padding,\n.hc-light .monaco-select-box-dropdown-padding {\n\t--dropdown-padding-top: 3px;\n\t--dropdown-padding-bottom: 4px;\n}\n\n.monaco-select-box-dropdown-container {\n\tdisplay: none;\n\tbox-sizing:\tborder-box;\n}\n\n.monaco-select-box-dropdown-container > .select-box-details-pane > .select-box-description-markdown * {\n\tmargin: 0;\n}\n\n.monaco-select-box-dropdown-container > .select-box-details-pane > .select-box-description-markdown a:focus {\n\toutline: 1px solid -webkit-focus-ring-color;\n\toutline-offset: -1px;\n}\n\n.monaco-select-box-dropdown-container > .select-box-details-pane > .select-box-description-markdown code {\n\tline-height: 15px; /** For some reason, this is needed, otherwise <code> will take up 20px height */\n\tfont-family: var(--monaco-monospace-font);\n}\n\n\n.monaco-select-box-dropdown-container.visible {\n\tdisplay: flex;\n\tflex-direction: column;\n\ttext-align: left;\n\twidth: 1px;\n\toverflow: hidden;\n\tborder-bottom-left-radius: 3px;\n\tborder-bottom-right-radius: 3px;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container {\n\tflex: 0 0 auto;\n\talign-self: flex-start;\n\tpadding-top: var(--dropdown-padding-top);\n\tpadding-bottom: var(--dropdown-padding-bottom);\n\tpadding-left: 1px;\n\tpadding-right: 1px;\n\twidth: 100%;\n\toverflow: hidden;\n\tbox-sizing:\tborder-box;\n}\n\n.monaco-select-box-dropdown-container > .select-box-details-pane {\n\tpadding: 5px;\n}\n\n.hc-black .monaco-select-box-dropdown-container > .select-box-dropdown-list-container {\n\tpadding-top: var(--dropdown-padding-top);\n\tpadding-bottom: var(--dropdown-padding-bottom);\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row {\n\tcursor: pointer;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row > .option-text {\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\tpadding-left: 3.5px;\n\twhite-space: nowrap;\n\tfloat: left;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row > .option-detail {\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\tpadding-left: 3.5px;\n\twhite-space: nowrap;\n\tfloat: left;\n\topacity: 0.7;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row > .option-decorator-right {\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\tpadding-right: 10px;\n\twhite-space: nowrap;\n\tfloat: right;\n}\n\n\n/* Accepted CSS hiding technique for accessibility reader text */\n/* https://webaim.org/techniques/css/invisiblecontent/ */\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row > .visually-hidden {\n\t\tposition: absolute;\n\t\tleft: -10000px;\n\t\ttop: auto;\n\t\twidth: 1px;\n\t\theight: 1px;\n\t\toverflow: hidden;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-container-width-control {\n\tflex: 1 1 auto;\n\talign-self: flex-start;\n\topacity: 0;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-container-width-control > .width-control-div {\n\toverflow: hidden;\n\tmax-height: 0px;\n}\n\n.monaco-select-box-dropdown-container > .select-box-dropdown-container-width-control > .width-control-div > .option-text-width-control {\n\tpadding-left: 4px;\n\tpadding-right: 8px;\n\twhite-space: nowrap;\n}\n",""]);const a=r},7659:e=>{var t={};e.exports=function(e,i){var n=function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(e){i=null}t[e]=i}return t[e]}(e);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(i)}},7689:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .sticky-widget {\n\toverflow: hidden;\n\tborder-bottom: 1px solid var(--vscode-editorStickyScroll-border);\n\twidth: 100%;\n\tbox-shadow: var(--vscode-editorStickyScroll-shadow) 0 4px 2px -2px;\n\tz-index: 4;\n\tright: initial !important;\n\tmargin-left: '0px';\n}\n\n.monaco-editor .sticky-widget .sticky-widget-line-numbers {\n\tfloat: left;\n\tbackground-color: var(--vscode-editorStickyScrollGutter-background);\n}\n\n.monaco-editor .sticky-widget.peek .sticky-widget-line-numbers {\n\tbackground-color: var(--vscode-peekViewEditorStickyScrollGutter-background);\n}\n\n.monaco-editor .sticky-widget .sticky-widget-lines-scrollable {\n\tdisplay: inline-block;\n\tposition: absolute;\n\toverflow: hidden;\n\twidth: var(--vscode-editorStickyScroll-scrollableWidth);\n\tbackground-color: var(--vscode-editorStickyScroll-background);\n}\n\n.monaco-editor .sticky-widget.peek .sticky-widget-lines-scrollable {\n\tbackground-color: var(--vscode-peekViewEditorStickyScroll-background);\n}\n\n.monaco-editor .sticky-widget .sticky-widget-lines {\n\tposition: absolute;\n\tbackground-color: inherit;\n}\n\n.monaco-editor .sticky-widget .sticky-line-number,\n.monaco-editor .sticky-widget .sticky-line-content {\n\tcolor: var(--vscode-editorLineNumber-foreground);\n\twhite-space: nowrap;\n\tdisplay: inline-block;\n\tposition: absolute;\n\tbackground-color: inherit;\n}\n\n.monaco-editor .sticky-widget .sticky-line-number .codicon-folding-expanded,\n.monaco-editor .sticky-widget .sticky-line-number .codicon-folding-collapsed {\n\tfloat: right;\n\ttransition: var(--vscode-editorStickyScroll-foldingOpacityTransition);\n\tposition: absolute;\n\tmargin-left: 2px;\n}\n\n.monaco-editor .sticky-widget .sticky-line-content {\n\twidth: var(--vscode-editorStickyScroll-scrollableWidth);\n\tbackground-color: inherit;\n\twhite-space: nowrap;\n}\n\n.monaco-editor .sticky-widget .sticky-line-number-inner {\n\tdisplay: inline-block;\n\ttext-align: right;\n}\n\n.monaco-editor .sticky-widget .sticky-line-content:hover {\n\tbackground-color: var(--vscode-editorStickyScrollHover-background);\n\tcursor: pointer;\n}\n",""]);const a=r},7823:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .lines-content .core-guide {\n\tposition: absolute;\n\tbox-sizing: border-box;\n}\n\n.monaco-editor .lines-content .core-guide-indent {\n\tbox-shadow: 1px 0 0 0 var(--vscode-editorIndentGuide-background) inset;\n}\n\n.monaco-editor .lines-content .core-guide-indent-active {\n\tbox-shadow: 1px 0 0 0 var(--vscode-editorIndentGuide-activeBackground, --vscode-editorIndentGuide-background) inset;\n}\n",""]);const a=r},7825:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(i){!function(e,t,i){var n="";i.supports&&(n+="@supports (".concat(i.supports,") {")),i.media&&(n+="@media ".concat(i.media," {"));var o=void 0!==i.layer;o&&(n+="@layer".concat(i.layer.length>0?" ".concat(i.layer):""," {")),n+=i.css,o&&(n+="}"),i.media&&(n+="}"),i.supports&&(n+="}");var s=i.sourceMap;s&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(n,e,t.options)}(t,e,i)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},7982:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-toolbar {\n\theight: 100%;\n}\n\n.monaco-toolbar .toolbar-toggle-more {\n\tdisplay: inline-block;\n\tpadding: 0;\n}\n",""]);const a=r},7997:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .bracket-match {\n\tbox-sizing: border-box;\n\tbackground-color: var(--vscode-editorBracketMatch-background);\n\tborder: 1px solid var(--vscode-editorBracketMatch-border);\n}\n",""]);const a=r},8033:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .rename-box {\n\tz-index: 100;\n\tcolor: inherit;\n\tborder-radius: 4px;\n}\n\n.monaco-editor .rename-box.preview {\n\tpadding: 4px 4px 0 4px;\n}\n\n.monaco-editor .rename-box .rename-input-with-button {\n\tpadding: 3px;\n\tborder-radius: 2px;\n\twidth: calc(100% - 8px); /* 4px padding on each side */\n}\n\n.monaco-editor .rename-box .rename-input {\n\twidth: calc(100% - 8px); /* 4px padding on each side */\n\tpadding: 0;\n}\n\n.monaco-editor .rename-box .rename-input:focus {\n\toutline: none;\n}\n\n.monaco-editor .rename-box .rename-suggestions-button {\n\tdisplay: flex;\n\talign-items: center;\n\tpadding: 3px;\n\tbackground-color: transparent;\n\tborder: none;\n\tborder-radius: 5px;\n\tcursor: pointer;\n}\n\n.monaco-editor .rename-box .rename-suggestions-button:hover {\n\tbackground-color: var(--vscode-toolbar-hoverBackground)\n}\n\n.monaco-editor .rename-box .rename-candidate-list-container .monaco-list-row {\n\tborder-radius: 2px;\n}\n\n.monaco-editor .rename-box .rename-label {\n\tdisplay: none;\n\topacity: .8;\n}\n\n.monaco-editor .rename-box.preview .rename-label {\n\tdisplay: inherit;\n}\n",""]);const a=r},8048:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* ---------- Icon label ---------- */\n\n.monaco-icon-label {\n\tdisplay: flex; /* required for icons support :before rule */\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.monaco-icon-label::before {\n\n\t/* svg icons rendered as background image */\n\tbackground-size: 16px;\n\tbackground-position: left center;\n\tbackground-repeat: no-repeat;\n\tpadding-right: 6px;\n\twidth: 16px;\n\theight: 22px;\n\tline-height: inherit !important;\n\tdisplay: inline-block;\n\n\t/* fonts icons */\n\t-webkit-font-smoothing: antialiased;\n\t-moz-osx-font-smoothing: grayscale;\n\tvertical-align: top;\n\n\tflex-shrink: 0; /* fix for https://github.com/microsoft/vscode/issues/13787 */\n}\n\n.monaco-icon-label-container.disabled {\n\tcolor: var(--vscode-disabledForeground);\n}\n.monaco-icon-label > .monaco-icon-label-container {\n\tmin-width: 0;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tflex: 1;\n}\n\n.monaco-icon-label > .monaco-icon-label-container > .monaco-icon-name-container > .label-name {\n\tcolor: inherit;\n\twhite-space: pre; /* enable to show labels that include multiple whitespaces */\n}\n\n.monaco-icon-label > .monaco-icon-label-container > .monaco-icon-name-container > .label-name > .label-separator {\n\tmargin: 0 2px;\n\topacity: 0.5;\n}\n\n.monaco-icon-label > .monaco-icon-label-container > .monaco-icon-description-container > .label-description {\n\topacity: .7;\n\tmargin-left: 0.5em;\n\tfont-size: 0.9em;\n\twhite-space: pre; /* enable to show labels that include multiple whitespaces */\n}\n\n.monaco-icon-label.nowrap > .monaco-icon-label-container > .monaco-icon-description-container > .label-description{\n\twhite-space: nowrap\n}\n\n.vs .monaco-icon-label > .monaco-icon-label-container > .monaco-icon-description-container > .label-description {\n\topacity: .95;\n}\n\n.monaco-icon-label.italic > .monaco-icon-label-container > .monaco-icon-name-container > .label-name,\n.monaco-icon-label.italic > .monaco-icon-label-container > .monaco-icon-description-container > .label-description {\n\tfont-style: italic;\n}\n\n.monaco-icon-label.deprecated {\n\ttext-decoration: line-through;\n\topacity: 0.66;\n}\n\n/* make sure apply italic font style to decorations as well */\n.monaco-icon-label.italic::after {\n\tfont-style: italic;\n}\n\n.monaco-icon-label.strikethrough > .monaco-icon-label-container > .monaco-icon-name-container > .label-name,\n.monaco-icon-label.strikethrough > .monaco-icon-label-container > .monaco-icon-description-container > .label-description {\n\ttext-decoration: line-through;\n}\n\n.monaco-icon-label::after {\n\topacity: 0.75;\n\tfont-size: 90%;\n\tfont-weight: 600;\n\tmargin: auto 16px 0 5px; /* https://github.com/microsoft/vscode/issues/113223 */\n\ttext-align: center;\n}\n\n/* make sure selection color wins when a label is being selected */\n.monaco-list:focus .selected .monaco-icon-label, /* list */\n.monaco-list:focus .selected .monaco-icon-label::after\n{\n\tcolor: inherit !important;\n}\n\n.monaco-list-row.focused.selected .label-description,\n.monaco-list-row.selected .label-description {\n\topacity: .8;\n}\n",""]);const a=r},8053:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .inputarea {\n\tmin-width: 0;\n\tmin-height: 0;\n\tmargin: 0;\n\tpadding: 0;\n\tposition: absolute;\n\toutline: none !important;\n\tresize: none;\n\tborder: none;\n\toverflow: hidden;\n\tcolor: transparent;\n\tbackground-color: transparent;\n\tz-index: -10;\n}\n/*.monaco-editor .inputarea {\n\tposition: fixed !important;\n\twidth: 800px !important;\n\theight: 500px !important;\n\ttop: initial !important;\n\tleft: initial !important;\n\tbottom: 0 !important;\n\tright: 0 !important;\n\tcolor: black !important;\n\tbackground: white !important;\n\tline-height: 15px !important;\n\tfont-size: 14px !important;\n\tz-index: 10 !important;\n}*/\n.monaco-editor .inputarea.ime-input {\n\tz-index: 10;\n\tcaret-color: var(--vscode-editorCursor-foreground);\n\tcolor: var(--vscode-editor-foreground);\n}\n",""]);const a=r},8081:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .glyph-margin {\n\tposition: absolute;\n\ttop: 0;\n}\n\n/*\n\tKeeping name short for faster parsing.\n\tcgmr = core glyph margin rendering (div)\n*/\n.monaco-editor .glyph-margin-widgets .cgmr {\n\tposition: absolute;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n/*\n\tEnsure spinning icons are pixel-perfectly centered and avoid wobble.\n\tThis is only applied to icons that spin to avoid unnecessary\n\tGPU layers and blurry subpixel AA.\n*/\n.monaco-editor .glyph-margin-widgets .cgmr.codicon-modifier-spin::before {\n\tposition: absolute;\n\ttop: 50%;\n\tleft: 50%;\n\ttransform: translate(-50%, -50%);\n}\n",""]);const a=r},8129:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.inline-editor-progress-decoration {\n\tdisplay: inline-block;\n\twidth: 1em;\n\theight: 1em;\n}\n\n.inline-progress-widget {\n\tdisplay: flex !important;\n\tjustify-content: center;\n\talign-items: center;\n}\n\n.inline-progress-widget .icon {\n\tfont-size: 80% !important;\n}\n\n.inline-progress-widget:hover .icon {\n\tfont-size: 90% !important;\n\tanimation: none;\n}\n\n.inline-progress-widget:hover .icon::before {\n\tcontent: var(--vscode-icon-x-content);\n\tfont-family: var(--vscode-icon-x-font-family);\n}\n",""]);const a=r},8134:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* ---------- Icon label ---------- */\n\n.monaco-icon-label {\n\tdisplay: flex; /* required for icons support :before rule */\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.monaco-icon-label::before {\n\n\t/* svg icons rendered as background image */\n\tbackground-size: 16px;\n\tbackground-position: left center;\n\tbackground-repeat: no-repeat;\n\tpadding-right: 6px;\n\twidth: 16px;\n\theight: 22px;\n\tline-height: inherit !important;\n\tdisplay: inline-block;\n\n\t/* fonts icons */\n\t-webkit-font-smoothing: antialiased;\n\t-moz-osx-font-smoothing: grayscale;\n\tvertical-align: top;\n\n\tflex-shrink: 0; /* fix for https://github.com/microsoft/vscode/issues/13787 */\n}\n\n.monaco-icon-label-iconpath {\n\twidth: 16px;\n\theight: 16px;\n\tpadding-left: 2px;\n\tmargin-top: 2px;\n\tdisplay: flex;\n}\n\n.monaco-icon-label-container.disabled {\n\tcolor: var(--vscode-disabledForeground);\n}\n.monaco-icon-label > .monaco-icon-label-container {\n\tmin-width: 0;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tflex: 1;\n}\n\n.monaco-icon-label > .monaco-icon-label-container > .monaco-icon-name-container > .label-name {\n\tcolor: inherit;\n\twhite-space: pre; /* enable to show labels that include multiple whitespaces */\n}\n\n.monaco-icon-label > .monaco-icon-label-container > .monaco-icon-name-container > .label-name > .label-separator {\n\tmargin: 0 2px;\n\topacity: 0.5;\n}\n\n.monaco-icon-label > .monaco-icon-label-container > .monaco-icon-suffix-container > .label-suffix {\n\topacity: .7;\n\twhite-space: pre;\n}\n\n.monaco-icon-label > .monaco-icon-label-container > .monaco-icon-description-container > .label-description {\n\topacity: .7;\n\tmargin-left: 0.5em;\n\tfont-size: 0.9em;\n\twhite-space: pre; /* enable to show labels that include multiple whitespaces */\n}\n\n.monaco-icon-label.nowrap > .monaco-icon-label-container > .monaco-icon-description-container > .label-description{\n\twhite-space: nowrap\n}\n\n.vs .monaco-icon-label > .monaco-icon-label-container > .monaco-icon-description-container > .label-description {\n\topacity: .95;\n}\n\n.monaco-icon-label.italic > .monaco-icon-label-container > .monaco-icon-name-container > .label-name,\n.monaco-icon-label.italic > .monaco-icon-label-container > .monaco-icon-description-container > .label-description {\n\tfont-style: italic;\n}\n\n.monaco-icon-label.deprecated {\n\ttext-decoration: line-through;\n\topacity: 0.66;\n}\n\n.monaco-icon-label.strikethrough > .monaco-icon-label-container > .monaco-icon-name-container > .label-name,\n.monaco-icon-label.strikethrough > .monaco-icon-label-container > .monaco-icon-description-container > .label-description {\n\ttext-decoration: line-through;\n}\n\n.monaco-icon-label::after {\n\topacity: 0.75;\n\tfont-size: 90%;\n\tfont-weight: 600;\n\tmargin: auto 16px 0 5px; /* https://github.com/microsoft/vscode/issues/113223 */\n\ttext-align: center;\n}\n\n/* make sure selection color wins when a label is being selected */\n.monaco-list:focus .selected .monaco-icon-label, /* list */\n.monaco-list:focus .selected .monaco-icon-label::after\n{\n\tcolor: inherit !important;\n}\n\n.monaco-list-row.focused.selected .label-description,\n.monaco-list-row.selected .label-description {\n\topacity: .8;\n}\n",""]);const a=r},8169:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .inputarea {\n\tmin-width: 0;\n\tmin-height: 0;\n\tmargin: 0;\n\tpadding: 0;\n\tposition: absolute;\n\toutline: none !important;\n\tresize: none;\n\tborder: none;\n\toverflow: hidden;\n\tcolor: transparent;\n\tbackground-color: transparent;\n\tz-index: -10;\n}\n/*.monaco-editor .inputarea {\n\tposition: fixed !important;\n\twidth: 800px !important;\n\theight: 500px !important;\n\ttop: initial !important;\n\tleft: initial !important;\n\tbottom: 0 !important;\n\tright: 0 !important;\n\tcolor: black !important;\n\tbackground: white !important;\n\tline-height: 15px !important;\n\tfont-size: 14px !important;\n\tz-index: 10 !important;\n}*/\n.monaco-editor .inputarea.ime-input {\n\tz-index: 10;\n\tcaret-color: var(--vscode-editorCursor-foreground);\n\tcolor: var(--vscode-editor-foreground);\n}\n",""]);const a=r},8189:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .mwh {\n\tposition: absolute;\n\tcolor: var(--vscode-editorWhitespace-foreground) !important;\n}\n",""]);const a=r},8245:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .unicode-highlight {\n\tborder: 1px solid var(--vscode-editorUnicodeHighlight-border);\n\tbackground-color: var(--vscode-editorUnicodeHighlight-background);\n\tbox-sizing: border-box;\n}\n",""]);const a=r},8268:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-mouse-cursor-text {\n\tcursor: text;\n}\n",""]);const a=r},8315:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/*\n\tKeeping name short for faster parsing.\n\tcdr = core decorations rendering (div)\n*/\n.monaco-editor .lines-content .cdr {\n\tposition: absolute;\n}",""]);const a=r},8357:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor.vs .dnd-target,\n.monaco-editor.hc-light .dnd-target {\n\tborder-right: 2px dotted black;\n\tcolor: white; /* opposite of black */\n}\n.monaco-editor.vs-dark .dnd-target {\n\tborder-right: 2px dotted #AEAFAD;\n\tcolor: #51504f; /* opposite of #AEAFAD */\n}\n.monaco-editor.hc-black .dnd-target {\n\tborder-right: 2px dotted #fff;\n\tcolor: #000; /* opposite of #fff */\n}\n\n.monaco-editor.mouse-default .view-lines,\n.monaco-editor.vs-dark.mac.mouse-default .view-lines,\n.monaco-editor.hc-black.mac.mouse-default .view-lines,\n.monaco-editor.hc-light.mac.mouse-default .view-lines {\n\tcursor: default;\n}\n.monaco-editor.mouse-copy .view-lines,\n.monaco-editor.vs-dark.mac.mouse-copy .view-lines,\n.monaco-editor.hc-black.mac.mouse-copy .view-lines,\n.monaco-editor.hc-light.mac.mouse-copy .view-lines {\n\tcursor: copy;\n}\n",""]);const a=r},8403:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* START cover the case that slider is visible on mouseover */\n.monaco-editor .minimap.slider-mouseover .minimap-slider {\n\topacity: 0;\n\ttransition: opacity 100ms linear;\n}\n.monaco-editor .minimap.slider-mouseover:hover .minimap-slider {\n\topacity: 1;\n}\n.monaco-editor .minimap.slider-mouseover .minimap-slider.active {\n\topacity: 1;\n}\n/* END cover the case that slider is visible on mouseover */\n.monaco-editor .minimap-slider .minimap-slider-horizontal {\n\tbackground: var(--vscode-minimapSlider-background);\n}\n.monaco-editor .minimap-slider:hover .minimap-slider-horizontal {\n\tbackground: var(--vscode-minimapSlider-hoverBackground);\n}\n.monaco-editor .minimap-slider.active .minimap-slider-horizontal {\n\tbackground: var(--vscode-minimapSlider-activeBackground);\n}\n.monaco-editor .minimap-shadow-visible {\n\tbox-shadow: var(--vscode-scrollbar-shadow) -6px 0 6px -6px inset;\n}\n.monaco-editor .minimap-shadow-hidden {\n\tposition: absolute;\n\twidth: 0;\n}\n.monaco-editor .minimap-shadow-visible {\n\tposition: absolute;\n\tleft: -6px;\n\twidth: 6px;\n}\n.monaco-editor.no-minimap-shadow .minimap-shadow-visible {\n\tposition: absolute;\n\tleft: -1px;\n\twidth: 1px;\n}\n\n/* 0.5s fade in/out for the minimap */\n.minimap.autohide {\n\topacity: 0;\n\ttransition: opacity 0.5s;\n}\n.minimap.autohide:hover {\n\topacity: 1;\n}\n",""]);const a=r},8405:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .view-overlays .current-line {\n\tdisplay: block;\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\tbox-sizing: border-box;\n\theight: 100%;\n}\n\n.monaco-editor .margin-view-overlays .current-line {\n\tdisplay: block;\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\tbox-sizing: border-box;\n\theight: 100%;\n}\n\n.monaco-editor\n\t.margin-view-overlays\n\t.current-line.current-line-margin.current-line-margin-both {\n\tborder-right: 0;\n}\n",""]);const a=r},8439:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.quick-input-widget {\n\tposition: absolute;\n\twidth: 600px;\n\tz-index: 2550;\n\tleft: 50%;\n\tmargin-left: -300px;\n\t-webkit-app-region: no-drag;\n\tborder-radius: 6px;\n}\n\n.quick-input-titlebar {\n\tdisplay: flex;\n\talign-items: center;\n\tborder-top-left-radius: 5px; /* match border radius of quick input widget */\n\tborder-top-right-radius: 5px;\n}\n\n.quick-input-left-action-bar {\n\tdisplay: flex;\n\tmargin-left: 4px;\n\tflex: 1;\n}\n\n.quick-input-title {\n\tpadding: 3px 0px;\n\ttext-align: center;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n}\n\n.quick-input-right-action-bar {\n\tdisplay: flex;\n\tmargin-right: 4px;\n\tflex: 1;\n}\n\n.quick-input-right-action-bar > .actions-container {\n\tjustify-content: flex-end;\n}\n\n.quick-input-titlebar .monaco-action-bar .action-label.codicon {\n\tbackground-position: center;\n\tbackground-repeat: no-repeat;\n\tpadding: 2px;\n}\n\n.quick-input-description {\n\tmargin: 6px;\n}\n\n.quick-input-header .quick-input-description {\n\tmargin: 4px 2px;\n}\n\n.quick-input-header {\n\tdisplay: flex;\n\tpadding: 8px 6px 6px 6px;\n}\n\n.quick-input-widget.hidden-input .quick-input-header {\n\t/* reduce margins and paddings when input box hidden */\n\tpadding: 0;\n\tmargin-bottom: 0;\n}\n\n.quick-input-and-message {\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex-grow: 1;\n\tmin-width: 0;\n\tposition: relative;\n}\n\n.quick-input-check-all {\n\talign-self: center;\n\tmargin: 0;\n}\n\n.quick-input-filter {\n\tflex-grow: 1;\n\tdisplay: flex;\n\tposition: relative;\n}\n\n.quick-input-box {\n\tflex-grow: 1;\n}\n\n.quick-input-widget.show-checkboxes .quick-input-box,\n.quick-input-widget.show-checkboxes .quick-input-message {\n\tmargin-left: 5px;\n}\n\n.quick-input-visible-count {\n\tposition: absolute;\n\tleft: -10000px;\n}\n\n.quick-input-count {\n\talign-self: center;\n\tposition: absolute;\n\tright: 4px;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.quick-input-count .monaco-count-badge {\n\tvertical-align: middle;\n\tpadding: 2px 4px;\n\tborder-radius: 2px;\n\tmin-height: auto;\n\tline-height: normal;\n}\n\n.quick-input-action {\n\tmargin-left: 6px;\n}\n\n.quick-input-action .monaco-text-button {\n\tfont-size: 11px;\n\tpadding: 0 6px;\n\tdisplay: flex;\n\theight: 25px;\n\talign-items: center;\n}\n\n.quick-input-message {\n\tmargin-top: -1px;\n\tpadding: 5px;\n\toverflow-wrap: break-word;\n}\n\n.quick-input-message > .codicon {\n\tmargin: 0 0.2em;\n\tvertical-align: text-bottom;\n}\n\n.quick-input-progress.monaco-progress-container {\n\tposition: relative;\n}\n\n.quick-input-progress.monaco-progress-container,\n.quick-input-progress.monaco-progress-container .progress-bit {\n\theight: 2px;\n}\n\n.quick-input-list {\n\tline-height: 22px;\n}\n\n.quick-input-widget.hidden-input .quick-input-list {\n\tmargin-top: 4px; /* reduce margins when input box hidden */\n\tpadding-bottom: 4px;\n}\n\n.quick-input-list .monaco-list {\n\toverflow: hidden;\n\tmax-height: calc(20 * 22px);\n\tpadding-bottom: 5px;\n}\n\n.quick-input-list .monaco-scrollable-element {\n\tpadding: 0px 5px;\n}\n\n.quick-input-list .quick-input-list-entry {\n\tbox-sizing: border-box;\n\toverflow: hidden;\n\tdisplay: flex;\n\theight: 100%;\n\tpadding: 0 6px;\n}\n\n.quick-input-list .quick-input-list-entry.quick-input-list-separator-border {\n\tborder-top-width: 1px;\n\tborder-top-style: solid;\n}\n\n.quick-input-list .monaco-list-row {\n\tborder-radius: 3px;\n}\n\n.quick-input-list .monaco-list-row[data-index=\"0\"] .quick-input-list-entry.quick-input-list-separator-border {\n\tborder-top-style: none;\n}\n\n.quick-input-list .quick-input-list-label {\n\toverflow: hidden;\n\tdisplay: flex;\n\theight: 100%;\n\tflex: 1;\n}\n\n.quick-input-list .quick-input-list-checkbox {\n\talign-self: center;\n\tmargin: 0;\n}\n\n.quick-input-list .quick-input-list-rows {\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tdisplay: flex;\n\tflex-direction: column;\n\theight: 100%;\n\tflex: 1;\n\tmargin-left: 5px;\n}\n\n.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-rows {\n\tmargin-left: 10px;\n}\n\n.quick-input-widget .quick-input-list .quick-input-list-checkbox {\n\tdisplay: none;\n}\n.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-checkbox {\n\tdisplay: inline;\n}\n\n.quick-input-list .quick-input-list-rows > .quick-input-list-row {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.quick-input-list .quick-input-list-rows > .quick-input-list-row .monaco-icon-label,\n.quick-input-list .quick-input-list-rows > .quick-input-list-row .monaco-icon-label .monaco-icon-label-container > .monaco-icon-name-container {\n\tflex: 1; /* make sure the icon label grows within the row */\n}\n\n.quick-input-list .quick-input-list-rows > .quick-input-list-row .codicon[class*='codicon-'] {\n\tvertical-align: text-bottom;\n}\n\n.quick-input-list .quick-input-list-rows .monaco-highlighted-label > span {\n\topacity: 1;\n}\n\n.quick-input-list .quick-input-list-entry .quick-input-list-entry-keybinding {\n\tmargin-right: 8px; /* separate from the separator label or scrollbar if any */\n}\n\n.quick-input-list .quick-input-list-label-meta {\n\topacity: 0.7;\n\tline-height: normal;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n}\n\n.quick-input-list .monaco-highlighted-label .highlight {\n\tfont-weight: bold;\n}\n\n.quick-input-list .quick-input-list-entry .quick-input-list-separator {\n\tmargin-right: 4px; /* separate from keybindings or actions */\n}\n\n.quick-input-list .quick-input-list-entry-action-bar {\n\tdisplay: flex;\n\tflex: 0;\n\toverflow: visible;\n}\n\n.quick-input-list .quick-input-list-entry-action-bar .action-label {\n\t/*\n\t * By default, actions in the quick input action bar are hidden\n\t * until hovered over them or selected.\n\t */\n\tdisplay: none;\n}\n\n.quick-input-list .quick-input-list-entry-action-bar .action-label.codicon {\n\tmargin-right: 4px;\n\tpadding: 0px 2px 2px 2px;\n}\n\n.quick-input-list .quick-input-list-entry-action-bar {\n\tmargin-top: 1px;\n}\n\n.quick-input-list .quick-input-list-entry-action-bar {\n\tmargin-right: 4px; /* separate from scrollbar */\n}\n\n.quick-input-list .quick-input-list-entry .quick-input-list-entry-action-bar .action-label.always-visible,\n.quick-input-list .quick-input-list-entry:hover .quick-input-list-entry-action-bar .action-label,\n.quick-input-list .monaco-list-row.focused .quick-input-list-entry-action-bar .action-label {\n\tdisplay: flex;\n}\n\n/* focused items in quick pick */\n.quick-input-list .monaco-list-row.focused .monaco-keybinding-key,\n.quick-input-list .monaco-list-row.focused .quick-input-list-entry .quick-input-list-separator {\n\tcolor: inherit\n}\n.quick-input-list .monaco-list-row.focused .monaco-keybinding-key {\n\tbackground: none;\n}\n",""]);const a=r},8474:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/* ---------- Find input ---------- */\n\n.monaco-findInput {\n\tposition: relative;\n}\n\n.monaco-findInput .monaco-inputbox {\n\tfont-size: 13px;\n\twidth: 100%;\n}\n\n.monaco-findInput > .controls {\n\tposition: absolute;\n\ttop: 3px;\n\tright: 2px;\n}\n\n.vs .monaco-findInput.disabled {\n\tbackground-color: #E1E1E1;\n}\n\n/* Theming */\n.vs-dark .monaco-findInput.disabled {\n\tbackground-color: #333;\n}\n\n/* Highlighting */\n.monaco-findInput.highlight-0 .controls,\n.hc-light .monaco-findInput.highlight-0 .controls {\n\tanimation: monaco-findInput-highlight-0 100ms linear 0s;\n}\n\n.monaco-findInput.highlight-1 .controls,\n.hc-light .monaco-findInput.highlight-1 .controls {\n\tanimation: monaco-findInput-highlight-1 100ms linear 0s;\n}\n\n.hc-black .monaco-findInput.highlight-0 .controls,\n.vs-dark .monaco-findInput.highlight-0 .controls {\n\tanimation: monaco-findInput-highlight-dark-0 100ms linear 0s;\n}\n\n.hc-black .monaco-findInput.highlight-1 .controls,\n.vs-dark .monaco-findInput.highlight-1 .controls {\n\tanimation: monaco-findInput-highlight-dark-1 100ms linear 0s;\n}\n\n@keyframes monaco-findInput-highlight-0 {\n\t0% { background: rgba(253, 255, 0, 0.8); }\n\t100% { background: transparent; }\n}\n@keyframes monaco-findInput-highlight-1 {\n\t0% { background: rgba(253, 255, 0, 0.8); }\n\t/* Made intentionally different such that the CSS minifier does not collapse the two animations into a single one*/\n\t99% { background: transparent; }\n}\n\n@keyframes monaco-findInput-highlight-dark-0 {\n\t0% { background: rgba(255, 255, 255, 0.44); }\n\t100% { background: transparent; }\n}\n@keyframes monaco-findInput-highlight-dark-1 {\n\t0% { background: rgba(255, 255, 255, 0.44); }\n\t/* Made intentionally different such that the CSS minifier does not collapse the two animations into a single one*/\n\t99% { background: transparent; }\n}\n",""]);const a=r},8494:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n.monaco-editor .inlineSuggestionsHints {\n\tpadding: 4px;\n\n\t.warningMessage p {\n\t\tmargin: 0;\n\t}\n}\n\n.monaco-editor .inlineSuggestionsHints.withBorder {\n\tz-index: 39;\n\tcolor: var(--vscode-editorHoverWidget-foreground);\n\tbackground-color: var(--vscode-editorHoverWidget-background);\n\tborder: 1px solid var(--vscode-editorHoverWidget-border);\n}\n\n.monaco-editor .inlineSuggestionsHints a {\n\tcolor: var(--vscode-foreground) !important;\n}\n\n.monaco-editor .inlineSuggestionsHints a:hover {\n\tcolor: var(--vscode-foreground) !important;\n}\n\n.monaco-editor .inlineSuggestionsHints .keybinding {\n\tdisplay: flex;\n\tmargin-left: 4px;\n\topacity: 0.6;\n}\n\n.monaco-editor .inlineSuggestionsHints .keybinding .monaco-keybinding-key {\n\tfont-size: 8px;\n\tpadding: 2px 3px;\n}\n\n.monaco-editor .inlineSuggestionsHints .availableSuggestionCount a {\n\tdisplay: flex;\n\tmin-width: 19px;\n\tjustify-content: center;\n}\n\n.monaco-editor .inlineSuggestionStatusBarItemLabel {\n\tmargin-right: 2px;\n}\n",""]);const a=r},8677:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-diff-editor .diff-review-line-number {\n\ttext-align: right;\n\tdisplay: inline-block;\n\tcolor: var(--vscode-editorLineNumber-foreground);\n}\n\n.monaco-diff-editor .diff-review {\n\tposition: absolute;\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.monaco-diff-editor .diff-review-summary {\n\tpadding-left: 10px;\n}\n\n.monaco-diff-editor .diff-review-shadow {\n\tposition: absolute;\n\tbox-shadow: var(--vscode-scrollbar-shadow) 0 -6px 6px -6px inset;\n}\n\n.monaco-diff-editor .diff-review-row {\n\twhite-space: pre;\n}\n\n.monaco-diff-editor .diff-review-table {\n\tdisplay: table;\n\tmin-width: 100%;\n}\n\n.monaco-diff-editor .diff-review-row {\n\tdisplay: table-row;\n\twidth: 100%;\n}\n\n.monaco-diff-editor .diff-review-spacer {\n\tdisplay: inline-block;\n\twidth: 10px;\n\tvertical-align: middle;\n}\n\n.monaco-diff-editor .diff-review-spacer > .codicon {\n\tfont-size: 9px !important;\n}\n\n.monaco-diff-editor .diff-review-actions {\n\tdisplay: inline-block;\n\tposition: absolute;\n\tright: 10px;\n\ttop: 2px;\n}\n\n.monaco-diff-editor .diff-review-actions .action-label {\n\twidth: 16px;\n\theight: 16px;\n\tmargin: 2px 0;\n}\n",""]);const a=r},8694:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-hover {\n\tcursor: default;\n\tposition: absolute;\n\toverflow: hidden;\n\tuser-select: text;\n\t-webkit-user-select: text;\n\tbox-sizing: border-box;\n\tline-height: 1.5em;\n\twhite-space: var(--vscode-hover-whiteSpace, normal);\n}\n\n.monaco-hover.fade-in {\n\tanimation: fadein 100ms linear;\n}\n\n.monaco-hover.hidden {\n\tdisplay: none;\n}\n\n.monaco-hover a:hover:not(.disabled) {\n\tcursor: pointer;\n}\n\n.monaco-hover .hover-contents:not(.html-hover-contents) {\n\tpadding: 4px 8px;\n}\n\n.monaco-hover .markdown-hover > .hover-contents:not(.code-hover-contents) {\n\tmax-width: var(--vscode-hover-maxWidth, 500px);\n\tword-wrap: break-word;\n}\n\n.monaco-hover .markdown-hover > .hover-contents:not(.code-hover-contents) hr {\n\tmin-width: 100%;\n}\n\n.monaco-hover p,\n.monaco-hover .code,\n.monaco-hover ul,\n.monaco-hover h1,\n.monaco-hover h2,\n.monaco-hover h3,\n.monaco-hover h4,\n.monaco-hover h5,\n.monaco-hover h6 {\n\tmargin: 8px 0;\n}\n\n.monaco-hover h1,\n.monaco-hover h2,\n.monaco-hover h3,\n.monaco-hover h4,\n.monaco-hover h5,\n.monaco-hover h6 {\n\tline-height: 1.1;\n}\n\n.monaco-hover code {\n\tfont-family: var(--monaco-monospace-font);\n}\n\n.monaco-hover hr {\n\tbox-sizing: border-box;\n\tborder-left: 0px;\n\tborder-right: 0px;\n\tmargin-top: 4px;\n\tmargin-bottom: -4px;\n\tmargin-left: -8px;\n\tmargin-right: -8px;\n\theight: 1px;\n}\n\n.monaco-hover p:first-child,\n.monaco-hover .code:first-child,\n.monaco-hover ul:first-child {\n\tmargin-top: 0;\n}\n\n.monaco-hover p:last-child,\n.monaco-hover .code:last-child,\n.monaco-hover ul:last-child {\n\tmargin-bottom: 0;\n}\n\n/* MarkupContent Layout */\n.monaco-hover ul {\n\tpadding-left: 20px;\n}\n.monaco-hover ol {\n\tpadding-left: 20px;\n}\n\n.monaco-hover li > p {\n\tmargin-bottom: 0;\n}\n\n.monaco-hover li > ul {\n\tmargin-top: 0;\n}\n\n.monaco-hover code {\n\tborder-radius: 3px;\n\tpadding: 0 0.4em;\n}\n\n.monaco-hover .monaco-tokenized-source {\n\twhite-space: var(--vscode-hover-sourceWhiteSpace, pre-wrap);\n}\n\n.monaco-hover .hover-row.status-bar {\n\tfont-size: 12px;\n\tline-height: 22px;\n}\n\n.monaco-hover .hover-row.status-bar .info {\n\tfont-style: italic;\n\tpadding: 0px 8px;\n}\n\n.monaco-hover .hover-row.status-bar .actions {\n\tdisplay: flex;\n\tpadding: 0px 8px;\n\twidth: 100%;\n}\n\n.monaco-hover .hover-row.status-bar .actions .action-container {\n\tmargin-right: 16px;\n\tcursor: pointer;\n\toverflow: hidden;\n\ttext-wrap: nowrap;\n\ttext-overflow: ellipsis;\n}\n\n.monaco-hover .hover-row.status-bar .actions .action-container .action .icon {\n\tpadding-right: 4px;\n\tvertical-align: middle;\n}\n\n.monaco-hover .hover-row.status-bar .actions .action-container a {\n\tcolor: var(--vscode-textLink-foreground);\n\ttext-decoration: var(--text-link-decoration);\n}\n\n.monaco-hover .hover-row.status-bar .actions .action-container a .icon.codicon {\n\tcolor: var(--vscode-textLink-foreground);\n}\n\n.monaco-hover .markdown-hover .hover-contents .codicon {\n\tcolor: inherit;\n\tfont-size: inherit;\n\tvertical-align: middle;\n}\n\n.monaco-hover .hover-contents a.code-link:hover,\n.monaco-hover .hover-contents a.code-link {\n\tcolor: inherit;\n}\n\n.monaco-hover .hover-contents a.code-link:before {\n\tcontent: '(';\n}\n\n.monaco-hover .hover-contents a.code-link:after {\n\tcontent: ')';\n}\n\n.monaco-hover .hover-contents a.code-link > span {\n\ttext-decoration: underline;\n\t/** Hack to force underline to show **/\n\tborder-bottom: 1px solid transparent;\n\ttext-underline-position: under;\n\tcolor: var(--vscode-textLink-foreground);\n}\n\n.monaco-hover .hover-contents a.code-link > span:hover {\n\tcolor: var(--vscode-textLink-activeForeground);\n}\n\n/**\n * Spans in markdown hovers need a margin-bottom to avoid looking cramped:\n * https://github.com/microsoft/vscode/issues/101496\n\n * This was later refined to only apply when the last child of a rendered markdown block (before the\n * border or a `hr`) uses background color:\n * https://github.com/microsoft/vscode/issues/228136\n */\n.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) p:last-child [style*=\"background-color\"] {\n\tmargin-bottom: 4px;\n\tdisplay: inline-block;\n}\n\n/**\n * Add a slight margin to try vertically align codicons with any text\n * https://github.com/microsoft/vscode/issues/221359\n */\n.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) span.codicon {\n\tmargin-bottom: 2px;\n}\n\n.monaco-hover-content .action-container a {\n\t-webkit-user-select: none;\n\tuser-select: none;\n}\n\n.monaco-hover-content .action-container.disabled {\n\tpointer-events: none;\n\topacity: 0.4;\n\tcursor: default;\n}\n\n/* Prevent text selection in all button-like elements within hovers */\n.monaco-hover .action-container,\n.monaco-hover .action,\n.monaco-hover button,\n.monaco-hover .monaco-button,\n.monaco-hover .monaco-text-button,\n.monaco-hover [role=\"button\"] {\n\t-webkit-user-select: none;\n\tuser-select: none;\n}\n",""]);const a=r},8731:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .margin {\n\tbackground-color: var(--vscode-editorGutter-background);\n}\n",""]);const a=r},8829:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/*\n\tKeeping name short for faster parsing.\n\tcslr = core selections layer rendering (div)\n*/\n.monaco-editor .lines-content .cslr {\n\tposition: absolute;\n}\n\n.monaco-editor .focused .selected-text {\n\tbackground-color: var(--vscode-editor-selectionBackground);\n}\n\n.monaco-editor .selected-text {\n\tbackground-color: var(--vscode-editor-inactiveSelectionBackground);\n}\n\n.monaco-editor\t\t\t.top-left-radius\t\t{ border-top-left-radius: 3px; }\n.monaco-editor\t\t\t.bottom-left-radius\t\t{ border-bottom-left-radius: 3px; }\n.monaco-editor\t\t\t.top-right-radius\t\t{ border-top-right-radius: 3px; }\n.monaco-editor\t\t\t.bottom-right-radius\t{ border-bottom-right-radius: 3px; }\n\n.monaco-editor.hc-black .top-left-radius\t\t{ border-top-left-radius: 0; }\n.monaco-editor.hc-black .bottom-left-radius\t\t{ border-bottom-left-radius: 0; }\n.monaco-editor.hc-black .top-right-radius\t\t{ border-top-right-radius: 0; }\n.monaco-editor.hc-black .bottom-right-radius\t{ border-bottom-right-radius: 0; }\n\n.monaco-editor.hc-light .top-left-radius\t\t{ border-top-left-radius: 0; }\n.monaco-editor.hc-light .bottom-left-radius\t\t{ border-bottom-left-radius: 0; }\n.monaco-editor.hc-light .top-right-radius\t\t{ border-top-right-radius: 0; }\n.monaco-editor.hc-light .bottom-right-radius\t{ border-bottom-right-radius: 0; }\n",""]);const a=r},8874:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor {\n\t.editorPlaceholder {\n\t\ttop: 0px;\n\t\tposition: absolute;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\ttext-wrap: nowrap;\n\t\tpointer-events: none;\n\n\t\tcolor: var(--vscode-editor-placeholder-foreground);\n\t}\n}\n",""]);const a=r},8880:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-text-button {\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\twidth: 100%;\n\tpadding: 4px;\n\tborder-radius: 2px;\n\ttext-align: center;\n\tcursor: pointer;\n\tjustify-content: center;\n\talign-items: center;\n\tborder: 1px solid var(--vscode-button-border, transparent);\n\tline-height: 18px;\n}\n\n.monaco-text-button:focus {\n\toutline-offset: 2px !important;\n}\n\n.monaco-text-button:hover {\n\ttext-decoration: none !important;\n}\n\n.monaco-button.disabled:focus,\n.monaco-button.disabled {\n\topacity: 0.4 !important;\n\tcursor: default;\n}\n\n.monaco-text-button .codicon {\n\tmargin: 0 0.2em;\n\tcolor: inherit !important;\n}\n\n.monaco-text-button.monaco-text-button-with-short-label {\n\tflex-direction: row;\n\tflex-wrap: wrap;\n\tpadding: 0 4px;\n\toverflow: hidden;\n\theight: 28px;\n}\n\n.monaco-text-button.monaco-text-button-with-short-label > .monaco-button-label {\n\tflex-basis: 100%;\n}\n\n.monaco-text-button.monaco-text-button-with-short-label > .monaco-button-label-short {\n\tflex-grow: 1;\n\twidth: 0;\n\toverflow: hidden;\n}\n\n.monaco-text-button.monaco-text-button-with-short-label > .monaco-button-label,\n.monaco-text-button.monaco-text-button-with-short-label > .monaco-button-label-short {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tfont-weight: normal;\n\tfont-style: inherit;\n\tpadding: 4px 0;\n}\n\n.monaco-button-dropdown {\n\tdisplay: flex;\n\tcursor: pointer;\n}\n\n.monaco-button-dropdown.disabled {\n\tcursor: default;\n}\n\n.monaco-button-dropdown > .monaco-button:focus {\n\toutline-offset: -1px !important;\n}\n\n.monaco-button-dropdown.disabled > .monaco-button.disabled,\n.monaco-button-dropdown.disabled > .monaco-button.disabled:focus,\n.monaco-button-dropdown.disabled > .monaco-button-dropdown-separator {\n\topacity: 0.4 !important;\n}\n\n.monaco-button-dropdown > .monaco-button.monaco-text-button {\n\tborder-right-width: 0 !important;\n}\n\n.monaco-button-dropdown .monaco-button-dropdown-separator {\n\tpadding: 4px 0;\n\tcursor: default;\n}\n\n.monaco-button-dropdown .monaco-button-dropdown-separator > div {\n\theight: 100%;\n\twidth: 1px;\n}\n\n.monaco-button-dropdown > .monaco-button.monaco-dropdown-button {\n\tborder: 1px solid var(--vscode-button-border, transparent);\n\tborder-left-width: 0 !important;\n\tborder-radius: 0 2px 2px 0;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-button-dropdown > .monaco-button.monaco-text-button {\n\tborder-radius: 2px 0 0 2px;\n}\n\n.monaco-description-button {\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tmargin: 4px 5px; /* allows button focus outline to be visible */\n}\n\n.monaco-description-button .monaco-button-description {\n\tfont-style: italic;\n\tfont-size: 11px;\n\tpadding: 4px 20px;\n}\n\n.monaco-description-button .monaco-button-label,\n.monaco-description-button .monaco-button-description {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n}\n\n.monaco-description-button .monaco-button-label > .codicon,\n.monaco-description-button .monaco-button-description > .codicon {\n\tmargin: 0 0.2em;\n\tcolor: inherit !important;\n}\n\n/* default color styles - based on CSS variables */\n\n.monaco-button.default-colors,\n.monaco-button-dropdown.default-colors > .monaco-button{\n\tcolor: var(--vscode-button-foreground);\n\tbackground-color: var(--vscode-button-background);\n}\n\n.monaco-button.default-colors:hover,\n.monaco-button-dropdown.default-colors > .monaco-button:hover {\n\tbackground-color: var(--vscode-button-hoverBackground);\n}\n\n.monaco-button.default-colors.secondary,\n.monaco-button-dropdown.default-colors > .monaco-button.secondary {\n\tcolor: var(--vscode-button-secondaryForeground);\n\tbackground-color: var(--vscode-button-secondaryBackground);\n}\n\n.monaco-button.default-colors.secondary:hover,\n.monaco-button-dropdown.default-colors > .monaco-button.secondary:hover {\n\tbackground-color: var(--vscode-button-secondaryHoverBackground);\n}\n\n.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator {\n\tbackground-color: var(--vscode-button-background);\n\tborder-top: 1px solid var(--vscode-button-border);\n\tborder-bottom: 1px solid var(--vscode-button-border);\n}\n\n.monaco-button-dropdown.default-colors .monaco-button.secondary + .monaco-button-dropdown-separator {\n\tbackground-color: var(--vscode-button-secondaryBackground);\n}\n\n.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator > div {\n\tbackground-color: var(--vscode-button-separator);\n}\n",""]);const a=r},8968:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII="},8970:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.context-view {\n\tposition: absolute;\n}\n\n.context-view.fixed {\n\tall: initial;\n\tfont-family: inherit;\n\tfont-size: 13px;\n\tposition: fixed;\n\tcolor: inherit;\n}\n",""]);const a=r},9055:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-action-bar .action-item.menu-entry .action-label.icon {\n\twidth: 16px;\n\theight: 16px;\n\tbackground-repeat: no-repeat;\n\tbackground-position: 50%;\n\tbackground-size: 16px;\n}\n\n.monaco-action-bar .action-item.menu-entry.text-only .action-label {\n\tcolor: var(--vscode-descriptionForeground);\n\toverflow: hidden;\n\tborder-radius: 2px;\n}\n\n.monaco-action-bar .action-item.menu-entry.text-only.use-comma:not(:last-of-type) .action-label::after {\n\tcontent: ', ';\n}\n\n.monaco-action-bar .action-item.menu-entry.text-only + .action-item:not(.text-only) > .monaco-dropdown .action-label {\n\tcolor: var(--vscode-descriptionForeground);\n}\n\n.monaco-dropdown-with-default {\n\tdisplay: flex !important;\n\tflex-direction: row;\n\tborder-radius: 5px;\n}\n\n.monaco-dropdown-with-default > .action-container > .action-label {\n\tmargin-right: 0;\n}\n\n.monaco-dropdown-with-default > .action-container.menu-entry > .action-label.icon {\n\twidth: 16px;\n\theight: 16px;\n\tbackground-repeat: no-repeat;\n\tbackground-position: 50%;\n\tbackground-size: 16px;\n}\n\n.monaco-dropdown-with-default:hover {\n\tbackground-color: var(--vscode-toolbar-hoverBackground);\n}\n\n.monaco-dropdown-with-default > .dropdown-action-container > .monaco-dropdown > .dropdown-label .codicon[class*='codicon-'] {\n\tfont-size: 12px;\n\tpadding-left: 0px;\n\tpadding-right: 0px;\n\tline-height: 16px;\n\tmargin-left: -3px;\n}\n\n.monaco-dropdown-with-default > .dropdown-action-container > .monaco-dropdown > .dropdown-label > .action-label {\n\tdisplay: block;\n\tbackground-size: 16px;\n\tbackground-position: center center;\n\tbackground-repeat: no-repeat;\n}\n",""]);const a=r},9133:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .scroll-decoration {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\theight: 6px;\n\tbox-shadow: var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset;\n}\n",""]);const a=r},9206:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-custom-toggle {\n\tmargin-left: 2px;\n\tfloat: left;\n\tcursor: pointer;\n\toverflow: hidden;\n\twidth: 20px;\n\theight: 20px;\n\tborder-radius: 3px;\n\tborder: 1px solid transparent;\n\tpadding: 1px;\n\tbox-sizing:\tborder-box;\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.monaco-custom-toggle:hover {\n\tbackground-color: var(--vscode-inputOption-hoverBackground);\n}\n\n.hc-black .monaco-custom-toggle:hover,\n.hc-light .monaco-custom-toggle:hover {\n\tborder: 1px dashed var(--vscode-focusBorder);\n}\n\n.hc-black .monaco-custom-toggle,\n.hc-light .monaco-custom-toggle {\n\tbackground: none;\n}\n\n.hc-black .monaco-custom-toggle:hover,\n.hc-light .monaco-custom-toggle:hover {\n\tbackground: none;\n}\n\n.monaco-custom-toggle.monaco-checkbox {\n\theight: 18px;\n\twidth: 18px;\n\tborder: 1px solid transparent;\n\tborder-radius: 3px;\n\tmargin-right: 9px;\n\tmargin-left: 0px;\n\tpadding: 0px;\n\topacity: 1;\n\tbackground-size: 16px !important;\n}\n\n/* hide check when unchecked */\n.monaco-custom-toggle.monaco-checkbox:not(.checked)::before {\n\tvisibility: hidden;\n}\n",""]);const a=r},9337:(e,t,i)=>{i.d(t,{A:()=>p});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s),a=i(4417),l=i.n(a),d=new URL(i(7584),i.b),h=new URL(i(6060),i.b),c=r()(o()),u=l()(d),g=l()(h);c.push([e.id,`/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .iPadShowKeyboard {\n\twidth: 58px;\n\tmin-width: 0;\n\theight: 36px;\n\tmin-height: 0;\n\tmargin: 0;\n\tpadding: 0;\n\tposition: absolute;\n\tresize: none;\n\toverflow: hidden;\n\tbackground: url(${u}) center center no-repeat;\n\tborder: 4px solid #F6F6F6;\n\tborder-radius: 4px;\n}\n\n.monaco-editor.vs-dark .iPadShowKeyboard {\n\tbackground: url(${g}) center center no-repeat;\n\tborder: 4px solid #252526;\n}`,""]);const p=c},9507:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/*\n\tKeeping name short for faster parsing.\n\tcslr = core selections layer rendering (div)\n*/\n.monaco-editor .lines-content .cslr {\n\tposition: absolute;\n}\n\n.monaco-editor .focused .selected-text {\n\tbackground-color: var(--vscode-editor-selectionBackground);\n}\n\n.monaco-editor .selected-text {\n\tbackground-color: var(--vscode-editor-inactiveSelectionBackground);\n}\n\n.monaco-editor\t\t\t.top-left-radius\t\t{ border-top-left-radius: 3px; }\n.monaco-editor\t\t\t.bottom-left-radius\t\t{ border-bottom-left-radius: 3px; }\n.monaco-editor\t\t\t.top-right-radius\t\t{ border-top-right-radius: 3px; }\n.monaco-editor\t\t\t.bottom-right-radius\t{ border-bottom-right-radius: 3px; }\n\n.monaco-editor.hc-black .top-left-radius\t\t{ border-top-left-radius: 0; }\n.monaco-editor.hc-black .bottom-left-radius\t\t{ border-bottom-left-radius: 0; }\n.monaco-editor.hc-black .top-right-radius\t\t{ border-top-right-radius: 0; }\n.monaco-editor.hc-black .bottom-right-radius\t{ border-bottom-right-radius: 0; }\n\n.monaco-editor.hc-light .top-left-radius\t\t{ border-top-left-radius: 0; }\n.monaco-editor.hc-light .bottom-left-radius\t\t{ border-bottom-left-radius: 0; }\n.monaco-editor.hc-light .top-right-radius\t\t{ border-top-right-radius: 0; }\n.monaco-editor.hc-light .bottom-right-radius\t{ border-bottom-right-radius: 0; }\n",""]);const a=r},9575:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n.monaco-editor .cursors-layer {\n\tposition: absolute;\n\ttop: 0;\n}\n\n.monaco-editor .cursors-layer > .cursor {\n\tposition: absolute;\n\toverflow: hidden;\n\tbox-sizing: border-box;\n}\n\n/* -- smooth-caret-animation -- */\n.monaco-editor .cursors-layer.cursor-smooth-caret-animation > .cursor {\n\ttransition: all 80ms;\n}\n\n/* -- block-outline-style -- */\n.monaco-editor .cursors-layer.cursor-block-outline-style > .cursor {\n\tbackground: transparent !important;\n\tborder-style: solid;\n\tborder-width: 1px;\n}\n\n/* -- underline-style -- */\n.monaco-editor .cursors-layer.cursor-underline-style > .cursor {\n\tborder-bottom-width: 2px;\n\tborder-bottom-style: solid;\n\tbackground: transparent !important;\n}\n\n/* -- underline-thin-style -- */\n.monaco-editor .cursors-layer.cursor-underline-thin-style > .cursor {\n\tborder-bottom-width: 1px;\n\tborder-bottom-style: solid;\n\tbackground: transparent !important;\n}\n\n@keyframes monaco-cursor-smooth {\n\t0%,\n\t20% {\n\t\topacity: 1;\n\t}\n\t60%,\n\t100% {\n\t\topacity: 0;\n\t}\n}\n\n@keyframes monaco-cursor-phase {\n\t0%,\n\t20% {\n\t\topacity: 1;\n\t}\n\t90%,\n\t100% {\n\t\topacity: 0;\n\t}\n}\n\n@keyframes monaco-cursor-expand {\n\t0%,\n\t20% {\n\t\ttransform: scaleY(1);\n\t}\n\t80%,\n\t100% {\n\t\ttransform: scaleY(0);\n\t}\n}\n\n.cursor-smooth {\n\tanimation: monaco-cursor-smooth 0.5s ease-in-out 0s 20 alternate;\n}\n\n.cursor-phase {\n\tanimation: monaco-cursor-phase 0.5s ease-in-out 0s 20 alternate;\n}\n\n.cursor-expand > .cursor {\n\tanimation: monaco-cursor-expand 0.5s ease-in-out 0s 20 alternate;\n}\n",""]);const a=r},9734:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .peekview-widget .head {\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\tjustify-content: space-between;\n\tflex-wrap: nowrap;\n}\n\n.monaco-editor .peekview-widget .head .peekview-title {\n\tdisplay: flex;\n\talign-items: baseline;\n\tfont-size: 13px;\n\tmargin-left: 20px;\n\tmin-width: 0;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n}\n\n.monaco-editor .peekview-widget .head .peekview-title.clickable {\n\tcursor: pointer;\n}\n\n.monaco-editor .peekview-widget .head .peekview-title .dirname:not(:empty) {\n\tfont-size: 0.9em;\n\tmargin-left: 0.5em;\n}\n\n.monaco-editor .peekview-widget .head .peekview-title .meta {\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.monaco-editor .peekview-widget .head .peekview-title .dirname {\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.monaco-editor .peekview-widget .head .peekview-title .filename {\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.monaco-editor .peekview-widget .head .peekview-title .meta:not(:empty)::before {\n\tcontent: '-';\n\tpadding: 0 0.3em;\n}\n\n.monaco-editor .peekview-widget .head .peekview-actions {\n\tflex: 1;\n\ttext-align: right;\n\tpadding-right: 2px;\n}\n\n.monaco-editor .peekview-widget .head .peekview-actions > .monaco-action-bar {\n\tdisplay: inline-block;\n}\n\n.monaco-editor .peekview-widget .head .peekview-actions > .monaco-action-bar,\n.monaco-editor .peekview-widget .head .peekview-actions > .monaco-action-bar > .actions-container {\n\theight: 100%;\n}\n\n.monaco-editor .peekview-widget > .body {\n\tborder-top: 1px solid;\n\tposition: relative;\n}\n\n.monaco-editor .peekview-widget .head .peekview-title .codicon {\n\tmargin-right: 4px;\n\talign-self: center;\n}\n\n.monaco-editor .peekview-widget .monaco-list .monaco-list-row.focused .codicon {\n\tcolor: inherit !important;\n}\n",""]);const a=r},9803:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .focused .selectionHighlight {\n\tbackground-color: var(--vscode-editor-selectionHighlightBackground);\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-editor-selectionHighlightBorder);\n}\n.monaco-editor.hc-black .focused .selectionHighlight, .monaco-editor.hc-light .focused .selectionHighlight {\n\tborder-style: dotted;\n}\n\n.monaco-editor .wordHighlight {\n\tbackground-color: var(--vscode-editor-wordHighlightBackground);\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-editor-wordHighlightBorder);\n}\n.monaco-editor.hc-black .wordHighlight, .monaco-editor.hc-light .wordHighlight {\n\tborder-style: dotted;\n}\n\n.monaco-editor .wordHighlightStrong {\n\tbackground-color: var(--vscode-editor-wordHighlightStrongBackground);\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-editor-wordHighlightStrongBorder);\n}\n.monaco-editor.hc-black .wordHighlightStrong, .monaco-editor.hc-light .wordHighlightStrong {\n\tborder-style: dotted;\n}\n\n.monaco-editor .wordHighlightText {\n\tbackground-color: var(--vscode-editor-wordHighlightTextBackground);\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-editor-wordHighlightTextBorder);\n}\n.monaco-editor.hc-black .wordHighlightText, .monaco-editor.hc-light .wordHighlightText {\n\tborder-style: dotted;\n}\n",""]);const a=r},9862:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-dropdown {\n\theight: 100%;\n\tpadding: 0;\n}\n\n.monaco-dropdown > .dropdown-label {\n\tcursor: pointer;\n\theight: 100%;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.monaco-dropdown > .dropdown-label > .action-label.disabled {\n\tcursor: default;\n}\n\n.monaco-dropdown-with-primary {\n\tdisplay: flex !important;\n\tflex-direction: row;\n\tborder-radius: 5px;\n}\n\n.monaco-dropdown-with-primary > .action-container > .action-label {\n\tmargin-right: 0;\n}\n\n.monaco-dropdown-with-primary > .dropdown-action-container > .monaco-dropdown > .dropdown-label .codicon[class*='codicon-'] {\n\tfont-size: 12px;\n\tpadding-left: 0px;\n\tpadding-right: 0px;\n\tline-height: 16px;\n\tmargin-left: -3px;\n}\n\n.monaco-dropdown-with-primary > .dropdown-action-container > .monaco-dropdown > .dropdown-label > .action-label {\n\tdisplay: block;\n\tbackground-size: 16px;\n\tbackground-position: center center;\n\tbackground-repeat: no-repeat;\n}\n",""]);const a=r},9926:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.post-edit-widget {\n\tbox-shadow: 0 0 8px 2px var(--vscode-widget-shadow);\n\tborder: 1px solid var(--vscode-widget-border, transparent);\n\tborder-radius: 4px;\n\tcolor: var(--vscode-button-foreground);\n\tbackground-color: var(--vscode-button-background);\n\toverflow: hidden;\n}\n\n.post-edit-widget .monaco-button {\n\tpadding: 2px;\n\tborder: none;\n\tborder-radius: 0;\n}\n\n.post-edit-widget .monaco-button:hover {\n\tbackground-color: var(--vscode-button-hoverBackground) !important;\n}\n\n.post-edit-widget .monaco-button .codicon {\n\tmargin: 0;\n}\n",""]);const a=r},9959:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(1601),o=i.n(n),s=i(6314),r=i.n(s)()(o());r.push([e.id,"/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-editor .glyph-margin {\n\tposition: absolute;\n\ttop: 0;\n}\n\n/*\n\tKeeping name short for faster parsing.\n\tcgmr = core glyph margin rendering (div)\n*/\n.monaco-editor .margin-view-overlays .cgmr {\n\tposition: absolute;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n",""]);const a=r}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={id:n,exports:{}};return e[n](s,s.exports,i),s.exports}i.m=e,i.amdO={},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),i.b="undefined"!=typeof document&&document.baseURI||self.location.href,i.nc=void 0;var n={};i.r(n),i.d(n,{PixelRatio:()=>fxe,addMatchMediaChangeListener:()=>mxe,getZoomFactor:()=>_xe,isAndroid:()=>kxe,isChrome:()=>Cxe,isElectron:()=>xxe,isFirefox:()=>bxe,isSafari:()=>yxe,isStandalone:()=>Dxe,isWebKit:()=>wxe,isWebkitWebView:()=>Sxe});var o={};i.r(o),i.d(o,{conf:()=>b7e,language:()=>w7e});var s={};i.r(s),i.d(s,{conf:()=>C7e,language:()=>y7e});const r=window;class a{constructor(){this.mapWindowIdToZoomFactor=new Map}static{this.INSTANCE=new a}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}getWindowId(e){return e.vscodeWindowId}}function l(e,t,i){"string"==typeof t&&(t=e.matchMedia(t)),t.addEventListener("change",i)}function d(e){return a.INSTANCE.getZoomFactor(e)}const h=navigator.userAgent,c=h.indexOf("Firefox")>=0,u=h.indexOf("AppleWebKit")>=0,g=h.indexOf("Chrome")>=0,p=!g&&h.indexOf("Safari")>=0,m=!g&&!p&&u,f=(h.indexOf("Electron/"),h.indexOf("Android")>=0);let _=!1;if("function"==typeof r.matchMedia){const e=r.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=r.matchMedia("(display-mode: fullscreen)");_=e.matches,l(r,e,(({matches:e})=>{_&&t.matches||(_=e)}))}function v(){return globalThis._VSCODE_NLS_MESSAGES}function b(){return globalThis._VSCODE_NLS_LANGUAGE}const w="pseudo"===b()||"undefined"!=typeof document&&document.location&&"string"==typeof document.location.hash&&document.location.hash.indexOf("pseudo=true")>=0;function C(e,t){let i;return i=0===t.length?e:e.replace(/\{(\d+)\}/g,((e,i)=>{const n=i[0],o=t[n];let s=e;return"string"==typeof o?s=o:"number"!=typeof o&&"boolean"!=typeof o&&null!=o||(s=String(o)),s})),w&&(i="["+i.replace(/[aouei]/g,"$&$&")+"]"),i}function y(e,t,...i){return C("number"==typeof e?S(e,t):t,i)}function S(e,t){const i=v()?.[e];if("string"!=typeof i){if("string"==typeof t)return t;throw new Error(`!!! NLS MISSING: ${e} !!!`)}return i}function x(e,t,...i){let n;n="number"==typeof e?S(e,t):t;const o=C(n,i);return{value:o,original:t===n?o:C(t,i)}}const k="en";let L,D,E=!1,N=!1,I=!1,T=!1,M=!1,A=!1,R=!1,O=!1,P=!1,F=!1,B=k,W=null,V=null;const H=globalThis;let z;void 0!==H.vscode&&void 0!==H.vscode.process?z=H.vscode.process:"undefined"!=typeof process&&"string"==typeof process?.versions?.node&&(z=process);const U="string"==typeof z?.versions?.electron,K=U&&"renderer"===z?.type;if("object"==typeof z){E="win32"===z.platform,N="darwin"===z.platform,I="linux"===z.platform,T=I&&!!z.env.SNAP&&!!z.env.SNAP_REVISION,R=U,P=!!z.env.CI||!!z.env.BUILD_ARTIFACTSTAGINGDIRECTORY||!!z.env.GITHUB_WORKSPACE,L=k,B=k;const e=z.env.VSCODE_NLS_CONFIG;if(e)try{const t=JSON.parse(e);L=t.userLocale,W=t.osLocale,B=t.resolvedLanguage||k,V=t.languagePack?.translationsConfigFile}catch(e){}M=!0}else"object"!=typeof navigator||K?console.error("Unable to resolve platform."):(D=navigator.userAgent,E=D.indexOf("Windows")>=0,N=D.indexOf("Macintosh")>=0,O=(D.indexOf("Macintosh")>=0||D.indexOf("iPad")>=0||D.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,I=D.indexOf("Linux")>=0,F=D?.indexOf("Mobi")>=0,A=!0,B=b()||k,L=navigator.language.toLowerCase(),W=L);let j=0;N?j=1:E?j=3:I&&(j=2);const q=E,$=N,G=I,Z=M,Y=A,Q=A&&"function"==typeof H.importScripts?H.origin:void 0,X=O,J=F,ee=j,te=D,ie=B,ne="function"==typeof H.postMessage&&!H.importScripts,oe=(()=>{if(ne){const e=[];H.addEventListener("message",(t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,n=e.length;i<n;i++){const n=e[i];if(n.id===t.data.vscodeScheduleAsyncWork)return e.splice(i,1),void n.callback()}}));let t=0;return i=>{const n=++t;e.push({id:n,callback:i}),H.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})(),se=N||O?2:E?1:3;let re=!0,ae=!1;function le(){if(!ae){ae=!0;const e=new Uint8Array(2);e[0]=1,e[1]=2;const t=new Uint16Array(e.buffer);re=513===t[0]}return re}const de=!!(te&&te.indexOf("Chrome")>=0),he=!!(te&&te.indexOf("Firefox")>=0),ce=!!(!de&&te&&te.indexOf("Safari")>=0),ue=!!(te&&te.indexOf("Edg/")>=0),ge=!!(te&&te.indexOf("Android")>=0),pe=(Z||document.queryCommandSupported&&document.queryCommandSupported("copy")||navigator&&navigator.clipboard&&navigator.clipboard.writeText,Z||navigator&&navigator.clipboard&&navigator.clipboard.readText,Z||_||navigator.keyboard,"ontouchstart"in r||navigator.maxTouchPoints,r.PointerEvent&&("ontouchstart"in r||navigator.maxTouchPoints>0));class me{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const fe=new me,_e=new me,ve=new me,be=new Array(230),we={},Ce=[],ye=Object.create(null),Se=Object.create(null),xe=[],ke=[];for(let e=0;e<=193;e++)xe[e]=-1;for(let e=0;e<=132;e++)ke[e]=-1;var Le;function De(e,t){return(e|(65535&t)<<16>>>0)>>>0}!function(){const e="",t=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN",e,e],[1,1,"Hyper",0,e,0,e,e,e],[1,2,"Super",0,e,0,e,e,e],[1,3,"Fn",0,e,0,e,e,e],[1,4,"FnLock",0,e,0,e,e,e],[1,5,"Suspend",0,e,0,e,e,e],[1,6,"Resume",0,e,0,e,e,e],[1,7,"Turbo",0,e,0,e,e,e],[1,8,"Sleep",0,e,0,"VK_SLEEP",e,e],[1,9,"WakeUp",0,e,0,e,e,e],[0,10,"KeyA",31,"A",65,"VK_A",e,e],[0,11,"KeyB",32,"B",66,"VK_B",e,e],[0,12,"KeyC",33,"C",67,"VK_C",e,e],[0,13,"KeyD",34,"D",68,"VK_D",e,e],[0,14,"KeyE",35,"E",69,"VK_E",e,e],[0,15,"KeyF",36,"F",70,"VK_F",e,e],[0,16,"KeyG",37,"G",71,"VK_G",e,e],[0,17,"KeyH",38,"H",72,"VK_H",e,e],[0,18,"KeyI",39,"I",73,"VK_I",e,e],[0,19,"KeyJ",40,"J",74,"VK_J",e,e],[0,20,"KeyK",41,"K",75,"VK_K",e,e],[0,21,"KeyL",42,"L",76,"VK_L",e,e],[0,22,"KeyM",43,"M",77,"VK_M",e,e],[0,23,"KeyN",44,"N",78,"VK_N",e,e],[0,24,"KeyO",45,"O",79,"VK_O",e,e],[0,25,"KeyP",46,"P",80,"VK_P",e,e],[0,26,"KeyQ",47,"Q",81,"VK_Q",e,e],[0,27,"KeyR",48,"R",82,"VK_R",e,e],[0,28,"KeyS",49,"S",83,"VK_S",e,e],[0,29,"KeyT",50,"T",84,"VK_T",e,e],[0,30,"KeyU",51,"U",85,"VK_U",e,e],[0,31,"KeyV",52,"V",86,"VK_V",e,e],[0,32,"KeyW",53,"W",87,"VK_W",e,e],[0,33,"KeyX",54,"X",88,"VK_X",e,e],[0,34,"KeyY",55,"Y",89,"VK_Y",e,e],[0,35,"KeyZ",56,"Z",90,"VK_Z",e,e],[0,36,"Digit1",22,"1",49,"VK_1",e,e],[0,37,"Digit2",23,"2",50,"VK_2",e,e],[0,38,"Digit3",24,"3",51,"VK_3",e,e],[0,39,"Digit4",25,"4",52,"VK_4",e,e],[0,40,"Digit5",26,"5",53,"VK_5",e,e],[0,41,"Digit6",27,"6",54,"VK_6",e,e],[0,42,"Digit7",28,"7",55,"VK_7",e,e],[0,43,"Digit8",29,"8",56,"VK_8",e,e],[0,44,"Digit9",30,"9",57,"VK_9",e,e],[0,45,"Digit0",21,"0",48,"VK_0",e,e],[1,46,"Enter",3,"Enter",13,"VK_RETURN",e,e],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE",e,e],[1,48,"Backspace",1,"Backspace",8,"VK_BACK",e,e],[1,49,"Tab",2,"Tab",9,"VK_TAB",e,e],[1,50,"Space",10,"Space",32,"VK_SPACE",e,e],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,e,0,e,e,e],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL",e,e],[1,64,"F1",59,"F1",112,"VK_F1",e,e],[1,65,"F2",60,"F2",113,"VK_F2",e,e],[1,66,"F3",61,"F3",114,"VK_F3",e,e],[1,67,"F4",62,"F4",115,"VK_F4",e,e],[1,68,"F5",63,"F5",116,"VK_F5",e,e],[1,69,"F6",64,"F6",117,"VK_F6",e,e],[1,70,"F7",65,"F7",118,"VK_F7",e,e],[1,71,"F8",66,"F8",119,"VK_F8",e,e],[1,72,"F9",67,"F9",120,"VK_F9",e,e],[1,73,"F10",68,"F10",121,"VK_F10",e,e],[1,74,"F11",69,"F11",122,"VK_F11",e,e],[1,75,"F12",70,"F12",123,"VK_F12",e,e],[1,76,"PrintScreen",0,e,0,e,e,e],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL",e,e],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",e,e],[1,79,"Insert",19,"Insert",45,"VK_INSERT",e,e],[1,80,"Home",14,"Home",36,"VK_HOME",e,e],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",e,e],[1,82,"Delete",20,"Delete",46,"VK_DELETE",e,e],[1,83,"End",13,"End",35,"VK_END",e,e],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT",e,e],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",e],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",e],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",e],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",e],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK",e,e],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE",e,e],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY",e,e],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT",e,e],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD",e,e],[1,94,"NumpadEnter",3,e,0,e,e,e],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1",e,e],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2",e,e],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3",e,e],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4",e,e],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5",e,e],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6",e,e],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7",e,e],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8",e,e],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9",e,e],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0",e,e],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL",e,e],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102",e,e],[1,107,"ContextMenu",58,"ContextMenu",93,e,e,e],[1,108,"Power",0,e,0,e,e,e],[1,109,"NumpadEqual",0,e,0,e,e,e],[1,110,"F13",71,"F13",124,"VK_F13",e,e],[1,111,"F14",72,"F14",125,"VK_F14",e,e],[1,112,"F15",73,"F15",126,"VK_F15",e,e],[1,113,"F16",74,"F16",127,"VK_F16",e,e],[1,114,"F17",75,"F17",128,"VK_F17",e,e],[1,115,"F18",76,"F18",129,"VK_F18",e,e],[1,116,"F19",77,"F19",130,"VK_F19",e,e],[1,117,"F20",78,"F20",131,"VK_F20",e,e],[1,118,"F21",79,"F21",132,"VK_F21",e,e],[1,119,"F22",80,"F22",133,"VK_F22",e,e],[1,120,"F23",81,"F23",134,"VK_F23",e,e],[1,121,"F24",82,"F24",135,"VK_F24",e,e],[1,122,"Open",0,e,0,e,e,e],[1,123,"Help",0,e,0,e,e,e],[1,124,"Select",0,e,0,e,e,e],[1,125,"Again",0,e,0,e,e,e],[1,126,"Undo",0,e,0,e,e,e],[1,127,"Cut",0,e,0,e,e,e],[1,128,"Copy",0,e,0,e,e,e],[1,129,"Paste",0,e,0,e,e,e],[1,130,"Find",0,e,0,e,e,e],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE",e,e],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP",e,e],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN",e,e],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR",e,e],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1",e,e],[1,136,"KanaMode",0,e,0,e,e,e],[0,137,"IntlYen",0,e,0,e,e,e],[1,138,"Convert",0,e,0,e,e,e],[1,139,"NonConvert",0,e,0,e,e,e],[1,140,"Lang1",0,e,0,e,e,e],[1,141,"Lang2",0,e,0,e,e,e],[1,142,"Lang3",0,e,0,e,e,e],[1,143,"Lang4",0,e,0,e,e,e],[1,144,"Lang5",0,e,0,e,e,e],[1,145,"Abort",0,e,0,e,e,e],[1,146,"Props",0,e,0,e,e,e],[1,147,"NumpadParenLeft",0,e,0,e,e,e],[1,148,"NumpadParenRight",0,e,0,e,e,e],[1,149,"NumpadBackspace",0,e,0,e,e,e],[1,150,"NumpadMemoryStore",0,e,0,e,e,e],[1,151,"NumpadMemoryRecall",0,e,0,e,e,e],[1,152,"NumpadMemoryClear",0,e,0,e,e,e],[1,153,"NumpadMemoryAdd",0,e,0,e,e,e],[1,154,"NumpadMemorySubtract",0,e,0,e,e,e],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR",e,e],[1,156,"NumpadClearEntry",0,e,0,e,e,e],[1,0,e,5,"Ctrl",17,"VK_CONTROL",e,e],[1,0,e,4,"Shift",16,"VK_SHIFT",e,e],[1,0,e,6,"Alt",18,"VK_MENU",e,e],[1,0,e,57,"Meta",91,"VK_COMMAND",e,e],[1,157,"ControlLeft",5,e,0,"VK_LCONTROL",e,e],[1,158,"ShiftLeft",4,e,0,"VK_LSHIFT",e,e],[1,159,"AltLeft",6,e,0,"VK_LMENU",e,e],[1,160,"MetaLeft",57,e,0,"VK_LWIN",e,e],[1,161,"ControlRight",5,e,0,"VK_RCONTROL",e,e],[1,162,"ShiftRight",4,e,0,"VK_RSHIFT",e,e],[1,163,"AltRight",6,e,0,"VK_RMENU",e,e],[1,164,"MetaRight",57,e,0,"VK_RWIN",e,e],[1,165,"BrightnessUp",0,e,0,e,e,e],[1,166,"BrightnessDown",0,e,0,e,e,e],[1,167,"MediaPlay",0,e,0,e,e,e],[1,168,"MediaRecord",0,e,0,e,e,e],[1,169,"MediaFastForward",0,e,0,e,e,e],[1,170,"MediaRewind",0,e,0,e,e,e],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",e,e],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",e,e],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP",e,e],[1,174,"Eject",0,e,0,e,e,e],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",e,e],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",e,e],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",e,e],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",e,e],[1,179,"LaunchApp1",0,e,0,"VK_MEDIA_LAUNCH_APP1",e,e],[1,180,"SelectTask",0,e,0,e,e,e],[1,181,"LaunchScreenSaver",0,e,0,e,e,e],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH",e,e],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME",e,e],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK",e,e],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD",e,e],[1,186,"BrowserStop",0,e,0,"VK_BROWSER_STOP",e,e],[1,187,"BrowserRefresh",0,e,0,"VK_BROWSER_REFRESH",e,e],[1,188,"BrowserFavorites",0,e,0,"VK_BROWSER_FAVORITES",e,e],[1,189,"ZoomToggle",0,e,0,e,e,e],[1,190,"MailReply",0,e,0,e,e,e],[1,191,"MailForward",0,e,0,e,e,e],[1,192,"MailSend",0,e,0,e,e,e],[1,0,e,114,"KeyInComposition",229,e,e,e],[1,0,e,116,"ABNT_C2",194,"VK_ABNT_C2",e,e],[1,0,e,96,"OEM_8",223,"VK_OEM_8",e,e],[1,0,e,0,e,0,"VK_KANA",e,e],[1,0,e,0,e,0,"VK_HANGUL",e,e],[1,0,e,0,e,0,"VK_JUNJA",e,e],[1,0,e,0,e,0,"VK_FINAL",e,e],[1,0,e,0,e,0,"VK_HANJA",e,e],[1,0,e,0,e,0,"VK_KANJI",e,e],[1,0,e,0,e,0,"VK_CONVERT",e,e],[1,0,e,0,e,0,"VK_NONCONVERT",e,e],[1,0,e,0,e,0,"VK_ACCEPT",e,e],[1,0,e,0,e,0,"VK_MODECHANGE",e,e],[1,0,e,0,e,0,"VK_SELECT",e,e],[1,0,e,0,e,0,"VK_PRINT",e,e],[1,0,e,0,e,0,"VK_EXECUTE",e,e],[1,0,e,0,e,0,"VK_SNAPSHOT",e,e],[1,0,e,0,e,0,"VK_HELP",e,e],[1,0,e,0,e,0,"VK_APPS",e,e],[1,0,e,0,e,0,"VK_PROCESSKEY",e,e],[1,0,e,0,e,0,"VK_PACKET",e,e],[1,0,e,0,e,0,"VK_DBE_SBCSCHAR",e,e],[1,0,e,0,e,0,"VK_DBE_DBCSCHAR",e,e],[1,0,e,0,e,0,"VK_ATTN",e,e],[1,0,e,0,e,0,"VK_CRSEL",e,e],[1,0,e,0,e,0,"VK_EXSEL",e,e],[1,0,e,0,e,0,"VK_EREOF",e,e],[1,0,e,0,e,0,"VK_PLAY",e,e],[1,0,e,0,e,0,"VK_ZOOM",e,e],[1,0,e,0,e,0,"VK_NONAME",e,e],[1,0,e,0,e,0,"VK_PA1",e,e],[1,0,e,0,e,0,"VK_OEM_CLEAR",e,e]],i=[],n=[];for(const e of t){const[t,o,s,r,a,l,d,h,c]=e;if(n[o]||(n[o]=!0,Ce[o]=s,ye[s]=o,Se[s.toLowerCase()]=o,t&&(xe[o]=r,0!==r&&3!==r&&5!==r&&4!==r&&6!==r&&57!==r&&(ke[r]=o))),!i[r]){if(i[r]=!0,!a)throw new Error(`String representation missing for key code ${r} around scan code ${s}`);fe.define(r,a),_e.define(r,h||a),ve.define(r,c||h||a)}l&&(be[l]=r),d&&(we[d]=r)}ke[3]=46}(),function(e){e.toString=function(e){return fe.keyCodeToStr(e)},e.fromString=function(e){return fe.strToKeyCode(e)},e.toUserSettingsUS=function(e){return _e.keyCodeToStr(e)},e.toUserSettingsGeneral=function(e){return ve.keyCodeToStr(e)},e.fromUserSettings=function(e){return _e.strToKeyCode(e)||ve.strToKeyCode(e)},e.toElectronAccelerator=function(e){if(e>=98&&e<=113)return null;switch(e){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return fe.keyCodeToStr(e)}}(Le||(Le={}));const Ee=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout((()=>{if(e.stack){if(We.isErrorNoTelemetry(e))throw new We(e.message+"\n\n"+e.stack);throw new Error(e.message+"\n\n"+e.stack)}throw e}),0)}}emit(e){this.listeners.forEach((t=>{t(e)}))}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function Ne(e){Ee.onUnexpectedError(e)}function Ie(e){Re(e)||Ee.onUnexpectedError(e)}function Te(e){Re(e)||Ee.onUnexpectedExternalError(e)}function Me(e){if(e instanceof Error){const{name:t,message:i,cause:n}=e;return{$isError:!0,name:t,message:i,stack:e.stacktrace||e.stack,noTelemetry:We.isErrorNoTelemetry(e),cause:n?Me(n):void 0,code:e.code}}return e}const Ae="Canceled";function Re(e){return e instanceof Oe||e instanceof Error&&e.name===Ae&&e.message===Ae}class Oe extends Error{constructor(){super(Ae),this.name=this.message}}function Pe(e){return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")}function Fe(e){return e?new Error(`Illegal state: ${e}`):new Error("Illegal state")}class Be extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class We extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof We)return e;const t=new We;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return"CodeExpectedError"===e.name}}class Ve extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Ve.prototype)}}function He(e,t){if("number"==typeof e){if(0===e)return null;const i=(65535&e)>>>0,n=(4294901760&e)>>>16;return new Ke(0!==n?[ze(i,t),ze(n,t)]:[ze(i,t)])}{const i=[];for(let n=0;n<e.length;n++)i.push(ze(e[n],t));return new Ke(i)}}function ze(e,t){const i=!!(2048&e),n=!!(256&e);return new Ue(2===t?n:i,!!(1024&e),!!(512&e),2===t?i:n,255&e)}class Ue{constructor(e,t,i,n,o){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyCode=o}equals(e){return e instanceof Ue&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}isModifierKey(){return 0===this.keyCode||5===this.keyCode||57===this.keyCode||6===this.keyCode||4===this.keyCode}isDuplicateModifierCase(){return this.ctrlKey&&5===this.keyCode||this.shiftKey&&4===this.keyCode||this.altKey&&6===this.keyCode||this.metaKey&&57===this.keyCode}}class Ke{constructor(e){if(0===e.length)throw Pe("chords");this.chords=e}}class je{constructor(e,t,i,n,o,s){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyLabel=o,this.keyAriaLabel=s}}class qe{}const $e=$?256:2048,Ge=$?2048:256;class Ze{constructor(e){this._standardKeyboardEventBrand=!0;const t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState?.("AltGraph"),this.keyCode=function(e){if(e.charCode){const t=String.fromCharCode(e.charCode).toUpperCase();return Le.fromString(t)}const t=e.keyCode;if(3===t)return 7;if(c)switch(t){case 59:return 85;case 60:if(G)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if($)return 57}else if(u){if($&&93===t)return 57;if(!$&&92===t)return 57}return be[t]||0}(t),this.code=t.code,this.ctrlKey=this.ctrlKey||5===this.keyCode,this.altKey=this.altKey||6===this.keyCode,this.shiftKey=this.shiftKey||4===this.keyCode,this.metaKey=this.metaKey||57===this.keyCode,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=$e),this.altKey&&(t|=512),this.shiftKey&&(t|=1024),this.metaKey&&(t|=Ge),t|=e,t}_computeKeyCodeChord(){let e=0;return 5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode),new Ue(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}const Ye=new WeakMap;function Qe(e){if(!e.parent||e.parent===e)return null;try{const t=e.location,i=e.parent.location;if("null"!==t.origin&&"null"!==i.origin&&t.origin!==i.origin)return null}catch(e){return null}return e.parent}class Xe{static getSameOriginWindowChain(e){let t=Ye.get(e);if(!t){t=[],Ye.set(e,t);let i,n=e;do{i=Qe(n),i?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=i}while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,n=0;const o=this.getSameOriginWindowChain(e);for(const e of o){const o=e.window.deref();if(i+=o?.scrollY??0,n+=o?.scrollX??0,o===t)break;if(!e.iframeElement)break;const s=e.iframeElement.getBoundingClientRect();i+=s.top,n+=s.left}return{top:i,left:n}}}class Je{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=0===t.button,this.middleButton=1===t.button,this.rightButton=2===t.button,this.buttons=t.buttons,this.defaultPrevented=t.defaultPrevented,this.target=t.target,this.detail=t.detail||1,"dblclick"===t.type&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,"number"==typeof t.pageX?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);const i=Xe.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=i.left,this.posy-=i.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class et{constructor(e,t=0,i=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t;let n=!1;if(g){const e=navigator.userAgent.match(/Chrome\/(\d+)/);n=(e?parseInt(e[1]):123)<=122}if(e){const t=e,i=e,o=e.view?.devicePixelRatio||1;if(void 0!==t.wheelDeltaY)this.deltaY=n?t.wheelDeltaY/(120*o):t.wheelDeltaY/120;else if(void 0!==i.VERTICAL_AXIS&&i.axis===i.VERTICAL_AXIS)this.deltaY=-i.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?this.deltaY=c&&!$?-e.deltaY/3:-e.deltaY:this.deltaY=-e.deltaY/40}if(void 0!==t.wheelDeltaX)this.deltaX=p&&q?-t.wheelDeltaX/120:n?t.wheelDeltaX/(120*o):t.wheelDeltaX/120;else if(void 0!==i.HORIZONTAL_AXIS&&i.axis===i.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?this.deltaX=c&&!$?-e.deltaX/3:-e.deltaX:this.deltaX=-e.deltaX/40}0===this.deltaY&&0===this.deltaX&&e.wheelDelta&&(this.deltaY=n?e.wheelDelta/(120*o):e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}}function tt(e,t){const i=this;let n,o=!1;return function(){if(o)return n;if(o=!0,t)try{n=e.apply(i,arguments)}finally{t()}else n=e.apply(i,arguments);return n}}function it(e,t){if(!e)throw new Error(t?`Assertion failed (${t})`:"Assertion Failed")}function nt(e,t="Unreachable"){throw new Error(t)}function ot(e,t="unexpected state"){if(!e)throw"string"==typeof t?new Ve(`Assertion Failed: ${t}`):t}function st(e,t="Soft Assertion Failed"){e||Ie(new Ve(t))}function rt(e){e()||(e(),Ie(new Ve("Assertion Failed")))}function at(e,t){let i=0;for(;i<e.length-1;){if(!t(e[i],e[i+1]))return!1;i++}return!0}function lt(e){return"string"==typeof e}function dt(e){return!("object"!=typeof e||null===e||Array.isArray(e)||e instanceof RegExp||e instanceof Date)}function ht(e){const t=Object.getPrototypeOf(Uint8Array);return"object"==typeof e&&e instanceof t}function ct(e){return"number"==typeof e&&!isNaN(e)}function ut(e){return!!e&&"function"==typeof e[Symbol.iterator]}function gt(e){return!0===e||!1===e}function pt(e){return void 0===e}function mt(e){return!ft(e)}function ft(e){return pt(e)||null===e}function _t(e,t){if(!e)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function vt(e){return ot(null!=e,"Argument is `undefined` or `null`."),e}function bt(e){return"function"==typeof e}function wt(e,t){if(lt(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(bt(t)){try{if(e instanceof t)return}catch{}if(!ft(e)&&e.constructor===t)return;if(1===t.length&&!0===t.call(void 0,e))return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}var Ct;!function(e){function t(e){return!!e&&"object"==typeof e&&"function"==typeof e[Symbol.iterator]}e.is=t;const i=Object.freeze([]);function*n(e){yield e}e.empty=function(){return i},e.single=n,e.wrap=function(e){return t(e)?e:n(e)},e.from=function(e){return e||i},e.reverse=function*(e){for(let t=e.length-1;t>=0;t--)yield e[t]},e.isEmpty=function(e){return!e||!0===e[Symbol.iterator]().next().done},e.first=function(e){return e[Symbol.iterator]().next().value},e.some=function(e,t){let i=0;for(const n of e)if(t(n,i++))return!0;return!1},e.every=function(e,t){let i=0;for(const n of e)if(!t(n,i++))return!1;return!0},e.find=function(e,t){for(const i of e)if(t(i))return i},e.filter=function*(e,t){for(const i of e)t(i)&&(yield i)},e.map=function*(e,t){let i=0;for(const n of e)yield t(n,i++)},e.flatMap=function*(e,t){let i=0;for(const n of e)yield*t(n,i++)},e.concat=function*(...e){for(const t of e)ut(t)?yield*t:yield t},e.reduce=function(e,t,i){let n=i;for(const i of e)n=t(n,i);return n},e.length=function(e){let t=0;for(const i of e)t++;return t},e.slice=function*(e,t,i=e.length){for(t<-e.length&&(t=0),t<0&&(t+=e.length),i<0?i+=e.length:i>e.length&&(i=e.length);t<i;t++)yield e[t]},e.consume=function(t,i=Number.POSITIVE_INFINITY){const n=[];if(0===i)return[n,t];const o=t[Symbol.iterator]();for(let t=0;t<i;t++){const t=o.next();if(t.done)return[n,e.empty()];n.push(t.value)}return[n,{[Symbol.iterator]:()=>o}]},e.asyncToArray=async function(e){const t=[];for await(const i of e)t.push(i);return t},e.asyncToArrayFlat=async function(e){let t=[];for await(const i of e)t=t.concat(i);return t}}(Ct||(Ct={}));let yt=null;function St(e){return yt?.trackDisposable(e),e}function xt(e){yt?.markAsDisposed(e)}function kt(e,t){yt?.setParent(e,t)}function Lt(e){return yt?.markAsSingleton(e),e}function Dt(e){return"object"==typeof e&&null!==e&&"function"==typeof e.dispose&&0===e.dispose.length}function Et(e){if(Ct.is(e)){const t=[];for(const i of e)if(i)try{i.dispose()}catch(e){t.push(e)}if(1===t.length)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function Nt(...e){const t=Tt((()=>Et(e)));return t}class It{constructor(e){this._isDisposed=!1,this._fn=e,St(this)}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,xt(this),this._fn()}}}function Tt(e){return new It(e)}class Mt{static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,St(this)}dispose(){this._isDisposed||(xt(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(0!==this._toDispose.size)try{Et(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===At.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return kt(e,this),this._isDisposed?Mt.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}}class At{static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new Mt,St(this),kt(this._store,this)}dispose(){xt(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}class Rt{constructor(){this._isDisposed=!1,St(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&kt(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,xt(this),this._value?.dispose(),this._value=void 0}}class Ot{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return 0==--this._counter&&this._disposable.dispose(),this}}class Pt{constructor(e){this.object=e}dispose(){}}class Ft{constructor(){this._store=new Map,this._isDisposed=!1,St(this)}dispose(){xt(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{Et(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||this._store.get(e)?.dispose(),this._store.set(e,t),kt(t,this)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}class Bt{static{this.Undefined=new Bt(void 0)}constructor(e){this.element=e,this.next=Bt.Undefined,this.prev=Bt.Undefined}}class Wt{constructor(){this._first=Bt.Undefined,this._last=Bt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Bt.Undefined}clear(){let e=this._first;for(;e!==Bt.Undefined;){const t=e.next;e.prev=Bt.Undefined,e.next=Bt.Undefined,e=t}this._first=Bt.Undefined,this._last=Bt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new Bt(e);if(this._first===Bt.Undefined)this._first=i,this._last=i;else if(t){const e=this._last;this._last=i,i.prev=e,e.next=i}else{const e=this._first;this._first=i,i.next=e,e.prev=i}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(i))}}shift(){if(this._first!==Bt.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Bt.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Bt.Undefined&&e.next!==Bt.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Bt.Undefined&&e.next===Bt.Undefined?(this._first=Bt.Undefined,this._last=Bt.Undefined):e.next===Bt.Undefined?(this._last=this._last.prev,this._last.next=Bt.Undefined):e.prev===Bt.Undefined&&(this._first=this._first.next,this._first.prev=Bt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Bt.Undefined;)yield e.element,e=e.next}}const Vt=globalThis.performance.now.bind(globalThis.performance);class Ht{static create(e){return new Ht(e)}constructor(e){this._now=!1===e?Date.now:Vt,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return-1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime}}var zt;!function(e){function t(e){return(t,i=null,n)=>{let o,s=!1;return o=e((e=>{if(!s)return o?o.dispose():s=!0,t.call(i,e)}),null,n),s&&o.dispose(),o}}function i(e,t,i){return o(((i,n=null,o)=>e((e=>i.call(n,t(e))),null,o)),i)}function n(e,t,i){return o(((i,n=null,o)=>e((e=>t(e)&&i.call(n,e)),null,o)),i)}function o(e,t){let i;const n=new Zt({onWillAddFirstListener(){i=e(n.fire,n)},onDidRemoveLastListener(){i?.dispose()}});return t?.add(n),n.event}function s(e,t,i=100,n=!1,o=!1,s,r){let a,l,d,h,c=0;const u=new Zt({leakWarningThreshold:s,onWillAddFirstListener(){a=e((e=>{c++,l=t(l,e),n&&!d&&(u.fire(l),l=void 0),h=()=>{const e=l;l=void 0,d=void 0,(!n||c>1)&&u.fire(e),c=0},"number"==typeof i?(d&&clearTimeout(d),d=setTimeout(h,i)):void 0===d&&(d=null,queueMicrotask(h))}))},onWillRemoveListener(){o&&c>0&&h?.()},onDidRemoveLastListener(){h=void 0,a.dispose()}});return r?.add(u),u.event}e.None=()=>At.None,e.defer=function(e,t){return s(e,(()=>{}),0,void 0,!0,void 0,t)},e.once=t,e.onceIf=function(t,i){return e.once(e.filter(t,i))},e.map=i,e.forEach=function(e,t,i){return o(((i,n=null,o)=>e((e=>{t(e),i.call(n,e)}),null,o)),i)},e.filter=n,e.signal=function(e){return e},e.any=function(...e){return(t,i=null,n)=>{return o=Nt(...e.map((e=>e((e=>t.call(i,e)))))),(s=n)instanceof Array?s.push(o):s&&s.add(o),o;var o,s}},e.reduce=function(e,t,n,o){let s=n;return i(e,(e=>(s=t(s,e),s)),o)},e.debounce=s,e.accumulate=function(t,i=0,n){return e.debounce(t,((e,t)=>e?(e.push(t),e):[t]),i,void 0,!0,void 0,n)},e.latch=function(e,t=(e,t)=>e===t,i){let o,s=!0;return n(e,(e=>{const i=s||!t(e,o);return s=!1,o=e,i}),i)},e.split=function(t,i,n){return[e.filter(t,i,n),e.filter(t,(e=>!i(e)),n)]},e.buffer=function(e,t=!1,i=[],n){let o=i.slice(),s=e((e=>{o?o.push(e):a.fire(e)}));n&&n.add(s);const r=()=>{o?.forEach((e=>a.fire(e))),o=null},a=new Zt({onWillAddFirstListener(){s||(s=e((e=>a.fire(e))),n&&n.add(s))},onDidAddFirstListener(){o&&(t?setTimeout(r):r())},onDidRemoveLastListener(){s&&s.dispose(),s=null}});return n&&n.add(a),a.event},e.chain=function(e,t){return(i,n,o)=>{const s=t(new a);return e((function(e){const t=s.evaluate(e);t!==r&&i.call(n,t)}),void 0,o)}};const r=Symbol("HaltChainable");class a{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push((t=>(e(t),t))),this}filter(e){return this.steps.push((t=>e(t)?t:r)),this}reduce(e,t){let i=t;return this.steps.push((t=>(i=e(i,t),i))),this}latch(e=(e,t)=>e===t){let t,i=!0;return this.steps.push((n=>{const o=i||!e(n,t);return i=!1,t=n,o?n:r})),this}evaluate(e){for(const t of this.steps)if((e=t(e))===r)break;return e}}e.fromNodeEventEmitter=function(e,t,i=e=>e){const n=(...e)=>o.fire(i(...e)),o=new Zt({onWillAddFirstListener:()=>e.on(t,n),onDidRemoveLastListener:()=>e.removeListener(t,n)});return o.event},e.fromDOMEventEmitter=function(e,t,i=e=>e){const n=(...e)=>o.fire(i(...e)),o=new Zt({onWillAddFirstListener:()=>e.addEventListener(t,n),onDidRemoveLastListener:()=>e.removeEventListener(t,n)});return o.event},e.toPromise=function(e,i){let n;const o=new Promise(((o,s)=>{const r=t(e)(o,null,i);n=()=>r.dispose()}));return o.cancel=n,o},e.forward=function(e,t){return e((e=>t.fire(e)))},e.runAndSubscribe=function(e,t,i){return t(i),e((e=>t(e)))};class l{constructor(e,t){this._observable=e,this._counter=0,this._hasChanged=!1;const i={onWillAddFirstListener:()=>{e.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{e.removeObserver(this)}};this.emitter=new Zt(i),t&&t.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,0===this._counter&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}e.fromObservable=function(e,t){return new l(e,t).emitter.event},e.fromObservableLight=function(e){return(t,i,n)=>{let o=0,s=!1;const r={beginUpdate(){o++},endUpdate(){o--,0===o&&(e.reportChanges(),s&&(s=!1,t.call(i)))},handlePossibleChange(){},handleChange(){s=!0}};e.addObserver(r),e.reportChanges();const a={dispose(){e.removeObserver(r)}};return n instanceof Mt?n.add(a):Array.isArray(n)&&n.push(a),a}}}(zt||(zt={}));class Ut{static{this.all=new Set}static{this._idPool=0}constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${Ut._idPool++}`,Ut.all.add(this)}start(e){this._stopWatch=new Ht,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}class Kt{static{this._idPool=1}constructor(e,t,i=(Kt._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=t,this.name=i,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){const i=this.threshold;if(i<=0||t<i)return;this._stacks||(this._stacks=new Map);const n=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,n+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=.5*i;const[e,n]=this.getMostFrequentStack(),o=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${n}):`;console.warn(o),console.warn(e);const s=new qt(o,e);this._errorHandler(s)}return()=>{const t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(const[i,n]of this._stacks)(!e||t<n)&&(e=[i,n],t=n);return e}}class jt{static create(){const e=new Error;return new jt(e.stack??"")}constructor(e){this.value=e}print(){console.warn(this.value.split("\n").slice(2).join("\n"))}}class qt extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}}class $t extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}}class Gt{constructor(e){this.value=e}}class Zt{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new Kt(e?.onListenerError??Ie,this._options?.leakWarningThreshold??-1):void 0,this._perfMon=this._options?._profName?new Ut(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);const t=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],i=new $t(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||Ie)(i),At.None}if(this._disposed)return At.None;t&&(e=e.bind(t));const n=new Gt(e);let o;this._leakageMon&&this._size>=Math.ceil(.2*this._leakageMon.threshold)&&(n.stack=jt.create(),o=this._leakageMon.check(n.stack,this._size+1)),this._listeners?this._listeners instanceof Gt?(this._deliveryQueue??=new Yt,this._listeners=[this._listeners,n]):this._listeners.push(n):(this._options?.onWillAddFirstListener?.(this),this._listeners=n,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;const s=Tt((()=>{o?.(),this._removeListener(n)}));return i instanceof Mt?i.add(s):Array.isArray(i)&&i.push(s),s},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(1===this._size)return this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),void(this._size=0);const t=this._listeners,i=t.indexOf(e);if(-1===i)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;const n=this._deliveryQueue.current===this;if(2*this._size<=t.length){let e=0;for(let i=0;i<t.length;i++)t[i]?t[e++]=t[i]:n&&e<this._deliveryQueue.end&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;const i=this._options?.onListenerError||Ie;if(i)try{e.value(t)}catch(e){i(e)}else e.value(t)}_deliverQueue(e){const t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Gt)this._deliver(this._listeners,e);else{const t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}}class Yt{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class Qt extends Zt{constructor(e){super(e),this._isPaused=0,this._eventQueue=new Wt,this._mergeFn=e?.merge}pause(){this._isPaused++}resume(){if(0!==this._isPaused&&0==--this._isPaused)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&0!==this._eventQueue.size;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(0!==this._isPaused?this._eventQueue.push(e):super.fire(e))}}class Xt extends Qt{constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout((()=>{this._handle=void 0,this.resume()}),this._delay)),super.fire(e)}}class Jt extends Zt{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e?.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),1===this._queuedEvents.length&&queueMicrotask((()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach((e=>super.fire(e))),this._queuedEvents=[]})))}}class ei{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new Zt({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),Tt(tt((()=>{this.hasListeners&&this.unhook(t);const e=this.events.indexOf(t);this.events.splice(e,1)})))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach((e=>this.hook(e)))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach((e=>this.unhook(e)))}hook(e){e.listener=e.event((e=>this.emitter.fire(e)))}unhook(e){e.listener?.dispose(),e.listener=null}dispose(){this.emitter.dispose();for(const e of this.events)e.listener?.dispose();this.events=[]}}class ti{constructor(){this.data=[]}wrapEvent(e,t,i){return(n,o,s)=>e((e=>{const s=this.data[this.data.length-1];if(!t)return void(s?s.buffers.push((()=>n.call(o,e))):n.call(o,e));const r=s;r?(r.items??=[],r.items.push(e),0===r.buffers.length&&s.buffers.push((()=>{r.reducedResult??=i?r.items.reduce(t,i):r.items.reduce(t),n.call(o,r.reducedResult)}))):n.call(o,t(i,e))}),void 0,s)}bufferEvents(e){const t={buffers:new Array};this.data.push(t);const i=e();return this.data.pop(),t.buffers.forEach((e=>e())),i}}class ii{constructor(){this.listening=!1,this.inputEvent=zt.None,this.inputEventListener=At.None,this.emitter=new Zt({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const ni=Object.freeze((function(e,t){const i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}));var oi;!function(e){e.isCancellationToken=function(t){return t===e.None||t===e.Cancelled||t instanceof si||!(!t||"object"!=typeof t)&&"boolean"==typeof t.isCancellationRequested&&"function"==typeof t.onCancellationRequested},e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:zt.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ni})}(oi||(oi={}));class si{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?ni:(this._emitter||(this._emitter=new Zt),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class ri{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new si),this._token}cancel(){this._token?this._token instanceof si&&this._token.cancel():this._token=oi.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof si&&this._token.dispose():this._token=oi.None}}function ai(e){const t=new ri;return e.add({dispose(){t.cancel()}}),t.token}const li=Symbol("MicrotaskDelay");function di(e){return!!e&&"function"==typeof e.then}function hi(e){const t=new ri,i=e(t.token);let n=!1;const o=new Promise(((e,o)=>{const s=t.token.onCancellationRequested((()=>{n=!0,s.dispose(),o(new Oe)}));Promise.resolve(i).then((i=>{s.dispose(),t.dispose(),n?Dt(i)&&i.dispose():e(i)}),(e=>{s.dispose(),t.dispose(),o(e)}))}));return new class{cancel(){t.cancel(),t.dispose()}then(e,t){return o.then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return o.finally(e)}}}function ci(e,t,i){return new Promise(((n,o)=>{const s=t.onCancellationRequested((()=>{s.dispose(),n(i)}));e.then(n,o).finally((()=>s.dispose()))}))}class ui{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.isDisposed)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const e=()=>{if(this.queuedPromise=null,this.isDisposed)return;const e=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,e};this.queuedPromise=new Promise((t=>{this.activePromise.then(e,e).then(t)}))}return new Promise(((e,t)=>{this.queuedPromise.then(e,t)}))}return this.activePromise=e(),new Promise(((e,t)=>{this.activePromise.then((t=>{this.activePromise=null,e(t)}),(e=>{this.activePromise=null,t(e)}))}))}dispose(){this.isDisposed=!0}}class gi{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise(((e,t)=>{this.doResolve=e,this.doReject=t})).then((()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const e=this.task;return this.task=null,e()}})));const i=()=>{this.deferred=null,this.doResolve?.(null)};return this.deferred=t===li?(e=>{let t=!0;return queueMicrotask((()=>{t&&(t=!1,e())})),{isTriggered:()=>t,dispose:()=>{t=!1}}})(i):((e,t)=>{let i=!0;const n=setTimeout((()=>{i=!1,t()}),e);return{isTriggered:()=>i,dispose:()=>{clearTimeout(n),i=!1}}})(t,i),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new Oe),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}}class pi{constructor(e){this.delayer=new gi(e),this.throttler=new ui}trigger(e,t){return this.delayer.trigger((()=>this.throttler.queue(e)),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function mi(e,t){return t?new Promise(((i,n)=>{const o=setTimeout((()=>{s.dispose(),i()}),e),s=t.onCancellationRequested((()=>{clearTimeout(o),s.dispose(),n(new Oe)}))})):hi((t=>mi(e,t)))}function fi(e,t=0,i){const n=setTimeout((()=>{e(),i&&o.dispose()}),t),o=Tt((()=>{clearTimeout(n),i?.delete(o)}));return i?.add(o),o}function _i(e,t=e=>!!e,i=null){let n=0;const o=e.length,s=()=>{if(n>=o)return Promise.resolve(i);const r=e[n++];return Promise.resolve(r()).then((e=>t(e)?Promise.resolve(e):s()))};return s()}class vi{constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){const t=new Li;return this._pendingTasks.push({task:e,deferred:t,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),t.p}_runIfNotRunning(){void 0===this._runningTask&&this._processQueue()}async _processQueue(){if(0===this._pendingTasks.length)return;const e=this._pendingTasks.shift();if(e){if(this._runningTask)throw new Ve;this._runningTask=e.task;try{const t=await e.task();e.deferred.complete(t)}catch(t){e.deferred.error(t)}finally{this._runningTask=void 0,this._processQueue()}}}clearPending(){const e=this._pendingTasks;this._pendingTasks=[];for(const t of e)t.setUndefinedWhenCleared?t.deferred.complete(void 0):t.deferred.error(new Oe)}}class bi{constructor(e,t){this._isDisposed=!1,this._token=void 0,"function"==typeof e&&"number"==typeof t&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){void 0!==this._token&&(clearTimeout(this._token),this._token=void 0)}cancelAndSet(e,t){if(this._isDisposed)throw new Ve("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout((()=>{this._token=void 0,e()}),t)}setIfNotSet(e,t){if(this._isDisposed)throw new Ve("Calling 'setIfNotSet' on a disposed TimeoutTimer");void 0===this._token&&(this._token=setTimeout((()=>{this._token=void 0,e()}),t))}}class wi{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new Ve("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();const n=i.setInterval((()=>{e()}),t);this.disposable=Tt((()=>{i.clearInterval(n),this.disposable=void 0}))}dispose(){this.cancel(),this.isDisposed=!0}}class Ci{constructor(e,t){this.timeoutToken=void 0,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=void 0)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return void 0!==this.timeoutToken}onTimeout(){this.timeoutToken=void 0,this.runner&&this.doRun()}doRun(){this.runner?.()}}let yi,Si;!function(){const e=globalThis;Si="function"!=typeof e.requestIdleCallback||"function"!=typeof e.cancelIdleCallback?(e,t,i)=>{oe((()=>{if(n)return;const e=Date.now()+15,i={didTimeout:!0,timeRemaining:()=>Math.max(0,e-Date.now())};t(Object.freeze(i))}));let n=!1;return{dispose(){n||(n=!0)}}}:(e,t,i)=>{const n=e.requestIdleCallback(t,"number"==typeof i?{timeout:i}:void 0);let o=!1;return{dispose(){o||(o=!0,e.cancelIdleCallback(n))}}},yi=(e,t)=>Si(globalThis,e,t)}();class xi{constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(e){this._error=e}finally{this._didRun=!0}},this._handle=Si(e,(()=>this._executor()))}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}class ki extends xi{constructor(e){super(globalThis,e)}}class Li{get isRejected(){return 1===this.outcome?.outcome}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise(((e,t)=>{this.completeCallback=e,this.errorCallback=t}))}complete(e){return this.isSettled?Promise.resolve():new Promise((t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()}))}error(e){return this.isSettled?Promise.resolve():new Promise((t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()}))}cancel(){return this.error(new Oe)}}var Di,Ei;!function(e){e.settled=async function(e){let t;const i=await Promise.all(e.map((e=>e.then((e=>e),(e=>{t||(t=e)})))));if(void 0!==t)throw t;return i},e.withAsyncBody=function(e){return new Promise((async(t,i)=>{try{await e(t,i)}catch(e){i(e)}}))}}(Di||(Di={}));class Ni{constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){const t=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(t,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(const t of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(t,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new Ve("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(e,t){t.ok?e.complete(t.value):e.error(t.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){const e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}{const e=new Li;return this._unsatisfiedConsumers.push(e),e.p}}}class Ii{constructor(e,t){this._onReturn=t,this._producerConsumer=new Ni,this._iterator={next:()=>this._producerConsumer.consume(),return:()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),throw:async e=>(this._finishError(e),{done:!0,value:void 0})},queueMicrotask((async()=>{const t=e({emitOne:e=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:e}}),emitMany:e=>{for(const t of e)this._producerConsumer.produce({ok:!0,value:{done:!1,value:t}})},reject:e=>this._finishError(e)});if(!this._producerConsumer.hasFinalValue)try{await t,this._finishOk()}catch(e){this._finishError(e)}}))}static fromArray(e){return new Ii((t=>{t.emitMany(e)}))}static fromPromise(e){return new Ii((async t=>{t.emitMany(await e)}))}static fromPromisesResolveOrder(e){return new Ii((async t=>{await Promise.all(e.map((async e=>t.emitOne(await e))))}))}static merge(e){return new Ii((async t=>{await Promise.all(e.map((async e=>{for await(const i of e)t.emitOne(i)})))}))}static{this.EMPTY=Ii.fromArray([])}static map(e,t){return new Ii((async i=>{for await(const n of e)i.emitOne(t(n))}))}map(e){return Ii.map(this,e)}static coalesce(e){return Ii.filter(e,(e=>!!e))}coalesce(){return Ii.coalesce(this)}static filter(e,t){return new Ii((async i=>{for await(const n of e)t(n)&&i.emitOne(n)}))}filter(e){return Ii.filter(this,e)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}}class Ti extends Ii{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function Mi(e){return e}Symbol("AsyncReaderEndOfStream");class Ai{constructor(e,t){this.lastCache=void 0,this.lastArgKey=void 0,"function"==typeof e?(this._fn=e,this._computeKey=Mi):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){const t=this._computeKey(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this._fn(e)),this.lastCache}}class Ri{get cachedValues(){return this._map}constructor(e,t){this._map=new Map,this._map2=new Map,"function"==typeof e?(this._fn=e,this._computeKey=Mi):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){const t=this._computeKey(e);if(this._map2.has(t))return this._map2.get(t);const i=this._fn(e);return this._map.set(e,i),this._map2.set(t,i),i}}!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Running=1]="Running",e[e.Completed=2]="Completed"}(Ei||(Ei={}));class Oi{constructor(e){this.executor=e,this._state=Ei.Uninitialized}get value(){if(this._state===Ei.Uninitialized){this._state=Ei.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=Ei.Completed}}else if(this._state===Ei.Running)throw new Error("Cannot read the value of a lazy that is being initialized");if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}function Pi(e){return!e||"string"!=typeof e||0===e.trim().length}const Fi=/{(\d+)}/g;function Bi(e,...t){return 0===t.length?e:e.replace(Fi,(function(e,i){const n=parseInt(i,10);return isNaN(n)||n<0||n>=t.length?e:t[n]}))}function Wi(e){return e.replace(/[<>&]/g,(function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}}))}function Vi(e){return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function Hi(e,t=" "){return Ui(zi(e,t),t)}function zi(e,t){if(!e||!t)return e;const i=t.length;if(0===i||0===e.length)return e;let n=0;for(;e.indexOf(t,n)===n;)n+=i;return e.substring(n)}function Ui(e,t){if(!e||!t)return e;const i=t.length,n=e.length;if(0===i||0===n)return e;let o=n,s=-1;for(;s=e.lastIndexOf(t,o-1),-1!==s&&s+i===o;){if(0===s)return"";o=s}return e.substring(0,o)}function Ki(e,t,i={}){if(!e)throw new Error("Cannot create regex from empty string");t||(e=Vi(e)),i.wholeWord&&(/\B/.test(e.charAt(0))||(e="\\b"+e),/\B/.test(e.charAt(e.length-1))||(e+="\\b"));let n="";return i.global&&(n+="g"),i.matchCase||(n+="i"),i.multiline&&(n+="m"),i.unicode&&(n+="u"),new RegExp(e,n)}function ji(e){return"^"!==e.source&&"^$"!==e.source&&"$"!==e.source&&"^\\s*$"!==e.source&&!(!e.exec("")||0!==e.lastIndex)}function qi(e){return e.split(/\r\n|\r|\n/)}function $i(e){for(let t=0,i=e.length;t<i;t++){const i=e.charCodeAt(t);if(32!==i&&9!==i)return t}return-1}function Gi(e,t=0,i=e.length){for(let n=t;n<i;n++){const i=e.charCodeAt(n);if(32!==i&&9!==i)return e.substring(t,n)}return e.substring(t,i)}function Zi(e,t=e.length-1){for(let i=t;i>=0;i--){const t=e.charCodeAt(i);if(32!==t&&9!==t)return i}return-1}function Yi(e,t){return e<t?-1:e>t?1:0}function Qi(e,t,i=0,n=e.length,o=0,s=t.length){for(;i<n&&o<s;i++,o++){const n=e.charCodeAt(i),s=t.charCodeAt(o);if(n<s)return-1;if(n>s)return 1}const r=n-i,a=s-o;return r<a?-1:r>a?1:0}function Xi(e,t){return Ji(e,t,0,e.length,0,t.length)}function Ji(e,t,i=0,n=e.length,o=0,s=t.length){for(;i<n&&o<s;i++,o++){let r=e.charCodeAt(i),a=t.charCodeAt(o);if(r===a)continue;if(r>=128||a>=128)return Qi(e.toLowerCase(),t.toLowerCase(),i,n,o,s);tn(r)&&(r-=32),tn(a)&&(a-=32);const l=r-a;if(0!==l)return l}const r=n-i,a=s-o;return r<a?-1:r>a?1:0}function en(e){return e>=48&&e<=57}function tn(e){return e>=97&&e<=122}function nn(e){return e>=65&&e<=90}function on(e,t){return e.length===t.length&&0===Ji(e,t)}function sn(e,t){const i=t.length;return!(t.length>e.length)&&0===Ji(e,t,0,i)}function rn(e,t){const i=Math.min(e.length,t.length);let n;for(n=0;n<i;n++)if(e.charCodeAt(n)!==t.charCodeAt(n))return n;return i}function an(e,t){const i=Math.min(e.length,t.length);let n;const o=e.length-1,s=t.length-1;for(n=0;n<i;n++)if(e.charCodeAt(o-n)!==t.charCodeAt(s-n))return n;return i}function ln(e){return 55296<=e&&e<=56319}function dn(e){return 56320<=e&&e<=57343}function hn(e,t){return t-56320+(e-55296<<10)+65536}function cn(e,t,i){const n=e.charCodeAt(i);if(ln(n)&&i+1<t){const t=e.charCodeAt(i+1);if(dn(t))return hn(n,t)}return n}class un{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){const e=function(e,t){const i=e.charCodeAt(t-1);if(dn(i)&&t>1){const n=e.charCodeAt(t-2);if(ln(n))return hn(n,i)}return i}(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=cn(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class gn{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new un(e,t)}nextGraphemeLength(){const e=En.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const i=t.offset,o=e.getGraphemeBreakType(t.nextCodePoint());if(Dn(n,o)){t.setOffset(i);break}n=o}return t.offset-i}prevGraphemeLength(){const e=En.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const i=t.offset,o=e.getGraphemeBreakType(t.prevCodePoint());if(Dn(o,n)){t.setOffset(i);break}n=o}return i-t.offset}eol(){return this._iterator.eol()}}function pn(e,t){return new gn(e,t).nextGraphemeLength()}function mn(e,t){return new gn(e,t).prevGraphemeLength()}let fn;function _n(e){return fn||(fn=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/),fn.test(e)}const vn=/^[\t\n\r\x20-\x7E]*$/;function bn(e){return vn.test(e)}const wn=/[\u2028\u2029]/;function Cn(e){return wn.test(e)}function yn(e){return e>=11904&&e<=55215||e>=63744&&e<=64255||e>=65281&&e<=65374}function Sn(e){return e>=127462&&e<=127487||8986===e||8987===e||9200===e||9203===e||e>=9728&&e<=10175||11088===e||11093===e||e>=127744&&e<=128591||e>=128640&&e<=128764||e>=128992&&e<=129008||e>=129280&&e<=129535||e>=129648&&e<=129782}new RegExp("(?:"+[/(?:\x1b\[|\x9b)[=?>!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~]/.source,/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/.source,/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/.source].join("|")+")","g");const xn=String.fromCharCode(65279);function kn(e){return!!(e&&e.length>0&&65279===e.charCodeAt(0))}function Ln(e){return(e%=52)<26?String.fromCharCode(97+e):String.fromCharCode(65+e-26)}function Dn(e,t){return 0===e?5!==t&&7!==t:!(2===e&&3===t||4!==e&&2!==e&&3!==e&&4!==t&&2!==t&&3!==t&&(8===e&&(8===t||9===t||11===t||12===t)||!(11!==e&&9!==e||9!==t&&10!==t)||(12===e||10===e)&&10===t||5===t||13===t||7===t||1===e||13===e&&14===t||6===e&&6===t))}class En{static{this._INSTANCE=null}static getInstance(){return En._INSTANCE||(En._INSTANCE=new En),En._INSTANCE}constructor(){this._data=JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}getGraphemeBreakType(e){if(e<32)return 10===e?3:13===e?2:4;if(e<127)return 0;const t=this._data,i=t.length/3;let n=1;for(;n<=i;)if(e<t[3*n])n*=2;else{if(!(e>t[3*n+1]))return t[3*n+2];n=2*n+1}return 0}}function Nn(e){return 127995<=e&&e<=127999}class In{static{this.ambiguousCharacterData=new Oi((()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}')))}static{this.cache=new Ai({getCacheKey:JSON.stringify},(e=>{function t(e){const t=new Map;for(let i=0;i<e.length;i+=2)t.set(e[i],e[i+1]);return t}function i(e,t){if(!e)return t;const i=new Map;for(const[n,o]of e)t.has(n)&&i.set(n,o);return i}const n=this.ambiguousCharacterData.value;let o,s=e.filter((e=>!e.startsWith("_")&&e in n));0===s.length&&(s=["_default"]);for(const e of s)o=i(o,t(n[e]));const r=function(e,t){const i=new Map(e);for(const[e,n]of t)i.set(e,n);return i}(t(n._common),o);return new In(r)}))}static getInstance(e){return In.cache.get(Array.from(e))}static{this._locales=new Oi((()=>Object.keys(In.ambiguousCharacterData.value).filter((e=>!e.startsWith("_")))))}static getLocales(){return In._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}class Tn{static getRawData(){return JSON.parse('{"_common":[11,12,13,127,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999],"cs":[173,8203,12288],"de":[173,8203,12288],"es":[8203,12288],"fr":[173,8203,12288],"it":[160,173,12288],"ja":[173],"ko":[173,12288],"pl":[173,8203,12288],"pt-BR":[173,8203,12288],"qps-ploc":[160,173,8203,12288],"ru":[173,12288],"tr":[160,173,8203,12288],"zh-hans":[160,173,8203,12288],"zh-hant":[173,12288]}')}static{this._data=void 0}static getData(){return this._data||(this._data=new Set([...Object.values(Tn.getRawData())].flat())),this._data}static isInvisibleCharacter(e){return Tn.getData().has(e)}static get codePoints(){return Tn.getData()}}let Mn;const An=globalThis.vscode;if(void 0!==An&&void 0!==An.process){const e=An.process;Mn={get platform(){return e.platform},get arch(){return e.arch},get env(){return e.env},cwd:()=>e.cwd()}}else Mn="undefined"!=typeof process&&"string"==typeof process?.versions?.node?{get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd:()=>process.env.VSCODE_CWD||process.cwd()}:{get platform(){return q?"win32":$?"darwin":"linux"},get arch(){},get env(){return{}},cwd:()=>"/"};const Rn=Mn.cwd,On=Mn.env,Pn=Mn.platform,Fn=46,Bn=47,Wn=92,Vn=58;class Hn extends Error{constructor(e,t,i){let n;"string"==typeof t&&0===t.indexOf("not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";const o=-1!==e.indexOf(".")?"property":"argument";let s=`The "${e}" ${o} ${n} of type ${t}`;s+=". Received type "+typeof i,super(s),this.code="ERR_INVALID_ARG_TYPE"}}function zn(e,t){if("string"!=typeof e)throw new Hn(t,"string",e)}const Un="win32"===Pn;function Kn(e){return e===Bn||e===Wn}function jn(e){return e===Bn}function qn(e){return e>=65&&e<=90||e>=97&&e<=122}function $n(e,t,i,n){let o="",s=0,r=-1,a=0,l=0;for(let d=0;d<=e.length;++d){if(d<e.length)l=e.charCodeAt(d);else{if(n(l))break;l=Bn}if(n(l)){if(r===d-1||1===a);else if(2===a){if(o.length<2||2!==s||o.charCodeAt(o.length-1)!==Fn||o.charCodeAt(o.length-2)!==Fn){if(o.length>2){const e=o.lastIndexOf(i);-1===e?(o="",s=0):(o=o.slice(0,e),s=o.length-1-o.lastIndexOf(i)),r=d,a=0;continue}if(0!==o.length){o="",s=0,r=d,a=0;continue}}t&&(o+=o.length>0?`${i}..`:"..",s=2)}else o.length>0?o+=`${i}${e.slice(r+1,d)}`:o=e.slice(r+1,d),s=d-r-1;r=d,a=0}else l===Fn&&-1!==a?++a:a=-1}return o}function Gn(e,t){!function(e){if(null===e||"object"!=typeof e)throw new Hn("pathObject","Object",e)}(t);const i=t.dir||t.root,n=t.base||`${t.name||""}${o=t.ext,o?`${"."===o[0]?"":"."}${o}`:""}`;var o;return i?i===t.root?`${i}${n}`:`${i}${e}${n}`:n}const Zn={resolve(...e){let t="",i="",n=!1;for(let o=e.length-1;o>=-1;o--){let s;if(o>=0){if(s=e[o],zn(s,`paths[${o}]`),0===s.length)continue}else 0===t.length?s=Rn():(s=On[`=${t}`]||Rn(),(void 0===s||s.slice(0,2).toLowerCase()!==t.toLowerCase()&&s.charCodeAt(2)===Wn)&&(s=`${t}\\`));const r=s.length;let a=0,l="",d=!1;const h=s.charCodeAt(0);if(1===r)Kn(h)&&(a=1,d=!0);else if(Kn(h))if(d=!0,Kn(s.charCodeAt(1))){let e=2,t=e;for(;e<r&&!Kn(s.charCodeAt(e));)e++;if(e<r&&e!==t){const i=s.slice(t,e);for(t=e;e<r&&Kn(s.charCodeAt(e));)e++;if(e<r&&e!==t){for(t=e;e<r&&!Kn(s.charCodeAt(e));)e++;e!==r&&e===t||(l=`\\\\${i}\\${s.slice(t,e)}`,a=e)}}}else a=1;else qn(h)&&s.charCodeAt(1)===Vn&&(l=s.slice(0,2),a=2,r>2&&Kn(s.charCodeAt(2))&&(d=!0,a=3));if(l.length>0)if(t.length>0){if(l.toLowerCase()!==t.toLowerCase())continue}else t=l;if(n){if(t.length>0)break}else if(i=`${s.slice(a)}\\${i}`,n=d,d&&t.length>0)break}return i=$n(i,!n,"\\",Kn),n?`${t}\\${i}`:`${t}${i}`||"."},normalize(e){zn(e,"path");const t=e.length;if(0===t)return".";let i,n=0,o=!1;const s=e.charCodeAt(0);if(1===t)return jn(s)?"\\":e;if(Kn(s))if(o=!0,Kn(e.charCodeAt(1))){let o=2,s=o;for(;o<t&&!Kn(e.charCodeAt(o));)o++;if(o<t&&o!==s){const r=e.slice(s,o);for(s=o;o<t&&Kn(e.charCodeAt(o));)o++;if(o<t&&o!==s){for(s=o;o<t&&!Kn(e.charCodeAt(o));)o++;if(o===t)return`\\\\${r}\\${e.slice(s)}\\`;o!==s&&(i=`\\\\${r}\\${e.slice(s,o)}`,n=o)}}}else n=1;else qn(s)&&e.charCodeAt(1)===Vn&&(i=e.slice(0,2),n=2,t>2&&Kn(e.charCodeAt(2))&&(o=!0,n=3));let r=n<t?$n(e.slice(n),!o,"\\",Kn):"";if(0!==r.length||o||(r="."),r.length>0&&Kn(e.charCodeAt(t-1))&&(r+="\\"),!o&&void 0===i&&e.includes(":")){if(r.length>=2&&qn(r.charCodeAt(0))&&r.charCodeAt(1)===Vn)return`.\\${r}`;let i=e.indexOf(":");do{if(i===t-1||Kn(e.charCodeAt(i+1)))return`.\\${r}`}while(-1!==(i=e.indexOf(":",i+1)))}return void 0===i?o?`\\${r}`:r:o?`${i}\\${r}`:`${i}${r}`},isAbsolute(e){zn(e,"path");const t=e.length;if(0===t)return!1;const i=e.charCodeAt(0);return Kn(i)||t>2&&qn(i)&&e.charCodeAt(1)===Vn&&Kn(e.charCodeAt(2))},join(...e){if(0===e.length)return".";let t,i;for(let n=0;n<e.length;++n){const o=e[n];zn(o,"path"),o.length>0&&(void 0===t?t=i=o:t+=`\\${o}`)}if(void 0===t)return".";let n=!0,o=0;if("string"==typeof i&&Kn(i.charCodeAt(0))){++o;const e=i.length;e>1&&Kn(i.charCodeAt(1))&&(++o,e>2&&(Kn(i.charCodeAt(2))?++o:n=!1))}if(n){for(;o<t.length&&Kn(t.charCodeAt(o));)o++;o>=2&&(t=`\\${t.slice(o)}`)}return Zn.normalize(t)},relative(e,t){if(zn(e,"from"),zn(t,"to"),e===t)return"";const i=Zn.resolve(e),n=Zn.resolve(t);if(i===n)return"";if((e=i.toLowerCase())===(t=n.toLowerCase()))return"";if(i.length!==e.length||n.length!==t.length){const e=i.split("\\"),t=n.split("\\");""===e[e.length-1]&&e.pop(),""===t[t.length-1]&&t.pop();const o=e.length,s=t.length,r=o<s?o:s;let a;for(a=0;a<r&&e[a].toLowerCase()===t[a].toLowerCase();a++);return 0===a?n:a===r?s>r?t.slice(a).join("\\"):o>r?"..\\".repeat(o-1-a)+"..":"":"..\\".repeat(o-a)+t.slice(a).join("\\")}let o=0;for(;o<e.length&&e.charCodeAt(o)===Wn;)o++;let s=e.length;for(;s-1>o&&e.charCodeAt(s-1)===Wn;)s--;const r=s-o;let a=0;for(;a<t.length&&t.charCodeAt(a)===Wn;)a++;let l=t.length;for(;l-1>a&&t.charCodeAt(l-1)===Wn;)l--;const d=l-a,h=r<d?r:d;let c=-1,u=0;for(;u<h;u++){const i=e.charCodeAt(o+u);if(i!==t.charCodeAt(a+u))break;i===Wn&&(c=u)}if(u!==h){if(-1===c)return n}else{if(d>h){if(t.charCodeAt(a+u)===Wn)return n.slice(a+u+1);if(2===u)return n.slice(a+u)}r>h&&(e.charCodeAt(o+u)===Wn?c=u:2===u&&(c=3)),-1===c&&(c=0)}let g="";for(u=o+c+1;u<=s;++u)u!==s&&e.charCodeAt(u)!==Wn||(g+=0===g.length?"..":"\\..");return a+=c,g.length>0?`${g}${n.slice(a,l)}`:(n.charCodeAt(a)===Wn&&++a,n.slice(a,l))},toNamespacedPath(e){if("string"!=typeof e||0===e.length)return e;const t=Zn.resolve(e);if(t.length<=2)return e;if(t.charCodeAt(0)===Wn){if(t.charCodeAt(1)===Wn){const e=t.charCodeAt(2);if(63!==e&&e!==Fn)return`\\\\?\\UNC\\${t.slice(2)}`}}else if(qn(t.charCodeAt(0))&&t.charCodeAt(1)===Vn&&t.charCodeAt(2)===Wn)return`\\\\?\\${t}`;return t},dirname(e){zn(e,"path");const t=e.length;if(0===t)return".";let i=-1,n=0;const o=e.charCodeAt(0);if(1===t)return Kn(o)?e:".";if(Kn(o)){if(i=n=1,Kn(e.charCodeAt(1))){let o=2,s=o;for(;o<t&&!Kn(e.charCodeAt(o));)o++;if(o<t&&o!==s){for(s=o;o<t&&Kn(e.charCodeAt(o));)o++;if(o<t&&o!==s){for(s=o;o<t&&!Kn(e.charCodeAt(o));)o++;if(o===t)return e;o!==s&&(i=n=o+1)}}}}else qn(o)&&e.charCodeAt(1)===Vn&&(i=t>2&&Kn(e.charCodeAt(2))?3:2,n=i);let s=-1,r=!0;for(let i=t-1;i>=n;--i)if(Kn(e.charCodeAt(i))){if(!r){s=i;break}}else r=!1;if(-1===s){if(-1===i)return".";s=i}return e.slice(0,s)},basename(e,t){void 0!==t&&zn(t,"suffix"),zn(e,"path");let i,n=0,o=-1,s=!0;if(e.length>=2&&qn(e.charCodeAt(0))&&e.charCodeAt(1)===Vn&&(n=2),void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let r=t.length-1,a=-1;for(i=e.length-1;i>=n;--i){const l=e.charCodeAt(i);if(Kn(l)){if(!s){n=i+1;break}}else-1===a&&(s=!1,a=i+1),r>=0&&(l===t.charCodeAt(r)?-1==--r&&(o=i):(r=-1,o=a))}return n===o?o=a:-1===o&&(o=e.length),e.slice(n,o)}for(i=e.length-1;i>=n;--i)if(Kn(e.charCodeAt(i))){if(!s){n=i+1;break}}else-1===o&&(s=!1,o=i+1);return-1===o?"":e.slice(n,o)},extname(e){zn(e,"path");let t=0,i=-1,n=0,o=-1,s=!0,r=0;e.length>=2&&e.charCodeAt(1)===Vn&&qn(e.charCodeAt(0))&&(t=n=2);for(let a=e.length-1;a>=t;--a){const t=e.charCodeAt(a);if(Kn(t)){if(!s){n=a+1;break}}else-1===o&&(s=!1,o=a+1),t===Fn?-1===i?i=a:1!==r&&(r=1):-1!==i&&(r=-1)}return-1===i||-1===o||0===r||1===r&&i===o-1&&i===n+1?"":e.slice(i,o)},format:Gn.bind(null,"\\"),parse(e){zn(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.length;let n=0,o=e.charCodeAt(0);if(1===i)return Kn(o)?(t.root=t.dir=e,t):(t.base=t.name=e,t);if(Kn(o)){if(n=1,Kn(e.charCodeAt(1))){let t=2,o=t;for(;t<i&&!Kn(e.charCodeAt(t));)t++;if(t<i&&t!==o){for(o=t;t<i&&Kn(e.charCodeAt(t));)t++;if(t<i&&t!==o){for(o=t;t<i&&!Kn(e.charCodeAt(t));)t++;t===i?n=t:t!==o&&(n=t+1)}}}}else if(qn(o)&&e.charCodeAt(1)===Vn){if(i<=2)return t.root=t.dir=e,t;if(n=2,Kn(e.charCodeAt(2))){if(3===i)return t.root=t.dir=e,t;n=3}}n>0&&(t.root=e.slice(0,n));let s=-1,r=n,a=-1,l=!0,d=e.length-1,h=0;for(;d>=n;--d)if(o=e.charCodeAt(d),Kn(o)){if(!l){r=d+1;break}}else-1===a&&(l=!1,a=d+1),o===Fn?-1===s?s=d:1!==h&&(h=1):-1!==s&&(h=-1);return-1!==a&&(-1===s||0===h||1===h&&s===a-1&&s===r+1?t.base=t.name=e.slice(r,a):(t.name=e.slice(r,s),t.base=e.slice(r,a),t.ext=e.slice(s,a))),t.dir=r>0&&r!==n?e.slice(0,r-1):t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},Yn=(()=>{if(Un){const e=/\\/g;return()=>{const t=Rn().replace(e,"/");return t.slice(t.indexOf("/"))}}return()=>Rn()})(),Qn={resolve(...e){let t="",i=!1;for(let n=e.length-1;n>=0&&!i;n--){const o=e[n];zn(o,`paths[${n}]`),0!==o.length&&(t=`${o}/${t}`,i=o.charCodeAt(0)===Bn)}if(!i){const e=Yn();t=`${e}/${t}`,i=e.charCodeAt(0)===Bn}return t=$n(t,!i,"/",jn),i?`/${t}`:t.length>0?t:"."},normalize(e){if(zn(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===Bn,i=e.charCodeAt(e.length-1)===Bn;return 0===(e=$n(e,!t,"/",jn)).length?t?"/":i?"./":".":(i&&(e+="/"),t?`/${e}`:e)},isAbsolute:e=>(zn(e,"path"),e.length>0&&e.charCodeAt(0)===Bn),join(...e){if(0===e.length)return".";const t=[];for(let i=0;i<e.length;++i){const n=e[i];zn(n,"path"),n.length>0&&t.push(n)}return 0===t.length?".":Qn.normalize(t.join("/"))},relative(e,t){if(zn(e,"from"),zn(t,"to"),e===t)return"";if((e=Qn.resolve(e))===(t=Qn.resolve(t)))return"";const i=e.length,n=i-1,o=t.length-1,s=n<o?n:o;let r=-1,a=0;for(;a<s;a++){const i=e.charCodeAt(1+a);if(i!==t.charCodeAt(1+a))break;i===Bn&&(r=a)}if(a===s)if(o>s){if(t.charCodeAt(1+a)===Bn)return t.slice(1+a+1);if(0===a)return t.slice(1+a)}else n>s&&(e.charCodeAt(1+a)===Bn?r=a:0===a&&(r=0));let l="";for(a=1+r+1;a<=i;++a)a!==i&&e.charCodeAt(a)!==Bn||(l+=0===l.length?"..":"/..");return`${l}${t.slice(1+r)}`},toNamespacedPath:e=>e,dirname(e){if(zn(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===Bn;let i=-1,n=!0;for(let t=e.length-1;t>=1;--t)if(e.charCodeAt(t)===Bn){if(!n){i=t;break}}else n=!1;return-1===i?t?"/":".":t&&1===i?"//":e.slice(0,i)},basename(e,t){void 0!==t&&zn(t,"suffix"),zn(e,"path");let i,n=0,o=-1,s=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let r=t.length-1,a=-1;for(i=e.length-1;i>=0;--i){const l=e.charCodeAt(i);if(l===Bn){if(!s){n=i+1;break}}else-1===a&&(s=!1,a=i+1),r>=0&&(l===t.charCodeAt(r)?-1==--r&&(o=i):(r=-1,o=a))}return n===o?o=a:-1===o&&(o=e.length),e.slice(n,o)}for(i=e.length-1;i>=0;--i)if(e.charCodeAt(i)===Bn){if(!s){n=i+1;break}}else-1===o&&(s=!1,o=i+1);return-1===o?"":e.slice(n,o)},extname(e){zn(e,"path");let t=-1,i=0,n=-1,o=!0,s=0;for(let r=e.length-1;r>=0;--r){const a=e[r];if("/"!==a)-1===n&&(o=!1,n=r+1),"."===a?-1===t?t=r:1!==s&&(s=1):-1!==t&&(s=-1);else if(!o){i=r+1;break}}return-1===t||-1===n||0===s||1===s&&t===n-1&&t===i+1?"":e.slice(t,n)},format:Gn.bind(null,"/"),parse(e){zn(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.charCodeAt(0)===Bn;let n;i?(t.root="/",n=1):n=0;let o=-1,s=0,r=-1,a=!0,l=e.length-1,d=0;for(;l>=n;--l){const t=e.charCodeAt(l);if(t!==Bn)-1===r&&(a=!1,r=l+1),t===Fn?-1===o?o=l:1!==d&&(d=1):-1!==o&&(d=-1);else if(!a){s=l+1;break}}if(-1!==r){const n=0===s&&i?1:s;-1===o||0===d||1===d&&o===r-1&&o===s+1?t.base=t.name=e.slice(n,r):(t.name=e.slice(n,o),t.base=e.slice(n,r),t.ext=e.slice(o,r))}return s>0?t.dir=e.slice(0,s-1):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};Qn.win32=Zn.win32=Zn,Qn.posix=Zn.posix=Qn;const Xn=Un?Zn.normalize:Qn.normalize,Jn=Un?Zn.resolve:Qn.resolve,eo=Un?Zn.relative:Qn.relative,to=Un?Zn.dirname:Qn.dirname,io=Un?Zn.basename:Qn.basename,no=Un?Zn.extname:Qn.extname,oo=Un?Zn.sep:Qn.sep,so=/^\w[\w\d+.-]*$/,ro=/^\//,ao=/^\/\//,lo="",ho="/",co=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class uo{static isUri(e){return e instanceof uo||!(!e||"object"!=typeof e)&&"string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString}constructor(e,t,i,n,o,s=!1){"object"==typeof e?(this.scheme=e.scheme||lo,this.authority=e.authority||lo,this.path=e.path||lo,this.query=e.query||lo,this.fragment=e.fragment||lo):(this.scheme=function(e,t){return e||t?e:"file"}(e,s),this.authority=t||lo,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==ho&&(t=ho+t):t=ho}return t}(this.scheme,i||lo),this.query=n||lo,this.fragment=o||lo,function(e,t){if(!e.scheme&&t)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!so.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!ro.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(ao.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}(this,s))}get fsPath(){return vo(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:n,query:o,fragment:s}=e;return void 0===t?t=this.scheme:null===t&&(t=lo),void 0===i?i=this.authority:null===i&&(i=lo),void 0===n?n=this.path:null===n&&(n=lo),void 0===o?o=this.query:null===o&&(o=lo),void 0===s?s=this.fragment:null===s&&(s=lo),t===this.scheme&&i===this.authority&&n===this.path&&o===this.query&&s===this.fragment?this:new po(t,i,n,o,s)}static parse(e,t=!1){const i=co.exec(e);return i?new po(i[2]||lo,yo(i[4]||lo),yo(i[5]||lo),yo(i[7]||lo),yo(i[9]||lo),t):new po(lo,lo,lo,lo,lo)}static file(e){let t=lo;if(q&&(e=e.replace(/\\/g,ho)),e[0]===ho&&e[1]===ho){const i=e.indexOf(ho,2);-1===i?(t=e.substring(2),e=ho):(t=e.substring(2,i),e=e.substring(i)||ho)}return new po("file",t,e,lo,lo)}static from(e,t){return new po(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return i=q&&"file"===e.scheme?uo.file(Zn.join(vo(e,!0),...t)).path:Qn.join(e.path,...t),e.with({path:i})}toString(e=!1){return bo(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof uo)return e;{const t=new po(e);return t._formatted=e.external??null,t._fsPath=e._sep===go?e.fsPath??null:null,t}}return e}}const go=q?1:void 0;class po extends uo{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=vo(this,!1)),this._fsPath}toString(e=!1){return e?bo(this,!0):(this._formatted||(this._formatted=bo(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=go),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}const mo={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function fo(e,t,i){let n,o=-1;for(let s=0;s<e.length;s++){const r=e.charCodeAt(s);if(r>=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||45===r||46===r||95===r||126===r||t&&47===r||i&&91===r||i&&93===r||i&&58===r)-1!==o&&(n+=encodeURIComponent(e.substring(o,s)),o=-1),void 0!==n&&(n+=e.charAt(s));else{void 0===n&&(n=e.substr(0,s));const t=mo[r];void 0!==t?(-1!==o&&(n+=encodeURIComponent(e.substring(o,s)),o=-1),n+=t):-1===o&&(o=s)}}return-1!==o&&(n+=encodeURIComponent(e.substring(o))),void 0!==n?n:e}function _o(e){let t;for(let i=0;i<e.length;i++){const n=e.charCodeAt(i);35===n||63===n?(void 0===t&&(t=e.substr(0,i)),t+=mo[n]):void 0!==t&&(t+=e[i])}return void 0!==t?t:e}function vo(e,t){let i;return i=e.authority&&e.path.length>1&&"file"===e.scheme?`//${e.authority}${e.path}`:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,q&&(i=i.replace(/\//g,"\\")),i}function bo(e,t){const i=t?_o:fo;let n="",{scheme:o,authority:s,path:r,query:a,fragment:l}=e;if(o&&(n+=o,n+=":"),(s||"file"===o)&&(n+=ho,n+=ho),s){let e=s.indexOf("@");if(-1!==e){const t=s.substr(0,e);s=s.substr(e+1),e=t.lastIndexOf(":"),-1===e?n+=i(t,!1,!1):(n+=i(t.substr(0,e),!1,!1),n+=":",n+=i(t.substr(e+1),!1,!0)),n+="@"}s=s.toLowerCase(),e=s.lastIndexOf(":"),-1===e?n+=i(s,!1,!0):(n+=i(s.substr(0,e),!1,!0),n+=s.substr(e))}if(r){if(r.length>=3&&47===r.charCodeAt(0)&&58===r.charCodeAt(2)){const e=r.charCodeAt(1);e>=65&&e<=90&&(r=`/${String.fromCharCode(e+32)}:${r.substr(3)}`)}else if(r.length>=2&&58===r.charCodeAt(1)){const e=r.charCodeAt(0);e>=65&&e<=90&&(r=`${String.fromCharCode(e+32)}:${r.substr(2)}`)}n+=i(r,!0,!1)}return a&&(n+="?",n+=i(a,!1,!1)),l&&(n+="#",n+=t?l:fo(l,!1,!1)),n}function wo(e){try{return decodeURIComponent(e)}catch{return e.length>3?e.substr(0,3)+wo(e.substr(3)):e}}const Co=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function yo(e){return e.match(Co)?e.replace(Co,(e=>wo(e))):e}var So;function xo(e,t){return uo.isUri(e)?on(e.scheme,t):sn(e,t+":")}function ko(e,...t){return t.some((t=>xo(e,t)))}!function(e){e.inMemory="inmemory",e.vscode="vscode",e.internal="private",e.walkThrough="walkThrough",e.walkThroughSnippet="walkThroughSnippet",e.http="http",e.https="https",e.file="file",e.mailto="mailto",e.untitled="untitled",e.data="data",e.command="command",e.vscodeRemote="vscode-remote",e.vscodeRemoteResource="vscode-remote-resource",e.vscodeManagedRemoteResource="vscode-managed-remote-resource",e.vscodeUserData="vscode-userdata",e.vscodeCustomEditor="vscode-custom-editor",e.vscodeNotebookCell="vscode-notebook-cell",e.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",e.vscodeNotebookCellMetadataDiff="vscode-notebook-cell-metadata-diff",e.vscodeNotebookCellOutput="vscode-notebook-cell-output",e.vscodeNotebookCellOutputDiff="vscode-notebook-cell-output-diff",e.vscodeNotebookMetadata="vscode-notebook-metadata",e.vscodeInteractiveInput="vscode-interactive-input",e.vscodeSettings="vscode-settings",e.vscodeWorkspaceTrust="vscode-workspace-trust",e.vscodeTerminal="vscode-terminal",e.vscodeChatCodeBlock="vscode-chat-code-block",e.vscodeChatCodeCompareBlock="vscode-chat-code-compare-block",e.vscodeChatEditor="vscode-chat-editor",e.vscodeChatInput="chatSessionInput",e.vscodeChatSession="vscode-chat-session",e.webviewPanel="webview-panel",e.vscodeWebview="vscode-webview",e.extension="extension",e.vscodeFileResource="vscode-file",e.tmp="tmp",e.vsls="vsls",e.vscodeSourceControl="vscode-scm",e.commentsInput="comment",e.codeSetting="code-setting",e.outputChannel="output",e.accessibleView="accessible-view",e.chatEditingSnapshotScheme="chat-editing-snapshot-text-model",e.chatEditingModel="chat-editing-text-model"}(So||(So={}));const Lo=new class{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}get _remoteResourcesPath(){return Qn.join(this._serverRootPath,So.vscodeRemoteResource)}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(t){return Ie(t),e}const t=e.authority;let i=this._hosts[t];i&&-1!==i.indexOf(":")&&-1===i.indexOf("[")&&(i=`[${i}]`);const n=this._ports[t],o=this._connectionTokens[t];let s=`path=${encodeURIComponent(e.path)}`;return"string"==typeof o&&(s+=`&tkn=${encodeURIComponent(o)}`),uo.from({scheme:Y?this._preferredWebSchema:So.vscodeRemoteResource,authority:`${i}:${n}`,path:this._remoteResourcesPath,query:s})}};class Do{static{this.FALLBACK_AUTHORITY="vscode-app"}uriToBrowserUri(e){return e.scheme===So.vscodeRemote?Lo.rewrite(e):e.scheme!==So.file||!Z&&Q!==`${So.vscodeFileResource}://${Do.FALLBACK_AUTHORITY}`?e:e.with({scheme:So.vscodeFileResource,authority:e.authority||Do.FALLBACK_AUTHORITY,query:null,fragment:null})}}const Eo=new Do;var No;Object.freeze({"Cache-Control":"no-cache, no-store"}),Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports"}),function(e){const t=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);e.CoopAndCoep=Object.freeze(t.get("3"));const i="vscode-coi";e.getHeadersFromQuery=function(e){let n;"string"==typeof e?n=new URL(e).searchParams:e instanceof URL?n=e.searchParams:uo.isUri(e)&&(n=new URL(e.toString(!0)).searchParams);const o=n?.get(i);if(o)return t.get(o)},e.addSearchParam=function(e,t,n){if(!globalThis.crossOriginIsolated)return;const o=t&&n?"3":n?"2":"1";e instanceof URLSearchParams?e.set(i,o):e[i]=o}}(No||(No={}));const Io="undefined"!=typeof Buffer;let To;new Oi((()=>new Uint8Array(256)));class Mo{static wrap(e){return Io&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new Mo(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return Io?this.buffer.toString():(To||(To=new TextDecoder),To.decode(this.buffer))}}function Ao(e,t){return(0|e[t+0])>>>0|e[t+1]<<8>>>0}function Ro(e,t,i){e[i+0]=255&t,t>>>=8,e[i+1]=255&t}function Oo(e,t){return e[t]*2**24+65536*e[t+1]+256*e[t+2]+e[t+3]}function Po(e,t,i){e[i+3]=t,t>>>=8,e[i+2]=t,t>>>=8,e[i+1]=t,t>>>=8,e[i]=t}function Fo(e,t){return e[t]}function Bo(e,t,i){e[i]=t}const Wo="0123456789abcdef";function Vo(e){return Ho(e,0)}function Ho(e,t){switch(typeof e){case"object":return null===e?zo(349,t):Array.isArray(e)?(i=e,n=zo(104579,n=t),i.reduce(((e,t)=>Ho(t,e)),n)):function(e,t){return t=zo(181387,t),Object.keys(e).sort().reduce(((t,i)=>(t=Uo(i,t),Ho(e[i],t))),t)}(e,t);case"string":return Uo(e,t);case"boolean":return function(e,t){return zo(e?433:863,t)}(e,t);case"number":return zo(e,t);case"undefined":return zo(937,t);default:return zo(617,t)}var i,n}function zo(e,t){return(t<<5)-t+e|0}function Uo(e,t){t=zo(149417,t);for(let i=0,n=e.length;i<n;i++)t=zo(e.charCodeAt(i),t);return t}function Ko(e,t,i=32){const n=i-t;return(e<<t|(~((1<<n)-1)&e)>>>n)>>>0}function jo(e,t=32){return e instanceof ArrayBuffer?function({buffer:e}){let t="";for(let i=0;i<e.length;i++){const n=e[i];t+=Wo[n>>>4],t+=Wo[15&n]}return t}(Mo.wrap(new Uint8Array(e))):(e>>>0).toString(16).padStart(t/4,"0")}class qo{static{this._bigBlock32=new DataView(new ArrayBuffer(320))}constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(0===t)return;const i=this._buff;let n,o,s=this._buffLen,r=this._leftoverHighSurrogate;for(0!==r?(n=r,o=-1,r=0):(n=e.charCodeAt(0),o=0);;){let a=n;if(ln(n)){if(!(o+1<t)){r=n;break}{const t=e.charCodeAt(o+1);dn(t)?(o++,a=hn(n,t)):a=65533}}else dn(n)&&(a=65533);if(s=this._push(i,s,a),o++,!(o<t))break;n=e.charCodeAt(o)}this._buffLen=s,this._leftoverHighSurrogate=r}_push(e,t,i){return i<128?e[t++]=i:i<2048?(e[t++]=192|(1984&i)>>>6,e[t++]=128|(63&i)>>>0):i<65536?(e[t++]=224|(61440&i)>>>12,e[t++]=128|(4032&i)>>>6,e[t++]=128|(63&i)>>>0):(e[t++]=240|(1835008&i)>>>18,e[t++]=128|(258048&i)>>>12,e[t++]=128|(4032&i)>>>6,e[t++]=128|(63&i)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),jo(this._h0)+jo(this._h1)+jo(this._h2)+jo(this._h3)+jo(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=qo._bigBlock32,t=this._buffDV;for(let i=0;i<64;i+=4)e.setUint32(i,t.getUint32(i,!1),!1);for(let t=64;t<320;t+=4)e.setUint32(t,Ko(e.getUint32(t-12,!1)^e.getUint32(t-32,!1)^e.getUint32(t-56,!1)^e.getUint32(t-64,!1),1),!1);let i,n,o,s=this._h0,r=this._h1,a=this._h2,l=this._h3,d=this._h4;for(let t=0;t<80;t++)t<20?(i=r&a|~r&l,n=1518500249):t<40?(i=r^a^l,n=1859775393):t<60?(i=r&a|r&l|a&l,n=2400959708):(i=r^a^l,n=3395469782),o=Ko(s,5)+i+d+n+e.getUint32(4*t,!1)&4294967295,d=l,l=a,a=Ko(r,30),r=s,s=o;this._h0=this._h0+s&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+a&4294967295,this._h3=this._h3+l&4294967295,this._h4=this._h4+d&4294967295}}class $o{constructor(e,t,i){this.owner=e,this.debugNameSource=t,this.referenceFn=i}getDebugName(e){return function(e,t){const i=Zo.get(e);if(i)return i;const n=function(e,t){const i=Zo.get(e);if(i)return i;const n=t.owner?function(e){const t=Qo.get(e);if(t)return t;const i=Xo(e)??"Object";let n=Yo.get(i)??0;n++,Yo.set(i,n);const o=1===n?i:`${i}#${n}`;return Qo.set(e,o),o}(t.owner)+".":"";let o;const s=t.debugNameSource;if(void 0!==s){if("function"!=typeof s)return n+s;if(o=s(),void 0!==o)return n+o}const r=t.referenceFn;if(void 0!==r&&(o=Jo(r),void 0!==o))return n+o;if(void 0!==t.owner){const i=function(e,t){for(const i in e)if(e[i]===t)return i}(t.owner,e);if(void 0!==i)return n+i}}(e,t);if(n){let t=Go.get(n)??0;t++,Go.set(n,t);const i=1===t?n:`${n}#${t}`;return Zo.set(e,i),i}}(e,this)}}const Go=new Map,Zo=new WeakMap,Yo=new Map,Qo=new WeakMap;function Xo(e){const t=e.constructor;if(t){if("Object"===t.name)return;return t.name}}function Jo(e){const t=e.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(t),n=i?i[1]:void 0;return n?.trim()}function es(e,t,i=(e,t)=>e===t){if(e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(let n=0,o=e.length;n<o;n++)if(!i(e[n],t[n]))return!1;return!0}function ts(e,t,i){return is(e.length,(n=>i(e[n],t)))}function is(e,t){let i=0,n=e-1;for(;i<=n;){const e=(i+n)/2|0,o=t(e);if(o<0)i=e+1;else{if(!(o>0))return e;n=e-1}}return-(i+1)}function ns(e,t,i){if((e|=0)>=t.length)throw new TypeError("invalid index");const n=t[Math.floor(t.length*Math.random())],o=[],s=[],r=[];for(const e of t){const t=i(e,n);t<0?o.push(e):t>0?s.push(e):r.push(e)}return e<o.length?ns(e,o,i):e<o.length+r.length?r[0]:ns(e-(o.length+r.length),s,i)}function os(e,t){const i=[];let n;for(const o of e.slice(0).sort(t))n&&0===t(n[0],o)?n.push(o):(n=[o],i.push(n));return i}function*ss(e,t){let i,n;for(const o of e)void 0!==n&&t(n,o)?i.push(o):(i&&(yield i),i=[o]),n=o;i&&(yield i)}function rs(e,t){for(let i=0;i<=e.length;i++)t(0===i?void 0:e[i-1],i===e.length?void 0:e[i])}function as(e){return e.filter((e=>!!e))}function ls(e){let t=0;for(let i=0;i<e.length;i++)e[i]&&(e[t]=e[i],t+=1);e.length=t}function ds(e){return!Array.isArray(e)||0===e.length}function hs(e){return Array.isArray(e)&&e.length>0}function cs(e,t=e=>e){const i=new Set;return e.filter((e=>{const n=t(e);return!i.has(n)&&(i.add(n),!0)}))}function us(e,t){let i="number"==typeof t?e:0;"number"==typeof t?i=e:(i=0,t=e);const n=[];if(i<=t)for(let e=i;e<t;e++)n.push(e);else for(let e=i;e>t;e--)n.push(e);return n}function gs(e,t,i){const n=e.slice(0,t),o=e.slice(t);return n.concat(i,o)}function ps(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.unshift(t))}function ms(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.push(t))}function fs(e,t){for(const i of t)e.push(i)}function _s(e){return Array.isArray(e)?e:[e]}function vs(e,t,i,n){const o=bs(e,t);let s=e.splice(o,i);return void 0===s&&(s=[]),function(e,t,i){const n=bs(e,t),o=e.length,s=i.length;e.length=o+s;for(let t=o-1;t>=n;t--)e[t+s]=e[t];for(let t=0;t<s;t++)e[t+n]=i[t]}(e,o,n),s}function bs(e,t){return t<0?Math.max(t+e.length,0):Math.min(t,e.length)}var ws;function Cs(e,t){return(i,n)=>t(e(i),e(n))}!function(e){e.isLessThan=function(e){return e<0},e.isLessThanOrEqual=function(e){return e<=0},e.isGreaterThan=function(e){return e>0},e.isNeitherLessOrGreaterThan=function(e){return 0===e},e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0}(ws||(ws={}));const ys=(e,t)=>e-t,Ss=(e,t)=>ys(e?1:0,t?1:0);function xs(e){return(t,i)=>-e(t,i)}class ks{constructor(e){this.firstIdx=0,this.items=e,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t<this.items.length&&e(this.items[t]);)t++;const i=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,i}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(0!==this.length)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class Ls{static{this.empty=new Ls((e=>{}))}constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate((t=>(e.push(t),!0))),e}filter(e){return new Ls((t=>this.iterate((i=>!e(i)||t(i)))))}map(e){return new Ls((t=>this.iterate((i=>t(e(i))))))}findLast(e){let t;return this.iterate((i=>(e(i)&&(t=i),!0))),t}findLastMaxBy(e){let t,i=!0;return this.iterate((n=>((i||ws.isGreaterThan(e(n,t)))&&(i=!1,t=n),!0))),t}}class Ds{constructor(e){this._indexMap=e}static createSortPermutation(e,t){const i=Array.from(e.keys()).sort(((i,n)=>t(e[i],e[n])));return new Ds(i)}apply(e){return e.map(((t,i)=>e[this._indexMap[i]]))}inverse(){const e=this._indexMap.slice();for(let t=0;t<this._indexMap.length;t++)e[this._indexMap[t]]=t;return new Ds(e)}}function Es(e){return e.reduce(((e,t)=>e+t),0)}const Ns=(e,t)=>e===t;function Is(e=Ns){return(t,i)=>es(t,i,e)}function Ts(e,t,i){if(void 0!==i){return null==e||null==t?t===e:i(e,t)}{const t=e;return(e,i)=>null==e||null==i?i===e:t(e,i)}}function Ms(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!Ms(e[i],t[i]))return!1;return!0}if(e&&"object"==typeof e&&t&&"object"==typeof t&&Object.getPrototypeOf(e)===Object.prototype&&Object.getPrototypeOf(t)===Object.prototype){const i=e,n=t,o=Object.keys(i),s=Object.keys(n),r=new Set(s);if(o.length!==s.length)return!1;for(const e of o){if(!r.has(e))return!1;if(!Ms(i[e],n[e]))return!1}return!0}return!1}function As(e){const t=new Error("BugIndicatingErrorRecovery: "+e);Ie(t),console.error("recovered from an error that indicates a bug",t)}let Rs;function Os(e){Rs?Rs instanceof Ws?Rs.loggers.push(e):Rs=new Ws([Rs,e]):Rs=e}function Ps(){return Rs}new WeakMap;let Fs,Bs=null;class Ws{constructor(e){this.loggers=e}handleObservableCreated(e,t){for(const i of this.loggers)i.handleObservableCreated(e,t)}handleOnListenerCountChanged(e,t){for(const i of this.loggers)i.handleOnListenerCountChanged(e,t)}handleObservableUpdated(e,t){for(const i of this.loggers)i.handleObservableUpdated(e,t)}handleAutorunCreated(e,t){for(const i of this.loggers)i.handleAutorunCreated(e,t)}handleAutorunDisposed(e){for(const t of this.loggers)t.handleAutorunDisposed(e)}handleAutorunDependencyChanged(e,t,i){for(const n of this.loggers)n.handleAutorunDependencyChanged(e,t,i)}handleAutorunStarted(e){for(const t of this.loggers)t.handleAutorunStarted(e)}handleAutorunFinished(e){for(const t of this.loggers)t.handleAutorunFinished(e)}handleDerivedDependencyChanged(e,t,i){for(const n of this.loggers)n.handleDerivedDependencyChanged(e,t,i)}handleDerivedCleared(e){for(const t of this.loggers)t.handleDerivedCleared(e)}handleBeginTransaction(e){for(const t of this.loggers)t.handleBeginTransaction(e)}handleEndTransaction(e){for(const t of this.loggers)t.handleEndTransaction(e)}}function Vs(e,t){const i=new Us(e,t);try{e(i)}finally{i.finish()}}function Hs(e){if(Fs)e(Fs);else{const t=new Us(e,void 0);Fs=t;try{e(t)}finally{t.finish(),Fs=void 0}}}function zs(e,t,i){e?t(e):Vs(t,i)}class Us{constructor(e,t){this._fn=e,this._getDebugName=t,this._updatingObservers=[],Ps()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():Jo(this._fn)}updateObserver(e,t){if(!this._updatingObservers)return As("Transaction already finished!"),void Vs((i=>{i.updateObserver(e,t)}));this._updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){const e=this._updatingObservers;if(e){for(let t=0;t<e.length;t++){const{observer:i,observable:n}=e[t];i.endUpdate(n)}this._updatingObservers=null,Ps()?.handleEndTransaction(this)}else As("transaction.finish() has already been called!")}debugGetUpdatingObservers(){return this._updatingObservers}}var Ks;!function(e){let t=!1;e.enable=function(){t=!0},e.ofCaller=function(){if(!t)return;const e=Error,i=e.stackTraceLimit;e.stackTraceLimit=3;const n=(new Error).stack;return e.stackTraceLimit=i,js.fromStack(n,2)}}(Ks||(Ks={}));class js{static fromStack(e,t){const i=function(e){const t=e.match(/\((.*):(\d+):(\d+)\)/);if(t)return{fileName:t[1],line:parseInt(t[2]),column:parseInt(t[3]),id:e};const i=e.match(/at ([^\(\)]*):(\d+):(\d+)/);return i?{fileName:i[1],line:parseInt(i[2]),column:parseInt(i[3]),id:e}:void 0}(e.split("\n")[t+1]);return i?new js(i.fileName,i.line,i.column,i.id):void 0}constructor(e,t,i,n){this.fileName=e,this.line=t,this.column=i,this.id=n}}let qs,$s,Gs,Zs,Ys;class Qs{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t,i=Ks.ofCaller()){const n=void 0===t?void 0:e,o=void 0===t?e:t;return qs({owner:n,debugName:()=>{const e=Jo(o);if(void 0!==e)return e;const t=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(o.toString());return t?`${this.debugName}.${t[2]}`:n?void 0:`${this.debugName} (mapped)`},debugReferenceFn:o},(e=>o(this.read(e),e)),i)}flatten(){return qs({owner:void 0,debugName:()=>`${this.debugName} (flattened)`},(e=>this.read(e).read(e)))}recomputeInitiallyAndOnChange(e,t){return e.add($s(this,t)),this}}class Xs extends Qs{constructor(e){super(),this._observers=new Set,Ps()?.handleObservableCreated(this,e)}addObserver(e){const t=this._observers.size;this._observers.add(e),0===t&&this.onFirstObserverAdded(),t!==this._observers.size&&Ps()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){const t=this._observers.delete(e);t&&0===this._observers.size&&this.onLastObserverRemoved(),t&&Ps()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}debugGetObservers(){return this._observers}}function Js(e,t,i=Ks.ofCaller()){let n;return n="string"==typeof e?new $o(void 0,e,void 0):new $o(e,void 0,void 0),new er(n,t,Ns,i)}class er extends Xs{get debugName(){return this._debugNameData.getDebugName(this)??"ObservableValue"}constructor(e,t,i,n){super(n),this._debugNameData=e,this._equalityComparator=i,this._value=t,Ps()?.handleObservableUpdated(this,{hadValue:!1,newValue:t,change:void 0,didChange:!0,oldValue:void 0})}get(){return this._value}set(e,t,i){if(void 0===i&&this._equalityComparator(this._value,e))return;let n;t||(t=n=new Us((()=>{}),(()=>`Setting ${this.debugName}`)));try{const n=this._value;this._setValue(e),Ps()?.handleObservableUpdated(this,{oldValue:n,newValue:e,change:i,didChange:!0,hadValue:!0});for(const e of this._observers)t.updateObserver(e,this),e.handleChange(this,i)}finally{n&&n.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}debugGetState(){return{value:this._value}}debugSetValue(e){this._value=e}}function tr(e,t,i=Ks.ofCaller()){let n;return n="string"==typeof e?new $o(void 0,e,void 0):new $o(e,void 0,void 0),new ir(n,t,Ns,i)}class ir extends er{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}}class nr extends Xs{get debugName(){return this._debugNameData.getDebugName(this)??"LazyObservableValue"}constructor(e,t,i,n){super(n),this._debugNameData=e,this._equalityComparator=i,this._isUpToDate=!0,this._deltas=[],this._updateCounter=0,this._value=t}get(){return this._update(),this._value}_update(){if(!this._isUpToDate)if(this._isUpToDate=!0,this._deltas.length>0){for(const e of this._deltas){Ps()?.handleObservableUpdated(this,{change:e,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(const t of this._observers)t.handleChange(this,e)}this._deltas.length=0}else{Ps()?.handleObservableUpdated(this,{change:void 0,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(const e of this._observers)e.handleChange(this,void 0)}}_beginUpdate(){if(this._updateCounter++,1===this._updateCounter)for(const e of this._observers)e.beginUpdate(this)}_endUpdate(){if(this._updateCounter--,0===this._updateCounter){this._update();const e=[...this._observers];for(const t of e)t.endUpdate(this)}}addObserver(e){const t=!this._observers.has(e)&&this._updateCounter>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this._observers.has(e)&&this._updateCounter>0;super.removeObserver(e),t&&e.endUpdate(this)}set(e,t,i){if(void 0===i&&this._equalityComparator(this._value,e))return;let n;t||(t=n=new Us((()=>{}),(()=>`Setting ${this.debugName}`)));try{if(this._isUpToDate=!1,this._setValue(e),void 0!==i&&this._deltas.push(i),t.updateObserver({beginUpdate:()=>this._beginUpdate(),endUpdate:()=>this._endUpdate(),handleChange:(e,t)=>{},handlePossibleChange:e=>{}},this),this._updateCounter>1)for(const e of this._observers)e.handlePossibleChange(this)}finally{n&&n.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function or(e,t,i=Ks.ofCaller()){return e.lazy?new nr(new $o(e.owner,e.debugName,void 0),t,e.equalsFn??Ns,i):new er(new $o(e.owner,e.debugName,void 0),t,e.equalsFn??Ns,i)}function sr(e){switch(e){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return"<unknown>"}}class rr{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,n){this._debugNameData=e,this._runFn=t,this._changeTracker=i,this._state=2,this._updateCount=0,this._disposed=!1,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._isRunning=!1,this._store=void 0,this._delayedStore=void 0,this._changeSummary=this._changeTracker?.createChangeSummary(void 0),Ps()?.handleAutorunCreated(this,n),this._run(),St(this)}dispose(){if(!this._disposed){this._disposed=!0;for(const e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),void 0!==this._store&&this._store.dispose(),void 0!==this._delayedStore&&this._delayedStore.dispose(),Ps()?.handleAutorunDisposed(this),xt(this)}}_run(){const e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=3;try{if(!this._disposed){Ps()?.handleAutorunStarted(this);const e=this._changeSummary,t=this._delayedStore;void 0!==t&&(this._delayedStore=void 0);try{this._isRunning=!0,this._changeTracker&&(this._changeTracker.beforeUpdate?.(this,e),this._changeSummary=this._changeTracker.createChangeSummary(e)),void 0!==this._store&&(this._store.dispose(),this._store=void 0),this._runFn(this,e)}catch(e){Ne(e)}finally{this._isRunning=!1,void 0!==t&&t.dispose()}}}finally{this._disposed||Ps()?.handleAutorunFinished(this);for(const e of this._dependenciesToBeRemoved)e.removeObserver(this);this._dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(e){3===this._state&&(this._state=1),this._updateCount++}endUpdate(e){try{if(1===this._updateCount)do{if(1===this._state){this._state=3;for(const e of this._dependencies)if(e.reportChanges(),2===this._state)break}3!==this._state&&this._run()}while(3!==this._state)}finally{this._updateCount--}rt((()=>this._updateCount>=0))}handlePossibleChange(e){3===this._state&&this._isDependency(e)&&(this._state=1)}handleChange(e,t){if(this._isDependency(e)){Ps()?.handleAutorunDependencyChanged(this,e,t);try{(!this._changeTracker||this._changeTracker.handleChange({changedObservable:e,change:t,didChange:t=>t===e},this._changeSummary))&&(this._state=2)}catch(e){Ne(e)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new Ve("The reader object cannot be used outside its compute function!")}readObservable(e){if(this._ensureNoRunning(),this._disposed)return e.get();e.addObserver(this);const t=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),t}get store(){if(this._ensureNoRunning(),this._disposed)throw new Ve("Cannot access store after dispose");return void 0===this._store&&(this._store=new Mt),this._store}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:sr(this._state)}}debugRerun(){this._isRunning?this._state=2:this._run()}}function ar(e,t=Ks.ofCaller()){return new rr(new $o(void 0,void 0,e),e,void 0,t)}function lr(e,t,i=Ks.ofCaller()){return new rr(new $o(e.owner,e.debugName,e.debugReferenceFn??t),t,void 0,i)}function dr(e,t,i=Ks.ofCaller()){return new rr(new $o(e.owner,e.debugName,e.debugReferenceFn??t),t,e.changeTracker,i)}function hr(e){const t=new Mt,i=lr({owner:void 0,debugName:void 0,debugReferenceFn:e},(i=>{t.clear(),e(i,t)}));return Tt((()=>{i.dispose(),t.dispose()}))}function cr(e){switch(e){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return"<unknown>"}}class ur extends Xs{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,n=void 0,o,s){super(s),this._debugNameData=e,this._computeFn=t,this._changeTracker=i,this._handleLastObserverRemoved=n,this._equalityComparator=o,this._state=0,this._value=void 0,this._updateCount=0,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._changeSummary=void 0,this._isUpdating=!1,this._isComputing=!1,this._didReportChange=!1,this._isInBeforeUpdate=!1,this._isReaderValid=!1,this._store=void 0,this._delayedStore=void 0,this._removedObserverToCallEndUpdateOn=null,this._changeSummary=this._changeTracker?.createChangeSummary(void 0)}onLastObserverRemoved(){this._state=0,this._value=void 0,Ps()?.handleDerivedCleared(this);for(const e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),void 0!==this._store&&(this._store.dispose(),this._store=void 0),void 0!==this._delayedStore&&(this._delayedStore.dispose(),this._delayedStore=void 0),this._handleLastObserverRemoved?.()}get(){if(this._isComputing,0===this._observers.size){let e;try{let t;this._isReaderValid=!0,this._changeTracker&&(t=this._changeTracker.createChangeSummary(void 0),this._changeTracker.beforeUpdate?.(this,t)),e=this._computeFn(this,t)}finally{this._isReaderValid=!1}return this.onLastObserverRemoved(),e}do{if(1===this._state)for(const e of this._dependencies)if(e.reportChanges(),2===this._state)break;1===this._state&&(this._state=3),3!==this._state&&this._recompute()}while(3!==this._state);return this._value}_recompute(){let e=!1;this._isComputing=!0,this._didReportChange=!1;const t=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=t;try{const t=this._changeSummary;this._isReaderValid=!0,this._changeTracker&&(this._isInBeforeUpdate=!0,this._changeTracker.beforeUpdate?.(this,t),this._isInBeforeUpdate=!1,this._changeSummary=this._changeTracker?.createChangeSummary(t));const i=0!==this._state,n=this._value;this._state=3;const o=this._delayedStore;void 0!==o&&(this._delayedStore=void 0);try{void 0!==this._store&&(this._store.dispose(),this._store=void 0),this._value=this._computeFn(this,t)}finally{this._isReaderValid=!1;for(const e of this._dependenciesToBeRemoved)e.removeObserver(this);this._dependenciesToBeRemoved.clear(),void 0!==o&&o.dispose()}e=this._didReportChange||i&&!this._equalityComparator(n,this._value),Ps()?.handleObservableUpdated(this,{oldValue:n,newValue:this._value,change:void 0,didChange:e,hadValue:i})}catch(e){Ne(e)}if(this._isComputing=!1,!this._didReportChange&&e)for(const e of this._observers)e.handleChange(this,void 0);else this._didReportChange=!1}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){if(this._isUpdating)throw new Ve("Cyclic deriveds are not supported yet!");this._updateCount++,this._isUpdating=!0;try{const e=1===this._updateCount;if(3===this._state&&(this._state=1,!e))for(const e of this._observers)e.handlePossibleChange(this);if(e)for(const e of this._observers)e.beginUpdate(this)}finally{this._isUpdating=!1}}endUpdate(e){if(this._updateCount--,0===this._updateCount){const e=[...this._observers];for(const t of e)t.endUpdate(this);if(this._removedObserverToCallEndUpdateOn){const e=[...this._removedObserverToCallEndUpdateOn];this._removedObserverToCallEndUpdateOn=null;for(const t of e)t.endUpdate(this)}}rt((()=>this._updateCount>=0))}handlePossibleChange(e){if(3===this._state&&this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)){this._state=1;for(const e of this._observers)e.handlePossibleChange(this)}}handleChange(e,t){if(this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)||this._isInBeforeUpdate){Ps()?.handleDerivedDependencyChanged(this,e,t);let i=!1;try{i=!this._changeTracker||this._changeTracker.handleChange({changedObservable:e,change:t,didChange:t=>t===e},this._changeSummary)}catch(e){Ne(e)}const n=3===this._state;if(i&&(1===this._state||n)&&(this._state=2,n))for(const e of this._observers)e.handlePossibleChange(this)}}_ensureReaderValid(){if(!this._isReaderValid)throw new Ve("The reader object cannot be used outside its compute function!")}readObservable(e){this._ensureReaderValid(),e.addObserver(this);const t=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),t}get store(){return this._ensureReaderValid(),void 0===this._store&&(this._store=new Mt),this._store}addObserver(e){const t=!this._observers.has(e)&&this._updateCount>0;super.addObserver(e),t&&(this._removedObserverToCallEndUpdateOn&&this._removedObserverToCallEndUpdateOn.has(e)?this._removedObserverToCallEndUpdateOn.delete(e):e.beginUpdate(this))}removeObserver(e){this._observers.has(e)&&this._updateCount>0&&(this._removedObserverToCallEndUpdateOn||(this._removedObserverToCallEndUpdateOn=new Set),this._removedObserverToCallEndUpdateOn.add(e)),super.removeObserver(e)}debugGetState(){return{state:this._state,stateStr:cr(this._state),updateCount:this._updateCount,isComputing:this._isComputing,dependencies:this._dependencies,value:this._value}}debugSetValue(e){this._value=e}debugRecompute(){this._isComputing?this._state=2:this._recompute()}setValue(e,t,i){this._value=e;const n=this._observers;t.updateObserver(this,this);for(const e of n)e.handleChange(this,i)}}class gr extends ur{constructor(e,t,i,n=void 0,o,s,r){super(e,t,i,n,o,r),this.set=s}}function pr(e,t,i=Ks.ofCaller()){return void 0!==t?new ur(new $o(e,void 0,t),t,void 0,void 0,Ns,i):new ur(new $o(void 0,void 0,e),e,void 0,void 0,Ns,i)}function mr(e,t,i,n=Ks.ofCaller()){return new gr(new $o(e,void 0,t),t,void 0,void 0,Ns,i,n)}function fr(e,t,i=Ks.ofCaller()){return new ur(new $o(e.owner,e.debugName,e.debugReferenceFn),t,void 0,e.onLastObserverRemoved,e.equalsFn??Ns,i)}function _r(e,t,i=Ks.ofCaller()){return new ur(new $o(e.owner,e.debugName,void 0),t,e.changeTracker,void 0,e.equalityComparer??Ns,i)}function vr(e,t,i=Ks.ofCaller()){let n,o,s;return void 0===t?(n=e,o=void 0):(o=e,n=t),new ur(new $o(o,void 0,n),(e=>{s?s.clear():s=new Mt;const t=n(e);return t&&s.add(t),t}),void 0,(()=>{s&&(s.dispose(),s=void 0)}),Ns,i)}var br;qs=fr;class wr{constructor(e){this._value=Js(this,void 0),this.promiseResult=this._value,this.promise=e.then((e=>(Vs((t=>{this._value.set(new Cr(e,void 0),t)})),e)),(e=>{throw Vs((t=>{this._value.set(new Cr(void 0,e),t)})),e}))}}class Cr{constructor(e,t){this.data=e,this.error=t}getDataOrThrow(){if(this.error)throw this.error;return this.data}}function yr(e,t,i,n){return t||(t=e=>null!=e),new Promise(((o,s)=>{let r=!0,a=!1;const l=e.map((e=>({isFinished:t(e),error:!!i&&i(e),state:e}))),d=ar((e=>{const{isFinished:t,error:i,state:n}=l.read(e);(t||i)&&(r?a=!0:d.dispose(),i?s(!0===i?n:i):o(n))}));if(n){const e=n.onCancellationRequested((()=>{d.dispose(),e.dispose(),s(new Oe)}));if(n.isCancellationRequested)return d.dispose(),e.dispose(),void s(new Oe)}r=!1,a&&d.dispose()}))}function Sr(...e){let t,i,n,o;return 2===e.length?[i,n]=e:[t,i,n,o]=e,new kr(new $o(t,void 0,n),i,n,(()=>kr.globalTransaction),Ns,o??Ks.ofCaller())}function xr(e,t,i,n=Ks.ofCaller()){return new kr(new $o(e.owner,e.debugName,e.debugReferenceFn??i),t,i,(()=>kr.globalTransaction),e.equalsFn??Ns,n)}class kr extends Xs{constructor(e,t,i,n,o,s){super(s),this._debugNameData=e,this.event=t,this._getValue=i,this._getTransaction=n,this._equalityComparator=o,this._hasValue=!1,this.handleEvent=e=>{const t=this._getValue(e),i=this._value,n=!this._hasValue||!this._equalityComparator(i,t);let o=!1;n&&(this._value=t,this._hasValue&&(o=!0,zs(this._getTransaction(),(e=>{Ps()?.handleObservableUpdated(this,{oldValue:i,newValue:t,change:void 0,didChange:n,hadValue:this._hasValue});for(const t of this._observers)e.updateObserver(t,this),t.handleChange(this,void 0)}),(()=>{const e=this.getDebugName();return"Event fired"+(e?`: ${e}`:"")}))),this._hasValue=!0),o||Ps()?.handleObservableUpdated(this,{oldValue:i,newValue:t,change:void 0,didChange:n,hadValue:this._hasValue})}}getDebugName(){return this._debugNameData.getDebugName(this)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this._subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this._subscription.dispose(),this._subscription=void 0,this._hasValue=!1,this._value=void 0}get(){return this._subscription?(this._hasValue||this.handleEvent(void 0),this._value):this._getValue(void 0)}debugSetValue(e){this._value=e}debugGetState(){return{value:this._value,hasValue:this._hasValue}}}function Lr(e,t=Ks.ofCaller()){return"string"==typeof e?new Dr(e,void 0,t):new Dr(void 0,e,t)}(br=Sr||(Sr={})).Observer=kr,br.batchEventsGlobally=function(e,t){let i=!1;void 0===kr.globalTransaction&&(kr.globalTransaction=e,i=!0);try{t()}finally{i&&(kr.globalTransaction=void 0)}};class Dr extends Xs{get debugName(){return new $o(this._owner,this._debugName,void 0).getDebugName(this)??"Observable Signal"}toString(){return this.debugName}constructor(e,t,i){super(i),this._debugName=e,this._owner=t}trigger(e,t){if(e)for(const i of this._observers)e.updateObserver(i,this),i.handleChange(this,t);else Vs((e=>{this.trigger(e,t)}),(()=>`Trigger signal ${this.debugName}`))}get(){}}function Er(e,t){let i,n,o=!1;return Sr((s=>{const r=ar((r=>{const a=e.read(r);o?(n&&clearTimeout(n),n=setTimeout((()=>{i=a,s()}),t)):(o=!0,i=a)}));return{dispose(){r.dispose(),o=!1,i=void 0}}}),(()=>o?i:e.get()))}function Nr(e,t){const i=new Ir(!0,t);e.addObserver(i);try{i.beginUpdate(e)}finally{i.endUpdate(e)}return Tt((()=>{e.removeObserver(i)}))}Gs=function(e){const t=new Ir(!1,void 0);return e.addObserver(t),Tt((()=>{e.removeObserver(t)}))},function(e){$s=e}(Nr);class Ir{constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){1===this._counter&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges()),this._counter--}handlePossibleChange(e){}handleChange(e,t){}}function Tr(e,t){let i;return fr({owner:e,debugReferenceFn:t},(e=>(i=t(e,i),i)))}function Mr(e,t,i,n){let o=new Ar(i,n);return fr({debugReferenceFn:i,owner:e,onLastObserverRemoved:()=>{o.dispose(),o=new Ar(i)}},(e=>(o.setItems(t.read(e)),o.getItems())))}class Ar{constructor(e,t){this._map=e,this._keySelector=t,this._cache=new Map,this._items=[]}dispose(){this._cache.forEach((e=>e.store.dispose())),this._cache.clear()}setItems(e){const t=[],i=new Set(this._cache.keys());for(const n of e){const e=this._keySelector?this._keySelector(n):n;let o=this._cache.get(e);if(o)i.delete(e);else{const t=new Mt;o={out:this._map(n,t),store:t},this._cache.set(e,o)}t.push(o.out)}for(const e of i)this._cache.get(e).store.dispose(),this._cache.delete(e);this._items=t}getItems(){return this._items}}function Rr(e){let t;return{createChangeSummary:e=>({changes:[]}),handleChange(i,n){t||(t=e());for(const e in t)i.didChange(t[e])&&n.changes.push({key:e,change:i.change});return!0},beforeUpdate(i,n){t||(t=e());for(const e in t){if("changes"===e)throw new Ve('property name "changes" is reserved for change tracking');n[e]=t[e].read(i)}}}}function Or(e){return new Pr(e)}class Pr extends Qs{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}}function Fr(e,t,i=Ks.ofCaller()){return new Br("string"==typeof e?e:new $o(e,void 0,void 0),t,i)}class Br extends Xs{constructor(e,t,i){super(i),this.event=t,this.handleEvent=()=>{Vs((e=>{for(const t of this._observers)e.updateObserver(t,this),t.handleChange(this,void 0)}),(()=>this.debugName))},this.debugName="string"==typeof e?e:e.getDebugName(this)??"Observable Signal From Event"}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function Wr(e,t){let i,n=!0;return function(e,t){const i=new Mt,n=dr({owner:e.owner,debugName:e.debugName,debugReferenceFn:e.debugReferenceFn??t,changeTracker:e.changeTracker},((e,n)=>{i.clear(),t(e,n)}));return Tt((()=>{n.dispose(),i.dispose()}))}({changeTracker:{createChangeSummary:()=>({deltas:[],didChange:!1}),handleChange:(t,i)=>{if(t.didChange(e)){const e=t.change;void 0!==e&&i.deltas.push(e),i.didChange=!0}return!0}}},((o,s)=>{const r=e.read(o),a=i;s.didChange&&(i=r,t(r,a,s.deltas)),n&&(n=!1,i=r)}))}function Vr(e,t){const i=new Mt,n=Wr(e,((e,n,o)=>{i.clear(),t(e,n,o,i)}));return{dispose(){n.dispose(),i.dispose()}}}class Hr{constructor(){this.indentation=0,this.changedObservablesSets=new WeakMap}addFilteredObj(e){this._filteredObjects||(this._filteredObjects=new Set),this._filteredObjects.add(e)}_isIncluded(e){return this._filteredObjects?.has(e)??!0}textToConsoleArgs(e){return function(e){const t=new Array,i=[];let n="";!function e(n){if("length"in n)for(const t of n)t&&e(t);else"text"in n?(`%c${n.text}`,t.push(n.style),n.data&&i.push(...n.data)):"data"in n&&i.push(...n.data)}(e);const o=[n,...t];return o.push(...i),o}([zr(qr("| ",this.indentation)),e])}formatInfo(e){return e.hadValue?e.didChange?[zr(" "),Kr(jr(e.oldValue,70),{color:"red",strikeThrough:!0}),zr(" "),Kr(jr(e.newValue,60),{color:"green"})]:[zr(" (unchanged)")]:[zr(" "),Kr(jr(e.newValue,60),{color:"green"}),zr(" (initial)")]}handleObservableCreated(e){if(e instanceof ur){const t=e;this.changedObservablesSets.set(t,new Set)}}handleOnListenerCountChanged(e,t){}handleObservableUpdated(e,t){this._isIncluded(e)&&(e instanceof ur?this._handleDerivedRecomputed(e,t):console.log(...this.textToConsoleArgs([Ur("observable value changed"),Kr(e.debugName,{color:"BlueViolet"}),...this.formatInfo(t)])))}formatChanges(e){if(0!==e.size)return Kr(" (changed deps: "+[...e].map((e=>e.debugName)).join(", ")+")",{color:"gray"})}handleDerivedDependencyChanged(e,t,i){this._isIncluded(e)&&this.changedObservablesSets.get(e)?.add(t)}_handleDerivedRecomputed(e,t){if(!this._isIncluded(e))return;const i=this.changedObservablesSets.get(e);i&&(console.log(...this.textToConsoleArgs([Ur("derived recomputed"),Kr(e.debugName,{color:"BlueViolet"}),...this.formatInfo(t),this.formatChanges(i),{data:[{fn:e._debugNameData.referenceFn??e._computeFn}]}])),i.clear())}handleDerivedCleared(e){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Ur("derived cleared"),Kr(e.debugName,{color:"BlueViolet"})]))}handleAutorunCreated(e){this._isIncluded(e)&&this.changedObservablesSets.set(e,new Set)}handleAutorunDisposed(e){}handleAutorunDependencyChanged(e,t,i){this._isIncluded(e)&&this.changedObservablesSets.get(e).add(t)}handleAutorunStarted(e){const t=this.changedObservablesSets.get(e);t&&(this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Ur("autorun"),Kr(e.debugName,{color:"BlueViolet"}),this.formatChanges(t),{data:[{fn:e._debugNameData.referenceFn??e._runFn}]}])),t.clear(),this.indentation++)}handleAutorunFinished(e){this.indentation--}handleBeginTransaction(e){let t=e.getDebugName();void 0===t&&"",this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Ur("transaction"),Kr(t,{color:"BlueViolet"}),{data:[{fn:e._fn}]}])),this.indentation++}handleEndTransaction(){this.indentation--}}function zr(e){return Kr(e,{color:"black"})}function Ur(e){return Kr(function(e){for(;e.length<10;)0;return e}(`${e}: `),{color:"black",bold:!0})}function Kr(e,t={color:"black"}){const i={color:t.color};return t.strikeThrough&&(i["text-decoration"]="line-through"),t.bold&&(i["font-weight"]="bold"),{text:e,style:Object.entries(n).reduce(((e,[t,i])=>`${e}${t}:${i};`),"")};var n}function jr(e,t){switch(typeof e){case"number":default:return""+e;case"string":return e.length+2<=t?`"${e}"`:`"${e.substr(0,t-7)}"+...`;case"boolean":return e?"true":"false";case"undefined":return"undefined";case"object":return null===e?"null":Array.isArray(e)?function(e,t){let i="[ ",n=!0;for(const o of e){if(n||(i+=", "),i.length-5>t){i+="...";break}n=!1,i+=`${jr(o,t-i.length)}`}return i+=" ]",i}(e,t):function(e,t){if("function"==typeof e.toString&&e.toString!==Object.prototype.toString){const i=e.toString();return i.length<=t?i:i.substring(0,t-3)+"..."}const i=Xo(e);let n=i?i+"(":"{ ",o=!0;for(const[i,s]of Object.entries(e)){if(o||(n+=", "),n.length-5>t){n+="...";break}o=!1,n+=`${i}: ${jr(s,t-n.length)}`}return n+=i?")":" }",n}(e,t);case"symbol":return e.toString();case"function":return`[[Function${e.name?" "+e.name:""}]]`}}function qr(e,t){let i="";for(let e=1;e<=t;e++)0;return i}class $r{static createClient(e,t){return new $r(e,t)}constructor(e,t){this._channelFactory=e,this._getHandler=t,this._channel=this._channelFactory({handleNotification:e=>{const t=e,i=this._getHandler().notifications[t[0]];if(!i)throw new Error(`Unknown notification "${t[0]}"!`);i(...t[1])},handleRequest:e=>{const t=e;try{return{type:"result",value:this._getHandler().requests[t[0]](...t[1])}}catch(e){return{type:"error",value:e}}}});const i=new Proxy({},{get:(e,t)=>async(...e)=>{const i=await this._channel.sendRequest([t,e]);if("error"===i.type)throw i.value;return i.value}}),n=new Proxy({},{get:(e,t)=>(...e)=>{this._channel.sendNotification([t,e])}});this.api={notifications:n,requests:i}}}class Gr{constructor(){this._timeout=void 0}throttle(e,t){void 0===this._timeout&&(this._timeout=setTimeout((()=>{this._timeout=void 0,e()}),t))}dispose(){void 0!==this._timeout&&clearTimeout(this._timeout)}}function Zr(e,t){for(const i in t)e[i]&&"object"==typeof e[i]&&t[i]&&"object"==typeof t[i]?Zr(e[i],t[i]):e[i]=t[i]}function Yr(e,t){for(const i in t)null===t[i]?delete e[i]:e[i]&&"object"==typeof e[i]&&t[i]&&"object"==typeof t[i]?Yr(e[i],t[i]):e[i]=t[i]}class Qr{static{this._instance=void 0}static getInstance(){return void 0===Qr._instance&&(Qr._instance=new Qr),Qr._instance}getTransactionState(){const e=[],t=[...this._activeTransactions];if(0===t.length)return;const i=t.flatMap((e=>e.debugGetUpdatingObservers()??[])).map((e=>e.observer)),n=new Set;for(;i.length>0;){const t=i.shift();if(n.has(t))continue;n.add(t);const o=this._getInfo(t,(e=>{n.has(e)||i.push(e)}));o&&e.push(o)}return{names:t.map((e=>e.getDebugName()??"tx")),affected:e}}_getObservableInfo(e){const t=this._instanceInfos.get(e);if(t)return t;Ie(new Ve("No info found"))}_getAutorunInfo(e){const t=this._instanceInfos.get(e);if(t)return t;Ie(new Ve("No info found"))}_getInfo(e,t){if(e instanceof ur){const i=[...e.debugGetObservers()];for(const e of i)t(e);const n=this._getObservableInfo(e);if(!n)return;const o=e.debugGetState(),s={name:e.debugName,instanceId:n.instanceId,updateCount:o.updateCount},r=[...n.changedObservables].map((e=>this._instanceInfos.get(e)?.instanceId)).filter(mt);if(o.isComputing)return{...s,type:"observable/derived",state:"updating",changedDependencies:r,initialComputation:!1};switch(o.state){case 0:return{...s,type:"observable/derived",state:"noValue"};case 3:return{...s,type:"observable/derived",state:"upToDate"};case 2:return{...s,type:"observable/derived",state:"stale",changedDependencies:r};case 1:return{...s,type:"observable/derived",state:"possiblyStale"}}}else if(e instanceof rr){const t=this._getAutorunInfo(e);if(!t)return;const i={name:e.debugName,instanceId:t.instanceId,updateCount:t.updateCount},n=[...t.changedObservables].map((e=>this._instanceInfos.get(e).instanceId));if(e.debugGetState().isRunning)return{...i,type:"autorun",state:"updating",changedDependencies:n};switch(e.debugGetState().state){case 3:return{...i,type:"autorun",state:"upToDate"};case 2:return{...i,type:"autorun",state:"stale",changedDependencies:n};case 1:return{...i,type:"autorun",state:"possiblyStale"}}}}_formatObservable(e){const t=this._getObservableInfo(e);if(t)return{name:e.debugName,instanceId:t.instanceId}}_formatObserver(e){if(e instanceof ur)return{name:e.toString(),instanceId:this._getObservableInfo(e)?.instanceId};const t=this._getAutorunInfo(e);return t?{name:e.toString(),instanceId:t.instanceId}:void 0}constructor(){this._declarationId=0,this._instanceId=0,this._declarations=new Map,this._instanceInfos=new WeakMap,this._aliveInstances=new Map,this._activeTransactions=new Set,this._channel=function(e,t){const i=globalThis;let n,o=[];const{channel:s,handler:r}=function(e){let t;return{channel:i=>(t=i,{sendNotification:t=>{e.sendNotification(t)},sendRequest:e=>{throw new Error("not supported")}}),handler:{handleRequest:e=>"notification"===e.type?t?.handleNotification(e.data):t?.handleRequest(e.data)}}}({sendNotification:e=>{n?n.sendNotification(e):o.push(e)}});let a;return(i.$$debugValueEditor_debugChannels??(i.$$debugValueEditor_debugChannels={}))[e]=e=>{a=t(),n=e;for(const t of o)e.sendNotification(t);return o=[],r},$r.createClient(s,(()=>{if(!a)throw new Error("Not supported");return a}))}("observableDevTools",(()=>({notifications:{setDeclarationIdFilter:e=>{},logObservableValue:e=>{console.log("logObservableValue",e)},flushUpdates:()=>{this._flushUpdates()},resetUpdates:()=>{this._pendingChanges=null,this._channel.api.notifications.handleChange(this._fullState,!0)}},requests:{getDeclarations:()=>{const e={};for(const t of this._declarations.values())e[t.id]=t;return{decls:e}},getSummarizedInstances:()=>null,getObservableValueInfo:e=>({observers:[...this._aliveInstances.get(e).debugGetObservers()].map((e=>this._formatObserver(e))).filter(mt)}),getDerivedInfo:e=>{const t=this._aliveInstances.get(e);return{dependencies:[...t.debugGetState().dependencies].map((e=>this._formatObservable(e))).filter(mt),observers:[...t.debugGetObservers()].map((e=>this._formatObserver(e))).filter(mt)}},getAutorunInfo:e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map((e=>this._formatObservable(e))).filter(mt)}),getTransactionState:()=>this.getTransactionState(),setValue:(e,t)=>{const i=this._aliveInstances.get(e);if(i instanceof ur)i.debugSetValue(t);else if(i instanceof er)i.debugSetValue(t);else{if(!(i instanceof kr))throw new Ve("Observable is not supported");i.debugSetValue(t)}const n=[...i.debugGetObservers()];for(const e of n)e.beginUpdate(i);for(const e of n)e.handleChange(i,void 0);for(const e of n)e.endUpdate(i)},getValue:e=>{const t=this._aliveInstances.get(e);return t instanceof ur||t instanceof er?jr(t.debugGetState().value,200):void 0},logValue:e=>{const t=this._aliveInstances.get(e);if(!t||!("get"in t))throw new Ve("Observable is not supported");console.log("Logged Value:",t.get())},rerun:e=>{const t=this._aliveInstances.get(e);if(t instanceof ur)t.debugRecompute();else{if(!(t instanceof rr))throw new Ve("Observable is not supported");t.debugRerun()}}}}))),this._pendingChanges=null,this._changeThrottler=new Gr,this._fullState={},this._flushUpdates=()=>{null!==this._pendingChanges&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)},Ks.enable()}_handleChange(e){Yr(this._fullState,e),null===this._pendingChanges?this._pendingChanges=e:Zr(this._pendingChanges,e),this._changeThrottler.throttle(this._flushUpdates,10)}_getDeclarationId(e,t){if(!t)return-1;let i=this._declarations.get(t.id);return void 0===i&&(i={id:this._declarationId++,type:e,url:t.fileName,line:t.line,column:t.column},this._declarations.set(t.id,i),this._handleChange({decls:{[i.id]:i}})),i.id}handleObservableCreated(e,t){const i={declarationId:this._getDeclarationId("observable/value",t),instanceId:this._instanceId++,listenerCount:0,lastValue:void 0,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,i)}handleOnListenerCountChanged(e,t){const i=this._getObservableInfo(e);if(i){if(0===i.listenerCount&&t>0){const t=e instanceof ur?"observable/derived":"observable/value";this._aliveInstances.set(i.instanceId,e),this._handleChange({instances:{[i.instanceId]:{instanceId:i.instanceId,declarationId:i.declarationId,formattedValue:i.lastValue,type:t,name:e.debugName}}})}else i.listenerCount>0&&0===t&&(this._handleChange({instances:{[i.instanceId]:null}}),this._aliveInstances.delete(i.instanceId));i.listenerCount=t}}handleObservableUpdated(e,t){if(e instanceof ur)return void this._handleDerivedRecomputed(e,t);const i=this._getObservableInfo(e);i&&t.didChange&&(i.lastValue=jr(t.newValue,30),i.listenerCount>0&&this._handleChange({instances:{[i.instanceId]:{formattedValue:i.lastValue}}}))}handleAutorunCreated(e,t){const i={declarationId:this._getDeclarationId("autorun",t),instanceId:this._instanceId++,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,i),this._aliveInstances.set(i.instanceId,e),i&&this._handleChange({instances:{[i.instanceId]:{instanceId:i.instanceId,declarationId:i.declarationId,runCount:0,type:"autorun",name:e.debugName}}})}handleAutorunDisposed(e){const t=this._getAutorunInfo(e);t&&(this._handleChange({instances:{[t.instanceId]:null}}),this._instanceInfos.delete(e),this._aliveInstances.delete(t.instanceId))}handleAutorunDependencyChanged(e,t,i){const n=this._getAutorunInfo(e);n&&n.changedObservables.add(t)}handleAutorunStarted(e){}handleAutorunFinished(e){const t=this._getAutorunInfo(e);t&&(t.changedObservables.clear(),t.updateCount++,this._handleChange({instances:{[t.instanceId]:{runCount:t.updateCount}}}))}handleDerivedDependencyChanged(e,t,i){const n=this._getObservableInfo(e);n&&n.changedObservables.add(t)}_handleDerivedRecomputed(e,t){const i=this._getObservableInfo(e);if(!i)return;const n=jr(t.newValue,30);i.updateCount++,i.changedObservables.clear(),i.lastValue=n,i.listenerCount>0&&this._handleChange({instances:{[i.instanceId]:{formattedValue:n,recomputationCount:i.updateCount}}})}handleDerivedCleared(e){const t=this._getObservableInfo(e);t&&(t.lastValue=void 0,t.changedObservables.clear(),t.listenerCount>0&&this._handleChange({instances:{[t.instanceId]:{formattedValue:void 0}}}))}handleBeginTransaction(e){this._activeTransactions.add(e)}handleEndTransaction(e){this._activeTransactions.delete(e)}}function Xr(e,t,i){const n="\t\t".repeat(t),o=[];if(i.has(e.sourceObj))return o.push(`${n}* ${e.type} ${e.name} (already listed)`),o.join("\n");if(i.add(e.sourceObj),o.push(`${n}* ${e.type} ${e.name}:`),o.push(`${n} value: ${jr(e.value,50)}`),o.push(`${n} state: ${e.state}`),e.dependencies.length>0){o.push(`${n} dependencies:`);for(const n of e.dependencies)o.push(Xr(n,t+1,i))}return o.join("\n")}class Jr{static from(e,t){if(e instanceof rr){const i=e.debugGetState();return new Jr(e,t(e.debugName),"autorun",void 0,i.stateStr,Array.from(i.dependencies).map((e=>Jr.from(e,t)||Jr.unknown(e))))}if(e instanceof ur){const i=e.debugGetState();return new Jr(e,t(e.debugName),"derived",i.value,i.stateStr,Array.from(i.dependencies).map((e=>Jr.from(e,t)||Jr.unknown(e))))}if(e instanceof er){const i=e.debugGetState();return new Jr(e,t(e.debugName),"observableValue",i.value,"upToDate",[])}if(e instanceof kr){const i=e.debugGetState();return new Jr(e,t(e.debugName),"fromEvent",i.value,i.hasValue?"upToDate":"initial",[])}}static unknown(e){return new Jr(e,"(unknown)","unknown",void 0,"unknown",[])}constructor(e,t,i,n,o,s){this.sourceObj=e,this.name=t,this.type=i,this.value=n,this.state=o,this.dependencies=s}}Zs=function(e,t){const i=t?.debugNamePostProcessor??(e=>e),n=Jr.from(e,i);return n?Xr(n,0,new Set).trim():""},On&&On.VSCODE_DEV_DEBUG_OBSERVABLES&&Os(Qr.getInstance());const{registerWindow:ea,getWindow:ta,getDocument:ia,getWindows:na,getWindowsCount:oa,getWindowId:sa,getWindowById:ra,hasWindow:aa,onDidRegisterWindow:la,onWillUnregisterWindow:da,onDidUnregisterWindow:ha}=function(){const e=new Map;!function(e){const t=e;"number"!=typeof t.vscodeWindowId&&Object.defineProperty(t,"vscodeWindowId",{get:()=>1})}(r);const t={window:r,disposables:new Mt};e.set(r.vscodeWindowId,t);const i=new Zt,n=new Zt,o=new Zt;return{onDidRegisterWindow:i.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:n.event,registerWindow(t){if(e.has(t.vscodeWindowId))return At.None;const s=new Mt,r={window:t,disposables:s.add(new Mt)};return e.set(t.vscodeWindowId,r),s.add(Tt((()=>{e.delete(t.vscodeWindowId),n.fire(t)}))),s.add(ga(t,Qa.BEFORE_UNLOAD,(()=>{o.fire(t)}))),i.fire(r),s},getWindows:()=>e.values(),getWindowsCount:()=>e.size,getWindowId:e=>e.vscodeWindowId,hasWindow:t=>e.has(t),getWindowById:function(i,n){return("number"==typeof i?e.get(i):void 0)??(n?t:void 0)},getWindow(e){const t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;const i=e;return i?.view?i.view.window:r},getDocument:e=>ta(e).document}}();function ca(e){for(;e.firstChild;)e.firstChild.remove()}class ua{constructor(e,t,i,n){this._node=e,this._type=t,this._handler=i,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function ga(e,t,i,n){return new ua(e,t,i,n)}function pa(e,t){return function(i){return t(new Je(e,i))}}const ma=function(e,t,i,n){let o=i;return"click"===t||"mousedown"===t||"contextmenu"===t?o=pa(ta(e),i):"keydown"!==t&&"keypress"!==t&&"keyup"!==t||(o=function(e){return function(t){return e(new Ze(t))}}(i)),ga(e,t,o,n)};function fa(e,t,i){return ga(e,X&&pe?Qa.POINTER_DOWN:Qa.MOUSE_DOWN,t,i)}function _a(e,t,i){return ga(e,X&&pe?Qa.POINTER_UP:Qa.MOUSE_UP,t,i)}function va(e,t,i){return Si(e,t,i)}class ba extends xi{constructor(e,t){super(e,t)}}let wa,Ca;class ya extends wi{constructor(e){super(),this.defaultTarget=e&&ta(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}}class Sa{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Ie(e)}}static sort(e,t){return t.priority-e.priority}}function xa(e){return ta(e).getComputedStyle(e,null)}function ka(e,t,i){const n=ta(e),o=n.document;if(e!==o.body)return new Da(e.clientWidth,e.clientHeight);if(X&&n?.visualViewport)return new Da(n.visualViewport.width,n.visualViewport.height);if(n?.innerWidth&&n.innerHeight)return new Da(n.innerWidth,n.innerHeight);if(o.body&&o.body.clientWidth&&o.body.clientHeight)return new Da(o.body.clientWidth,o.body.clientHeight);if(o.documentElement&&o.documentElement.clientWidth&&o.documentElement.clientHeight)return new Da(o.documentElement.clientWidth,o.documentElement.clientHeight);if(i)return ka(i,t);if(t)return t;throw new Error("Unable to figure out browser width and height")}!function(){const e=new Map,t=new Map,i=new Map,n=new Map;Ca=(o,s,r=0)=>{const a=sa(o),l=new Sa(s,r);let d=e.get(a);return d||(d=[],e.set(a,d)),d.push(l),i.get(a)||(i.set(a,!0),o.requestAnimationFrame((()=>(o=>{i.set(o,!1);const s=e.get(o)??[];for(t.set(o,s),e.set(o,[]),n.set(o,!0);s.length>0;)s.sort(Sa.sort),s.shift().execute();n.set(o,!1)})(a)))),l},wa=(e,i,o)=>{const s=sa(e);if(n.get(s)){const e=new Sa(i,o);let n=t.get(s);return n||(n=[],t.set(s,n)),n.push(e),e}return Ca(e,i,o)}}();class La{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t){const i=xa(e),n=i?i.getPropertyValue(t):"0";return La.convertToPixels(e,n)}static getBorderLeftWidth(e){return La.getDimension(e,"border-left-width")}static getBorderRightWidth(e){return La.getDimension(e,"border-right-width")}static getBorderTopWidth(e){return La.getDimension(e,"border-top-width")}static getBorderBottomWidth(e){return La.getDimension(e,"border-bottom-width")}static getPaddingLeft(e){return La.getDimension(e,"padding-left")}static getPaddingRight(e){return La.getDimension(e,"padding-right")}static getPaddingTop(e){return La.getDimension(e,"padding-top")}static getPaddingBottom(e){return La.getDimension(e,"padding-bottom")}static getMarginLeft(e){return La.getDimension(e,"margin-left")}static getMarginTop(e){return La.getDimension(e,"margin-top")}static getMarginRight(e){return La.getDimension(e,"margin-right")}static getMarginBottom(e){return La.getDimension(e,"margin-bottom")}}class Da{static{this.None=new Da(0,0)}constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new Da(e,t):this}static is(e){return"object"==typeof e&&"number"==typeof e.height&&"number"==typeof e.width}static lift(e){return e instanceof Da?e:new Da(e.width,e.height)}static equals(e,t){return e===t||!(!e||!t)&&e.width===t.width&&e.height===t.height}}function Ea(e){let t=e.offsetParent,i=e.offsetTop,n=e.offsetLeft;for(;null!==(e=e.parentNode)&&e!==e.ownerDocument.body&&e!==e.ownerDocument.documentElement;){i-=e.scrollTop;const o=Fa(e)?null:xa(e);o&&(n-="rtl"!==o.direction?e.scrollLeft:-e.scrollLeft),e===t&&(n+=La.getBorderLeftWidth(e),i+=La.getBorderTopWidth(e),i+=e.offsetTop,n+=e.offsetLeft,t=e.offsetParent)}return{left:n,top:i}}function Na(e){const t=e.getBoundingClientRect(),i=ta(e);return{left:t.left+i.scrollX,top:t.top+i.scrollY,width:t.width,height:t.height}}function Ia(e){let t=e,i=1;do{const e=xa(t).zoom;null!=e&&"1"!==e&&(i*=e),t=t.parentElement}while(null!==t&&t!==t.ownerDocument.documentElement);return i}function Ta(e){const t=La.getMarginLeft(e)+La.getMarginRight(e);return e.offsetWidth+t}function Ma(e){const t=La.getBorderLeftWidth(e)+La.getBorderRightWidth(e),i=La.getPaddingLeft(e)+La.getPaddingRight(e);return e.offsetWidth-t-i}function Aa(e){const t=La.getBorderTopWidth(e)+La.getBorderBottomWidth(e),i=La.getPaddingTop(e)+La.getPaddingBottom(e);return e.offsetHeight-t-i}function Ra(e){const t=La.getMarginTop(e)+La.getMarginBottom(e);return e.offsetHeight+t}function Oa(e,t){return Boolean(t?.contains(e))}function Pa(e,t,i){return!!function(e,t,i){for(;e&&e.nodeType===e.ELEMENT_NODE;){if(e.classList.contains(t))return e;if(i)if("string"==typeof i){if(e.classList.contains(i))return null}else if(e===i)return null;e=e.parentNode}return null}(e,t,i)}function Fa(e){return e&&!!e.host&&!!e.mode}function Ba(e){return!!Wa(e)}function Wa(e){for(;e.parentNode;){if(e===e.ownerDocument?.body)return null;e=e.parentNode}return Fa(e)?e:null}function Va(){let e=Ua().activeElement;for(;e?.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Ha(e){return Va()===e}function za(e){return Oa(Va(),e)}function Ua(){return oa()<=1?r.document:Array.from(na()).map((({window:e})=>e.document)).find((e=>e.hasFocus()))??r.document}function Ka(){const e=Ua();return e.defaultView?.window??r}const ja=new class{constructor(){this.mutationObservers=new Map}observe(e,t,i){let n=this.mutationObservers.get(e);n||(n=new Map,this.mutationObservers.set(e,n));const o=Vo(i);let s=n.get(o);if(s)s.users+=1;else{const r=new Zt,a=new MutationObserver((e=>r.fire(e)));a.observe(e,i);const l=s={users:1,observer:a,onDidMutate:r.event};t.add(Tt((()=>{l.users-=1,0===l.users&&(r.dispose(),a.disconnect(),n?.delete(o),0===n?.size&&this.mutationObservers.delete(e))}))),n.set(o,s)}return s.onDidMutate}};function qa(e){return e instanceof HTMLElement||e instanceof ta(e).HTMLElement}function $a(e){return e instanceof HTMLAnchorElement||e instanceof ta(e).HTMLAnchorElement}function Ga(e){return e instanceof SVGElement||e instanceof ta(e).SVGElement}function Za(e){return e instanceof MouseEvent||e instanceof ta(e).MouseEvent}function Ya(e){return e instanceof KeyboardEvent||e instanceof ta(e).KeyboardEvent}const Qa={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:u?"webkitAnimationStart":"animationstart",ANIMATION_END:u?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:u?"webkitAnimationIteration":"animationiteration"};function Xa(e){const t=e;return!(!t||"function"!=typeof t.preventDefault||"function"!=typeof t.stopPropagation)}const Ja=(e,t)=>(e.preventDefault(),t&&e.stopPropagation(),e);class el extends At{get onDidFocus(){return this._onDidFocus.event}get onDidBlur(){return this._onDidBlur.event}static hasFocusWithin(e){if(qa(e)){const t=Wa(e);return Oa(t?t.activeElement:e.ownerDocument.activeElement,e)}{const t=e;return Oa(t.document.activeElement,t.document)}}constructor(e){super(),this._onDidFocus=this._register(new Zt),this._onDidBlur=this._register(new Zt);let t=el.hasFocusWithin(e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,(qa(e)?ta(e):e).setTimeout((()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())}),0))};this._refreshStateHandler=()=>{el.hasFocusWithin(e)!==t&&(t?o():n())},this._register(ga(e,Qa.FOCUS,n,!0)),this._register(ga(e,Qa.BLUR,o,!0)),qa(e)&&(this._register(ga(e,Qa.FOCUS_IN,(()=>this._refreshStateHandler()))),this._register(ga(e,Qa.FOCUS_OUT,(()=>this._refreshStateHandler()))))}}function tl(e){return new el(e)}function il(e,...t){if(e.append(...t),1===t.length&&"string"!=typeof t[0])return t[0]}function nl(e,t){return e.insertBefore(t,e.firstChild),t}function ol(e,...t){e.textContent="",il(e,...t)}const sl=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var rl;function al(e,t,i,...n){const o=sl.exec(t);if(!o)throw new Error("Bad use of emmet");const s=o[1]||"div";let r;return r=e!==rl.HTML?document.createElementNS(e,s):document.createElement(s),o[3]&&(r.id=o[3]),o[4]&&(r.className=o[4].replace(/\./g," ").trim()),i&&Object.entries(i).forEach((([e,t])=>{void 0!==t&&(/^on\w+$/.test(e)?r[e]=t:"selected"===e?t&&r.setAttribute(e,"true"):r.setAttribute(e,t))})),r.append(...n),r}function ll(e,t,...i){return al(rl.HTML,e,t,...i)}function dl(...e){for(const t of e)t.style.display="",t.removeAttribute("aria-hidden")}function hl(...e){for(const t of e)t.style.display="none",t.setAttribute("aria-hidden","true")}function cl(e,t){const i=e.devicePixelRatio*t;return Math.max(1,Math.floor(i))/e.devicePixelRatio}function ul(e){r.open(e,"_blank","noopener")}!function(e){e.HTML="http://www.w3.org/1999/xhtml",e.SVG="http://www.w3.org/2000/svg"}(rl||(rl={})),ll.SVG=function(e,t,...i){return al(rl.SVG,e,t,...i)},Lo.setPreferredWebSchema(/^https:/.test(r.location.href)?"https":"http");class gl extends Zt{constructor(){super(),this._subscriptions=new Mt,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(zt.runAndSubscribe(la,(({window:e,disposables:t})=>this.registerListeners(e,t)),{window:r,disposables:this._subscriptions}))}registerListeners(e,t){t.add(ga(e,"keydown",(e=>{if(e.defaultPrevented)return;const t=new Ze(e);if(6!==t.keyCode||!e.repeat){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else{if(6===t.keyCode)return;this._keyStatus.lastKeyPressed=void 0}this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}}),!0)),t.add(ga(e,"keyup",(e=>{e.defaultPrevented||(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))}),!0)),t.add(ga(e.document.body,"mousedown",(()=>{this._keyStatus.lastKeyPressed=void 0}),!0)),t.add(ga(e.document.body,"mouseup",(()=>{this._keyStatus.lastKeyPressed=void 0}),!0)),t.add(ga(e.document.body,"mousemove",(e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)}),!0)),t.add(ga(e,"blur",(()=>{this.resetKeyStatus()})))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return gl.instance||(gl.instance=new gl),gl.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class pl extends At{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(ga(this.element,Qa.DRAG_START,(e=>{this.callbacks.onDragStart?.(e)}))),this.callbacks.onDrag&&this._register(ga(this.element,Qa.DRAG,(e=>{this.callbacks.onDrag?.(e)}))),this._register(ga(this.element,Qa.DRAG_ENTER,(e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter?.(e)}))),this._register(ga(this.element,Qa.DRAG_OVER,(e=>{e.preventDefault(),this.callbacks.onDragOver?.(e,e.timeStamp-this.dragStartTime)}))),this._register(ga(this.element,Qa.DRAG_LEAVE,(e=>{this.counter--,0===this.counter&&(this.dragStartTime=0,this.callbacks.onDragLeave?.(e))}))),this._register(ga(this.element,Qa.DRAG_END,(e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd?.(e)}))),this._register(ga(this.element,Qa.DROP,(e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop?.(e)})))}}const ml=/(?<tag>[\w\-]+)?(?:#(?<id>[\w\-]+))?(?<class>(?:\.(?:[\w\-]+))*)(?:@(?<name>(?:[\w\_])+))?/;function fl(e,...t){let i,n;Array.isArray(t[0])?(i={},n=t[0]):(i=t[0]||{},n=t[1]);const o=ml.exec(e);if(!o||!o.groups)throw new Error("Bad use of h");const s=o.groups.tag||"div",r=document.createElement(s);o.groups.id&&(r.id=o.groups.id);const a=[];if(o.groups.class)for(const e of o.groups.class.split("."))""!==e&&a.push(e);if(void 0!==i.className)for(const e of i.className.split("."))""!==e&&a.push(e);a.length>0&&(r.className=a.join(" "));const l={};if(o.groups.name&&(l[o.groups.name]=r),n)for(const e of n)qa(e)?r.appendChild(e):"string"==typeof e?r.append(e):"root"in e&&(Object.assign(l,e),r.appendChild(e.root));for(const[e,t]of Object.entries(i))if("className"!==e)if("style"===e)for(const[e,i]of Object.entries(t))r.style.setProperty(_l(e),"number"==typeof i?i+"px":""+i);else"tabIndex"===e?r.tabIndex=t:r.setAttribute(_l(e),t.toString());return l.root=r,l}function _l(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function vl(e){return"input"===e.tagName.toLowerCase()||"textarea"===e.tagName.toLowerCase()||qa(e)&&!!e.editContext}var bl;!function(e){function t(e=void 0){return(t,i,n)=>{const o=i.class;delete i.class;const s=i.ref;delete i.ref;const r=i.obsRef;return delete i.obsRef,new El(t,s,r,e,o,i,n)}}function i(e,i=void 0){const n=t(i);return(t,i)=>n(e,t,i)}e.div=i("div"),e.elem=t(void 0),e.svg=i("svg","http://www.w3.org/2000/svg"),e.svgElem=t("http://www.w3.org/2000/svg"),e.ref=function(){let e;const t=function(t){e=t};return Object.defineProperty(t,"element",{get(){if(!e)throw new Ve("Make sure the ref is set before accessing the element. Maybe wrong initialization order?");return e}}),t}}(bl||(bl={}));class wl{constructor(e,t,i,n,o,s,r){this._deriveds=[],this._element=n?document.createElementNS(n,e):document.createElement(e),t&&t(this._element),i&&this._deriveds.push(pr((e=>{i(this),e.store.add({dispose:()=>{i(null)}})}))),o&&(xl(o)?this._deriveds.push(pr(this,(e=>{Cl(this._element,Sl(o,e))}))):Cl(this._element,Sl(o,void 0)));for(const[a,l]of Object.entries(s))if("style"===a)for(const[d,h]of Object.entries(l)){const c=_l(d);Il(h)?this._deriveds.push(fr({owner:this,debugName:()=>`set.style.${c}`},(e=>{this._element.style.setProperty(c,kl(h.read(e)))}))):this._element.style.setProperty(c,kl(h))}else"tabIndex"===a?Il(l)?this._deriveds.push(pr(this,(e=>{this._element.tabIndex=l.read(e)}))):this._element.tabIndex=l:a.startsWith("on")?this._element[a]=l:Il(l)?this._deriveds.push(fr({owner:this,debugName:()=>`set.${a}`},(e=>{Nl(this._element,a,l.read(e))}))):Nl(this._element,a,l);if(r){function u(e,t){return Il(t)?u(e,t.read(e)):Array.isArray(t)?t.flatMap((t=>u(e,t))):t instanceof wl?(e&&t.readEffect(e),[t._element]):t?[t]:[]}const g=pr(this,(e=>{this._element.replaceChildren(...u(e,r))}));this._deriveds.push(g),Ll(r)||g.get()}}readEffect(e){for(const t of this._deriveds)t.read(e)}keepUpdated(e){return pr((e=>{this.readEffect(e)})).recomputeInitiallyAndOnChange(e),this}toDisposableLiveElement(){const e=new Mt;return this.keepUpdated(e),new Dl(this._element,e)}}function Cl(e,t){Ga(e)?e.setAttribute("class",t):e.className=t}function yl(e,t,i){if(Il(e))i(e.read(t));else if(Array.isArray(e))for(const n of e)yl(n,t,i);else i(e)}function Sl(e,t){let i="";return yl(e,t,(e=>{e&&(0===i.length?i=e:i+=" "+e)})),i}function xl(e){return!!Il(e)||!!Array.isArray(e)&&e.some((e=>xl(e)))}function kl(e){return"number"==typeof e?e+"px":e}function Ll(e){return!!Il(e)||!!Array.isArray(e)&&e.some((e=>Ll(e)))}class Dl{constructor(e,t){this.element=e,this._disposable=t}dispose(){this._disposable.dispose()}}class El extends wl{constructor(){super(...arguments),this._isHovered=void 0,this._didMouseMoveDuringHover=void 0}get element(){return this._element}get isHovered(){if(!this._isHovered){const e=Js("hovered",!1);this._element.addEventListener("mouseenter",(t=>e.set(!0,void 0))),this._element.addEventListener("mouseleave",(t=>e.set(!1,void 0))),this._isHovered=e}return this._isHovered}get didMouseMoveDuringHover(){if(!this._didMouseMoveDuringHover){let e=!1;const t=Js("didMouseMoveDuringHover",!1);this._element.addEventListener("mouseenter",(t=>{e=!0})),this._element.addEventListener("mousemove",(i=>{e&&t.set(!0,void 0)})),this._element.addEventListener("mouseleave",(i=>{e=!1,t.set(!1,void 0)})),this._didMouseMoveDuringHover=t}return this._didMouseMoveDuringHover}}function Nl(e,t,i){null==i?e.removeAttribute(_l(t)):e.setAttribute(_l(t),String(i))}function Il(e){return!!e&&void 0!==e.read&&void 0!==e.reportChanges}var Tl=i(5072),Ml=i.n(Tl),Al=i(7825),Rl=i.n(Al),Ol=i(7659),Pl=i.n(Ol),Fl=i(5056),Bl=i.n(Fl),Wl=i(540),Vl=i.n(Wl),Hl=i(1113),zl=i.n(Hl),Ul=i(5038),Kl={};let jl,ql,$l,Gl,Zl;function Yl(e){jl&&(ql.textContent!==e?(ca($l),Xl(ql,e)):(ca(ql),Xl($l,e)))}function Ql(e){jl&&(Gl.textContent!==e?(ca(Zl),Xl(Gl,e)):(ca(Gl),Xl(Zl,e)))}function Xl(e,t){ca(e),t.length>2e4&&(t=t.substr(0,2e4)),e.textContent=t,e.style.visibility="hidden",e.style.visibility="visible"}var Jl,ed,td;Kl.styleTagTransform=zl(),Kl.setAttributes=Bl(),Kl.insert=Pl().bind(null,"head"),Kl.domAPI=Rl(),Kl.insertStyleElement=Vl(),Ml()(Ul.A,Kl),Ul.A&&Ul.A.locals&&Ul.A.locals;class id{constructor(e,t){this.uri=e,this.value=t}}class nd{static{this.defaultToKey=e=>e.toString()}constructor(e,t){if(this[Jl]="ResourceMap",e instanceof nd)this.map=new Map(e.map),this.toKey=t??nd.defaultToKey;else if(function(e){return Array.isArray(e)}(e)){this.map=new Map,this.toKey=t??nd.defaultToKey;for(const[t,i]of e)this.set(t,i)}else this.map=new Map,this.toKey=e??nd.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new id(e,t)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){void 0!==t&&(e=e.bind(t));for(const[t,i]of this.map)e(i.value,i.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[(Jl=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}class od{constructor(e,t){this[ed]="ResourceSet",e&&"function"!=typeof e?(this._map=new nd(t),e.forEach(this.add,this)):this._map=new nd(e)}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,t){this._map.forEach(((i,n)=>e.call(t,n,n,this)))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(ed=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}}class sd{constructor(){this[td]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=0){const i=this._map.get(e);if(i)return 0!==t&&this.touch(i,t),i.value}set(e,t,i=0){let n=this._map.get(e);if(n)n.value=t,0!==i&&this.touch(n,i);else{switch(n={key:e,value:t,next:void 0,previous:void 0},i){case 0:case 2:default:this.addItemLast(n);break;case 1:this.addItemFirst(n)}this._map.set(e,n),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const i=this._state;let n=this._head;for(;n;){if(t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");n=n.next}}keys(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:i.key,done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}values(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:i.value,done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}entries(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:[i.key,i.value],done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}[(td=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(0===e)return void this.clear();let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(0===e)return void this.clear();let t=this._tail,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.previous,i--;this._tail=t,this._size=i,t&&(t.next=void 0),this._state++}addItemFirst(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e,this._state++}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(1===t||2===t)if(1===t){if(e===this._head)return;const t=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(t.previous=i,i.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(2===t){if(e===this._tail)return;const t=e.next,i=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=i,i.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}toJSON(){const e=[];return this.forEach(((t,i)=>{e.push([i,t])})),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}}class rd extends sd{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}}class ad extends rd{constructor(e,t=1){super(e,t)}trim(e){this.trimOld(e)}set(e,t){return super.set(e,t),this.checkTrim(),this}}class ld{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,i]of e)this.set(t,i)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){const t=this._m1.get(e);return void 0!==t&&(this._m1.delete(e),this._m2.delete(t),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}}class dd{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){const i=this.map.get(e);i&&(i.delete(t),0===i.size&&this.map.delete(e))}forEach(e,t){const i=this.map.get(e);i&&i.forEach(t)}}class hd{constructor(){this._data=new Map}set(e,...t){let i=this._data;for(let e=0;e<t.length-1;e++)i.has(t[e])||i.set(t[e],new Map),i=i.get(t[e]);i.set(t[t.length-1],e)}get(...e){let t=this._data;for(let i=0;i<e.length-1;i++){if(!t.has(e[i]))return;t=t.get(e[i])}return t.get(e[e.length-1])}clear(){this._data.clear()}toString(){const e=(t,i)=>{let n="";for(const[o,s]of t)n+=`${" ".repeat(i)}${o}: `,s instanceof Map?n+="\n"+e(s,i+1):n+=`${s}\n`;return n};return e(this._data,0)}}let cd=0;const ud=new Uint32Array(10);function gd(e,t,i){var n;e>=i&&e<i+t.length&&(0!==(n=t[e-i])&&(ud[cd++]=255&n,n>>8&&(ud[cd++]=n>>8&255),n>>16&&(ud[cd++]=n>>16&255)))}const pd=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),md=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),fd=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),_d=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]);function vd(...e){return function(t,i){for(let n=0,o=e.length;n<o;n++){const o=e[n](t,i);if(o)return o}return null}}wd.bind(void 0,!1);const bd=wd.bind(void 0,!0);function wd(e,t,i){if(!i||i.length<t.length)return null;let n;return n=e?sn(i,t):0===i.indexOf(t),n?t.length>0?[{start:0,end:t.length}]:[]:null}function Cd(e,t){const i=t.toLowerCase().indexOf(e.toLowerCase());return-1===i?null:[{start:i,end:i+e.length}]}function yd(e,t){return Sd(e.toLowerCase(),t.toLowerCase(),0,0)}function Sd(e,t,i,n){if(i===e.length)return[];if(n===t.length)return null;if(e[i]===t[n]){let o=null;return(o=Sd(e,t,i+1,n+1))?Rd({start:n,end:n+1},o):null}return Sd(e,t,i,n+1)}function xd(e){return 97<=e&&e<=122}function kd(e){return 65<=e&&e<=90}function Ld(e){return 48<=e&&e<=57}function Dd(e){return 32===e||9===e||10===e||13===e}const Ed=new Set;function Nd(e){return Dd(e)||Ed.has(e)}function Id(e,t){return e===t||Nd(e)&&Nd(t)}"()[]{}<>`'\"-/;:,.?!".split("").forEach((e=>Ed.add(e.charCodeAt(0))));const Td=new Map;function Md(e){if(Td.has(e))return Td.get(e);let t;const i=function(e){const t=function(e){if(cd=0,gd(e,pd,4352),cd>0)return ud.subarray(0,cd);if(gd(e,md,4449),cd>0)return ud.subarray(0,cd);if(gd(e,fd,4520),cd>0)return ud.subarray(0,cd);if(gd(e,_d,12593),cd)return ud.subarray(0,cd);if(e>=44032&&e<=55203){const t=e-44032,i=t%588,n=Math.floor(t/588),o=Math.floor(i/28),s=i%28-1;if(n<pd.length?gd(n,pd,0):4352+n-12593<_d.length&&gd(4352+n,_d,12593),o<md.length?gd(o,md,0):4449+o-12593<_d.length&&gd(4449+o-12593,_d,12593),s>=0&&(s<fd.length?gd(s,fd,0):4520+s-12593<_d.length&&gd(4520+s-12593,_d,12593)),cd>0)return ud.subarray(0,cd)}}(e);if(t&&t.length>0)return new Uint32Array(t)}(e);return i&&(t=i),Td.set(e,t),t}function Ad(e){return xd(e)||kd(e)||Ld(e)}function Rd(e,t){return 0===t.length?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function Od(e,t){for(let i=t;i<e.length;i++){const t=e.charCodeAt(i);if(kd(t)||Ld(t)||i>0&&!Ad(e.charCodeAt(i-1)))return i}return e.length}function Pd(e,t,i,n){if(i===e.length)return[];if(n===t.length)return null;if(e[i]!==t[n].toLowerCase())return null;{let o=null,s=n+1;for(o=Pd(e,t,i+1,n+1);!o&&(s=Od(t,s))<t.length;)o=Pd(e,t,i+1,s),s++;return null===o?null:Rd({start:n,end:n+1},o)}}function Fd(e,t){if(!t)return null;if(0===(t=t.trim()).length)return null;if(!function(e){let t=0,i=0,n=0,o=0;for(let s=0;s<e.length;s++)n=e.charCodeAt(s),kd(n)&&t++,xd(n)&&i++,Dd(n)&&o++;return 0!==t&&0!==i||0!==o?t<=5:e.length<=30}(e))return null;t.length>60&&(t=t.substring(0,60));const i=function(e){let t=0,i=0,n=0,o=0,s=0;for(let r=0;r<e.length;r++)s=e.charCodeAt(r),kd(s)&&t++,xd(s)&&i++,Ad(s)&&n++,Ld(s)&&o++;return{upperPercent:t/e.length,lowerPercent:i/e.length,alphaPercent:n/e.length,numericPercent:o/e.length}}(t);if(!function(e){const{upperPercent:t,lowerPercent:i,alphaPercent:n,numericPercent:o}=e;return i>.2&&t<.8&&n>.6&&o<.2}(i)){if(!function(e){const{upperPercent:t,lowerPercent:i}=e;return 0===i&&t>.6}(i))return null;t=t.toLowerCase()}let n=null,o=0;for(e=e.toLowerCase();o<t.length&&null===(n=Pd(e,t,0,o));)o=Od(t,o+1);return n}function Bd(e,t,i=!1){if(!t||0===t.length)return null;let n=null,o=0;for(e=e.toLowerCase(),t=t.toLowerCase();o<t.length&&(n=Wd(e,t,0,o,i),null===n);)o=Vd(t,o+1);return n}function Wd(e,t,i,n,o){let s=0;if(i===e.length)return[];if(n===t.length)return null;if(!Id(e.charCodeAt(i),t.charCodeAt(n))){const o=Md(e.charCodeAt(i));if(!o)return null;for(let e=0;e<o.length;e++)if(!Id(o[e],t.charCodeAt(n+e)))return null;s+=o.length-1}let r=null,a=n+s+1;if(r=Wd(e,t,i+1,a,o),!o)for(;!r&&(a=Vd(t,a))<t.length;)r=Wd(e,t,i+1,a,o),a++;if(!r)return null;if(e.charCodeAt(i)!==t.charCodeAt(n)){const o=Md(e.charCodeAt(i));if(!o)return r;for(let e=0;e<o.length;e++)if(o[e]!==t.charCodeAt(n+e))return r}return Rd({start:n,end:n+s+1},r)}function Vd(e,t){for(let i=t;i<e.length;i++)if(Nd(e.charCodeAt(i))||i>0&&Nd(e.charCodeAt(i-1)))return i;return e.length}const Hd=vd(bd,Fd,Cd),zd=vd(bd,Fd,yd),Ud=new ad(1e4);function Kd(e,t,i=!1){if("string"!=typeof e||"string"!=typeof t)return null;let n=Ud.get(e);n||(n=new RegExp(e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*"),"i"),Ud.set(e,n));const o=n.exec(t);return o?[{start:o.index,end:o.index+o[0].length}]:i?zd(e,t):Hd(e,t)}function jd(e,t){const i=dh(e,e.toLowerCase(),0,t,t.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return i?$d(i):null}function qd(e,t,i,n,o,s){const r=Math.min(13,e.length);for(;i<r;i++){const r=dh(e,t,i,n,o,s,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(r)return r}return[0,s]}function $d(e){if(void 0===e)return[];const t=[],i=e[1];for(let n=e.length-1;n>1;n--){const o=e[n]+i,s=t[t.length-1];s&&s.end===o?s.end=o+1:t.push({start:o,end:o+1})}return t}const Gd=128;function Zd(){const e=[],t=[];for(let e=0;e<=Gd;e++)t[e]=0;for(let i=0;i<=Gd;i++)e.push(t.slice(0));return e}function Yd(e){const t=[];for(let i=0;i<=e;i++)t[i]=0;return t}const Qd=Yd(2*Gd),Xd=Yd(2*Gd),Jd=Zd(),eh=Zd(),th=Zd(),ih=!1;function nh(e,t,i,n,o){function s(e,t,i=" "){for(;e.length<t;)e=i+e;return e}let r=` | |${n.split("").map((e=>s(e,3))).join("|")}\n`;for(let n=0;n<=i;n++)r+=0===n?" |":`${t[n-1]}|`,r+=e[n].slice(0,o+1).map((e=>s(e.toString(),3))).join("|")+"\n";return r}function oh(e,t){if(t<0||t>=e.length)return!1;const i=e.codePointAt(t);switch(i){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!Sn(i)}}function sh(e,t){if(t<0||t>=e.length)return!1;switch(e.charCodeAt(t)){case 32:case 9:return!0;default:return!1}}function rh(e,t,i){return t[e]!==i[e]}var ah;!function(e){e.Default=[-100,0],e.isDefault=function(e){return!e||2===e.length&&-100===e[0]&&0===e[1]}}(ah||(ah={}));class lh{static{this.default={boostFullMatch:!0,firstMatchCanBeWeak:!1}}constructor(e,t){this.firstMatchCanBeWeak=e,this.boostFullMatch=t}}function dh(e,t,i,n,o,s,r=lh.default){const a=e.length>Gd?Gd:e.length,l=n.length>Gd?Gd:n.length;if(i>=a||s>=l||a-i>l-s)return;if(!function(e,t,i,n,o,s,r=!1){for(;t<i&&o<s;)e[t]===n[o]&&(r&&(Qd[t]=o),t+=1),o+=1;return t===i}(t,i,a,o,s,l,!0))return;!function(e,t,i,n,o,s){let r=e-1,a=t-1;for(;r>=i&&a>=n;)o[r]===s[a]&&(Xd[r]=a,r--),a--}(a,l,i,s,t,o);let d=1,h=1,c=i,u=s;const g=[!1];for(d=1,c=i;c<a;d++,c++){const r=Qd[c],p=Xd[c],m=c+1<a?Xd[c+1]:l;for(h=r-s+1,u=r;u<m;h++,u++){let a=Number.MIN_SAFE_INTEGER,m=!1;u<=p&&(a=hh(e,t,c,i,n,o,u,l,s,0===Jd[d-1][h-1],g));let f=0;a!==Number.MIN_SAFE_INTEGER&&(m=!0,f=a+eh[d-1][h-1]);const _=u>r,v=_?eh[d][h-1]+(Jd[d][h-1]>0?-5:0):0,b=u>r+1&&Jd[d][h-1]>0,w=b?eh[d][h-2]+(Jd[d][h-2]>0?-5:0):0;if(b&&(!_||w>=v)&&(!m||w>=f))eh[d][h]=w,th[d][h]=3,Jd[d][h]=0;else if(_&&(!m||v>=f))eh[d][h]=v,th[d][h]=2,Jd[d][h]=0;else{if(!m)throw new Error("not possible");eh[d][h]=f,th[d][h]=1,Jd[d][h]=Jd[d-1][h-1]+1}}}if(ih&&function(e,t,i,n){e=e.substr(t),i=i.substr(n),console.log(nh(eh,e,e.length,i,i.length)),console.log(nh(th,e,e.length,i,i.length)),console.log(nh(Jd,e,e.length,i,i.length))}(e,i,n,s),!g[0]&&!r.firstMatchCanBeWeak)return;d--,h--;const p=[eh[d][h],s];let m=0,f=0;for(;d>=1;){let e=h;do{const t=th[d][e];if(3===t)e-=2;else{if(2!==t)break;e-=1}}while(e>=1);m>1&&t[i+d-1]===o[s+h-1]&&!rh(e+s-1,n,o)&&m+1>Jd[d][e]&&(e=h),e===h?m++:m=1,f||(f=e),d--,h=e-1,p.push(h)}l-s===a&&r.boostFullMatch&&(p[0]+=2);const _=f-a;return p[0]-=_,p}function hh(e,t,i,n,o,s,r,a,l,d,h){if(t[i]!==s[r])return Number.MIN_SAFE_INTEGER;let c=1,u=!1;return r===i-n?c=e[i]===o[r]?7:5:!rh(r,o,s)||0!==r&&rh(r-1,o,s)?!oh(s,r)||0!==r&&oh(s,r-1)?(oh(s,r-1)||sh(s,r-1))&&(c=5,u=!0):c=5:(c=e[i]===o[r]?7:5,u=!0),c>1&&i===n&&(h[0]=!0),u||(u=rh(r,o,s)||oh(s,r-1)||sh(s,r-1)),i===n?r>l&&(c-=u?3:5):c+=d?u?2:0:u?0:1,r+1===a&&(c-=u?3:5),c}function ch(e,t,i,n,o,s,r){return function(e,t,i,n,o,s,r,a){let l=dh(e,t,i,n,o,s,a);if(e.length>=3){const t=Math.min(7,e.length-1);for(let r=i+1;r<t;r++){const t=uh(e,r);if(t){const e=dh(t,t.toLowerCase(),i,n,o,s,a);e&&(e[0]-=3,(!l||e[0]>l[0])&&(l=e))}}}return l}(e,t,i,n,o,s,0,r)}function uh(e,t){if(t+1>=e.length)return;const i=e[t],n=e[t+1];return i!==n?e.slice(0,t)+n+i+e.slice(t+2):void 0}const gh=Object.create(null);function ph(e,t){if(lt(t)){const i=gh[t];if(void 0===i)throw new Error(`${e} references an unknown codicon: ${t}`);t=i}return gh[e]=t,{id:e}}function mh(){return gh}const fh={add:ph("add",6e4),plus:ph("plus",6e4),gistNew:ph("gist-new",6e4),repoCreate:ph("repo-create",6e4),lightbulb:ph("lightbulb",60001),lightBulb:ph("light-bulb",60001),repo:ph("repo",60002),repoDelete:ph("repo-delete",60002),gistFork:ph("gist-fork",60003),repoForked:ph("repo-forked",60003),gitPullRequest:ph("git-pull-request",60004),gitPullRequestAbandoned:ph("git-pull-request-abandoned",60004),recordKeys:ph("record-keys",60005),keyboard:ph("keyboard",60005),tag:ph("tag",60006),gitPullRequestLabel:ph("git-pull-request-label",60006),tagAdd:ph("tag-add",60006),tagRemove:ph("tag-remove",60006),person:ph("person",60007),personFollow:ph("person-follow",60007),personOutline:ph("person-outline",60007),personFilled:ph("person-filled",60007),gitBranch:ph("git-branch",60008),gitBranchCreate:ph("git-branch-create",60008),gitBranchDelete:ph("git-branch-delete",60008),sourceControl:ph("source-control",60008),mirror:ph("mirror",60009),mirrorPublic:ph("mirror-public",60009),star:ph("star",60010),starAdd:ph("star-add",60010),starDelete:ph("star-delete",60010),starEmpty:ph("star-empty",60010),comment:ph("comment",60011),commentAdd:ph("comment-add",60011),alert:ph("alert",60012),warning:ph("warning",60012),search:ph("search",60013),searchSave:ph("search-save",60013),logOut:ph("log-out",60014),signOut:ph("sign-out",60014),logIn:ph("log-in",60015),signIn:ph("sign-in",60015),eye:ph("eye",60016),eyeUnwatch:ph("eye-unwatch",60016),eyeWatch:ph("eye-watch",60016),circleFilled:ph("circle-filled",60017),primitiveDot:ph("primitive-dot",60017),closeDirty:ph("close-dirty",60017),debugBreakpoint:ph("debug-breakpoint",60017),debugBreakpointDisabled:ph("debug-breakpoint-disabled",60017),debugHint:ph("debug-hint",60017),terminalDecorationSuccess:ph("terminal-decoration-success",60017),primitiveSquare:ph("primitive-square",60018),edit:ph("edit",60019),pencil:ph("pencil",60019),info:ph("info",60020),issueOpened:ph("issue-opened",60020),gistPrivate:ph("gist-private",60021),gitForkPrivate:ph("git-fork-private",60021),lock:ph("lock",60021),mirrorPrivate:ph("mirror-private",60021),close:ph("close",60022),removeClose:ph("remove-close",60022),x:ph("x",60022),repoSync:ph("repo-sync",60023),sync:ph("sync",60023),clone:ph("clone",60024),desktopDownload:ph("desktop-download",60024),beaker:ph("beaker",60025),microscope:ph("microscope",60025),vm:ph("vm",60026),deviceDesktop:ph("device-desktop",60026),file:ph("file",60027),fileText:ph("file-text",60027),more:ph("more",60028),ellipsis:ph("ellipsis",60028),kebabHorizontal:ph("kebab-horizontal",60028),mailReply:ph("mail-reply",60029),reply:ph("reply",60029),organization:ph("organization",60030),organizationFilled:ph("organization-filled",60030),organizationOutline:ph("organization-outline",60030),newFile:ph("new-file",60031),fileAdd:ph("file-add",60031),newFolder:ph("new-folder",60032),fileDirectoryCreate:ph("file-directory-create",60032),trash:ph("trash",60033),trashcan:ph("trashcan",60033),history:ph("history",60034),clock:ph("clock",60034),folder:ph("folder",60035),fileDirectory:ph("file-directory",60035),symbolFolder:ph("symbol-folder",60035),logoGithub:ph("logo-github",60036),markGithub:ph("mark-github",60036),github:ph("github",60036),terminal:ph("terminal",60037),console:ph("console",60037),repl:ph("repl",60037),zap:ph("zap",60038),symbolEvent:ph("symbol-event",60038),error:ph("error",60039),stop:ph("stop",60039),variable:ph("variable",60040),symbolVariable:ph("symbol-variable",60040),array:ph("array",60042),symbolArray:ph("symbol-array",60042),symbolModule:ph("symbol-module",60043),symbolPackage:ph("symbol-package",60043),symbolNamespace:ph("symbol-namespace",60043),symbolObject:ph("symbol-object",60043),symbolMethod:ph("symbol-method",60044),symbolFunction:ph("symbol-function",60044),symbolConstructor:ph("symbol-constructor",60044),symbolBoolean:ph("symbol-boolean",60047),symbolNull:ph("symbol-null",60047),symbolNumeric:ph("symbol-numeric",60048),symbolNumber:ph("symbol-number",60048),symbolStructure:ph("symbol-structure",60049),symbolStruct:ph("symbol-struct",60049),symbolParameter:ph("symbol-parameter",60050),symbolTypeParameter:ph("symbol-type-parameter",60050),symbolKey:ph("symbol-key",60051),symbolText:ph("symbol-text",60051),symbolReference:ph("symbol-reference",60052),goToFile:ph("go-to-file",60052),symbolEnum:ph("symbol-enum",60053),symbolValue:ph("symbol-value",60053),symbolRuler:ph("symbol-ruler",60054),symbolUnit:ph("symbol-unit",60054),activateBreakpoints:ph("activate-breakpoints",60055),archive:ph("archive",60056),arrowBoth:ph("arrow-both",60057),arrowDown:ph("arrow-down",60058),arrowLeft:ph("arrow-left",60059),arrowRight:ph("arrow-right",60060),arrowSmallDown:ph("arrow-small-down",60061),arrowSmallLeft:ph("arrow-small-left",60062),arrowSmallRight:ph("arrow-small-right",60063),arrowSmallUp:ph("arrow-small-up",60064),arrowUp:ph("arrow-up",60065),bell:ph("bell",60066),bold:ph("bold",60067),book:ph("book",60068),bookmark:ph("bookmark",60069),debugBreakpointConditionalUnverified:ph("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:ph("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:ph("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:ph("debug-breakpoint-data-unverified",60072),debugBreakpointData:ph("debug-breakpoint-data",60073),debugBreakpointDataDisabled:ph("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:ph("debug-breakpoint-log-unverified",60074),debugBreakpointLog:ph("debug-breakpoint-log",60075),debugBreakpointLogDisabled:ph("debug-breakpoint-log-disabled",60075),briefcase:ph("briefcase",60076),broadcast:ph("broadcast",60077),browser:ph("browser",60078),bug:ph("bug",60079),calendar:ph("calendar",60080),caseSensitive:ph("case-sensitive",60081),check:ph("check",60082),checklist:ph("checklist",60083),chevronDown:ph("chevron-down",60084),chevronLeft:ph("chevron-left",60085),chevronRight:ph("chevron-right",60086),chevronUp:ph("chevron-up",60087),chromeClose:ph("chrome-close",60088),chromeMaximize:ph("chrome-maximize",60089),chromeMinimize:ph("chrome-minimize",60090),chromeRestore:ph("chrome-restore",60091),circleOutline:ph("circle-outline",60092),circle:ph("circle",60092),debugBreakpointUnverified:ph("debug-breakpoint-unverified",60092),terminalDecorationIncomplete:ph("terminal-decoration-incomplete",60092),circleSlash:ph("circle-slash",60093),circuitBoard:ph("circuit-board",60094),clearAll:ph("clear-all",60095),clippy:ph("clippy",60096),closeAll:ph("close-all",60097),cloudDownload:ph("cloud-download",60098),cloudUpload:ph("cloud-upload",60099),code:ph("code",60100),collapseAll:ph("collapse-all",60101),colorMode:ph("color-mode",60102),commentDiscussion:ph("comment-discussion",60103),creditCard:ph("credit-card",60105),dash:ph("dash",60108),dashboard:ph("dashboard",60109),database:ph("database",60110),debugContinue:ph("debug-continue",60111),debugDisconnect:ph("debug-disconnect",60112),debugPause:ph("debug-pause",60113),debugRestart:ph("debug-restart",60114),debugStart:ph("debug-start",60115),debugStepInto:ph("debug-step-into",60116),debugStepOut:ph("debug-step-out",60117),debugStepOver:ph("debug-step-over",60118),debugStop:ph("debug-stop",60119),debug:ph("debug",60120),deviceCameraVideo:ph("device-camera-video",60121),deviceCamera:ph("device-camera",60122),deviceMobile:ph("device-mobile",60123),diffAdded:ph("diff-added",60124),diffIgnored:ph("diff-ignored",60125),diffModified:ph("diff-modified",60126),diffRemoved:ph("diff-removed",60127),diffRenamed:ph("diff-renamed",60128),diff:ph("diff",60129),diffSidebyside:ph("diff-sidebyside",60129),discard:ph("discard",60130),editorLayout:ph("editor-layout",60131),emptyWindow:ph("empty-window",60132),exclude:ph("exclude",60133),extensions:ph("extensions",60134),eyeClosed:ph("eye-closed",60135),fileBinary:ph("file-binary",60136),fileCode:ph("file-code",60137),fileMedia:ph("file-media",60138),filePdf:ph("file-pdf",60139),fileSubmodule:ph("file-submodule",60140),fileSymlinkDirectory:ph("file-symlink-directory",60141),fileSymlinkFile:ph("file-symlink-file",60142),fileZip:ph("file-zip",60143),files:ph("files",60144),filter:ph("filter",60145),flame:ph("flame",60146),foldDown:ph("fold-down",60147),foldUp:ph("fold-up",60148),fold:ph("fold",60149),folderActive:ph("folder-active",60150),folderOpened:ph("folder-opened",60151),gear:ph("gear",60152),gift:ph("gift",60153),gistSecret:ph("gist-secret",60154),gist:ph("gist",60155),gitCommit:ph("git-commit",60156),gitCompare:ph("git-compare",60157),compareChanges:ph("compare-changes",60157),gitMerge:ph("git-merge",60158),githubAction:ph("github-action",60159),githubAlt:ph("github-alt",60160),globe:ph("globe",60161),grabber:ph("grabber",60162),graph:ph("graph",60163),gripper:ph("gripper",60164),heart:ph("heart",60165),home:ph("home",60166),horizontalRule:ph("horizontal-rule",60167),hubot:ph("hubot",60168),inbox:ph("inbox",60169),issueReopened:ph("issue-reopened",60171),issues:ph("issues",60172),italic:ph("italic",60173),jersey:ph("jersey",60174),json:ph("json",60175),kebabVertical:ph("kebab-vertical",60176),key:ph("key",60177),law:ph("law",60178),lightbulbAutofix:ph("lightbulb-autofix",60179),linkExternal:ph("link-external",60180),link:ph("link",60181),listOrdered:ph("list-ordered",60182),listUnordered:ph("list-unordered",60183),liveShare:ph("live-share",60184),loading:ph("loading",60185),location:ph("location",60186),mailRead:ph("mail-read",60187),mail:ph("mail",60188),markdown:ph("markdown",60189),megaphone:ph("megaphone",60190),mention:ph("mention",60191),milestone:ph("milestone",60192),gitPullRequestMilestone:ph("git-pull-request-milestone",60192),mortarBoard:ph("mortar-board",60193),move:ph("move",60194),multipleWindows:ph("multiple-windows",60195),mute:ph("mute",60196),noNewline:ph("no-newline",60197),note:ph("note",60198),octoface:ph("octoface",60199),openPreview:ph("open-preview",60200),package:ph("package",60201),paintcan:ph("paintcan",60202),pin:ph("pin",60203),play:ph("play",60204),run:ph("run",60204),plug:ph("plug",60205),preserveCase:ph("preserve-case",60206),preview:ph("preview",60207),project:ph("project",60208),pulse:ph("pulse",60209),question:ph("question",60210),quote:ph("quote",60211),radioTower:ph("radio-tower",60212),reactions:ph("reactions",60213),references:ph("references",60214),refresh:ph("refresh",60215),regex:ph("regex",60216),remoteExplorer:ph("remote-explorer",60217),remote:ph("remote",60218),remove:ph("remove",60219),replaceAll:ph("replace-all",60220),replace:ph("replace",60221),repoClone:ph("repo-clone",60222),repoForcePush:ph("repo-force-push",60223),repoPull:ph("repo-pull",60224),repoPush:ph("repo-push",60225),report:ph("report",60226),requestChanges:ph("request-changes",60227),rocket:ph("rocket",60228),rootFolderOpened:ph("root-folder-opened",60229),rootFolder:ph("root-folder",60230),rss:ph("rss",60231),ruby:ph("ruby",60232),saveAll:ph("save-all",60233),saveAs:ph("save-as",60234),save:ph("save",60235),screenFull:ph("screen-full",60236),screenNormal:ph("screen-normal",60237),searchStop:ph("search-stop",60238),server:ph("server",60240),settingsGear:ph("settings-gear",60241),settings:ph("settings",60242),shield:ph("shield",60243),smiley:ph("smiley",60244),sortPrecedence:ph("sort-precedence",60245),splitHorizontal:ph("split-horizontal",60246),splitVertical:ph("split-vertical",60247),squirrel:ph("squirrel",60248),starFull:ph("star-full",60249),starHalf:ph("star-half",60250),symbolClass:ph("symbol-class",60251),symbolColor:ph("symbol-color",60252),symbolConstant:ph("symbol-constant",60253),symbolEnumMember:ph("symbol-enum-member",60254),symbolField:ph("symbol-field",60255),symbolFile:ph("symbol-file",60256),symbolInterface:ph("symbol-interface",60257),symbolKeyword:ph("symbol-keyword",60258),symbolMisc:ph("symbol-misc",60259),symbolOperator:ph("symbol-operator",60260),symbolProperty:ph("symbol-property",60261),wrench:ph("wrench",60261),wrenchSubaction:ph("wrench-subaction",60261),symbolSnippet:ph("symbol-snippet",60262),tasklist:ph("tasklist",60263),telescope:ph("telescope",60264),textSize:ph("text-size",60265),threeBars:ph("three-bars",60266),thumbsdown:ph("thumbsdown",60267),thumbsup:ph("thumbsup",60268),tools:ph("tools",60269),triangleDown:ph("triangle-down",60270),triangleLeft:ph("triangle-left",60271),triangleRight:ph("triangle-right",60272),triangleUp:ph("triangle-up",60273),twitter:ph("twitter",60274),unfold:ph("unfold",60275),unlock:ph("unlock",60276),unmute:ph("unmute",60277),unverified:ph("unverified",60278),verified:ph("verified",60279),versions:ph("versions",60280),vmActive:ph("vm-active",60281),vmOutline:ph("vm-outline",60282),vmRunning:ph("vm-running",60283),watch:ph("watch",60284),whitespace:ph("whitespace",60285),wholeWord:ph("whole-word",60286),window:ph("window",60287),wordWrap:ph("word-wrap",60288),zoomIn:ph("zoom-in",60289),zoomOut:ph("zoom-out",60290),listFilter:ph("list-filter",60291),listFlat:ph("list-flat",60292),listSelection:ph("list-selection",60293),selection:ph("selection",60293),listTree:ph("list-tree",60294),debugBreakpointFunctionUnverified:ph("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:ph("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:ph("debug-breakpoint-function-disabled",60296),debugStackframeActive:ph("debug-stackframe-active",60297),circleSmallFilled:ph("circle-small-filled",60298),debugStackframeDot:ph("debug-stackframe-dot",60298),terminalDecorationMark:ph("terminal-decoration-mark",60298),debugStackframe:ph("debug-stackframe",60299),debugStackframeFocused:ph("debug-stackframe-focused",60299),debugBreakpointUnsupported:ph("debug-breakpoint-unsupported",60300),symbolString:ph("symbol-string",60301),debugReverseContinue:ph("debug-reverse-continue",60302),debugStepBack:ph("debug-step-back",60303),debugRestartFrame:ph("debug-restart-frame",60304),debugAlt:ph("debug-alt",60305),callIncoming:ph("call-incoming",60306),callOutgoing:ph("call-outgoing",60307),menu:ph("menu",60308),expandAll:ph("expand-all",60309),feedback:ph("feedback",60310),gitPullRequestReviewer:ph("git-pull-request-reviewer",60310),groupByRefType:ph("group-by-ref-type",60311),ungroupByRefType:ph("ungroup-by-ref-type",60312),account:ph("account",60313),gitPullRequestAssignee:ph("git-pull-request-assignee",60313),bellDot:ph("bell-dot",60314),debugConsole:ph("debug-console",60315),library:ph("library",60316),output:ph("output",60317),runAll:ph("run-all",60318),syncIgnored:ph("sync-ignored",60319),pinned:ph("pinned",60320),githubInverted:ph("github-inverted",60321),serverProcess:ph("server-process",60322),serverEnvironment:ph("server-environment",60323),pass:ph("pass",60324),issueClosed:ph("issue-closed",60324),stopCircle:ph("stop-circle",60325),playCircle:ph("play-circle",60326),record:ph("record",60327),debugAltSmall:ph("debug-alt-small",60328),vmConnect:ph("vm-connect",60329),cloud:ph("cloud",60330),merge:ph("merge",60331),export:ph("export",60332),graphLeft:ph("graph-left",60333),magnet:ph("magnet",60334),notebook:ph("notebook",60335),redo:ph("redo",60336),checkAll:ph("check-all",60337),pinnedDirty:ph("pinned-dirty",60338),passFilled:ph("pass-filled",60339),circleLargeFilled:ph("circle-large-filled",60340),circleLarge:ph("circle-large",60341),circleLargeOutline:ph("circle-large-outline",60341),combine:ph("combine",60342),gather:ph("gather",60342),table:ph("table",60343),variableGroup:ph("variable-group",60344),typeHierarchy:ph("type-hierarchy",60345),typeHierarchySub:ph("type-hierarchy-sub",60346),typeHierarchySuper:ph("type-hierarchy-super",60347),gitPullRequestCreate:ph("git-pull-request-create",60348),runAbove:ph("run-above",60349),runBelow:ph("run-below",60350),notebookTemplate:ph("notebook-template",60351),debugRerun:ph("debug-rerun",60352),workspaceTrusted:ph("workspace-trusted",60353),workspaceUntrusted:ph("workspace-untrusted",60354),workspaceUnknown:ph("workspace-unknown",60355),terminalCmd:ph("terminal-cmd",60356),terminalDebian:ph("terminal-debian",60357),terminalLinux:ph("terminal-linux",60358),terminalPowershell:ph("terminal-powershell",60359),terminalTmux:ph("terminal-tmux",60360),terminalUbuntu:ph("terminal-ubuntu",60361),terminalBash:ph("terminal-bash",60362),arrowSwap:ph("arrow-swap",60363),copy:ph("copy",60364),personAdd:ph("person-add",60365),filterFilled:ph("filter-filled",60366),wand:ph("wand",60367),debugLineByLine:ph("debug-line-by-line",60368),inspect:ph("inspect",60369),layers:ph("layers",60370),layersDot:ph("layers-dot",60371),layersActive:ph("layers-active",60372),compass:ph("compass",60373),compassDot:ph("compass-dot",60374),compassActive:ph("compass-active",60375),azure:ph("azure",60376),issueDraft:ph("issue-draft",60377),gitPullRequestClosed:ph("git-pull-request-closed",60378),gitPullRequestDraft:ph("git-pull-request-draft",60379),debugAll:ph("debug-all",60380),debugCoverage:ph("debug-coverage",60381),runErrors:ph("run-errors",60382),folderLibrary:ph("folder-library",60383),debugContinueSmall:ph("debug-continue-small",60384),beakerStop:ph("beaker-stop",60385),graphLine:ph("graph-line",60386),graphScatter:ph("graph-scatter",60387),pieChart:ph("pie-chart",60388),bracket:ph("bracket",60175),bracketDot:ph("bracket-dot",60389),bracketError:ph("bracket-error",60390),lockSmall:ph("lock-small",60391),azureDevops:ph("azure-devops",60392),verifiedFilled:ph("verified-filled",60393),newline:ph("newline",60394),layout:ph("layout",60395),layoutActivitybarLeft:ph("layout-activitybar-left",60396),layoutActivitybarRight:ph("layout-activitybar-right",60397),layoutPanelLeft:ph("layout-panel-left",60398),layoutPanelCenter:ph("layout-panel-center",60399),layoutPanelJustify:ph("layout-panel-justify",60400),layoutPanelRight:ph("layout-panel-right",60401),layoutPanel:ph("layout-panel",60402),layoutSidebarLeft:ph("layout-sidebar-left",60403),layoutSidebarRight:ph("layout-sidebar-right",60404),layoutStatusbar:ph("layout-statusbar",60405),layoutMenubar:ph("layout-menubar",60406),layoutCentered:ph("layout-centered",60407),target:ph("target",60408),indent:ph("indent",60409),recordSmall:ph("record-small",60410),errorSmall:ph("error-small",60411),terminalDecorationError:ph("terminal-decoration-error",60411),arrowCircleDown:ph("arrow-circle-down",60412),arrowCircleLeft:ph("arrow-circle-left",60413),arrowCircleRight:ph("arrow-circle-right",60414),arrowCircleUp:ph("arrow-circle-up",60415),layoutSidebarRightOff:ph("layout-sidebar-right-off",60416),layoutPanelOff:ph("layout-panel-off",60417),layoutSidebarLeftOff:ph("layout-sidebar-left-off",60418),blank:ph("blank",60419),heartFilled:ph("heart-filled",60420),map:ph("map",60421),mapHorizontal:ph("map-horizontal",60421),foldHorizontal:ph("fold-horizontal",60421),mapFilled:ph("map-filled",60422),mapHorizontalFilled:ph("map-horizontal-filled",60422),foldHorizontalFilled:ph("fold-horizontal-filled",60422),circleSmall:ph("circle-small",60423),bellSlash:ph("bell-slash",60424),bellSlashDot:ph("bell-slash-dot",60425),commentUnresolved:ph("comment-unresolved",60426),gitPullRequestGoToChanges:ph("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:ph("git-pull-request-new-changes",60428),searchFuzzy:ph("search-fuzzy",60429),commentDraft:ph("comment-draft",60430),send:ph("send",60431),sparkle:ph("sparkle",60432),insert:ph("insert",60433),mic:ph("mic",60434),thumbsdownFilled:ph("thumbsdown-filled",60435),thumbsupFilled:ph("thumbsup-filled",60436),coffee:ph("coffee",60437),snake:ph("snake",60438),game:ph("game",60439),vr:ph("vr",60440),chip:ph("chip",60441),piano:ph("piano",60442),music:ph("music",60443),micFilled:ph("mic-filled",60444),repoFetch:ph("repo-fetch",60445),copilot:ph("copilot",60446),lightbulbSparkle:ph("lightbulb-sparkle",60447),robot:ph("robot",60448),sparkleFilled:ph("sparkle-filled",60449),diffSingle:ph("diff-single",60450),diffMultiple:ph("diff-multiple",60451),surroundWith:ph("surround-with",60452),share:ph("share",60453),gitStash:ph("git-stash",60454),gitStashApply:ph("git-stash-apply",60455),gitStashPop:ph("git-stash-pop",60456),vscode:ph("vscode",60457),vscodeInsiders:ph("vscode-insiders",60458),codeOss:ph("code-oss",60459),runCoverage:ph("run-coverage",60460),runAllCoverage:ph("run-all-coverage",60461),coverage:ph("coverage",60462),githubProject:ph("github-project",60463),mapVertical:ph("map-vertical",60464),foldVertical:ph("fold-vertical",60464),mapVerticalFilled:ph("map-vertical-filled",60465),foldVerticalFilled:ph("fold-vertical-filled",60465),goToSearch:ph("go-to-search",60466),percentage:ph("percentage",60467),sortPercentage:ph("sort-percentage",60467),attach:ph("attach",60468),goToEditingSession:ph("go-to-editing-session",60469),editSession:ph("edit-session",60470),codeReview:ph("code-review",60471),copilotWarning:ph("copilot-warning",60472),python:ph("python",60473),copilotLarge:ph("copilot-large",60474),copilotWarningLarge:ph("copilot-warning-large",60475),keyboardTab:ph("keyboard-tab",60476),copilotBlocked:ph("copilot-blocked",60477),copilotNotConnected:ph("copilot-not-connected",60478),flag:ph("flag",60479),lightbulbEmpty:ph("lightbulb-empty",60480),symbolMethodArrow:ph("symbol-method-arrow",60481),copilotUnavailable:ph("copilot-unavailable",60482),repoPinned:ph("repo-pinned",60483),keyboardTabAbove:ph("keyboard-tab-above",60484),keyboardTabBelow:ph("keyboard-tab-below",60485),gitPullRequestDone:ph("git-pull-request-done",60486),mcp:ph("mcp",60487),extensionsLarge:ph("extensions-large",60488),layoutPanelDock:ph("layout-panel-dock",60489),layoutSidebarLeftDock:ph("layout-sidebar-left-dock",60490),layoutSidebarRightDock:ph("layout-sidebar-right-dock",60491),copilotInProgress:ph("copilot-in-progress",60492),copilotError:ph("copilot-error",60493),copilotSuccess:ph("copilot-success",60494),chatSparkle:ph("chat-sparkle",60495),searchSparkle:ph("search-sparkle",60496),editSparkle:ph("edit-sparkle",60497),copilotSnooze:ph("copilot-snooze",60498),sendToRemoteAgent:ph("send-to-remote-agent",60499),commentDiscussionSparkle:ph("comment-discussion-sparkle",60500),chatSparkleWarning:ph("chat-sparkle-warning",60501),chatSparkleError:ph("chat-sparkle-error",60502),collection:ph("collection",60503),newCollection:ph("new-collection",60504),thinking:ph("thinking",60505),dialogError:ph("dialog-error","error"),dialogWarning:ph("dialog-warning","warning"),dialogInfo:ph("dialog-info","info"),dialogClose:ph("dialog-close","close"),treeItemExpanded:ph("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:ph("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:ph("tree-filter-on-type-off","list-selection"),treeFilterClear:ph("tree-filter-clear","close"),treeItemLoading:ph("tree-item-loading","loading"),menuSelection:ph("menu-selection","check"),menuSubmenu:ph("menu-submenu","chevron-right"),menuBarMore:ph("menubar-more","more"),scrollbarButtonLeft:ph("scrollbar-button-left","triangle-left"),scrollbarButtonRight:ph("scrollbar-button-right","triangle-right"),scrollbarButtonUp:ph("scrollbar-button-up","triangle-up"),scrollbarButtonDown:ph("scrollbar-button-down","triangle-down"),toolBarMore:ph("toolbar-more","more"),quickInputBack:ph("quick-input-back","arrow-left"),dropDownButton:ph("drop-down-button",60084),symbolCustomColor:ph("symbol-customcolor",60252),exportIcon:ph("export",60332),workspaceUnspecified:ph("workspace-unspecified",60355),newLine:ph("newline",60394),thumbsDownFilled:ph("thumbsdown-filled",60435),thumbsUpFilled:ph("thumbsup-filled",60436),gitFetch:ph("git-fetch",60445),lightbulbSparkleAutofix:ph("lightbulb-sparkle-autofix",60447),debugBreakpointPending:ph("debug-breakpoint-pending",60377)};var _h,vh;!function(e){e.isThemeColor=function(e){return!!e&&"object"==typeof e&&"string"==typeof e.id}}(_h||(_h={})),function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9-]+",e.iconModifierExpression="~[A-Za-z]+",e.iconNameCharacter="[A-Za-z0-9~-]";const t=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function i(e){const n=t.exec(e.id);if(!n)return i(fh.error);const[,o,s]=n,r=["codicon","codicon-"+o];return s&&r.push("codicon-modifier-"+s.substring(1)),r}e.asClassNameArray=i,e.asClassName=function(e){return i(e).join(" ")},e.asCSSSelector=function(e){return"."+i(e).join(".")},e.isThemeIcon=function(e){return!!e&&"object"==typeof e&&"string"==typeof e.id&&(void 0===e.color||_h.isThemeColor(e.color))};const n=new RegExp(`^\\$\\((${e.iconNameExpression}(?:${e.iconModifierExpression})?)\\)$`);e.fromString=function(e){const t=n.exec(e);if(!t)return;const[,i]=t;return{id:i}},e.fromId=function(e){return{id:e}},e.modify=function(e,t){let i=e.id;const n=i.lastIndexOf("~");return-1!==n&&(i=i.substring(0,n)),t&&(i=`${i}~${t}`),{id:i}},e.getModifier=function(e){const t=e.id.lastIndexOf("~");if(-1!==t)return e.id.substring(t+1)},e.isEqual=function(e,t){return e.id===t.id&&e.color?.id===t.color?.id}}(vh||(vh={}));const bh=new RegExp(`\\$\\(${vh.iconNameExpression}(?:${vh.iconModifierExpression})?\\)`,"g"),wh=new RegExp(`(\\\\)?${bh.source}`,"g"),Ch=new RegExp(`\\\\${bh.source}`,"g"),yh=new RegExp(`(\\s)?(\\\\)?${bh.source}(\\s)?`,"g");function Sh(e){return-1===e.indexOf("$(")?e:e.replace(yh,((e,t,i,n)=>i?e:t||n||""))}function xh(e){return e?e.replace(/\$\((.*?)\)/g,((e,t)=>` ${t} `)).trim():""}const kh=new RegExp(`\\$\\(${vh.iconNameCharacter}+\\)`,"g");function Lh(e){kh.lastIndex=0;let t="";const i=[];let n=0;for(;;){const o=kh.lastIndex,s=kh.exec(e),r=e.substring(o,s?.index);if(r.length>0){t+=r;for(let e=0;e<r.length;e++)i.push(n)}if(!s)break;n+=s[0].length}return{text:t,iconOffsets:i}}function Dh(e,t,i=!1){const{text:n,iconOffsets:o}=t;if(!o||0===o.length)return Kd(e,n,i);const s=zi(n," "),r=n.length-s.length,a=Kd(e,s,i);if(a)for(const e of a){const t=o[e.start+r]+r;e.start+=t,e.end+=t}return a}function Eh(e){return 47===e||92===e}function Nh(e){return e.replace(/[\\/]/g,Qn.sep)}function Ih(e,t=Qn.sep){if(!e)return"";const i=e.length,n=e.charCodeAt(0);if(Eh(n)){if(Eh(e.charCodeAt(1))&&!Eh(e.charCodeAt(2))){let n=3;const o=n;for(;n<i&&!Eh(e.charCodeAt(n));n++);if(o!==n&&!Eh(e.charCodeAt(n+1)))for(n+=1;n<i;n++)if(Eh(e.charCodeAt(n)))return e.slice(0,n+1).replace(/[\\/]/g,t)}return t}if(Mh(n)&&58===e.charCodeAt(1))return Eh(e.charCodeAt(2))?e.slice(0,2)+t:e.slice(0,2);let o=e.indexOf("://");if(-1!==o)for(o+=3;o<i;o++)if(Eh(e.charCodeAt(o)))return e.slice(0,o+1);return""}function Th(e,t,i,n=oo){if(e===t)return!0;if(!e||!t)return!1;if(t.length>e.length)return!1;if(i){if(!sn(e,t))return!1;if(t.length===e.length)return!0;let i=t.length;return t.charAt(t.length-1)===n&&i--,e.charAt(i)===n}return t.charAt(t.length-1)!==n&&(t+=n),0===e.indexOf(t)}function Mh(e){return e>=65&&e<=90||e>=97&&e<=122}function Ah(e){return vo(e,!0)}class Rh{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:Yi(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t||!(!e||!t)&&this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}isEqualOrParent(e,t,i=!1){if(e.scheme===t.scheme){if(e.scheme===So.file)return Th(Ah(e),Ah(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(jh(e.authority,t.authority))return Th(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return uo.joinPath(e,...t)}basenameOrAuthority(e){return Bh(e)||e.authority}basename(e){return Qn.basename(e.path)}extname(e){return Qn.extname(e.path)}dirname(e){if(0===e.path.length)return e;let t;return e.scheme===So.file?t=uo.file(to(Ah(e))).path:(t=Qn.dirname(e.path),e.authority&&t.length&&47!==t.charCodeAt(0)&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return t=e.scheme===So.file?uo.file(Xn(Ah(e))).path:Qn.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!jh(e.authority,t.authority))return;if(e.scheme===So.file){const i=eo(Ah(e),Ah(t));return q?Nh(i):i}let i=e.path||"/";const n=t.path||"/";if(this._ignorePathCasing(e)){let e=0;for(const t=Math.min(i.length,n.length);e<t&&(i.charCodeAt(e)===n.charCodeAt(e)||i.charAt(e).toLowerCase()===n.charAt(e).toLowerCase());e++);i=n.substr(0,e)+i.substr(e)}return Qn.relative(i,n)}resolvePath(e,t){if(e.scheme===So.file){const i=uo.file(Jn(Ah(e),t));return e.with({authority:i.authority,path:i.path})}var i;return-1===(i=t).indexOf("/")&&(i=Nh(i)),/^[a-zA-Z]:(\/|$)/.test(i)&&(i="/"+i),t=i,e.with({path:Qn.resolve(e.path,t)})}isAbsolutePath(e){return!!e.path&&"/"===e.path[0]}isEqualAuthority(e,t){return e===t||void 0!==e&&void 0!==t&&on(e,t)}hasTrailingPathSeparator(e,t=oo){if(e.scheme===So.file){const i=Ah(e);return i.length>Ih(i).length&&i[i.length-1]===t}{const t=e.path;return t.length>1&&47===t.charCodeAt(t.length-1)&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=oo){return qh(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=oo){let i=!1;if(e.scheme===So.file){const n=Ah(e);i=void 0!==n&&n.length===Ih(n).length&&n[n.length-1]===t}else{t="/";const n=e.path;i=1===n.length&&47===n.charCodeAt(n.length-1)}return i||qh(e,t)?e:e.with({path:e.path+"/"})}}const Oh=new Rh((()=>!1)),Ph=(new Rh((e=>e.scheme!==So.file||!G)),new Rh((e=>!0)),Oh.isEqual.bind(Oh)),Fh=(Oh.isEqualOrParent.bind(Oh),Oh.getComparisonKey.bind(Oh),Oh.basenameOrAuthority.bind(Oh)),Bh=Oh.basename.bind(Oh),Wh=Oh.extname.bind(Oh),Vh=Oh.dirname.bind(Oh),Hh=Oh.joinPath.bind(Oh),zh=Oh.normalizePath.bind(Oh),Uh=Oh.relativePath.bind(Oh),Kh=Oh.resolvePath.bind(Oh),jh=(Oh.isAbsolutePath.bind(Oh),Oh.isEqualAuthority.bind(Oh)),qh=Oh.hasTrailingPathSeparator.bind(Oh);var $h;Oh.removeTrailingPathSeparator.bind(Oh),Oh.addTrailingPathSeparator.bind(Oh),function(e){e.META_DATA_LABEL="label",e.META_DATA_DESCRIPTION="description",e.META_DATA_SIZE="size",e.META_DATA_MIME="mime",e.parseMetaData=function(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach((e=>{const[t,n]=e.split(":");t&&n&&i.set(t,n)}));const n=t.path.substring(0,t.path.indexOf(";"));return n&&i.set(e.META_DATA_MIME,n),i}}($h||($h={}));class Gh{constructor(e="",t=!1){if(this.value=e,"string"!=typeof this.value)throw Pe("value");"boolean"==typeof t?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1):(this.isTrusted=t.isTrusted??void 0,this.supportThemeIcons=t.supportThemeIcons??!1,this.supportHtml=t.supportHtml??!1)}appendText(e,t=0){var i;return this.value+=function(e){return e.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}(this.supportThemeIcons?(i=e,i.replace(wh,((e,t)=>t?e:`\\${e}`))):e).replace(/([ \t]+)/g,((e,t)=>" ".repeat(t.length))).replace(/\>/gm,"\\>").replace(/\n/g,1===t?"\\\n":"\n\n"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=`\n${function(e,t){const i=e.match(/^`+/gm)?.reduce(((e,t)=>e.length>t.length?e:t)).length??0,n=i>=3?i+1:3;return[`${"`".repeat(n)}${t}`,e,`${"`".repeat(n)}`].join("\n")}(t,e)}\n`,this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){const i=new RegExp(Vi(t),"g");return e.replace(i,((t,i)=>"\\"!==e.charAt(i-1)?`\\${t}`:t))}}function Zh(e){return Yh(e)?!e.value:!Array.isArray(e)||e.every(Zh)}function Yh(e){return e instanceof Gh||!(!e||"object"!=typeof e)&&!("string"!=typeof e.value||"boolean"!=typeof e.isTrusted&&"object"!=typeof e.isTrusted&&void 0!==e.isTrusted||"boolean"!=typeof e.supportThemeIcons&&void 0!==e.supportThemeIcons)}function Qh(e){return e.replace(/"/g,""")}function Xh(e){return e?e.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1"):e}function Jh(e,...t){return uo.from({scheme:So.command,path:e,query:t.length?encodeURIComponent(JSON.stringify(t)):void 0})}var ec,tc=i(2755),ic={};ic.styleTagTransform=zl(),ic.setAttributes=Bl(),ic.insert=Pl().bind(null,"head"),ic.domAPI=Rl(),ic.insertStyleElement=Vl(),Ml()(tc.A,ic),tc.A&&tc.A.locals&&tc.A.locals,function(e){e.serviceIds=new Map,e.DI_TARGET="$di$target",e.DI_DEPENDENCIES="$di$dependencies",e.getServiceDependencies=function(t){return t[e.DI_DEPENDENCIES]||[]}}(ec||(ec={}));const nc=oc("instantiationService");function oc(e){if(ec.serviceIds.has(e))return ec.serviceIds.get(e);const t=function(e,i,n){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");!function(e,t,i){t[ec.DI_TARGET]===t?t[ec.DI_DEPENDENCIES].push({id:e,index:i}):(t[ec.DI_DEPENDENCIES]=[{id:e,index:i}],t[ec.DI_TARGET]=t)}(t,e,n)};return t.toString=()=>e,ec.serviceIds.set(e,t),t}const sc=oc("codeEditorService");class rc{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new rc(e,t)}delta(e=0,t=0){return this.with(Math.max(1,this.lineNumber+e),Math.max(1,this.column+t))}equals(e){return rc.equals(this,e)}static equals(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return rc.isBefore(this,e)}static isBefore(e,t){return e.lineNumber<t.lineNumber||!(t.lineNumber<e.lineNumber)&&e.column<t.column}isBeforeOrEqual(e){return rc.isBeforeOrEqual(this,e)}static isBeforeOrEqual(e,t){return e.lineNumber<t.lineNumber||!(t.lineNumber<e.lineNumber)&&e.column<=t.column}static compare(e,t){const i=0|e.lineNumber,n=0|t.lineNumber;return i===n?(0|e.column)-(0|t.column):i-n}clone(){return new rc(this.lineNumber,this.column)}toString(){return"("+this.lineNumber+","+this.column+")"}static lift(e){return new rc(e.lineNumber,e.column)}static isIPosition(e){return e&&"number"==typeof e.lineNumber&&"number"==typeof e.column}toJSON(){return{lineNumber:this.lineNumber,column:this.column}}}const ac=oc("modelService"),lc=oc("textModelService");class dc extends At{get onDidChange(){return this._onDidChange.event}constructor(e,t="",i="",n=!0,o){super(),this._onDidChange=this._register(new Zt),this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=n,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}async run(e,t){this._actionCallback&&await this._actionCallback(e)}}class hc extends At{constructor(){super(...arguments),this._onWillRun=this._register(new Zt),this._onDidRun=this._register(new Zt)}get onWillRun(){return this._onWillRun.event}get onDidRun(){return this._onDidRun.event}async run(e,t){if(!e.enabled)return;let i;this._onWillRun.fire({action:e});try{await this.runAction(e,t)}catch(e){i=e}this._onDidRun.fire({action:e,error:i})}async runAction(e,t){await e.run(t)}}class cc{constructor(){this.id=cc.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const i of e)i.length&&(t=t.length?[...t,new cc,...i]:i);return t}static{this.ID="vs.actions.separator"}async run(){}}class uc{get actions(){return this._actions}constructor(e,t,i,n){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=n,this._actions=i}async run(){}}class gc extends dc{static{this.ID="vs.actions.empty"}constructor(){super(gc.ID,y(28,"(empty)"),void 0,!1)}}function pc(e){return{id:e.id,label:e.label,tooltip:e.tooltip??e.label,class:e.class,enabled:e.enabled??!0,checked:e.checked,run:async(...t)=>e.run(...t)}}const mc=oc("commandService"),fc=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Zt,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,t){if(!e)throw new Error("invalid command");if("string"==typeof e){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t})}if(e.metadata&&Array.isArray(e.metadata.args)){const t=[];for(const i of e.metadata.args)t.push(i.constraint);const i=e.handler;e.handler=function(e,...n){return function(e,t){const i=Math.min(e.length,t.length);for(let n=0;n<i;n++)wt(e[n],t[n])}(n,t),i(e,...n)}}const{id:i}=e;let n=this._commands.get(i);n||(n=new Wt,this._commands.set(i,n));const o=n.unshift(e),s=Tt((()=>{o();const e=this._commands.get(i);e?.isEmpty()&&this._commands.delete(i)}));return this._onDidRegisterCommand.fire(i),Lt(s)}registerCommandAlias(e,t){return fc.registerCommand(e,((e,...i)=>e.get(mc).executeCommand(t,...i)))}getCommand(e){const t=this._commands.get(e);if(t&&!t.isEmpty())return Ct.first(t)}getCommands(){const e=new Map;for(const t of this._commands.keys()){const i=this.getCommand(t);i&&e.set(t,i)}return e}};function _c(...e){switch(e.length){case 1:return y(1678,"Did you mean {0}?",e[0]);case 2:return y(1679,"Did you mean {0} or {1}?",e[0],e[1]);case 3:return y(1680,"Did you mean {0}, {1} or {2}?",e[0],e[1],e[2]);default:return}}fc.registerCommand("noop",(()=>{}));const vc=y(1681,"Did you forget to open or close the quote?"),bc=y(1682,"Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");class wc{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:case 8:return">=";case 9:return"=~";case 10:case 17:case 18:case 19:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 20:return"EOF";default:throw Fe(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}static{this._regexFlags=new Set(["i","g","s","m","y","u"].map((e=>e.charCodeAt(0))))}static{this._keywords=new Map([["not",14],["in",13],["false",12],["true",11]])}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const e=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:e})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const e=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:e})}else this._match(126)?this._addToken(9):this._error(_c("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(_c("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(_c("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return!this._isAtEnd()&&this._input.charCodeAt(this._current)===e&&(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const t=this._start,i=this._input.substring(this._start,this._current),n={type:19,offset:this._start,lexeme:i};this._errors.push({offset:t,lexeme:i,additionalInfo:e}),this._tokens.push(n)}_string(){this.stringRe.lastIndex=this._start;const e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;const t=this._input.substring(this._start,this._current),i=wc._keywords.get(t);i?this._addToken(i):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;39!==this._peek()&&!this._isAtEnd();)this._advance();this._isAtEnd()?this._error(vc):(this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1}))}_regex(){let e=this._current,t=!1,i=!1;for(;;){if(e>=this._input.length)return this._current=e,void this._error(bc);const n=this._input.charCodeAt(e);if(t)t=!1;else{if(47===n&&!i){e++;break}91===n?i=!0:92===n?t=!0:93===n&&(i=!1)}e++}for(;e<this._input.length&&wc._regexFlags.has(this._input.charCodeAt(e));)e++;this._current=e;const n=this._input.substring(this._start,this._current);this._tokens.push({type:10,lexeme:n,offset:this._start})}_isAtEnd(){return this._current>=this._input.length}}const Cc=new Map;Cc.set("false",!1),Cc.set("true",!0),Cc.set("isMac",$),Cc.set("isLinux",G),Cc.set("isWindows",q),Cc.set("isWeb",Y),Cc.set("isMacNative",$&&!Y),Cc.set("isEdge",ue),Cc.set("isFirefox",he),Cc.set("isChrome",de),Cc.set("isSafari",ce);const yc=Object.prototype.hasOwnProperty,Sc={regexParsingWithErrorRecovery:!0},xc=y(1660,"Empty context key expression"),kc=y(1661,"Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),Lc=y(1662,"'in' after 'not'."),Dc=y(1663,"closing parenthesis ')'"),Ec=y(1664,"Unexpected token"),Nc=y(1665,"Did you forget to put && or || before the token?"),Ic=y(1666,"Unexpected end of expression"),Tc=y(1667,"Did you forget to put a context key?");class Mc{static{this._parseError=new Error}constructor(e=Sc){this._config=e,this._scanner=new wc,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(""!==e){this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const e=this._expr();if(!this._isAtEnd()){const e=this._peek(),t=17===e.type?Nc:void 0;throw this._parsingErrors.push({message:Ec,offset:e.offset,lexeme:wc.getLexeme(e),additionalInfo:t}),Mc._parseError}return e}catch(e){if(e!==Mc._parseError)throw e;return}}else this._parsingErrors.push({message:xc,offset:0,lexeme:"",additionalInfo:kc})}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const t=this._and();e.push(t)}return 1===e.length?e[0]:Ac.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return 1===e.length?e[0]:Ac.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),Oc.INSTANCE;case 12:return this._advance(),Pc.INSTANCE;case 0:{this._advance();const e=this._expr();return this._consume(1,Dc),e?.negate()}case 17:return this._advance(),zc.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const e=this._peek();switch(e.type){case 11:return this._advance(),Ac.true();case 12:return this._advance(),Ac.false();case 0:{this._advance();const e=this._expr();return this._consume(1,Dc),e}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const e=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),10!==e.type)throw this._errExpectedButGot("REGEX",e);const i=e.lexeme,n=i.lastIndexOf("/"),o=n===i.length-1?void 0:this._removeFlagsGY(i.substring(n+1));let s;try{s=new RegExp(i.substring(1,n),o)}catch(t){throw this._errExpectedButGot("REGEX",e)}return Gc.create(t,s)}switch(e.type){case 10:case 19:{const i=[e.lexeme];this._advance();let n=this._peek(),o=0;for(let t=0;t<e.lexeme.length;t++)40===e.lexeme.charCodeAt(t)?o++:41===e.lexeme.charCodeAt(t)&&o--;for(;!this._isAtEnd()&&15!==n.type&&16!==n.type;){switch(n.type){case 0:o++;break;case 1:o--;break;case 10:case 18:for(let t=0;t<n.lexeme.length;t++)40===n.lexeme.charCodeAt(t)?o++:41===e.lexeme.charCodeAt(t)&&o--}if(o<0)break;i.push(wc.getLexeme(n)),this._advance(),n=this._peek()}const s=i.join(""),r=s.lastIndexOf("/"),a=r===s.length-1?void 0:this._removeFlagsGY(s.substring(r+1));let l;try{l=new RegExp(s.substring(1,r),a)}catch(t){throw this._errExpectedButGot("REGEX",e)}return Ac.regex(t,l)}case 18:{const i=e.lexeme;this._advance();let n=null;if(!Pi(i)){const t=i.indexOf("/"),o=i.lastIndexOf("/");if(t!==o&&t>=0){const s=i.slice(t+1,o),r="i"===i[o+1]?"i":"";try{n=new RegExp(s,r)}catch(t){throw this._errExpectedButGot("REGEX",e)}}}if(null===n)throw this._errExpectedButGot("REGEX",e);return Gc.create(t,n)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,Lc);const e=this._value();return Ac.notIn(t,e)}switch(this._peek().type){case 3:{this._advance();const e=this._value();if(18===this._previous().type)return Ac.equals(t,e);switch(e){case"true":return Ac.has(t);case"false":return Ac.not(t);default:return Ac.equals(t,e)}}case 4:{this._advance();const e=this._value();if(18===this._previous().type)return Ac.notEquals(t,e);switch(e){case"true":return Ac.not(t);case"false":return Ac.has(t);default:return Ac.notEquals(t,e)}}case 5:return this._advance(),qc.create(t,this._value());case 6:return this._advance(),$c.create(t,this._value());case 7:return this._advance(),Kc.create(t,this._value());case 8:return this._advance(),jc.create(t,this._value());case 13:return this._advance(),Ac.in(t,this._value());default:return Ac.has(t)}}case 20:throw this._parsingErrors.push({message:Ic,offset:e.offset,lexeme:"",additionalInfo:Tc}),Mc._parseError;default:throw this._errExpectedButGot("true | false | KEY \n\t| KEY '=~' REGEX \n\t| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value",this._peek())}}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return!!this._check(e)&&(this._advance(),!0)}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,i){const n=y(1668,"Expected: {0}\nReceived: '{1}'.",e,wc.getLexeme(t)),o=t.offset,s=wc.getLexeme(t);return this._parsingErrors.push({message:n,offset:o,lexeme:s,additionalInfo:i}),Mc._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return 20===this._peek().type}}class Ac{static false(){return Oc.INSTANCE}static true(){return Pc.INSTANCE}static has(e){return Fc.create(e)}static equals(e,t){return Bc.create(e,t)}static notEquals(e,t){return Hc.create(e,t)}static regex(e,t){return Gc.create(e,t)}static in(e,t){return Wc.create(e,t)}static notIn(e,t){return Vc.create(e,t)}static not(e){return zc.create(e)}static and(...e){return Qc.create(e,null,!0)}static or(...e){return Xc.create(e,null,!0)}static{this._parser=new Mc({regexParsingWithErrorRecovery:!1})}static deserialize(e){if(null!=e)return this._parser.parse(e)}}function Rc(e,t){return e.cmp(t)}class Oc{static{this.INSTANCE=new Oc}constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return Pc.INSTANCE}}class Pc{static{this.INSTANCE=new Pc}constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return Oc.INSTANCE}}class Fc{static create(e,t=null){const i=Cc.get(e);return"boolean"==typeof i?i?Pc.INSTANCE:Oc.INSTANCE:new Fc(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:tu(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=Cc.get(this.key);return"boolean"==typeof e?e?Pc.INSTANCE:Oc.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=zc.create(this.key,this)),this.negated}}class Bc{static create(e,t,i=null){if("boolean"==typeof t)return t?Fc.create(e,i):zc.create(e,i);const n=Cc.get(e);return"boolean"==typeof n?t===(n?"true":"false")?Pc.INSTANCE:Oc.INSTANCE:new Bc(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:iu(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){const e=Cc.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?Pc.INSTANCE:Oc.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Hc.create(this.key,this.value,this)),this.negated}}class Wc{static create(e,t){return new Wc(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:iu(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type&&this.key===e.key&&this.valueKey===e.valueKey}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.includes(i):"string"==typeof i&&"object"==typeof t&&null!==t&&yc.call(t,i)}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=Vc.create(this.key,this.valueKey)),this.negated}}class Vc{static create(e,t){return new Vc(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=Wc.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type&&this._negated.equals(e._negated)}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}class Hc{static create(e,t,i=null){if("boolean"==typeof t)return t?zc.create(e,i):Fc.create(e,i);const n=Cc.get(e);return"boolean"==typeof n?t===(n?"true":"false")?Oc.INSTANCE:Pc.INSTANCE:new Hc(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:iu(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){const e=Cc.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?Oc.INSTANCE:Pc.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Bc.create(this.key,this.value,this)),this.negated}}class zc{static create(e,t=null){const i=Cc.get(e);return"boolean"==typeof i?i?Oc.INSTANCE:Pc.INSTANCE:new zc(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:tu(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=Cc.get(this.key);return"boolean"==typeof e?e?Oc.INSTANCE:Pc.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Fc.create(this.key,this)),this.negated}}function Uc(e,t){if("string"==typeof e){const t=parseFloat(e);isNaN(t)||(e=t)}return"string"==typeof e||"number"==typeof e?t(e):Oc.INSTANCE}class Kc{static create(e,t,i=null){return Uc(t,(t=>new Kc(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:iu(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=$c.create(this.key,this.value,this)),this.negated}}class jc{static create(e,t,i=null){return Uc(t,(t=>new jc(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:iu(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=qc.create(this.key,this.value,this)),this.negated}}class qc{static create(e,t,i=null){return Uc(t,(t=>new qc(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:iu(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=jc.create(this.key,this.value,this)),this.negated}}class $c{static create(e,t,i=null){return Uc(t,(t=>new $c(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:iu(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Kc.create(this.key,this.value,this)),this.negated}}class Gc{static create(e,t){return new Gc(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.key<e.key)return-1;if(this.key>e.key)return 1;const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return t<i?-1:t>i?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return!!this.regexp&&this.regexp.test(t)}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Zc.create(this)),this.negated}}class Zc{static create(e){return new Zc(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type&&this._actual.equals(e._actual)}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function Yc(e){let t=null;for(let i=0,n=e.length;i<n;i++){const n=e[i].substituteConstants();if(e[i]!==n&&null===t){t=[];for(let n=0;n<i;n++)t[n]=e[n]}null!==t&&(t[i]=n)}return null===t?e:t}class Qc{static create(e,t,i){return Qc._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=6}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,i=this.expr.length;t<i;t++){const i=Rc(this.expr[t],e.expr[t]);if(0!==i)return i}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const e=Yc(this.expr);return e===this.expr?this:Qc.create(e,this.negated,!1)}evaluate(e){for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].evaluate(e))return!1;return!0}static _normalizeArr(e,t,i){const n=[];let o=!1;for(const t of e)if(t)if(1!==t.type){if(0===t.type)return Oc.INSTANCE;6!==t.type?n.push(t):n.push(...t.expr)}else o=!0;if(0===n.length&&o)return Pc.INSTANCE;if(0!==n.length){if(1===n.length)return n[0];n.sort(Rc);for(let e=1;e<n.length;e++)n[e-1].equals(n[e])&&(n.splice(e,1),e--);if(1===n.length)return n[0];for(;n.length>1;){const e=n[n.length-1];if(9!==e.type)break;n.pop();const t=n.pop(),o=0===n.length,s=Xc.create(e.expr.map((e=>Qc.create([e,t],null,i))),null,o);s&&(n.push(s),n.sort(Rc))}if(1===n.length)return n[0];if(i){for(let e=0;e<n.length;e++)for(let t=e+1;t<n.length;t++)if(n[e].negate().equals(n[t]))return Oc.INSTANCE;if(1===n.length)return n[0]}return new Qc(n,t)}}serialize(){return this.expr.map((e=>e.serialize())).join(" && ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());this.negated=Xc.create(e,this,!0)}return this.negated}}class Xc{static create(e,t,i){return Xc._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,i=this.expr.length;t<i;t++){const i=Rc(this.expr[t],e.expr[t]);if(0!==i)return i}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const e=Yc(this.expr);return e===this.expr?this:Xc.create(e,this.negated,!1)}evaluate(e){for(let t=0,i=this.expr.length;t<i;t++)if(this.expr[t].evaluate(e))return!0;return!1}static _normalizeArr(e,t,i){let n=[],o=!1;if(e){for(let t=0,i=e.length;t<i;t++){const i=e[t];if(i)if(0!==i.type){if(1===i.type)return Pc.INSTANCE;9!==i.type?n.push(i):n=n.concat(i.expr)}else o=!0}if(0===n.length&&o)return Oc.INSTANCE;n.sort(Rc)}if(0!==n.length){if(1===n.length)return n[0];for(let e=1;e<n.length;e++)n[e-1].equals(n[e])&&(n.splice(e,1),e--);if(1===n.length)return n[0];if(i){for(let e=0;e<n.length;e++)for(let t=e+1;t<n.length;t++)if(n[e].negate().equals(n[t]))return Pc.INSTANCE;if(1===n.length)return n[0]}return new Xc(n,t)}}serialize(){return this.expr.map((e=>e.serialize())).join(" || ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),i=e.shift(),n=[];for(const e of su(t))for(const t of su(i))n.push(Qc.create([e,t],null,!1));e.unshift(Xc.create(n,null,!1))}this.negated=Xc.create(e,this,!0)}return this.negated}}class Jc extends Fc{static{this._info=[]}static all(){return Jc._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,"object"==typeof i?Jc._info.push({...i,key:e}):!0!==i&&Jc._info.push({key:e,description:i,type:null!=t?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return Bc.create(this.key,e)}}const eu=oc("contextKeyService");function tu(e,t){return e<t?-1:e>t?1:0}function iu(e,t,i,n){return e<i?-1:e>i?1:t<n?-1:t>n?1:0}function nu(e,t){if(0===e.type||1===t.type)return!0;if(9===e.type)return 9===t.type&&ou(e.expr,t.expr);if(9===t.type){for(const i of t.expr)if(nu(e,i))return!0;return!1}if(6===e.type){if(6===t.type)return ou(t.expr,e.expr);for(const i of e.expr)if(nu(i,t))return!0;return!1}return e.equals(t)}function ou(e,t){let i=0,n=0;for(;i<e.length&&n<t.length;){const o=e[i].cmp(t[n]);if(o<0)return!1;0===o?(i++,n++):n++}return i===e.length}function su(e){return 9===e.type?e.expr:[e]}const ru=new class{constructor(){this.data=new Map}add(e,t){it(lt(e)),it(dt(t)),it(!this.data.has(e),"There is already an extension with this id"),this.data.set(e,t)}as(e){return this.data.get(e)||null}dispose(){this.data.forEach((e=>{bt(e.dispose)&&e.dispose()})),this.data.clear()}};class au{constructor(){this._coreKeybindings=new Wt,this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(1===se){if(e&&e.win)return e.win}else if(2===se){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=au.bindToCurrentPlatform(e),i=new Mt;if(t&&t.primary){const n=He(t.primary,se);n&&i.add(this._registerDefaultKeybinding(n,e.id,e.args,e.weight,0,e.when))}if(t&&Array.isArray(t.secondary))for(let n=0,o=t.secondary.length;n<o;n++){const o=He(t.secondary[n],se);o&&i.add(this._registerDefaultKeybinding(o,e.id,e.args,e.weight,-n-1,e.when))}return i}registerCommandAndKeybindingRule(e){return Nt(this.registerKeybindingRule(e),fc.registerCommand(e))}_registerDefaultKeybinding(e,t,i,n,o,s){const r=this._coreKeybindings.push({keybinding:e,command:t,commandArgs:i,when:s,weight1:n,weight2:o,extensionId:null,isBuiltinExtension:!1});return this._cachedMergedKeybindings=null,Tt((()=>{r(),this._cachedMergedKeybindings=null}))}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(du)),this._cachedMergedKeybindings.slice(0)}}const lu=new au;function du(e,t){if(e.weight1!==t.weight1)return e.weight1-t.weight1;if(e.command&&t.command){if(e.command<t.command)return-1;if(e.command>t.command)return 1}return e.weight2-t.weight2}ru.add("platform.keybindingsRegistry",lu);var hu,cu=function(e,t){return function(i,n){t(i,n,e)}};function uu(e){return void 0!==e.command}class gu{static{this._instances=new Map}static{this.CommandPalette=new gu("CommandPalette")}static{this.DebugBreakpointsContext=new gu("DebugBreakpointsContext")}static{this.DebugCallStackContext=new gu("DebugCallStackContext")}static{this.DebugConsoleContext=new gu("DebugConsoleContext")}static{this.DebugVariablesContext=new gu("DebugVariablesContext")}static{this.NotebookVariablesContext=new gu("NotebookVariablesContext")}static{this.DebugHoverContext=new gu("DebugHoverContext")}static{this.DebugWatchContext=new gu("DebugWatchContext")}static{this.DebugToolBar=new gu("DebugToolBar")}static{this.DebugToolBarStop=new gu("DebugToolBarStop")}static{this.DebugDisassemblyContext=new gu("DebugDisassemblyContext")}static{this.DebugCallStackToolbar=new gu("DebugCallStackToolbar")}static{this.DebugCreateConfiguration=new gu("DebugCreateConfiguration")}static{this.EditorContext=new gu("EditorContext")}static{this.SimpleEditorContext=new gu("SimpleEditorContext")}static{this.EditorContent=new gu("EditorContent")}static{this.EditorLineNumberContext=new gu("EditorLineNumberContext")}static{this.EditorContextCopy=new gu("EditorContextCopy")}static{this.EditorContextPeek=new gu("EditorContextPeek")}static{this.EditorContextShare=new gu("EditorContextShare")}static{this.EditorTitle=new gu("EditorTitle")}static{this.CompactWindowEditorTitle=new gu("CompactWindowEditorTitle")}static{this.EditorTitleRun=new gu("EditorTitleRun")}static{this.EditorTitleContext=new gu("EditorTitleContext")}static{this.EditorTitleContextShare=new gu("EditorTitleContextShare")}static{this.EmptyEditorGroup=new gu("EmptyEditorGroup")}static{this.EmptyEditorGroupContext=new gu("EmptyEditorGroupContext")}static{this.EditorTabsBarContext=new gu("EditorTabsBarContext")}static{this.EditorTabsBarShowTabsSubmenu=new gu("EditorTabsBarShowTabsSubmenu")}static{this.EditorTabsBarShowTabsZenModeSubmenu=new gu("EditorTabsBarShowTabsZenModeSubmenu")}static{this.EditorActionsPositionSubmenu=new gu("EditorActionsPositionSubmenu")}static{this.EditorSplitMoveSubmenu=new gu("EditorSplitMoveSubmenu")}static{this.ExplorerContext=new gu("ExplorerContext")}static{this.ExplorerContextShare=new gu("ExplorerContextShare")}static{this.ExtensionContext=new gu("ExtensionContext")}static{this.ExtensionEditorContextMenu=new gu("ExtensionEditorContextMenu")}static{this.GlobalActivity=new gu("GlobalActivity")}static{this.CommandCenter=new gu("CommandCenter")}static{this.CommandCenterCenter=new gu("CommandCenterCenter")}static{this.LayoutControlMenuSubmenu=new gu("LayoutControlMenuSubmenu")}static{this.LayoutControlMenu=new gu("LayoutControlMenu")}static{this.MenubarMainMenu=new gu("MenubarMainMenu")}static{this.MenubarAppearanceMenu=new gu("MenubarAppearanceMenu")}static{this.MenubarDebugMenu=new gu("MenubarDebugMenu")}static{this.MenubarEditMenu=new gu("MenubarEditMenu")}static{this.MenubarCopy=new gu("MenubarCopy")}static{this.MenubarFileMenu=new gu("MenubarFileMenu")}static{this.MenubarGoMenu=new gu("MenubarGoMenu")}static{this.MenubarHelpMenu=new gu("MenubarHelpMenu")}static{this.MenubarLayoutMenu=new gu("MenubarLayoutMenu")}static{this.MenubarNewBreakpointMenu=new gu("MenubarNewBreakpointMenu")}static{this.PanelAlignmentMenu=new gu("PanelAlignmentMenu")}static{this.PanelPositionMenu=new gu("PanelPositionMenu")}static{this.ActivityBarPositionMenu=new gu("ActivityBarPositionMenu")}static{this.MenubarPreferencesMenu=new gu("MenubarPreferencesMenu")}static{this.MenubarRecentMenu=new gu("MenubarRecentMenu")}static{this.MenubarSelectionMenu=new gu("MenubarSelectionMenu")}static{this.MenubarShare=new gu("MenubarShare")}static{this.MenubarSwitchEditorMenu=new gu("MenubarSwitchEditorMenu")}static{this.MenubarSwitchGroupMenu=new gu("MenubarSwitchGroupMenu")}static{this.MenubarTerminalMenu=new gu("MenubarTerminalMenu")}static{this.MenubarTerminalSuggestStatusMenu=new gu("MenubarTerminalSuggestStatusMenu")}static{this.MenubarViewMenu=new gu("MenubarViewMenu")}static{this.MenubarHomeMenu=new gu("MenubarHomeMenu")}static{this.OpenEditorsContext=new gu("OpenEditorsContext")}static{this.OpenEditorsContextShare=new gu("OpenEditorsContextShare")}static{this.ProblemsPanelContext=new gu("ProblemsPanelContext")}static{this.SCMInputBox=new gu("SCMInputBox")}static{this.SCMChangeContext=new gu("SCMChangeContext")}static{this.SCMResourceContext=new gu("SCMResourceContext")}static{this.SCMResourceContextShare=new gu("SCMResourceContextShare")}static{this.SCMResourceFolderContext=new gu("SCMResourceFolderContext")}static{this.SCMResourceGroupContext=new gu("SCMResourceGroupContext")}static{this.SCMSourceControl=new gu("SCMSourceControl")}static{this.SCMSourceControlInline=new gu("SCMSourceControlInline")}static{this.SCMSourceControlTitle=new gu("SCMSourceControlTitle")}static{this.SCMHistoryTitle=new gu("SCMHistoryTitle")}static{this.SCMHistoryItemContext=new gu("SCMHistoryItemContext")}static{this.SCMHistoryItemChangeContext=new gu("SCMHistoryItemChangeContext")}static{this.SCMHistoryItemHover=new gu("SCMHistoryItemHover")}static{this.SCMHistoryItemRefContext=new gu("SCMHistoryItemRefContext")}static{this.SCMQuickDiffDecorations=new gu("SCMQuickDiffDecorations")}static{this.SCMTitle=new gu("SCMTitle")}static{this.SearchContext=new gu("SearchContext")}static{this.SearchActionMenu=new gu("SearchActionContext")}static{this.StatusBarWindowIndicatorMenu=new gu("StatusBarWindowIndicatorMenu")}static{this.StatusBarRemoteIndicatorMenu=new gu("StatusBarRemoteIndicatorMenu")}static{this.StickyScrollContext=new gu("StickyScrollContext")}static{this.TestItem=new gu("TestItem")}static{this.TestItemGutter=new gu("TestItemGutter")}static{this.TestProfilesContext=new gu("TestProfilesContext")}static{this.TestMessageContext=new gu("TestMessageContext")}static{this.TestMessageContent=new gu("TestMessageContent")}static{this.TestPeekElement=new gu("TestPeekElement")}static{this.TestPeekTitle=new gu("TestPeekTitle")}static{this.TestCallStack=new gu("TestCallStack")}static{this.TestCoverageFilterItem=new gu("TestCoverageFilterItem")}static{this.TouchBarContext=new gu("TouchBarContext")}static{this.TitleBar=new gu("TitleBar")}static{this.TitleBarContext=new gu("TitleBarContext")}static{this.TitleBarTitleContext=new gu("TitleBarTitleContext")}static{this.TunnelContext=new gu("TunnelContext")}static{this.TunnelPrivacy=new gu("TunnelPrivacy")}static{this.TunnelProtocol=new gu("TunnelProtocol")}static{this.TunnelPortInline=new gu("TunnelInline")}static{this.TunnelTitle=new gu("TunnelTitle")}static{this.TunnelLocalAddressInline=new gu("TunnelLocalAddressInline")}static{this.TunnelOriginInline=new gu("TunnelOriginInline")}static{this.ViewItemContext=new gu("ViewItemContext")}static{this.ViewContainerTitle=new gu("ViewContainerTitle")}static{this.ViewContainerTitleContext=new gu("ViewContainerTitleContext")}static{this.ViewTitle=new gu("ViewTitle")}static{this.ViewTitleContext=new gu("ViewTitleContext")}static{this.CommentEditorActions=new gu("CommentEditorActions")}static{this.CommentThreadTitle=new gu("CommentThreadTitle")}static{this.CommentThreadActions=new gu("CommentThreadActions")}static{this.CommentThreadAdditionalActions=new gu("CommentThreadAdditionalActions")}static{this.CommentThreadTitleContext=new gu("CommentThreadTitleContext")}static{this.CommentThreadCommentContext=new gu("CommentThreadCommentContext")}static{this.CommentTitle=new gu("CommentTitle")}static{this.CommentActions=new gu("CommentActions")}static{this.CommentsViewThreadActions=new gu("CommentsViewThreadActions")}static{this.InteractiveToolbar=new gu("InteractiveToolbar")}static{this.InteractiveCellTitle=new gu("InteractiveCellTitle")}static{this.InteractiveCellDelete=new gu("InteractiveCellDelete")}static{this.InteractiveCellExecute=new gu("InteractiveCellExecute")}static{this.InteractiveInputExecute=new gu("InteractiveInputExecute")}static{this.InteractiveInputConfig=new gu("InteractiveInputConfig")}static{this.ReplInputExecute=new gu("ReplInputExecute")}static{this.IssueReporter=new gu("IssueReporter")}static{this.NotebookToolbar=new gu("NotebookToolbar")}static{this.NotebookToolbarContext=new gu("NotebookToolbarContext")}static{this.NotebookStickyScrollContext=new gu("NotebookStickyScrollContext")}static{this.NotebookCellTitle=new gu("NotebookCellTitle")}static{this.NotebookCellDelete=new gu("NotebookCellDelete")}static{this.NotebookCellInsert=new gu("NotebookCellInsert")}static{this.NotebookCellBetween=new gu("NotebookCellBetween")}static{this.NotebookCellListTop=new gu("NotebookCellTop")}static{this.NotebookCellExecute=new gu("NotebookCellExecute")}static{this.NotebookCellExecuteGoTo=new gu("NotebookCellExecuteGoTo")}static{this.NotebookCellExecutePrimary=new gu("NotebookCellExecutePrimary")}static{this.NotebookDiffCellInputTitle=new gu("NotebookDiffCellInputTitle")}static{this.NotebookDiffDocumentMetadata=new gu("NotebookDiffDocumentMetadata")}static{this.NotebookDiffCellMetadataTitle=new gu("NotebookDiffCellMetadataTitle")}static{this.NotebookDiffCellOutputsTitle=new gu("NotebookDiffCellOutputsTitle")}static{this.NotebookOutputToolbar=new gu("NotebookOutputToolbar")}static{this.NotebookOutlineFilter=new gu("NotebookOutlineFilter")}static{this.NotebookOutlineActionMenu=new gu("NotebookOutlineActionMenu")}static{this.NotebookEditorLayoutConfigure=new gu("NotebookEditorLayoutConfigure")}static{this.NotebookKernelSource=new gu("NotebookKernelSource")}static{this.BulkEditTitle=new gu("BulkEditTitle")}static{this.BulkEditContext=new gu("BulkEditContext")}static{this.TimelineItemContext=new gu("TimelineItemContext")}static{this.TimelineTitle=new gu("TimelineTitle")}static{this.TimelineTitleContext=new gu("TimelineTitleContext")}static{this.TimelineFilterSubMenu=new gu("TimelineFilterSubMenu")}static{this.AccountsContext=new gu("AccountsContext")}static{this.SidebarTitle=new gu("SidebarTitle")}static{this.PanelTitle=new gu("PanelTitle")}static{this.AuxiliaryBarTitle=new gu("AuxiliaryBarTitle")}static{this.TerminalInstanceContext=new gu("TerminalInstanceContext")}static{this.TerminalEditorInstanceContext=new gu("TerminalEditorInstanceContext")}static{this.TerminalNewDropdownContext=new gu("TerminalNewDropdownContext")}static{this.TerminalTabContext=new gu("TerminalTabContext")}static{this.TerminalTabEmptyAreaContext=new gu("TerminalTabEmptyAreaContext")}static{this.TerminalStickyScrollContext=new gu("TerminalStickyScrollContext")}static{this.WebviewContext=new gu("WebviewContext")}static{this.InlineCompletionsActions=new gu("InlineCompletionsActions")}static{this.InlineEditsActions=new gu("InlineEditsActions")}static{this.NewFile=new gu("NewFile")}static{this.MergeInput1Toolbar=new gu("MergeToolbar1Toolbar")}static{this.MergeInput2Toolbar=new gu("MergeToolbar2Toolbar")}static{this.MergeBaseToolbar=new gu("MergeBaseToolbar")}static{this.MergeInputResultToolbar=new gu("MergeToolbarResultToolbar")}static{this.InlineSuggestionToolbar=new gu("InlineSuggestionToolbar")}static{this.InlineEditToolbar=new gu("InlineEditToolbar")}static{this.ChatContext=new gu("ChatContext")}static{this.ChatCodeBlock=new gu("ChatCodeblock")}static{this.ChatCompareBlock=new gu("ChatCompareBlock")}static{this.ChatMessageTitle=new gu("ChatMessageTitle")}static{this.ChatHistory=new gu("ChatHistory")}static{this.ChatWelcomeHistoryContext=new gu("ChatWelcomeHistoryContext")}static{this.ChatMessageFooter=new gu("ChatMessageFooter")}static{this.ChatExecute=new gu("ChatExecute")}static{this.ChatExecuteSecondary=new gu("ChatExecuteSecondary")}static{this.ChatInput=new gu("ChatInput")}static{this.ChatInputSide=new gu("ChatInputSide")}static{this.ChatModePicker=new gu("ChatModePicker")}static{this.ChatEditingWidgetToolbar=new gu("ChatEditingWidgetToolbar")}static{this.ChatEditingEditorContent=new gu("ChatEditingEditorContent")}static{this.ChatEditingEditorHunk=new gu("ChatEditingEditorHunk")}static{this.ChatEditingDeletedNotebookCell=new gu("ChatEditingDeletedNotebookCell")}static{this.ChatInputAttachmentToolbar=new gu("ChatInputAttachmentToolbar")}static{this.ChatEditingWidgetModifiedFilesToolbar=new gu("ChatEditingWidgetModifiedFilesToolbar")}static{this.ChatInputResourceAttachmentContext=new gu("ChatInputResourceAttachmentContext")}static{this.ChatInputSymbolAttachmentContext=new gu("ChatInputSymbolAttachmentContext")}static{this.ChatInlineResourceAnchorContext=new gu("ChatInlineResourceAnchorContext")}static{this.ChatInlineSymbolAnchorContext=new gu("ChatInlineSymbolAnchorContext")}static{this.ChatMessageCheckpoint=new gu("ChatMessageCheckpoint")}static{this.ChatMessageRestoreCheckpoint=new gu("ChatMessageRestoreCheckpoint")}static{this.ChatEditingCodeBlockContext=new gu("ChatEditingCodeBlockContext")}static{this.ChatTitleBarMenu=new gu("ChatTitleBarMenu")}static{this.ChatAttachmentsContext=new gu("ChatAttachmentsContext")}static{this.ChatToolOutputResourceToolbar=new gu("ChatToolOutputResourceToolbar")}static{this.ChatTextEditorMenu=new gu("ChatTextEditorMenu")}static{this.ChatToolOutputResourceContext=new gu("ChatToolOutputResourceContext")}static{this.ChatMultiDiffContext=new gu("ChatMultiDiffContext")}static{this.ChatSessionsMenu=new gu("ChatSessionsMenu")}static{this.ChatConfirmationMenu=new gu("ChatConfirmationMenu")}static{this.AccessibleView=new gu("AccessibleView")}static{this.MultiDiffEditorFileToolbar=new gu("MultiDiffEditorFileToolbar")}static{this.DiffEditorHunkToolbar=new gu("DiffEditorHunkToolbar")}static{this.DiffEditorSelectionToolbar=new gu("DiffEditorSelectionToolbar")}constructor(e){if(gu._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);gu._instances.set(e,this),this.id=e}}const pu=oc("menuService");class mu{static{this._all=new Map}static for(e){let t=this._all.get(e);return t||(t=new mu(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const i of e)i instanceof mu&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}}const fu=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Jt({merge:mu.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(e){return this._commands.set(e.id,e),this._onDidChangeMenu.fire(mu.for(gu.CommandPalette)),Lt(Tt((()=>{this._commands.delete(e.id)&&this._onDidChangeMenu.fire(mu.for(gu.CommandPalette))})))}getCommand(e){return this._commands.get(e)}getCommands(){const e=new Map;return this._commands.forEach(((t,i)=>e.set(i,t))),e}appendMenuItem(e,t){let i=this._menuItems.get(e);i||(i=new Wt,this._menuItems.set(e,i));const n=i.push(t);return this._onDidChangeMenu.fire(mu.for(e)),Lt(Tt((()=>{n(),this._onDidChangeMenu.fire(mu.for(e))})))}appendMenuItems(e){const t=new Mt;for(const{id:i,item:n}of e)t.add(this.appendMenuItem(i,n));return t}getMenuItems(e){let t;return t=this._menuItems.has(e)?[...this._menuItems.get(e)]:[],e===gu.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(e){const t=new Set;for(const i of e)uu(i)&&(t.add(i.command.id),i.alt&&t.add(i.alt.id));this._commands.forEach(((i,n)=>{t.has(n)||e.push({command:i})}))}};class _u extends uc{constructor(e,t,i){super(`submenuitem.${e.submenu.id}`,"string"==typeof e.title?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let vu=hu=class{static label(e,t){return t?.renderShortTitle&&e.shortTitle?"string"==typeof e.shortTitle?e.shortTitle:e.shortTitle.value:"string"==typeof e.title?e.title:e.title.value}constructor(e,t,i,n,o,s,r){let a;if(this.hideActions=n,this.menuKeybinding=o,this._commandService=r,this.id=e.id,this.label=hu.label(e,i),this.tooltip=("string"==typeof e.tooltip?e.tooltip:e.tooltip?.value)??"",this.enabled=!e.precondition||s.contextMatchesRules(e.precondition),this.checked=void 0,e.toggled){const t=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=s.contextMatchesRules(t.condition),this.checked&&t.tooltip&&(this.tooltip="string"==typeof t.tooltip?t.tooltip:t.tooltip.value),this.checked&&vh.isThemeIcon(t.icon)&&(a=t.icon),this.checked&&t.title&&(this.label="string"==typeof t.title?t.title:t.title.value)}a||(a=vh.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new hu(t,void 0,i,n,void 0,s,r):void 0,this._options=i,this.class=a&&vh.asClassName(a)}run(...e){let t=[];return this._options?.arg&&(t=[...t,this._options.arg]),this._options?.shouldForwardArgs&&(t=[...t,...e]),this._commandService.executeCommand(this.id,...t)}};vu=hu=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([cu(5,eu),cu(6,mc)],vu);class bu{constructor(e){this.desc=e}}function wu(e){const t=[],i=new e,{f1:n,menu:o,keybinding:s,...r}=i.desc;if(fc.getCommand(r.id))throw new Error(`Cannot register two commands with the same id: ${r.id}`);if(t.push(fc.registerCommand({id:r.id,handler:(e,...t)=>i.run(e,...t),metadata:r.metadata??{description:i.desc.title}})),Array.isArray(o))for(const e of o)t.push(fu.appendMenuItem(e.id,{command:{...r,precondition:null===e.precondition?void 0:r.precondition},...e}));else o&&t.push(fu.appendMenuItem(o.id,{command:{...r,precondition:null===o.precondition?void 0:r.precondition},...o}));if(n&&(t.push(fu.appendMenuItem(gu.CommandPalette,{command:r,when:r.precondition})),t.push(fu.addCommand(r))),Array.isArray(s))for(const e of s)t.push(lu.registerKeybindingRule({...e,id:r.id,when:r.precondition?Ac.and(r.precondition,e.when):e.when}));else s&&t.push(lu.registerKeybindingRule({...s,id:r.id,when:r.precondition?Ac.and(r.precondition,s.when):s.when}));return{dispose(){Et(t)}}}const Cu=oc("telemetryService"),yu=oc("logService"),Su=oc("loggerService");var xu;!function(e){e[e.Off=0]="Off",e[e.Trace=1]="Trace",e[e.Debug=2]="Debug",e[e.Info=3]="Info",e[e.Warning=4]="Warning",e[e.Error=5]="Error"}(xu||(xu={}));const ku=xu.Info;function Lu(e,t){return e!==xu.Off&&e<=t}class Du extends At{constructor(){super(...arguments),this.level=ku,this._onDidChangeLogLevel=this._register(new Zt)}get onDidChangeLogLevel(){return this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return Lu(this.level,e)}canLog(e){return!this._store.isDisposed&&this.checkLogLevel(e)}}class Eu extends Du{constructor(e=ku,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.canLog(xu.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.canLog(xu.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.canLog(xu.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.canLog(xu.Warning)&&(this.useColors?console.warn("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.canLog(xu.Error)&&(this.useColors?console.error("%c ERR","color: #f33",e,...t):console.error(e,...t))}}class Nu extends Du{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const i of this.loggers)i.trace(e,...t)}debug(e,...t){for(const i of this.loggers)i.debug(e,...t)}info(e,...t){for(const i of this.loggers)i.info(e,...t)}warn(e,...t){for(const i of this.loggers)i.warn(e,...t)}error(e,...t){for(const i of this.loggers)i.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose();super.dispose()}}class Iu extends At{constructor(e,t,i){if(super(),this.logLevel=e,this.logsHome=t,this._loggers=new nd,this._onDidChangeLoggers=this._register(new Zt),this._onDidChangeVisibility=this._register(new Zt),i)for(const e of i)this._loggers.set(e.resource,{logger:void 0,info:e})}getLoggerEntry(e){return lt(e)?[...this._loggers.values()].find((t=>t.info.id===e)):this._loggers.get(e)}createLogger(e,t){const i=this.toResource(e),n=lt(e)?e:t?.id??Vo(i.toString()).toString(16);let o=this._loggers.get(i)?.logger;const s="always"===t?.logLevel?xu.Trace:t?.logLevel;o||(o=this.doCreateLogger(i,s??this.getLogLevel(i)??this.logLevel,{...t,id:n}));const r={logger:o,info:{resource:i,id:n,logLevel:s,name:t?.name,hidden:t?.hidden,group:t?.group,extensionId:t?.extensionId,when:t?.when}};return this.registerLogger(r.info),this._loggers.set(i,r),o}toResource(e){return lt(e)?Hh(this.logsHome,`${e}.log`):e}setVisibility(e,t){const i=this.getLoggerEntry(e);i&&t!==!i.info.hidden&&(i.info.hidden=!t,this._loggers.set(i.info.resource,i),this._onDidChangeVisibility.fire([i.info.resource,t]))}getLogLevel(e){let t;return e&&(t=this._loggers.get(e)?.info.logLevel),t??this.logLevel}registerLogger(e){const t=this._loggers.get(e.resource);t?t.info.hidden!==e.hidden&&this.setVisibility(e.resource,!e.hidden):(this._loggers.set(e.resource,{info:e,logger:void 0}),this._onDidChangeLoggers.fire({added:[e],removed:[]}))}dispose(){this._loggers.forEach((e=>e.logger?.dispose())),this._loggers.clear(),super.dispose()}}class Tu{constructor(){this.onDidChangeLogLevel=(new Zt).event}setLevel(e){}getLevel(){return xu.Info}trace(e,...t){}debug(e,...t){}info(e,...t){}warn(e,...t){}error(e,...t){}dispose(){}}new Jc("logLevel",function(e){switch(e){case xu.Trace:return"trace";case xu.Debug:return"debug";case xu.Info:return"info";case xu.Warning:return"warn";case xu.Error:return"error";case xu.Off:return"off"}}(xu.Info));class Mu{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this.metadata=e.metadata}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let e=t.kbExpr;this.precondition&&(e=e?Ac.and(e,this.precondition):this.precondition);const i={id:this.id,weight:t.weight,args:t.args,when:e,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};lu.registerKeybindingRule(i)}}fc.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata})}_registerMenuItem(e){fu.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}}class Au extends Mu{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i,n){return this._implementations.push({priority:e,name:t,implementation:i,when:n}),this._implementations.sort(((e,t)=>t.priority-e.priority)),{dispose:()=>{for(let e=0;e<this._implementations.length;e++)if(this._implementations[e].implementation===i)return void this._implementations.splice(e,1)}}}runCommand(e,t){const i=e.get(yu),n=e.get(eu);i.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);for(const o of this._implementations){if(o.when){const e=n.getContext(Va());if(!o.when.evaluate(e))continue}const s=o.implementation(e,t);if(s){if(i.trace(`Command '${this.id}' was handled by '${o.name}'.`),"boolean"==typeof s)return;return s}}i.trace(`The Command '${this.id}' was not handled by any implementation.`)}}class Ru extends Mu{constructor(e,t){super(t),this.command=e}runCommand(e,t){return this.command.runCommand(e,t)}}class Ou extends Mu{static bindToContribution(e){return class extends Ou{constructor(e){super(e),this._callback=e.handler}runEditorCommand(t,i,n){const o=e(i);o&&this._callback(o,n)}}}static runEditorCommand(e,t,i,n){const o=e.get(sc),s=o.getFocusedCodeEditor()||o.getActiveCodeEditor();if(s)return s.invokeWithinContext((e=>{if(e.get(eu).contextMatchesRules(i??void 0))return n(e,s,t)}))}runCommand(e,t){return Ou.runEditorCommand(e,t,this.precondition,((e,t,i)=>this.runEditorCommand(e,t,i)))}}class Pu extends Ou{static convertOptions(e){let t;function i(t){return t.menuId||(t.menuId=gu.EditorContext),t.title||(t.title="string"==typeof e.label?e.label:e.label.value),t.when=Ac.and(e.precondition,t.when),t}return t=Array.isArray(e.menuOpts)?e.menuOpts:e.menuOpts?[e.menuOpts]:[],Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(Pu.convertOptions(e)),"string"==typeof e.label?(this.label=e.label,this.alias=e.alias??e.label):(this.label=e.label.value,this.alias=e.alias??e.label.original)}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(Cu).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class Fu extends Pu{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort(((e,t)=>t[0]-e[0])),{dispose:()=>{for(let e=0;e<this._implementations.length;e++)if(this._implementations[e][1]===t)return void this._implementations.splice(e,1)}}}run(e,t,i){for(const n of this._implementations){const o=n[1](e,t,i);if(o){if("boolean"==typeof o)return;return o}}}}class Bu extends bu{run(e,...t){const i=e.get(sc),n=i.getFocusedCodeEditor()||i.getActiveCodeEditor();if(n)return n.invokeWithinContext((e=>{const i=e.get(eu),o=e.get(yu);if(i.contextMatchesRules(this.desc.precondition??void 0))return this.runEditorCommand(e,n,...t);o.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,this.desc.precondition?.serialize())}))}}function Wu(e,t){fc.registerCommand(e,(function(e,...i){const n=e.get(nc),[o,s]=i;_t(uo.isUri(o)),_t(rc.isIPosition(s));const r=e.get(ac).getModel(o);if(r){const e=rc.lift(s);return n.invokeFunction(t,r,e,...i.slice(2))}return e.get(lc).createModelReference(o).then((e=>new Promise(((o,r)=>{try{o(n.invokeFunction(t,e.object.textEditorModel,rc.lift(s),i.slice(2)))}catch(e){r(e)}})).finally((()=>{e.dispose()}))))}))}function Vu(e){return ju.INSTANCE.registerEditorCommand(e),e}function Hu(e){const t=new e;return ju.INSTANCE.registerEditorAction(t),t}function zu(e){return ju.INSTANCE.registerEditorAction(e),e}function Uu(e,t,i){ju.INSTANCE.registerEditorContribution(e,t,i)}var Ku;!function(e){e.getEditorCommand=function(e){return ju.INSTANCE.getEditorCommand(e)},e.getEditorActions=function(){return ju.INSTANCE.getEditorActions()},e.getEditorContributions=function(){return ju.INSTANCE.getEditorContributions()},e.getSomeEditorContributions=function(e){return ju.INSTANCE.getEditorContributions().filter((t=>e.indexOf(t.id)>=0))},e.getDiffEditorContributions=function(){return ju.INSTANCE.getDiffEditorContributions()}}(Ku||(Ku={}));class ju{static{this.INSTANCE=new ju}constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,i){this.editorContributions.push({id:e,ctor:t,instantiation:i})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}function qu(e){return e.register(),e}ru.add("editor.contributions",ju.INSTANCE);const $u=qu(new Au({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:gu.MenubarEditMenu,group:"1_do",title:y(64,"&&Undo"),order:1},{menuId:gu.CommandPalette,group:"",title:y(65,"Undo"),order:1},{menuId:gu.SimpleEditorContext,group:"1_do",title:y(66,"Undo"),order:1}]}));qu(new Ru($u,{id:"default:undo",precondition:void 0}));const Gu=qu(new Au({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:gu.MenubarEditMenu,group:"1_do",title:y(67,"&&Redo"),order:2},{menuId:gu.CommandPalette,group:"",title:y(68,"Redo"),order:1},{menuId:gu.SimpleEditorContext,group:"1_do",title:y(69,"Redo"),order:2}]}));qu(new Ru(Gu,{id:"default:redo",precondition:void 0}));const Zu=qu(new Au({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:gu.MenubarSelectionMenu,group:"1_basic",title:y(70,"&&Select All"),order:1},{menuId:gu.CommandPalette,group:"",title:y(71,"Select All"),order:1},{menuId:gu.SimpleEditorContext,group:"9_select",title:y(72,"Select All"),order:1}]}));class Yu{constructor(e,t,i,n){e>i||e===i&&t>n?(this.startLineNumber=i,this.startColumn=n,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=n)}isEmpty(){return Yu.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return Yu.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<e.startColumn||t.lineNumber===e.endLineNumber&&t.column>e.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return Yu.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>e.endColumn)}strictContainsRange(e){return Yu.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return Yu.plusRange(this,e)}static plusRange(e,t){let i,n,o,s;return t.startLineNumber<e.startLineNumber?(i=t.startLineNumber,n=t.startColumn):t.startLineNumber===e.startLineNumber?(i=t.startLineNumber,n=Math.min(t.startColumn,e.startColumn)):(i=e.startLineNumber,n=e.startColumn),t.endLineNumber>e.endLineNumber?(o=t.endLineNumber,s=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,s=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,s=e.endColumn),new Yu(i,n,o,s)}intersectRanges(e){return Yu.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,s=e.endColumn;const r=t.startLineNumber,a=t.startColumn,l=t.endLineNumber,d=t.endColumn;return i<r?(i=r,n=a):i===r&&(n=Math.max(n,a)),o>l?(o=l,s=d):o===l&&(s=Math.min(s,d)),i>o||i===o&&n>s?null:new Yu(i,n,o,s)}equalsRange(e){return Yu.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t||!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return Yu.getEndPosition(this)}static getEndPosition(e){return new rc(e.endLineNumber,e.endColumn)}getStartPosition(){return Yu.getStartPosition(this)}static getStartPosition(e){return new rc(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new Yu(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new Yu(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return Yu.collapseToStart(this)}static collapseToStart(e){return new Yu(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return Yu.collapseToEnd(this)}static collapseToEnd(e){return new Yu(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new Yu(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,t=e){return new Yu(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new Yu(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&"number"==typeof e.startLineNumber&&"number"==typeof e.startColumn&&"number"==typeof e.endLineNumber&&"number"==typeof e.endColumn}static areIntersectingOrTouching(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn)}static areIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<=t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<=e.startColumn)}static areOnlyIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber-1||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn-1||t.endLineNumber<e.startLineNumber-1||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn-1)}static compareRangesUsingStarts(e,t){if(e&&t){const i=0|e.startLineNumber,n=0|t.startLineNumber;if(i===n){const i=0|e.startColumn,n=0|t.startColumn;if(i===n){const i=0|e.endLineNumber,n=0|t.endLineNumber;return i===n?(0|e.endColumn)-(0|t.endColumn):i-n}return i-n}return i-n}return(e?1:0)-(t?1:0)}static compareRangesUsingEnds(e,t){return e.endLineNumber===t.endLineNumber?e.endColumn===t.endColumn?e.startLineNumber===t.startLineNumber?e.startColumn-t.startColumn:e.startLineNumber-t.startLineNumber:e.endColumn-t.endColumn:e.endLineNumber-t.endLineNumber}static spansMultipleLines(e){return e.endLineNumber>e.startLineNumber}toJSON(){return this}}class Qu extends Yu{constructor(e,t,i,n){super(e,t,i,n),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=n}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return Qu.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return 0===this.getDirection()?new Qu(this.startLineNumber,this.startColumn,e,t):new Qu(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new rc(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new rc(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return 0===this.getDirection()?new Qu(e,t,this.endLineNumber,this.endColumn):new Qu(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new Qu(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return 0===t?new Qu(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new Qu(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new Qu(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let i=0,n=e.length;i<n;i++)if(!this.selectionsEqual(e[i],t[i]))return!1;return!0}static isISelection(e){return e&&"number"==typeof e.selectionStartLineNumber&&"number"==typeof e.selectionStartColumn&&"number"==typeof e.positionLineNumber&&"number"==typeof e.positionColumn}static createWithDirection(e,t,i,n,o){return 0===o?new Qu(e,t,i,n):new Qu(i,n,e,t)}}var Xu;!function(e){e.editorSimpleInput=new Jc("editorSimpleInput",!1,!0),e.editorTextFocus=new Jc("editorTextFocus",!1,y(678,"Whether the editor text has focus (cursor is blinking)")),e.focus=new Jc("editorFocus",!1,y(679,"Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),e.textInputFocus=new Jc("textInputFocus",!1,y(680,"Whether an editor or a rich text input has focus (cursor is blinking)")),e.readOnly=new Jc("editorReadonly",!1,y(681,"Whether the editor is read-only")),e.inDiffEditor=new Jc("inDiffEditor",!1,y(682,"Whether the context is a diff editor")),e.isEmbeddedDiffEditor=new Jc("isEmbeddedDiffEditor",!1,y(683,"Whether the context is an embedded diff editor")),e.multiDiffEditorAllCollapsed=new Jc("multiDiffEditorAllCollapsed",void 0,y(684,"Whether all files in multi diff editor are collapsed")),e.hasChanges=new Jc("diffEditorHasChanges",!1,y(685,"Whether the diff editor has changes")),e.comparingMovedCode=new Jc("comparingMovedCode",!1,y(686,"Whether a moved code block is selected for comparison")),e.accessibleDiffViewerVisible=new Jc("accessibleDiffViewerVisible",!1,y(687,"Whether the accessible diff viewer is visible")),e.diffEditorRenderSideBySideInlineBreakpointReached=new Jc("diffEditorRenderSideBySideInlineBreakpointReached",!1,y(688,"Whether the diff editor render side by side inline breakpoint is reached")),e.diffEditorInlineMode=new Jc("diffEditorInlineMode",!1,y(689,"Whether inline mode is active")),e.diffEditorOriginalWritable=new Jc("diffEditorOriginalWritable",!1,y(690,"Whether modified is writable in the diff editor")),e.diffEditorModifiedWritable=new Jc("diffEditorModifiedWritable",!1,y(691,"Whether modified is writable in the diff editor")),e.diffEditorOriginalUri=new Jc("diffEditorOriginalUri","",y(692,"The uri of the original document")),e.diffEditorModifiedUri=new Jc("diffEditorModifiedUri","",y(693,"The uri of the modified document")),e.columnSelection=new Jc("editorColumnSelection",!1,y(694,"Whether `editor.columnSelection` is enabled")),e.writable=e.readOnly.toNegated(),e.hasNonEmptySelection=new Jc("editorHasSelection",!1,y(695,"Whether the editor has text selected")),e.hasOnlyEmptySelection=e.hasNonEmptySelection.toNegated(),e.hasMultipleSelections=new Jc("editorHasMultipleSelections",!1,y(696,"Whether the editor has multiple selections")),e.hasSingleSelection=e.hasMultipleSelections.toNegated(),e.tabMovesFocus=new Jc("editorTabMovesFocus",!1,y(697,"Whether `Tab` will move focus out of the editor")),e.tabDoesNotMoveFocus=e.tabMovesFocus.toNegated(),e.isInEmbeddedEditor=new Jc("isInEmbeddedEditor",!1,!0),e.canUndo=new Jc("canUndo",!1,!0),e.canRedo=new Jc("canRedo",!1,!0),e.hoverVisible=new Jc("editorHoverVisible",!1,y(698,"Whether the editor hover is visible")),e.hoverFocused=new Jc("editorHoverFocused",!1,y(699,"Whether the editor hover is focused")),e.stickyScrollFocused=new Jc("stickyScrollFocused",!1,y(700,"Whether the sticky scroll is focused")),e.stickyScrollVisible=new Jc("stickyScrollVisible",!1,y(701,"Whether the sticky scroll is visible")),e.standaloneColorPickerVisible=new Jc("standaloneColorPickerVisible",!1,y(702,"Whether the standalone color picker is visible")),e.standaloneColorPickerFocused=new Jc("standaloneColorPickerFocused",!1,y(703,"Whether the standalone color picker is focused")),e.inCompositeEditor=new Jc("inCompositeEditor",void 0,y(704,"Whether the editor is part of a larger editor (e.g. notebooks)")),e.notInCompositeEditor=e.inCompositeEditor.toNegated(),e.languageId=new Jc("editorLangId","",y(705,"The language identifier of the editor")),e.hasCompletionItemProvider=new Jc("editorHasCompletionItemProvider",!1,y(706,"Whether the editor has a completion item provider")),e.hasCodeActionsProvider=new Jc("editorHasCodeActionsProvider",!1,y(707,"Whether the editor has a code actions provider")),e.hasCodeLensProvider=new Jc("editorHasCodeLensProvider",!1,y(708,"Whether the editor has a code lens provider")),e.hasDefinitionProvider=new Jc("editorHasDefinitionProvider",!1,y(709,"Whether the editor has a definition provider")),e.hasDeclarationProvider=new Jc("editorHasDeclarationProvider",!1,y(710,"Whether the editor has a declaration provider")),e.hasImplementationProvider=new Jc("editorHasImplementationProvider",!1,y(711,"Whether the editor has an implementation provider")),e.hasTypeDefinitionProvider=new Jc("editorHasTypeDefinitionProvider",!1,y(712,"Whether the editor has a type definition provider")),e.hasHoverProvider=new Jc("editorHasHoverProvider",!1,y(713,"Whether the editor has a hover provider")),e.hasDocumentHighlightProvider=new Jc("editorHasDocumentHighlightProvider",!1,y(714,"Whether the editor has a document highlight provider")),e.hasDocumentSymbolProvider=new Jc("editorHasDocumentSymbolProvider",!1,y(715,"Whether the editor has a document symbol provider")),e.hasReferenceProvider=new Jc("editorHasReferenceProvider",!1,y(716,"Whether the editor has a reference provider")),e.hasRenameProvider=new Jc("editorHasRenameProvider",!1,y(717,"Whether the editor has a rename provider")),e.hasSignatureHelpProvider=new Jc("editorHasSignatureHelpProvider",!1,y(718,"Whether the editor has a signature help provider")),e.hasInlayHintsProvider=new Jc("editorHasInlayHintsProvider",!1,y(719,"Whether the editor has an inline hints provider")),e.hasDocumentFormattingProvider=new Jc("editorHasDocumentFormattingProvider",!1,y(720,"Whether the editor has a document formatting provider")),e.hasDocumentSelectionFormattingProvider=new Jc("editorHasDocumentSelectionFormattingProvider",!1,y(721,"Whether the editor has a document selection formatting provider")),e.hasMultipleDocumentFormattingProvider=new Jc("editorHasMultipleDocumentFormattingProvider",!1,y(722,"Whether the editor has multiple document formatting providers")),e.hasMultipleDocumentSelectionFormattingProvider=new Jc("editorHasMultipleDocumentSelectionFormattingProvider",!1,y(723,"Whether the editor has multiple document selection formatting providers"))}(Xu||(Xu={}));var Ju;const eg=new Jc("selectionAnchorSet",!1);let tg=class{static{Ju=this}static{this.ID="editor.contrib.selectionAnchorController"}static get(e){return e.getContribution(Ju.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=eg.bindTo(t),this.modelChangeListener=e.onDidChangeModel((()=>this.selectionAnchorSetContextKey.reset()))}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations((t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(Qu.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:(new Gh).appendText(y(794,"Selection Anchor")),className:"selection-anchor"})})),this.selectionAnchorSetContextKey.set(!!this.decorationId),Yl(y(795,"Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(Qu.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations((t=>{t.removeDecoration(e),this.decorationId=void 0})),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};var ig,ng;tg=Ju=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([(ig=1,ng=eu,function(e,t){ng(e,t,ig)})],tg),Uu(tg.ID,tg,4),Hu(class extends Pu{constructor(){super({id:"editor.action.setSelectionAnchor",label:x(796,"Set Selection Anchor"),precondition:void 0,kbOpts:{kbExpr:Xu.editorTextFocus,primary:De(2089,2080),weight:100}})}async run(e,t){tg.get(t)?.setSelectionAnchor()}}),Hu(class extends Pu{constructor(){super({id:"editor.action.goToSelectionAnchor",label:x(797,"Go to Selection Anchor"),precondition:eg})}async run(e,t){tg.get(t)?.goToSelectionAnchor()}}),Hu(class extends Pu{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:x(798,"Select from Anchor to Cursor"),precondition:eg,kbOpts:{kbExpr:Xu.editorTextFocus,primary:De(2089,2089),weight:100}})}async run(e,t){tg.get(t)?.selectFromAnchorToCursor()}}),Hu(class extends Pu{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:x(799,"Cancel Selection Anchor"),precondition:eg,kbOpts:{kbExpr:Xu.editorTextFocus,primary:9,weight:100}})}async run(e,t){tg.get(t)?.cancelSelectionAnchor()}});var og=i(7997),sg={};function rg(e){if(!e||"object"!=typeof e)return e;if(e instanceof RegExp)return e;const t=Array.isArray(e)?[]:{};return Object.entries(e).forEach((([e,i])=>{t[e]=i&&"object"==typeof i?rg(i):i})),t}sg.styleTagTransform=zl(),sg.setAttributes=Bl(),sg.insert=Pl().bind(null,"head"),sg.domAPI=Rl(),sg.insertStyleElement=Vl(),Ml()(og.A,sg),og.A&&og.A.locals&&og.A.locals;const ag=Object.prototype.hasOwnProperty;function lg(e,t){return dg(e,t,new Set)}function dg(e,t,i){if(ft(e))return e;const n=t(e);if(void 0!==n)return n;if(Array.isArray(e)){const n=[];for(const o of e)n.push(dg(o,t,i));return n}if(dt(e)){if(i.has(e))throw new Error("Cannot clone recursive data-structure");i.add(e);const n={};for(const o in e)ag.call(e,o)&&(n[o]=dg(e[o],t,i));return i.delete(e),n}return e}function hg(e,t,i=!0){return dt(e)?(dt(t)&&Object.keys(t).forEach((n=>{n in e?i&&(dt(e[n])&&dt(t[n])?hg(e[n],t[n],i):e[n]=t[n]):e[n]=t[n]})),e):t}function cg(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;let i,n;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(!cg(e[i],t[i]))return!1}else{const o=[];for(n in e)o.push(n);o.sort();const s=[];for(n in t)s.push(n);if(s.sort(),!cg(o,s))return!1;for(i=0;i<o.length;i++)if(!cg(e[o[i]],t[o[i]]))return!1}return!0}var ug,gg,pg,mg;!function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"}(ug||(ug={})),function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=3]="Right"}(gg||(gg={})),function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"}(pg||(pg={})),function(e){e[e.Both=0]="Both",e[e.Right=1]="Right",e[e.Left=2]="Left",e[e.None=3]="None"}(mg||(mg={}));class fg{get originalIndentSize(){return this._indentSizeIsTabSize?"tabSize":this.indentSize}constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,0|e.tabSize),"tabSize"===e.indentSize?(this.indentSize=this.tabSize,this._indentSizeIsTabSize=!0):(this.indentSize=Math.max(1,0|e.indentSize),this._indentSizeIsTabSize=!1),this.insertSpaces=Boolean(e.insertSpaces),this.defaultEOL=0|e.defaultEOL,this.trimAutoWhitespace=Boolean(e.trimAutoWhitespace),this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this._indentSizeIsTabSize===e._indentSizeIsTabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&cg(this.bracketPairColorizationOptions,e.bracketPairColorizationOptions)}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}}class _g{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}class vg{constructor(e,t,i,n,o,s){this.identifier=e,this.range=t,this.text=i,this.forceMoveMarkers=n,this.isAutoWhitespaceEdit=o,this._isTracked=s}}class bg{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}class wg{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}}function Cg(e){return!e.isTooLargeForSyncing()&&!e.isForSimpleWidget}function yg(e,t){const i=Math.pow(10,t);return Math.round(e*i)/i}class Sg{constructor(e,t,i,n=1){this._rgbaBrand=void 0,this.r=0|Math.min(255,Math.max(0,e)),this.g=0|Math.min(255,Math.max(0,t)),this.b=0|Math.min(255,Math.max(0,i)),this.a=yg(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class xg{constructor(e,t,i,n){this._hslaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=yg(Math.max(Math.min(1,t),0),3),this.l=yg(Math.max(Math.min(1,i),0),3),this.a=yg(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,n=e.b/255,o=e.a,s=Math.max(t,i,n),r=Math.min(t,i,n);let a=0,l=0;const d=(r+s)/2,h=s-r;if(h>0){switch(l=Math.min(d<=.5?h/(2*d):h/(2-2*d),1),s){case t:a=(i-n)/h+(i<n?6:0);break;case i:a=(n-t)/h+2;break;case n:a=(t-i)/h+4}a*=60,a=Math.round(a)}return new xg(a,l,d,o)}static _hue2rgb(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){const t=e.h/360,{s:i,l:n,a:o}=e;let s,r,a;if(0===i)s=r=a=n;else{const e=n<.5?n*(1+i):n+i-n*i,o=2*n-e;s=xg._hue2rgb(o,e,t+1/3),r=xg._hue2rgb(o,e,t),a=xg._hue2rgb(o,e,t-1/3)}return new Sg(Math.round(255*s),Math.round(255*r),Math.round(255*a),o)}}class kg{constructor(e,t,i,n){this._hsvaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=yg(Math.max(Math.min(1,t),0),3),this.v=yg(Math.max(Math.min(1,i),0),3),this.a=yg(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,n=e.b/255,o=Math.max(t,i,n),s=o-Math.min(t,i,n),r=0===o?0:s/o;let a;return a=0===s?0:o===t?((i-n)/s%6+6)%6:o===i?(n-t)/s+2:(t-i)/s+4,new kg(Math.round(60*a),r,o,e.a)}static toRGBA(e){const{h:t,s:i,v:n,a:o}=e,s=n*i,r=s*(1-Math.abs(t/60%2-1)),a=n-s;let[l,d,h]=[0,0,0];return t<60?(l=s,d=r):t<120?(l=r,d=s):t<180?(d=s,h=r):t<240?(d=r,h=s):t<300?(l=r,h=s):t<=360&&(l=s,h=r),l=Math.round(255*(l+a)),d=Math.round(255*(d+a)),h=Math.round(255*(h+a)),new Sg(l,d,h,o)}}class Lg{static fromHex(e){return Lg.Format.CSS.parseHex(e)||Lg.red}static equals(e,t){return!e&&!t||!(!e||!t)&&e.equals(t)}get hsla(){return this._hsla?this._hsla:xg.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:kg.fromRGBA(this.rgba)}constructor(e){if(!e)throw new Error("Color needs a value");if(e instanceof Sg)this.rgba=e;else if(e instanceof xg)this._hsla=e,this.rgba=xg.toRGBA(e);else{if(!(e instanceof kg))throw new Error("Invalid color ctor argument");this._hsva=e,this.rgba=kg.toRGBA(e)}}equals(e){return!!e&&Sg.equals(this.rgba,e.rgba)&&xg.equals(this.hsla,e.hsla)&&kg.equals(this.hsva,e.hsva)}getRelativeLuminance(){return yg(.2126*Lg._relativeLuminanceForComponent(this.rgba.r)+.7152*Lg._relativeLuminanceForComponent(this.rgba.g)+.0722*Lg._relativeLuminanceForComponent(this.rgba.b),4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3>=128}isLighterThan(e){return this.getRelativeLuminance()>e.getRelativeLuminance()}isDarkerThan(e){return this.getRelativeLuminance()<e.getRelativeLuminance()}lighten(e){return new Lg(new xg(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*e,this.hsla.a))}darken(e){return new Lg(new xg(this.hsla.h,this.hsla.s,this.hsla.l-this.hsla.l*e,this.hsla.a))}transparent(e){const{r:t,g:i,b:n,a:o}=this.rgba;return new Lg(new Sg(t,i,n,o*e))}isTransparent(){return 0===this.rgba.a}isOpaque(){return 1===this.rgba.a}opposite(){return new Lg(new Sg(255-this.rgba.r,255-this.rgba.g,255-this.rgba.b,this.rgba.a))}mix(e,t=.5){const i=Math.min(Math.max(t,0),1),n=this.rgba,o=e.rgba,s=n.r+(o.r-n.r)*i,r=n.g+(o.g-n.g)*i,a=n.b+(o.b-n.b)*i,l=n.a+(o.a-n.a)*i;return new Lg(new Sg(s,r,a,l))}makeOpaque(e){if(this.isOpaque()||1!==e.rgba.a)return this;const{r:t,g:i,b:n,a:o}=this.rgba;return new Lg(new Sg(e.rgba.r-o*(e.rgba.r-t),e.rgba.g-o*(e.rgba.g-i),e.rgba.b-o*(e.rgba.b-n),1))}toString(){return this._toString||(this._toString=Lg.Format.CSS.format(this)),this._toString}toNumber32Bit(){return this._toNumber32Bit||(this._toNumber32Bit=(this.rgba.r<<24|this.rgba.g<<16|this.rgba.b<<8|255*this.rgba.a)>>>0),this._toNumber32Bit}static getLighterColor(e,t,i){if(e.isLighterThan(t))return e;i=i||.5;const n=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(o-n)/o,e.lighten(i)}static getDarkerColor(e,t,i){if(e.isDarkerThan(t))return e;i=i||.5;const n=e.getRelativeLuminance();return i=i*(n-t.getRelativeLuminance())/n,e.darken(i)}static{this.white=new Lg(new Sg(255,255,255,1))}static{this.black=new Lg(new Sg(0,0,0,1))}static{this.red=new Lg(new Sg(255,0,0,1))}static{this.blue=new Lg(new Sg(0,0,255,1))}static{this.green=new Lg(new Sg(0,255,0,1))}static{this.cyan=new Lg(new Sg(0,255,255,1))}static{this.lightgrey=new Lg(new Sg(211,211,211,1))}static{this.transparent=new Lg(new Sg(0,0,0,0))}}function Dg(e){let t=0,i=0,n=0,o=0;for(let s=0,r=e.length;s<r;s++){const a=e.charCodeAt(s);13===a?(0===t&&(i=s),t++,s+1<r&&10===e.charCodeAt(s+1)?(o|=2,s++):o|=3,n=s+1):10===a&&(o|=1,0===t&&(i=s),t++,n=s+1)}return 0===t&&(i=e.length),[t,i,e.length-n,o]}!function(e){let t;!function(t){let i;!function(t){function i(e){const t=e.toString(16);return 2!==t.length?"0"+t:t}function n(t){const i=t.length;if(0===i)return null;if(35!==t.charCodeAt(0))return null;if(7===i){const i=16*o(t.charCodeAt(1))+o(t.charCodeAt(2)),n=16*o(t.charCodeAt(3))+o(t.charCodeAt(4)),s=16*o(t.charCodeAt(5))+o(t.charCodeAt(6));return new e(new Sg(i,n,s,1))}if(9===i){const i=16*o(t.charCodeAt(1))+o(t.charCodeAt(2)),n=16*o(t.charCodeAt(3))+o(t.charCodeAt(4)),s=16*o(t.charCodeAt(5))+o(t.charCodeAt(6)),r=16*o(t.charCodeAt(7))+o(t.charCodeAt(8));return new e(new Sg(i,n,s,r/255))}if(4===i){const i=o(t.charCodeAt(1)),n=o(t.charCodeAt(2)),s=o(t.charCodeAt(3));return new e(new Sg(16*i+i,16*n+n,16*s+s))}if(5===i){const i=o(t.charCodeAt(1)),n=o(t.charCodeAt(2)),s=o(t.charCodeAt(3)),r=o(t.charCodeAt(4));return new e(new Sg(16*i+i,16*n+n,16*s+s,(16*r+r)/255))}return null}function o(e){switch(e){case 48:return 0;case 49:return 1;case 50:return 2;case 51:return 3;case 52:return 4;case 53:return 5;case 54:return 6;case 55:return 7;case 56:return 8;case 57:return 9;case 97:case 65:return 10;case 98:case 66:return 11;case 99:case 67:return 12;case 100:case 68:return 13;case 101:case 69:return 14;case 102:case 70:return 15}return 0}t.formatRGB=function(t){return 1===t.rgba.a?`rgb(${t.rgba.r}, ${t.rgba.g}, ${t.rgba.b})`:e.Format.CSS.formatRGBA(t)},t.formatRGBA=function(e){return`rgba(${e.rgba.r}, ${e.rgba.g}, ${e.rgba.b}, ${+e.rgba.a.toFixed(2)})`},t.formatHSL=function(t){return 1===t.hsla.a?`hsl(${t.hsla.h}, ${Math.round(100*t.hsla.s)}%, ${Math.round(100*t.hsla.l)}%)`:e.Format.CSS.formatHSLA(t)},t.formatHSLA=function(e){return`hsla(${e.hsla.h}, ${Math.round(100*e.hsla.s)}%, ${Math.round(100*e.hsla.l)}%, ${e.hsla.a.toFixed(2)})`},t.formatHex=function(e){return`#${i(e.rgba.r)}${i(e.rgba.g)}${i(e.rgba.b)}`},t.formatHexA=function(t,n=!1){return n&&1===t.rgba.a?e.Format.CSS.formatHex(t):`#${i(t.rgba.r)}${i(t.rgba.g)}${i(t.rgba.b)}${i(Math.round(255*t.rgba.a))}`},t.format=function(t){return t.isOpaque()?e.Format.CSS.formatHex(t):e.Format.CSS.formatRGBA(t)},t.parse=function(t){if("transparent"===t)return e.transparent;if(t.startsWith("#"))return n(t);if(t.startsWith("rgba(")){const i=t.match(/rgba\((?<r>(?:\+|-)?\d+), *(?<g>(?:\+|-)?\d+), *(?<b>(?:\+|-)?\d+), *(?<a>(?:\+|-)?\d+(\.\d+)?)\)/);if(!i)throw new Error("Invalid color format "+t);const n=parseInt(i.groups?.r??"0"),o=parseInt(i.groups?.g??"0"),s=parseInt(i.groups?.b??"0"),r=parseFloat(i.groups?.a??"0");return new e(new Sg(n,o,s,r))}if(t.startsWith("rgb(")){const i=t.match(/rgb\((?<r>(?:\+|-)?\d+), *(?<g>(?:\+|-)?\d+), *(?<b>(?:\+|-)?\d+)\)/);if(!i)throw new Error("Invalid color format "+t);const n=parseInt(i.groups?.r??"0"),o=parseInt(i.groups?.g??"0"),s=parseInt(i.groups?.b??"0");return new e(new Sg(n,o,s))}return function(t){switch(t){case"aliceblue":return new e(new Sg(240,248,255,1));case"antiquewhite":return new e(new Sg(250,235,215,1));case"aqua":case"cyan":return new e(new Sg(0,255,255,1));case"aquamarine":return new e(new Sg(127,255,212,1));case"azure":return new e(new Sg(240,255,255,1));case"beige":return new e(new Sg(245,245,220,1));case"bisque":return new e(new Sg(255,228,196,1));case"black":return new e(new Sg(0,0,0,1));case"blanchedalmond":return new e(new Sg(255,235,205,1));case"blue":return new e(new Sg(0,0,255,1));case"blueviolet":return new e(new Sg(138,43,226,1));case"brown":return new e(new Sg(165,42,42,1));case"burlywood":return new e(new Sg(222,184,135,1));case"cadetblue":return new e(new Sg(95,158,160,1));case"chartreuse":return new e(new Sg(127,255,0,1));case"chocolate":return new e(new Sg(210,105,30,1));case"coral":return new e(new Sg(255,127,80,1));case"cornflowerblue":return new e(new Sg(100,149,237,1));case"cornsilk":return new e(new Sg(255,248,220,1));case"crimson":return new e(new Sg(220,20,60,1));case"darkblue":return new e(new Sg(0,0,139,1));case"darkcyan":return new e(new Sg(0,139,139,1));case"darkgoldenrod":return new e(new Sg(184,134,11,1));case"darkgray":case"darkgrey":return new e(new Sg(169,169,169,1));case"darkgreen":return new e(new Sg(0,100,0,1));case"darkkhaki":return new e(new Sg(189,183,107,1));case"darkmagenta":return new e(new Sg(139,0,139,1));case"darkolivegreen":return new e(new Sg(85,107,47,1));case"darkorange":return new e(new Sg(255,140,0,1));case"darkorchid":return new e(new Sg(153,50,204,1));case"darkred":return new e(new Sg(139,0,0,1));case"darksalmon":return new e(new Sg(233,150,122,1));case"darkseagreen":return new e(new Sg(143,188,143,1));case"darkslateblue":return new e(new Sg(72,61,139,1));case"darkslategray":case"darkslategrey":return new e(new Sg(47,79,79,1));case"darkturquoise":return new e(new Sg(0,206,209,1));case"darkviolet":return new e(new Sg(148,0,211,1));case"deeppink":return new e(new Sg(255,20,147,1));case"deepskyblue":return new e(new Sg(0,191,255,1));case"dimgray":case"dimgrey":return new e(new Sg(105,105,105,1));case"dodgerblue":return new e(new Sg(30,144,255,1));case"firebrick":return new e(new Sg(178,34,34,1));case"floralwhite":return new e(new Sg(255,250,240,1));case"forestgreen":return new e(new Sg(34,139,34,1));case"fuchsia":case"magenta":return new e(new Sg(255,0,255,1));case"gainsboro":return new e(new Sg(220,220,220,1));case"ghostwhite":return new e(new Sg(248,248,255,1));case"gold":return new e(new Sg(255,215,0,1));case"goldenrod":return new e(new Sg(218,165,32,1));case"gray":case"grey":return new e(new Sg(128,128,128,1));case"green":return new e(new Sg(0,128,0,1));case"greenyellow":return new e(new Sg(173,255,47,1));case"honeydew":return new e(new Sg(240,255,240,1));case"hotpink":return new e(new Sg(255,105,180,1));case"indianred":return new e(new Sg(205,92,92,1));case"indigo":return new e(new Sg(75,0,130,1));case"ivory":return new e(new Sg(255,255,240,1));case"khaki":return new e(new Sg(240,230,140,1));case"lavender":return new e(new Sg(230,230,250,1));case"lavenderblush":return new e(new Sg(255,240,245,1));case"lawngreen":return new e(new Sg(124,252,0,1));case"lemonchiffon":return new e(new Sg(255,250,205,1));case"lightblue":return new e(new Sg(173,216,230,1));case"lightcoral":return new e(new Sg(240,128,128,1));case"lightcyan":return new e(new Sg(224,255,255,1));case"lightgoldenrodyellow":return new e(new Sg(250,250,210,1));case"lightgray":case"lightgrey":return new e(new Sg(211,211,211,1));case"lightgreen":return new e(new Sg(144,238,144,1));case"lightpink":return new e(new Sg(255,182,193,1));case"lightsalmon":return new e(new Sg(255,160,122,1));case"lightseagreen":return new e(new Sg(32,178,170,1));case"lightskyblue":return new e(new Sg(135,206,250,1));case"lightslategray":case"lightslategrey":return new e(new Sg(119,136,153,1));case"lightsteelblue":return new e(new Sg(176,196,222,1));case"lightyellow":return new e(new Sg(255,255,224,1));case"lime":return new e(new Sg(0,255,0,1));case"limegreen":return new e(new Sg(50,205,50,1));case"linen":return new e(new Sg(250,240,230,1));case"maroon":return new e(new Sg(128,0,0,1));case"mediumaquamarine":return new e(new Sg(102,205,170,1));case"mediumblue":return new e(new Sg(0,0,205,1));case"mediumorchid":return new e(new Sg(186,85,211,1));case"mediumpurple":return new e(new Sg(147,112,219,1));case"mediumseagreen":return new e(new Sg(60,179,113,1));case"mediumslateblue":return new e(new Sg(123,104,238,1));case"mediumspringgreen":return new e(new Sg(0,250,154,1));case"mediumturquoise":return new e(new Sg(72,209,204,1));case"mediumvioletred":return new e(new Sg(199,21,133,1));case"midnightblue":return new e(new Sg(25,25,112,1));case"mintcream":return new e(new Sg(245,255,250,1));case"mistyrose":return new e(new Sg(255,228,225,1));case"moccasin":return new e(new Sg(255,228,181,1));case"navajowhite":return new e(new Sg(255,222,173,1));case"navy":return new e(new Sg(0,0,128,1));case"oldlace":return new e(new Sg(253,245,230,1));case"olive":return new e(new Sg(128,128,0,1));case"olivedrab":return new e(new Sg(107,142,35,1));case"orange":return new e(new Sg(255,165,0,1));case"orangered":return new e(new Sg(255,69,0,1));case"orchid":return new e(new Sg(218,112,214,1));case"palegoldenrod":return new e(new Sg(238,232,170,1));case"palegreen":return new e(new Sg(152,251,152,1));case"paleturquoise":return new e(new Sg(175,238,238,1));case"palevioletred":return new e(new Sg(219,112,147,1));case"papayawhip":return new e(new Sg(255,239,213,1));case"peachpuff":return new e(new Sg(255,218,185,1));case"peru":return new e(new Sg(205,133,63,1));case"pink":return new e(new Sg(255,192,203,1));case"plum":return new e(new Sg(221,160,221,1));case"powderblue":return new e(new Sg(176,224,230,1));case"purple":return new e(new Sg(128,0,128,1));case"rebeccapurple":return new e(new Sg(102,51,153,1));case"red":return new e(new Sg(255,0,0,1));case"rosybrown":return new e(new Sg(188,143,143,1));case"royalblue":return new e(new Sg(65,105,225,1));case"saddlebrown":return new e(new Sg(139,69,19,1));case"salmon":return new e(new Sg(250,128,114,1));case"sandybrown":return new e(new Sg(244,164,96,1));case"seagreen":return new e(new Sg(46,139,87,1));case"seashell":return new e(new Sg(255,245,238,1));case"sienna":return new e(new Sg(160,82,45,1));case"silver":return new e(new Sg(192,192,192,1));case"skyblue":return new e(new Sg(135,206,235,1));case"slateblue":return new e(new Sg(106,90,205,1));case"slategray":case"slategrey":return new e(new Sg(112,128,144,1));case"snow":return new e(new Sg(255,250,250,1));case"springgreen":return new e(new Sg(0,255,127,1));case"steelblue":return new e(new Sg(70,130,180,1));case"tan":return new e(new Sg(210,180,140,1));case"teal":return new e(new Sg(0,128,128,1));case"thistle":return new e(new Sg(216,191,216,1));case"tomato":return new e(new Sg(255,99,71,1));case"turquoise":return new e(new Sg(64,224,208,1));case"violet":return new e(new Sg(238,130,238,1));case"wheat":return new e(new Sg(245,222,179,1));case"white":return new e(new Sg(255,255,255,1));case"whitesmoke":return new e(new Sg(245,245,245,1));case"yellow":return new e(new Sg(255,255,0,1));case"yellowgreen":return new e(new Sg(154,205,50,1));default:return null}}(t)},t.parseHex=n}(i=t.CSS||(t.CSS={}))}(t=e.Format||(e.Format={}))}(Lg||(Lg={}));class Eg{static _nextVisibleColumn(e,t,i){return 9===e?Eg.nextRenderTabStop(t,i):yn(e)||Sn(e)?t+2:t+1}static visibleColumnFromColumn(e,t,i){const n=Math.min(t-1,e.length),o=e.substring(0,n),s=new gn(o);let r=0;for(;!s.eol();){const e=cn(o,n,s.offset);s.nextGraphemeLength(),r=this._nextVisibleColumn(e,r,i)}return r}static columnFromVisibleColumn(e,t,i){if(t<=0)return 1;const n=e.length,o=new gn(e);let s=0,r=1;for(;!o.eol();){const a=cn(e,n,o.offset);o.nextGraphemeLength();const l=this._nextVisibleColumn(a,s,i),d=o.offset+1;if(l>=t)return l-t<t-s?d:r;s=l,r=d}return n+1}static nextRenderTabStop(e,t){return e+t-e%t}static nextIndentTabStop(e,t){return Eg.nextRenderTabStop(e,t)}static prevRenderTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}static prevIndentTabStop(e,t){return Eg.prevRenderTabStop(e,t)}}function Ng(e,t,i){let n=$i(e);return-1===n&&(n=e.length),function(e,t,i){let n=0;for(let i=0;i<e.length;i++)"\t"===e.charAt(i)?n=Eg.nextIndentTabStop(n,t):n++;let o="";if(!i){const e=Math.floor(n/t);n%=t;for(let t=0;t<e;t++)o+="\t"}for(let e=0;e<n;e++)o+=" ";return o}(e.substring(0,n),t,i)+e.substring(n)}const Ig={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}},Tg=oc("languageService"),Mg="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?",Ag=function(e=""){let t="(-?\\d*\\.\\d\\w*)|([^";for(const i of Mg)e.indexOf(i)>=0||(t+="\\"+i);return t+="\\s]+)",new RegExp(t,"g")}();function Rg(e){let t=Ag;if(e&&e instanceof RegExp)if(e.global)t=e;else{let i="g";e.ignoreCase&&(i+="i"),e.multiline&&(i+="m"),e.unicode&&(i+="u"),t=new RegExp(e.source,i)}return t.lastIndex=0,t}const Og=new Wt;function Pg(e,t,i,n,o){if(t=Rg(t),o||(o=Ct.first(Og)),i.length>o.maxLen){let s=e-o.maxLen/2;return s<0?s=0:n+=s,Pg(e,t,i=i.substring(s,e+o.maxLen/2),n,o)}const s=Date.now(),r=e-1-n;let a=-1,l=null;for(let e=1;!(Date.now()-s>=o.timeBudget);e++){const n=r-o.windowSize*e;t.lastIndex=Math.max(0,n);const s=Fg(t,i,r,a);if(!s&&l)break;if(l=s,n<=0)break;a=n}if(l){const e={word:l[0],startColumn:n+1+l.index,endColumn:n+1+l.index+l[0].length};return t.lastIndex=0,e}return null}function Fg(e,t,i,n){let o;for(;o=e.exec(t);){const t=o.index||0;if(t<=i&&e.lastIndex>=i)return o;if(n>0&&t>n)return null}return null}var Bg,Wg;Og.unshift({maxLen:1e3,windowSize:15,timeBudget:150}),(Wg=Bg||(Bg={}))[Wg.None=0]="None",Wg[Wg.Indent=1]="Indent",Wg[Wg.IndentOutdent=2]="IndentOutdent",Wg[Wg.Outdent=3]="Outdent";class Vg{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;t<i;t++)switch(e.notIn[t]){case"string":this._inString=!1;break;case"comment":this._inComment=!1;break;case"regex":this._inRegEx=!1}}isOK(e){switch(e){case 0:return!0;case 1:return this._inComment;case 2:return this._inString;case 3:return this._inRegEx}}shouldAutoClose(e,t){if(0===e.getTokenCount())return!0;const i=e.findTokenIndexAtOffset(t-2),n=e.getStandardTokenType(i);return this.isOK(n)}_findNeutralCharacterInRange(e,t){for(let i=e;i<=t;i++){const e=String.fromCharCode(i);if(!this.open.includes(e)&&!this.close.includes(e))return e}return null}findNeutralCharacter(){return this._neutralCharacterSearched||(this._neutralCharacterSearched=!0,this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(48,57)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(97,122)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(65,90))),this._neutralCharacter}}class Hg{constructor(e){this.autoClosingPairsOpenByStart=new Map,this.autoClosingPairsOpenByEnd=new Map,this.autoClosingPairsCloseByStart=new Map,this.autoClosingPairsCloseByEnd=new Map,this.autoClosingPairsCloseSingleChar=new Map;for(const t of e)zg(this.autoClosingPairsOpenByStart,t.open.charAt(0),t),zg(this.autoClosingPairsOpenByEnd,t.open.charAt(t.open.length-1),t),zg(this.autoClosingPairsCloseByStart,t.close.charAt(0),t),zg(this.autoClosingPairsCloseByEnd,t.close.charAt(t.close.length-1),t),1===t.close.length&&1===t.open.length&&zg(this.autoClosingPairsCloseSingleChar,t.close,t)}}function zg(e,t,i){e.has(t)?e.get(t).push(i):e.set(t,[i])}class Ug{static{this.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=";:.,=}])> \n\t"}static{this.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS="'\"`;:.,=}])> \n\t"}constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map((e=>new Vg(e))):e.brackets?this._autoClosingPairs=e.brackets.map((e=>new Vg({open:e[0],close:e[1]}))):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new Vg({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes="string"==typeof e.autoCloseBefore?e.autoCloseBefore:Ug.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets="string"==typeof e.autoCloseBefore?e.autoCloseBefore:Ug.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}}function Kg(e,t){const i=e.getCount(),n=e.findTokenIndexAtOffset(t),o=e.getLanguageId(n);let s=n;for(;s+1<i&&e.getLanguageId(s+1)===o;)s++;let r=n;for(;r>0&&e.getLanguageId(r-1)===o;)r--;return new jg(e,o,r,s+1,e.getStartOffset(r),e.getEndOffset(s))}class jg{constructor(e,t,i,n,o,s){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=o,this._lastCharOffset=s,this.languageIdCodec=e.languageIdCodec}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getLineLength(){return this._lastCharOffset-this.firstCharOffset}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}toIViewLineTokens(){return this._actual.sliceAndInflate(this.firstCharOffset,this._lastCharOffset,0)}}function qg(e){return!!(3&e)}let $g,Gg,Zg;function Yg(){return $g||($g=new TextDecoder("UTF-16LE")),$g}function Qg(){return Zg||(Zg=le()?Yg():(Gg||(Gg=new TextDecoder("UTF-16BE")),Gg)),Zg}class Xg{constructor(e){this._capacity=0|e,this._buffer=new Uint16Array(this._capacity),this._completedStrings=null,this._bufferLength=0}reset(){this._completedStrings=null,this._bufferLength=0}build(){return null!==this._completedStrings?(this._flushBuffer(),this._completedStrings.join("")):this._buildBuffer()}_buildBuffer(){if(0===this._bufferLength)return"";const e=new Uint16Array(this._buffer.buffer,0,this._bufferLength);return Qg().decode(e)}_flushBuffer(){const e=this._buildBuffer();this._bufferLength=0,null===this._completedStrings?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}appendCharCode(e){const t=this._capacity-this._bufferLength;t<=1&&(0===t||ln(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIICharCode(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendString(e){const t=e.length;if(this._bufferLength+t>=this._capacity)return this._flushBuffer(),void(this._completedStrings[this._completedStrings.length]=e);for(let i=0;i<t;i++)this._buffer[this._bufferLength++]=e.charCodeAt(i)}}class Jg{constructor(e,t,i,n,o,s){this._richEditBracketBrand=void 0,this.languageId=e,this.index=t,this.open=i,this.close=n,this.forwardRegex=o,this.reversedRegex=s,this._openSet=Jg._toSet(this.open),this._closeSet=Jg._toSet(this.close)}isOpen(e){return this._openSet.has(e)}isClose(e){return this._closeSet.has(e)}static _toSet(e){const t=new Set;for(const i of e)t.add(i);return t}}class ep{constructor(e,t){this._richEditBracketsBrand=void 0;const i=function(e){const t=e.length;e=e.map((e=>[e[0].toLowerCase(),e[1].toLowerCase()]));const i=[];for(let e=0;e<t;e++)i[e]=e;const n=(e,t)=>{const[i,n]=e,[o,s]=t;return i===o||i===s||n===o||n===s},o=(e,n)=>{const o=Math.min(e,n),s=Math.max(e,n);for(let e=0;e<t;e++)i[e]===s&&(i[e]=o)};for(let s=0;s<t;s++){const r=e[s];for(let a=s+1;a<t;a++)n(r,e[a])&&o(i[s],i[a])}const s=[];for(let n=0;n<t;n++){const o=[],r=[];for(let s=0;s<t;s++)if(i[s]===n){const[t,i]=e[s];o.push(t),r.push(i)}o.length>0&&s.push({open:o,close:r})}return s}(t);this.brackets=i.map(((t,n)=>new Jg(e,n,t.open,t.close,function(e,t,i,n){let o=[];o=o.concat(e),o=o.concat(t);for(let e=0,t=o.length;e<t;e++)tp(o[e],i,n,o);return o=np(o),o.sort(ip),o.reverse(),sp(o)}(t.open,t.close,i,n),function(e,t,i,n){let o=[];o=o.concat(e),o=o.concat(t);for(let e=0,t=o.length;e<t;e++)tp(o[e],i,n,o);return o=np(o),o.sort(ip),o.reverse(),sp(o.map(rp))}(t.open,t.close,i,n)))),this.forwardRegex=function(e){let t=[];for(const i of e){for(const e of i.open)t.push(e);for(const e of i.close)t.push(e)}return t=np(t),sp(t)}(this.brackets),this.reversedRegex=function(e){let t=[];for(const i of e){for(const e of i.open)t.push(e);for(const e of i.close)t.push(e)}return t=np(t),sp(t.map(rp))}(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const e of this.brackets){for(const t of e.open)this.textIsBracket[t]=e,this.textIsOpenBracket[t]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,t.length);for(const t of e.close)this.textIsBracket[t]=e,this.textIsOpenBracket[t]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,t.length)}}}function tp(e,t,i,n){for(let o=0,s=t.length;o<s;o++){if(o===i)continue;const s=t[o];for(const t of s.open)t.indexOf(e)>=0&&n.push(t);for(const t of s.close)t.indexOf(e)>=0&&n.push(t)}}function ip(e,t){return e.length-t.length}function np(e){if(e.length<=1)return e;const t=[],i=new Set;for(const n of e)i.has(n)||(t.push(n),i.add(n));return t}function op(e){const t=/^[\w ]+$/.test(e);return e=Vi(e),t?`\\b${e}\\b`:e}function sp(e,t){return Ki(`(${e.map(op).join(")|(")})`,!0,t)}const rp=function(){let e=null,t=null;return function(i){return e!==i&&(e=i,t=function(e){const t=new Uint16Array(e.length);let i=0;for(let n=e.length-1;n>=0;n--)t[i++]=e.charCodeAt(n);return Qg().decode(t)}(e)),t}}();class ap{static _findPrevBracketInText(e,t,i,n){const o=i.match(e);if(!o)return null;const s=i.length-(o.index||0),r=o[0].length,a=n+s;return new Yu(t,a-r+1,t,a+1)}static findPrevBracketInRange(e,t,i,n,o){const s=rp(i).substring(i.length-o,i.length-n);return this._findPrevBracketInText(e,t,s,n)}static findNextBracketInText(e,t,i,n){const o=i.match(e);if(!o)return null;const s=o.index||0,r=o[0].length;if(0===r)return null;const a=n+s;return new Yu(t,a+1,t,a+1+r)}static findNextBracketInRange(e,t,i,n,o){const s=i.substring(n,o);return this.findNextBracketInText(e,t,s,n)}}class lp{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const t=i.charAt(i.length-1);e.push(t)}return cs(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||0===this._richEditBrackets.brackets.length)return null;const n=t.findTokenIndexAtOffset(i-1);if(qg(t.getStandardTokenType(n)))return null;const o=this._richEditBrackets.reversedRegex,s=t.getLineContent().substring(0,i-1)+e,r=ap.findPrevBracketInRange(o,1,s,0,s.length);if(!r)return null;const a=s.substring(r.startColumn-1,r.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[a])return null;const l=t.getActualLineContentBefore(r.startColumn-1);return/^\s*$/.test(l)?{matchOpenBracket:a}:null}}function dp(e){return e.global&&(e.lastIndex=0),!0}class hp{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&dp(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&dp(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&dp(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&dp(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}class cp{constructor(e){(e=e||{}).brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach((e=>{const t=cp._createOpenBracketRegExp(e[0]),i=cp._createCloseBracketRegExp(e[1]);t&&i&&this._brackets.push({open:e[0],openRegExp:t,close:e[1],closeRegExp:i})})),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,n){if(e>=3)for(let e=0,o=this._regExpRules.length;e<o;e++){const o=this._regExpRules[e];if([{reg:o.beforeText,text:i},{reg:o.afterText,text:n},{reg:o.previousLineText,text:t}].every((e=>!e.reg||(e.reg.lastIndex=0,e.reg.test(e.text)))))return o.action}if(e>=2&&i.length>0&&n.length>0)for(let e=0,t=this._brackets.length;e<t;e++){const t=this._brackets[e];if(t.openRegExp.test(i)&&t.closeRegExp.test(n))return{indentAction:Bg.IndentOutdent}}if(e>=2&&i.length>0)for(let e=0,t=this._brackets.length;e<t;e++)if(this._brackets[e].openRegExp.test(i))return{indentAction:Bg.Indent};return null}static _createOpenBracketRegExp(e){let t=Vi(e);return/\B/.test(t.charAt(0))||(t="\\b"+t),t+="\\s*$",cp._safeRegExp(t)}static _createCloseBracketRegExp(e){let t=Vi(e);return/\B/.test(t.charAt(t.length-1))||(t+="\\b"),t="^\\s*"+t,cp._safeRegExp(t)}static _safeRegExp(e){try{return new RegExp(e)}catch(e){return Ie(e),null}}}const up=oc("configurationService");function gp(e,t){const i=Object.create(null);for(const n in e)pp(i,n,e[n],t);return i}function pp(e,t,i,n){const o=t.split("."),s=o.pop();let r=e;for(let e=0;e<o.length;e++){const i=o[e];let s=r[i];switch(typeof s){case"undefined":s=r[i]=Object.create(null);break;case"object":if(null===s)return void n(`Ignoring ${t} as ${o.slice(0,e+1).join(".")} is null`);break;default:return void n(`Ignoring ${t} as ${o.slice(0,e+1).join(".")} is ${JSON.stringify(s)}`)}r=s}if("object"==typeof r&&null!==r)try{r[s]=i}catch(e){n(`Ignoring ${t} as ${o.join(".")} is ${JSON.stringify(r)}`)}else n(`Ignoring ${t} as ${o.join(".")} is ${JSON.stringify(r)}`)}function mp(e,t){fp(e,t.split("."))}function fp(e,t){if(!e)return;const i=t.shift();if(0!==t.length){if(-1!==Object.keys(e).indexOf(i)){const n=e[i];"object"!=typeof n||Array.isArray(n)||(fp(n,t),0===Object.keys(n).length&&delete e[i])}}else delete e[i]}function _p(e,t,i){const n=function(e,t){let i=e;for(const e of t){if("object"!=typeof i||null===i)return;i=i[e]}return i}(e,t.split("."));return void 0===n?i:n}class vp{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const bp=[];function wp(e,t,i){t instanceof vp||(t=new vp(t,[],Boolean(i))),bp.push([e,t])}function Cp(){return bp}const yp=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list",html:"text/html"}),Sp="base.contributions.json",xp=new class extends At{constructor(){super(...arguments),this.schemasById={},this._onDidChangeSchema=this._register(new Zt)}registerSchema(e,t,i){const n=function(e){return e.length>0&&"#"===e.charAt(e.length-1)?e.substring(0,e.length-1):e}(e);this.schemasById[n]=t,this._onDidChangeSchema.fire(e),i&&i.add(Tt((()=>{delete this.schemasById[n],this._onDidChangeSchema.fire(e)})))}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}};ru.add(Sp,xp);const kp="base.contributions.configuration",Lp={properties:{},patternProperties:{}},Dp={properties:{},patternProperties:{}},Ep={properties:{},patternProperties:{}},Np={properties:{},patternProperties:{}},Ip={properties:{},patternProperties:{}},Tp={properties:{},patternProperties:{}},Mp={properties:{},patternProperties:{}},Ap="vscode://schemas/settings/resourceLanguage",Rp=ru.as(Sp),Op="\\[([^\\]]+)\\]",Pp=new RegExp(Op,"g"),Fp=`^(${Op})+$`,Bp=new RegExp(Fp);function Wp(e){const t=[];if(Bp.test(e)){let i=Pp.exec(e);for(;i?.length;){const n=i[1].trim();n&&t.push(n),i=Pp.exec(e)}}return cs(t)}const Vp=new class extends At{constructor(){super(),this.registeredConfigurationDefaults=[],this.overrideIdentifiers=new Set,this._onDidSchemaChange=this._register(new Zt),this._onDidUpdateConfiguration=this._register(new Zt),this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:y(1649,"Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},Rp.registerSchema(Ap,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){return this.registerConfigurations([e],t),e}registerConfigurations(e,t=!0){const i=new Set;this.doRegisterConfigurations(e,t,i),Rp.registerSchema(Ap,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){this.registeredConfigurationDefaults.push(...e);const i=[];for(const{overrides:n,source:o}of e)for(const e in n){t.add(e);const s=this.configurationDefaultsOverrides.get(e)??this.configurationDefaultsOverrides.set(e,{configurationDefaultOverrides:[]}).get(e),r=n[e];if(s.configurationDefaultOverrides.push({value:r,source:o}),Bp.test(e)){const t=this.mergeDefaultConfigurationsForOverrideIdentifier(e,r,o,s.configurationDefaultOverrideValue);if(!t)continue;s.configurationDefaultOverrideValue=t,this.updateDefaultOverrideProperty(e,t,o),i.push(...Wp(e))}else{const t=this.mergeDefaultConfigurationsForConfigurationProperty(e,r,o,s.configurationDefaultOverrideValue);if(!t)continue;s.configurationDefaultOverrideValue=t;const i=this.configurationProperties[e];i&&(this.updatePropertyDefaultValue(e,i),this.updateSchema(e,i))}}this.doRegisterOverrideIdentifiers(i)}updateDefaultOverrideProperty(e,t,i){const n={type:"object",default:t.value,description:y(1650,"Configure settings to be overridden for {0}.",(o=e,o.replace(/^\[/,"").replace(/]$/g,"").replace(/\]\[/g,", "))),$ref:Ap,defaultDefaultValue:t.value,source:i,defaultValueSource:i};var o;this.configurationProperties[e]=n,this.defaultLanguageConfigurationOverridesNode.properties[e]=n}mergeDefaultConfigurationsForOverrideIdentifier(e,t,i,n){const o=n?.value||{},s=n?.source??new Map;if(s instanceof Map){for(const e of Object.keys(t)){const n=t[e];if(dt(n)&&(pt(o[e])||dt(o[e]))){if(o[e]={...o[e]??{},...n},i)for(const t in n)s.set(`${e}.${t}`,i)}else o[e]=n,i?s.set(e,i):s.delete(e)}return{value:o,source:s}}console.error("objectConfigurationSources is not a Map")}mergeDefaultConfigurationsForConfigurationProperty(e,t,i,n){const o=this.configurationProperties[e],s=n?.value??o?.defaultDefaultValue;let r=i;if(dt(t)&&(void 0!==o&&"object"===o.type||void 0===o&&(pt(s)||dt(s)))){if(r=n?.source??new Map,!(r instanceof Map))return void console.error("defaultValueSource is not a Map");for(const n in t)i&&r.set(`${e}.${n}`,i);t={...dt(s)?s:{},...t}}return{value:t,source:r}}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach((e=>{this.validateAndRegisterProperties(e,t,e.extensionInfo,e.restrictedProperties,void 0,i),this.configurationContributors.push(e),this.registerJSONConfiguration(e)}))}validateAndRegisterProperties(e,t=!0,i,n,o=4,s){o=ft(e.scope)?o:e.scope;const r=e.properties;if(r)for(const e in r){const a=r[e];if(t&&Hp(e,a)){delete r[e];continue}a.source=i,a.defaultDefaultValue=r[e].default,this.updatePropertyDefaultValue(e,a),Bp.test(e)?a.scope=void 0:(a.scope=ft(a.scope)?o:a.scope,a.restricted=ft(a.restricted)?!!n?.includes(e):a.restricted),a.experiment?a.tags?.some((e=>"onexp"===e.toLowerCase()))||(a.tags=a.tags??[],a.tags.push("onExP")):a.tags?.some((e=>"onexp"===e.toLowerCase()))&&(console.error(`Invalid tag 'onExP' found for property '${e}'. Please use 'experiment' property instead.`),a.experiment={mode:"startup"});const l=r[e].hasOwnProperty("included")&&!r[e].included,d=r[e].policy?.name;l?(this.excludedConfigurationProperties[e]=r[e],d&&(this.policyConfigurations.set(d,e),s.add(e)),delete r[e]):(s.add(e),d&&this.policyConfigurations.set(d,e),this.configurationProperties[e]=r[e],!r[e].deprecationMessage&&r[e].markdownDeprecationMessage&&(r[e].deprecationMessage=r[e].markdownDeprecationMessage))}const a=e.allOf;if(a)for(const e of a)this.validateAndRegisterProperties(e,t,i,n,o,s)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}registerJSONConfiguration(e){const t=e=>{const i=e.properties;if(i)for(const e in i)this.updateSchema(e,i[e]);const n=e.allOf;n?.forEach(t)};t(e)}updateSchema(e,t){switch(Lp.properties[e]=t,t.scope){case 1:Dp.properties[e]=t;break;case 2:Np.properties[e]=t;break;case 3:Ep.properties[e]=t;break;case 7:Ip.properties[e]=t;break;case 4:Tp.properties[e]=t;break;case 5:Mp.properties[e]=t;break;case 6:Mp.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:y(1651,"Configure editor settings to be overridden for a language."),errorMessage:y(1652,"This setting does not support per-language configuration."),$ref:Ap};this.updatePropertyDefaultValue(t,i),Lp.properties[t]=i,Dp.properties[t]=i,Ep.properties[t]=i,Np.properties[t]=i,Ip.properties[t]=i,Tp.properties[t]=i,Mp.properties[t]=i}}registerOverridePropertyPatternKey(){const e={type:"object",description:y(1653,"Configure editor settings to be overridden for a language."),errorMessage:y(1654,"This setting does not support per-language configuration."),$ref:Ap};Lp.patternProperties[Fp]=e,Dp.patternProperties[Fp]=e,Ep.patternProperties[Fp]=e,Np.patternProperties[Fp]=e,Ip.patternProperties[Fp]=e,Tp.patternProperties[Fp]=e,Mp.patternProperties[Fp]=e,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e)?.configurationDefaultOverrideValue;let n,o;!i||t.disallowConfigurationDefault&&i.source||(n=i.value,o=i.source),pt(n)&&(n=t.defaultDefaultValue,o=void 0),pt(n)&&(n=function(e){switch(Array.isArray(e)?e[0]:e){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}(t.type)),t.default=n,t.defaultValueSource=o}};function Hp(e,t){return e.trim()?Bp.test(e)?y(1656,"Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",e):void 0!==Vp.getConfigurationProperties()[e]?y(1657,"Cannot register '{0}'. This property is already registered.",e):t.policy?.name&&void 0!==Vp.getPolicyConfigurations().get(t.policy?.name)?y(1658,"Cannot register '{0}'. The associated policy {1} is already registered with {2}.",e,t.policy?.name,Vp.getPolicyConfigurations().get(t.policy?.name)):null:y(1655,"Cannot register an empty property")}ru.add(kp,Vp);const zp=new class extends At{constructor(){super(),this._onDidChangeLanguages=this._register(new Zt),this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t<i;t++)if(this._languages[t]===e)return void this._languages.splice(t,1)}}}getLanguages(){return this._languages}};ru.add("editor.modesRegistry",zp);const Up="plaintext";zp.registerLanguage({id:Up,extensions:[".txt"],aliases:[y(780,"Plain Text"),"text"],mimetypes:[yp.text]}),ru.as(kp).registerDefaultConfigurations([{overrides:{"[plaintext]":{"editor.unicodeHighlight.ambiguousCharacters":!1,"editor.unicodeHighlight.invisibleCharacters":!1},"[go]":{"editor.insertSpaces":!1},"[makefile]":{"editor.insertSpaces":!1},"[shellscript]":{"files.eol":"\n"},"[yaml]":{"editor.insertSpaces":!0,"editor.tabSize":2}}}]);class Kp{constructor(e,t){this.languageId=e;const i=t.brackets?jp(t.brackets):[],n=new Ri((e=>{const t=new Set;return{info:new $p(this,e,t),closing:t}})),o=new Ri((e=>{const t=new Set,i=new Set;return{info:new Gp(this,e,t,i),opening:t,openingColorized:i}}));for(const[e,t]of i){const i=n.get(e),s=o.get(t);i.closing.add(s.info),s.opening.add(i.info)}const s=t.colorizedBracketPairs?jp(t.colorizedBracketPairs):i.filter((e=>!("<"===e[0]&&">"===e[1])));for(const[e,t]of s){const i=n.get(e),s=o.get(t);i.closing.add(s.info),s.openingColorized.add(i.info),s.opening.add(i.info)}this._openingBrackets=new Map([...n.cachedValues].map((([e,t])=>[e,t.info]))),this._closingBrackets=new Map([...o.cachedValues].map((([e,t])=>[e,t.info])))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}getBracketRegExp(e){return sp(Array.from([...this._openingBrackets.keys(),...this._closingBrackets.keys()]),e)}}function jp(e){return e.filter((([e,t])=>""!==e&&""!==t))}class qp{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class $p extends qp{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class Gp extends qp{constructor(e,t,i,n){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=n,this.isOpeningBracket=!1}closes(e){return e.config===this.config&&this.openingBrackets.has(e)}closesColorized(e){return e.config===this.config&&this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}var Zp=function(e,t){return function(i,n){t(i,n,e)}};class Yp{constructor(e){this.languageId=e}affects(e){return!this.languageId||this.languageId===e}}const Qp=oc("languageConfigurationService");let Xp=class extends At{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new rm),this.onDidChangeEmitter=this._register(new Zt),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(Jp));this._register(this.configurationService.onDidChangeConfiguration((e=>{const t=e.change.keys.some((e=>i.has(e))),n=e.change.overrides.filter((([e,t])=>t.some((e=>i.has(e))))).map((([e])=>e));if(t)this.configurations.clear(),this.onDidChangeEmitter.fire(new Yp(void 0));else for(const e of n)this.languageService.isRegisteredLanguageId(e)&&(this.configurations.delete(e),this.onDidChangeEmitter.fire(new Yp(e)))}))),this._register(this._registry.onDidChange((e=>{this.configurations.delete(e.languageId),this.onDidChangeEmitter.fire(new Yp(e.languageId))})))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=function(e,t,i,n){let o=t.getLanguageConfiguration(e);if(!o){if(!n.isRegisteredLanguageId(e))return new am(e,{});o=new am(e,{})}const s=function(e,t){const i=t.getValue(Jp.brackets,{overrideIdentifier:e}),n=t.getValue(Jp.colorizedBracketPairs,{overrideIdentifier:e});return{brackets:em(i),colorizedBracketPairs:em(n)}}(o.languageId,i),r=nm([o.underlyingConfig,s]);return new am(o.languageId,r)}(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};Xp=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Zp(0,up),Zp(1,Tg)],Xp);const Jp={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function em(e){if(Array.isArray(e))return e.map((e=>{if(Array.isArray(e)&&2===e.length)return[e[0],e[1]]})).filter((e=>!!e))}function tm(e,t,i){let n=Gi(e.getLineContent(t));return n.length>i-1&&(n=n.substring(0,i-1)),n}class im{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new om(e,t,++this._order);return this._entries.push(i),this._resolved=null,Lt(Tt((()=>{for(let e=0;e<this._entries.length;e++)if(this._entries[e]===i){this._entries.splice(e,1),this._resolved=null;break}})))}getResolvedConfiguration(){if(!this._resolved){const e=this._resolve();e&&(this._resolved=new am(this.languageId,e))}return this._resolved}_resolve(){return 0===this._entries.length?null:(this._entries.sort(om.cmp),nm(this._entries.map((e=>e.configuration))))}}function nm(e){let t={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const i of e)t={comments:i.comments||t.comments,brackets:i.brackets||t.brackets,wordPattern:i.wordPattern||t.wordPattern,indentationRules:i.indentationRules||t.indentationRules,onEnterRules:i.onEnterRules||t.onEnterRules,autoClosingPairs:i.autoClosingPairs||t.autoClosingPairs,surroundingPairs:i.surroundingPairs||t.surroundingPairs,autoCloseBefore:i.autoCloseBefore||t.autoCloseBefore,folding:i.folding||t.folding,colorizedBracketPairs:i.colorizedBracketPairs||t.colorizedBracketPairs,__electricCharacterSupport:i.__electricCharacterSupport||t.__electricCharacterSupport};return t}class om{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class sm{constructor(e){this.languageId=e}}class rm extends At{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new Zt),this.onDidChange=this._onDidChange.event,this._register(this.register(Up,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let n=this._entries.get(e);n||(n=new im(e),this._entries.set(e,n));const o=n.register(t,i);return this._onDidChange.fire(new sm(e)),Lt(Tt((()=>{o.dispose(),this._onDidChange.fire(new sm(e))})))}getLanguageConfiguration(e){const t=this._entries.get(e);return t?.getResolvedConfiguration()||null}}class am{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new cp(this.underlyingConfig):null,this.comments=am._handleComments(this.underlyingConfig),this.characterPair=new Ug(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||Ag,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new hp(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new Kp(e,this.underlyingConfig)}getWordDefinition(){return Rg(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new ep(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new lp(this.brackets)),this._electricCharacter}onEnter(e,t,i,n){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,n):null}getAutoClosingPairs(){return new Hg(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const t=e.comments;if(!t)return null;const i={};if(t.lineComment&&("string"==typeof t.lineComment?i.lineCommentToken=t.lineComment:(i.lineCommentToken=t.lineComment.comment,i.lineCommentNoIndent=t.lineComment.noIndent)),t.blockComment){const[e,n]=t.blockComment;i.blockCommentStartToken=e,i.blockCommentEndToken=n}return i}}wp(Qp,Xp,1);class lm{constructor(e,t,i,n){this.range=e,this.nestingLevel=t,this.nestingLevelOfEqualBracketType=i,this.isInvalid=n}}class dm{constructor(e,t,i,n,o,s){this.range=e,this.openingBracketRange=t,this.closingBracketRange=i,this.nestingLevel=n,this.nestingLevelOfEqualBracketType=o,this.bracketPairNode=s}get openingBracketInfo(){return this.bracketPairNode.openingBracket.bracketInfo}}class hm extends dm{constructor(e,t,i,n,o,s,r){super(e,t,i,n,o,s),this.minVisibleColumnIndentation=r}}class cm{static fromTo(e,t){return new cm(e,t)}static addRange(e,t){let i=0;for(;i<t.length&&t[i].endExclusive<e.start;)i++;let n=i;for(;n<t.length&&t[n].start<=e.endExclusive;)n++;if(i===n)t.splice(i,0,e);else{const o=Math.min(e.start,t[i].start),s=Math.max(e.endExclusive,t[n-1].endExclusive);t.splice(i,n-i,new cm(o,s))}}static tryCreate(e,t){if(!(e>t))return new cm(e,t)}static ofLength(e){return new cm(0,e)}static ofStartAndLength(e,t){return new cm(e,e+t)}static emptyAt(e){return new cm(e,e)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new Ve(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new cm(this.start+e,this.endExclusive+e)}deltaStart(e){return new cm(this.start+e,this.endExclusive)}deltaEnd(e){return new cm(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}contains(e){return this.start<=e&&e<this.endExclusive}join(e){return new cm(Math.min(this.start,e.start),Math.max(this.endExclusive,e.endExclusive))}intersect(e){const t=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);if(t<=i)return new cm(t,i)}intersectionLength(e){const t=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);return Math.max(0,i-t)}intersects(e){return Math.max(this.start,e.start)<Math.min(this.endExclusive,e.endExclusive)}intersectsOrTouches(e){return Math.max(this.start,e.start)<=Math.min(this.endExclusive,e.endExclusive)}isBefore(e){return this.endExclusive<=e.start}isAfter(e){return this.start>=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new Ve(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Ve(`Invalid clipping range: ${this.toString()}`);return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;t<this.endExclusive;t++)e(t)}joinRightTouching(e){if(this.endExclusive!==e.start)throw new Ve(`Invalid join: ${this.toString()} and ${e.toString()}`);return new cm(this.start,e.endExclusive)}}class um{constructor(){this._sortedRanges=[]}addRange(e){let t=0;for(;t<this._sortedRanges.length&&this._sortedRanges[t].endExclusive<e.start;)t++;let i=t;for(;i<this._sortedRanges.length&&this._sortedRanges[i].start<=e.endExclusive;)i++;if(t===i)this._sortedRanges.splice(t,0,e);else{const n=Math.min(e.start,this._sortedRanges[t].start),o=Math.max(e.endExclusive,this._sortedRanges[i-1].endExclusive);this._sortedRanges.splice(t,i-t,new cm(n,o))}}toString(){return this._sortedRanges.map((e=>e.toString())).join(", ")}intersectsStrict(e){let t=0;for(;t<this._sortedRanges.length&&this._sortedRanges[t].endExclusive<=e.start;)t++;return t<this._sortedRanges.length&&this._sortedRanges[t].start<e.endExclusive}intersectWithRange(e){const t=new um;for(const i of this._sortedRanges){const n=i.intersect(e);n&&t.addRange(n)}return t}intersectWithRangeLength(e){return this.intersectWithRange(e).length}get length(){return this._sortedRanges.reduce(((e,t)=>e+t.length),0)}}function gm(e,t,i=e.length-1){const n=function(e,t,i=e.length-1){for(let n=i;n>=0;n--)if(t(e[n]))return n;return-1}(e,t,i);if(-1!==n)return e[n]}function pm(e,t){const i=mm(e,t);return-1===i?void 0:e[i]}function mm(e,t,i=0,n=e.length){let o=i,s=n;for(;o<s;){const i=Math.floor((o+s)/2);t(e[i])?o=i+1:s=i}return o-1}function fm(e,t,i=0,n=e.length){let o=i,s=n;for(;o<s;){const i=Math.floor((o+s)/2);t(e[i])?s=i:o=i+1}return o}class _m{static{this.assertInvariants=!1}constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(e){if(_m.assertInvariants){if(this._prevFindLastPredicate)for(const t of this._array)if(this._prevFindLastPredicate(t)&&!e(t))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.");this._prevFindLastPredicate=e}const t=mm(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=t+1,-1===t?void 0:this._array[t]}}function vm(e,t){if(0===e.length)return;let i=e[0];for(let n=1;n<e.length;n++){const o=e[n];t(o,i)>0&&(i=o)}return i}function bm(e,t){if(0===e.length)return;let i=e[0];for(let n=1;n<e.length;n++){const o=e[n];t(o,i)>=0&&(i=o)}return i}function wm(e,t){return vm(e,((e,i)=>-t(e,i)))}function Cm(e,t){if(0===e.length)return-1;let i=0;for(let n=1;n<e.length;n++)t(e[n],e[i])>0&&(i=n);return i}class ym{static ofLength(e,t){return new ym(e,e+t)}static fromRange(e){return new ym(e.startLineNumber,e.endLineNumber)}static fromRangeInclusive(e){return new ym(e.startLineNumber,e.endLineNumber+1)}static{this.compareByStart=Cs((e=>e.startLineNumber),ys)}static joinMany(e){if(0===e.length)return[];let t=new Sm(e[0].slice());for(let i=1;i<e.length;i++)t=t.getUnion(new Sm(e[i].slice()));return t.ranges}static join(e){if(0===e.length)throw new Ve("lineRanges cannot be empty");let t=e[0].startLineNumber,i=e[0].endLineNumberExclusive;for(let n=1;n<e.length;n++)t=Math.min(t,e[n].startLineNumber),i=Math.max(i,e[n].endLineNumberExclusive);return new ym(t,i)}static deserialize(e){return new ym(e[0],e[1])}constructor(e,t){if(e>t)throw new Ve(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&e<this.endLineNumberExclusive}get isEmpty(){return this.startLineNumber===this.endLineNumberExclusive}delta(e){return new ym(this.startLineNumber+e,this.endLineNumberExclusive+e)}deltaLength(e){return new ym(this.startLineNumber,this.endLineNumberExclusive+e)}get length(){return this.endLineNumberExclusive-this.startLineNumber}join(e){return new ym(Math.min(this.startLineNumber,e.startLineNumber),Math.max(this.endLineNumberExclusive,e.endLineNumberExclusive))}toString(){return`[${this.startLineNumber},${this.endLineNumberExclusive})`}intersect(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumberExclusive,e.endLineNumberExclusive);if(t<=i)return new ym(t,i)}intersectsStrict(e){return this.startLineNumber<e.endLineNumberExclusive&&e.startLineNumber<this.endLineNumberExclusive}intersectsOrTouches(e){return this.startLineNumber<=e.endLineNumberExclusive&&e.startLineNumber<=this.endLineNumberExclusive}equals(e){return this.startLineNumber===e.startLineNumber&&this.endLineNumberExclusive===e.endLineNumberExclusive}toInclusiveRange(){return this.isEmpty?null:new Yu(this.startLineNumber,1,this.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER)}toExclusiveRange(){return new Yu(this.startLineNumber,1,this.endLineNumberExclusive,1)}mapToLineArray(e){const t=[];for(let i=this.startLineNumber;i<this.endLineNumberExclusive;i++)t.push(e(i));return t}forEach(e){for(let t=this.startLineNumber;t<this.endLineNumberExclusive;t++)e(t)}serialize(){return[this.startLineNumber,this.endLineNumberExclusive]}toOffsetRange(){return new cm(this.startLineNumber-1,this.endLineNumberExclusive-1)}addMargin(e,t){return new ym(this.startLineNumber-e,this.endLineNumberExclusive+t)}}class Sm{constructor(e=[]){this._normalizedRanges=e}get ranges(){return this._normalizedRanges}addRange(e){if(0===e.length)return;const t=fm(this._normalizedRanges,(t=>t.endLineNumberExclusive>=e.startLineNumber)),i=mm(this._normalizedRanges,(t=>t.startLineNumber<=e.endLineNumberExclusive))+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){const i=this._normalizedRanges[t];this._normalizedRanges[t]=i.join(e)}else{const n=this._normalizedRanges[t].join(this._normalizedRanges[i-1]).join(e);this._normalizedRanges.splice(t,i-t,n)}}contains(e){const t=pm(this._normalizedRanges,(t=>t.startLineNumber<=e));return!!t&&t.endLineNumberExclusive>e}intersects(e){const t=pm(this._normalizedRanges,(t=>t.startLineNumber<e.endLineNumberExclusive));return!!t&&t.endLineNumberExclusive>e.startLineNumber}getUnion(e){if(0===this._normalizedRanges.length)return e;if(0===e._normalizedRanges.length)return this;const t=[];let i=0,n=0,o=null;for(;i<this._normalizedRanges.length||n<e._normalizedRanges.length;){let s=null;if(i<this._normalizedRanges.length&&n<e._normalizedRanges.length){const t=this._normalizedRanges[i],o=e._normalizedRanges[n];t.startLineNumber<o.startLineNumber?(s=t,i++):(s=o,n++)}else i<this._normalizedRanges.length?(s=this._normalizedRanges[i],i++):(s=e._normalizedRanges[n],n++);null===o?o=s:o.endLineNumberExclusive>=s.startLineNumber?o=new ym(o.startLineNumber,Math.max(o.endLineNumberExclusive,s.endLineNumberExclusive)):(t.push(o),o=s)}return null!==o&&t.push(o),new Sm(t)}subtractFrom(e){const t=fm(this._normalizedRanges,(t=>t.endLineNumberExclusive>=e.startLineNumber)),i=mm(this._normalizedRanges,(t=>t.startLineNumber<=e.endLineNumberExclusive))+1;if(t===i)return new Sm([e]);const n=[];let o=e.startLineNumber;for(let e=t;e<i;e++){const t=this._normalizedRanges[e];t.startLineNumber>o&&n.push(new ym(o,t.startLineNumber)),o=t.endLineNumberExclusive}return o<e.endLineNumberExclusive&&n.push(new ym(o,e.endLineNumberExclusive)),new Sm(n)}toString(){return this._normalizedRanges.map((e=>e.toString())).join(", ")}getIntersection(e){const t=[];let i=0,n=0;for(;i<this._normalizedRanges.length&&n<e._normalizedRanges.length;){const o=this._normalizedRanges[i],s=e._normalizedRanges[n],r=o.intersect(s);r&&!r.isEmpty&&t.push(r),o.endLineNumberExclusive<s.endLineNumberExclusive?i++:n++}return new Sm(t)}getWithDelta(e){return new Sm(this._normalizedRanges.map((t=>t.delta(e))))}}class xm{static{this.zero=new xm(0,0)}static betweenPositions(e,t){return e.lineNumber===t.lineNumber?new xm(0,t.column-e.column):new xm(t.lineNumber-e.lineNumber,t.column-1)}static fromPosition(e){return new xm(e.lineNumber-1,e.column-1)}static ofRange(e){return xm.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let t=0,i=0;for(const n of e)"\n"===n?(t++,i=0):i++;return new xm(t,i)}constructor(e,t){this.lineCount=e,this.columnCount=t}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}add(e){return 0===e.lineCount?new xm(this.lineCount,this.columnCount+e.columnCount):new xm(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return 0===this.lineCount?new Yu(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new Yu(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new Yu(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return ym.ofLength(1,this.lineCount+1)}addToPosition(e){return 0===this.lineCount?new rc(e.lineNumber,e.column+this.columnCount):new rc(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}}function km(e){return 0===e}const Lm=2**26;function Dm(e,t){return e*Lm+t}function Em(e){const t=e,i=Math.floor(t/Lm);return new xm(i,t-i*Lm)}function Nm(e,t){let i=e+t;return t>=Lm&&(i-=e%Lm),i}function Im(e,t){return e.reduce(((e,i)=>Nm(e,t(i))),0)}function Tm(e,t){return e===t}function Mm(e,t){const i=e,n=t;if(n-i<=0)return 0;const o=Math.floor(i/Lm),s=Math.floor(n/Lm),r=n-s*Lm;return o===s?Dm(0,r-(i-o*Lm)):Dm(s-o,r)}function Am(e,t){return e<t}function Rm(e,t){return e<=t}function Om(e,t){return e>=t}function Pm(e){return Dm(e.lineNumber-1,e.column-1)}function Fm(e,t){const i=e,n=Math.floor(i/Lm),o=i-n*Lm,s=t,r=Math.floor(s/Lm);return new Yu(n+1,o+1,r+1,s-r*Lm+1)}class Bm{static fromModelContentChanges(e){const t=e.map((e=>{const t=Yu.lift(e.range);return new Bm(Pm(t.getStartPosition()),Pm(t.getEndPosition()),function(e){const t=qi(e);return Dm(t.length-1,t[t.length-1].length)}(e.text))})).reverse();return t}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${Em(this.startOffset)}...${Em(this.endOffset)}) -> ${Em(this.newLength)}`}}class Wm{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map((e=>Vm.from(e)))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return null===i?null:Mm(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?Dm(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):Dm(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=Em(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?Dm(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):Dm(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx<this.edits.length;){const t=this.edits[this.nextEditIdx],i=this.translateOldToCur(t.endOffsetAfterObj);if(!Rm(i,e))break;{this.nextEditIdx++;const e=Em(i),n=Em(this.translateOldToCur(t.endOffsetBeforeObj)),o=e.lineCount-n.lineCount;this.deltaOldToNewLineCount+=o;const s=this.deltaLineIdxInOld===t.endOffsetBeforeObj.lineCount?this.deltaOldToNewColumnCount:0,r=e.columnCount-n.columnCount;this.deltaOldToNewColumnCount=s+r,this.deltaLineIdxInOld=t.endOffsetBeforeObj.lineCount}}}}class Vm{static from(e){return new Vm(e.startOffset,e.endOffset,e.newLength)}constructor(e,t,i){this.endOffsetBeforeObj=Em(t),this.endOffsetAfterObj=Em(Nm(e,i)),this.offsetObj=Em(e)}}const Hm=[];class zm{static{this.cache=new Array(129)}static create(e,t){if(e<=128&&0===t.length){let i=zm.cache[e];return i||(i=new zm(e,t),zm.cache[e]=i),i}return new zm(e,t)}static{this.empty=zm.create(0,Hm)}static getEmpty(){return this.empty}constructor(e,t){this.items=e,this.additionalItems=t}add(e,t){const i=t.getKey(e);let n=i>>5;if(0===n){const e=1<<i|this.items;return e===this.items?this:zm.create(e,this.additionalItems)}n--;const o=this.additionalItems.slice(0);for(;o.length<n;)o.push(0);return o[n]|=1<<(31&i),zm.create(this.items,o)}merge(e){const t=this.items|e.items;if(this.additionalItems===Hm&&e.additionalItems===Hm)return t===this.items?this:t===e.items?e:zm.create(t,Hm);const i=[];for(let t=0;t<Math.max(this.additionalItems.length,e.additionalItems.length);t++){const n=this.additionalItems[t]||0,o=e.additionalItems[t]||0;i.push(n|o)}return zm.create(t,i)}intersects(e){if(this.items&e.items)return!0;for(let t=0;t<Math.min(this.additionalItems.length,e.additionalItems.length);t++)if(this.additionalItems[t]&e.additionalItems[t])return!0;return!1}}const Um={getKey:e=>e};class Km{constructor(){this.items=new Map}getKey(e){let t=this.items.get(e);return void 0===t&&(t=this.items.size,this.items.set(e,t)),t}}class jm{get length(){return this._length}constructor(e){this._length=e}}class qm extends jm{static create(e,t,i){let n=e.length;return t&&(n=Nm(n,t.length)),i&&(n=Nm(n,i.length)),new qm(n,e,t,i,t?t.missingOpeningBracketIds:zm.getEmpty())}get kind(){return 2}get listHeight(){return 0}get childrenLength(){return 3}getChild(e){switch(e){case 0:return this.openingBracket;case 1:return this.child;case 2:return this.closingBracket}throw new Error("Invalid child index")}get children(){const e=[];return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}constructor(e,t,i,n,o){super(e),this.openingBracket=t,this.child=i,this.closingBracket=n,this.missingOpeningBracketIds=o}canBeReused(e){return null!==this.closingBracket&&!e.intersects(this.missingOpeningBracketIds)}deepClone(){return new qm(this.length,this.openingBracket.deepClone(),this.child&&this.child.deepClone(),this.closingBracket&&this.closingBracket.deepClone(),this.missingOpeningBracketIds)}computeMinIndentation(e,t){return this.child?this.child.computeMinIndentation(Nm(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class $m extends jm{static create23(e,t,i,n=!1){let o=e.length,s=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(o=Nm(o,t.length),s=s.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");o=Nm(o,i.length),s=s.merge(i.missingOpeningBracketIds)}return n?new Zm(o,e.listHeight+1,e,t,i,s):new Gm(o,e.listHeight+1,e,t,i,s)}static getEmpty(){return new Qm(0,0,[],zm.getEmpty())}get kind(){return 4}get missingOpeningBracketIds(){return this._missingOpeningBracketIds}constructor(e,t,i){super(e),this.listHeight=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}throwIfImmutable(){}makeLastElementMutable(){this.throwIfImmutable();const e=this.childrenLength;if(0===e)return;const t=this.getChild(e-1),i=4===t.kind?t.toMutable():t;return t!==i&&this.setChild(e-1,i),i}makeFirstElementMutable(){if(this.throwIfImmutable(),0===this.childrenLength)return;const e=this.getChild(0),t=4===e.kind?e.toMutable():e;return e!==t&&this.setChild(0,t),t}canBeReused(e){if(e.intersects(this.missingOpeningBracketIds))return!1;if(0===this.childrenLength)return!1;let t=this;for(;4===t.kind;){const e=t.childrenLength;if(0===e)throw new Ve;t=t.getChild(e-1)}return t.canBeReused(e)}handleChildrenChanged(){this.throwIfImmutable();const e=this.childrenLength;let t=this.getChild(0).length,i=this.getChild(0).missingOpeningBracketIds;for(let n=1;n<e;n++){const e=this.getChild(n);t=Nm(t,e.length),i=i.merge(e.missingOpeningBracketIds)}this._length=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}computeMinIndentation(e,t){if(-1!==this.cachedMinIndentation)return this.cachedMinIndentation;let i=Number.MAX_SAFE_INTEGER,n=e;for(let e=0;e<this.childrenLength;e++){const o=this.getChild(e);o&&(i=Math.min(i,o.computeMinIndentation(n,t)),n=Nm(n,o.length))}return this.cachedMinIndentation=i,i}}class Gm extends $m{get childrenLength(){return null!==this._item3?3:2}getChild(e){switch(e){case 0:return this._item1;case 1:return this._item2;case 2:return this._item3}throw new Error("Invalid child index")}setChild(e,t){switch(e){case 0:return void(this._item1=t);case 1:return void(this._item2=t);case 2:return void(this._item3=t)}throw new Error("Invalid child index")}get children(){return this._item3?[this._item1,this._item2,this._item3]:[this._item1,this._item2]}get item1(){return this._item1}get item2(){return this._item2}get item3(){return this._item3}constructor(e,t,i,n,o,s){super(e,t,s),this._item1=i,this._item2=n,this._item3=o}deepClone(){return new Gm(this.length,this.listHeight,this._item1.deepClone(),this._item2.deepClone(),this._item3?this._item3.deepClone():null,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){if(this._item3)throw new Error("Cannot append to a full (2,3) tree node");this.throwIfImmutable(),this._item3=e,this.handleChildrenChanged()}unappendChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item3;return this._item3=null,this.handleChildrenChanged(),e}prependChildOfSameHeight(e){if(this._item3)throw new Error("Cannot prepend to a full (2,3) tree node");this.throwIfImmutable(),this._item3=this._item2,this._item2=this._item1,this._item1=e,this.handleChildrenChanged()}unprependChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item1;return this._item1=this._item2,this._item2=this._item3,this._item3=null,this.handleChildrenChanged(),e}toMutable(){return this}}class Zm extends Gm{toMutable(){return new Gm(this.length,this.listHeight,this.item1,this.item2,this.item3,this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}class Ym extends $m{get childrenLength(){return this._children.length}getChild(e){return this._children[e]}setChild(e,t){this._children[e]=t}get children(){return this._children}constructor(e,t,i,n){super(e,t,n),this._children=i}deepClone(){const e=new Array(this._children.length);for(let t=0;t<this._children.length;t++)e[t]=this._children[t].deepClone();return new Ym(this.length,this.listHeight,e,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){this.throwIfImmutable(),this._children.push(e),this.handleChildrenChanged()}unappendChild(){this.throwIfImmutable();const e=this._children.pop();return this.handleChildrenChanged(),e}prependChildOfSameHeight(e){this.throwIfImmutable(),this._children.unshift(e),this.handleChildrenChanged()}unprependChild(){this.throwIfImmutable();const e=this._children.shift();return this.handleChildrenChanged(),e}toMutable(){return this}}class Qm extends Ym{toMutable(){return new Ym(this.length,this.listHeight,[...this.children],this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}const Xm=[];class Jm extends jm{get listHeight(){return 0}get childrenLength(){return 0}getChild(e){return null}get children(){return Xm}deepClone(){return this}}class ef extends Jm{get kind(){return 0}get missingOpeningBracketIds(){return zm.getEmpty()}canBeReused(e){return!0}computeMinIndentation(e,t){const i=Em(e),n=(0===i.columnCount?i.lineCount:i.lineCount+1)+1,o=(s=Nm(e,this.length),Math.floor(s/Lm)+1);var s;let r=Number.MAX_SAFE_INTEGER;for(let e=n;e<=o;e++){const i=t.getLineFirstNonWhitespaceColumn(e),n=t.getLineContent(e);if(0===i)continue;const o=Eg.visibleColumnFromColumn(n,i,t.getOptions().tabSize);r=Math.min(r,o)}return r}}class tf extends Jm{static create(e,t,i){return new tf(e,t,i)}get kind(){return 1}get missingOpeningBracketIds(){return zm.getEmpty()}constructor(e,t,i){super(e),this.bracketInfo=t,this.bracketIds=i}get text(){return this.bracketInfo.bracketText}get languageId(){return this.bracketInfo.languageId}canBeReused(e){return!1}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class nf extends Jm{get kind(){return 3}constructor(e,t){super(t),this.missingOpeningBracketIds=e}canBeReused(e){return!e.intersects(this.missingOpeningBracketIds)}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class of{static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(768&e)>>>8}static containsBalancedBrackets(e){return!!(1024&e)}static getFontStyle(e){return(30720&e)>>>11}static getForeground(e){return(16744448&e)>>>15}static getBackground(e){return(4278190080&e)>>>24}static getClassNameFromMetadata(e){let t="mtk"+this.getForeground(e);const i=this.getFontStyle(e);return 1&i&&(t+=" mtki"),2&i&&(t+=" mtkb"),4&i&&(t+=" mtku"),8&i&&(t+=" mtks"),t}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),n=this.getFontStyle(e);let o=`color: ${t[i]};`;1&n&&(o+="font-style: italic;"),2&n&&(o+="font-weight: bold;");let s="";return 4&n&&(s+=" underline"),8&n&&(s+=" line-through"),s&&(o+=`text-decoration:${s};`),o}static getPresentationFromMetadata(e){const t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:Boolean(1&i),bold:Boolean(2&i),underline:Boolean(4&i),strikethrough:Boolean(8&i)}}}class sf{constructor(e,t,i,n,o){this.length=e,this.kind=t,this.bracketId=i,this.bracketIds=n,this.astNode=o}}class rf{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new af(this.textModel,this.bracketTokens),this._offset=0,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return Dm(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=Nm(this._offset,e);const t=Em(this._offset);this.reader.setPosition(t.lineCount,t.columnCount)}read(){let e;return this.peeked?(this.didPeek=!1,e=this.peeked):e=this.reader.read(),e&&(this._offset=Nm(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}class af{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.lineIdx=0,this.line=null,this.lineCharOffset=0,this.lineTokens=null,this.lineTokenOffset=0,this.peekedToken=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}setPosition(e,t){e===this.lineIdx?(this.lineCharOffset=t,null!==this.line&&(this.lineTokenOffset=0===this.lineCharOffset?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset))):(this.lineIdx=e,this.lineCharOffset=t,this.line=null),this.peekedToken=null}read(){if(this.peekedToken){const e=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=e.length,e}if(this.lineIdx>this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;null===this.line&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=0===this.lineCharOffset?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const n=this.lineTokens,o=n.getCount();let s=null;if(this.lineTokenOffset<o){const r=n.getMetadata(this.lineTokenOffset);for(;this.lineTokenOffset+1<o&&r===n.getMetadata(this.lineTokenOffset+1);)this.lineTokenOffset++;const a=0===of.getTokenType(r),l=of.containsBalancedBrackets(r),d=n.getEndOffset(this.lineTokenOffset);if(l&&a&&this.lineCharOffset<d){const e=n.getLanguageId(this.lineTokenOffset),t=this.line.substring(this.lineCharOffset,d),i=this.bracketTokens.getSingleLanguageBracketTokens(e),o=i.regExpGlobal;if(o){o.lastIndex=0;const e=o.exec(t);e&&(s=i.getToken(e[0]),s&&(this.lineCharOffset+=e.index))}}if(i+=d-this.lineCharOffset,s){if(e!==this.lineIdx||t!==this.lineCharOffset){this.peekedToken=s;break}return this.lineCharOffset+=s.length,s}this.lineTokenOffset++,this.lineCharOffset=d}else{if(this.lineIdx===this.textBufferLineCount-1)break;if(this.lineIdx++,this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.lineTokenOffset=0,this.line=this.lineTokens.getLineContent(),this.lineCharOffset=0,i+=33,i>1e3)break}if(i>1500)break}const n=(o=e,s=t,r=this.lineIdx,a=this.lineCharOffset,o!==r?Dm(r-o,a):Dm(0,a-s));var o,s,r,a;return new sf(n,0,-1,zm.getEmpty(),new ef(n))}}class lf{constructor(e,t){this.text=e,this._offset=0,this.idx=0;const i=t.getRegExpStr(),n=i?new RegExp(i+"|\n","gi"):null,o=[];let s,r=0,a=0,l=0,d=0;const h=[];for(let e=0;e<60;e++)h.push(new sf(Dm(0,e),0,-1,zm.getEmpty(),new ef(Dm(0,e))));const c=[];for(let e=0;e<60;e++)c.push(new sf(Dm(1,e),0,-1,zm.getEmpty(),new ef(Dm(1,e))));if(n)for(n.lastIndex=0;null!==(s=n.exec(e));){const e=s.index,i=s[0];if("\n"===i)r++,a=e+1;else{if(l!==e){let t;if(d===r){const i=e-l;if(i<h.length)t=h[i];else{const e=Dm(0,i);t=new sf(e,0,-1,zm.getEmpty(),new ef(e))}}else{const i=r-d,n=e-a;if(1===i&&n<c.length)t=c[n];else{const e=Dm(i,n);t=new sf(e,0,-1,zm.getEmpty(),new ef(e))}}o.push(t)}o.push(t.getToken(i)),l=e+i.length,d=r}}const u=e.length;if(l!==u){const e=d===r?Dm(0,u-l):Dm(r-d,u-a);o.push(new sf(e,0,-1,zm.getEmpty(),new ef(e)))}this.length=Dm(r,u-a),this.tokens=o}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new Be}}class df{static createFromLanguage(e,t){function i(e){return t.getKey(`${e.languageId}:::${e.bracketText}`)}const n=new Map;for(const t of e.bracketsNew.openingBrackets){const e=Dm(0,t.bracketText.length),o=i(t),s=zm.getEmpty().add(o,Um);n.set(t.bracketText,new sf(e,1,o,s,tf.create(e,t,s)))}for(const t of e.bracketsNew.closingBrackets){const e=Dm(0,t.bracketText.length);let o=zm.getEmpty();const s=t.getOpeningBrackets();for(const e of s)o=o.add(i(e),Um);n.set(t.bracketText,new sf(e,2,i(s[0]),o,tf.create(e,t,o)))}return new df(n)}constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}getRegExpStr(){if(this.isEmpty)return null;{const e=[...this.map.keys()];return e.sort(),e.reverse(),e.map((e=>function(e){let t=Vi(e);return/^[\w ]+/.test(e)&&(t=`\\b${t}`),/[\w ]+$/.test(e)&&(t=`${t}\\b`),t}(e))).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(2===i.kind&&i.bracketIds.intersects(e))return t}get isEmpty(){return 0===this.map.size}}class hf{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=df.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function cf(e,t=!1){if(0===e.length)return null;if(1===e.length)return e[0];let i=e.length;for(;i>3;){const n=i>>1;for(let o=0;o<n;o++){const n=o<<1;e[o]=$m.create23(e[n],e[n+1],n+3===i?e[n+2]:null,t)}i=n}return $m.create23(e[0],e[1],i>=3?e[2]:null,t)}function uf(e,t){return Math.abs(e.listHeight-t.listHeight)}function gf(e,t){return e.listHeight===t.listHeight?$m.create23(e,t,null,!1):e.listHeight>t.listHeight?function(e,t){let i=e=e.toMutable();const n=[];let o;for(;;){if(t.listHeight===i.listHeight){o=t;break}if(4!==i.kind)throw new Error("unexpected");n.push(i),i=i.makeLastElementMutable()}for(let e=n.length-1;e>=0;e--){const t=n[e];o?t.childrenLength>=3?o=$m.create23(t.unappendChild(),o,null,!1):(t.appendChildOfSameHeight(o),o=void 0):t.handleChildrenChanged()}return o?$m.create23(e,o,null,!1):e}(e,t):function(e,t){let i=e=e.toMutable();const n=[];for(;t.listHeight!==i.listHeight;){if(4!==i.kind)throw new Error("unexpected");n.push(i),i=i.makeFirstElementMutable()}let o=t;for(let e=n.length-1;e>=0;e--){const t=n[e];o?t.childrenLength>=3?o=$m.create23(o,t.unprependChild(),null,!1):(t.prependChildOfSameHeight(o),o=void 0):t.handleChildrenChanged()}return o?$m.create23(o,e,null,!1):e}(t,e)}class pf{constructor(e){this.lastOffset=0,this.nextNodes=[e],this.offsets=[0],this.idxs=[]}readLongestNodeAt(e,t){if(Am(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=ff(this.nextNodes);if(!i)return;const n=ff(this.offsets);if(Am(e,n))return;if(Am(n,e))if(Nm(n,i.length)<=e)this.nextNodeAfterCurrent();else{const e=mf(i);-1!==e?(this.nextNodes.push(i.getChild(e)),this.offsets.push(n),this.idxs.push(e)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const e=mf(i);if(-1===e)return void this.nextNodeAfterCurrent();this.nextNodes.push(i.getChild(e)),this.offsets.push(n),this.idxs.push(e)}}}}nextNodeAfterCurrent(){for(;;){const e=ff(this.offsets),t=ff(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),0===this.idxs.length)break;const i=ff(this.nextNodes),n=mf(i,this.idxs[this.idxs.length-1]);if(-1!==n){this.nextNodes.push(i.getChild(n)),this.offsets.push(Nm(e,t.length)),this.idxs[this.idxs.length-1]=n;break}this.idxs.pop()}}}function mf(e,t=-1){for(;;){if(++t>=e.childrenLength)return-1;if(e.getChild(t))return t}}function ff(e){return e.length>0?e[e.length-1]:void 0}function _f(e,t,i,n){return new vf(e,t,i,n).parseDocument()}class vf{constructor(e,t,i,n){if(this.tokenizer=e,this.createImmutableLists=n,this._itemsConstructed=0,this._itemsFromCache=0,i&&n)throw new Error("Not supported");this.oldNodeReader=i?new pf(i):void 0,this.positionMapper=new Wm(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(zm.getEmpty(),0);return e||(e=$m.getEmpty()),e}parseList(e,t){const i=[];for(;;){let n=this.tryReadChildFromCache(e);if(!n){const i=this.tokenizer.peek();if(!i||2===i.kind&&i.bracketIds.intersects(e))break;n=this.parseChild(e,t+1)}4===n.kind&&0===n.childrenLength||i.push(n)}const n=this.oldNodeReader?function(e){if(0===e.length)return null;if(1===e.length)return e[0];let t=0;function i(){if(t>=e.length)return null;const i=t,n=e[i].listHeight;for(t++;t<e.length&&e[t].listHeight===n;)t++;return t-i>=2?cf(0===i&&t===e.length?e:e.slice(i,t),!1):e[i]}let n=i(),o=i();if(!o)return n;for(let e=i();e;e=i())uf(n,o)<=uf(o,e)?(n=gf(n,o),o=e):o=gf(o,e);return gf(n,o)}(i):cf(i,this.createImmutableLists);return n}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(null===t||!km(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),(i=>!(null!==t&&!Am(i.length,t))&&i.canBeReused(e)));if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}}parseChild(e,t){this._itemsConstructed++;const i=this.tokenizer.read();switch(i.kind){case 2:return new nf(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new ef(i.length);const n=e.merge(i.bracketIds),o=this.parseList(n,t+1),s=this.tokenizer.peek();return s&&2===s.kind&&(s.bracketId===i.bracketId||s.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),qm.create(i.astNode,o,s.astNode)):qm.create(i.astNode,o,null)}default:throw new Error("unexpected")}}}function bf(e,t){if(0===e.length)return t;if(0===t.length)return e;const i=new ks(Cf(e)),n=Cf(t);n.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let o=i.dequeue();function s(e){if(void 0===e){const e=i.takeWhile((e=>!0))||[];return o&&e.unshift(o),e}const t=[];for(;o&&!km(e);){const[n,s]=o.splitAt(e);t.push(n),e=Mm(n.lengthAfter,e),o=s??i.dequeue()}return km(e)||t.push(new wf(!1,e,e)),t}const r=[];function a(e,t,i){if(r.length>0&&Tm(r[r.length-1].endOffset,e)){const e=r[r.length-1];r[r.length-1]=new Bm(e.startOffset,t,Nm(e.newLength,i))}else r.push({startOffset:e,endOffset:t,newLength:i})}let l=0;for(const e of n){const t=s(e.lengthBefore);if(e.modified){const i=Nm(l,Im(t,(e=>e.lengthBefore)));a(l,i,e.lengthAfter),l=i}else for(const e of t){const t=l;l=Nm(l,e.lengthBefore),e.modified&&a(t,l,e.lengthAfter)}}return r}class wf{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=Mm(e,this.lengthAfter);return Tm(t,0)?[this,void 0]:this.modified?[new wf(this.modified,this.lengthBefore,e),new wf(this.modified,0,t)]:[new wf(this.modified,e,e),new wf(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${Em(this.lengthBefore)} -> ${Em(this.lengthAfter)}`}}function Cf(e){const t=[];let i=0;for(const n of e){const e=Mm(i,n.startOffset);km(e)||t.push(new wf(!1,e,e));const o=Mm(n.startOffset,n.endOffset);t.push(new wf(!0,o,n.newLength)),i=n.endOffset}return t}class yf extends At{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new Zt,this.denseKeyProvider=new Km,this.brackets=new hf(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)2===e.tokenization.backgroundTokenizationState?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const e=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),t=new lf(this.textModel.getValue(),e);this.initialAstWithoutTokens=_f(t,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(2===this.textModel.tokenization.backgroundTokenizationState){const e=void 0===this.initialAstWithoutTokens;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map((e=>new Bm(Dm(e.fromLineNumber-1,0),Dm(e.toLineNumber,0),Dm(e.toLineNumber-e.fromLineNumber+1,0))));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=Bm.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=bf(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=bf(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,i){const n=t;return _f(new rf(this.textModel,this.brackets),e,n,i)}getBracketsInRange(e,t){this.flushQueue();const i=Dm(e.startLineNumber-1,e.startColumn-1),n=Dm(e.endLineNumber-1,e.endColumn-1);return new Ls((e=>{const o=this.initialAstWithoutTokens||this.astWithTokens;kf(o,0,o.length,i,n,e,0,0,new Map,t)}))}getBracketPairsInRange(e,t){this.flushQueue();const i=Pm(e.getStartPosition()),n=Pm(e.getEndPosition());return new Ls((e=>{const o=this.initialAstWithoutTokens||this.astWithTokens,s=new Lf(e,t,this.textModel);Df(o,0,o.length,i,n,s,0,new Map)}))}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return xf(t,0,t.length,Pm(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return Sf(t,0,t.length,Pm(e))}}function Sf(e,t,i,n){if(4===e.kind||2===e.kind){const o=[];for(const n of e.children)i=Nm(t,n.length),o.push({nodeOffsetStart:t,nodeOffsetEnd:i}),t=i;for(let t=o.length-1;t>=0;t--){const{nodeOffsetStart:i,nodeOffsetEnd:s}=o[t];if(Am(i,n)){const o=Sf(e.children[t],i,s,n);if(o)return o}}return null}if(3===e.kind)return null;if(1===e.kind){const n=Fm(t,i);return{bracketInfo:e.bracketInfo,range:n}}return null}function xf(e,t,i,n){if(4===e.kind||2===e.kind){for(const o of e.children){if(Am(n,i=Nm(t,o.length))){const e=xf(o,t,i,n);if(e)return e}t=i}return null}if(3===e.kind)return null;if(1===e.kind){const n=Fm(t,i);return{bracketInfo:e.bracketInfo,range:n}}return null}function kf(e,t,i,n,o,s,r,a,l,d,h=!1){if(r>200)return!0;e:for(;;)switch(e.kind){case 4:{const a=e.childrenLength;for(let h=0;h<a;h++){const a=e.getChild(h);if(a){if(i=Nm(t,a.length),Rm(t,o)&&Om(i,n)){if(Om(i,o)){e=a;continue e}if(!kf(a,t,i,n,o,s,r,0,l,d))return!1}t=i}}return!0}case 2:{const h=!d||!e.closingBracket||e.closingBracket.bracketInfo.closesColorized(e.openingBracket.bracketInfo);let c=0;if(l){let t=l.get(e.openingBracket.text);void 0===t&&(t=0),c=t,h&&(t++,l.set(e.openingBracket.text,t))}const u=e.childrenLength;for(let g=0;g<u;g++){const u=e.getChild(g);if(u){if(i=Nm(t,u.length),Rm(t,o)&&Om(i,n)){if(Om(i,o)&&1!==u.kind){e=u,h?(r++,a=c+1):a=c;continue e}if((h||1!==u.kind||!e.closingBracket)&&!kf(u,t,i,n,o,s,h?r+1:r,h?c+1:c,l,d,!e.closingBracket))return!1}t=i}}return l?.set(e.openingBracket.text,c),!0}case 3:{const e=Fm(t,i);return s(new lm(e,r-1,0,!0))}case 1:{const e=Fm(t,i);return s(new lm(e,r-1,a-1,h))}case 0:return!0}}class Lf{constructor(e,t,i){this.push=e,this.includeMinIndentation=t,this.textModel=i}}function Df(e,t,i,n,o,s,r,a){if(r>200)return!0;let l=!0;if(2===e.kind){let d=0;if(a){let t=a.get(e.openingBracket.text);void 0===t&&(t=0),d=t,t++,a.set(e.openingBracket.text,t)}const h=Nm(t,e.openingBracket.length);let c=-1;if(s.includeMinIndentation&&(c=e.computeMinIndentation(t,s.textModel)),l=s.push(new hm(Fm(t,i),Fm(t,h),e.closingBracket?Fm(Nm(h,e.child?.length||0),i):void 0,r,d,e,c)),t=h,l&&e.child){const d=e.child;if(i=Nm(t,d.length),Rm(t,o)&&Om(i,n)&&(l=Df(d,t,i,n,o,s,r+1,a),!l))return!1}a?.set(e.openingBracket.text,d)}else{let i=t;for(const t of e.children){const e=i;if(i=Nm(i,t.length),Rm(e,o)&&Rm(n,i)&&(l=Df(t,e,i,n,o,s,r,a),!l))return!1}}return l}class Ef extends At{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Rt),this.onDidChangeEmitter=new Zt,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1}handleLanguageConfigurationServiceChange(e){e.languageId&&!this.bracketPairsTree.value?.object.didLanguageChange(e.languageId)||(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){this.bracketPairsTree.value?.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){this.bracketPairsTree.value?.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){this.bracketPairsTree.value?.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const i=new Mt;this.bracketPairsTree.value=(e=i.add(new yf(this.textModel,(e=>this.languageConfigurationService.getLanguageConfiguration(e)))),t=i,{object:e,dispose:()=>t?.dispose()}),i.add(this.bracketPairsTree.value.object.onDidChange((e=>this.onDidChangeEmitter.fire(e)))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire());var e,t}getBracketPairsInRange(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!1)||Ls.empty}getBracketPairsInRangeWithMinIndentation(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!0)||Ls.empty}getBracketsInRange(e,t=!1){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketsInRange(e,t)||Ls.empty}findMatchingBracketUp(e,t,i){const n=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(n.lineNumber,n.column);if(this.canBuildAST){const i=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!i)return null;const n=this.getBracketPairsInRange(Yu.fromPositions(t,t)).findLast((e=>i.closes(e.openingBracketInfo)));return n?n.openingBracketRange:null}{const t=e.toLowerCase(),s=this.languageConfigurationService.getLanguageConfiguration(o).brackets;if(!s)return null;const r=s.textIsBracket[t];return r?Tf(this._findMatchingBracketUp(r,n,Nf(i))):null}}matchBracket(e,t){if(this.canBuildAST){const t=this.getBracketPairsInRange(Yu.fromPositions(e,e)).filter((t=>void 0!==t.closingBracketRange&&(t.openingBracketRange.containsPosition(e)||t.closingBracketRange.containsPosition(e)))).findLastMaxBy(Cs((t=>t.openingBracketRange.containsPosition(e)?t.openingBracketRange:t.closingBracketRange),Yu.compareRangesUsingStarts));return t?[t.openingBracketRange,t.closingBracketRange]:null}{const i=Nf(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,n){const o=t.getCount(),s=t.getLanguageId(n);let r=Math.max(0,e.column-1-i.maxBracketLength);for(let e=n-1;e>=0;e--){const i=t.getEndOffset(e);if(i<=r)break;if(qg(t.getStandardTokenType(e))||t.getLanguageId(e)!==s){r=i;break}}let a=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let e=n+1;e<o;e++){const i=t.getStartOffset(e);if(i>=a)break;if(qg(t.getStandardTokenType(e))||t.getLanguageId(e)!==s){a=i;break}}return{searchStartOffset:r,searchEndOffset:a}}_matchBracket(e,t){const i=e.lineNumber,n=this.textModel.tokenization.getLineTokens(i),o=this.textModel.getLineContent(i),s=n.findTokenIndexAtOffset(e.column-1);if(s<0)return null;const r=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(s)).brackets;if(r&&!qg(n.getStandardTokenType(s))){let{searchStartOffset:a,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,r,s),d=null;for(;;){const n=ap.findNextBracketInRange(r.forwardRegex,i,o,a,l);if(!n)break;if(n.startColumn<=e.column&&e.column<=n.endColumn){const e=o.substring(n.startColumn-1,n.endColumn-1).toLowerCase(),i=this._matchFoundBracket(n,r.textIsBracket[e],r.textIsOpenBracket[e],t);if(i){if(i instanceof If)return null;d=i}}a=n.endColumn-1}if(d)return d}if(s>0&&n.getStartOffset(s)===e.column-1){const r=s-1,a=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(r)).brackets;if(a&&!qg(n.getStandardTokenType(r))){const{searchStartOffset:s,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,a,r),d=ap.findPrevBracketInRange(a.reversedRegex,i,o,s,l);if(d&&d.startColumn<=e.column&&e.column<=d.endColumn){const e=o.substring(d.startColumn-1,d.endColumn-1).toLowerCase(),i=this._matchFoundBracket(d,a.textIsBracket[e],a.textIsOpenBracket[e],t);if(i)return i instanceof If?null:i}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return o?o instanceof If?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const n=e.languageId,o=e.reversedRegex;let s=-1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return If.INSTANCE;const d=ap.findPrevBracketInRange(o,t,n,a,l);if(!d)break;const h=n.substring(d.startColumn-1,d.endColumn-1).toLowerCase();if(e.isOpen(h)?s++:e.isClose(h)&&s--,0===s)return d;l=d.startColumn-1}return null};for(let e=t.lineNumber;e>=1;e--){const i=this.textModel.tokenization.getLineTokens(e),o=i.getCount(),s=this.textModel.getLineContent(e);let r=o-1,l=s.length,d=s.length;e===t.lineNumber&&(r=i.findTokenIndexAtOffset(t.column-1),l=t.column-1,d=t.column-1);let h=!0;for(;r>=0;r--){const t=i.getLanguageId(r)===n&&!qg(i.getStandardTokenType(r));if(t)h?l=i.getStartOffset(r):(l=i.getStartOffset(r),d=i.getEndOffset(r));else if(h&&l!==d){const t=a(e,s,l,d);if(t)return t}h=t}if(h&&l!==d){const t=a(e,s,l,d);if(t)return t}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageId,o=e.forwardRegex;let s=1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return If.INSTANCE;const d=ap.findNextBracketInRange(o,t,n,a,l);if(!d)break;const h=n.substring(d.startColumn-1,d.endColumn-1).toLowerCase();if(e.isOpen(h)?s++:e.isClose(h)&&s--,0===s)return d;a=d.endColumn-1}return null},l=this.textModel.getLineCount();for(let e=t.lineNumber;e<=l;e++){const i=this.textModel.tokenization.getLineTokens(e),o=i.getCount(),s=this.textModel.getLineContent(e);let r=0,l=0,d=0;e===t.lineNumber&&(r=i.findTokenIndexAtOffset(t.column-1),l=t.column-1,d=t.column-1);let h=!0;for(;r<o;r++){const t=i.getLanguageId(r)===n&&!qg(i.getStandardTokenType(r));if(t)h||(l=i.getStartOffset(r)),d=i.getEndOffset(r);else if(h&&l!==d){const t=a(e,s,l,d);if(t)return t}h=t}if(h&&l!==d){const t=a(e,s,l,d);if(t)return t}}return null}findPrevBracket(e){const t=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getFirstBracketBefore(t)||null;let i=null,n=null,o=null;for(let e=t.lineNumber;e>=1;e--){const s=this.textModel.tokenization.getLineTokens(e),r=s.getCount(),a=this.textModel.getLineContent(e);let l=r-1,d=a.length,h=a.length;if(e===t.lineNumber){l=s.findTokenIndexAtOffset(t.column-1),d=t.column-1,h=t.column-1;const e=s.getLanguageId(l);i!==e&&(i=e,n=this.languageConfigurationService.getLanguageConfiguration(i).brackets,o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew)}let c=!0;for(;l>=0;l--){const t=s.getLanguageId(l);if(i!==t){if(n&&o&&c&&d!==h){const t=ap.findPrevBracketInRange(n.reversedRegex,e,a,d,h);if(t)return this._toFoundBracket(o,t);c=!1}i=t,n=this.languageConfigurationService.getLanguageConfiguration(i).brackets,o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew}const r=!!n&&!qg(s.getStandardTokenType(l));if(r)c?d=s.getStartOffset(l):(d=s.getStartOffset(l),h=s.getEndOffset(l));else if(o&&n&&c&&d!==h){const t=ap.findPrevBracketInRange(n.reversedRegex,e,a,d,h);if(t)return this._toFoundBracket(o,t)}c=r}if(o&&n&&c&&d!==h){const t=ap.findPrevBracketInRange(n.reversedRegex,e,a,d,h);if(t)return this._toFoundBracket(o,t)}}return null}findNextBracket(e){const t=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getFirstBracketAfter(t)||null;const i=this.textModel.getLineCount();let n=null,o=null,s=null;for(let e=t.lineNumber;e<=i;e++){const i=this.textModel.tokenization.getLineTokens(e),r=i.getCount(),a=this.textModel.getLineContent(e);let l=0,d=0,h=0;if(e===t.lineNumber){l=i.findTokenIndexAtOffset(t.column-1),d=t.column-1,h=t.column-1;const e=i.getLanguageId(l);n!==e&&(n=e,o=this.languageConfigurationService.getLanguageConfiguration(n).brackets,s=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew)}let c=!0;for(;l<r;l++){const t=i.getLanguageId(l);if(n!==t){if(s&&o&&c&&d!==h){const t=ap.findNextBracketInRange(o.forwardRegex,e,a,d,h);if(t)return this._toFoundBracket(s,t);c=!1}n=t,o=this.languageConfigurationService.getLanguageConfiguration(n).brackets,s=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew}const r=!!o&&!qg(i.getStandardTokenType(l));if(r)c||(d=i.getStartOffset(l)),h=i.getEndOffset(l);else if(s&&o&&c&&d!==h){const t=ap.findNextBracketInRange(o.forwardRegex,e,a,d,h);if(t)return this._toFoundBracket(s,t)}c=r}if(s&&o&&c&&d!==h){const t=ap.findNextBracketInRange(o.forwardRegex,e,a,d,h);if(t)return this._toFoundBracket(s,t)}}return null}findEnclosingBrackets(e,t){const i=this.textModel.validatePosition(e);if(this.canBuildAST){const e=Yu.fromPositions(i),t=this.getBracketPairsInRange(Yu.fromPositions(i,i)).findLast((t=>void 0!==t.closingBracketRange&&t.range.strictContainsRange(e)));return t?[t.openingBracketRange,t.closingBracketRange]:null}const n=Nf(t),o=this.textModel.getLineCount(),s=new Map;let r=[];const a=(e,t)=>{if(!s.has(e)){const i=[];for(let e=0,n=t?t.brackets.length:0;e<n;e++)i[e]=0;s.set(e,i)}r=s.get(e)};let l=0;const d=(e,t,i,o,s)=>{for(;;){if(n&&++l%100==0&&!n())return If.INSTANCE;const a=ap.findNextBracketInRange(e.forwardRegex,t,i,o,s);if(!a)break;const d=i.substring(a.startColumn-1,a.endColumn-1).toLowerCase(),h=e.textIsBracket[d];if(h&&(h.isOpen(d)?r[h.index]++:h.isClose(d)&&r[h.index]--,-1===r[h.index]))return this._matchFoundBracket(a,h,!1,n);o=a.endColumn-1}return null};let h=null,c=null;for(let e=i.lineNumber;e<=o;e++){const t=this.textModel.tokenization.getLineTokens(e),n=t.getCount(),o=this.textModel.getLineContent(e);let s=0,r=0,l=0;if(e===i.lineNumber){s=t.findTokenIndexAtOffset(i.column-1),r=i.column-1,l=i.column-1;const e=t.getLanguageId(s);h!==e&&(h=e,c=this.languageConfigurationService.getLanguageConfiguration(h).brackets,a(h,c))}let u=!0;for(;s<n;s++){const i=t.getLanguageId(s);if(h!==i){if(c&&u&&r!==l){const t=d(c,e,o,r,l);if(t)return Tf(t);u=!1}h=i,c=this.languageConfigurationService.getLanguageConfiguration(h).brackets,a(h,c)}const n=!!c&&!qg(t.getStandardTokenType(s));if(n)u||(r=t.getStartOffset(s)),l=t.getEndOffset(s);else if(c&&u&&r!==l){const t=d(c,e,o,r,l);if(t)return Tf(t)}u=n}if(c&&u&&r!==l){const t=d(c,e,o,r,l);if(t)return Tf(t)}}return null}_toFoundBracket(e,t){if(!t)return null;let i=this.textModel.getValueInRange(t);i=i.toLowerCase();const n=e.getBracketInfo(i);return n?{range:t,bracketInfo:n}:null}}function Nf(e){if(void 0===e)return()=>!0;{const t=Date.now();return()=>Date.now()-t<=e}}class If{static{this.INSTANCE=new If}constructor(){this._searchCanceledBrand=void 0}}function Tf(e){return e instanceof If?null:e}function Mf(e){return`--vscode-${e.replace(/\./g,"-")}`}function Af(e){return`var(${Mf(e)})`}function Rf(e,t){return`var(${Mf(e)}, ${t})`}const Of="base.contributions.colors",Pf=new class extends At{constructor(){super(),this._onDidChangeSchema=this._register(new Zt),this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,n=!1,o){const s={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:o};this.colorsById[e]=s;const r={type:"string",format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(r.deprecationMessage=o),n&&(r.pattern="^#(?:(?<rgba>[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$",r.patternErrorMessage=y(2004,"This color must be transparent or it will obscure content")),this.colorSchema.properties[e]={description:i,oneOf:[r,{type:"string",const:"default",description:y(2005,"Use the default color.")}]},this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map((e=>this.colorsById[e]))}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i?.defaults)return Uf(null!==(n=i.defaults)&&"object"==typeof n&&"light"in n&&"dark"in n?i.defaults[t.type]:i.defaults,t);var n}getColorSchema(){return this.colorSchema}toString(){return Object.keys(this.colorsById).sort(((e,t)=>{const i=-1===e.indexOf(".")?0:1,n=-1===t.indexOf(".")?0:1;return i!==n?i-n:e.localeCompare(t)})).map((e=>`- \`${e}\`: ${this.colorsById[e].description}`)).join("\n")}};function Ff(e,t,i,n,o){return Pf.registerColor(e,t,i,n,o)}function Bf(e,t){return{op:0,value:e,factor:t}}function Wf(e,t){return{op:1,value:e,factor:t}}function Vf(e,t){return{op:2,value:e,factor:t}}function Hf(...e){return{op:4,values:e}}function zf(e,t,i,n){return{op:5,value:e,background:t,factor:i,transparency:n}}function Uf(e,t){if(null!==e)return"string"==typeof e?"#"===e[0]?Lg.fromHex(e):t.getColor(e):e instanceof Lg?e:"object"==typeof e?function(e,t){switch(e.op){case 0:return Uf(e.value,t)?.darken(e.factor);case 1:return Uf(e.value,t)?.lighten(e.factor);case 2:return Uf(e.value,t)?.transparent(e.factor);case 7:{const i=Uf(e.color,t)||Lg.transparent,n=Uf(e.with,t)||Lg.transparent;return i.mix(n,e.ratio)}case 3:{const i=Uf(e.background,t);return i?Uf(e.value,t)?.makeOpaque(i):Uf(e.value,t)}case 4:for(const i of e.values){const e=Uf(i,t);if(e)return e}return;case 6:return Uf(t.defines(e.if)?e.then:e.else,t);case 5:{const i=Uf(e.value,t);if(!i)return;const n=Uf(e.background,t);return n?i.isDarkerThan(n)?Lg.getLighterColor(i,n,e.factor).transparent(e.transparency):Lg.getDarkerColor(i,n,e.factor).transparent(e.transparency):i.transparent(e.factor*e.transparency)}default:throw nt()}}(e,t):void 0}ru.add(Of,Pf);const Kf="vscode://schemas/workbench-colors",jf=ru.as(Sp);jf.registerSchema(Kf,Pf.getColorSchema());const qf=new Ci((()=>jf.notifySchemaChanged(Kf)),200);Pf.onDidChangeSchema((()=>{qf.isScheduled()||qf.schedule()}));const $f=Ff("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},y(1756,"Overall foreground color. This color is only used if not overridden by a component.")),Gf=(Ff("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},y(1757,"Overall foreground for disabled elements. This color is only used if not overridden by a component.")),Ff("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},y(1758,"Overall foreground color for error messages. This color is only used if not overridden by a component.")),Ff("descriptionForeground",{light:"#717171",dark:Vf($f,.7),hcDark:Vf($f,.7),hcLight:Vf($f,.7)},y(1759,"Foreground color for description text providing additional information, for example for a label."))),Zf=Ff("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},y(1760,"The default color for icons in the workbench.")),Yf=Ff("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},y(1761,"Overall border color for focused elements. This color is only used if not overridden by a component.")),Qf=Ff("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},y(1762,"An extra border around elements to separate them from others for greater contrast.")),Xf=Ff("contrastActiveBorder",{light:null,dark:null,hcDark:Yf,hcLight:Yf},y(1763,"An extra border around active elements to separate them from others for greater contrast.")),Jf=(Ff("selection.background",null,y(1764,"The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor.")),Ff("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},y(1765,"Foreground color for links in text."))),e_=(Ff("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},y(1766,"Foreground color for links in text when clicked on and on mouse hover.")),Ff("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:Lg.black,hcLight:"#292929"},y(1767,"Color for text separators.")),Ff("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},y(1768,"Foreground color for preformatted text segments.")),Ff("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},y(1769,"Background color for preformatted text segments.")),Ff("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},y(1770,"Background color for block quotes in text.")),Ff("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:Lg.white,hcLight:"#292929"},y(1771,"Border color for block quotes in text.")),Ff("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:Lg.black,hcLight:"#F2F2F2"},y(1772,"Background color for code blocks in text.")),Ff("sash.hoverBorder",Yf,y(1977,"Border color of active sashes.")),Ff("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:Lg.black,hcLight:"#0F4A85"},y(1978,"Badge background color. Badges are small information labels, e.g. for search results count."))),t_=Ff("badge.foreground",{dark:Lg.white,light:"#333",hcDark:Lg.white,hcLight:Lg.white},y(1979,"Badge foreground color. Badges are small information labels, e.g. for search results count.")),i_=(Ff("activityWarningBadge.foreground",{dark:Lg.black.lighten(.2),light:Lg.white,hcDark:null,hcLight:Lg.black.lighten(.2)},y(1980,"Foreground color of the warning activity badge")),Ff("activityWarningBadge.background",{dark:"#CCA700",light:"#BF8803",hcDark:null,hcLight:"#CCA700"},y(1981,"Background color of the warning activity badge")),Ff("activityErrorBadge.foreground",{dark:Lg.black.lighten(.2),light:Lg.white,hcDark:null,hcLight:Lg.black.lighten(.2)},y(1982,"Foreground color of the error activity badge")),Ff("activityErrorBadge.background",{dark:"#F14C4C",light:"#E51400",hcDark:null,hcLight:"#F14C4C"},y(1983,"Background color of the error activity badge")),Ff("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},y(1984,"Scrollbar shadow to indicate that the view is scrolled."))),n_=Ff("scrollbarSlider.background",{dark:Lg.fromHex("#797979").transparent(.4),light:Lg.fromHex("#646464").transparent(.4),hcDark:Vf(Qf,.6),hcLight:Vf(Qf,.4)},y(1985,"Scrollbar slider background color.")),o_=Ff("scrollbarSlider.hoverBackground",{dark:Lg.fromHex("#646464").transparent(.7),light:Lg.fromHex("#646464").transparent(.7),hcDark:Vf(Qf,.8),hcLight:Vf(Qf,.8)},y(1986,"Scrollbar slider background color when hovering.")),s_=Ff("scrollbarSlider.activeBackground",{dark:Lg.fromHex("#BFBFBF").transparent(.4),light:Lg.fromHex("#000000").transparent(.6),hcDark:Qf,hcLight:Qf},y(1987,"Scrollbar slider background color when clicked on.")),r_=Ff("progressBar.background",{dark:Lg.fromHex("#0E70C0"),light:Lg.fromHex("#0E70C0"),hcDark:Qf,hcLight:Qf},y(1988,"Background color of the progress bar that can show for long running operations.")),a_=(Ff("chart.line",{dark:"#236B8E",light:"#236B8E",hcDark:"#236B8E",hcLight:"#236B8E"},y(1989,"Line color for the chart.")),Ff("chart.axis",{dark:Lg.fromHex("#BFBFBF").transparent(.4),light:Lg.fromHex("#000000").transparent(.6),hcDark:Qf,hcLight:Qf},y(1990,"Axis color for the chart.")),Ff("chart.guide",{dark:Lg.fromHex("#BFBFBF").transparent(.2),light:Lg.fromHex("#000000").transparent(.2),hcDark:Qf,hcLight:Qf},y(1991,"Guide line for the chart.")),Ff("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:Lg.black,hcLight:Lg.white},y(1781,"Editor background color."))),l_=Ff("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:Lg.white,hcLight:$f},y(1782,"Editor default foreground color.")),d_=(Ff("editorStickyScroll.background",a_,y(1783,"Background color of sticky scroll in the editor")),Ff("editorStickyScrollGutter.background",a_,y(1784,"Background color of the gutter part of sticky scroll in the editor")),Ff("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:Lg.fromHex("#0F4A85").transparent(.1)},y(1785,"Background color of sticky scroll on hover in the editor")),Ff("editorStickyScroll.border",{dark:null,light:null,hcDark:Qf,hcLight:Qf},y(1786,"Border color of sticky scroll in the editor")),Ff("editorStickyScroll.shadow",i_,y(1787," Shadow color of sticky scroll in the editor")),Ff("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:Lg.white},y(1788,"Background color of editor widgets, such as find/replace."))),h_=Ff("editorWidget.foreground",$f,y(1789,"Foreground color of editor widgets, such as find/replace.")),c_=Ff("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:Qf,hcLight:Qf},y(1790,"Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.")),u_=(Ff("editorWidget.resizeBorder",null,y(1791,"Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")),Ff("editorError.background",null,y(1792,"Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Ff("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},y(1793,"Foreground color of error squigglies in the editor."))),g_=Ff("editorError.border",{dark:null,light:null,hcDark:Lg.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},y(1794,"If set, color of double underlines for errors in the editor.")),p_=Ff("editorWarning.background",null,y(1795,"Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),m_=Ff("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},y(1796,"Foreground color of warning squigglies in the editor.")),f_=Ff("editorWarning.border",{dark:null,light:null,hcDark:Lg.fromHex("#FFCC00").transparent(.8),hcLight:Lg.fromHex("#FFCC00").transparent(.8)},y(1797,"If set, color of double underlines for warnings in the editor.")),__=(Ff("editorInfo.background",null,y(1798,"Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Ff("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},y(1799,"Foreground color of info squigglies in the editor."))),v_=Ff("editorInfo.border",{dark:null,light:null,hcDark:Lg.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},y(1800,"If set, color of double underlines for infos in the editor.")),b_=Ff("editorHint.foreground",{dark:Lg.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},y(1801,"Foreground color of hint squigglies in the editor.")),w_=(Ff("editorHint.border",{dark:null,light:null,hcDark:Lg.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},y(1802,"If set, color of double underlines for hints in the editor.")),Ff("editorLink.activeForeground",{dark:"#4E94CE",light:Lg.blue,hcDark:Lg.cyan,hcLight:"#292929"},y(1803,"Color of active links."))),C_=Ff("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},y(1804,"Color of the editor selection.")),y_=Ff("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:Lg.white},y(1805,"Color of the selected text for high contrast.")),S_=Ff("editor.inactiveSelectionBackground",{light:Vf(C_,.5),dark:Vf(C_,.5),hcDark:Vf(C_,.7),hcLight:Vf(C_,.5)},y(1806,"Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),x_=Ff("editor.selectionHighlightBackground",{light:zf(C_,a_,.3,.6),dark:zf(C_,a_,.3,.6),hcDark:null,hcLight:null},y(1807,"Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0),k_=(Ff("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:Xf,hcLight:Xf},y(1808,"Border color for regions with the same content as the selection.")),Ff("editor.compositionBorder",{light:"#000000",dark:"#ffffff",hcLight:"#000000",hcDark:"#ffffff"},y(1809,"The border color for an IME composition.")),Ff("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},y(1810,"Color of the current search match.")),Ff("editor.findMatchForeground",null,y(1811,"Text color of the current search match."))),L_=Ff("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},y(1812,"Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),D_=Ff("editor.findMatchHighlightForeground",null,y(1813,"Foreground color of the other search matches."),!0),E_=(Ff("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},y(1814,"Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),Ff("editor.findMatchBorder",{light:null,dark:null,hcDark:Xf,hcLight:Xf},y(1815,"Border color of the current search match.")),Ff("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:Xf,hcLight:Xf},y(1816,"Border color of the other search matches."))),N_=Ff("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:Vf(Xf,.4),hcLight:Vf(Xf,.4)},y(1817,"Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),I_=(Ff("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},y(1818,"Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0),Ff("editorHoverWidget.background",d_,y(1819,"Background color of the editor hover."))),T_=Ff("editorHoverWidget.foreground",h_,y(1820,"Foreground color of the editor hover.")),M_=Ff("editorHoverWidget.border",c_,y(1821,"Border color of the editor hover.")),A_=(Ff("editorHoverWidget.statusBarBackground",{dark:Wf(I_,.2),light:Bf(I_,.05),hcDark:d_,hcLight:d_},y(1822,"Background color of the editor hover status bar.")),Ff("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:Lg.white,hcLight:Lg.black},y(1823,"Foreground color of inline hints"))),R_=Ff("editorInlayHint.background",{dark:Vf(e_,.1),light:Vf(e_,.1),hcDark:Vf(Lg.white,.1),hcLight:Vf(e_,.1)},y(1824,"Background color of inline hints")),O_=Ff("editorInlayHint.typeForeground",A_,y(1825,"Foreground color of inline hints for types")),P_=Ff("editorInlayHint.typeBackground",R_,y(1826,"Background color of inline hints for types")),F_=Ff("editorInlayHint.parameterForeground",A_,y(1827,"Foreground color of inline hints for parameters")),B_=Ff("editorInlayHint.parameterBackground",R_,y(1828,"Background color of inline hints for parameters")),W_=Ff("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},y(1829,"The color used for the lightbulb actions icon.")),V_=(Ff("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},y(1830,"The color used for the lightbulb auto fix actions icon.")),Ff("editorLightBulbAi.foreground",W_,y(1831,"The color used for the lightbulb AI icon.")),Ff("editor.snippetTabstopHighlightBackground",{dark:new Lg(new Sg(124,124,124,.3)),light:new Lg(new Sg(10,50,100,.2)),hcDark:new Lg(new Sg(124,124,124,.3)),hcLight:new Lg(new Sg(10,50,100,.2))},y(1832,"Highlight background color of a snippet tabstop.")),Ff("editor.snippetTabstopHighlightBorder",null,y(1833,"Highlight border color of a snippet tabstop.")),Ff("editor.snippetFinalTabstopHighlightBackground",null,y(1834,"Highlight background color of the final tabstop of a snippet.")),Ff("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new Lg(new Sg(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},y(1835,"Highlight border color of the final tabstop of a snippet.")),new Lg(new Sg(155,185,85,.2))),H_=new Lg(new Sg(255,0,0,.2)),z_=Ff("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},y(1836,"Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),U_=Ff("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},y(1837,"Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),K_=Ff("diffEditor.insertedLineBackground",{dark:V_,light:V_,hcDark:null,hcLight:null},y(1838,"Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),j_=(Ff("diffEditor.removedLineBackground",{dark:H_,light:H_,hcDark:null,hcLight:null},y(1839,"Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),Ff("diffEditorGutter.insertedLineBackground",null,y(1840,"Background color for the margin where lines got inserted.")),Ff("diffEditorGutter.removedLineBackground",null,y(1841,"Background color for the margin where lines got removed.")),Ff("diffEditorOverview.insertedForeground",null,y(1842,"Diff overview ruler foreground for inserted content."))),q_=Ff("diffEditorOverview.removedForeground",null,y(1843,"Diff overview ruler foreground for removed content.")),$_=(Ff("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},y(1844,"Outline color for the text that got inserted.")),Ff("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},y(1845,"Outline color for text that got removed.")),Ff("diffEditor.border",{dark:null,light:null,hcDark:Qf,hcLight:Qf},y(1846,"Border color between the two text editors.")),Ff("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},y(1847,"Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.")),Ff("diffEditor.unchangedRegionBackground","sideBar.background",y(1848,"The background color of unchanged blocks in the diff editor.")),Ff("diffEditor.unchangedRegionForeground","foreground",y(1849,"The foreground color of unchanged blocks in the diff editor.")),Ff("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},y(1850,"The background color of unchanged code in the diff editor.")),Ff("widget.shadow",{dark:Vf(Lg.black,.36),light:Vf(Lg.black,.16),hcDark:null,hcLight:null},y(1851,"Shadow color of widgets such as find/replace inside the editor."))),G_=Ff("widget.border",{dark:null,light:null,hcDark:Qf,hcLight:Qf},y(1852,"Border color of widgets such as find/replace inside the editor.")),Z_=Ff("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},y(1853,"Toolbar background when hovering over actions using the mouse")),Y_=(Ff("toolbar.hoverOutline",{dark:null,light:null,hcDark:Xf,hcLight:Xf},y(1854,"Toolbar outline when hovering over actions using the mouse")),Ff("toolbar.activeBackground",{dark:Wf(Z_,.1),light:Bf(Z_,.1),hcDark:null,hcLight:null},y(1855,"Toolbar background when holding the mouse over actions")),Ff("breadcrumb.foreground",Vf($f,.8),y(1856,"Color of focused breadcrumb items."))),Q_=Ff("breadcrumb.background",a_,y(1857,"Background color of breadcrumb items.")),X_=Ff("breadcrumb.focusForeground",{light:Bf($f,.2),dark:Wf($f,.1),hcDark:Wf($f,.1),hcLight:Wf($f,.1)},y(1858,"Color of focused breadcrumb items.")),J_=Ff("breadcrumb.activeSelectionForeground",{light:Bf($f,.2),dark:Wf($f,.1),hcDark:Wf($f,.1),hcLight:Wf($f,.1)},y(1859,"Color of selected breadcrumb items.")),ev=(Ff("breadcrumbPicker.background",d_,y(1860,"Background color of breadcrumb item picker.")),Lg.fromHex("#40C8AE").transparent(.5)),tv=Lg.fromHex("#40A6FF").transparent(.5),iv=Lg.fromHex("#606060").transparent(.4),nv=Ff("merge.currentHeaderBackground",{dark:ev,light:ev,hcDark:null,hcLight:null},y(1861,"Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),ov=(Ff("merge.currentContentBackground",Vf(nv,.4),y(1862,"Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),Ff("merge.incomingHeaderBackground",{dark:tv,light:tv,hcDark:null,hcLight:null},y(1863,"Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0)),sv=(Ff("merge.incomingContentBackground",Vf(ov,.4),y(1864,"Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),Ff("merge.commonHeaderBackground",{dark:iv,light:iv,hcDark:null,hcLight:null},y(1865,"Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0)),rv=(Ff("merge.commonContentBackground",Vf(sv,.4),y(1866,"Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),Ff("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},y(1867,"Border color on headers and the splitter in inline merge-conflicts."))),av=(Ff("editorOverviewRuler.currentContentForeground",{dark:Vf(nv,1),light:Vf(nv,1),hcDark:rv,hcLight:rv},y(1868,"Current overview ruler foreground for inline merge-conflicts.")),Ff("editorOverviewRuler.incomingContentForeground",{dark:Vf(ov,1),light:Vf(ov,1),hcDark:rv,hcLight:rv},y(1869,"Incoming overview ruler foreground for inline merge-conflicts.")),Ff("editorOverviewRuler.commonContentForeground",{dark:Vf(sv,1),light:Vf(sv,1),hcDark:rv,hcLight:rv},y(1870,"Common ancestor overview ruler foreground for inline merge-conflicts.")),Ff("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:"#AB5A00"},y(1871,"Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0)),lv=Ff("editorOverviewRuler.selectionHighlightForeground","#A0A0A0CC",y(1872,"Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),dv=Ff("problemsErrorIcon.foreground",u_,y(1873,"The color used for the problems error icon.")),hv=Ff("problemsWarningIcon.foreground",m_,y(1874,"The color used for the problems warning icon.")),cv=Ff("problemsInfoIcon.foreground",__,y(1875,"The color used for the problems info icon.")),uv=Ff("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},y(1966,"Minimap marker color for find matches."),!0),gv=Ff("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},y(1967,"Minimap marker color for repeating editor selections."),!0),pv=Ff("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},y(1968,"Minimap marker color for the editor selection."),!0),mv=Ff("minimap.infoHighlight",{dark:__,light:__,hcDark:v_,hcLight:v_},y(1969,"Minimap marker color for infos.")),fv=Ff("minimap.warningHighlight",{dark:m_,light:m_,hcDark:f_,hcLight:f_},y(1970,"Minimap marker color for warnings.")),_v=Ff("minimap.errorHighlight",{dark:new Lg(new Sg(255,18,18,.7)),light:new Lg(new Sg(255,18,18,.7)),hcDark:new Lg(new Sg(255,50,50,1)),hcLight:"#B5200D"},y(1971,"Minimap marker color for errors.")),vv=Ff("minimap.background",null,y(1972,"Minimap background color.")),bv=Ff("minimap.foregroundOpacity",Lg.fromHex("#000f"),y(1973,'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.')),wv=(Ff("minimapSlider.background",Vf(n_,.5),y(1974,"Minimap slider background color.")),Ff("minimapSlider.hoverBackground",Vf(o_,.5),y(1975,"Minimap slider background color when hovering.")),Ff("minimapSlider.activeBackground",Vf(s_,.5),y(1976,"Minimap slider background color when clicked on.")),Ff("charts.foreground",$f,y(1773,"The foreground color used in charts.")),Ff("charts.lines",Vf($f,.5),y(1774,"The color used for horizontal lines in charts.")),Ff("charts.red",u_,y(1775,"The red color used in chart visualizations.")),Ff("charts.blue",__,y(1776,"The blue color used in chart visualizations.")),Ff("charts.yellow",m_,y(1777,"The yellow color used in chart visualizations.")),Ff("charts.orange",uv,y(1778,"The orange color used in chart visualizations.")),Ff("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},y(1779,"The green color used in chart visualizations.")),Ff("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},y(1780,"The purple color used in chart visualizations.")),Ff("input.background",{dark:"#3C3C3C",light:Lg.white,hcDark:Lg.black,hcLight:Lg.white},y(1876,"Input box background."))),Cv=Ff("input.foreground",$f,y(1877,"Input box foreground.")),yv=Ff("input.border",{dark:null,light:null,hcDark:Qf,hcLight:Qf},y(1878,"Input box border.")),Sv=Ff("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:Qf,hcLight:Qf},y(1879,"Border color of activated options in input fields.")),xv=Ff("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},y(1880,"Background color of activated options in input fields.")),kv=Ff("inputOption.activeBackground",{dark:Vf(Yf,.4),light:Vf(Yf,.2),hcDark:Lg.transparent,hcLight:Lg.transparent},y(1881,"Background hover color of options in input fields.")),Lv=Ff("inputOption.activeForeground",{dark:Lg.white,light:Lg.black,hcDark:$f,hcLight:$f},y(1882,"Foreground color of activated options in input fields.")),Dv=(Ff("input.placeholderForeground",{light:Vf($f,.5),dark:Vf($f,.5),hcDark:Vf($f,.7),hcLight:Vf($f,.7)},y(1883,"Input box foreground color for placeholder text.")),Ff("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:Lg.black,hcLight:Lg.white},y(1884,"Input validation background color for information severity."))),Ev=Ff("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:$f},y(1885,"Input validation foreground color for information severity.")),Nv=Ff("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:Qf,hcLight:Qf},y(1886,"Input validation border color for information severity.")),Iv=Ff("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:Lg.black,hcLight:Lg.white},y(1887,"Input validation background color for warning severity.")),Tv=Ff("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:$f},y(1888,"Input validation foreground color for warning severity.")),Mv=Ff("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:Qf,hcLight:Qf},y(1889,"Input validation border color for warning severity.")),Av=Ff("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:Lg.black,hcLight:Lg.white},y(1890,"Input validation background color for error severity.")),Rv=Ff("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:$f},y(1891,"Input validation foreground color for error severity.")),Ov=Ff("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:Qf,hcLight:Qf},y(1892,"Input validation border color for error severity.")),Pv=Ff("dropdown.background",{dark:"#3C3C3C",light:Lg.white,hcDark:Lg.black,hcLight:Lg.white},y(1893,"Dropdown background.")),Fv=Ff("dropdown.listBackground",{dark:null,light:null,hcDark:Lg.black,hcLight:Lg.white},y(1894,"Dropdown list background.")),Bv=Ff("dropdown.foreground",{dark:"#F0F0F0",light:$f,hcDark:Lg.white,hcLight:$f},y(1895,"Dropdown foreground.")),Wv=Ff("dropdown.border",{dark:Pv,light:"#CECECE",hcDark:Qf,hcLight:Qf},y(1896,"Dropdown border.")),Vv=Ff("button.foreground",Lg.white,y(1897,"Button foreground color.")),Hv=Ff("button.separator",Vf(Vv,.4),y(1898,"Button separator color.")),zv=Ff("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},y(1899,"Button background color.")),Uv=Ff("button.hoverBackground",{dark:Wf(zv,.2),light:Bf(zv,.2),hcDark:zv,hcLight:zv},y(1900,"Button background color when hovering.")),Kv=Ff("button.border",Qf,y(1901,"Button border color.")),jv=Ff("button.secondaryForeground",{dark:Lg.white,light:Lg.white,hcDark:Lg.white,hcLight:$f},y(1902,"Secondary button foreground color.")),qv=Ff("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:Lg.white},y(1903,"Secondary button background color.")),$v=Ff("button.secondaryHoverBackground",{dark:Wf(qv,.2),light:Bf(qv,.2),hcDark:null,hcLight:null},y(1904,"Secondary button background color when hovering.")),Gv=Ff("radio.activeForeground",Lv,y(1905,"Foreground color of active radio option.")),Zv=Ff("radio.activeBackground",kv,y(1906,"Background color of active radio option.")),Yv=Ff("radio.activeBorder",Sv,y(1907,"Border color of the active radio option.")),Qv=Ff("radio.inactiveForeground",null,y(1908,"Foreground color of inactive radio option.")),Xv=Ff("radio.inactiveBackground",null,y(1909,"Background color of inactive radio option.")),Jv=Ff("radio.inactiveBorder",{light:Vf(Gv,.2),dark:Vf(Gv,.2),hcDark:Vf(Gv,.4),hcLight:Vf(Gv,.2)},y(1910,"Border color of the inactive radio option.")),eb=Ff("radio.inactiveHoverBackground",xv,y(1911,"Background color of inactive active radio option when hovering.")),tb=Ff("checkbox.background",Pv,y(1912,"Background color of checkbox widget.")),ib=(Ff("checkbox.selectBackground",d_,y(1913,"Background color of checkbox widget when the element it's in is selected.")),Ff("checkbox.foreground",Bv,y(1914,"Foreground color of checkbox widget."))),nb=Ff("checkbox.border",Wv,y(1915,"Border color of checkbox widget.")),ob=(Ff("checkbox.selectBorder",Zf,y(1916,"Border color of checkbox widget when the element it's in is selected.")),Ff("checkbox.disabled.background",{op:7,color:tb,with:ib,ratio:.33},y(1917,"Background of a disabled checkbox."))),sb=Ff("checkbox.disabled.foreground",{op:7,color:ib,with:tb,ratio:.33},y(1918,"Foreground of a disabled checkbox.")),rb=Ff("keybindingLabel.background",{dark:new Lg(new Sg(128,128,128,.17)),light:new Lg(new Sg(221,221,221,.4)),hcDark:Lg.transparent,hcLight:Lg.transparent},y(1919,"Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),ab=Ff("keybindingLabel.foreground",{dark:Lg.fromHex("#CCCCCC"),light:Lg.fromHex("#555555"),hcDark:Lg.white,hcLight:$f},y(1920,"Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),lb=Ff("keybindingLabel.border",{dark:new Lg(new Sg(51,51,51,.6)),light:new Lg(new Sg(204,204,204,.4)),hcDark:new Lg(new Sg(111,195,223)),hcLight:Qf},y(1921,"Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),db=Ff("keybindingLabel.bottomBorder",{dark:new Lg(new Sg(68,68,68,.6)),light:new Lg(new Sg(187,187,187,.4)),hcDark:new Lg(new Sg(111,195,223)),hcLight:$f},y(1922,"Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),hb=Ff("list.focusBackground",null,y(1923,"List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),cb=Ff("list.focusForeground",null,y(1924,"List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),ub=Ff("list.focusOutline",{dark:Yf,light:Yf,hcDark:Xf,hcLight:Xf},y(1925,"List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),gb=Ff("list.focusAndSelectionOutline",null,y(1926,"List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),pb=Ff("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:Lg.fromHex("#0F4A85").transparent(.1)},y(1927,"List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),mb=Ff("list.activeSelectionForeground",{dark:Lg.white,light:Lg.white,hcDark:null,hcLight:null},y(1928,"List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),fb=Ff("list.activeSelectionIconForeground",null,y(1929,"List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),_b=Ff("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:Lg.fromHex("#0F4A85").transparent(.1)},y(1930,"List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),vb=Ff("list.inactiveSelectionForeground",null,y(1931,"List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),bb=Ff("list.inactiveSelectionIconForeground",null,y(1932,"List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),wb=Ff("list.inactiveFocusBackground",null,y(1933,"List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Cb=Ff("list.inactiveFocusOutline",null,y(1934,"List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),yb=Ff("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:Lg.white.transparent(.1),hcLight:Lg.fromHex("#0F4A85").transparent(.1)},y(1935,"List/Tree background when hovering over items using the mouse.")),Sb=Ff("list.hoverForeground",null,y(1936,"List/Tree foreground when hovering over items using the mouse.")),xb=Ff("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},y(1937,"List/Tree drag and drop background when moving items over other items when using the mouse.")),kb=Ff("list.dropBetweenBackground",{dark:Zf,light:Zf,hcDark:null,hcLight:null},y(1938,"List/Tree drag and drop border color when moving items between items when using the mouse.")),Lb=Ff("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Yf,hcLight:Yf},y(1939,"List/Tree foreground color of the match highlights when searching inside the list/tree.")),Db=Ff("list.focusHighlightForeground",{dark:Lb,light:(Eb=pb,Nb=Lb,{op:6,if:Eb,then:Nb,else:"#BBE7FF"}),hcDark:Lb,hcLight:Lb},y(1940,"List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));var Eb,Nb;Ff("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},y(1941,"List/Tree foreground color for invalid items, for example an unresolved root in explorer.")),Ff("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},y(1942,"Foreground color of list items containing errors.")),Ff("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},y(1943,"Foreground color of list items containing warnings."));const Ib=Ff("listFilterWidget.background",{light:Bf(d_,0),dark:Wf(d_,0),hcDark:d_,hcLight:d_},y(1944,"Background color of the type filter widget in lists and trees.")),Tb=Ff("listFilterWidget.outline",{dark:Lg.transparent,light:Lg.transparent,hcDark:"#f38518",hcLight:"#007ACC"},y(1945,"Outline color of the type filter widget in lists and trees.")),Mb=Ff("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:Qf,hcLight:Qf},y(1946,"Outline color of the type filter widget in lists and trees, when there are no matches.")),Ab=Ff("listFilterWidget.shadow",$_,y(1947,"Shadow color of the type filter widget in lists and trees.")),Rb=(Ff("list.filterMatchBackground",{dark:L_,light:L_,hcDark:null,hcLight:null},y(1948,"Background color of the filtered match.")),Ff("list.filterMatchBorder",{dark:E_,light:E_,hcDark:Qf,hcLight:Xf},y(1949,"Border color of the filtered match.")),Ff("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},y(1950,"List/Tree foreground color for items that are deemphasized.")),Ff("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},y(1951,"Tree stroke color for the indentation guides."))),Ob=Ff("tree.inactiveIndentGuidesStroke",Vf(Rb,.4),y(1952,"Tree stroke color for the indentation guides that are not active.")),Pb=Ff("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},y(1953,"Table border color between columns.")),Fb=Ff("tree.tableOddRowsBackground",{dark:Vf($f,.04),light:Vf($f,.04),hcDark:null,hcLight:null},y(1954,"Background color for odd table rows.")),Bb=(Ff("editorActionList.background",d_,y(1955,"Action List background color.")),Ff("editorActionList.foreground",h_,y(1956,"Action List foreground color."))),Wb=(Ff("editorActionList.focusForeground",mb,y(1957,"Action List foreground color for the focused item.")),Ff("editorActionList.focusBackground",pb,y(1958,"Action List background color for the focused item.")),Ff("menu.border",{dark:null,light:null,hcDark:Qf,hcLight:Qf},y(1959,"Border color of menus."))),Vb=Ff("menu.foreground",Bv,y(1960,"Foreground color of menu items.")),Hb=Ff("menu.background",Pv,y(1961,"Background color of menu items.")),zb=Ff("menu.selectionForeground",mb,y(1962,"Foreground color of the selected menu item in menus.")),Ub=Ff("menu.selectionBackground",pb,y(1963,"Background color of the selected menu item in menus.")),Kb=Ff("menu.selectionBorder",{dark:null,light:null,hcDark:Xf,hcLight:Xf},y(1964,"Border color of the selected menu item in menus.")),jb=Ff("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:Qf,hcLight:Qf},y(1965,"Color of a separator menu item in menus.")),qb=Ff("quickInput.background",d_,y(1992,"Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),$b=Ff("quickInput.foreground",h_,y(1993,"Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),Gb=Ff("quickInputTitle.background",{dark:new Lg(new Sg(255,255,255,.105)),light:new Lg(new Sg(0,0,0,.06)),hcDark:"#000000",hcLight:Lg.white},y(1994,"Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),Zb=Ff("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:Lg.white,hcLight:"#0F4A85"},y(1995,"Quick picker color for grouping labels.")),Yb=Ff("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:Lg.white,hcLight:"#0F4A85"},y(1996,"Quick picker color for grouping borders.")),Qb=Ff("quickInput.list.focusBackground",null,"",void 0,y(1997,"Please use quickInputList.focusBackground instead")),Xb=Ff("quickInputList.focusForeground",mb,y(1998,"Quick picker foreground color for the focused item.")),Jb=Ff("quickInputList.focusIconForeground",fb,y(1999,"Quick picker icon foreground color for the focused item.")),ew=Ff("quickInputList.focusBackground",{dark:Hf(Qb,pb),light:Hf(Qb,pb),hcDark:null,hcLight:null},y(2e3,"Quick picker background color for the focused item."));var tw,iw;function nw(e){return e===tw.HIGH_CONTRAST_DARK||e===tw.HIGH_CONTRAST_LIGHT}function ow(e){return e===tw.DARK||e===tw.HIGH_CONTRAST_DARK}Ff("search.resultsInfoForeground",{light:$f,dark:Vf($f,.65),hcDark:$f,hcLight:$f},y(2001,"Color of the text in the search viewlet's completion message.")),Ff("searchEditor.findMatchBackground",{light:Vf(L_,.66),dark:Vf(L_,.66),hcDark:L_,hcLight:L_},y(2002,"Color of the Search Editor query matches.")),Ff("searchEditor.findMatchBorder",{light:Vf(E_,.66),dark:Vf(E_,.66),hcDark:E_,hcLight:E_},y(2003,"Border color of the Search Editor query matches.")),function(e){e.DARK="dark",e.LIGHT="light",e.HIGH_CONTRAST_DARK="hcDark",e.HIGH_CONTRAST_LIGHT="hcLight"}(tw||(tw={})),function(e){e.VS="vs",e.VS_DARK="vs-dark",e.HC_BLACK="hc-black",e.HC_LIGHT="hc-light"}(iw||(iw={}));const sw=oc("themeService");function rw(e){return{id:e}}function aw(e){switch(e){case tw.DARK:return iw.VS_DARK;case tw.HIGH_CONTRAST_DARK:return iw.HC_BLACK;case tw.HIGH_CONTRAST_LIGHT:return iw.HC_LIGHT;default:return iw.VS}}const lw="base.contributions.theming",dw=new class extends At{constructor(){super(),this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=this._register(new Zt)}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Tt((()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)}))}getThemingParticipants(){return this.themingParticipants}};function hw(e){return dw.onColorThemeChange(e)}ru.add(lw,dw);class cw extends At{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange((e=>this.onThemeChange(e))))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}const uw=Ff("editor.lineHighlightBackground",null,y(607,"Background color for the highlight of line at the cursor position.")),gw=Ff("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:Qf},y(608,"Background color for the border around the line at the cursor position.")),pw=(Ff("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},y(609,"Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0),Ff("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:Xf,hcLight:Xf},y(610,"Background color of the border around highlighted ranges.")),Ff("editor.symbolHighlightBackground",{dark:L_,light:L_,hcDark:null,hcLight:null},y(611,"Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0),Ff("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:Xf,hcLight:Xf},y(612,"Background color of the border around highlighted symbols.")),Ff("editorCursor.foreground",{dark:"#AEAFAD",light:Lg.black,hcDark:Lg.white,hcLight:"#0F4A85"},y(613,"Color of the editor cursor."))),mw=Ff("editorCursor.background",null,y(614,"The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),fw=Ff("editorMultiCursor.primary.foreground",pw,y(615,"Color of the primary editor cursor when multiple cursors are present.")),_w=Ff("editorMultiCursor.primary.background",mw,y(616,"The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),vw=Ff("editorMultiCursor.secondary.foreground",pw,y(617,"Color of secondary editor cursors when multiple cursors are present.")),bw=Ff("editorMultiCursor.secondary.background",mw,y(618,"The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),ww=Ff("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},y(619,"Color of whitespace characters in the editor.")),Cw=Ff("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:Lg.white,hcLight:"#292929"},y(620,"Color of editor line numbers.")),yw=Ff("editorIndentGuide.background",ww,y(621,"Color of the editor indentation guides."),!1,y(622,"'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),Sw=Ff("editorIndentGuide.activeBackground",ww,y(623,"Color of the active editor indentation guides."),!1,y(624,"'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),xw=Ff("editorIndentGuide.background1",yw,y(625,"Color of the editor indentation guides (1).")),kw=Ff("editorIndentGuide.background2","#00000000",y(626,"Color of the editor indentation guides (2).")),Lw=Ff("editorIndentGuide.background3","#00000000",y(627,"Color of the editor indentation guides (3).")),Dw=Ff("editorIndentGuide.background4","#00000000",y(628,"Color of the editor indentation guides (4).")),Ew=Ff("editorIndentGuide.background5","#00000000",y(629,"Color of the editor indentation guides (5).")),Nw=Ff("editorIndentGuide.background6","#00000000",y(630,"Color of the editor indentation guides (6).")),Iw=Ff("editorIndentGuide.activeBackground1",Sw,y(631,"Color of the active editor indentation guides (1).")),Tw=Ff("editorIndentGuide.activeBackground2","#00000000",y(632,"Color of the active editor indentation guides (2).")),Mw=Ff("editorIndentGuide.activeBackground3","#00000000",y(633,"Color of the active editor indentation guides (3).")),Aw=Ff("editorIndentGuide.activeBackground4","#00000000",y(634,"Color of the active editor indentation guides (4).")),Rw=Ff("editorIndentGuide.activeBackground5","#00000000",y(635,"Color of the active editor indentation guides (5).")),Ow=Ff("editorIndentGuide.activeBackground6","#00000000",y(636,"Color of the active editor indentation guides (6).")),Pw=Ff("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:Xf,hcLight:Xf},y(637,"Color of editor active line number"),!1,y(638,"Id is deprecated. Use 'editorLineNumber.activeForeground' instead.")),Fw=(Ff("editorLineNumber.activeForeground",Pw,y(639,"Color of editor active line number")),Ff("editorLineNumber.dimmedForeground",null,y(640,"Color of the final editor line when editor.renderFinalNewline is set to dimmed."))),Bw=Ff("editorRuler.foreground",{dark:"#5A5A5A",light:Lg.lightgrey,hcDark:Lg.white,hcLight:"#292929"},y(641,"Color of the editor rulers.")),Ww=(Ff("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},y(642,"Foreground color of editor CodeLens")),Ff("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},y(643,"Background color behind matching brackets")),Ff("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:Qf,hcLight:Qf},y(644,"Color for matching brackets boxes")),Ff("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},y(645,"Color of the overview ruler border."))),Vw=Ff("editorOverviewRuler.background",null,y(646,"Background color of the editor overview ruler.")),Hw=(Ff("editorGutter.background",a_,y(647,"Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")),Ff("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:Lg.fromHex("#fff").transparent(.8),hcLight:Qf},y(648,"Border color of unnecessary (unused) source code in the editor.")),Ff("editorUnnecessaryCode.opacity",{dark:Lg.fromHex("#000a"),light:Lg.fromHex("#0007"),hcDark:null,hcLight:null},y(649,"Opacity of unnecessary (unused) source code in the editor. For example, \"#000000c0\" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out."))),zw=(Ff("editorGhostText.border",{dark:null,light:null,hcDark:Lg.fromHex("#fff").transparent(.8),hcLight:Lg.fromHex("#292929").transparent(.8)},y(650,"Border color of ghost text in the editor.")),Ff("editorGhostText.foreground",{dark:Lg.fromHex("#ffffff56"),light:Lg.fromHex("#0007"),hcDark:null,hcLight:null},y(651,"Foreground color of the ghost text in the editor."))),Uw=(Ff("editorGhostText.background",null,y(652,"Background color of the ghost text in the editor.")),Ff("editorOverviewRuler.rangeHighlightForeground",new Lg(new Sg(0,122,204,.6)),y(653,"Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0)),Kw=Ff("editorOverviewRuler.errorForeground",{dark:new Lg(new Sg(255,18,18,.7)),light:new Lg(new Sg(255,18,18,.7)),hcDark:new Lg(new Sg(255,50,50,1)),hcLight:"#B5200D"},y(654,"Overview ruler marker color for errors.")),jw=Ff("editorOverviewRuler.warningForeground",{dark:m_,light:m_,hcDark:f_,hcLight:f_},y(655,"Overview ruler marker color for warnings.")),qw=Ff("editorOverviewRuler.infoForeground",{dark:__,light:__,hcDark:v_,hcLight:v_},y(656,"Overview ruler marker color for infos.")),$w=Ff("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},y(657,"Foreground color of brackets (1). Requires enabling bracket pair colorization.")),Gw=Ff("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},y(658,"Foreground color of brackets (2). Requires enabling bracket pair colorization.")),Zw=Ff("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},y(659,"Foreground color of brackets (3). Requires enabling bracket pair colorization.")),Yw=Ff("editorBracketHighlight.foreground4","#00000000",y(660,"Foreground color of brackets (4). Requires enabling bracket pair colorization.")),Qw=Ff("editorBracketHighlight.foreground5","#00000000",y(661,"Foreground color of brackets (5). Requires enabling bracket pair colorization.")),Xw=Ff("editorBracketHighlight.foreground6","#00000000",y(662,"Foreground color of brackets (6). Requires enabling bracket pair colorization.")),Jw=Ff("editorBracketHighlight.unexpectedBracket.foreground",{dark:new Lg(new Sg(255,18,18,.8)),light:new Lg(new Sg(255,18,18,.8)),hcDark:new Lg(new Sg(255,50,50,1)),hcLight:"#B5200D"},y(663,"Foreground color of unexpected brackets.")),eC=Ff("editorBracketPairGuide.background1","#00000000",y(664,"Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),tC=Ff("editorBracketPairGuide.background2","#00000000",y(665,"Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),iC=Ff("editorBracketPairGuide.background3","#00000000",y(666,"Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),nC=Ff("editorBracketPairGuide.background4","#00000000",y(667,"Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),oC=Ff("editorBracketPairGuide.background5","#00000000",y(668,"Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),sC=Ff("editorBracketPairGuide.background6","#00000000",y(669,"Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),rC=Ff("editorBracketPairGuide.activeBackground1","#00000000",y(670,"Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),aC=Ff("editorBracketPairGuide.activeBackground2","#00000000",y(671,"Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),lC=Ff("editorBracketPairGuide.activeBackground3","#00000000",y(672,"Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),dC=Ff("editorBracketPairGuide.activeBackground4","#00000000",y(673,"Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),hC=Ff("editorBracketPairGuide.activeBackground5","#00000000",y(674,"Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),cC=Ff("editorBracketPairGuide.activeBackground6","#00000000",y(675,"Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));Ff("editorUnicodeHighlight.border",m_,y(676,"Border color used to highlight unicode characters.")),Ff("editorUnicodeHighlight.background",p_,y(677,"Background color used to highlight unicode characters.")),hw(((e,t)=>{const i=e.getColor(a_),n=e.getColor(uw),o=n&&!n.isTransparent()?n:i;o&&t.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${o}; }`)}));class uC extends At{constructor(e){super(),this.textModel=e,this.colorProvider=new gC,this.onDidChangeEmitter=new Zt,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange((e=>{this.onDidChangeEmitter.fire()})))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,n){return n||void 0===t?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map((e=>({id:`bracket${e.range.toString()}-${e.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(e,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:e.range}))).toArray():[]}getAllDecorations(e,t){return void 0===e?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new Yu(1,1,this.textModel.getLineCount(),1),e,t):[]}}class gC{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return"bracket-highlighting-"+e%30}}function pC(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}hw(((e,t)=>{const i=[$w,Gw,Zw,Yw,Qw,Xw],n=new gC;t.addRule(`.monaco-editor .${n.unexpectedClosingBracketClassName} { color: ${e.getColor(Jw)}; }`);const o=i.map((t=>e.getColor(t))).filter((e=>!!e)).filter((e=>!e.isTransparent()));for(let e=0;e<30;e++){const i=o[e%o.length];t.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(e)} { color: ${i}; }`)}}));class mC{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,i,n){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=n}toString(){return 0===this.oldText.length?`(insert@${this.oldPosition} "${pC(this.newText)}")`:0===this.newText.length?`(delete@${this.oldPosition} "${pC(this.oldText)}")`:`(replace@${this.oldPosition} "${pC(this.oldText)}" with "${pC(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const n=t.length;Po(e,n,i),i+=4;for(let o=0;o<n;o++)Ro(e,t.charCodeAt(o),i),i+=2;return i}static _readString(e,t){const i=Oo(e,t);return function(e,t,i){const n=new Uint16Array(e.buffer,t,i);return i>0&&(65279===n[0]||65534===n[0])?function(e,t,i){const n=[];let o=0;for(let s=0;s<i;s++){const i=Ao(e,t);t+=2,n[o++]=String.fromCharCode(i)}return n.join("")}(e,t,i):Yg().decode(n)}(e,t+=4,i)}writeSize(){return 8+mC._writeStringSize(this.oldText)+mC._writeStringSize(this.newText)}write(e,t){return Po(e,this.oldPosition,t),t+=4,Po(e,this.newPosition,t),t+=4,t=mC._writeString(e,this.oldText,t),mC._writeString(e,this.newText,t)}static read(e,t,i){const n=Oo(e,t),o=Oo(e,t+=4);t+=4;const s=mC._readString(e,t);t+=mC._writeStringSize(s);const r=mC._readString(e,t);return t+=mC._writeStringSize(r),i.push(new mC(n,s,o,r)),t}}class fC{constructor(e,t){this._prevEdits=e,this._currEdits=t,this._result=[],this._resultLen=0,this._prevLen=this._prevEdits.length,this._prevDeltaOffset=0,this._currLen=this._currEdits.length,this._currDeltaOffset=0}compress(){let e=0,t=0,i=this._getPrev(e),n=this._getCurr(t);for(;e<this._prevLen||t<this._currLen;){if(null===i){this._acceptCurr(n),n=this._getCurr(++t);continue}if(null===n){this._acceptPrev(i),i=this._getPrev(++e);continue}if(n.oldEnd<=i.newPosition){this._acceptCurr(n),n=this._getCurr(++t);continue}if(i.newEnd<=n.oldPosition){this._acceptPrev(i),i=this._getPrev(++e);continue}if(n.oldPosition<i.newPosition){const[e,t]=fC._splitCurr(n,i.newPosition-n.oldPosition);this._acceptCurr(e),n=t;continue}if(i.newPosition<n.oldPosition){const[e,t]=fC._splitPrev(i,n.oldPosition-i.newPosition);this._acceptPrev(e),i=t;continue}let o,s;if(n.oldEnd===i.newEnd)o=i,s=n,i=this._getPrev(++e),n=this._getCurr(++t);else if(n.oldEnd<i.newEnd){const[e,r]=fC._splitPrev(i,n.oldLength);o=e,s=n,i=r,n=this._getCurr(++t)}else{const[t,r]=fC._splitCurr(n,i.newLength);o=i,s=t,i=this._getPrev(++e),n=r}this._result[this._resultLen++]=new mC(o.oldPosition,o.oldText,s.newPosition,s.newText),this._prevDeltaOffset+=o.newLength-o.oldLength,this._currDeltaOffset+=s.newLength-s.oldLength}const o=fC._merge(this._result);return fC._removeNoOps(o)}_acceptCurr(e){this._result[this._resultLen++]=fC._rebaseCurr(this._prevDeltaOffset,e),this._currDeltaOffset+=e.newLength-e.oldLength}_getCurr(e){return e<this._currLen?this._currEdits[e]:null}_acceptPrev(e){this._result[this._resultLen++]=fC._rebasePrev(this._currDeltaOffset,e),this._prevDeltaOffset+=e.newLength-e.oldLength}_getPrev(e){return e<this._prevLen?this._prevEdits[e]:null}static _rebaseCurr(e,t){return new mC(t.oldPosition-e,t.oldText,t.newPosition,t.newText)}static _rebasePrev(e,t){return new mC(t.oldPosition,t.oldText,t.newPosition+e,t.newText)}static _splitPrev(e,t){const i=e.newText.substr(0,t),n=e.newText.substr(t);return[new mC(e.oldPosition,e.oldText,e.newPosition,i),new mC(e.oldEnd,"",e.newPosition+t,n)]}static _splitCurr(e,t){const i=e.oldText.substr(0,t),n=e.oldText.substr(t);return[new mC(e.oldPosition,i,e.newPosition,e.newText),new mC(e.oldPosition+t,n,e.newEnd,"")]}static _merge(e){if(0===e.length)return e;const t=[];let i=0,n=e[0];for(let o=1;o<e.length;o++){const s=e[o];n.oldEnd===s.oldPosition?n=new mC(n.oldPosition,n.oldText+s.oldText,n.newPosition,n.newText+s.newText):(t[i++]=n,n=s)}return t[i++]=n,t}static _removeNoOps(e){if(0===e.length)return e;const t=[];let i=0;for(let n=0;n<e.length;n++){const o=e[n];o.oldText!==o.newText&&(t[i++]=o)}return t}}const _C=function(){if("function"==typeof crypto.randomUUID)return crypto.randomUUID.bind(crypto);const e=new Uint8Array(16),t=[];for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return function(){crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128;let i=0,n="";return n+=t[e[i++]],n+=t[e[i++]],n+=t[e[i++]],n+=t[e[i++]],n+="-",n+=t[e[i++]],n+=t[e[i++]],n+="-",n+=t[e[i++]],n+=t[e[i++]],n+="-",n+=t[e[i++]],n+=t[e[i++]],n+="-",n+=t[e[i++]],n+=t[e[i++]],n+=t[e[i++]],n+=t[e[i++]],n+=t[e[i++]],n+=t[e[i++]],n}}();function vC(e){return`${e}-${_C()}`}const bC=Symbol("TextModelEditSource");class wC{constructor(e,t){this.metadata=e}toString(){return`${this.metadata.source}`}getType(){const e=this.metadata;switch(e.source){case"cursor":return e.kind;case"inlineCompletionAccept":return e.source+(e.$nes?":nes":"");case"unknown":return e.name||"unknown";default:return e.source}}toKey(e,t={}){const i=this.metadata;return Object.entries(i).filter((([i,n])=>{const o=t[i];return void 0!==o?o:(i.match(/\$/g)||[]).length<=e&&null!=n&&""!==n})).map((([e,t])=>`${e}:${t}`)).join("-")}}function CC(e){return new wC(e,bC)}const yC=e=>CC({source:"unknown",name:e.name}),SC=()=>CC({source:"rename"}),xC=e=>CC({source:"inlineCompletionAccept",$nes:e.nes,...AC(e.providerId),$$requestUuid:e.requestUuid,$$languageId:e.languageId}),kC=e=>CC({source:"inlineCompletionPartialAccept",type:e.type,$nes:e.nes,...AC(e.providerId),$$requestUuid:e.requestUuid,$$languageId:e.languageId}),LC=e=>CC({source:"cursor",kind:e.kind,detailedSource:e.detailedSource}),DC=()=>CC({source:"setValue"}),EC=()=>CC({source:"eolChange"}),NC=()=>CC({source:"applyEdits"}),IC=()=>CC({source:"snippet"}),TC=e=>CC({source:"suggest",...AC(e.providerId)}),MC=e=>CC({source:"codeAction",$kind:e.kind,...AC(e.providerId)});function AC(e){return e?{$extensionId:e.extensionId,$extensionVersion:e.extensionVersion,$providerId:e.providerId}:{}}class RC{static fromText(e){const t=xm.ofText(e).lineCount,i=e.length;return new RC(t,0,i,0)}static tryCreate(e,t,i,n){if(void 0!==e&&void 0!==t&&void 0!==i&&void 0!==n)return new RC(e,t,i,n)}constructor(e,t,i,n){this.linesAdded=e,this.linesRemoved=t,this.charsAdded=i,this.charsRemoved=n}}var OC,PC;function FC(e){return e.toString()}!function(e){e.newId=function(){return vC("sgt")}}(OC||(OC={}));class BC{static create(e,t){const i=e.getAlternativeVersionId(),n=HC(e);return new BC(i,i,n,n,t,t,[])}constructor(e,t,i,n,o,s,r){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=n,this.beforeCursorState=o,this.afterCursorState=s,this.changes=r}append(e,t,i,n,o){var s,r;t.length>0&&(this.changes=(r=t,null===(s=this.changes)||0===s.length?r:new fC(s,r).compress())),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+16*(e?e.length:0)}static _writeSelections(e,t,i){if(Po(e,t?t.length:0,i),i+=4,t)for(const n of t)Po(e,n.selectionStartLineNumber,i),i+=4,Po(e,n.selectionStartColumn,i),i+=4,Po(e,n.positionLineNumber,i),i+=4,Po(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=Oo(e,t);t+=4;for(let o=0;o<n;o++){const n=Oo(e,t),o=Oo(e,t+=4),s=Oo(e,t+=4),r=Oo(e,t+=4);t+=4,i.push(new Qu(n,o,s,r))}return t}serialize(){let e=10+BC._writeSelectionsSize(this.beforeCursorState)+BC._writeSelectionsSize(this.afterCursorState)+4;for(const t of this.changes)e+=t.writeSize();const t=new Uint8Array(e);let i=0;Po(t,this.beforeVersionId,i),i+=4,Po(t,this.afterVersionId,i),i+=4,Bo(t,this.beforeEOL,i),i+=1,Bo(t,this.afterEOL,i),i+=1,i=BC._writeSelections(t,this.beforeCursorState,i),i=BC._writeSelections(t,this.afterCursorState,i),Po(t,this.changes.length,i),i+=4;for(const e of this.changes)i=e.write(t,i);return t.buffer}static deserialize(e){const t=new Uint8Array(e);let i=0;const n=Oo(t,i);i+=4;const o=Oo(t,i);i+=4;const s=Fo(t,i);i+=1;const r=Fo(t,i);i+=1;const a=[];i=BC._readSelections(t,i,a);const l=[];i=BC._readSelections(t,i,l);const d=Oo(t,i);i+=4;const h=[];for(let e=0;e<d;e++)i=mC.read(t,i,h);return new BC(n,o,s,r,a,l,h)}}class WC{get type(){return 0}get resource(){return uo.isUri(this.model)?this.model:this.model.uri}constructor(e,t,i,n){this.label=e,this.code=t,this.model=i,this._data=BC.create(i,n)}toString(){return(this._data instanceof BC?this._data:BC.deserialize(this._data)).changes.map((e=>e.toString())).join(", ")}matchesResource(e){return(uo.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof BC}append(e,t,i,n,o){this._data instanceof BC&&this._data.append(e,t,i,n,o)}close(){this._data instanceof BC&&(this._data=this._data.serialize())}open(){this._data instanceof BC||(this._data=BC.deserialize(this._data))}undo(){if(uo.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof BC&&(this._data=this._data.serialize());const e=BC.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(uo.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof BC&&(this._data=this._data.serialize());const e=BC.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof BC&&(this._data=this._data.serialize()),this._data.byteLength+168}}class VC{get resources(){return this._editStackElementsArr.map((e=>e.resource))}constructor(e,t,i){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const e of this._editStackElementsArr){const t=FC(e.resource);this._editStackElementsMap.set(t,e)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=FC(e);return this._editStackElementsMap.has(t)}setModel(e){const t=FC(uo.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=FC(e.uri);return!!this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).canAppend(e)}append(e,t,i,n,o){const s=FC(e.uri);this._editStackElementsMap.get(s).append(e,t,i,n,o)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=FC(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${Bh(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function HC(e){return"\n"===e.getEOL()?0:1}function zC(e){return!!e&&(e instanceof WC||e instanceof VC)}class UC{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);zC(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);zC(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(zC(i)&&i.canAppend(this._model))return i;const n=new WC(y(781,"Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(n,t),n}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],HC(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n,o=yC({name:"pushEditOperation"})){const s=this._getOrCreateEditStackElement(e,n),r=this._model.applyEdits(t,!0,o),a=UC._computeCursorState(i,r),l=r.map(((e,t)=>({index:t,textChange:e.textChange})));return l.sort(((e,t)=>e.textChange.oldPosition===t.textChange.oldPosition?e.index-t.index:e.textChange.oldPosition-t.textChange.oldPosition)),s.append(this._model,l.map((e=>e.textChange)),HC(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(e){return Ie(e),null}}}class KC extends At{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function jC(e,t){let i=0,n=0;const o=e.length;for(;n<o;){const o=e.charCodeAt(n);if(32===o)i++;else{if(9!==o)break;i=i-i%t+t}n++}return n===o?-1:i}!function(e){e[e.Disabled=0]="Disabled",e[e.EnabledForActive=1]="EnabledForActive",e[e.Enabled=2]="Enabled"}(PC||(PC={}));class qC{constructor(e,t,i,n,o,s){if(this.visibleColumn=e,this.column=t,this.className=i,this.horizontalLine=n,this.forWrappedLinesAfterColumn=o,this.forWrappedLinesBeforeOrAtColumn=s,-1!==e==(-1!==t))throw new Error}}class $C{constructor(e,t){this.top=e,this.endColumn=t}}class GC extends KC{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t}getLanguageConfiguration(e){return this.languageConfigurationService.getLanguageConfiguration(e)}_computeIndentLevel(e){return jC(this.textModel.getLineContent(e+1),this.textModel.getOptions().tabSize)}getActiveIndentGuide(e,t,i){this.assertNotDisposed();const n=this.textModel.getLineCount();if(e<1||e>n)throw new Ve("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=Boolean(o&&o.offSide);let r=-2,a=-1,l=-2,d=-1;const h=e=>{if(-1!==r&&(-2===r||r>e-1)){r=-1,a=-1;for(let t=e-2;t>=0;t--){const e=this._computeIndentLevel(t);if(e>=0){r=t,a=e;break}}}if(-2===l){l=-1,d=-1;for(let t=e;t<n;t++){const e=this._computeIndentLevel(t);if(e>=0){l=t,d=e;break}}}};let c=-2,u=-1,g=-2,p=-1;const m=e=>{if(-2===c){c=-1,u=-1;for(let t=e-2;t>=0;t--){const e=this._computeIndentLevel(t);if(e>=0){c=t,u=e;break}}}if(-1!==g&&(-2===g||g<e-1)){g=-1,p=-1;for(let t=e;t<n;t++){const e=this._computeIndentLevel(t);if(e>=0){g=t,p=e;break}}}};let f=0,_=!0,v=0,b=!0,w=0,C=0;for(let o=0;_||b;o++){const r=e-o,g=e+o;o>1&&(r<1||r<t)&&(_=!1),o>1&&(g>n||g>i)&&(b=!1),o>5e4&&(_=!1,b=!1);let y=-1;if(_&&r>=1){const e=this._computeIndentLevel(r-1);e>=0?(l=r-1,d=e,y=Math.ceil(e/this.textModel.getOptions().indentSize)):(h(r),y=this._getIndentLevelForWhitespaceLine(s,a,d))}let S=-1;if(b&&g<=n){const e=this._computeIndentLevel(g-1);e>=0?(c=g-1,u=e,S=Math.ceil(e/this.textModel.getOptions().indentSize)):(m(g),S=this._getIndentLevelForWhitespaceLine(s,u,p))}if(0!==o){if(1===o){if(g<=n&&S>=0&&C+1===S){_=!1,f=g,v=g,w=S;continue}if(r>=1&&y>=0&&y-1===C){b=!1,f=r,v=r,w=y;continue}if(f=e,v=e,w=C,0===w)return{startLineNumber:f,endLineNumber:v,indent:w}}_&&(y>=w?f=r:_=!1),b&&(S>=w?v=g:b=!1)}else C=y}return{startLineNumber:f,endLineNumber:v,indent:w}}getLinesBracketGuides(e,t,i,n){const o=[];for(let i=e;i<=t;i++)o.push([]);const s=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new Yu(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let r;if(i&&s.length>0){const n=(e<=i.lineNumber&&i.lineNumber<=t?s:this.textModel.bracketPairs.getBracketPairsInRange(Yu.fromPositions(i)).toArray()).filter((e=>Yu.strictContainsPosition(e.range,i)));r=gm(n,(e=>true))?.range}const a=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,l=new ZC;for(const i of s){if(!i.closingBracketRange)continue;const s=r&&i.range.equalsRange(r);if(!s&&!n.includeInactive)continue;const d=l.getInlineClassName(i.nestingLevel,i.nestingLevelOfEqualBracketType,a)+(n.highlightActive&&s?" "+l.activeClassName:""),h=i.openingBracketRange.getStartPosition(),c=i.closingBracketRange.getStartPosition(),u=n.horizontalGuides===PC.Enabled||n.horizontalGuides===PC.EnabledForActive&&s;if(i.range.startLineNumber===i.range.endLineNumber){u&&o[i.range.startLineNumber-e].push(new qC(-1,i.openingBracketRange.getEndPosition().column,d,new $C(!1,c.column),-1,-1));continue}const g=this.getVisibleColumnFromPosition(c),p=this.getVisibleColumnFromPosition(i.openingBracketRange.getStartPosition()),m=Math.min(p,g,i.minVisibleColumnIndentation+1);let f=!1;$i(this.textModel.getLineContent(i.closingBracketRange.startLineNumber))<i.closingBracketRange.startColumn-1&&(f=!0);const _=Math.max(h.lineNumber,e),v=Math.min(c.lineNumber,t),b=f?1:0;for(let t=_;t<v+b;t++)o[t-e].push(new qC(m,-1,d,null,t===h.lineNumber?h.column:-1,t===c.lineNumber?c.column:-1));u&&(h.lineNumber>=e&&p>m&&o[h.lineNumber-e].push(new qC(m,-1,d,new $C(!1,h.column),-1,-1)),c.lineNumber<=t&&g>m&&o[c.lineNumber-e].push(new qC(m,-1,d,new $C(!f,c.column),-1,-1)))}for(const e of o)e.sort(((e,t)=>e.visibleColumn-t.visibleColumn));return o}getVisibleColumnFromPosition(e){return Eg.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const i=this.textModel.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const n=this.textModel.getOptions(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=Boolean(o&&o.offSide),r=new Array(t-e+1);let a=-2,l=-1,d=-2,h=-1;for(let o=e;o<=t;o++){const t=o-e,c=this._computeIndentLevel(o-1);if(c>=0)a=o-1,l=c,r[t]=Math.ceil(c/n.indentSize);else{if(-2===a){a=-1,l=-1;for(let e=o-2;e>=0;e--){const t=this._computeIndentLevel(e);if(t>=0){a=e,l=t;break}}}if(-1!==d&&(-2===d||d<o-1)){d=-1,h=-1;for(let e=o;e<i;e++){const t=this._computeIndentLevel(e);if(t>=0){d=e,h=t;break}}}r[t]=this._getIndentLevelForWhitespaceLine(s,l,h)}}return r}_getIndentLevelForWhitespaceLine(e,t,i){const n=this.textModel.getOptions();return-1===t||-1===i?0:t<i?1+Math.floor(t/n.indentSize):t===i||e?Math.ceil(i/n.indentSize):1+Math.floor(i/n.indentSize)}}class ZC{constructor(){this.activeClassName="indent-active"}getInlineClassName(e,t,i){return this.getInlineClassNameOfLevel(i?t:e)}getInlineClassNameOfLevel(e){return"bracket-indent-guide lvl-"+e%30}}class YC{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function QC(e,t,i,n,o){let s;for(o.spacesDiff=0,o.looksLikeAlignment=!1,s=0;s<t&&s<n&&e.charCodeAt(s)===i.charCodeAt(s);s++);let r=0,a=0;for(let i=s;i<t;i++)32===e.charCodeAt(i)?r++:a++;let l=0,d=0;for(let e=s;e<n;e++)32===i.charCodeAt(e)?l++:d++;if(r>0&&a>0)return;if(l>0&&d>0)return;const h=Math.abs(a-d),c=Math.abs(r-l);if(0===h)return o.spacesDiff=c,void(c>0&&0<=l-1&&l-1<e.length&&l<i.length&&32!==i.charCodeAt(l)&&32===e.charCodeAt(l-1)&&44===e.charCodeAt(e.length-1)&&(o.looksLikeAlignment=!0));c%h!=0||(o.spacesDiff=c/h)}function XC(e,t,i){const n=Math.min(e.getLineCount(),1e4);let o=0,s=0,r="",a=0;const l=[2,4,6,8,3,5,7],d=[0,0,0,0,0,0,0,0,0],h=new YC;for(let l=1;l<=n;l++){const n=e.getLineLength(l),c=e.getLineContent(l),u=n<=65536;let g=!1,p=0,m=0,f=0;for(let t=0,i=n;t<i;t++){const i=u?c.charCodeAt(t):e.getLineCharCode(l,t);if(9===i)f++;else{if(32!==i){g=!0,p=t;break}m++}}if(!g)continue;if(f>0?o++:m>1&&s++,QC(r,a,c,p,h),h.looksLikeAlignment&&(!i||t!==h.spacesDiff))continue;const _=h.spacesDiff;_<=8&&d[_]++,r=c,a=p}let c=i;o!==s&&(c=o<s);let u=t;if(c){let e=c?0:.1*n;l.forEach((t=>{const i=d[t];i>e&&(e=i,u=t)})),4===u&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(u=2)}return{insertSpaces:c,tabSize:u}}function JC(e){return(1&e.metadata)>>>0}function ey(e,t){e.metadata=254&e.metadata|t}function ty(e){return(2&e.metadata)>>>1==1}function iy(e,t){e.metadata=253&e.metadata|(t?1:0)<<1}function ny(e){return(4&e.metadata)>>>2==1}function oy(e,t){e.metadata=251&e.metadata|(t?1:0)<<2}function sy(e){return(64&e.metadata)>>>6==1}function ry(e,t){e.metadata=191&e.metadata|(t?1:0)<<6}function ay(e){return(128&e.metadata)>>>7==1}function ly(e,t){e.metadata=127&e.metadata|(t?1:0)<<7}function dy(e,t){e.metadata=231&e.metadata|t<<3}function hy(e,t){e.metadata=223&e.metadata|(t?1:0)<<5}class cy{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,ey(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,oy(this,!1),ry(this,!1),dy(this,1),hy(this,!1),ly(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,iy(this,!1)}reset(e,t,i,n){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=n}setOptions(e){this.options=e;const t=this.options.className;oy(this,"squiggly-error"===t||"squiggly-warning"===t||"squiggly-info"===t),ry(this,null!==this.options.glyphMarginClassName),dy(this,this.options.stickiness),hy(this,this.options.collapseOnReplaceEdit),ly(this,this.options.affectsFont??!1)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const uy=new cy(null,0,0);uy.parent=uy,uy.left=uy,uy.right=uy,ey(uy,0);class gy{constructor(){this.root=uy,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,n,o,s,r){return this.root===uy?[]:function(e,t,i,n,o,s,r,a){let l=e.root,d=0,h=0,c=0,u=0;const g=[];let p=0;for(;l!==uy;)if(ty(l))iy(l.left,!1),iy(l.right,!1),l===l.parent.right&&(d-=l.parent.delta),l=l.parent;else{if(!ty(l.left)){if(h=d+l.maxEnd,h<t){iy(l,!0);continue}if(l.left!==uy){l=l.left;continue}}if(c=d+l.start,c>i)iy(l,!0);else{if(u=d+l.end,u>=t){l.setCachedOffsets(c,u,r);let e=!0;n&&l.ownerId&&l.ownerId!==n&&(e=!1),o&&ny(l)&&(e=!1),s&&ay(l)&&(e=!1),a&&!sy(l)&&(e=!1),e&&(g[p++]=l)}iy(l,!0),l.right===uy||ty(l.right)||(d+=l.delta,l=l.right)}}return iy(e.root,!1),g}(this,e,t,i,n,o,s,r)}search(e,t,i,n,o){return this.root===uy?[]:function(e,t,i,n,o,s){let r=e.root,a=0,l=0,d=0;const h=[];let c=0;for(;r!==uy;){if(ty(r)){iy(r.left,!1),iy(r.right,!1),r===r.parent.right&&(a-=r.parent.delta),r=r.parent;continue}if(r.left!==uy&&!ty(r.left)){r=r.left;continue}l=a+r.start,d=a+r.end,r.setCachedOffsets(l,d,o);let e=!0;t&&r.ownerId&&r.ownerId!==t&&(e=!1),i&&ny(r)&&(e=!1),n&&ay(r)&&(e=!1),s&&!sy(r)&&(e=!1),e&&(h[c++]=r),iy(r,!0),r.right===uy||ty(r.right)||(a+=r.delta,r=r.right)}return iy(e.root,!1),h}(this,e,t,i,n,o)}collectNodesFromOwner(e){return function(e,t){let i=e.root;const n=[];let o=0;for(;i!==uy;)ty(i)?(iy(i.left,!1),iy(i.right,!1),i=i.parent):i.left===uy||ty(i.left)?(i.ownerId===t&&(n[o++]=i),iy(i,!0),i.right===uy||ty(i.right)||(i=i.right)):i=i.left;return iy(e.root,!1),n}(this,e)}collectNodesPostOrder(){return function(e){let t=e.root;const i=[];let n=0;for(;t!==uy;)ty(t)?(iy(t.left,!1),iy(t.right,!1),t=t.parent):t.left===uy||ty(t.left)?t.right===uy||ty(t.right)?(i[n++]=t,iy(t,!0)):t=t.right:t=t.left;return iy(e.root,!1),i}(this)}insert(e){fy(this,e),this._normalizeDeltaIfNecessary()}delete(e){_y(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let n=0;for(;e!==this.root;)e===e.parent.right&&(n+=e.parent.delta),e=e.parent;const o=i.start+n,s=i.end+n;i.setCachedOffsets(o,s,t)}acceptReplace(e,t,i,n){const o=function(e,t,i){let n=e.root,o=0,s=0,r=0,a=0;const l=[];let d=0;for(;n!==uy;)if(ty(n))iy(n.left,!1),iy(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),n=n.parent;else{if(!ty(n.left)){if(s=o+n.maxEnd,s<t){iy(n,!0);continue}if(n.left!==uy){n=n.left;continue}}r=o+n.start,r>i?iy(n,!0):(a=o+n.end,a>=t&&(n.setCachedOffsets(r,a,0),l[d++]=n),iy(n,!0),n.right===uy||ty(n.right)||(o+=n.delta,n=n.right))}return iy(e.root,!1),l}(this,e,e+t);for(let e=0,t=o.length;e<t;e++)_y(this,o[e]);this._normalizeDeltaIfNecessary(),function(e,t,i,n){let o=e.root,s=0,r=0,a=0;const l=n-(i-t);for(;o!==uy;)if(ty(o))iy(o.left,!1),iy(o.right,!1),o===o.parent.right&&(s-=o.parent.delta),yy(o),o=o.parent;else{if(!ty(o.left)){if(r=s+o.maxEnd,r<t){iy(o,!0);continue}if(o.left!==uy){o=o.left;continue}}a=s+o.start,a>i?(o.start+=l,o.end+=l,o.delta+=l,(o.delta<-1073741824||o.delta>1073741824)&&(e.requestNormalizeDelta=!0),iy(o,!0)):(iy(o,!0),o.right===uy||ty(o.right)||(s+=o.delta,o=o.right))}iy(e.root,!1)}(this,e,e+t,i),this._normalizeDeltaIfNecessary();for(let s=0,r=o.length;s<r;s++){const r=o[s];r.start=r.cachedAbsoluteStart,r.end=r.cachedAbsoluteEnd,my(r,e,e+t,i,n),r.maxEnd=r.end,fy(this,r)}this._normalizeDeltaIfNecessary()}_normalizeDeltaIfNecessary(){this.requestNormalizeDelta&&(this.requestNormalizeDelta=!1,function(e){let t=e.root,i=0;for(;t!==uy;)t.left===uy||ty(t.left)?t.right===uy||ty(t.right)?(t.start=i+t.start,t.end=i+t.end,t.delta=0,yy(t),iy(t,!0),iy(t.left,!1),iy(t.right,!1),t===t.parent.right&&(i-=t.parent.delta),t=t.parent):(i+=t.delta,t=t.right):t=t.left;iy(e.root,!1)}(this))}}function py(e,t,i,n){return e<i||!(e>i)&&1!==n&&(2===n||t)}function my(e,t,i,n,o){const s=function(e){return(24&e.metadata)>>>3}(e),r=0===s||2===s,a=1===s||2===s,l=i-t,d=n,h=Math.min(l,d),c=e.start;let u=!1;const g=e.end;let p=!1;t<=c&&g<=i&&function(e){return(32&e.metadata)>>>5==1}(e)&&(e.start=t,u=!0,e.end=t,p=!0);{const e=o?1:l>0?2:0;!u&&py(c,r,t,e)&&(u=!0),!p&&py(g,a,t,e)&&(p=!0)}if(h>0&&!o){const e=l>d?2:0;!u&&py(c,r,t+h,e)&&(u=!0),!p&&py(g,a,t+h,e)&&(p=!0)}{const n=o?1:0;!u&&py(c,r,i,n)&&(e.start=t+d,u=!0),!p&&py(g,a,i,n)&&(e.end=t+d,p=!0)}const m=d-l;u||(e.start=Math.max(0,c+m)),p||(e.end=Math.max(0,g+m)),e.start>e.end&&(e.end=e.start)}function fy(e,t){if(e.root===uy)return t.parent=uy,t.left=uy,t.right=uy,ey(t,0),e.root=t,e.root;!function(e,t){let i=0,n=e.root;const o=t.start,s=t.end;for(;;)if(r=o,a=s,l=n.start+i,d=n.end+i,(r===l?a-d:r-l)<0){if(n.left===uy){t.start-=i,t.end-=i,t.maxEnd-=i,n.left=t;break}n=n.left}else{if(n.right===uy){t.start-=i+n.delta,t.end-=i+n.delta,t.maxEnd-=i+n.delta,n.right=t;break}i+=n.delta,n=n.right}var r,a,l,d;t.parent=n,t.left=uy,t.right=uy,ey(t,1)}(e,t),Sy(t.parent);let i=t;for(;i!==e.root&&1===JC(i.parent);)if(i.parent===i.parent.parent.left){const t=i.parent.parent.right;1===JC(t)?(ey(i.parent,0),ey(t,0),ey(i.parent.parent,1),i=i.parent.parent):(i===i.parent.right&&(i=i.parent,by(e,i)),ey(i.parent,0),ey(i.parent.parent,1),wy(e,i.parent.parent))}else{const t=i.parent.parent.left;1===JC(t)?(ey(i.parent,0),ey(t,0),ey(i.parent.parent,1),i=i.parent.parent):(i===i.parent.left&&(i=i.parent,wy(e,i)),ey(i.parent,0),ey(i.parent.parent,1),by(e,i.parent.parent))}return ey(e.root,0),t}function _y(e,t){let i,n;if(t.left===uy?(i=t.right,n=t,i.delta+=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta):t.right===uy?(i=t.left,n=t):(n=function(e){for(;e.left!==uy;)e=e.left;return e}(t.right),i=n.right,i.start+=n.delta,i.end+=n.delta,i.delta+=n.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=t.delta,n.end+=t.delta,n.delta=t.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0)),n===e.root)return e.root=i,ey(i,0),t.detach(),vy(),yy(i),void(e.root.parent=uy);const o=1===JC(n);if(n===n.parent.left?n.parent.left=i:n.parent.right=i,n===t?i.parent=n.parent:(n.parent===t?i.parent=n:i.parent=n.parent,n.left=t.left,n.right=t.right,n.parent=t.parent,ey(n,JC(t)),t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==uy&&(n.left.parent=n),n.right!==uy&&(n.right.parent=n)),t.detach(),o)return Sy(i.parent),n!==t&&(Sy(n),Sy(n.parent)),void vy();let s;for(Sy(i),Sy(i.parent),n!==t&&(Sy(n),Sy(n.parent));i!==e.root&&0===JC(i);)i===i.parent.left?(s=i.parent.right,1===JC(s)&&(ey(s,0),ey(i.parent,1),by(e,i.parent),s=i.parent.right),0===JC(s.left)&&0===JC(s.right)?(ey(s,1),i=i.parent):(0===JC(s.right)&&(ey(s.left,0),ey(s,1),wy(e,s),s=i.parent.right),ey(s,JC(i.parent)),ey(i.parent,0),ey(s.right,0),by(e,i.parent),i=e.root)):(s=i.parent.left,1===JC(s)&&(ey(s,0),ey(i.parent,1),wy(e,i.parent),s=i.parent.left),0===JC(s.left)&&0===JC(s.right)?(ey(s,1),i=i.parent):(0===JC(s.left)&&(ey(s.right,0),ey(s,1),by(e,s),s=i.parent.left),ey(s,JC(i.parent)),ey(i.parent,0),ey(s.left,0),wy(e,i.parent),i=e.root));ey(i,0),vy()}function vy(){uy.parent=uy,uy.delta=0,uy.start=0,uy.end=0}function by(e,t){const i=t.right;i.delta+=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta,t.right=i.left,i.left!==uy&&(i.left.parent=t),i.parent=t.parent,t.parent===uy?e.root=i:t===t.parent.left?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i,yy(t),yy(i)}function wy(e,t){const i=t.left;t.delta-=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(e.requestNormalizeDelta=!0),t.start-=i.delta,t.end-=i.delta,t.left=i.right,i.right!==uy&&(i.right.parent=t),i.parent=t.parent,t.parent===uy?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i,yy(t),yy(i)}function Cy(e){let t=e.end;if(e.left!==uy){const i=e.left.maxEnd;i>t&&(t=i)}if(e.right!==uy){const i=e.right.maxEnd+e.delta;i>t&&(t=i)}return t}function yy(e){e.maxEnd=Cy(e)}function Sy(e){for(;e!==uy;){const t=Cy(e);if(e.maxEnd===t)return;e.maxEnd=t,e=e.parent}}class xy{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==ky)return Ly(this.right);let e=this;for(;e.parent!==ky&&e.parent.left!==e;)e=e.parent;return e.parent===ky?ky:e.parent}prev(){if(this.left!==ky)return Dy(this.left);let e=this;for(;e.parent!==ky&&e.parent.right!==e;)e=e.parent;return e.parent===ky?ky:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const ky=new xy(null,0);function Ly(e){for(;e.left!==ky;)e=e.left;return e}function Dy(e){for(;e.right!==ky;)e=e.right;return e}function Ey(e){return e===ky?0:e.size_left+e.piece.length+Ey(e.right)}function Ny(e){return e===ky?0:e.lf_left+e.piece.lineFeedCnt+Ny(e.right)}function Iy(){ky.parent=ky}function Ty(e,t){const i=t.right;i.size_left+=t.size_left+(t.piece?t.piece.length:0),i.lf_left+=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),t.right=i.left,i.left!==ky&&(i.left.parent=t),i.parent=t.parent,t.parent===ky?e.root=i:t.parent.left===t?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i}function My(e,t){const i=t.left;t.left=i.right,i.right!==ky&&(i.right.parent=t),i.parent=t.parent,t.size_left-=i.size_left+(i.piece?i.piece.length:0),t.lf_left-=i.lf_left+(i.piece?i.piece.lineFeedCnt:0),t.parent===ky?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i}function Ay(e,t){let i,n;if(t.left===ky?(n=t,i=n.right):t.right===ky?(n=t,i=n.left):(n=Ly(t.right),i=n.right),n===e.root)return e.root=i,i.color=0,t.detach(),Iy(),void(e.root.parent=ky);const o=1===n.color;if(n===n.parent.left?n.parent.left=i:n.parent.right=i,n===t?(i.parent=n.parent,Py(e,i)):(n.parent===t?i.parent=n:i.parent=n.parent,Py(e,i),n.left=t.left,n.right=t.right,n.parent=t.parent,n.color=t.color,t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==ky&&(n.left.parent=n),n.right!==ky&&(n.right.parent=n),n.size_left=t.size_left,n.lf_left=t.lf_left,Py(e,n)),t.detach(),i.parent.left===i){const t=Ey(i),n=Ny(i);if(t!==i.parent.size_left||n!==i.parent.lf_left){const o=t-i.parent.size_left,s=n-i.parent.lf_left;i.parent.size_left=t,i.parent.lf_left=n,Oy(e,i.parent,o,s)}}if(Py(e,i.parent),o)return void Iy();let s;for(;i!==e.root&&0===i.color;)i===i.parent.left?(s=i.parent.right,1===s.color&&(s.color=0,i.parent.color=1,Ty(e,i.parent),s=i.parent.right),0===s.left.color&&0===s.right.color?(s.color=1,i=i.parent):(0===s.right.color&&(s.left.color=0,s.color=1,My(e,s),s=i.parent.right),s.color=i.parent.color,i.parent.color=0,s.right.color=0,Ty(e,i.parent),i=e.root)):(s=i.parent.left,1===s.color&&(s.color=0,i.parent.color=1,My(e,i.parent),s=i.parent.left),0===s.left.color&&0===s.right.color?(s.color=1,i=i.parent):(0===s.left.color&&(s.right.color=0,s.color=1,Ty(e,s),s=i.parent.left),s.color=i.parent.color,i.parent.color=0,s.left.color=0,My(e,i.parent),i=e.root));i.color=0,Iy()}function Ry(e,t){for(Py(e,t);t!==e.root&&1===t.parent.color;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;1===i.color?(t.parent.color=0,i.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.right&&Ty(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,My(e,t.parent.parent))}else{const i=t.parent.parent.left;1===i.color?(t.parent.color=0,i.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.left&&My(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,Ty(e,t.parent.parent))}e.root.color=0}function Oy(e,t,i,n){for(;t!==e.root&&t!==ky;)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}function Py(e,t){let i=0,n=0;if(t!==e.root){for(;t!==e.root&&t===t.parent.right;)t=t.parent;if(t!==e.root)for(i=Ey((t=t.parent).left)-t.size_left,n=Ny(t.left)-t.lf_left,t.size_left+=i,t.lf_left+=n;t!==e.root&&(0!==i||0!==n);)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}}ky.parent=ky,ky.left=ky,ky.right=ky,ky.color=0;const Fy=(e,t)=>new Oi((()=>{try{return new Intl.Collator(e,t)}catch{return new Intl.Collator(void 0,t)}})),By=(e,t)=>new Oi((()=>{try{return new Intl.Segmenter(e,t)}catch{return new Intl.Segmenter(void 0,t)}})),Wy=(e,t)=>new Oi((()=>{try{return new Intl.NumberFormat(e,t)}catch{return new Intl.NumberFormat(void 0,t)}}));function Vy(e){return e<0?0:e>255?255:0|e}function Hy(e){return e<0?0:e>4294967295?4294967295:0|e}class zy{constructor(e){const t=Vy(e);this._defaultValue=t,this._asciiMap=zy._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){const t=new Uint8Array(256);return t.fill(e),t}set(e,t){const i=Vy(t);e>=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}class Uy{constructor(){this._actual=new zy(0)}add(e){this._actual.set(e,1)}has(e){return 1===this._actual.get(e)}clear(){return this._actual.clear()}}class Ky extends zy{constructor(e,t){super(0),this._segmenter=null,this._cachedLine=null,this._cachedSegments=[],this.intlSegmenterLocales=t,this.intlSegmenterLocales.length>0?this._segmenter=By(this.intlSegmenterLocales,{granularity:"word"}):this._segmenter=null;for(let t=0,i=e.length;t<i;t++)this.set(e.charCodeAt(t),2);this.set(32,1),this.set(9,1)}findPrevIntlWordBeforeOrAtOffset(e,t){let i=null;for(const n of this._getIntlSegmenterWordsOnLine(e)){if(n.index>t)break;i=n}return i}findNextIntlWordAtOrAfterOffset(e,t){for(const i of this._getIntlSegmenterWordsOnLine(e))if(!(i.index<t))return i;return null}_getIntlSegmenterWordsOnLine(e){return this._segmenter?(this._cachedLine===e||(this._cachedLine=e,this._cachedSegments=this._filterWordSegments(this._segmenter.value.segment(e))),this._cachedSegments):[]}_filterWordSegments(e){const t=[];for(const i of e)this._isWordLike(i)&&t.push(i);return t}_isWordLike(e){return!!e.isWordLike}}const jy=new ad(10);function qy(e,t){const i=`${e}/${t.join(",")}`;let n=jy.get(i);return n||(n=new Ky(e,t),jy.set(i,n)),n}class $y{constructor(e,t,i,n){this.searchString=e,this.isRegex=t,this.matchCase=i,this.wordSeparators=n}parseSearchRequest(){if(""===this.searchString)return null;let e;e=this.isRegex?Gy(this.searchString):this.searchString.indexOf("\n")>=0;let t=null;try{t=Ki(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch(e){return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new bg(t,this.wordSeparators?qy(this.wordSeparators,[]):null,i?this.searchString:null)}}function Gy(e){if(!e||0===e.length)return!1;for(let t=0,i=e.length;t<i;t++){const n=e.charCodeAt(t);if(10===n)return!0;if(92===n){if(t++,t>=i)break;const n=e.charCodeAt(t);if(110===n||114===n||87===n)return!0}}return!1}function Zy(e,t,i){if(!i)return new _g(e,null);const n=[];for(let e=0,i=t.length;e<i;e++)n[e]=t[e];return new _g(e,n)}class Yy{constructor(e){const t=[];let i=0;for(let n=0,o=e.length;n<o;n++)10===e.charCodeAt(n)&&(t[i++]=n);this._lineFeedsOffsets=t}findLineFeedCountBeforeOffset(e){const t=this._lineFeedsOffsets;let i=0,n=t.length-1;if(-1===n)return 0;if(e<=t[0])return 0;for(;i<n;){const o=i+((n-i)/2|0);t[o]>=e?n=o-1:t[o+1]>=e?(i=o,n=o):i=o+1}return i+1}}class Qy{static findMatches(e,t,i,n,o){const s=t.parseSearchRequest();return s?s.regex.multiline?this._doFindMatchesMultiline(e,i,new Jy(s.wordSeparators,s.regex),n,o):this._doFindMatchesLineByLine(e,i,s,n,o):[]}static _getMultilineMatchRange(e,t,i,n,o,s){let r,a,l=0;if(n?(l=n.findLineFeedCountBeforeOffset(o),r=t+o+l):r=t+o,n){const e=n.findLineFeedCountBeforeOffset(o+s.length)-l;a=r+s.length+e}else a=r+s.length;const d=e.getPositionAt(r),h=e.getPositionAt(a);return new Yu(d.lineNumber,d.column,h.lineNumber,h.column)}static _doFindMatchesMultiline(e,t,i,n,o){const s=e.getOffsetAt(t.getStartPosition()),r=e.getValueInRange(t,1),a="\r\n"===e.getEOL()?new Yy(r):null,l=[];let d,h=0;for(i.reset(0);d=i.next(r);)if(l[h++]=Zy(this._getMultilineMatchRange(e,s,r,a,d.index,d[0]),d,n),h>=o)return l;return l}static _doFindMatchesLineByLine(e,t,i,n,o){const s=[];let r=0;if(t.startLineNumber===t.endLineNumber){const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return r=this._findMatchesInLine(i,a,t.startLineNumber,t.startColumn-1,r,s,n,o),s}const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);r=this._findMatchesInLine(i,a,t.startLineNumber,t.startColumn-1,r,s,n,o);for(let a=t.startLineNumber+1;a<t.endLineNumber&&r<o;a++)r=this._findMatchesInLine(i,e.getLineContent(a),a,0,r,s,n,o);if(r<o){const a=e.getLineContent(t.endLineNumber).substring(0,t.endColumn-1);r=this._findMatchesInLine(i,a,t.endLineNumber,0,r,s,n,o)}return s}static _findMatchesInLine(e,t,i,n,o,s,r,a){const l=e.wordSeparators;if(!r&&e.simpleSearch){const r=e.simpleSearch,d=r.length,h=t.length;let c=-d;for(;-1!==(c=t.indexOf(r,c+d));)if((!l||Xy(l,t,h,c,d))&&(s[o++]=new _g(new Yu(i,c+1+n,i,c+1+d+n),null),o>=a))return o;return o}const d=new Jy(e.wordSeparators,e.regex);let h;d.reset(0);do{if(h=d.next(t),h&&(s[o++]=Zy(new Yu(i,h.index+1+n,i,h.index+1+h[0].length+n),h,r),o>=a))return o}while(h);return o}static findNextMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const s=new Jy(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,s,n):this._doFindNextMatchLineByLine(e,i,s,n)}static _doFindNextMatchMultiline(e,t,i,n){const o=new rc(t.lineNumber,1),s=e.getOffsetAt(o),r=e.getLineCount(),a=e.getValueInRange(new Yu(o.lineNumber,o.column,r,e.getLineMaxColumn(r)),1),l="\r\n"===e.getEOL()?new Yy(a):null;i.reset(t.column-1);const d=i.next(a);return d?Zy(this._getMultilineMatchRange(e,s,a,l,d.index,d[0]),d,n):1!==t.lineNumber||1!==t.column?this._doFindNextMatchMultiline(e,new rc(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const o=e.getLineCount(),s=t.lineNumber,r=e.getLineContent(s),a=this._findFirstMatchInLine(i,r,s,t.column,n);if(a)return a;for(let t=1;t<=o;t++){const r=(s+t-1)%o,a=e.getLineContent(r+1),l=this._findFirstMatchInLine(i,a,r+1,1,n);if(l)return l}return null}static _findFirstMatchInLine(e,t,i,n,o){e.reset(n-1);const s=e.next(t);return s?Zy(new Yu(i,s.index+1,i,s.index+1+s[0].length),s,o):null}static findPreviousMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const s=new Jy(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,s,n):this._doFindPreviousMatchLineByLine(e,i,s,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const o=this._doFindMatchesMultiline(e,new Yu(1,1,t.lineNumber,t.column),i,n,9990);if(o.length>0)return o[o.length-1];const s=e.getLineCount();return t.lineNumber!==s||t.column!==e.getLineMaxColumn(s)?this._doFindPreviousMatchMultiline(e,new rc(s,e.getLineMaxColumn(s)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const o=e.getLineCount(),s=t.lineNumber,r=e.getLineContent(s).substring(0,t.column-1),a=this._findLastMatchInLine(i,r,s,n);if(a)return a;for(let t=1;t<=o;t++){const r=(o+s-t-1)%o,a=e.getLineContent(r+1),l=this._findLastMatchInLine(i,a,r+1,n);if(l)return l}return null}static _findLastMatchInLine(e,t,i,n){let o,s=null;for(e.reset(0);o=e.next(t);)s=Zy(new Yu(i,o.index+1,i,o.index+1+o[0].length),o,n);return s}}function Xy(e,t,i,n,o){return function(e,t,i,n,o){if(0===n)return!0;const s=t.charCodeAt(n-1);if(0!==e.get(s))return!0;if(13===s||10===s)return!0;if(o>0){const i=t.charCodeAt(n);if(0!==e.get(i))return!0}return!1}(e,t,0,n,o)&&function(e,t,i,n,o){if(n+o===i)return!0;const s=t.charCodeAt(n+o);if(0!==e.get(s))return!0;if(13===s||10===s)return!0;if(o>0){const i=t.charCodeAt(n+o-1);if(0!==e.get(i))return!0}return!1}(e,t,i,n,o)}class Jy{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t)return null;if(i=this._searchRegex.exec(e),!i)return null;const n=i.index,o=i[0].length;if(n===this._prevMatchStartIndex&&o===this._prevMatchLength){if(0===o){cn(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=o,!this._wordSeparators||Xy(this._wordSeparators,e,t,n,o))return i}while(i);return null}}const eS=65535;function tS(e){let t;return t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length),t.set(e,0),t}class iS{constructor(e,t,i,n,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=o}}function nS(e,t=!0){const i=[0];let n=1;for(let t=0,o=e.length;t<o;t++){const s=e.charCodeAt(t);13===s?t+1<o&&10===e.charCodeAt(t+1)?(i[n++]=t+2,t++):i[n++]=t+1:10===s&&(i[n++]=t+1)}return t?tS(i):i}class oS{constructor(e,t,i,n,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=o}}class sS{constructor(e,t){this.buffer=e,this.lineStarts=t}}class rS{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==ky&&e.iterate(e.root,(e=>(e!==ky&&this._pieces.push(e.piece),!0)))}read(){return 0===this._pieces.length?0===this._index?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:0===this._index?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class aS{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber<e&&i.nodeStartLineNumber+i.node.piece.lineFeedCnt>=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const i=this._cache;for(let n=0;n<i.length;n++){const o=i[n];(null===o.node.parent||o.nodeStartOffset>=e)&&(i[n]=null,t=!0)}if(t){const e=[];for(const t of i)null!==t&&e.push(t);this._cache=e}}}class lS{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new sS("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=ky,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let t=0,i=e.length;t<i;t++)if(e[t].buffer.length>0){e[t].lineStarts||(e[t].lineStarts=nS(e[t].buffer));const i=new oS(t+1,{line:0,column:0},{line:e[t].lineStarts.length-1,column:e[t].buffer.length-e[t].lineStarts[e[t].lineStarts.length-1]},e[t].lineStarts.length-1,e[t].buffer.length);this._buffers.push(e[t]),n=this.rbInsertRight(n,i)}this._searchCache=new aS(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=65535-Math.floor(21845),i=2*t;let n="",o=0;const s=[];if(this.iterate(this.root,(r=>{const a=this.getNodeContent(r),l=a.length;if(o<=t||o+l<i)return n+=a,o+=l,!0;const d=n.replace(/\r\n|\r|\n/g,e);return s.push(new sS(d,nS(d))),n=a,o=l,!0})),o>0){const t=n.replace(/\r\n|\r|\n/g,e);s.push(new sS(t,nS(t)))}this.create(s,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new rS(this,e)}getOffsetAt(e,t){let i=0,n=this.root;for(;n!==ky;)if(n.left!==ky&&n.lf_left+1>=e)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt+1>=e)return i+=n.size_left,i+(this.getAccumulatedValue(n,e-n.lf_left-2)+t-1);e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right}return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0;const n=e;for(;t!==ky;)if(0!==t.size_left&&t.size_left>=e)t=t.left;else{if(t.size_left+t.piece.length>=e){const o=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+o.index,0===o.index){const e=this.getOffsetAt(i+1,1);return new rc(i+1,n-e+1)}return new rc(i+1,o.remainder+1)}if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===ky){const t=this.getOffsetAt(i+1,1);return new rc(i+1,n-e-t+1)}t=t.right}return new rc(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const i=this.nodeAt2(e.startLineNumber,e.startColumn),n=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,n);return t?t===this._EOL&&this._EOLNormalized&&t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const i=e.node,n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n.substring(o+e.remainder,o+t.remainder)}let i=e.node;const n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let s=n.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==ky;){const e=this._buffers[i.piece.bufferIndex].buffer,n=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){s+=e.substring(n,n+t.remainder);break}s+=e.substr(n,i.piece.length),i=i.next()}return s}getLinesContent(){const e=[];let t=0,i="",n=!1;return this.iterate(this.root,(o=>{if(o===ky)return!0;const s=o.piece;let r=s.length;if(0===r)return!0;const a=this._buffers[s.bufferIndex].buffer,l=this._buffers[s.bufferIndex].lineStarts,d=s.start.line,h=s.end.line;let c=l[d]+s.start.column;if(n&&(10===a.charCodeAt(c)&&(c++,r--),e[t++]=i,i="",n=!1,0===r))return!0;if(d===h)return this._EOLNormalized||13!==a.charCodeAt(c+r-1)?i+=a.substr(c,r):(n=!0,i+=a.substr(c,r-1)),!0;i+=this._EOLNormalized?a.substring(c,Math.max(c,l[d+1]-this._EOLLength)):a.substring(c,l[d+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let n=d+1;n<h;n++)i=this._EOLNormalized?a.substring(l[n],l[n+1]-this._EOLLength):a.substring(l[n],l[n+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;return this._EOLNormalized||13!==a.charCodeAt(l[h]+s.end.column-1)?i=a.substr(l[h],s.end.column):(n=!0,0===s.end.column?t--:i=a.substr(l[h],s.end.column-1)),!0})),n&&(e[t++]=i,i=""),e[t++]=i,e}getLength(){return this._length}getLineCount(){return this._lineCnt}getLineContent(e){return this._lastVisitedLine.lineNumber===e||(this._lastVisitedLine.lineNumber=e,e===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(e):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(e,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(e).replace(/(\r\n|\r|\n)$/,"")),this._lastVisitedLine.value}_getCharCode(e){if(e.remainder===e.node.piece.length){const t=e.node.next();if(!t)return 0;const i=this._buffers[t.piece.bufferIndex],n=this.offsetInBuffer(t.piece.bufferIndex,t.piece.start);return i.buffer.charCodeAt(n)}{const t=this._buffers[e.node.piece.bufferIndex],i=this.offsetInBuffer(e.node.piece.bufferIndex,e.node.piece.start)+e.remainder;return t.buffer.charCodeAt(i)}}getLineCharCode(e,t){const i=this.nodeAt2(e,t+1);return this._getCharCode(i)}getLineLength(e){if(e===this.getLineCount()){const t=this.getOffsetAt(e,1);return this.getLength()-t}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength}getNearestChunk(e){const t=this.nodeAt(e);if(t.remainder===t.node.piece.length){const e=t.node.next();if(!e||e===ky)return"";const i=this._buffers[e.piece.bufferIndex],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start);return i.buffer.substring(n,n+e.piece.length)}{const e=this._buffers[t.node.piece.bufferIndex],i=this.offsetInBuffer(t.node.piece.bufferIndex,t.node.piece.start),n=i+t.remainder,o=i+t.node.piece.length;return e.buffer.substring(n,o)}}findMatchesInNode(e,t,i,n,o,s,r,a,l,d,h){const c=this._buffers[e.piece.bufferIndex],u=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),g=this.offsetInBuffer(e.piece.bufferIndex,o),p=this.offsetInBuffer(e.piece.bufferIndex,s);let m;const f={line:0,column:0};let _,v;t._wordSeparators?(_=c.buffer.substring(g,p),v=e=>e+g,t.reset(0)):(_=c.buffer,v=e=>e,t.reset(g));do{if(m=t.next(_),m){if(v(m.index)>=p)return d;this.positionInBuffer(e,v(m.index)-u,f);const t=this.getLineFeedCnt(e.piece.bufferIndex,o,f),s=f.line===o.line?f.column-o.column+n:f.column+1,r=s+m[0].length;if(h[d++]=Zy(new Yu(i+t,s,i+t,r),m,a),v(m.index)+m[0].length>=p)return d;if(d>=l)return d}}while(m);return d}findMatchesLineByLine(e,t,i,n){const o=[];let s=0;const r=new Jy(t.wordSeparators,t.regex);let a=this.nodeAt2(e.startLineNumber,e.startColumn);if(null===a)return[];const l=this.nodeAt2(e.endLineNumber,e.endColumn);if(null===l)return[];let d=this.positionInBuffer(a.node,a.remainder);const h=this.positionInBuffer(l.node,l.remainder);if(a.node===l.node)return this.findMatchesInNode(a.node,r,e.startLineNumber,e.startColumn,d,h,t,i,n,s,o),o;let c=e.startLineNumber,u=a.node;for(;u!==l.node;){const l=this.getLineFeedCnt(u.piece.bufferIndex,d,u.piece.end);if(l>=1){const a=this._buffers[u.piece.bufferIndex].lineStarts,h=this.offsetInBuffer(u.piece.bufferIndex,u.piece.start),g=a[d.line+l],p=c===e.startLineNumber?e.startColumn:1;if(s=this.findMatchesInNode(u,r,c,p,d,this.positionInBuffer(u,g-h),t,i,n,s,o),s>=n)return o;c+=l}const h=c===e.startLineNumber?e.startColumn-1:0;if(c===e.endLineNumber){const a=this.getLineContent(c).substring(h,e.endColumn-1);return s=this._findMatchesInLine(t,r,a,e.endLineNumber,h,s,o,i,n),o}if(s=this._findMatchesInLine(t,r,this.getLineContent(c).substr(h),c,h,s,o,i,n),s>=n)return o;c++,a=this.nodeAt2(c,1),u=a.node,d=this.positionInBuffer(a.node,a.remainder)}if(c===e.endLineNumber){const a=c===e.startLineNumber?e.startColumn-1:0,l=this.getLineContent(c).substring(a,e.endColumn-1);return s=this._findMatchesInLine(t,r,l,e.endLineNumber,a,s,o,i,n),o}const g=c===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(l.node,r,c,g,d,h,t,i,n,s,o),o}_findMatchesInLine(e,t,i,n,o,s,r,a,l){const d=e.wordSeparators;if(!a&&e.simpleSearch){const t=e.simpleSearch,a=t.length,h=i.length;let c=-a;for(;-1!==(c=i.indexOf(t,c+a));)if((!d||Xy(d,i,h,c,a))&&(r[s++]=new _g(new Yu(n,c+1+o,n,c+1+a+o),null),s>=l))return s;return s}let h;t.reset(0);do{if(h=t.next(i),h&&(r[s++]=Zy(new Yu(n,h.index+1+o,n,h.index+1+h[0].length+o),h,a),s>=l))return s}while(h);return s}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==ky){const{node:i,remainder:n,nodeStartOffset:o}=this.nodeAt(e),s=i.piece,r=s.bufferIndex,a=this.positionInBuffer(i,n);if(0===i.piece.bufferIndex&&s.end.line===this._lastChangeBufferPos.line&&s.end.column===this._lastChangeBufferPos.column&&o+s.length===e&&t.length<eS)return this.appendToNode(i,t),void this.computeBufferMetadata();if(o===e)this.insertContentToNodeLeft(t,i),this._searchCache.validate(e);else if(o+i.piece.length>e){const e=[];let o=new oS(s.bufferIndex,a,s.end,this.getLineFeedCnt(s.bufferIndex,a,s.end),this.offsetInBuffer(r,s.end)-this.offsetInBuffer(r,a));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&10===this.nodeCharCodeAt(i,n)){const e={line:o.start.line+1,column:0};o=new oS(o.bufferIndex,e,o.end,this.getLineFeedCnt(o.bufferIndex,e,o.end),o.length-1),t+="\n"}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(13===this.nodeCharCodeAt(i,n-1)){const o=this.positionInBuffer(i,n-1);this.deleteNodeTail(i,o),t="\r"+t,0===i.piece.length&&e.push(i)}else this.deleteNodeTail(i,a);else this.deleteNodeTail(i,a);const l=this.createNewPieces(t);o.length>0&&this.rbInsertRight(i,o);let d=i;for(let e=0;e<l.length;e++)d=this.rbInsertRight(d,l[e]);this.deleteNodes(e)}else this.insertContentToNodeRight(t,i)}else{const e=this.createNewPieces(t);let i=this.rbInsertLeft(null,e[0]);for(let t=1;t<e.length;t++)i=this.rbInsertRight(i,e[t])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===ky)return;const i=this.nodeAt(e),n=this.nodeAt(e+t),o=i.node,s=n.node;if(o===s){const s=this.positionInBuffer(o,i.remainder),r=this.positionInBuffer(o,n.remainder);if(i.nodeStartOffset===e){if(t===o.piece.length){const e=o.next();return Ay(this,o),this.validateCRLFWithPrevNode(e),void this.computeBufferMetadata()}return this.deleteNodeHead(o,r),this._searchCache.validate(e),this.validateCRLFWithPrevNode(o),void this.computeBufferMetadata()}return i.nodeStartOffset+o.piece.length===e+t?(this.deleteNodeTail(o,s),this.validateCRLFWithNextNode(o),void this.computeBufferMetadata()):(this.shrinkNode(o,s,r),void this.computeBufferMetadata())}const r=[],a=this.positionInBuffer(o,i.remainder);this.deleteNodeTail(o,a),this._searchCache.validate(e),0===o.piece.length&&r.push(o);const l=this.positionInBuffer(s,n.remainder);this.deleteNodeHead(s,l),0===s.piece.length&&r.push(s);for(let e=o.next();e!==ky&&e!==s;e=e.next())r.push(e);const d=0===o.piece.length?o.prev():o;this.deleteNodes(r),this.validateCRLFWithNextNode(d),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){const i=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){const n=t.piece,o={line:n.start.line+1,column:0},s=new oS(n.bufferIndex,o,n.end,this.getLineFeedCnt(n.bufferIndex,o,n.end),n.length-1);t.piece=s,e+="\n",Oy(this,t,-1,-1),0===t.piece.length&&i.push(t)}const n=this.createNewPieces(e);let o=this.rbInsertLeft(t,n[n.length-1]);for(let e=n.length-2;e>=0;e--)o=this.rbInsertLeft(o,n[e]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+="\n");const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let o=n;for(let e=1;e<i.length;e++)o=this.rbInsertRight(o,i[e]);this.validateCRLFWithPrevNode(n)}positionInBuffer(e,t,i){const n=e.piece,o=e.piece.bufferIndex,s=this._buffers[o].lineStarts,r=s[n.start.line]+n.start.column+t;let a=n.start.line,l=n.end.line,d=0,h=0,c=0;for(;a<=l&&(d=a+(l-a)/2|0,c=s[d],d!==l);)if(h=s[d+1],r<c)l=d-1;else{if(!(r>=h))break;a=d+1}return i?(i.line=d,i.column=r-c,null):{line:d,column:r-c}}getLineFeedCnt(e,t,i){if(0===i.column)return i.line-t.line;const n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;const o=n[i.line+1],s=n[i.line]+i.column;if(o>s+1)return i.line-t.line;const r=s-1;return 13===this._buffers[e].buffer.charCodeAt(r)?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;t<e.length;t++)Ay(this,e[t])}createNewPieces(e){if(e.length>eS){const t=[];for(;e.length>eS;){const i=e.charCodeAt(65534);let n;13===i||i>=55296&&i<=56319?(n=e.substring(0,65534),e=e.substring(65534)):(n=e.substring(0,eS),e=e.substring(eS));const o=nS(n);t.push(new oS(this._buffers.length,{line:0,column:0},{line:o.length-1,column:n.length-o[o.length-1]},o.length-1,n.length)),this._buffers.push(new sS(n,o))}const i=nS(e);return t.push(new oS(this._buffers.length,{line:0,column:0},{line:i.length-1,column:e.length-i[i.length-1]},i.length-1,e.length)),this._buffers.push(new sS(e,i)),t}let t=this._buffers[0].buffer.length;const i=nS(e,!1);let n=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&0!==t&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},n=this._lastChangeBufferPos;for(let e=0;e<i.length;e++)i[e]+=t+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+="_"+e,t+=1}else{if(0!==t)for(let e=0;e<i.length;e++)i[e]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+=e}const o=this._buffers[0].buffer.length,s=this._buffers[0].lineStarts.length-1,r={line:s,column:o-this._buffers[0].lineStarts[s]},a=new oS(0,n,r,this.getLineFeedCnt(0,n,r),o-t);return this._lastChangeBufferPos=r,[a]}getLineRawContent(e,t=0){let i=this.root,n="";const o=this._searchCache.get2(e);if(o){i=o.node;const s=this.getAccumulatedValue(i,e-o.nodeStartLineNumber-1),r=this._buffers[i.piece.bufferIndex].buffer,a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(o.nodeStartLineNumber+i.piece.lineFeedCnt!==e){const n=this.getAccumulatedValue(i,e-o.nodeStartLineNumber);return r.substring(a+s,a+n-t)}n=r.substring(a+s,a+i.piece.length)}else{let o=0;const s=e;for(;i!==ky;)if(i.left!==ky&&i.lf_left>=e-1)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt>e-1){const n=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return o+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:o,nodeStartLineNumber:s-(e-1-i.lf_left)}),a.substring(l+n,l+r-t)}if(i.lf_left+i.piece.lineFeedCnt===e-1){const t=this.getAccumulatedValue(i,e-i.lf_left-2),o=this._buffers[i.piece.bufferIndex].buffer,s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=o.substring(s+t,s+i.piece.length);break}e-=i.lf_left+i.piece.lineFeedCnt,o+=i.size_left+i.piece.length,i=i.right}}for(i=i.next();i!==ky;){const e=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const o=this.getAccumulatedValue(i,0),s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=e.substring(s,s+o-t),n}{const t=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=e.substr(t,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==ky;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){const i=e.piece,n=this.positionInBuffer(e,t),o=n.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){const t=this.getLineFeedCnt(e.piece.bufferIndex,i.start,n);if(t!==o)return{index:t,remainder:0}}return{index:o,remainder:n.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,n=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?n[i.end.line]+i.end.column-n[i.start.line]-i.start.column:n[o]-n[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.end),s=t,r=this.offsetInBuffer(i.bufferIndex,s),a=this.getLineFeedCnt(i.bufferIndex,i.start,s),l=a-n,d=r-o,h=i.length+d;e.piece=new oS(i.bufferIndex,i.start,s,a,h),Oy(this,e,d,l)}deleteNodeHead(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.start),s=t,r=this.getLineFeedCnt(i.bufferIndex,s,i.end),a=r-n,l=o-this.offsetInBuffer(i.bufferIndex,s),d=i.length+l;e.piece=new oS(i.bufferIndex,s,i.end,r,d),Oy(this,e,l,a)}shrinkNode(e,t,i){const n=e.piece,o=n.start,s=n.end,r=n.length,a=n.lineFeedCnt,l=t,d=this.getLineFeedCnt(n.bufferIndex,n.start,l),h=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,o);e.piece=new oS(n.bufferIndex,n.start,l,d,h),Oy(this,e,h-r,d-a);const c=new oS(n.bufferIndex,i,s,this.getLineFeedCnt(n.bufferIndex,i,s),this.offsetInBuffer(n.bufferIndex,s)-this.offsetInBuffer(n.bufferIndex,i)),u=this.rbInsertRight(e,c);this.validateCRLFWithPrevNode(u)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+="\n");const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=nS(t,!1);for(let e=0;e<o.length;e++)o[e]+=n;if(i){const e=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:n-e}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(o.slice(1));const s=this._buffers[0].lineStarts.length-1,r={line:s,column:this._buffers[0].buffer.length-this._buffers[0].lineStarts[s]},a=e.piece.length+t.length,l=e.piece.lineFeedCnt,d=this.getLineFeedCnt(0,e.piece.start,r),h=d-l;e.piece=new oS(e.piece.bufferIndex,e.piece.start,r,d,a),this._lastChangeBufferPos=r,Oy(this,e,t.length,h)}nodeAt(e){let t=this.root;const i=this._searchCache.get(e);if(i)return{node:i.node,nodeStartOffset:i.nodeStartOffset,remainder:e-i.nodeStartOffset};let n=0;for(;t!==ky;)if(t.size_left>e)t=t.left;else{if(t.size_left+t.piece.length>=e){n+=t.size_left;const i={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(i),i}e-=t.size_left+t.piece.length,n+=t.size_left+t.piece.length,t=t.right}return null}nodeAt2(e,t){let i=this.root,n=0;for(;i!==ky;)if(i.left!==ky&&i.lf_left>=e-1)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt>e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2),s=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(o+t-1,s),nodeStartOffset:n}}if(i.lf_left+i.piece.lineFeedCnt===e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2);if(o+t-1<=i.piece.length)return{node:i,remainder:o+t-1,nodeStartOffset:n};t-=i.piece.length-o;break}e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==ky;){if(i.piece.lineFeedCnt>0){const e=this.getAccumulatedValue(i,0),n=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,e),nodeStartOffset:n}}if(i.piece.length>=t-1)return{node:i,remainder:t-1,nodeStartOffset:this.offsetOfNode(i)};t-=i.piece.length,i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(n)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&"\n"===this._EOL)}startWithLF(e){if("string"==typeof e)return 10===e.charCodeAt(0);if(e===ky||0===e.piece.lineFeedCnt)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,o=i[n]+t.start.column;return n!==i.length-1&&(!(i[n+1]>o+1)&&10===this._buffers[t.bufferIndex].buffer.charCodeAt(o))}endWithCR(e){return"string"==typeof e?13===e.charCodeAt(e.length-1):e!==ky&&0!==e.piece.lineFeedCnt&&13===this.nodeCharCodeAt(e,e.piece.length-1)}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const i=[],n=this._buffers[e.piece.bufferIndex].lineStarts;let o;o=0===e.piece.end.column?{line:e.piece.end.line-1,column:n[e.piece.end.line]-n[e.piece.end.line-1]-1}:{line:e.piece.end.line,column:e.piece.end.column-1};const s=e.piece.length-1,r=e.piece.lineFeedCnt-1;e.piece=new oS(e.piece.bufferIndex,e.piece.start,o,r,s),Oy(this,e,-1,-1),0===e.piece.length&&i.push(e);const a={line:t.piece.start.line+1,column:0},l=t.piece.length-1,d=this.getLineFeedCnt(t.piece.bufferIndex,a,t.piece.end);t.piece=new oS(t.piece.bufferIndex,a,t.piece.end,d,l),Oy(this,t,-1,-1),0===t.piece.length&&i.push(t);const h=this.createNewPieces("\r\n");this.rbInsertRight(e,h[0]);for(let e=0;e<i.length;e++)Ay(this,i[e])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const i=t.next();if(this.startWithLF(i)){if(e+="\n",1===i.piece.length)Ay(this,i);else{const e=i.piece,t={line:e.start.line+1,column:0},n=e.length-1,o=this.getLineFeedCnt(e.bufferIndex,t,e.end);i.piece=new oS(e.bufferIndex,t,e.end,o,n),Oy(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===ky)return t(ky);const i=this.iterate(e.left,t);return i?t(e)&&this.iterate(e.right,t):i}getNodeContent(e){if(e===ky)return"";const t=this._buffers[e.piece.bufferIndex],i=e.piece,n=this.offsetInBuffer(i.bufferIndex,i.start),o=this.offsetInBuffer(i.bufferIndex,i.end);return t.buffer.substring(n,o)}getPieceContent(e){const t=this._buffers[e.bufferIndex],i=this.offsetInBuffer(e.bufferIndex,e.start),n=this.offsetInBuffer(e.bufferIndex,e.end);return t.buffer.substring(i,n)}rbInsertRight(e,t){const i=new xy(t,1);if(i.left=ky,i.right=ky,i.parent=ky,i.size_left=0,i.lf_left=0,this.root===ky)this.root=i,i.color=0;else if(e.right===ky)e.right=i,i.parent=e;else{const t=Ly(e.right);t.left=i,i.parent=t}return Ry(this,i),i}rbInsertLeft(e,t){const i=new xy(t,1);if(i.left=ky,i.right=ky,i.parent=ky,i.size_left=0,i.lf_left=0,this.root===ky)this.root=i,i.color=0;else if(e.left===ky)e.left=i,i.parent=e;else{const t=Dy(e.left);t.right=i,i.parent=t}return Ry(this,i),i}}class dS extends At{constructor(e,t,i,n,o,s,r){super(),this._onDidChangeContent=this._register(new Zt),this._BOM=t,this._mightContainNonBasicASCII=!s,this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._pieceTree=new lS(e,i,r)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(e){return this._pieceTree.createSnapshot(e?this._BOM:"")}getOffsetAt(e,t){return this._pieceTree.getOffsetAt(e,t)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,t){const i=e+t,n=this.getPositionAt(e),o=this.getPositionAt(i);return new Yu(n.lineNumber,n.column,o.lineNumber,o.column)}getValueInRange(e,t=0){if(e.isEmpty())return"";const i=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,i)}getValueLengthInRange(e,t=0){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;const i=this.getOffsetAt(e.startLineNumber,e.startColumn),n=this.getOffsetAt(e.endLineNumber,e.endColumn);let o=0;const s=this._getEndOfLine(t),r=this.getEOL();return s.length!==r.length&&(o=(s.length-r.length)*(e.endLineNumber-e.startLineNumber)),n-i+o}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let i=0;const n=e.startLineNumber,o=e.endLineNumber;for(let t=n;t<=o;t++){const s=this.getLineContent(t),r=t===n?e.startColumn-1:0,a=t===o?e.endColumn-1:s.length;for(let e=r;e<a;e++)ln(s.charCodeAt(e))?(i+=1,e+=1):i+=1}return i+=this._getEndOfLine(t).length*(o-n),i}return this.getValueLengthInRange(e,t)}getNearestChunk(e){return this._pieceTree.getNearestChunk(e)}getLength(){return this._pieceTree.getLength()}getLineCount(){return this._pieceTree.getLineCount()}getLinesContent(){return this._pieceTree.getLinesContent()}getLineContent(e){return this._pieceTree.getLineContent(e)}getLineCharCode(e,t){return this._pieceTree.getLineCharCode(e,t)}getLineLength(e){return this._pieceTree.getLineLength(e)}getLineFirstNonWhitespaceColumn(e){const t=$i(this.getLineContent(e));return-1===t?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Zi(this.getLineContent(e));return-1===t?0:t+2}_getEndOfLine(e){switch(e){case 1:return"\n";case 2:return"\r\n";case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,t,i){let n=this._mightContainRTL,o=this._mightContainUnusualLineTerminators,s=this._mightContainNonBasicASCII,r=!0,a=[];for(let t=0;t<e.length;t++){const i=e[t];r&&i._isTracked&&(r=!1);const l=i.range;if(i.text){let e=!0;s||(e=!bn(i.text),s=e),!n&&e&&(n=_n(i.text)),!o&&e&&(o=Cn(i.text))}let d="",h=0,c=0,u=0;if(i.text){let e;[h,c,u,e]=Dg(i.text);const t=this.getEOL();d=0===e||e===("\r\n"===t?2:1)?i.text:i.text.replace(/\r\n|\r|\n/g,t)}a[t]={sortIndex:t,identifier:i.identifier||null,range:l,rangeOffset:this.getOffsetAt(l.startLineNumber,l.startColumn),rangeLength:this.getValueLengthInRange(l),text:d,eolCount:h,firstLineLength:c,lastLineLength:u,forceMoveMarkers:Boolean(i.forceMoveMarkers),isAutoWhitespaceEdit:i.isAutoWhitespaceEdit||!1}}a.sort(dS._sortOpsAscending);let l=!1;for(let e=0,t=a.length-1;e<t;e++){const t=a[e].range.getEndPosition(),i=a[e+1].range.getStartPosition();if(i.isBeforeOrEqual(t)){if(i.isBefore(t))throw new Error("Overlapping ranges are not allowed!");l=!0}}r&&(a=this._reduceOperations(a));const d=i||t?dS._getInverseEditRanges(a):[],h=[];if(t)for(let e=0;e<a.length;e++){const t=a[e],i=d[e];if(t.isAutoWhitespaceEdit&&t.range.isEmpty())for(let e=i.startLineNumber;e<=i.endLineNumber;e++){let n="";e===i.startLineNumber&&(n=this.getLineContent(t.range.startLineNumber),-1!==$i(n))||h.push({lineNumber:e,oldContent:n})}}let c=null;if(i){let e=0;c=[];for(let t=0;t<a.length;t++){const i=a[t],n=d[t],o=this.getValueInRange(i.range),s=i.rangeOffset+e;e+=i.text.length-o.length,c[t]={sortIndex:i.sortIndex,identifier:i.identifier,range:n,text:o,textChange:new mC(i.rangeOffset,o,s,i.text)}}l||c.sort(((e,t)=>e.sortIndex-t.sortIndex))}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=s;const u=this._doApplyEdits(a);let g=null;if(t&&h.length>0){h.sort(((e,t)=>t.lineNumber-e.lineNumber)),g=[];for(let e=0,t=h.length;e<t;e++){const t=h[e].lineNumber;if(e>0&&h[e-1].lineNumber===t)continue;const i=h[e].oldContent,n=this.getLineContent(t);0!==n.length&&n!==i&&-1===$i(n)&&g.push(t)}}return this._onDidChangeContent.fire(),new wg(c,u,g)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,n=e[e.length-1].range,o=new Yu(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let s=i.startLineNumber,r=i.startColumn;const a=[];for(let i=0,n=e.length;i<n;i++){const n=e[i],o=n.range;t=t||n.forceMoveMarkers,a.push(this.getValueInRange(new Yu(s,r,o.startLineNumber,o.startColumn))),n.text.length>0&&a.push(n.text),s=o.endLineNumber,r=o.endColumn}const l=a.join(""),[d,h,c]=Dg(l);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:l,eolCount:d,firstLineLength:h,lastLineLength:c,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(dS._sortOpsDescending);const t=[];for(let i=0;i<e.length;i++){const n=e[i],o=n.range.startLineNumber,s=n.range.startColumn,r=n.range.endLineNumber,a=n.range.endColumn;if(o===r&&s===a&&0===n.text.length)continue;n.text?(this._pieceTree.delete(n.rangeOffset,n.rangeLength),this._pieceTree.insert(n.rangeOffset,n.text,!0)):this._pieceTree.delete(n.rangeOffset,n.rangeLength);const l=new Yu(o,s,r,a);t.push({range:l,rangeLength:n.rangeLength,text:n.text,rangeOffset:n.rangeOffset,forceMoveMarkers:n.forceMoveMarkers})}return t}findMatchesLineByLine(e,t,i,n){return this._pieceTree.findMatchesLineByLine(e,t,i,n)}static _getInverseEditRanges(e){const t=[];let i=0,n=0,o=null;for(let s=0,r=e.length;s<r;s++){const r=e[s];let a,l,d;if(o?o.range.endLineNumber===r.range.startLineNumber?(a=i,l=n+(r.range.startColumn-o.range.endColumn)):(a=i+(r.range.startLineNumber-o.range.endLineNumber),l=r.range.startColumn):(a=r.range.startLineNumber,l=r.range.startColumn),r.text.length>0){const e=r.eolCount+1;d=1===e?new Yu(a,l,a,l+r.firstLineLength):new Yu(a,l,a+e-1,r.lastLineLength+1)}else d=new Yu(a,l,a,l);i=d.endLineNumber,n=d.endColumn,t.push(d),o=r}return t}static _sortOpsAscending(e,t){const i=Yu.compareRangesUsingEnds(e.range,t.range);return 0===i?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=Yu.compareRangesUsingEnds(e.range,t.range);return 0===i?t.sortIndex-e.sortIndex:-i}}class hS{constructor(e,t,i,n,o,s,r,a,l){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=o,this._containsRTL=s,this._containsUnusualLineTerminators=r,this._isBasicASCII=a,this._normalizeEOL=l}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return 0===t?1===e?"\n":"\r\n":i>t/2?"\r\n":"\n"}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&("\r\n"===t&&(this._cr>0||this._lf>0)||"\n"===t&&(this._cr>0||this._crlf>0)))for(let e=0,n=i.length;e<n;e++){const n=i[e].buffer.replace(/\r\n|\r|\n/g,t),o=nS(n);i[e]=new sS(n,o)}const n=new dS(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:n,disposable:n}}}class cS{constructor(){this.chunks=[],this.BOM="",this._hasPreviousChar=!1,this._previousChar=0,this._tmpLineStarts=[],this.cr=0,this.lf=0,this.crlf=0,this.containsRTL=!1,this.containsUnusualLineTerminators=!1,this.isBasicASCII=!0}acceptChunk(e){if(0===e.length)return;0===this.chunks.length&&kn(e)&&(this.BOM=xn,e=e.substr(1));const t=e.charCodeAt(e.length-1);13===t||t>=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){(t||0!==e.length)&&(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=function(e,t){e.length=0,e[0]=0;let i=1,n=0,o=0,s=0,r=!0;for(let a=0,l=t.length;a<l;a++){const d=t.charCodeAt(a);13===d?a+1<l&&10===t.charCodeAt(a+1)?(s++,e[i++]=a+2,a++):(n++,e[i++]=a+1):10===d?(o++,e[i++]=a+1):r&&9!==d&&(d<32||d>126)&&(r=!1)}const a=new iS(tS(e),n,o,s,r);return e.length=0,a}(this._tmpLineStarts,e);this.chunks.push(new sS(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=_n(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=Cn(e)))}finish(e=!0){return this._finish(),new hS(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(0===this.chunks.length&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=nS(e.buffer);e.lineStarts=t,13===this._previousChar&&this.cr++}}}class uS{static createEmpty(e,t){const i=uS.defaultTokenMetadata,n=new Uint32Array(2);return n[0]=e.length,n[1]=i,new uS(n,e,t)}static createFromTextAndMetadata(e,t){let i=0,n="";const o=new Array;for(const{text:t,metadata:s}of e)o.push(i+t.length,s),i+=t.length,n+=t;return new uS(new Uint32Array(o),n,t)}static convertToEndOffset(e,t){const i=(e.length>>>1)-1;for(let t=0;t<i;t++)e[t<<1]=e[t+1<<1];e[i<<1]=t}static findIndexInTokensArray(e,t){if(e.length<=2)return 0;let i=0,n=(e.length>>>1)-1;for(;i<n;){const o=i+Math.floor((n-i)/2),s=e[o<<1];if(s===t)return o+1;s<t?i=o+1:s>t&&(n=o)}return i}static{this.defaultTokenMetadata=33587200}constructor(e,t,i){this._lineTokensBrand=void 0,(e.length>1?e[e.length-2]:0)!==t.length&&Ie(new Error("Token length and text length do not match!")),this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this.languageIdCodec=i}getTextLength(){return this._text.length}equals(e){return e instanceof uS&&this.slicedEquals(e,0,this._tokensCount)}slicedEquals(e,t,i){if(this._text!==e._text)return!1;if(this._tokensCount!==e._tokensCount)return!1;const n=t<<1,o=n+(i<<1);for(let t=n;t<o;t++)if(this._tokens[t]!==e._tokens[t])return!1;return!0}getLineContent(){return this._text}getCount(){return this._tokensCount}getStartOffset(e){return e>0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[1+(e<<1)]}getLanguageId(e){const t=this._tokens[1+(e<<1)],i=of.getLanguageId(t);return this.languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[1+(e<<1)];return of.getTokenType(t)}getForeground(e){const t=this._tokens[1+(e<<1)];return of.getForeground(t)}getClassName(e){const t=this._tokens[1+(e<<1)];return of.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[1+(e<<1)];return of.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[1+(e<<1)];return of.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return uS.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new gS(this,e,t,i)}sliceZeroCopy(e){return this.sliceAndInflate(e.start,e.endExclusive,0)}withInserted(e){if(0===e.length)return this;let t=0,i=0,n="";const o=new Array;let s=0;for(;;){const r=t<this._tokensCount?this._tokens[t<<1]:-1,a=i<e.length?e[i]:null;if(-1!==r&&(null===a||r<=a.offset)){n+=this._text.substring(s,r);const e=this._tokens[1+(t<<1)];o.push(n.length,e),t++,s=r}else{if(!a)break;if(a.offset>s){n+=this._text.substring(s,a.offset);const e=this._tokens[1+(t<<1)];o.push(n.length,e),s=a.offset}n+=a.text,o.push(n.length,a.tokenMetadata),i++}}return new uS(new Uint32Array(o),n,this.languageIdCodec)}getTokensInRange(e){const t=new fS,i=this.findTokenIndexAtOffset(e.start),n=this.findTokenIndexAtOffset(e.endExclusive);for(let o=i;o<=n;o++){const i=new cm(this.getStartOffset(o),this.getEndOffset(o)).intersectionLength(e);i>0&&t.add(i,this.getMetadata(o))}return t.build()}getTokenText(e){const t=this.getStartOffset(e),i=this.getEndOffset(e);return this._text.substring(t,i)}forEach(e){const t=this.getCount();for(let i=0;i<t;i++)e(i)}toString(){let e="";return this.forEach((t=>{e+=`[${this.getTokenText(t)}]{${this.getClassName(t)}}`})),e}}class gS{constructor(e,t,i,n){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=n,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this.languageIdCodec=e.languageIdCodec,this._tokensCount=0;for(let t=this._firstTokenIndex,n=e.getCount();t<n&&!(e.getStartOffset(t)>=i);t++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof gS&&this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount)}getCount(){return this._tokensCount}getStandardTokenType(e){return this._source.getStandardTokenType(this._firstTokenIndex+e)}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}getTokenText(e){const t=this._firstTokenIndex+e,i=this._source.getStartOffset(t),n=this._source.getEndOffset(t);let o=this._source.getTokenText(t);return i<this._startOffset&&(o=o.substring(this._startOffset-i)),n>this._endOffset&&(o=o.substring(0,o.length-(n-this._endOffset))),o}forEach(e){for(let t=0;t<this.getCount();t++)e(t)}}class pS{static fromLineTokens(e){const t=[];for(let i=0;i<e.getCount();i++)t.push(new mS(e.getEndOffset(i)-e.getStartOffset(i),e.getMetadata(i)));return pS.create(t)}static create(e){return new pS(e)}constructor(e){this._tokenInfo=e}toLineTokens(e,t){return uS.createFromTextAndMetadata(this.map(((t,i)=>({text:t.substring(e),metadata:i.metadata}))),t)}forEach(e){let t=0;for(const i of this._tokenInfo)e(new cm(t,t+i.length),i),t+=i.length}map(e){const t=[];let i=0;for(const n of this._tokenInfo){const o=new cm(i,i+n.length);t.push(e(o,n)),i+=n.length}return t}slice(e){const t=[];let i=0;for(const n of this._tokenInfo){const o=i,s=o+n.length;if(s>e.start){if(o>=e.endExclusive)break;const i=Math.max(0,e.start-o),r=Math.max(0,s-e.endExclusive);t.push(new mS(n.length-i-r,n.metadata))}i+=n.length}return pS.create(t)}}class mS{constructor(e,t){this.length=e,this.metadata=t}}class fS{constructor(){this._tokens=[]}add(e,t){this._tokens.push(new mS(e,t))}build(){return pS.create(this._tokens)}}class _S{constructor(){this._onDidChangeVisibleRanges=new Zt,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set,this._viewsChanged=Lr(this),this.visibleLineRanges=fr({owner:this,equalsFn:Is(((e,t)=>e.equals(t)))},(e=>{this._viewsChanged.read(e);const t=ym.joinMany([...this._views].map((t=>t.state.read(e)?.visibleLineRanges??[])));return t}))}attachView(){const e=new bS((t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})}));return this._views.add(e),this._viewsChanged.trigger(void 0),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0}),this._viewsChanged.trigger(void 0)}}class vS{constructor(e,t){this.visibleLineRanges=e,this.stabilized=t}equals(e){return this===e||!!es(this.visibleLineRanges,e.visibleLineRanges,((e,t)=>e.equals(t)))&&this.stabilized===e.stabilized}}class bS{get state(){return this._state}constructor(e){this.handleStateChange=e,this._state=or({owner:this,equalsFn:Ts(((e,t)=>e.equals(t)))},void 0)}setVisibleLines(e,t){const i=e.map((e=>new ym(e.startLineNumber,e.endLineNumber+1))),n=new vS(i,t);this._state.set(n,void 0,void 0),this.handleStateChange(n)}}class wS extends At{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new Ci((()=>this.update()),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){es(this._computedLineRanges,this._lineRanges,((e,t)=>e.equals(t)))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}}class CS extends At{get backgroundTokenizationState(){return this._backgroundTokenizationState}constructor(e,t){super(),this._languageIdCodec=e,this._textModel=t,this._onDidChangeTokens=this._register(new Zt),this.onDidChangeTokens=this._onDidChangeTokens.event}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}}function yS(e,t){const i=e.gotoNextSibling(),n=t.gotoNextSibling();if(i!==n)throw new Error("Trees are out of sync");return i&&n}function SS(e,t){const i=e.gotoParent(),n=t.gotoParent();if(i!==n)throw new Error("Trees are out of sync");return i&&n}function xS(e,t,i){const n=e.gotoFirstChild(),o=t.gotoFirstChild();if(n!==o)throw new Error("Trees are out of sync");if(0===i)return n&&o;for(let n=1;n<=i;n++){const i=e.gotoNextSibling(),n=t.gotoNextSibling();if(i!==n)throw new Error("Trees are out of sync");if(!i||!n)return!1}return n&&o}function kS(e,t){do{if(e.currentNode.nextSibling)return yS(e,t);e.currentNode.parent&&SS(e,t)}while(e.currentNode.nextSibling||e.currentNode.parent);return!1}function LS(e,t){const i=t.walk();i.resetTo(e);const n=e.currentNode;do{if(i.currentNode.previousSibling&&i.currentNode.endIndex-i.currentNode.startIndex!=0)i.gotoPreviousSibling();else{for(;!i.currentNode.previousSibling&&i.currentNode.parent;)i.gotoParent();i.gotoPreviousSibling()}}while(i.currentNode.endIndex>n.startIndex&&(i.currentNode.parent||i.currentNode.previousSibling)&&i.currentNode.id!==n.id);return i.currentNode.id!==n.id&&i.currentNode.endIndex<=n.startIndex?i.currentNode:void 0}var DS=function(e,t){return function(i,n){t(i,n,e)}};let ES=class extends At{constructor(e,t,i,n,o,s,r){super(),this.languageId=e,this._ranges=t,this._parser=i,this._parserClass=n,this.textModel=o,this._logService=s,this._telemetryService=r,this._tree=Js(this,void 0),this.tree=this._tree,this._treeLastParsedVersion=Js(this,-1),this.treeLastParsedVersion=this._treeLastParsedVersion,this._onDidChangeContentQueue=new vi,this._tree=Js(this,void 0),this.tree=this._tree,this._register(Tt((()=>{this._tree.get()?.delete(),this._lastFullyParsed?.delete(),this._lastFullyParsedWithEdits?.delete(),this._parser.delete()}))),this.handleContentChange(void 0,this._ranges)}handleContentChange(e,t){const i=this.textModel.getVersionId();let n=[];t&&(n=this._setRanges(t)),e&&this._applyEdits(e.changes),this._onDidChangeContentQueue.clearPending(),this._onDidChangeContentQueue.schedule((async()=>{if(this._store.isDisposed)return;const e=this._lastFullyParsed;let t;this._lastFullyParsedWithEdits&&this._lastFullyParsed&&(t=this._findChangedNodes(this._lastFullyParsedWithEdits,this._lastFullyParsed));const o=await this._parseAndUpdateTree(i);if(o){let s;t?e&&t&&(s=this._findTreeChanges(o,t,n)):this._ranges&&(s=this._ranges.map((e=>({newRange:new Yu(e.startPosition.row+1,e.startPosition.column+1,e.endPosition.row+1,e.endPosition.column+1),oldRangeLength:e.endIndex-e.startIndex,newRangeStartOffset:e.startIndex,newRangeEndOffset:e.endIndex})))),s||(s=[{newRange:this.textModel.getFullModelRange(),newRangeStartOffset:0,newRangeEndOffset:this.textModel.getValueLength()}]);const r=this._tree.get();Vs((e=>{this._tree.set(o,e,{ranges:s,versionId:i}),this._treeLastParsedVersion.set(i,e)})),r?.delete()}}))}_applyEdits(e){for(const t of e){const e=xm.ofRange(Yu.lift(t.range)),i=xm.ofText(t.text),n=0===t.text.length?i:e.add(i),o={startIndex:t.rangeOffset,oldEndIndex:t.rangeOffset+t.rangeLength,newEndIndex:t.rangeOffset+t.text.length,startPosition:{row:t.range.startLineNumber-1,column:t.range.startColumn-1},oldEndPosition:{row:t.range.endLineNumber-1,column:t.range.endColumn-1},newEndPosition:{row:t.range.startLineNumber+n.lineCount-1,column:n.lineCount?n.columnCount:t.range.endColumn+n.columnCount}};this._tree.get()?.edit(o),this._lastFullyParsedWithEdits?.edit(o)}}_findChangedNodes(e,t){if(this._ranges&&this._ranges.every((t=>t.startPosition.row!==e.rootNode.startPosition.row))||0!==e.rootNode.startPosition.row)return[];const i=e.walk(),n=t.walk(),o=[];let s=!0;do{if(i.currentNode.hasChanges){const t=i.currentNode.children,r=[],a=t.filter(((e,t)=>!!(e?.hasChanges||n.currentNode.children.length<=t)&&(r.push(t),!0)));if(0===a.length||i.currentNode.hasError!==n.currentNode.hasError){for(;i.currentNode.parent&&s&&!i.currentNode.isNamed;)s=SS(i,n);const t=i.currentNode,r=LS(i,e)??t;o.push({startIndex:r.startIndex,endIndex:t.endIndex,startPosition:r.startPosition,endPosition:t.endPosition}),s=kS(i,n)}else a.length>=1&&(s=xS(i,n,r[0]))}else s=kS(i,n)}while(s);return i.delete(),n.delete(),o}_findTreeChanges(e,t,i){let n=0;const o=[];for(let s=0;s<t.length;s++){const r=t[s];if(o.length>0&&r.startIndex>=o[o.length-1].newRangeStartOffset&&r.endIndex<=o[o.length-1].newRangeEndOffset)continue;const a=e.walk(),l=()=>a.startIndex<r.startIndex&&a.endIndex>r.endIndex;for(;l();){let e=a.gotoFirstChild(),t=!1;for(;e;){if(l()&&a.currentNode.isNamed){t=!0;break}e=a.gotoNextSibling()}if(!t){a.gotoParent();break}if(0===a.currentNode.childCount)break}const d=a.currentNode.startPosition,h=a.currentNode.endPosition,c=a.currentNode.startIndex,u=a.currentNode.endIndex,g={newRange:new Yu(d.row+1,d.column+1,h.row+1,h.column+1),newRangeStartOffset:c,newRangeEndOffset:u};n<i.length&&IS(i[n],{startIndex:c,endIndex:u,startPosition:d,endPosition:h})?(i[n].startIndex<g.newRangeStartOffset&&(g.newRange=g.newRange.setStartPosition(i[n].startPosition.row+1,i[n].startPosition.column+1),g.newRangeStartOffset=i[n].startIndex),i[n].endIndex>g.newRangeEndOffset&&(g.newRange=g.newRange.setEndPosition(i[n].endPosition.row+1,i[n].endPosition.column+1),g.newRangeEndOffset=i[n].endIndex),n++):n<i.length&&i[n].endIndex<g.newRangeStartOffset&&o.push({newRange:new Yu(i[n].startPosition.row+1,i[n].startPosition.column+1,i[n].endPosition.row+1,i[n].endPosition.column+1),newRangeStartOffset:i[n].startIndex,newRangeEndOffset:i[n].endIndex}),o.length>0&&o[o.length-1].newRangeEndOffset>=g.newRangeStartOffset?(o[o.length-1].newRange=Yu.fromPositions(o[o.length-1].newRange.getStartPosition(),g.newRange.getEndPosition()),o[o.length-1].newRangeEndOffset=g.newRangeEndOffset):o.push(g)}return this._constrainRanges(o)}_constrainRanges(e){if(!this._ranges)return e;const t=[];let i=0,n=0;for(;i<e.length&&n<this._ranges.length;){const o=e[i],s=this._ranges[n];if(o.newRangeEndOffset<s.startIndex)i++;else if(o.newRangeStartOffset>s.endIndex)n++;else{const e=Math.max(o.newRangeStartOffset,s.startIndex),n=Math.min(o.newRangeEndOffset,s.endIndex),r=o.newRange.intersectRanges(new Yu(s.startPosition.row+1,s.startPosition.column+1,s.endPosition.row+1,s.endPosition.column+1));t.push({newRange:r,newRangeEndOffset:n,newRangeStartOffset:e}),n<o.newRangeEndOffset?(o.newRange=Yu.fromPositions(r.getEndPosition(),o.newRange.getEndPosition()),o.newRangeStartOffset=n+1):i++}}return t}async _parseAndUpdateTree(e){const t=await this._parse();if(t)return this._lastFullyParsed?.delete(),this._lastFullyParsed=t.copy(),this._lastFullyParsedWithEdits?.delete(),this._lastFullyParsedWithEdits=t.copy(),t;this._tree.get()||this._parser.reset()}_parse(){let e="fullParse";return this._tree.get()&&(e="incrementalParse"),this._parseAndYield(e)}async _parseAndYield(e){let t=0,i=0;const n=this.textModel.getVersionId();let o;const s=function(){let e=performance.now();return function(t){const i=performance.now();return i-e>50&&(e=i,!0)}}();do{const e=performance.now();o=this._parser.parse(((e,t)=>this._parseCallback(e)),this._tree.get(),{progressCallback:s,includedRanges:this._ranges}),t+=performance.now()-e,i++,await new Promise((e=>oe(e)))}while(!this._store.isDisposed&&!o&&n===this.textModel.getVersionId());return this._sendParseTimeTelemetry(e,t,i),o&&n===this.textModel.getVersionId()?o:void 0}_parseCallback(e){try{return this.textModel.getTextBuffer().getNearestChunk(e)}catch(e){this._logService.debug("Error getting chunk for tree-sitter parsing",e)}}_setRanges(e){const t=[];if(this._ranges)for(const i of e){let e=!1;for(let t=0;t<this._ranges.length;t++){const n=this._ranges[t];if(NS(n,i)||IS(n,i)){e=!0;break}}e||t.push(i)}else t.push(...e);return this._ranges=e,t}_sendParseTimeTelemetry(e,t,i){this._logService.debug(`Tree parsing (${e}) took ${t} ms and ${i} passes.`),"fullParse"===e?this._telemetryService.publicLog2("treeSitter.fullParse",{languageId:this.languageId,time:t,passes:i}):this._telemetryService.publicLog2("treeSitter.incrementalParse",{languageId:this.languageId,time:t,passes:i})}createParsedTreeSync(e){const t=new this._parserClass;t.setLanguage(this._parser.language);const i=t.parse(e);return t.delete(),i??void 0}};function NS(e,t){return e.startPosition.row===t.startPosition.row&&e.startPosition.column===t.startPosition.column&&e.endPosition.row===t.endPosition.row&&e.endPosition.column===t.endPosition.column&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex}function IS(e,t){return e.startIndex<=t.startIndex&&e.endIndex>=t.startIndex||t.startIndex<=e.startIndex&&t.endIndex>=e.startIndex}ES=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([DS(5,yu),DS(6,Cu)],ES);class TS extends At{get isResolved(){return this._isResolved}constructor(e,t,i){super(),this._registry=e,this._languageId=t,this._factory=i,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}async _create(){const e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}}class MS{constructor(e,t,i){this.offset=e,this.type=t,this.language=i,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}}class AS{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class RS{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var OS,PS,FS,BS,WS,VS,HS,zS;!function(e){e[e.Increase=0]="Increase",e[e.Decrease=1]="Decrease"}(OS||(OS={})),function(e){const t=new Map;t.set(0,fh.symbolMethod),t.set(1,fh.symbolFunction),t.set(2,fh.symbolConstructor),t.set(3,fh.symbolField),t.set(4,fh.symbolVariable),t.set(5,fh.symbolClass),t.set(6,fh.symbolStruct),t.set(7,fh.symbolInterface),t.set(8,fh.symbolModule),t.set(9,fh.symbolProperty),t.set(10,fh.symbolEvent),t.set(11,fh.symbolOperator),t.set(12,fh.symbolUnit),t.set(13,fh.symbolValue),t.set(15,fh.symbolEnum),t.set(14,fh.symbolConstant),t.set(15,fh.symbolEnum),t.set(16,fh.symbolEnumMember),t.set(17,fh.symbolKeyword),t.set(28,fh.symbolSnippet),t.set(18,fh.symbolText),t.set(19,fh.symbolColor),t.set(20,fh.symbolFile),t.set(21,fh.symbolReference),t.set(22,fh.symbolCustomColor),t.set(23,fh.symbolFolder),t.set(24,fh.symbolTypeParameter),t.set(25,fh.account),t.set(26,fh.issues),t.set(27,fh.tools),e.toIcon=function(e){let i=t.get(e);return i||(console.info("No codicon found for CompletionItemKind "+e),i=fh.symbolProperty),i},e.toLabel=function(e){switch(e){case 0:return y(724,"Method");case 1:return y(725,"Function");case 2:return y(726,"Constructor");case 3:return y(727,"Field");case 4:return y(728,"Variable");case 5:return y(729,"Class");case 6:return y(730,"Struct");case 7:return y(731,"Interface");case 8:return y(732,"Module");case 9:return y(733,"Property");case 10:return y(734,"Event");case 11:return y(735,"Operator");case 12:return y(736,"Unit");case 13:return y(737,"Value");case 14:return y(738,"Constant");case 15:return y(739,"Enum");case 16:return y(740,"Enum Member");case 17:return y(741,"Keyword");case 18:return y(742,"Text");case 19:return y(743,"Color");case 20:return y(744,"File");case 21:return y(745,"Reference");case 22:return y(746,"Custom Color");case 23:return y(747,"Folder");case 24:return y(748,"Type Parameter");case 25:return y(749,"User");case 26:return y(750,"Issue");case 27:return y(751,"Tool");case 28:return y(752,"Snippet");default:return""}};const i=new Map;i.set("method",0),i.set("function",1),i.set("constructor",2),i.set("field",3),i.set("variable",4),i.set("class",5),i.set("struct",6),i.set("interface",7),i.set("module",8),i.set("property",9),i.set("event",10),i.set("operator",11),i.set("unit",12),i.set("value",13),i.set("constant",14),i.set("enum",15),i.set("enum-member",16),i.set("enumMember",16),i.set("keyword",17),i.set("snippet",28),i.set("text",18),i.set("color",19),i.set("file",20),i.set("reference",21),i.set("customcolor",22),i.set("folder",23),i.set("type-parameter",24),i.set("typeParameter",24),i.set("account",25),i.set("issue",26),i.set("tool",27),e.fromString=function(e,t){let n=i.get(e);return void 0!==n||t||(n=9),n}}(PS||(PS={})),function(e){e[e.Automatic=0]="Automatic",e[e.Explicit=1]="Explicit"}(FS||(FS={}));class US{constructor(e,t,i,n){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=n}equals(e){return Yu.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}!function(e){e[e.Code=1]="Code",e[e.Label=2]="Label"}(BS||(BS={}));class KS{static fromExtensionId(e){return new KS(e,void 0,void 0)}constructor(e,t,i){this.extensionId=e,this.extensionVersion=t,this.providerId=i}toString(){let e="";return this.extensionId&&(e+=this.extensionId),this.extensionVersion&&(e+=`@${this.extensionVersion}`),this.providerId&&(e+=`:${this.providerId}`),0===e.length&&(e="unknown"),e}}!function(e){e[e.Accepted=0]="Accepted",e[e.Rejected=1]="Rejected",e[e.Ignored=2]="Ignored"}(WS||(WS={})),function(e){e[e.Automatic=0]="Automatic",e[e.PasteAs=1]="PasteAs"}(VS||(VS={})),function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(HS||(HS={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(zS||(zS={}));const jS={17:y(753,"array"),16:y(754,"boolean"),4:y(755,"class"),13:y(756,"constant"),8:y(757,"constructor"),9:y(758,"enumeration"),21:y(759,"enumeration member"),23:y(760,"event"),7:y(761,"field"),0:y(762,"file"),11:y(763,"function"),10:y(764,"interface"),19:y(765,"key"),5:y(766,"method"),1:y(767,"module"),2:y(768,"namespace"),20:y(769,"null"),15:y(770,"number"),18:y(771,"object"),24:y(772,"operator"),3:y(773,"package"),6:y(774,"property"),14:y(775,"string"),22:y(776,"struct"),25:y(777,"type parameter"),12:y(778,"variable")};var qS,$S,GS,ZS,YS;!function(e){const t=new Map;t.set(0,fh.symbolFile),t.set(1,fh.symbolModule),t.set(2,fh.symbolNamespace),t.set(3,fh.symbolPackage),t.set(4,fh.symbolClass),t.set(5,fh.symbolMethod),t.set(6,fh.symbolProperty),t.set(7,fh.symbolField),t.set(8,fh.symbolConstructor),t.set(9,fh.symbolEnum),t.set(10,fh.symbolInterface),t.set(11,fh.symbolFunction),t.set(12,fh.symbolVariable),t.set(13,fh.symbolConstant),t.set(14,fh.symbolString),t.set(15,fh.symbolNumber),t.set(16,fh.symbolBoolean),t.set(17,fh.symbolArray),t.set(18,fh.symbolObject),t.set(19,fh.symbolKey),t.set(20,fh.symbolNull),t.set(21,fh.symbolEnumMember),t.set(22,fh.symbolStruct),t.set(23,fh.symbolEvent),t.set(24,fh.symbolOperator),t.set(25,fh.symbolTypeParameter),e.toIcon=function(e){let i=t.get(e);return i||(console.info("No codicon found for SymbolKind "+e),i=fh.symbolProperty),i};const i=new Map;i.set(0,20),i.set(1,8),i.set(2,8),i.set(3,8),i.set(4,5),i.set(5,0),i.set(6,9),i.set(7,3),i.set(8,2),i.set(9,15),i.set(10,7),i.set(11,1),i.set(12,4),i.set(13,14),i.set(14,18),i.set(15,13),i.set(16,13),i.set(17,13),i.set(18,13),i.set(19,17),i.set(20,13),i.set(21,16),i.set(22,6),i.set(23,10),i.set(24,11),i.set(25,24),e.toCompletionKind=function(e){let t=i.get(e);return void 0===t&&(console.info("No completion kind found for SymbolKind "+e),t=20),t}}(qS||(qS={}));class QS{static{this.Comment=new QS("comment")}static{this.Imports=new QS("imports")}static{this.Region=new QS("region")}static fromValue(e){switch(e){case"comment":return QS.Comment;case"imports":return QS.Imports;case"region":return QS.Region}return new QS(e)}constructor(e){this.value=e}}!function(e){e[e.AIGenerated=1]="AIGenerated"}($S||($S={})),function(e){e[e.Invoke=0]="Invoke",e[e.Automatic=1]="Automatic"}(GS||(GS={})),function(e){e.is=function(e){return!(!e||"object"!=typeof e)&&"string"==typeof e.id&&"string"==typeof e.title}}(ZS||(ZS={})),function(e){e[e.Type=1]="Type",e[e.Parameter=2]="Parameter"}(YS||(YS={}));class XS{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then((e=>{e&&e.dispose()}))}get tokenizationSupport(){return this._tokenizationSupport||(this._tokenizationSupport=this.createSupport()),this._tokenizationSupport}}const JS=new class{constructor(){this._tokenizationSupports=new Map,this._factories=new Map,this._onDidChange=new Zt,this.onDidChange=this._onDidChange.event,this._colorMap=null}handleChange(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,t){return this._tokenizationSupports.set(e,t),this.handleChange([e]),Tt((()=>{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))}))}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){this._factories.get(e)?.dispose();const i=new TS(this,e,t);return this._factories.set(e,i),Tt((()=>{const t=this._factories.get(e);t&&t===i&&(this._factories.delete(e),t.dispose())}))}async getOrCreate(e){const t=this.get(e);if(t)return t;const i=this._factories.get(e);return!i||i.isResolved?null:(await i.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;const t=this._factories.get(e);return!(t&&!t.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}},ex=new class{clone(){return this}equals(e){return this===e}};function tx(e,t){return new AS([new MS(0,"",e)],t)}function ix(e,t){const i=new Uint32Array(2);return i[0]=0,i[1]=(32768|e|2<<24)>>>0,new RS(i,null===t?ex:t)}class nx{constructor(e){this._default=e,this._store=[]}get(e){return e<this._store.length?this._store[e]:this._default}set(e,t){for(;e>=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,i){if(e>=this._store.length)return;if(0===t)return void this.insert(e,i);if(0===i)return void this.delete(e,t);const n=this._store.slice(0,e),o=this._store.slice(e+t),s=function(e,t){const i=[];for(let n=0;n<e;n++)i[n]=t;return i}(i,this._default);this._store=n.concat(s,o)}delete(e,t){0===t||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(0===t||e>=this._store.length)return;const i=[];for(let e=0;e<t;e++)i[e]=this._default;this._store=gs(this._store,e,i)}}class ox{get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._startLineNumber+this._tokens.length-1}constructor(e,t){this._startLineNumber=e,this._tokens=t}getLineTokens(e){return this._tokens[e-this._startLineNumber]}appendLineTokens(e){this._tokens.push(e)}}class sx{constructor(){this._tokens=[]}add(e,t){if(this._tokens.length>0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e)return void i.appendLineTokens(t)}this._tokens.push(new ox(e,[t]))}finalize(){return this._tokens}}class rx{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new dx(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class ax extends rx{constructor(e,t,i,n){super(e,t),this._textModel=i,this._languageIdCodec=n}updateTokensUntilLine(e,t){const i=this._textModel.getLanguageId();for(;;){const n=this.getFirstInvalidLine();if(!n||n.lineNumber>t)break;const o=this._textModel.getLineContent(n.lineNumber),s=ux(this._languageIdCodec,i,this.tokenizationSupport,o,!0,n.startState);e.add(n.lineNumber,s.tokens),this.store.setEndState(n.lineNumber,s.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return 0;const n=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),s=o.substring(0,e.column-1)+t+o.substring(e.column-1),r=ux(this._languageIdCodec,n,this.tokenizationSupport,s,!0,i),a=new uS(r.tokens,s,this._languageIdCodec);if(0===a.getCount())return 0;const l=a.findTokenIndexAtOffset(e.column-1);return a.getStandardTokenType(l)}tokenizeLinesAt(e,t){const i=this.getStartState(e);if(!i)return null;const n=this._textModel.getLanguageId(),o=[];let s=i;for(const e of t){const t=ux(this._languageIdCodec,n,this.tokenizationSupport,e,!0,s);o.push(new uS(t.tokens,e,this._languageIdCodec)),s=t.endState}return o}hasAccurateTokensForLine(e){return e<this.store.getFirstInvalidEndStateLineNumberOrMax()}isCheapToTokenize(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e<t||e===t&&this._textModel.getLineLength(e)<2048}tokenizeHeuristically(e,t,i){if(i<=this.store.getFirstInvalidEndStateLineNumberOrMax())return{heuristicTokens:!1};if(t<=this.store.getFirstInvalidEndStateLineNumberOrMax())return this.updateTokensUntilLine(e,i),{heuristicTokens:!1};let n=this.guessStartState(t);const o=this._textModel.getLanguageId();for(let s=t;s<=i;s++){const t=this._textModel.getLineContent(s),i=ux(this._languageIdCodec,o,this.tokenizationSupport,t,!0,n);e.add(s,i.tokens),n=i.endState}return{heuristicTokens:!0}}guessStartState(e){let{likelyRelevantLines:t,initialState:i}=lx(this._textModel,e,this);i||(i=this.tokenizationSupport.getInitialState());const n=this._textModel.getLanguageId();let o=i;for(const e of t)o=ux(this._languageIdCodec,n,this.tokenizationSupport,e,!1,o).endState;return o}}function lx(e,t,i){let n=e.getLineFirstNonWhitespaceColumn(t);const o=[];let s=null;for(let r=t-1;n>1&&r>=1;r--){const t=e.getLineFirstNonWhitespaceColumn(r);if(0!==t&&t<n&&(o.push(e.getLineContent(r)),n=t,s=i?.getStartState(r),s))break}return o.reverse(),{likelyRelevantLines:o,initialState:s??void 0}}class dx{constructor(e){this.lineCount=e,this._tokenizationStateStore=new hx,this._invalidEndStatesLineNumbers=new cx,this._invalidEndStatesLineNumbers.addRange(new cm(1,e+1))}getEndState(e){return this._tokenizationStateStore.getEndState(e)}setEndState(e,t){if(!t)throw new Ve("Cannot set null/undefined state");this._invalidEndStatesLineNumbers.delete(e);const i=this._tokenizationStateStore.setEndState(e,t);return i&&e<this.lineCount&&this._invalidEndStatesLineNumbers.addRange(new cm(e+1,e+2)),i}acceptChange(e,t){this.lineCount+=t-e.length,this._tokenizationStateStore.acceptChange(e,t),this._invalidEndStatesLineNumbers.addRangeAndResize(new cm(e.startLineNumber,e.endLineNumberExclusive),t)}acceptChanges(e){for(const t of e){const[e]=Dg(t.text);this.acceptChange(new ym(t.range.startLineNumber,t.range.endLineNumber+1),e+1)}}invalidateEndStateRange(e){this._invalidEndStatesLineNumbers.addRange(new cm(e.startLineNumber,e.endLineNumberExclusive))}getFirstInvalidEndStateLineNumber(){return this._invalidEndStatesLineNumbers.min}getFirstInvalidEndStateLineNumberOrMax(){return this.getFirstInvalidEndStateLineNumber()||Number.MAX_SAFE_INTEGER}allStatesValid(){return null===this._invalidEndStatesLineNumbers.min}getStartState(e,t){return 1===e?t:this.getEndState(e-1)}getFirstInvalidLine(e){const t=this.getFirstInvalidEndStateLineNumber();if(null===t)return null;const i=this.getStartState(t,e);if(!i)throw new Ve("Start state must be defined");return{lineNumber:t,startState:i}}}class hx{constructor(){this._lineEndStates=new nx(null)}getEndState(e){return this._lineEndStates.get(e)}setEndState(e,t){const i=this._lineEndStates.get(e);return!(i&&i.equals(t)||(this._lineEndStates.set(e,t),0))}acceptChange(e,t){let i=e.length;t>0&&i>0&&(i--,t--),this._lineEndStates.replace(e.startLineNumber,i,t)}}class cx{constructor(){this._ranges=[]}get min(){return 0===this._ranges.length?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex((t=>t.contains(e)));if(-1!==t){const i=this._ranges[t];i.start===e?i.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new cm(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new cm(i.start,e):this._ranges.splice(t,1,new cm(i.start,e),new cm(e+1,i.endExclusive))}}addRange(e){cm.addRange(e,this._ranges)}addRangeAndResize(e,t){let i=0;for(;!(i>=this._ranges.length||e.start<=this._ranges[i].endExclusive);)i++;let n=i;for(;!(n>=this._ranges.length||e.endExclusive<this._ranges[n].start);)n++;const o=t-e.length;for(let e=n;e<this._ranges.length;e++)this._ranges[e]=this._ranges[e].delta(o);if(i===n){const n=new cm(e.start,e.start+t);n.isEmpty||this._ranges.splice(i,0,n)}else{const t=Math.min(e.start,this._ranges[i].start),s=Math.max(e.endExclusive,this._ranges[n-1].endExclusive),r=new cm(t,s+o);r.isEmpty?this._ranges.splice(i,n-i):this._ranges.splice(i,n-i,r)}}toString(){return this._ranges.map((e=>e.toString())).join(" + ")}}function ux(e,t,i,n,o,s){let r=null;if(i)try{r=i.tokenizeEncoded(n,o,s.clone())}catch(e){Ie(e)}return r||(r=ix(e.encodeLanguageId(t),s)),uS.convertToEndOffset(r.tokens,n.length),r}class gx{constructor(e,t){this._tokenizerWithStateStore=e,this._backgroundTokenStore=t,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){!this._isScheduled&&this._tokenizerWithStateStore._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&(this._isScheduled=!0,yi((e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)})))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),i=()=>{!this._isDisposed&&this._tokenizerWithStateStore._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&(this._backgroundTokenizeForAtLeast1ms(),Date.now()<t?oe(i):this._beginBackgroundTokenization())};i()}_backgroundTokenizeForAtLeast1ms(){const e=this._tokenizerWithStateStore._textModel.getLineCount(),t=new sx,i=Ht.create(!1);do{if(i.elapsed()>1)break;if(this._tokenizeOneInvalidLine(t)>=e)break}while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return!!this._tokenizerWithStateStore&&!this._tokenizerWithStateStore.store.allStatesValid()}_tokenizeOneInvalidLine(e){const t=this._tokenizerWithStateStore?.getFirstInvalidLine();return t?(this._tokenizerWithStateStore.updateTokensUntilLine(e,t.lineNumber),t.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new ym(e,t))}}class px{get children(){return this._children}get length(){return this._length}constructor(e){this.height=e,this._children=[],this._length=0}static create(e,t){const i=new px(e.height+1);return i.appendChild(e),i.appendChild(t),i}canAppendChild(){return this._children.length<3}appendChild(e){if(!this.canAppendChild())throw new Error("Cannot insert more than 3 children in a ListNode");this._children.push(e),this._length+=e.length,this._updateParentLength(e.length),fx(e)||(e.parent=this)}_updateParentLength(e){let t=this.parent;for(;t;)t._length+=e,t=t.parent}unappendChild(){const e=this._children.pop();return this._length-=e.length,this._updateParentLength(-e.length),e}prependChild(e){if(this._children.length>=3)throw new Error("Cannot prepend more than 3 children in a ListNode");this._children.unshift(e),this._length+=e.length,this._updateParentLength(e.length),fx(e)||(e.parent=this)}unprependChild(){const e=this._children.shift();return this._length-=e.length,this._updateParentLength(-e.length),e}lastChild(){return this._children[this._children.length-1]}dispose(){this._children.splice(0,this._children.length)}}var mx;function fx(e){return void 0!==e.token}function _x(e,t){let i=e;const n=[];let o;for(;;){if(t.height===i.height){o=t;break}if(fx(i))throw new Error("unexpected");n.push(i),i=i.lastChild()}for(let e=n.length-1;e>=0;e--){const t=n[e];o&&(t.children.length>=3?o=px.create(t.unappendChild(),o):(t.appendChild(o),o=void 0))}if(o){const t=new px(o.height+1);return t.appendChild(e),t.appendChild(o),t}return e}!function(e){e[e.None=0]="None",e[e.ViewportGuess=1]="ViewportGuess",e[e.EditGuess=2]="EditGuess",e[e.Accurate=3]="Accurate"}(mx||(mx={}));class vx{constructor(e){this._textModel=e,this._root=this.createEmptyRoot()}createEmptyRoot(){return{length:this._textModel.getValueLength(),token:0,height:0,tokenQuality:mx.None}}buildStore(e,t){this._root=this.createFromUpdates(e,t)}createFromUpdates(e,t){if(0===e.length)return this.createEmptyRoot();let i={length:e[0].length,token:e[0].token,height:0,tokenQuality:t};for(let n=1;n<e.length;n++)i=_x(i,{length:e[n].length,token:e[n].token,height:0,tokenQuality:t});return i}update(e,t,i){0!==t.length&&this.replace(e,t[0].startOffsetInclusive,t,i)}delete(e,t){this.replace(e,t,[],mx.EditGuess)}replace(e,t,i,n){const o=t+e,s=[],r=[],a=[{node:this._root,offset:0}];for(;a.length>0;){const e=a.pop(),i=e.offset;if(i<t&&i+e.node.length<=t)fx(e.node)||(e.node.parent=void 0),s.push(e.node);else if(fx(e.node)&&i<t&&s.push({length:t-i,token:e.node.token,height:0,tokenQuality:e.node.tokenQuality}),!(t<=i&&i+e.node.length<=o))if(i>=o)fx(e.node)||(e.node.parent=void 0),r.push(e.node);else if(fx(e.node)&&i+e.node.length>o)r.push({length:i+e.node.length-o,token:e.node.token,height:0,tokenQuality:e.node.tokenQuality});else if(!fx(e.node)){let t=i+e.node.length;for(let i=e.node.children.length-1;i>=0;i--)t-=e.node.children[i].length,a.push({node:e.node.children[i],offset:t})}}let l;l=i.length>0?s.concat(this.createFromUpdates(i,n),r):s.concat(r);let d=l[0];for(let e=1;e<l.length;e++)h=d,c=l[e],d=h.height===c.height?px.create(h,c):h.height>c.height?_x(h,c):function(e,t){let i=e;const n=[];for(;t.height!==i.height;){if(fx(i))throw new Error("unexpected");n.push(i),i=i.children[0]}let o=t;for(let e=n.length-1;e>=0;e--){const t=n[e];o&&(t.children.length>=3?o=px.create(o,t.unprependChild()):(t.prependChild(o),o=void 0))}return o?px.create(o,e):e}(c,h);var h,c;this._root=d??this.createEmptyRoot()}traverseInOrderInRange(e,t,i){const n=[{node:this._root,offset:0}];for(;n.length>0;){const{node:o,offset:s}=n.pop();if(!(s+o.length<=e||s>=t)){if(i(o,s))return;if(!fx(o)){let e=s+o.length;for(let t=o.children.length-1;t>=0;t--)e-=o.children[t].length,n.push({node:o.children[t],offset:e})}}}}getTokenAt(e){let t;return this.traverseInOrderInRange(e,this._root.length,((e,i)=>!!fx(e)&&(t={token:e.token,startOffsetInclusive:i,length:e.length},!0))),t}getTokensInRange(e,t){const i=[];return this.traverseInOrderInRange(e,t,((n,o)=>{if(fx(n)){let s=n.length,r=o;o<e&&o+n.length>t?(r=e,s=t-e):o<e?(s-=e-o,r=e):o+n.length>t&&(s-=o+n.length-t),i.push({token:n.token,startOffsetInclusive:r,length:s})}return!1})),i}markForRefresh(e,t){this.traverseInOrderInRange(e,t,(e=>(fx(e)&&(e.tokenQuality=mx.None),!1)))}rangeHasTokens(e,t,i){let n=!0;return this.traverseInOrderInRange(e,t,(e=>(fx(e)&&e.tokenQuality<i&&(n=!1),!1))),n}rangeNeedsRefresh(e,t){let i=!1;return this.traverseInOrderInRange(e,t,(e=>(fx(e)&&e.tokenQuality!==mx.Accurate&&(i=!0),!1))),i}getNeedsRefresh(){const e=[];return this.traverseInOrderInRange(0,this._textModel.getValueLength(),((t,i)=>(fx(t)&&t.tokenQuality!==mx.Accurate&&(e.length>0&&e[e.length-1].endOffset===i?e[e.length-1].endOffset+=t.length:e.push({startOffset:i,endOffset:i+t.length})),!1))),e}dispose(){const e=[[this._root,!1]];for(;e.length>0;){const[t,i]=e.pop();if(fx(t));else if(i)t.dispose(),t.parent=void 0;else{e.push([t,!0]);for(let i=t.children.length-1;i>=0;i--)e.push([t.children[i],!1])}}this._root=void 0}}const bx=oc("treeSitterThemeService");let wx=class extends At{get _textModel(){return this._tree.textModel}constructor(e,t,i,n,o){var s;super(),this._tree=e,this._highlightingQueries=t,this._languageIdCodec=i,this._visibleLineRanges=n,this._treeSitterThemeService=o,this._onDidChangeTokens=this._register(new Zt),this.onDidChangeTokens=this._onDidChangeTokens.event,this._onDidCompleteBackgroundTokenization=this._register(new Zt),this.onDidChangeBackgroundTokenization=this._onDidCompleteBackgroundTokenization.event,this._encodedLanguageId=this._languageIdCodec.encodeLanguageId(this._tree.languageId),this._register(Wr(this._treeSitterThemeService.onChange,(()=>{this._updateTheme()}))),this._tokenStore=this._register(new vx(this._textModel)),this._accurateVersion=this._textModel.getVersionId(),this._guessVersion=this._textModel.getVersionId(),this._tokenStore.buildStore(this._createEmptyTokens(),mx.None),this._register(ar((e=>{const t=this._visibleLineRanges.read(e);this._parseAndTokenizeViewPort(t)}))),this._register(dr({owner:this,changeTracker:(s={tree:this._tree.tree},{createChangeSummary:e=>({changes:[]}),handleChange(e,t){for(const i in s)e.didChange(s[i])&&t.changes.push({key:i,change:e.change});return!0},beforeUpdate(e,t){for(const i in s){if("changes"===i)throw new Ve('property name "changes" is reserved for change tracking');t[i]=s[i].read(e)}}})},((e,t)=>{const i=t.changes.at(0)?.change;if(t.changes.length>1)throw new Ve("The tree changed twice in one transaction. This is currently not supported and should not happen.");if(i){if(this.hasTokens())for(const e of i.ranges)this._markForRefresh(e.newRange);this.hasTokens()?this._handleTreeUpdate(i.ranges,i.versionId):this._firstTreeUpdate(i.versionId)}else t.tree&&this._firstTreeUpdate(this._tree.treeLastParsedVersion.read(e))})))}handleContentChanged(e){this._guessVersion=e.versionId;for(const t of e.changes)if(t.text.length>t.rangeLength){const e=t.rangeOffset>0?t.rangeOffset-1:t.rangeOffset,i=this._tokenStore.getTokenAt(e);let n;i?(n={startOffsetInclusive:i.startOffsetInclusive,length:i.length+t.text.length-t.rangeLength,token:i.token},this._tokenStore.markForRefresh(e,t.rangeOffset+(t.text.length>t.rangeLength?t.text.length:t.rangeLength))):n={startOffsetInclusive:e,length:t.text.length,token:0},this._tokenStore.update(i?.length??0,[n],mx.EditGuess)}else if(t.text.length<t.rangeLength){const e=t.rangeLength-t.text.length;this._tokenStore.delete(e,t.rangeOffset)}}getLineTokens(e){const t=this._textModel.getLineContent(e),i=this.getTokens(e);return new uS(i,t,this._languageIdCodec)}_createEmptyTokens(){const e=this._emptyToken(),t=this._textModel.getValueLength();return[this._emptyTokensForOffsetAndLength(0,t,e)]}_emptyToken(){return this._treeSitterThemeService.findMetadata([],this._encodedLanguageId,!1,void 0)}_emptyTokensForOffsetAndLength(e,t,i){return{token:i,length:e+t,startOffsetInclusive:0}}hasAccurateTokensForLine(e){return this.hasTokens(new Yu(e,1,e,this._textModel.getLineMaxColumn(e)))}tokenizeLinesAt(e,t){const i=this._guessTokensForLinesContent(e,t),n=[];if(!i)return null;for(let e=0;e<i.length;e++)n.push(new uS(i[e],t[e],this._languageIdCodec));return n}_rangeHasTokens(e,t){return this._tokenStore.rangeHasTokens(this._textModel.getOffsetAt(e.getStartPosition()),this._textModel.getOffsetAt(e.getEndPosition()),t)}hasTokens(e){return!e||this._guessVersion===this._accurateVersion||!this._tokenStore.rangeNeedsRefresh(this._textModel.getOffsetAt(e.getStartPosition()),this._textModel.getOffsetAt(e.getEndPosition()))}getTokens(e){const t=this._textModel.getOffsetAt({lineNumber:e,column:1}),i=this._textModel.getOffsetAt({lineNumber:e,column:this._textModel.getLineLength(e)+1}),n=this._tokenStore.getTokensInRange(t,i),o=new Uint32Array(2*n.length);for(let e=0;e<n.length;e++)o[2*e]=n[e].startOffsetInclusive-t+n[e].length,o[2*e+1]=n[e].token;return o}getTokensInRange(e,t,i,n){const o=n?this._tokenizeCapturesWithMetadata(n,t,i):this._tokenize(e,t,i);if(o?.endOffsetsAndMetadata)return this._rangeTokensAsUpdates(t,o.endOffsetsAndMetadata)}_updateTokensInStore(e,t,i){this._accurateVersion=e;for(const n of t){const t=n.newTokens.length>0?n.newTokens[n.newTokens.length-1]:void 0;let o;o=t&&this._guessVersion>=e?t.startOffsetInclusive+t.length-n.newTokens[0].startOffsetInclusive:n.oldRangeLength?n.oldRangeLength:0,this._tokenStore.update(o,n.newTokens,i)}}_markForRefresh(e){this._tokenStore.markForRefresh(this._textModel.getOffsetAt(e.getStartPosition()),this._textModel.getOffsetAt(e.getEndPosition()))}_getNeedsRefresh(){const e=this._tokenStore.getNeedsRefresh();return e?e.map((e=>({range:Yu.fromPositions(this._textModel.getPositionAt(e.startOffset),this._textModel.getPositionAt(e.endOffset)),startOffset:e.startOffset,endOffset:e.endOffset}))):[]}_parseAndTokenizeViewPort(e){const t=e.map((e=>e.toInclusiveRange())).filter(mt);for(const e of t){const t=this._textModel.getOffsetAt(e.getStartPosition()),i=this._textModel.getOffsetAt(e.getEndPosition()),n=this._textModel.getVersionId();if(this._rangeHasTokens(e,mx.ViewportGuess))continue;const o=this._textModel.getValueInRange(e),s=this._forceParseAndTokenizeContent(e,t,i,o,!0);if(!s||this._rangeHasTokens(e,mx.ViewportGuess))continue;if(0===s.length)continue;const r=s[s.length-1],a=r.startOffsetInclusive+r.length-s[0].startOffsetInclusive;this._updateTokensInStore(n,[{newTokens:s,oldRangeLength:a}],mx.ViewportGuess),this._onDidChangeTokens.fire({changes:{semanticTokensApplied:!1,ranges:[{fromLineNumber:e.startLineNumber,toLineNumber:e.endLineNumber}]}})}}_guessTokensForLinesContent(e,t){if(0===t.length)return;const i=t.join(this._textModel.getEOL()),n=new Yu(1,1,e+t.length,t[t.length-1].length+1),o=this._textModel.getOffsetAt({lineNumber:e,column:1}),s=this._forceParseAndTokenizeContent(n,o,o+i.length,i,!1);if(!s)return;const r=new Array(t.length);let a=0,l=0,d=0;for(let e=0;e<t.length;e++){const i=[];let n=!1;for(let o=a;!n&&o<s.length;o++){const r=s[o],h=r.endOffset-d,c=l-d;if(h<=t[e].length)i.push({endOffset:h,metadata:r.metadata}),a++;else if(c<t[e].length){const o={endOffset:t[e].length,metadata:r.metadata};i.push(o),n=!0}else n=!0;l=r.endOffset}r[e]=this._endOffsetTokensToUint32Array(i),d+=t[e].length+this._textModel.getEOL().length}return r}_forceParseAndTokenizeContent(e,t,i,n,o){const s=lx(this._textModel,e.startLineNumber).likelyRelevantLines,r=s.join(this._textModel.getEOL()),a=this._tree.createParsedTreeSync(`${r}${n}`);if(!a)return;const l=new Yu(1,1,e.endLineNumber-e.startLineNumber+1+s.length,e.endColumn),d=this.captureAtRange(l),h=this._tokenizeCapturesWithMetadata(d,r.length,i-t+r.length);return a.delete(),h?o?this._rangeTokensAsUpdates(t,h.endOffsetsAndMetadata,r.length):h.endOffsetsAndMetadata:void 0}_firstTreeUpdate(e){return this._setViewPortTokens(e)}_setViewPortTokens(e){const t=this._visibleLineRanges.get().map((e=>{const t=e.toInclusiveRange();if(!t)return;const i=this._textModel.getOffsetAt(t.getStartPosition()),n=this._textModel.getOffsetAt(t.getEndPosition());return{newRange:t,newRangeEndOffset:n,newRangeStartOffset:i}})).filter(mt);return this._handleTreeUpdate(t,e)}_handleTreeUpdate(e,t){const i=[],n=1e3;for(let t=0;t<e.length;t++)if(e[t].newRange.endLineNumber-e[t].newRange.startLineNumber>n){const o=e[t].newRange.endLineNumber;let s=e[t].newRange.startLineNumber,r=e[t].newRange.startColumn,a=s+n;do{const l=new rc(s,r),d=a===e[t].newRange.endLineNumber?e[t].newRange.endColumn:this._textModel.getLineMaxColumn(a),h=new rc(a,d),c=Yu.fromPositions(l,h);i.push({range:c,startOffset:this._textModel.getOffsetAt(c.getStartPosition()),endOffset:this._textModel.getOffsetAt(c.getEndPosition())}),s=a+1,r=1,a<o&&a+n>o?a=o:a+=n}while(a<=o)}else if(0===t||i[t-1].endOffset<e[t].newRangeStartOffset)i.push({range:e[t].newRange,startOffset:e[t].newRangeStartOffset,endOffset:e[t].newRangeEndOffset});else if(i[t-1].endOffset<e[t].newRangeEndOffset){const n=this._textModel.getPositionAt(i[t-1].endOffset+1),o=new Yu(n.lineNumber,n.column,e[t].newRange.endLineNumber,e[t].newRange.endColumn);i.push({range:o,startOffset:i[t-1].endOffset+1,endOffset:e[t].newRangeEndOffset})}const o=i.map((e=>this._getCaptures(e.range)));return this._updateTreeForRanges(i,t,o).then((()=>{this._textModel.isDisposed()||this._tree.treeLastParsedVersion.get()!==this._textModel.getVersionId()||this._refreshNeedsRefresh(t)}))}async _updateTreeForRanges(e,t,i){let n;for(let o=0;o<e.length&&(this._textModel.isDisposed()||t===this._textModel.getVersionId());o++){const s=i[o],r=e[o],a=this.getTokensInRange(r.range,r.startOffset,r.endOffset,s);n=a?{newTokens:a}:{newTokens:[]},this._updateTokensInStore(t,[n],mx.Accurate),this._onDidChangeTokens.fire({changes:{semanticTokensApplied:!1,ranges:[{fromLineNumber:r.range.getStartPosition().lineNumber,toLineNumber:r.range.getEndPosition().lineNumber}]}}),await new Promise((e=>oe(e)))}this._onDidCompleteBackgroundTokenization.fire()}_refreshNeedsRefresh(e){const t=this._getNeedsRefresh();if(0===t.length)return;const i=new Array(t.length);for(let e=0;e<t.length;e++){const n=t[e];i[e]={newRange:n.range,newRangeStartOffset:n.startOffset,newRangeEndOffset:n.endOffset}}this._handleTreeUpdate(i,e)}_rangeTokensAsUpdates(e,t,i){const n=[];let o=0;for(const s of t){if(s.endOffset<=o||i&&s.endOffset<i)continue;let t;t=i&&o<i?{startOffsetInclusive:e+i,length:s.endOffset-i,token:s.metadata}:{startOffsetInclusive:e+o,length:s.endOffset-o,token:s.metadata},n.push(t),o=s.endOffset}return n}_updateTheme(){const e=this._textModel.getFullModelRange();this._markForRefresh(e),this._parseAndTokenizeViewPort(this._visibleLineRanges.get())}captureAtRange(e){const t=this._tree.tree.get();return t?this._highlightingQueries.captures(t.rootNode,{startPosition:{row:e.startLineNumber-1,column:e.startColumn-1},endPosition:{row:e.endLineNumber-1,column:e.endColumn-1}}).map((e=>({name:e.name,text:e.node.text,node:{startIndex:e.node.startIndex,endIndex:e.node.endIndex,startPosition:{lineNumber:e.node.startPosition.row+1,column:e.node.startPosition.column+1},endPosition:{lineNumber:e.node.endPosition.row+1,column:e.node.endPosition.column+1}},encodedLanguageId:this._encodedLanguageId}))):[]}captureAtRangeWithInjections(e){const t=this.captureAtRange(e);for(let i=0;i<t.length;i++){const n=t[i],o=n.node.startPosition.lineNumber,s=n.node.endPosition.lineNumber,r=n.node.startPosition.column,a=n.node.endPosition.column,l=o>e.startLineNumber&&o<e.endLineNumber?o:e.startLineNumber,d=s>e.startLineNumber&&s<e.endLineNumber?s:e.endLineNumber,h=o===e.startLineNumber?r<e.startColumn?e.startColumn:r:o<e.startLineNumber?e.startColumn:r,c=s===e.endLineNumber?a>e.endColumn?e.endColumn:a:s>e.endLineNumber?e.endColumn:a,u=new Yu(l,h,d,c),g=this._getInjectionCaptures(n,u);g&&g.length>0&&(t.splice(i+1,0,...g),i+=g.length)}return t}tokenizeEncoded(e){const t=this._tokenizeEncoded(e);if(!t)return;const i=this._rangeTokensAsUpdates(this._textModel.getOffsetAt({lineNumber:e,column:1}),t.result);t.versionId===this._textModel.getVersionId()&&this._updateTokensInStore(t.versionId,[{newTokens:i,oldRangeLength:this._textModel.getLineLength(e)}],mx.Accurate)}_getCaptures(e){return this.captureAtRangeWithInjections(e)}_tokenize(e,t,i){const n=this._getCaptures(e),o=this._tokenizeCapturesWithMetadata(n,t,i);if(o)return{...o,versionId:this._tree.treeLastParsedVersion.get()}}_createTokensFromCaptures(e,t,i){const n=this._tree.tree.get(),o=Ht.create(),s=i-t,r=this._languageIdCodec.encodeLanguageId(this._tree.languageId),a=Cx[this._tree.languageId]||"source";if(0===e.length)return n?(o.stop(),{endOffsets:[{endOffset:s,scopes:[],encodedLanguageId:r}],captureTime:o.elapsed()}):void 0;const l=Array(e.length);l.fill({endOffset:0,scopes:[a],encodedLanguageId:r});let d=0;const h=()=>{l.push({endOffset:0,scopes:[a],encodedLanguageId:r})},c=(e,t)=>e.name.includes("punctuation")&&e.text?Array.from(e.text.matchAll(yx)).map((e=>t+e.index)):void 0,u=(e,t,i,n)=>{if(void 0!==n){const o=l[n].scopes;let s=l[n].bracket;if((n>0?l[n-1].endOffset:0)!==t){let r;if(s&&s.length>0){r=[];const e=[];for(let n=0;n<s.length;n++){const o=s[n];o<t?r.push(o):o>i&&e.push(o)}0===r.length&&(r=void 0),s=0===e.length?void 0:e}l.splice(n,0,{endOffset:t,scopes:[...o],bracket:r,encodedLanguageId:e.encodedLanguageId}),n++,h(),d++}l.splice(n,0,{endOffset:i,scopes:[...o,e.name],bracket:c(e,t),encodedLanguageId:e.encodedLanguageId}),l[d].bracket=s}else l[d]={endOffset:i,scopes:[a,e.name],bracket:c(e,t),encodedLanguageId:e.encodedLanguageId};d++};for(let n=0;n<e.length;n++){const o=e[n],s=o.node.endIndex<i?o.node.endIndex<t?t:o.node.endIndex:i,r=o.node.startIndex<t?t:o.node.startIndex,g=s-t;let p;const m=s-r;p=n>0?l[d-1].endOffset:r-t-1;const f=g-m;if(p>=0&&p<f&&(l[d]={endOffset:f,scopes:[a],encodedLanguageId:this._encodedLanguageId},d++,h()),!(m<0))if(p>=g){let e=d-1,t=l[e].endOffset,i=e>=2?l[e-1].endOffset:0;do{if(i+m===t){if(i===f){l[e].scopes.push(o.name);const t=l[e].bracket;l[e].bracket=t&&t.length>0?t:c(o,f)}}else if(i<=f){u(o,f,g,e);break}e--,i=e>=1?l[e-1].endOffset:0,t=e>=0?l[e].endOffset:0}while(t>f)}else u(o,f,g)}l[d-1].endOffset<s&&s-l[d-1].endOffset>0&&(h(),l[d]={endOffset:s,scopes:l[d].scopes,encodedLanguageId:this._encodedLanguageId},d++);for(let e=0;e<l.length;e++)if(0===l[e].endOffset&&0!==e){l.splice(e,l.length-e);break}const g=o.elapsed();return{endOffsets:l,captureTime:g}}_getInjectionCaptures(e,t){return[]}_tokenizeCapturesWithMetadata(e,t,i){const n=Ht.create(),o=this._createTokensFromCaptures(e,t,i);if(!o)return;const s=o.endOffsets;for(let e=0;e<s.length;e++){const t=s[e];t.metadata=this._treeSitterThemeService.findMetadata(t.scopes,t.encodedLanguageId,!!t.bracket&&t.bracket.length>0,void 0)}const r=n.elapsed();return{endOffsetsAndMetadata:s,captureTime:o.captureTime,metadataTime:r}}_tokenizeEncoded(e){const t=this._textModel.getOffsetAt({lineNumber:e,column:1}),i=e+1<=this._textModel.getLineCount()?this._textModel.getOffsetAt({lineNumber:e+1,column:1}):this._textModel.getValueLength(),n=i-t,o=this._tokenize(new Yu(e,1,e,n+1),t,i);if(o)return{result:o.endOffsetsAndMetadata,captureTime:o.captureTime,metadataTime:o.metadataTime,versionId:o.versionId}}_endOffsetTokensToUint32Array(e){const t=new Uint32Array(2*e.length);for(let i=0;i<e.length;i++)t[2*i]=e[i].endOffset,t[2*i+1]=e[i].metadata;return t}};wx=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(4,bx)],wx);const Cx={css:"source.css",typescript:"source.ts",ini:"source.ini",regex:"source.regex"},yx=/[\{\}\[\]\<\>\(\)]/g,Sx=oc("treeSitterLibraryService");var xx=function(e,t){return function(i,n){t(i,n,e)}};let kx=class extends CS{constructor(e,t,i,n,o,s){super(t,i),this._languageIdObs=e,this._treeSitterLibraryService=o,this._instantiationService=s,this._backgroundTokenizationState=1,this._onDidChangeBackgroundTokenizationState=this._register(new Zt),this.onDidChangeBackgroundTokenizationState=this._onDidChangeBackgroundTokenizationState.event;const r=new wr(this._treeSitterLibraryService.getParserClass()),a=pr(this,(e=>{const t=r.promiseResult?.read(e)?.getDataOrThrow();return t}));this._tree=pr(this,(e=>{const t=a.read(e);if(!t)return;const i=this._languageIdObs.read(e),n=this._treeSitterLibraryService.getLanguage(i,e);if(!n)return;const o=new t;return e.store.add(Tt((()=>{o.delete()}))),o.setLanguage(n),void 0!==this._treeSitterLibraryService.getInjectionQueries(i,e)?e.store.add(this._instantiationService.createInstance(ES,i,void 0,o,t,this._textModel)):void 0})),this._tokenizationImpl=pr(this,(e=>{const t=this._tree.read(e);if(!t)return;const i=this._treeSitterLibraryService.getHighlightingQueries(t.languageId,e);return i?e.store.add(this._instantiationService.createInstance(wx,t,i,this._languageIdCodec,n)):void 0})),this._register(ar((e=>{const t=this._tokenizationImpl.read(e);t&&(e.store.add(t.onDidChangeTokens((e=>{this._onDidChangeTokens.fire(e.changes)}))),e.store.add(t.onDidChangeBackgroundTokenization((e=>{this._backgroundTokenizationState=2,this._onDidChangeBackgroundTokenizationState.fire()}))))})))}getLineTokens(e){const t=this._tokenizationImpl.get();if(!t){const t=this._textModel.getLineContent(e);return uS.createEmpty(t,this._languageIdCodec)}return t.getLineTokens(e)}todo_resetTokenization(e=!0){e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}handleDidChangeAttached(){}handleDidChangeContent(e){if(e.isFlush)this.todo_resetTokenization(!1);else{const t=this._tokenizationImpl.get();t?.handleContentChanged(e)}const t=this._tree.get();t?.handleContentChange(e)}forceTokenization(e){const t=this._tokenizationImpl.get();t&&(t.hasAccurateTokensForLine(e)||t.tokenizeEncoded(e))}hasAccurateTokensForLine(e){const t=this._tokenizationImpl.get();return!!t&&t.hasAccurateTokensForLine(e)}isCheapToTokenize(e){return!0}getTokenTypeIfInsertingCharacter(e,t,i){return 0}tokenizeLinesAt(e,t){const i=this._tokenizationImpl.get();return i?i.tokenizeLinesAt(e,t):null}get hasTokens(){const e=this._tokenizationImpl.get();return!!e&&e.hasTokens()}};kx=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([xx(4,Sx),xx(5,nc)],kx);class Lx{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return 0===this._pieces.length}set(e,t,i=void 0){if(this._pieces=e||[],this._isComplete=t,i)for(const e of this._pieces)e.reportIfInvalid(i)}setPartial(e,t){let i=e;if(t.length>0){const n=t[0].getRange(),o=t[t.length-1].getRange();if(!n||!o)return e;i=e.plusRange(n).plusRange(o)}let n=null;for(let e=0,t=this._pieces.length;e<t;e++){const o=this._pieces[e];if(o.endLineNumber<i.startLineNumber)continue;if(o.startLineNumber>i.endLineNumber){n=n||{index:e};break}if(o.removeTokens(i),o.isEmpty()){this._pieces.splice(e,1),e--,t--;continue}if(o.endLineNumber<i.startLineNumber)continue;if(o.startLineNumber>i.endLineNumber){n=n||{index:e};continue}const[s,r]=o.split(i);s.isEmpty()?n=n||{index:e}:r.isEmpty()||(this._pieces.splice(e,1,s,r),e++,t++,n=n||{index:e})}return n=n||{index:this._pieces.length},t.length>0&&(this._pieces=gs(this._pieces,n.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(0===t.getTextLength())return t;const i=this._pieces;if(0===i.length)return t;const n=i[Lx._findFirstPieceWithLine(i,e)].getLineTokens(e);if(!n)return t;const o=t.getCount(),s=n.getCount();let r=0;const a=[];let l=0,d=0;const h=(e,t)=>{e!==d&&(d=e,a[l++]=e,a[l++]=t)};for(let e=0;e<s;e++){const i=Math.min(n.getStartCharacter(e),t.getTextLength()),s=Math.min(n.getEndCharacter(e),t.getTextLength()),a=n.getMetadata(e),l=((1&a?2048:0)|(2&a?4096:0)|(4&a?8192:0)|(8&a?16384:0)|(16&a?16744448:0)|(32&a?4278190080:0))>>>0,d=~l>>>0;for(;r<o&&t.getEndOffset(r)<=i;)h(t.getEndOffset(r),t.getMetadata(r)),r++;for(r<o&&t.getStartOffset(r)<i&&h(i,t.getMetadata(r));r<o&&t.getEndOffset(r)<s;)h(t.getEndOffset(r),t.getMetadata(r)&d|a&l),r++;if(r<o)h(s,t.getMetadata(r)&d|a&l),t.getEndOffset(r)===s&&r++;else{const e=Math.min(Math.max(0,r-1),o-1);h(s,t.getMetadata(e)&d|a&l)}}for(;r<o;)h(t.getEndOffset(r),t.getMetadata(r)),r++;return new uS(new Uint32Array(a),t.getLineContent(),this._languageIdCodec)}static _findFirstPieceWithLine(e,t){let i=0,n=e.length-1;for(;i<n;){let o=i+Math.floor((n-i)/2);if(e[o].endLineNumber<t)i=o+1;else{if(!(e[o].startLineNumber>t)){for(;o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}n=o-1}}return i}acceptEdit(e,t,i,n,o){for(const s of this._pieces)s.acceptEdit(e,t,i,n,o)}}const Dx=new Uint32Array(0).buffer;class Ex{static deleteBeginning(e,t){return null===e||e===Dx?e:Ex.delete(e,0,t)}static deleteEnding(e,t){if(null===e||e===Dx)return e;const i=Nx(e),n=i[i.length-2];return Ex.delete(e,t,n)}static delete(e,t,i){if(null===e||e===Dx||t===i)return e;const n=Nx(e),o=n.length>>>1;if(0===t&&n[n.length-2]===i)return Dx;const s=uS.findIndexInTokensArray(n,t),r=s>0?n[s-1<<1]:0;if(i<n[s<<1]){const r=i-t;for(let e=s;e<o;e++)n[e<<1]-=r;return e}let a,l;r!==t?(n[s<<1]=t,a=s+1<<1,l=t):(a=s<<1,l=r);const d=i-t;for(let e=s+1;e<o;e++){const t=n[e<<1]-d;t>l&&(n[a++]=t,n[a++]=n[1+(e<<1)],l=t)}if(a===n.length)return e;const h=new Uint32Array(a);return h.set(n.subarray(0,a),0),h.buffer}static append(e,t){if(t===Dx)return e;if(e===Dx)return t;if(null===e)return e;if(null===t)return null;const i=Nx(e),n=Nx(t),o=n.length>>>1,s=new Uint32Array(i.length+n.length);s.set(i,0);let r=i.length;const a=i[i.length-2];for(let e=0;e<o;e++)s[r++]=n[e<<1]+a,s[r++]=n[1+(e<<1)];return s.buffer}static insert(e,t,i){if(null===e||e===Dx)return e;const n=Nx(e),o=n.length>>>1;let s=uS.findIndexInTokensArray(n,t);s>0&&n[s-1<<1]===t&&s--;for(let e=s;e<o;e++)n[e<<1]+=i;return e}}function Nx(e){return e instanceof Uint32Array?e:new Uint32Array(e)}class Ix{constructor(e){this._lineTokens=[],this._len=0,this._languageIdCodec=e}flush(){this._lineTokens=[],this._len=0}get hasTokens(){return this._lineTokens.length>0}getTokens(e,t,i){let n=null;if(t<this._len&&(n=this._lineTokens[t]),null!==n&&n!==Dx)return new uS(Nx(n),i,this._languageIdCodec);const o=new Uint32Array(2);return o[0]=i.length,o[1]=Tx(this._languageIdCodec.encodeLanguageId(e)),new uS(o,i,this._languageIdCodec)}static _massageTokens(e,t,i){const n=i?Nx(i):null;if(0===t){let t=!1;if(n&&n.length>1&&(t=of.getLanguageId(n[1])!==e),!t)return Dx}if(!n||0===n.length){const i=new Uint32Array(2);return i[0]=t,i[1]=Tx(e),i.buffer}return n[n.length-2]=t,0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(0===t)return;const i=[];for(let e=0;e<t;e++)i[e]=null;this._lineTokens=gs(this._lineTokens,e,i),this._len+=t}setTokens(e,t,i,n,o){const s=Ix._massageTokens(this._languageIdCodec.encodeLanguageId(e),i,n);this._ensureLine(t);const r=this._lineTokens[t];return this._lineTokens[t]=s,!!o&&!Ix._equals(r,s)}static _equals(e,t){if(!e||!t)return!e&&!t;const i=Nx(e),n=Nx(t);if(i.length!==n.length)return!1;for(let e=0,t=i.length;e<t;e++)if(i[e]!==n[e])return!1;return!0}acceptEdit(e,t,i){this._acceptDeleteRange(e),this._acceptInsertText(new rc(e.startLineNumber,e.startColumn),t,i)}_acceptDeleteRange(e){const t=e.startLineNumber-1;if(t>=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;return void(this._lineTokens[t]=Ex.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1))}this._lineTokens[t]=Ex.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i<this._len&&(n=Ex.deleteBeginning(this._lineTokens[i],e.endColumn-1)),this._lineTokens[t]=Ex.append(this._lineTokens[t],n),this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t,i){if(0===t&&0===i)return;const n=e.lineNumber-1;n>=this._len||(0!==t?(this._lineTokens[n]=Ex.deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=Ex.insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)):this._lineTokens[n]=Ex.insert(this._lineTokens[n],e.column-1,i))}setMultilineTokens(e,t){if(0===e.length)return{changes:[]};const i=[];for(let n=0,o=e.length;n<o;n++){const o=e[n];let s=0,r=0,a=!1;for(let e=o.startLineNumber;e<=o.endLineNumber;e++)a?(this.setTokens(t.getLanguageId(),e-1,t.getLineLength(e),o.getLineTokens(e),!1),r=e):this.setTokens(t.getLanguageId(),e-1,t.getLineLength(e),o.getLineTokens(e),!0)&&(a=!0,s=e,r=e);a&&i.push({fromLineNumber:s,toLineNumber:r})}return{changes:i}}}function Tx(e){return(32768|e|2<<24|1024)>>>0}class Mx extends CS{constructor(e,t,i,n){super(e,t),this.getLanguageId=i,this._tokenizer=null,this._backgroundTokenizationState=1,this._onDidChangeBackgroundTokenizationState=this._register(new Zt),this.onDidChangeBackgroundTokenizationState=this._onDidChangeBackgroundTokenizationState.event,this._defaultBackgroundTokenizer=null,this._backgroundTokenizer=this._register(new Rt),this._tokens=new Ix(this._languageIdCodec),this._debugBackgroundTokenizer=this._register(new Rt),this._attachedViewStates=this._register(new Ft),this._register(JS.onDidChange((e=>{const t=this.getLanguageId();-1!==e.changedLanguages.indexOf(t)&&this.todo_resetTokenization()}))),this.todo_resetTokenization(),this._register(n.onDidChangeVisibleRanges((({view:e,state:t})=>{if(t){let i=this._attachedViewStates.get(e);i||(i=new wS((()=>this.refreshRanges(i.lineRanges))),this._attachedViewStates.set(e,i)),i.handleStateChange(t)}else this._attachedViewStates.deleteAndDispose(e)})))}todo_resetTokenization(e=!0){this._tokens.flush(),this._debugBackgroundTokens?.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new dx(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const[t,i]=(()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const e=JS.get(this.getLanguageId());if(!e)return[null,null];let t;try{t=e.getInitialState()}catch(e){return Ie(e),[null,null]}return[e,t]})();if(this._tokenizer=t&&i?new ax(this._textModel.getLineCount(),t,this._textModel,this._languageIdCodec):null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const e={setTokens:e=>{this.setTokens(e)},backgroundTokenizationFinished:()=>{2!==this._backgroundTokenizationState&&(this._backgroundTokenizationState=2,this._onDidChangeBackgroundTokenizationState.fire())},setEndState:(e,t)=>{if(!this._tokenizer)return;const i=this._tokenizer.store.getFirstInvalidEndStateLineNumber();null!==i&&e>=i&&this._tokenizer?.store.setEndState(e,t)}};t&&t.createBackgroundTokenizer&&!t.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=t.createBackgroundTokenizer(this._textModel,e)),this._backgroundTokenizer.value||this._textModel.isTooLargeForTokenization()||(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new gx(this._tokenizer,e),this._defaultBackgroundTokenizer.handleChanges()),t?.backgroundTokenizerShouldOnlyVerifyTokens&&t.createBackgroundTokenizer?(this._debugBackgroundTokens=new Ix(this._languageIdCodec),this._debugBackgroundStates=new dx(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=t.createBackgroundTokenizer(this._textModel,{setTokens:e=>{this._debugBackgroundTokens?.setMultilineTokens(e,this._textModel)},backgroundTokenizationFinished(){},setEndState:(e,t)=>{this._debugBackgroundStates?.setEndState(e,t)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){this._defaultBackgroundTokenizer?.handleChanges()}handleDidChangeContent(e){if(e.isFlush)this.todo_resetTokenization(!1);else if(!e.isEolChange){for(const t of e.changes){const[e,i]=Dg(t.text);this._tokens.acceptEdit(t.range,e,i),this._debugBackgroundTokens?.acceptEdit(t.range,e,i)}this._debugBackgroundStates?.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),this._defaultBackgroundTokenizer?.handleChanges()}}setTokens(e){const{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){const e=ym.joinMany([...this._attachedViewStates].map((([e,t])=>t.lineRanges)));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const i=new sx,{heuristicTokens:n}=this._tokenizer.tokenizeHeuristically(i,e,t),o=this.setTokens(i.finalize());if(n)for(const e of o.changes)this._backgroundTokenizer.value?.requestTokens(e.fromLineNumber,e.toLineNumber+1);this._defaultBackgroundTokenizer?.checkFinished()}forceTokenization(e){const t=new sx;this._tokenizer?.updateTokensUntilLine(t,e),this.setTokens(t.finalize()),this._defaultBackgroundTokenizer?.checkFinished()}hasAccurateTokensForLine(e){return!this._tokenizer||this._tokenizer.hasAccurateTokensForLine(e)}isCheapToTokenize(e){return!this._tokenizer||this._tokenizer.isCheapToTokenize(e)}getLineTokens(e){const t=this._textModel.getLineContent(e),i=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,t);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const n=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,t);!i.equals(n)&&this._debugBackgroundTokenizer.value?.reportMismatchingTokens&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return i}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return 0;const n=this._textModel.validatePosition(new rc(e,t));return this.forceTokenization(n.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(n,i)}tokenizeLinesAt(e,t){return this._tokenizer?(this.forceTokenization(e),this._tokenizer.tokenizeLinesAt(e,t)):null}get hasTokens(){return this._tokens.hasTokens}}var Ax,Rx=function(e,t){return function(i,n){t(i,n,e)}};let Ox=Ax=class extends KC{constructor(e,t,i,n,o,s,r,a){super(),this._textModel=e,this._bracketPairsTextModelPart=t,this._languageId=i,this._attachedViews=n,this._languageService=o,this._languageConfigurationService=s,this._instantiationService=r,this._treeSitterLibraryService=a,this._languageIdObs=Js(this,this._languageId),this._useTreeSitter=pr(this,(e=>{const t=this._languageIdObs.read(e);return this._treeSitterLibraryService.supportsLanguage(t,e)})),this.tokens=pr(this,(e=>{let t;return t=this._useTreeSitter.read(e)?e.store.add(this._instantiationService.createInstance(kx,this._languageIdObs,this._languageService.languageIdCodec,this._textModel,this._attachedViews.visibleLineRanges)):e.store.add(new Mx(this._languageService.languageIdCodec,this._textModel,(()=>this._languageId),this._attachedViews)),e.store.add(t.onDidChangeTokens((e=>{this._emitModelTokensChangedEvent(e)}))),e.store.add(t.onDidChangeBackgroundTokenizationState((e=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()}))),t}));let l=!1;this.tokens.recomputeInitiallyAndOnChange(this._store,(e=>{l&&e.todo_resetTokenization(),l=!0})),this._semanticTokens=new Lx(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new Zt),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new Zt),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new Zt),this.onDidChangeTokens=this._onDidChangeTokens.event}handleLanguageConfigurationServiceChange(e){e.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[e,i,n]=Dg(t.text);this._semanticTokens.acceptEdit(t.range,e,i,n,t.text.length>0?t.text.charCodeAt(0):0)}this.tokens.get().handleDidChangeContent(e)}handleDidChangeAttached(){this.tokens.get().handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this.tokens.get().getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new Ve("Illegal value for lineNumber")}get hasTokens(){return this.tokens.get().hasTokens}resetTokenization(){this.tokens.get().todo_resetTokenization()}get backgroundTokenizationState(){return this.tokens.get().backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.tokens.get().forceTokenization(e)}hasAccurateTokensForLine(e){return this.validateLineNumber(e),this.tokens.get().hasAccurateTokensForLine(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.tokens.get().isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.tokens.get().tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,i){return this.tokens.get().getTokenTypeIfInsertingCharacter(e,t,i)}tokenizeLinesAt(e,t){return this.tokens.get().tokenizeLinesAt(e,t)}setSemanticTokens(e,t){this._semanticTokens.set(e,t,this._textModel),this._emitModelTokensChangedEvent({semanticTokensApplied:null!==e,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),i=this._textModel.getLineContent(t.lineNumber),n=this.getLineTokens(t.lineNumber),o=n.findTokenIndexAtOffset(t.column-1),[s,r]=Ax._findLanguageBoundaries(n,o),a=Pg(t.column,this.getLanguageConfiguration(n.getLanguageId(o)).getWordDefinition(),i.substring(s,r),s);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a;if(o>0&&s===t.column-1){const[s,r]=Ax._findLanguageBoundaries(n,o-1),a=Pg(t.column,this.getLanguageConfiguration(n.getLanguageId(o-1)).getWordDefinition(),i.substring(s,r),s);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let n=0;for(let o=t;o>=0&&e.getLanguageId(o)===i;o--)n=e.getStartOffset(o);let o=e.getLineContent().length;for(let n=t,s=e.getCount();n<s&&e.getLanguageId(n)===i;n++)o=e.getEndOffset(n);return[n,o]}getWordUntilPosition(e){const t=this.getWordAtPosition(e);return t?{word:t.word.substr(0,e.column-t.startColumn),startColumn:t.startColumn,endColumn:e.column}:{word:"",startColumn:e.column,endColumn:e.column}}getLanguageId(){return this._languageId}getLanguageIdAtPosition(e,t){const i=this._textModel.validatePosition(new rc(e,t)),n=this.getLineTokens(i.lineNumber);return n.getLanguageId(n.findTokenIndexAtOffset(i.column-1))}setLanguageId(e,t="api"){if(this._languageId===e)return;const i={oldLanguage:this._languageId,newLanguage:e,source:t};this._languageId=e,this._languageIdObs.set(e,void 0),this._bracketPairsTextModelPart.handleDidChangeLanguage(i),this._onDidChangeLanguage.fire(i),this._onDidChangeLanguageConfiguration.fire({})}};Ox=Ax=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Rx(4,Tg),Rx(5,Qp),Rx(6,nc),Rx(7,Sx)],Ox);class Px{constructor(){this.changeType=1}}class Fx{static applyInjectedText(e,t){if(!t||0===t.length)return e;let i="",n=0;for(const o of t)i+=e.substring(n,o.column-1),n=o.column-1,i+=o.options.content;return i+=e.substring(n),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new Fx(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new Fx(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort(((e,t)=>e.lineNumber===t.lineNumber?e.column===t.column?e.order-t.order:e.column-t.column:e.lineNumber-t.lineNumber)),t}constructor(e,t,i,n,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=n,this.order=o}}class Bx{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class Wx{constructor(e,t,i,n){this.ownerId=e,this.decorationId=t,this.lineNumber=i,this.lineHeight=n}}class Vx{constructor(e,t){this.ownerId=e,this.lineNumber=t}}class Hx{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class zx{constructor(e,t,i,n){this.changeType=4,this.injectedTexts=n,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class Ux{constructor(){this.changeType=5}}class Kx{constructor(e,t,i,n){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=n,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;t<i;t++)if(this.changes[t].changeType===e)return!0;return!1}static merge(e,t){const i=[].concat(e.changes).concat(t.changes),n=t.versionId,o=e.isUndoing||t.isUndoing,s=e.isRedoing||t.isRedoing;return new Kx(i,n,o,s)}}class jx{constructor(e){this.changes=e}}class qx{constructor(e){this.changes=e}}class $x{constructor(e){this.changes=e}}class Gx{constructor(e,t){this.rawContentChangedEvent=e,this.contentChangedEvent=t}merge(e){const t=Kx.merge(this.rawContentChangedEvent,e.rawContentChangedEvent),i=Gx._mergeChangeEvents(this.contentChangedEvent,e.contentChangedEvent);return new Gx(t,i)}static _mergeChangeEvents(e,t){const i=[].concat(e.changes).concat(t.changes),n=t.eol,o=t.versionId,s=e.isUndoing||t.isUndoing,r=e.isRedoing||t.isRedoing,a=e.isFlush||t.isFlush;return{changes:i,eol:n,isEolChange:e.isEolChange&&t.isEolChange,versionId:o,isUndoing:s,isRedoing:r,isFlush:a,detailedReasons:e.detailedReasons.concat(t.detailedReasons),detailedReasonsChangeLengths:e.detailedReasonsChangeLengths.concat(t.detailedReasonsChangeLengths)}}}const Zx=oc("undoRedoService");class Yx{constructor(e,t){this.resource=e,this.elements=t}}class Qx{static{this._ID=0}constructor(){this.id=Qx._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}static{this.None=new Qx}}class Xx{static{this._ID=0}constructor(){this.id=Xx._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}static{this.None=new Xx}}var Jx;function ek(e,t){const i=new Set;for(const n of t)e.has(n)&&i.add(n);return i}class tk{static{Jx=Symbol.toStringTag}constructor(e,t){this.toKey=t,this._map=new Map,this[Jx]="SetWithKey";for(const t of e)this.add(t)}get size(){return this._map.size}add(e){const t=this.toKey(e);return this._map.set(t,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(const e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(const e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,t){this._map.forEach((i=>e.call(t,i,i,this)))}[Symbol.iterator](){return this.values()}}var ik,nk=function(e,t){return function(i,n){t(i,n,e)}};function ok(e,t){let i;var n;return i="string"==typeof e?function(e){const t=new cS;return t.acceptChunk(e),t.finish()}(e):(n=e)&&"function"==typeof n.read?function(e){const t=new cS;let i;for(;"string"==typeof(i=e.read());)t.acceptChunk(i);return t.finish()}(e):e,i.create(t)}let sk=0;class rk{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;for(;;){const n=this._source.read();if(null===n)return this._eos=!0,0===t?null:e.join("");if(n.length>0&&(e[t++]=n,i+=n.length),i>=65536)return e.join("")}}}const ak=()=>{throw new Error("Invalid change accessor")};let lk=class extends At{static{ik=this}static{this._MODEL_SYNC_LIMIT=52428800}static{this.LARGE_FILE_SIZE_THRESHOLD=20971520}static{this.LARGE_FILE_LINE_COUNT_THRESHOLD=3e5}static{this.LARGE_FILE_HEAP_OPERATION_THRESHOLD=268435456}static{this.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:Ig.tabSize,indentSize:Ig.indentSize,insertSpaces:Ig.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:Ig.trimAutoWhitespace,largeFileOptimizations:Ig.largeFileOptimizations,bracketPairColorizationOptions:Ig.bracketPairColorizationOptions}}static resolveOptions(e,t){if(t.detectIndentation){const i=XC(e,t.tabSize,t.insertSpaces);return new fg({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new fg(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}get onDidChangeOptions(){return this._onDidChangeOptions.event}get onDidChangeAttached(){return this._onDidChangeAttached.event}get onDidChangeLineHeight(){return this._onDidChangeLineHeight.event}get onDidChangeFont(){return this._onDidChangeFont.event}onDidChangeContent(e){return this._eventEmitter.slowEvent((t=>e(t.contentChangedEvent)))}onDidChangeContentOrInjectedText(e){return Nt(this._eventEmitter.fastEvent((t=>e(t))),this._onDidChangeInjectedText.event((t=>e(t))))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(e,t,i,n=null,o,s,r,a){super(),this._undoRedoService=o,this._languageService=s,this._languageConfigurationService=r,this.instantiationService=a,this._onWillDispose=this._register(new Zt),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new xk(((e,t,i)=>this.handleBeforeFireDecorationsChangedEvent(e,t,i)))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new Zt),this._onDidChangeAttached=this._register(new Zt),this._onDidChangeInjectedText=this._register(new Zt),this._onDidChangeLineHeight=this._register(new Zt),this._onDidChangeFont=this._register(new Zt),this._eventEmitter=this._register(new kk),this._languageSelectionListener=this._register(new Rt),this._deltaDecorationCallCnt=0,this._attachedViews=new _S,sk++,this.id="$model"+sk,this.isForSimpleWidget=i.isForSimpleWidget,this._associatedResource=null==n?uo.parse("inmemory://model/"+sk):n,this._attachedEditorCount=0;const{textBuffer:l,disposable:d}=ok(e,i.defaultEOL);this._buffer=l,this._bufferDisposable=d;const h=this._buffer.getLineCount(),c=this._buffer.getValueLengthInRange(new Yu(1,1,h,this._buffer.getLineLength(h)+1),0);i.largeFileOptimizations?(this._isTooLargeForTokenization=c>ik.LARGE_FILE_SIZE_THRESHOLD||h>ik.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=c>ik.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._options=ik.resolveOptions(this._buffer,i);const u="string"==typeof t?t:t.languageId;"string"!=typeof t&&(this._languageSelectionListener.value=t.onDidChange((()=>this._setLanguage(t.languageId)))),this._bracketPairs=this._register(new Ef(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new GC(this,this._languageConfigurationService)),this._decorationProvider=this._register(new uC(this)),this._tokenizationTextModelPart=this.instantiationService.createInstance(Ox,this,this._bracketPairs,u,this._attachedViews),this._isTooLargeForSyncing=c>ik._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=Ln(sk),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new uk,this._commandManager=new UC(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange((()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()}))),this._languageService.requestRichLanguageFeatures(u),this._register(this._languageConfigurationService.onDidChange((e=>{this._bracketPairs.handleLanguageConfigurationServiceChange(e),this._tokenizationTextModelPart.handleLanguageConfigurationServiceChange(e)})))}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new dS([],"","\n",!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=At.None}_assertNotDisposed(){if(this._isDisposed)throw new Ve("Model is disposed!")}getTextBuffer(){return this._assertNotDisposed(),this._buffer}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new Gx(e,t)))}setValue(e,t=DC()){if(this._assertNotDisposed(),null==e)throw Pe();const{textBuffer:i,disposable:n}=ok(e,this._options.defaultEOL);this._setValueFromTextBuffer(i,n,t)}_createContentChanged2(e,t,i,n,o,s,r,a,l,d){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:o}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:s,isRedoing:r,isFlush:a,detailedReasons:[d],detailedReasonsChangeLengths:[1]}}_setValueFromTextBuffer(e,t,i){this._assertNotDisposed();const n=this.getFullModelRange(),o=this.getValueLengthInRange(n),s=this.getLineCount(),r=this.getLineMaxColumn(s);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new uk,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new Kx([new Px],this._versionId,!1,!1),this._createContentChanged2(new Yu(1,1,s,r),0,o,new rc(s,r),this.getValue(),!1,!1,!0,!1,i))}setEOL(e){this._assertNotDisposed();const t=1===e?"\r\n":"\n";if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new Kx([new Ux],this._versionId,!1,!1),this._createContentChanged2(new Yu(1,1,o,s),0,n,new rc(o,s),this.getValue(),!1,!1,!1,!0,EC()))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i<n;i++){const n=t[i],o=n.range,s=n.cachedAbsoluteStart-n.start,r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);n.cachedAbsoluteStart=r,n.cachedAbsoluteEnd=a,n.cachedVersionId=e,n.start=r-s,n.end=a-s,yy(n)}}onBeforeAttached(){return this._attachedEditorCount++,1===this._attachedEditorCount&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.attachView()}onBeforeDetached(e){this._attachedEditorCount--,0===this._attachedEditorCount&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.detachView(e)}isAttachedToEditor(){return this._attachedEditorCount>0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let n=1;n<=i;n++){const i=this._buffer.getLineLength(n);i>=1e4?t+=i:e+=i}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=void 0!==e.tabSize?e.tabSize:this._options.tabSize,i=void 0!==e.indentSize?e.indentSize:this._options.originalIndentSize,n=void 0!==e.insertSpaces?e.insertSpaces:this._options.insertSpaces,o=void 0!==e.trimAutoWhitespace?e.trimAutoWhitespace:this._options.trimAutoWhitespace,s=void 0!==e.bracketColorizationOptions?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,r=new fg({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:s});if(this._options.equals(r))return;const a=this._options.createChangeEvent(r);this._options=r,this._bracketPairs.handleDidChangeOptions(a),this._decorationProvider.handleDidChangeOptions(a),this._onDidChangeOptions.fire(a)}detectIndentation(e,t){this._assertNotDisposed();const i=XC(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),Ng(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(wn.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map((e=>({range:e.range,text:null}))),(()=>null))}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Ve("Operation would exceed heap memory limits");const i=this.getFullModelRange(),n=this.getValueInRange(i,e);return t?this._buffer.getBOM()+n:n}createSnapshot(e=!1){return new rk(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+n:n}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ve("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ve("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Ve("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),"\n"===this._buffer.getEOL()?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ve("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ve("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ve("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let o=Math.floor("number"!=typeof i||isNaN(i)?1:i),s=Math.floor("number"!=typeof n||isNaN(n)?1:n);if(o<1)o=1,s=1;else if(o>t)o=t,s=this.getLineMaxColumn(o);else if(s<=1)s=1;else{const e=this.getLineMaxColumn(o);s>=e&&(s=e)}const r=e.endLineNumber,a=e.endColumn;let l=Math.floor("number"!=typeof r||isNaN(r)?1:r),d=Math.floor("number"!=typeof a||isNaN(a)?1:a);if(l<1)l=1,d=1;else if(l>t)l=t,d=this.getLineMaxColumn(l);else if(d<=1)d=1;else{const e=this.getLineMaxColumn(l);d>=e&&(d=e)}return i===o&&n===s&&r===l&&a===d&&e instanceof Yu&&!(e instanceof Qu)?e:new Yu(o,s,l,d)}_isValidPosition(e,t,i){return"number"==typeof e&&"number"==typeof t&&(!isNaN(e)&&!isNaN(t)&&(!(e<1||t<1)&&((0|e)===e&&(0|t)===t&&(!(e>this._buffer.getLineCount())&&(1===t||!(t>this.getLineMaxColumn(e))&&(1!==i||!ln(this._buffer.getLineCharCode(e,t-2))))))))}_validatePosition(e,t,i){const n=Math.floor("number"!=typeof e||isNaN(e)?1:e),o=Math.floor("number"!=typeof t||isNaN(t)?1:t),s=this._buffer.getLineCount();if(n<1)return new rc(1,1);if(n>s)return new rc(s,this.getLineMaxColumn(s));if(o<=1)return new rc(n,1);const r=this.getLineMaxColumn(n);return o>=r?new rc(n,r):1===i&&ln(this._buffer.getLineCharCode(n,o-2))?new rc(n,o-1):new rc(n,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof rc&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}isValidRange(e){return this._isValidRange(e,1)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,s=e.endColumn;if(!this._isValidPosition(i,n,0))return!1;if(!this._isValidPosition(o,s,0))return!1;if(1===t){const e=n>1?this._buffer.getLineCharCode(i,n-2):0,t=s>1&&s<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,s-2):0,r=ln(e),a=ln(t);return!r&&!a}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof Yu&&!(e instanceof Qu)&&this._isValidRange(e,1))return e;const t=this._validatePosition(e.startLineNumber,e.startColumn,0),i=this._validatePosition(e.endLineNumber,e.endColumn,0),n=t.lineNumber,o=t.column,s=i.lineNumber,r=i.column;{const e=o>1?this._buffer.getLineCharCode(n,o-2):0,t=r>1&&r<=this._buffer.getLineLength(s)?this._buffer.getLineCharCode(s,r-2):0,i=ln(e),a=ln(t);return i||a?n===s&&o===r?new Yu(n,o-1,s,r-1):i&&a?new Yu(n,o-1,s,r+1):i?new Yu(n,o-1,s,r):new Yu(n,o,s,r+1):new Yu(n,o,s,r)}}modifyPosition(e,t){this._assertNotDisposed();const i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new Yu(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,o,s,r=999){this._assertNotDisposed();let a=null;null!==t&&(Array.isArray(t)||(t=[t]),t.every((e=>Yu.isIRange(e)))&&(a=t.map((e=>this.validateRange(e))))),null===a&&(a=[this.getFullModelRange()]),a=a.sort(((e,t)=>e.startLineNumber-t.startLineNumber||e.startColumn-t.startColumn));const l=[];let d;if(l.push(a.reduce(((e,t)=>Yu.areIntersecting(e,t)?e.plusRange(t):(l.push(e),t)))),!i&&e.indexOf("\n")<0){const t=new $y(e,i,n,o).parseSearchRequest();if(!t)return[];d=e=>this.findMatchesLineByLine(e,t,s,r)}else d=t=>Qy.findMatches(this,new $y(e,i,n,o),t,s,r);return l.map(d).reduce(((e,t)=>e.concat(t)),[])}findNextMatch(e,t,i,n,o,s){this._assertNotDisposed();const r=this.validatePosition(t);if(!i&&e.indexOf("\n")<0){const t=new $y(e,i,n,o).parseSearchRequest();if(!t)return null;const a=this.getLineCount();let l=new Yu(r.lineNumber,r.column,a,this.getLineMaxColumn(a)),d=this.findMatchesLineByLine(l,t,s,1);return Qy.findNextMatch(this,new $y(e,i,n,o),r,s),d.length>0?d[0]:(l=new Yu(1,1,r.lineNumber,this.getLineMaxColumn(r.lineNumber)),d=this.findMatchesLineByLine(l,t,s,1),d.length>0?d[0]:null)}return Qy.findNextMatch(this,new $y(e,i,n,o),r,s)}findPreviousMatch(e,t,i,n,o,s){this._assertNotDisposed();const r=this.validatePosition(t);return Qy.findPreviousMatch(this,new $y(e,i,n,o),r,s)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if(("\n"===this.getEOL()?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof vg?e:new vg(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this._validateEditOperation(e[i]);return t}pushEditOperations(e,t,i,n,o){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(t),i,n,o)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,t,i,n,o){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){const i=t.map((e=>({range:this.validateRange(e.range),text:e.text})));let n=!0;if(e)for(let t=0,o=e.length;t<o;t++){const o=e[t];let s=!1;for(let e=0,t=i.length;e<t;e++){const t=i[e].range,n=t.startLineNumber>o.endLineNumber,r=o.startLineNumber>t.endLineNumber;if(!n&&!r){s=!0;break}}if(!s){n=!1;break}}if(n)for(let e=0,n=this._trimAutoWhitespaceLines.length;e<n;e++){const n=this._trimAutoWhitespaceLines[e],o=this.getLineMaxColumn(n);let s=!0;for(let e=0,t=i.length;e<t;e++){const t=i[e].range,r=i[e].text;if(!(n<t.startLineNumber||n>t.endLineNumber||n===t.startLineNumber&&t.startColumn===o&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(0)||n===t.startLineNumber&&1===t.startColumn&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(r.length-1))){s=!1;break}}if(s){const e=new Yu(n,1,n,o);t.push(new vg(null,e,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,n,o)}_applyUndo(e,t,i,n){const o=e.map((e=>{const t=this.getPositionAt(e.newPosition),i=this.getPositionAt(e.newEnd);return{range:new Yu(t.lineNumber,t.column,i.lineNumber,i.column),text:e.oldText}}));this._applyUndoRedoEdits(o,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const o=e.map((e=>{const t=this.getPositionAt(e.oldPosition),i=this.getPositionAt(e.oldEnd);return{range:new Yu(t.lineNumber,t.column,i.lineNumber,i.column),text:e.newText}}));this._applyUndoRedoEdits(o,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,o,s){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(s),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t,i){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const n=this._validateEditOperations(e);return this._doApplyEdits(n,t??!1,i??NC())}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t,i){const n=this._buffer.getLineCount(),o=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),s=this._buffer.getLineCount(),r=o.changes;if(this._trimAutoWhitespaceLines=o.trimAutoWhitespaceLineNumbers,0!==r.length){for(let e=0,t=r.length;e<t;e++){const t=r[e];this._decorationsTree.acceptReplace(t.rangeOffset,t.rangeLength,t.text.length,t.forceMoveMarkers)}const e=[];this._increaseVersionId();let t=n;for(let i=0,n=r.length;i<n;i++){const n=r[i],[o]=Dg(n.text);this._onDidChangeDecorations.fire();const a=n.range.startLineNumber,l=n.range.endLineNumber,d=l-a,h=o,c=Math.min(d,h),u=h-d,g=s-t-u+a,p=g,m=g+h,f=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new rc(p,1)),this.getOffsetAt(new rc(m,this.getLineMaxColumn(m))),0),_=Fx.fromDecorations(f),v=new ks(_);for(let t=c;t>=0;t--){const i=a+t,n=g+t;v.takeFromEndWhile((e=>e.lineNumber>n));const o=v.takeFromEndWhile((e=>e.lineNumber===n));e.push(new Bx(i,this.getLineContent(n),o))}if(c<d){const t=a+c;e.push(new Hx(t+1,l))}if(c<h){const i=new ks(_),n=a+c,o=h-c,r=s-t-o+n+1,l=[],d=[];for(let e=0;e<o;e++){const t=r+e;d[e]=this.getLineContent(t),i.takeWhile((e=>e.lineNumber<t)),l[e]=i.takeWhile((e=>e.lineNumber===t))}e.push(new zx(n+1,a+h,d,l))}t+=u}this._emitContentChangedEvent(new Kx(e,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:r,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1,detailedReasons:[i],detailedReasonsChangeLengths:[r.length]})}return null===o.reverseEdits?void 0:o.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e,t,i){if(e&&e.size>0){const t=Array.from(e).map((e=>new Bx(e,this.getLineContent(e),this._getInjectedTextInLine(e))));this._onDidChangeInjectedText.fire(new jx(t))}if(t&&t.size>0){const e=Array.from(t).map((e=>new Wx(e.ownerId,e.decorationId,e.lineNumber,e.lineHeight)));this._onDidChangeLineHeight.fire(new qx(e))}if(i&&i.size>0){const e=Array.from(i).map((e=>new Vx(e.ownerId,e.lineNumber)));this._onDidChangeFont.fire(new $x(e))}}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(t,i)=>this._deltaDecorationsImpl(e,[],[{range:t,options:i}])[0],changeDecoration:(t,i)=>{this._changeDecorationImpl(e,t,i)},changeDecorationOptions:(t,i)=>{this._changeDecorationOptionsImpl(e,t,Ck(i))},removeDecoration:t=>{this._deltaDecorationsImpl(e,[t],[])},deltaDecorations:(t,i)=>0===t.length&&0===i.length?[]:this._deltaDecorationsImpl(e,t,i)};let n=null;try{n=t(i)}catch(e){Ie(e)}return i.addDecoration=ak,i.changeDecoration=ak,i.changeDecorationOptions=ak,i.removeDecoration=ak,i.deltaDecorations=ak,n}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),0===e.length&&0===t.length)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),Ie(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const n=e?this._decorations[e]:null;if(!n)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:wk[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.id],null;const o=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),r=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(n),n.reset(this.getVersionId(),s,r,o),n.setOptions(wk[i]),this._decorationsTree.insert(n),n.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let e=0,i=t.length;e<i;e++){const i=t[e];this._decorationsTree.delete(i),delete this._decorations[i.id]}}getDecorationOptions(e){const t=this._decorations[e];return t?t.options:null}getDecorationRange(e){const t=this._decorations[e];return t?this._decorationsTree.getNodeRange(this,t):null}getLineDecorations(e,t=0,i=!1,n=!1){return e<1||e>this.getLineCount()?[]:this.getLinesDecorations(e,e,t,i,n)}getLinesDecorations(e,t,i=0,n=!1,o=!1,s=!1){const r=this.getLineCount(),a=Math.min(r,Math.max(1,e)),l=Math.min(r,Math.max(1,t)),d=this.getLineMaxColumn(l),h=new Yu(a,1,l,d),c=this._getDecorationsInRange(h,i,n,o,s);return fs(c,this._decorationProvider.getDecorationsInRange(h,i,n)),c}getDecorationsInRange(e,t=0,i=!1,n=!1,o=!1,s=!1){const r=this.validateRange(e),a=this._getDecorationsInRange(r,t,i,n,s);return fs(a,this._decorationProvider.getDecorationsInRange(r,t,i,o)),a}getOverviewRulerDecorations(e=0,t=!1,i=!1){return this._decorationsTree.getAll(this,e,t,i,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}getCustomLineHeightsDecorations(e=0){return this._decorationsTree.getAllCustomLineHeights(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),n=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return Fx.fromDecorations(n).filter((t=>t.lineNumber===e))}getFontDecorationsInRange(e,t=0){const i=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),n=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getFontDecorationsInInterval(this,i,n,t)}getAllDecorations(e=0,t=!1,i=!1){let n=this._decorationsTree.getAll(this,e,t,i,!1,!1);return n=n.concat(this._decorationProvider.getAllDecorations(e,t)),n}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!1,!0)}_getDecorationsInRange(e,t,i,n,o){const s=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),r=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,s,r,t,i,n,o)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t,i){const n=this._decorations[t];if(!n)return;if(n.options.after){const e=this.getDecorationRange(t);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(n.options.before){const e=this.getDecorationRange(t);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}if(null!==n.options.lineHeight){const i=this.getDecorationRange(t);this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e,t,i.startLineNumber,null)}if(n.options.affectsFont){const i=this.getDecorationRange(t);this._onDidChangeDecorations.recordLineAffectedByFontChange(e,n.id,i.startLineNumber)}const o=this._validateRangeRelaxedNoAllocations(i),s=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),r=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);this._decorationsTree.delete(n),n.reset(this.getVersionId(),s,r,o),this._decorationsTree.insert(n),this._onDidChangeDecorations.checkAffectedAndFire(n.options),n.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.endLineNumber),n.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.startLineNumber),null!==n.options.lineHeight&&this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e,t,o.startLineNumber,n.options.lineHeight),n.options.affectsFont&&this._onDidChangeDecorations.recordLineAffectedByFontChange(e,n.id,o.startLineNumber)}_changeDecorationOptionsImpl(e,t,i){const n=this._decorations[t];if(!n)return;const o=!(!n.options.overviewRuler||!n.options.overviewRuler.color),s=!(!i.overviewRuler||!i.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(n.options),this._onDidChangeDecorations.checkAffectedAndFire(i),n.options.after||i.after){const e=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(n.options.before||i.before){const e=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}if(null!==n.options.lineHeight||null!==i.lineHeight){const o=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e,t,o.startLineNumber,i.lineHeight)}if(n.options.affectsFont||i.affectsFont){const i=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByFontChange(e,t,i.startLineNumber)}const r=o!==s,a=function(e){return!!e.after||!!e.before}(i)!==ck(n);r||a?(this._decorationsTree.delete(n),n.setOptions(i),this._decorationsTree.insert(n)):n.setOptions(i)}_deltaDecorationsImpl(e,t,i,n=!1){const o=this.getVersionId(),s=t.length;let r=0;const a=i.length;let l=0;this._onDidChangeDecorations.beginDeferredEmit();try{const d=new Array(a);for(;r<s||l<a;){let h=null;if(r<s){let i;do{i=t[r++],h=this._decorations[i]}while(!h&&r<s);if(h){if(h.options.after){const e=this._decorationsTree.getNodeRange(this,h);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(h.options.before){const e=this._decorationsTree.getNodeRange(this,h);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}if(null!==h.options.lineHeight){const t=this._decorationsTree.getNodeRange(this,h);this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e,i,t.startLineNumber,null)}if(h.options.affectsFont){const t=this._decorationsTree.getNodeRange(this,h);this._onDidChangeDecorations.recordLineAffectedByFontChange(e,i,t.startLineNumber)}this._decorationsTree.delete(h),n||this._onDidChangeDecorations.checkAffectedAndFire(h.options)}}if(l<a){if(!h){const e=++this._lastDecorationId,t=`${this._instanceId};${e}`;h=new cy(t,0,0),this._decorations[t]=h}const t=i[l],s=this._validateRangeRelaxedNoAllocations(t.range),r=Ck(t.options),a=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),c=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);h.ownerId=e,h.reset(o,a,c,s),h.setOptions(r),h.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber),h.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber),null!==h.options.lineHeight&&this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e,h.id,s.startLineNumber,h.options.lineHeight),h.options.affectsFont&&this._onDidChangeDecorations.recordLineAffectedByFontChange(e,h.id,s.startLineNumber),n||this._onDidChangeDecorations.checkAffectedAndFire(r),this._decorationsTree.insert(h),d[l]=h.id,l++}else h&&delete this._decorations[h.id]}return d}finally{this._onDidChangeDecorations.endDeferredEmit()}}getLanguageId(){return this.tokenization.getLanguageId()}setLanguage(e,t){"string"==typeof e?(this._languageSelectionListener.clear(),this._setLanguage(e,t)):(this._languageSelectionListener.value=e.onDidChange((()=>this._setLanguage(e.languageId,t))),this._setLanguage(e.languageId,t))}_setLanguage(e,t){this.tokenization.setLanguageId(e,t),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return dk(this.getLineContent(e))+1}toString(){return`TextModel(${this.uri.toString()})`}};function dk(e){let t=0;for(const i of e){if(" "!==i&&"\t"!==i)break;t++}return t}function hk(e){return!(!e.options.overviewRuler||!e.options.overviewRuler.color)}function ck(e){return!!e.options.after||!!e.options.before}lk=ik=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([nk(4,Zx),nk(5,Tg),nk(6,Qp),nk(7,nc)],lk);class uk{constructor(){this._decorationsTree0=new gy,this._decorationsTree1=new gy,this._injectedTextDecorationsTree=new gy}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)null===i.range&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,n,o,s,r){const a=e.getVersionId(),l=this._intervalSearch(t,i,n,o,s,a,r);return this._ensureNodesHaveRanges(e,l)}_intervalSearch(e,t,i,n,o,s,r){const a=this._decorationsTree0.intervalSearch(e,t,i,n,o,s,r),l=this._decorationsTree1.intervalSearch(e,t,i,n,o,s,r),d=this._injectedTextDecorationsTree.intervalSearch(e,t,i,n,o,s,r);return a.concat(l).concat(d)}getInjectedTextInInterval(e,t,i,n){const o=e.getVersionId(),s=this._injectedTextDecorationsTree.intervalSearch(t,i,n,!1,!1,o,!1);return this._ensureNodesHaveRanges(e,s).filter((e=>e.options.showIfCollapsed||!e.range.isEmpty()))}getFontDecorationsInInterval(e,t,i,n){const o=e.getVersionId(),s=this._decorationsTree0.intervalSearch(t,i,n,!1,!1,o,!1);return this._ensureNodesHaveRanges(e,s).filter((e=>e.options.affectsFont))}getAllInjectedText(e,t){const i=e.getVersionId(),n=this._injectedTextDecorationsTree.search(t,!1,!1,i,!1);return this._ensureNodesHaveRanges(e,n).filter((e=>e.options.showIfCollapsed||!e.range.isEmpty()))}getAllCustomLineHeights(e,t){const i=e.getVersionId(),n=this._search(t,!1,!1,!1,i,!1);return this._ensureNodesHaveRanges(e,n).filter((e=>"number"==typeof e.options.lineHeight))}getAll(e,t,i,n,o,s){const r=e.getVersionId(),a=this._search(t,i,n,o,r,s);return this._ensureNodesHaveRanges(e,a)}_search(e,t,i,n,o,s){if(n)return this._decorationsTree1.search(e,t,i,o,s);{const n=this._decorationsTree0.search(e,t,i,o,s),r=this._decorationsTree1.search(e,t,i,o,s),a=this._injectedTextDecorationsTree.search(e,t,i,o,s);return n.concat(r).concat(a)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),n=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(n)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){ck(e)?this._injectedTextDecorationsTree.insert(e):hk(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){ck(e)?this._injectedTextDecorationsTree.delete(e):hk(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),null===t.range&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){ck(e)?this._injectedTextDecorationsTree.resolveNode(e,t):hk(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,n){this._decorationsTree0.acceptReplace(e,t,i,n),this._decorationsTree1.acceptReplace(e,t,i,n),this._injectedTextDecorationsTree.acceptReplace(e,t,i,n)}}function gk(e){return e.replace(/[^a-z0-9\-_]/gi," ")}class pk{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class mk extends pk{constructor(e){super(e),this._resolvedColor=null,this.position="number"==typeof e.position?e.position:ug.Center}getColor(e){return this._resolvedColor||("light"!==e.type&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if("string"==typeof e)return e;const i=e?t.getColor(e.id):null;return i?i.toString():""}}class fk{constructor(e){this.position=e?.position??gg.Center,this.persistLane=e?.persistLane}}class _k extends pk{constructor(e){super(e),this.position=e.position,this.sectionHeaderStyle=e.sectionHeaderStyle??null,this.sectionHeaderText=e.sectionHeaderText??null}getColor(e){return this._resolvedColor||("light"!==e.type&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return"string"==typeof e?Lg.fromHex(e):t.getColor(e.id)}}class vk{static from(e){return e instanceof vk?e:new vk(e)}constructor(e){this.content=e.content||"",this.tokens=e.tokens??null,this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}}class bk{static register(e){return new bk(e)}static createDynamic(e){return new bk(e)}constructor(e){this.description=e.description,this.blockClassName=e.blockClassName?gk(e.blockClassName):null,this.blockDoesNotCollapse=e.blockDoesNotCollapse??null,this.blockIsAfterEnd=e.blockIsAfterEnd??null,this.blockPadding=e.blockPadding??null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?gk(e.className):null,this.shouldFillLineOnLineBreak=e.shouldFillLineOnLineBreak??null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.lineNumberHoverMessage=e.lineNumberHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.lineHeight=e.lineHeight?Math.min(e.lineHeight,300):null,this.fontSize=e.fontSize||null,this.affectsFont=!!(e.fontSize||e.fontFamily||e.fontWeight||e.fontStyle),this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new mk(e.overviewRuler):null,this.minimap=e.minimap?new _k(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new fk(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?gk(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?gk(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?gk(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?e.linesDecorationsTooltip.replace(/[<>"'&]/g,(e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?gk(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?gk(e.marginClassName):null,this.inlineClassName=e.inlineClassName?gk(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?gk(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?gk(e.afterContentClassName):null,this.after=e.after?vk.from(e.after):null,this.before=e.before?vk.from(e.before):null,this.hideInCommentTokens=e.hideInCommentTokens??!1,this.hideInStringTokens=e.hideInStringTokens??!1,this.textDirection=e.textDirection??null}}bk.EMPTY=bk.register({description:"empty"});const wk=[bk.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),bk.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),bk.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),bk.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function Ck(e){return e instanceof bk?e:bk.createDynamic(e)}class yk{static toKey(e){return`${e.ownerId};${e.decorationId};${e.lineNumber}`}constructor(e,t,i,n){this.ownerId=e,this.decorationId=t,this.lineNumber=i,this.lineHeight=n}}class Sk{static toKey(e){return`${e.ownerId};${e.decorationId};${e.lineNumber}`}constructor(e,t,i){this.ownerId=e,this.decorationId=t,this.lineNumber=i}}class xk extends At{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new Zt),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._affectedLineHeights=null,this._affectedFontLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._affectsLineNumber=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){this._deferredCnt--,0===this._deferredCnt&&(this._shouldFireDeferred&&this.doFire(),this._affectedInjectedTextLines?.clear(),this._affectedInjectedTextLines=null,this._affectedLineHeights?.clear(),this._affectedLineHeights=null,this._affectedFontLines?.clear(),this._affectedFontLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}recordLineAffectedByLineHeightChange(e,t,i,n){this._affectedLineHeights||(this._affectedLineHeights=new tk([],yk.toKey)),this._affectedLineHeights.add(new yk(e,t,i,n))}recordLineAffectedByFontChange(e,t,i){this._affectedFontLines||(this._affectedFontLines=new tk([],Sk.toKey)),this._affectedFontLines.add(new Sk(e,t,i))}checkAffectedAndFire(e){this._affectsMinimap||=!!e.minimap?.position,this._affectsOverviewRuler||=!!e.overviewRuler?.color,this._affectsGlyphMargin||=!!e.glyphMarginClassName,this._affectsLineNumber||=!!e.lineNumberClassName,this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){0===this._deferredCnt?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines,this._affectedLineHeights,this._affectedFontLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin,affectsLineNumber:this._affectsLineNumber};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class kk extends At{constructor(){super(),this._fastEmitter=this._register(new Zt),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new Zt),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,0===this._deferredCnt&&null!==this._deferredEvent){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){this._deferredCnt>0?this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e:(this._fastEmitter.fire(e),this._slowEmitter.fire(e))}}const Lk=Ff("editorOverviewRuler.bracketMatchForeground","#A0A0A0",y(800,"Overview ruler marker color for matching brackets."));class Dk{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class Ek extends At{static{this.ID="editor.contrib.bracketMatchingController"}static get(e){return e.getContribution(Ek.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Ci((()=>this._updateBrackets()),50)),this._matchBrackets=this._editor.getOption(80),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition((e=>{"never"!==this._matchBrackets&&this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeModelContent((e=>{this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeModel((e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeModelLanguageConfiguration((e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeConfiguration((e=>{e.hasChanged(80)&&(this._matchBrackets=this._editor.getOption(80),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())}))),this._register(e.onDidBlurEditorWidget((()=>{this._updateBracketsSoon.schedule()}))),this._register(e.onDidFocusEditorWidget((()=>{this._updateBracketsSoon.schedule()})))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map((t=>{const i=t.getStartPosition(),n=e.bracketPairs.matchBracket(i);let o=null;if(n)n[0].containsPosition(i)&&!n[1].containsPosition(i)?o=n[1].getStartPosition():n[1].containsPosition(i)&&(o=n[0].getStartPosition());else{const t=e.bracketPairs.findEnclosingBrackets(i);if(t)o=t[1].getStartPosition();else{const t=e.bracketPairs.findNextBracket(i);t&&t.range&&(o=t.range.getStartPosition())}}return o?new Qu(o.lineNumber,o.column,o.lineNumber,o.column):new Qu(i.lineNumber,i.column,i.lineNumber,i.column)}));this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach((n=>{const o=n.getStartPosition();let s=t.bracketPairs.matchBracket(o);if(!s&&(s=t.bracketPairs.findEnclosingBrackets(o),!s)){const e=t.bracketPairs.findNextBracket(o);e&&e.range&&(s=t.bracketPairs.matchBracket(e.range.getStartPosition()))}let r=null,a=null;if(s){s.sort(Yu.compareRangesUsingStarts);const[t,i]=s;if(r=e?t.getStartPosition():t.getEndPosition(),a=e?i.getEndPosition():i.getStartPosition(),i.containsPosition(o)){const e=r;r=a,a=e}}r&&a&&i.push(new Qu(r.lineNumber,r.column,a.lineNumber,a.column))})),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach((i=>{const n=i.getPosition();let o=t.bracketPairs.matchBracket(n);o||(o=t.bracketPairs.findEnclosingBrackets(n)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())}))}static{this._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=bk.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:rw(Lk),position:ug.Center}})}static{this._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=bk.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"})}_updateBrackets(){if("never"===this._matchBrackets)return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus())return this._lastBracketsData=[],void(this._lastVersionId=0);const e=this._editor.getSelections();if(e.length>100)return this._lastBracketsData=[],void(this._lastVersionId=0);const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const o=[];let s=0;for(let t=0,i=e.length;t<i;t++){const i=e[t];i.isEmpty()&&(o[s++]=i.getStartPosition())}o.length>1&&o.sort(rc.compare);const r=[];let a=0,l=0;const d=n.length;for(let e=0,i=o.length;e<i;e++){const i=o[e];for(;l<d&&n[l].position.isBefore(i);)l++;if(l<d&&n[l].position.equals(i))r[a++]=n[l];else{let e=t.bracketPairs.matchBracket(i,20),n=Ek._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;e||"always"!==this._matchBrackets||(e=t.bracketPairs.findEnclosingBrackets(i,20),n=Ek._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),r[a++]=new Dk(i,e,n)}}this._lastBracketsData=r,this._lastVersionId=i}}Uu(Ek.ID,Ek,1),Hu(class extends Pu{constructor(){super({id:"editor.action.selectToBracket",label:x(803,"Select to Bracket"),precondition:void 0,metadata:{description:x(804,"Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){let n=!0;i&&!1===i.selectBrackets&&(n=!1),Ek.get(t)?.selectToBracket(n)}}),Hu(class extends Pu{constructor(){super({id:"editor.action.jumpToBracket",label:x(802,"Go to Bracket"),precondition:void 0,kbOpts:{kbExpr:Xu.editorTextFocus,primary:3165,weight:100}})}run(e,t){Ek.get(t)?.jumpToBracket()}}),Hu(class extends Pu{constructor(){super({id:"editor.action.removeBrackets",label:x(805,"Remove Brackets"),precondition:void 0,kbOpts:{kbExpr:Xu.editorTextFocus,primary:2561,weight:100}})}run(e,t){Ek.get(t)?.removeBrackets(this.id)}}),fu.appendMenuItem(gu.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:y(801,"Go to &&Bracket")},order:2});const Nk=new class{constructor(){this._inputMode="insert",this._onDidChangeInputMode=new Zt,this.onDidChangeInputMode=this._onDidChangeInputMode.event}getInputMode(){return this._inputMode}},Ik=()=>!0,Tk=()=>!1,Mk=e=>" "===e||"\t"===e;class Ak{static shouldRecreate(e){return e.hasChanged(165)||e.hasChanged(148)||e.hasChanged(45)||e.hasChanged(85)||e.hasChanged(88)||e.hasChanged(89)||e.hasChanged(10)||e.hasChanged(11)||e.hasChanged(15)||e.hasChanged(13)||e.hasChanged(14)||e.hasChanged(20)||e.hasChanged(145)||e.hasChanged(141)||e.hasChanged(59)||e.hasChanged(104)||e.hasChanged(147)||e.hasChanged(93)}constructor(e,t,i,n){this.languageConfigurationService=n,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const o=i.options,s=o.get(165),r=o.get(59);this.readOnly=o.get(104),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=o.get(132),this.lineHeight=r.lineHeight,this.typicalHalfwidthCharacterWidth=r.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(s.height/this.lineHeight)-2),this.useTabStops=o.get(145),this.trimWhitespaceOnDelete=o.get(141),this.wordSeparators=o.get(148),this.emptySelectionClipboard=o.get(45),this.copyWithSyntaxHighlighting=o.get(31),this.multiCursorMergeOverlapping=o.get(85),this.multiCursorPaste=o.get(88),this.multiCursorLimit=o.get(89),this.autoClosingBrackets=o.get(10),this.autoClosingComments=o.get(11),this.autoClosingQuotes=o.get(15),this.autoClosingDelete=o.get(13),this.autoClosingOvertype=o.get(14),this.autoSurround=o.get(20),this.autoIndent=o.get(16),this.wordSegmenterLocales=o.get(147),this.overtypeOnPaste=o.get(93),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const a=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(a)for(const e of a)this.surroundingPairs[e.open]=e.close;const l=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=l?.blockCommentStartToken??null}get electricChars(){if(!this._electricChars){this._electricChars={};const e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter?.getElectricCharacters();if(e)for(const t of e)this._electricChars[t]=!0}return this._electricChars}get inputMode(){return Nk.getInputMode()}onElectricCharacter(e,t,i){const n=Kg(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return o?o.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return Ng(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return Mk;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return Ik;case"never":return Tk}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return e=>-1!==i.indexOf(e)}visibleColumnFromColumn(e,t){return Eg.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const n=Eg.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(n<o)return o;const s=e.getLineMaxColumn(t);return n>s?s:n}}class Rk{static fromModelState(e){return new Ok(e)}static fromViewState(e){return new Pk(e)}static fromModelSelection(e){const t=Qu.liftSelection(e),i=new Fk(Yu.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return Rk.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this.fromModelSelection(e[i]);return t}constructor(e,t){this._cursorStateBrand=void 0,this.modelState=e,this.viewState=t}equals(e){return this.viewState.equals(e.viewState)&&this.modelState.equals(e.modelState)}}class Ok{constructor(e){this.modelState=e,this.viewState=null}}class Pk{constructor(e){this.modelState=null,this.viewState=e}}class Fk{constructor(e,t,i,n,o){this.selectionStart=e,this.selectionStartKind=t,this.selectionStartLeftoverVisibleColumns=i,this.position=n,this.leftoverVisibleColumns=o,this._singleCursorStateBrand=void 0,this.selection=Fk._computeSelection(this.selectionStart,this.position)}equals(e){return this.selectionStartLeftoverVisibleColumns===e.selectionStartLeftoverVisibleColumns&&this.leftoverVisibleColumns===e.leftoverVisibleColumns&&this.selectionStartKind===e.selectionStartKind&&this.position.equals(e.position)&&this.selectionStart.equalsRange(e.selectionStart)}hasSelection(){return!this.selection.isEmpty()||!this.selectionStart.isEmpty()}move(e,t,i,n){return e?new Fk(this.selectionStart,this.selectionStartKind,this.selectionStartLeftoverVisibleColumns,new rc(t,i),n):new Fk(new Yu(t,i,t,i),0,n,new rc(t,i),n)}static _computeSelection(e,t){return e.isEmpty()||!t.isBeforeOrEqual(e.getStartPosition())?Qu.fromPositions(e.getStartPosition(),t):Qu.fromPositions(e.getEndPosition(),t)}}class Bk{constructor(e,t,i){this._editOperationResultBrand=void 0,this.type=e,this.commands=t,this.shouldPushStackElementBefore=i.shouldPushStackElementBefore,this.shouldPushStackElementAfter=i.shouldPushStackElementAfter}}function Wk(e){return"'"===e||'"'===e||"`"===e}class Vk{static columnSelect(e,t,i,n,o,s){const r=Math.abs(o-i)+1,a=i>o,l=n>s,d=n<s,h=[];for(let o=0;o<r;o++){const r=i+(a?-o:o),c=e.columnFromVisibleColumn(t,r,n),u=e.columnFromVisibleColumn(t,r,s),g=e.visibleColumnFromColumn(t,new rc(r,c)),p=e.visibleColumnFromColumn(t,new rc(r,u));if(d){if(g>s)continue;if(p<n)continue}if(l){if(p>n)continue;if(g<s)continue}h.push(new Fk(new Yu(r,c,r,c),0,0,new rc(r,u),0))}if(0===h.length)for(let e=0;e<r;e++){const n=i+(a?-e:e),o=t.getLineMaxColumn(n);h.push(new Fk(new Yu(n,o,n,o),0,0,new rc(n,o),0))}return{viewStates:h,reversed:a,fromLineNumber:i,fromVisualColumn:n,toLineNumber:o,toVisualColumn:s}}static columnSelectLeft(e,t,i){let n=i.toViewVisualColumn;return n>0&&n--,Vk.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,i){let n=0;const o=Math.min(i.fromViewLineNumber,i.toViewLineNumber),s=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let i=o;i<=s;i++){const o=t.getLineMaxColumn(i),s=e.visibleColumnFromColumn(t,new rc(i,o));n=Math.max(n,s)}let r=i.toViewVisualColumn;return r<n&&r++,this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,r)}static columnSelectUp(e,t,i,n){const o=n?e.pageSize:1,s=Math.max(1,i.toViewLineNumber-o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,s,i.toViewVisualColumn)}static columnSelectDown(e,t,i,n){const o=n?e.pageSize:1,s=Math.min(t.getLineCount(),i.toViewLineNumber+o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,s,i.toViewVisualColumn)}}class Hk{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return Qu.fromPositions(i.getEndPosition())}}class zk{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){const i=this._range.getStartPosition(),n=this._range.getEndPosition(),o=n.lineNumber;let s=Gk(e,n,this._text.length+(this._range.isEmpty()?0:-1));s.lineNumber>o&&(s=new rc(o,e.getLineMaxColumn(o)));const r=Yu.fromPositions(i,s);t.addTrackedEditOperation(r,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return Qu.fromPositions(i.getEndPosition())}}class Uk{constructor(e,t){this._range=e,this._text=t}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return Qu.fromRange(i,0)}}class Kk{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return Qu.fromPositions(i.getStartPosition())}}class jk{constructor(e,t,i,n,o=!1){this._range=e,this._text=t,this._columnDeltaOffset=n,this._lineNumberDeltaOffset=i,this.insertsAutoWhitespace=o}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return Qu.fromPositions(i.getEndPosition().delta(this._lineNumberDeltaOffset,this._columnDeltaOffset))}}class qk{constructor(e){this._range=e}getEditOperations(e,t){const i=e.getValueInRange(this._range),n=this._range.getEndPosition(),o=n.lineNumber;let s=Gk(e,n,i.length);s.lineNumber>o&&(s=new rc(o,e.getLineMaxColumn(o)));const r=Yu.fromPositions(n,s);t.addTrackedEditOperation(r,"")}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return Qu.fromPositions(i.getEndPosition())}}class $k{constructor(e,t,i,n=!1){this._range=e,this._text=t,this._initialSelection=i,this._forceMoveMarkers=n,this._selectionId=null}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text,this._forceMoveMarkers),this._selectionId=t.trackSelection(this._initialSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}function Gk(e,t,i){if(i<0)throw new Error("Unexpected negative delta");const n=e.getLineCount();let o=new rc(n,e.getLineMaxColumn(n));for(let s=t.lineNumber;s<=n;s++)if(s===t.lineNumber){const n=i-e.getLineMaxColumn(t.lineNumber)+t.column;if(n<=0){o=new rc(t.lineNumber,t.column+i);break}i=n}else{const t=i-e.getLineMaxColumn(s);if(t<=0){o=new rc(s,i);break}i=t}return o}class Zk{static whitespaceVisibleColumn(e,t,i){const n=e.length;let o=0,s=-1,r=-1;for(let a=0;a<n;a++){if(a===t)return[s,r,o];switch(o%i==0&&(s=a,r=o),e.charCodeAt(a)){case 32:o+=1;break;case 9:o=Eg.nextRenderTabStop(o,i);break;default:return[-1,-1,-1]}}return t===n?[s,r,o]:[-1,-1,-1]}static atomicPosition(e,t,i,n){const o=e.length,[s,r,a]=Zk.whitespaceVisibleColumn(e,t,i);if(-1===a)return-1;let l;switch(n){case 0:l=!0;break;case 1:l=!1;break;case 2:if(a%i==0)return t;l=a%i<=i/2}if(l){if(-1===s)return-1;let t=r;for(let n=s;n<o;++n){if(t===r+i)return s;switch(e.charCodeAt(n)){case 32:t+=1;break;case 9:t=Eg.nextRenderTabStop(t,i);break;default:return-1}}return t===r+i?s:-1}const d=Eg.nextRenderTabStop(a,i);let h=a;for(let n=t;n<o;n++){if(h===d)return n;switch(e.charCodeAt(n)){case 32:h+=1;break;case 9:h=Eg.nextRenderTabStop(h,i);break;default:return-1}}return h===d?o:-1}}class Yk{constructor(e,t,i){this._cursorPositionBrand=void 0,this.lineNumber=e,this.column=t,this.leftoverVisibleColumns=i}}class Qk{static leftPosition(e,t){if(t.column>e.getLineMinColumn(t.lineNumber))return t.delta(void 0,-mn(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new rc(i,e.getLineMaxColumn(i))}return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const n=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),s=Zk.atomicPosition(o,t.column-1,i,0);if(-1!==s&&s+1>=n)return new rc(t.lineNumber,s+1)}return this.leftPosition(e,t)}static left(e,t,i){const n=e.stickyTabStops?Qk.leftPositionAtomicSoftTabs(t,i,e.tabSize):Qk.leftPosition(t,i);return new Yk(n.lineNumber,n.column,0)}static moveLeft(e,t,i,n,o){let s,r;if(i.hasSelection()&&!n)s=i.selection.startLineNumber,r=i.selection.startColumn;else{const n=i.position.delta(void 0,-(o-1)),a=t.normalizePosition(Qk.clipPositionColumn(n,t),0),l=Qk.left(e,t,a);s=l.lineNumber,r=l.column}return i.move(n,s,r,0)}static clipPositionColumn(e,t){return new rc(e.lineNumber,Qk.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return e<t?t:e>i?i:e}static rightPosition(e,t,i){return i<e.getLineMaxColumn(t)?i+=pn(e.getLineContent(t),i-1):t<e.getLineCount()&&(t+=1,i=e.getLineMinColumn(t)),new rc(t,i)}static rightPositionAtomicSoftTabs(e,t,i,n,o){if(i<e.getLineIndentColumn(t)){const o=e.getLineContent(t),s=Zk.atomicPosition(o,i-1,n,1);if(-1!==s)return new rc(t,s+1)}return this.rightPosition(e,t,i)}static right(e,t,i){const n=e.stickyTabStops?Qk.rightPositionAtomicSoftTabs(t,i.lineNumber,i.column,e.tabSize,e.indentSize):Qk.rightPosition(t,i.lineNumber,i.column);return new Yk(n.lineNumber,n.column,0)}static moveRight(e,t,i,n,o){let s,r;if(i.hasSelection()&&!n)s=i.selection.endLineNumber,r=i.selection.endColumn;else{const n=i.position.delta(void 0,o-1),a=t.normalizePosition(Qk.clipPositionColumn(n,t),1),l=Qk.right(e,t,a);s=l.lineNumber,r=l.column}return i.move(n,s,r,0)}static vertical(e,t,i,n,o,s,r,a){const l=Eg.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize)+o,d=t.getLineCount(),h=1===i&&1===n,c=i===d&&n===t.getLineMaxColumn(i),u=s<i?h:c;if((i=s)<1?(i=1,n=r?t.getLineMinColumn(i):Math.min(t.getLineMaxColumn(i),n)):i>d?(i=d,n=r?t.getLineMaxColumn(i):Math.min(t.getLineMaxColumn(i),n)):n=e.columnFromVisibleColumn(t,i,l),o=u?0:l-Eg.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),void 0!==a){const e=new rc(i,n),s=t.normalizePosition(e,a);o+=n-s.column,i=s.lineNumber,n=s.column}return new Yk(i,n,o)}static down(e,t,i,n,o,s,r){return this.vertical(e,t,i,n,o,i+s,r,4)}static moveDown(e,t,i,n,o){let s,r;i.hasSelection()&&!n?(s=i.selection.endLineNumber,r=i.selection.endColumn):(s=i.position.lineNumber,r=i.position.column);let a,l=0;do{if(a=Qk.down(e,t,s+l,r,i.leftoverVisibleColumns,o,!0),t.normalizePosition(new rc(a.lineNumber,a.column),2).lineNumber>s)break}while(l++<10&&s+l<t.getLineCount());return i.move(n,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateDown(e,t,i){const n=i.selection,o=Qk.down(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=Qk.down(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new Fk(new Yu(o.lineNumber,o.column,o.lineNumber,o.column),0,o.leftoverVisibleColumns,new rc(s.lineNumber,s.column),s.leftoverVisibleColumns)}static up(e,t,i,n,o,s,r){return this.vertical(e,t,i,n,o,i-s,r,3)}static moveUp(e,t,i,n,o){let s,r;i.hasSelection()&&!n?(s=i.selection.startLineNumber,r=i.selection.startColumn):(s=i.position.lineNumber,r=i.position.column);const a=Qk.up(e,t,s,r,i.leftoverVisibleColumns,o,!0);return i.move(n,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateUp(e,t,i){const n=i.selection,o=Qk.up(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=Qk.up(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new Fk(new Yu(o.lineNumber,o.column,o.lineNumber,o.column),0,o.leftoverVisibleColumns,new rc(s.lineNumber,s.column),s.leftoverVisibleColumns)}static _isBlankLine(e,t){return 0===e.getLineFirstNonWhitespaceColumn(t)}static moveToPrevBlankLine(e,t,i,n){let o=i.position.lineNumber;for(;o>1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return i.move(n,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,n){const o=t.getLineCount();let s=i.position.lineNumber;for(;s<o&&this._isBlankLine(t,s);)s++;for(;s<o&&!this._isBlankLine(t,s);)s++;return i.move(n,s,t.getLineMinColumn(s),0)}static moveToBeginningOfLine(e,t,i,n){const o=i.position.lineNumber,s=t.getLineMinColumn(o),r=t.getLineFirstNonWhitespaceColumn(o)||s;let a;return a=i.position.column===r?s:r,i.move(n,o,a,0)}static moveToEndOfLine(e,t,i,n,o){const s=i.position.lineNumber,r=t.getLineMaxColumn(s);return i.move(n,s,r,o?1073741824-r:0)}static moveToBeginningOfBuffer(e,t,i,n){return i.move(n,1,1,0)}static moveToEndOfBuffer(e,t,i,n){const o=t.getLineCount(),s=t.getLineMaxColumn(o);return i.move(n,o,s,0)}}class Xk{static deleteRight(e,t,i,n){const o=[];let s=3!==e;for(let e=0,r=n.length;e<r;e++){const r=n[e],a=this.getDeleteRightRange(r,i,t);a.isEmpty()?o[e]=null:(a.startLineNumber!==a.endLineNumber&&(s=!0),o[e]=new Hk(a,""))}return[s,o]}static getDeleteRightRange(e,t,i){if(!e.isEmpty())return e;const n=e.getPosition(),o=Qk.right(i,t,n);if(i.trimWhitespaceOnDelete&&o.lineNumber!==n.lineNumber){const e=t.getLineFirstNonWhitespaceColumn(n.lineNumber)>0,i=t.getLineFirstNonWhitespaceColumn(o.lineNumber);if(e&&i>0)return new Yu(o.lineNumber,i,n.lineNumber,n.column)}return new Yu(o.lineNumber,o.column,n.lineNumber,n.column)}static isAutoClosingPairDelete(e,t,i,n,o,s,r){if("never"===t&&"never"===i)return!1;if("never"===e)return!1;for(let a=0,l=s.length;a<l;a++){const l=s[a],d=l.getPosition();if(!l.isEmpty())return!1;const h=o.getLineContent(d.lineNumber);if(d.column<2||d.column>=h.length+1)return!1;const c=h.charAt(d.column-2),u=n.get(c);if(!u)return!1;if(Wk(c)){if("never"===i)return!1}else if("never"===t)return!1;const g=h.charAt(d.column-1);let p=!1;for(const e of u)e.open===c&&e.close===g&&(p=!0);if(!p)return!1;if("auto"===e){let e=!1;for(let t=0,i=r.length;t<i;t++){const i=r[t];if(d.lineNumber===i.startLineNumber&&d.column===i.startColumn){e=!0;break}}if(!e)return!1}}return!0}static _runAutoClosingPairDelete(e,t,i){const n=[];for(let e=0,t=i.length;e<t;e++){const t=i[e].getPosition(),o=new Yu(t.lineNumber,t.column-1,t.lineNumber,t.column+1);n[e]=new Hk(o,"")}return[!0,n]}static deleteLeft(e,t,i,n,o){if(this.isAutoClosingPairDelete(t.autoClosingDelete,t.autoClosingBrackets,t.autoClosingQuotes,t.autoClosingPairs.autoClosingPairsOpenByEnd,i,n,o))return this._runAutoClosingPairDelete(t,i,n);const s=[];let r=2!==e;for(let e=0,o=n.length;e<o;e++){const o=Xk.getDeleteLeftRange(n[e],i,t);o.isEmpty()?s[e]=null:(o.startLineNumber!==o.endLineNumber&&(r=!0),s[e]=new Hk(o,""))}return[r,s]}static getDeleteLeftRange(e,t,i){if(!e.isEmpty())return e;const n=e.getPosition();if(i.useTabStops&&n.column>1){const e=t.getLineContent(n.lineNumber),o=$i(e),s=-1===o?e.length+1:o+1;if(n.column<=s){const e=i.visibleColumnFromColumn(t,n),o=Eg.prevIndentTabStop(e,i.indentSize),s=i.columnFromVisibleColumn(t,n.lineNumber,o);return new Yu(n.lineNumber,s,n.lineNumber,n.column)}}return Yu.fromPositions(Xk.getPositionAfterDeleteLeft(n,t),n)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=function(e,t){if(0===e)return 0;const i=function(e,t){const i=new un(t,e);let n=i.prevCodePoint();for(;Nn(n)||65039===n||8419===n;){if(0===i.offset)return;n=i.prevCodePoint()}if(!Sn(n))return;let o=i.offset;return o>0&&8205===i.prevCodePoint()&&(o=i.offset),o}(e,t);if(void 0!==i)return i;const n=new un(t,e);return n.prevCodePoint(),n.offset}(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}if(e.lineNumber>1){const i=e.lineNumber-1;return new rc(i,t.getLineMaxColumn(i))}return e}static cut(e,t,i){const n=[];let o=null;i.sort(((e,t)=>rc.compare(e.getStartPosition(),t.getEndPosition())));for(let s=0,r=i.length;s<r;s++){const r=i[s];if(r.isEmpty())if(e.emptySelectionClipboard){const e=r.getPosition();let i,a,l,d;e.lineNumber<t.getLineCount()?(i=e.lineNumber,a=1,l=e.lineNumber+1,d=1):e.lineNumber>1&&o?.endLineNumber!==e.lineNumber?(i=e.lineNumber-1,a=t.getLineMaxColumn(e.lineNumber-1),l=e.lineNumber,d=t.getLineMaxColumn(e.lineNumber)):(i=e.lineNumber,a=1,l=e.lineNumber,d=t.getLineMaxColumn(e.lineNumber));const h=new Yu(i,a,l,d);o=h,h.isEmpty()?n[s]=null:n[s]=new Hk(h,"")}else n[s]=null;else n[s]=new Hk(r,"")}return new Bk(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class Jk{static _createWord(e,t,i,n,o){return{start:n,end:o,wordType:t,nextCharClass:i}}static _createIntlWord(e,t){return{start:e.index,end:e.index+e.segment.length,wordType:1,nextCharClass:t}}static _findPreviousWordOnLine(e,t,i){const n=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(n,e,i)}static _doFindPreviousWordOnLine(e,t,i){let n=0;const o=t.findPrevIntlWordBeforeOrAtOffset(e,i.column-2);for(let s=i.column-2;s>=0;s--){const i=e.charCodeAt(s),r=t.get(i);if(o&&s===o.index)return this._createIntlWord(o,r);if(0===r){if(2===n)return this._createWord(e,n,r,s+1,this._findEndOfWord(e,t,n,s+1));n=1}else if(2===r){if(1===n)return this._createWord(e,n,r,s+1,this._findEndOfWord(e,t,n,s+1));n=2}else if(1===r&&0!==n)return this._createWord(e,n,r,s+1,this._findEndOfWord(e,t,n,s+1))}return 0!==n?this._createWord(e,n,1,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){const o=t.findNextIntlWordAtOrAfterOffset(e,n),s=e.length;for(let r=n;r<s;r++){const n=e.charCodeAt(r),s=t.get(n);if(o&&r===o.index+o.segment.length)return r;if(1===s)return r;if(1===i&&2===s)return r;if(2===i&&0===s)return r}return s}static _findNextWordOnLine(e,t,i){const n=t.getLineContent(i.lineNumber);return this._doFindNextWordOnLine(n,e,i)}static _doFindNextWordOnLine(e,t,i){let n=0;const o=e.length,s=t.findNextIntlWordAtOrAfterOffset(e,i.column-1);for(let r=i.column-1;r<o;r++){const i=e.charCodeAt(r),o=t.get(i);if(s&&r===s.index)return this._createIntlWord(s,o);if(0===o){if(2===n)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,r-1),r);n=1}else if(2===o){if(1===n)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,r-1),r);n=2}else if(1===o&&0!==n)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,r-1),r)}return 0!==n?this._createWord(e,n,1,this._findStartOfWord(e,t,n,o-1),o):null}static _findStartOfWord(e,t,i,n){const o=t.findPrevIntlWordBeforeOrAtOffset(e,n);for(let s=n;s>=0;s--){const n=e.charCodeAt(s),r=t.get(n);if(o&&s===o.index)return s;if(1===r)return s+1;if(1===i&&2===r)return s+1;if(2===i&&0===r)return s+1}return 0}static moveWordLeft(e,t,i,n,o){let s=i.lineNumber,r=i.column;1===r&&s>1&&(s-=1,r=t.getLineMaxColumn(s));let a=Jk._findPreviousWordOnLine(e,t,new rc(s,r));if(0===n)return new rc(s,a?a.start+1:1);if(1===n)return!o&&a&&2===a.wordType&&a.end-a.start==1&&0===a.nextCharClass&&(a=Jk._findPreviousWordOnLine(e,t,new rc(s,a.start+1))),new rc(s,a?a.start+1:1);if(3===n){for(;a&&2===a.wordType;)a=Jk._findPreviousWordOnLine(e,t,new rc(s,a.start+1));return new rc(s,a?a.start+1:1)}return a&&r<=a.end+1&&(a=Jk._findPreviousWordOnLine(e,t,new rc(s,a.start+1))),new rc(s,a?a.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(1===t.column)return i>1?new rc(i-1,e.getLineMaxColumn(i-1)):t;const o=e.getLineContent(i);for(let e=t.column-1;e>1;e--){const t=o.charCodeAt(e-2),s=o.charCodeAt(e-1);if(95===t&&95!==s)return new rc(i,e);if(45===t&&45!==s)return new rc(i,e);if((tn(t)||en(t))&&nn(s))return new rc(i,e);if(nn(t)&&nn(s)&&e+1<n){const t=o.charCodeAt(e);if(tn(t)||en(t))return new rc(i,e)}}return new rc(i,1)}static moveWordRight(e,t,i,n){let o=i.lineNumber,s=i.column,r=!1;s===t.getLineMaxColumn(o)&&o<t.getLineCount()&&(r=!0,o+=1,s=1);let a=Jk._findNextWordOnLine(e,t,new rc(o,s));if(2===n)a&&2===a.wordType&&a.end-a.start==1&&0===a.nextCharClass&&(a=Jk._findNextWordOnLine(e,t,new rc(o,a.end+1))),s=a?a.end+1:t.getLineMaxColumn(o);else if(3===n){for(r&&(s=0);a&&(2===a.wordType||a.start+1<=s);)a=Jk._findNextWordOnLine(e,t,new rc(o,a.end+1));s=a?a.start+1:t.getLineMaxColumn(o)}else a&&!r&&s>=a.start+1&&(a=Jk._findNextWordOnLine(e,t,new rc(o,a.end+1))),s=a?a.start+1:t.getLineMaxColumn(o);return new rc(o,s)}static _moveWordPartRight(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===n)return i<e.getLineCount()?new rc(i+1,1):t;const o=e.getLineContent(i);for(let e=t.column+1;e<n;e++){const t=o.charCodeAt(e-2),s=o.charCodeAt(e-1);if(95!==t&&95===s)return new rc(i,e);if(45!==t&&45===s)return new rc(i,e);if((tn(t)||en(t))&&nn(s))return new rc(i,e);if(nn(t)&&nn(s)&&e+1<n){const t=o.charCodeAt(e);if(tn(t)||en(t))return new rc(i,e)}}return new rc(i,n)}static _deleteWordLeftWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=t.column-2,o=Zi(i,n);return o+1<n?new Yu(t.lineNumber,o+2,t.lineNumber,t.column):null}static deleteWordLeft(e,t){const i=e.wordSeparators,n=e.model,o=e.selection,s=e.whitespaceHeuristics;if(!o.isEmpty())return o;if(Xk.isAutoClosingPairDelete(e.autoClosingDelete,e.autoClosingBrackets,e.autoClosingQuotes,e.autoClosingPairs.autoClosingPairsOpenByEnd,e.model,[e.selection],e.autoClosedCharacters)){const t=e.selection.getPosition();return new Yu(t.lineNumber,t.column-1,t.lineNumber,t.column+1)}const r=new rc(o.positionLineNumber,o.positionColumn);let a=r.lineNumber,l=r.column;if(1===a&&1===l)return null;if(s){const e=this._deleteWordLeftWhitespace(n,r);if(e)return e}let d=Jk._findPreviousWordOnLine(i,n,r);return 0===t?d?l=d.start+1:l>1?l=1:(a--,l=n.getLineMaxColumn(a)):(d&&l<=d.end+1&&(d=Jk._findPreviousWordOnLine(i,n,new rc(a,d.start+1))),d?l=d.end+1:l>1?l=1:(a--,l=n.getLineMaxColumn(a))),new Yu(a,l,r.lineNumber,r.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const n=new rc(i.positionLineNumber,i.positionColumn);return this._deleteInsideWordWhitespace(t,n)||this._deleteInsideWordDetermineDeleteRange(e,t,n)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return 32===i||9===i}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=i.length;if(0===n)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let s=Math.min(t.column-1,n-1);if(!this._charAtIsWhitespace(i,s))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;s+1<n&&this._charAtIsWhitespace(i,s+1);)s++;return new Yu(t.lineNumber,o+1,t.lineNumber,s+2)}static _deleteInsideWordDetermineDeleteRange(e,t,i){const n=t.getLineContent(i.lineNumber),o=n.length;if(0===o)return i.lineNumber>1?new Yu(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumber<t.getLineCount()?new Yu(i.lineNumber,1,i.lineNumber+1,1):new Yu(i.lineNumber,1,i.lineNumber,1);const s=e=>e.start+1<=i.column&&i.column<=e.end+1,r=(e,t)=>(e=Math.min(e,i.column),t=Math.max(t,i.column),new Yu(i.lineNumber,e,i.lineNumber,t)),a=e=>{let t=e.start+1,i=e.end+1,s=!1;for(;i-1<o&&this._charAtIsWhitespace(n,i-1);)s=!0,i++;if(!s)for(;t>1&&this._charAtIsWhitespace(n,t-2);)t--;return r(t,i)},l=Jk._findPreviousWordOnLine(e,t,i);if(l&&s(l))return a(l);const d=Jk._findNextWordOnLine(e,t,i);return d&&s(d)?a(d):l&&d?r(l.end+1,d.start+1):l?r(l.start+1,l.end+1):d?r(d.start+1,d.end+1):r(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=Jk._moveWordPartLeft(e,i);return new Yu(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let n=t;n<i;n++){const t=e.charAt(n);if(" "!==t&&"\t"!==t)return n}return i}static _deleteWordRightWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=t.column-1,o=this._findFirstNonWhitespaceChar(i,n);return n+1<o?new Yu(t.lineNumber,t.column,t.lineNumber,o+1):null}static deleteWordRight(e,t){const i=e.wordSeparators,n=e.model,o=e.selection,s=e.whitespaceHeuristics;if(!o.isEmpty())return o;const r=new rc(o.positionLineNumber,o.positionColumn);let a=r.lineNumber,l=r.column;const d=n.getLineCount(),h=n.getLineMaxColumn(a);if(a===d&&l===h)return null;if(s){const e=this._deleteWordRightWhitespace(n,r);if(e)return e}let c=Jk._findNextWordOnLine(i,n,r);return 2===t?c?l=c.end+1:l<h||a===d?l=h:(a++,c=Jk._findNextWordOnLine(i,n,new rc(a,1)),l=c?c.start+1:n.getLineMaxColumn(a)):(c&&l>=c.start+1&&(c=Jk._findNextWordOnLine(i,n,new rc(a,c.end+1))),c?l=c.start+1:l<h||a===d?l=h:(a++,c=Jk._findNextWordOnLine(i,n,new rc(a,1)),l=c?c.start+1:n.getLineMaxColumn(a))),new Yu(a,l,r.lineNumber,r.column)}static _deleteWordPartRight(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=Jk._moveWordPartRight(e,i);return new Yu(i.lineNumber,i.column,n.lineNumber,n.column)}static _createWordAtPosition(e,t,i){const n=new Yu(t,i.start+1,t,i.end+1);return{word:e.getValueInRange(n),startColumn:n.startColumn,endColumn:n.endColumn}}static getWordAtPosition(e,t,i,n){const o=qy(t,i),s=Jk._findPreviousWordOnLine(o,e,n);if(s&&1===s.wordType&&s.start<=n.column-1&&n.column-1<=s.end)return Jk._createWordAtPosition(e,n.lineNumber,s);const r=Jk._findNextWordOnLine(o,e,n);return r&&1===r.wordType&&r.start<=n.column-1&&n.column-1<=r.end?Jk._createWordAtPosition(e,n.lineNumber,r):null}static word(e,t,i,n,o){const s=qy(e.wordSeparators,e.wordSegmenterLocales),r=Jk._findPreviousWordOnLine(s,t,o),a=Jk._findNextWordOnLine(s,t,o);if(!n){let e,i;return r&&1===r.wordType&&r.start<=o.column-1&&o.column-1<=r.end?(e=r.start+1,i=r.end+1):a&&1===a.wordType&&a.start<=o.column-1&&o.column-1<=a.end?(e=a.start+1,i=a.end+1):(e=r?r.end+1:1,i=a?a.start+1:t.getLineMaxColumn(o.lineNumber)),new Fk(new Yu(o.lineNumber,e,o.lineNumber,i),1,0,new rc(o.lineNumber,i),0)}let l,d;r&&1===r.wordType&&r.start<o.column-1&&o.column-1<r.end?(l=r.start+1,d=r.end+1):a&&1===a.wordType&&a.start<o.column-1&&o.column-1<a.end?(l=a.start+1,d=a.end+1):(l=o.column,d=o.column);const h=o.lineNumber;let c;if(i.selectionStart.containsPosition(o))c=i.selectionStart.endColumn;else if(o.isBeforeOrEqual(i.selectionStart.getStartPosition())){c=l;const e=new rc(h,c);i.selectionStart.containsPosition(e)&&(c=i.selectionStart.endColumn)}else{c=d;const e=new rc(h,c);i.selectionStart.containsPosition(e)&&(c=i.selectionStart.startColumn)}return i.move(!0,h,c,0)}}class eL extends Jk{static deleteWordPartLeft(e){const t=tL([Jk.deleteWordLeft(e,0),Jk.deleteWordLeft(e,2),Jk._deleteWordPartLeft(e.model,e.selection)]);return t.sort(Yu.compareRangesUsingEnds),t[2]}static deleteWordPartRight(e){const t=tL([Jk.deleteWordRight(e,0),Jk.deleteWordRight(e,2),Jk._deleteWordPartRight(e.model,e.selection)]);return t.sort(Yu.compareRangesUsingStarts),t[0]}static moveWordPartLeft(e,t,i,n){const o=tL([Jk.moveWordLeft(e,t,i,0,n),Jk.moveWordLeft(e,t,i,2,n),Jk._moveWordPartLeft(t,i)]);return o.sort(rc.compare),o[2]}static moveWordPartRight(e,t,i){const n=tL([Jk.moveWordRight(e,t,i,0),Jk.moveWordRight(e,t,i,2),Jk._moveWordPartRight(t,i)]);return n.sort(rc.compare),n[0]}}function tL(e){return e.filter((e=>Boolean(e)))}class iL{static addCursorDown(e,t,i){const n=[];let o=0;for(let s=0,r=t.length;s<r;s++){const r=t[s];n[o++]=new Rk(r.modelState,r.viewState),n[o++]=i?Rk.fromModelState(Qk.translateDown(e.cursorConfig,e.model,r.modelState)):Rk.fromViewState(Qk.translateDown(e.cursorConfig,e,r.viewState))}return n}static addCursorUp(e,t,i){const n=[];let o=0;for(let s=0,r=t.length;s<r;s++){const r=t[s];n[o++]=new Rk(r.modelState,r.viewState),n[o++]=i?Rk.fromModelState(Qk.translateUp(e.cursorConfig,e.model,r.modelState)):Rk.fromViewState(Qk.translateUp(e.cursorConfig,e,r.viewState))}return n}static moveToBeginningOfLine(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o];n[o]=this._moveToLineStart(e,s,i)}return n}static _moveToLineStart(e,t,i){const n=t.viewState.position.column,o=n===t.modelState.position.column,s=t.viewState.position.lineNumber,r=e.getLineFirstNonWhitespaceColumn(s);return o||n===r?this._moveToLineStartByModel(e,t,i):this._moveToLineStartByView(e,t,i)}static _moveToLineStartByView(e,t,i){return Rk.fromViewState(Qk.moveToBeginningOfLine(e.cursorConfig,e,t.viewState,i))}static _moveToLineStartByModel(e,t,i){return Rk.fromModelState(Qk.moveToBeginningOfLine(e.cursorConfig,e.model,t.modelState,i))}static moveToEndOfLine(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=this._moveToLineEnd(e,r,i,n)}return o}static _moveToLineEnd(e,t,i,n){const o=t.viewState.position,s=e.getLineMaxColumn(o.lineNumber),r=o.column===s,a=t.modelState.position,l=e.model.getLineMaxColumn(a.lineNumber),d=s-o.column==l-a.column;return r||d?this._moveToLineEndByModel(e,t,i,n):this._moveToLineEndByView(e,t,i,n)}static _moveToLineEndByView(e,t,i,n){return Rk.fromViewState(Qk.moveToEndOfLine(e.cursorConfig,e,t.viewState,i,n))}static _moveToLineEndByModel(e,t,i,n){return Rk.fromModelState(Qk.moveToEndOfLine(e.cursorConfig,e.model,t.modelState,i,n))}static expandLineSelection(e,t){const i=[];for(let n=0,o=t.length;n<o;n++){const o=t[n],s=o.modelState.selection.startLineNumber,r=e.model.getLineCount();let a,l=o.modelState.selection.endLineNumber;l===r?a=e.model.getLineMaxColumn(r):(l++,a=1),i[n]=Rk.fromModelState(new Fk(new Yu(s,1,s,1),0,0,new rc(l,a),0))}return i}static moveToBeginningOfBuffer(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o];n[o]=Rk.fromModelState(Qk.moveToBeginningOfBuffer(e.cursorConfig,e.model,s.modelState,i))}return n}static moveToEndOfBuffer(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o];n[o]=Rk.fromModelState(Qk.moveToEndOfBuffer(e.cursorConfig,e.model,s.modelState,i))}return n}static selectAll(e,t){const i=e.model.getLineCount(),n=e.model.getLineMaxColumn(i);return Rk.fromModelState(new Fk(new Yu(1,1,1,1),0,0,new rc(i,n),0))}static line(e,t,i,n,o){const s=e.model.validatePosition(n),r=o?e.coordinatesConverter.validateViewPosition(new rc(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);if(!i){const t=e.model.getLineCount();let i=s.lineNumber+1,n=1;return i>t&&(i=t,n=e.model.getLineMaxColumn(i)),Rk.fromModelState(new Fk(new Yu(s.lineNumber,1,i,n),2,0,new rc(i,n),0))}const a=t.modelState.selectionStart.getStartPosition().lineNumber;if(s.lineNumber<a)return Rk.fromViewState(t.viewState.move(!0,r.lineNumber,1,0));if(s.lineNumber>a){const i=e.getLineCount();let n=r.lineNumber+1,o=1;return n>i&&(n=i,o=e.getLineMaxColumn(n)),Rk.fromViewState(t.viewState.move(!0,n,o,0))}{const e=t.modelState.selectionStart.getEndPosition();return Rk.fromModelState(t.modelState.move(!0,e.lineNumber,e.column,0))}}static word(e,t,i,n){const o=e.model.validatePosition(n);return Rk.fromModelState(Jk.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new Rk(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return Rk.fromViewState(new Fk(new Yu(i,n,i,n),0,0,new rc(i,n),0))}static moveTo(e,t,i,n,o){if(i){if(1===t.modelState.selectionStartKind)return this.word(e,t,i,n);if(2===t.modelState.selectionStartKind)return this.line(e,t,i,n,o)}const s=e.model.validatePosition(n),r=o?e.coordinatesConverter.validateViewPosition(new rc(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);return Rk.fromViewState(t.viewState.move(i,r.lineNumber,r.column,0))}static simpleMove(e,t,i,n,o,s){switch(i){case 0:return 4===s?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,o);case 1:return 4===s?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,o);case 2:return 2===s?this._moveUpByViewLines(e,t,n,o):this._moveUpByModelLines(e,t,n,o);case 3:return 2===s?this._moveDownByViewLines(e,t,n,o):this._moveDownByModelLines(e,t,n,o);case 4:return 2===s?t.map((t=>Rk.fromViewState(Qk.moveToPrevBlankLine(e.cursorConfig,e,t.viewState,n)))):t.map((t=>Rk.fromModelState(Qk.moveToPrevBlankLine(e.cursorConfig,e.model,t.modelState,n))));case 5:return 2===s?t.map((t=>Rk.fromViewState(Qk.moveToNextBlankLine(e.cursorConfig,e,t.viewState,n)))):t.map((t=>Rk.fromModelState(Qk.moveToNextBlankLine(e.cursorConfig,e.model,t.modelState,n))));case 6:return this._moveToViewMinColumn(e,t,n);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case 8:return this._moveToViewCenterColumn(e,t,n);case 9:return this._moveToViewMaxColumn(e,t,n);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,n);default:return null}}static viewportMove(e,t,i,n,o){const s=e.getCompletelyVisibleViewRange(),r=e.coordinatesConverter.convertViewRangeToModelRange(s);switch(i){case 11:{const i=this._firstLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 13:{const i=this._lastLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 12:{const i=Math.round((r.startLineNumber+r.endLineNumber)/2),o=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,o)]}case 14:{const i=[];for(let o=0,r=t.length;o<r;o++){const r=t[o];i[o]=this.findPositionInViewportIfOutside(e,r,s,n)}return i}default:return null}}static findPositionInViewportIfOutside(e,t,i,n){const o=t.viewState.position.lineNumber;if(i.startLineNumber<=o&&o<=i.endLineNumber-1)return new Rk(t.modelState,t.viewState);{let s;s=o>i.endLineNumber-1?i.endLineNumber-1:o<i.startLineNumber?i.startLineNumber:o;const r=Qk.vertical(e.cursorConfig,e,o,t.viewState.position.column,t.viewState.leftoverVisibleColumns,s,!1);return Rk.fromViewState(t.viewState.move(n,r.lineNumber,r.column,r.leftoverVisibleColumns))}}static _firstLineNumberInRange(e,t,i){let n=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(n)&&n++,Math.min(t.endLineNumber,n+i-1)}static _lastLineNumberInRange(e,t,i){let n=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(n)&&n++,Math.max(n,t.endLineNumber-i+1)}static _moveLeft(e,t,i,n){return t.map((t=>{const o=e.getTextDirection(t.viewState.position.lineNumber)===pg.RTL;return Rk.fromViewState(o?Qk.moveRight(e.cursorConfig,e,t.viewState,i,n):Qk.moveLeft(e.cursorConfig,e,t.viewState,i,n))}))}static _moveHalfLineLeft(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=Math.round(e.getLineLength(r)/2);n[o]=Rk.fromViewState(Qk.moveLeft(e.cursorConfig,e,s.viewState,i,a))}return n}static _moveRight(e,t,i,n){return t.map((t=>{const o=e.getTextDirection(t.viewState.position.lineNumber)===pg.RTL;return Rk.fromViewState(o?Qk.moveLeft(e.cursorConfig,e,t.viewState,i,n):Qk.moveRight(e.cursorConfig,e,t.viewState,i,n))}))}static _moveHalfLineRight(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=Math.round(e.getLineLength(r)/2);n[o]=Rk.fromViewState(Qk.moveRight(e.cursorConfig,e,s.viewState,i,a))}return n}static _moveDownByViewLines(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=Rk.fromViewState(Qk.moveDown(e.cursorConfig,e,r.viewState,i,n))}return o}static _moveDownByModelLines(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=Rk.fromModelState(Qk.moveDown(e.cursorConfig,e.model,r.modelState,i,n))}return o}static _moveUpByViewLines(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=Rk.fromViewState(Qk.moveUp(e.cursorConfig,e,r.viewState,i,n))}return o}static _moveUpByModelLines(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=Rk.fromModelState(Qk.moveUp(e.cursorConfig,e.model,r.modelState,i,n))}return o}static _moveToViewPosition(e,t,i,n,o){return Rk.fromViewState(t.viewState.move(i,n,o,0))}static _moveToModelPosition(e,t,i,n,o){return Rk.fromModelState(t.modelState.move(i,n,o,0))}static _moveToViewMinColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineMinColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewFirstNonWhitespaceColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineFirstNonWhitespaceColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewCenterColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=Math.round((e.getLineMaxColumn(r)+e.getLineMinColumn(r))/2);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewMaxColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineMaxColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewLastNonWhitespaceColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineLastNonWhitespaceColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}}var nL;!function(e){e.metadata={description:"Move cursor to a logical position in the view",args:[{name:"Cursor move argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'to': A mandatory logical position value providing where to move the cursor.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',\n\t\t\t\t\t\t'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'\n\t\t\t\t\t\t'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'\n\t\t\t\t\t\t'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'by': Unit to move. Default is computed based on 'to' value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'line', 'wrappedLine', 'character', 'halfLine'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'value': Number of units to move. Default is '1'.\n\t\t\t\t\t* 'select': If 'true' makes the selection. Default is 'false'.\n\t\t\t\t",constraint:function(e){if(!dt(e))return!1;const t=e;return!(!lt(t.to)||!pt(t.select)&&!gt(t.select)||!pt(t.by)&&!lt(t.by)||!pt(t.value)&&!ct(t.value))},schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1}}}}]},e.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},e.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"},e.parse=function(t){if(!t.to)return null;let i;switch(t.to){case e.RawDirection.Left:i=0;break;case e.RawDirection.Right:i=1;break;case e.RawDirection.Up:i=2;break;case e.RawDirection.Down:i=3;break;case e.RawDirection.PrevBlankLine:i=4;break;case e.RawDirection.NextBlankLine:i=5;break;case e.RawDirection.WrappedLineStart:i=6;break;case e.RawDirection.WrappedLineFirstNonWhitespaceCharacter:i=7;break;case e.RawDirection.WrappedLineColumnCenter:i=8;break;case e.RawDirection.WrappedLineEnd:i=9;break;case e.RawDirection.WrappedLineLastNonWhitespaceCharacter:i=10;break;case e.RawDirection.ViewPortTop:i=11;break;case e.RawDirection.ViewPortBottom:i=13;break;case e.RawDirection.ViewPortCenter:i=12;break;case e.RawDirection.ViewPortIfOutside:i=14;break;default:return null}let n=0;switch(t.by){case e.RawUnit.Line:n=1;break;case e.RawUnit.WrappedLine:n=2;break;case e.RawUnit.Character:n=3;break;case e.RawUnit.HalfLine:n=4}return{direction:i,unit:n,select:!!t.select,value:t.value||1}}}(nL||(nL={}));class oL{constructor(e,t,i){this._indentRulesSupport=t,this._indentationLineProcessor=new rL(e,i)}shouldIncrease(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIncrease(i)}shouldDecrease(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldDecrease(i)}shouldIgnore(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIgnore(i)}shouldIndentNextLine(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIndentNextLine(i)}}class sL{constructor(e,t){this.model=e,this.indentationLineProcessor=new rL(e,t)}getProcessedTokenContextAroundRange(e){return{beforeRangeProcessedTokens:this._getProcessedTokensBeforeRange(e),afterRangeProcessedTokens:this._getProcessedTokensAfterRange(e),previousLineProcessedTokens:this._getProcessedPreviousLineTokens(e)}}_getProcessedTokensBeforeRange(e){this.model.tokenization.forceTokenization(e.startLineNumber);const t=this.model.tokenization.getLineTokens(e.startLineNumber),i=Kg(t,e.startColumn-1);let n;if(aL(this.model,e.getStartPosition())){const o=e.startColumn-1-i.firstCharOffset,s=i.firstCharOffset,r=s+o;n=t.sliceAndInflate(s,r,0)}else{const i=e.startColumn-1;n=t.sliceAndInflate(0,i,0)}return this.indentationLineProcessor.getProcessedTokens(n)}_getProcessedTokensAfterRange(e){const t=e.isEmpty()?e.getStartPosition():e.getEndPosition();this.model.tokenization.forceTokenization(t.lineNumber);const i=this.model.tokenization.getLineTokens(t.lineNumber),n=Kg(i,t.column-1),o=t.column-1-n.firstCharOffset,s=n.firstCharOffset+o,r=n.firstCharOffset+n.getLineLength(),a=i.sliceAndInflate(s,r,0);return this.indentationLineProcessor.getProcessedTokens(a)}_getProcessedPreviousLineTokens(e){this.model.tokenization.forceTokenization(e.startLineNumber);const t=Kg(this.model.tokenization.getLineTokens(e.startLineNumber),e.startColumn-1),i=uS.createEmpty("",t.languageIdCodec),n=e.startLineNumber-1;if(0===n)return i;if(0!==t.firstCharOffset)return i;const o=(e=>(this.model.tokenization.forceTokenization(e),Kg(this.model.tokenization.getLineTokens(e),this.model.getLineMaxColumn(e)-1)))(n);if(t.languageId!==o.languageId)return i;const s=o.toIViewLineTokens();return this.indentationLineProcessor.getProcessedTokens(s)}}class rL{constructor(e,t){this.model=e,this.languageConfigurationService=t}getProcessedLine(e,t){this.model.tokenization.forceTokenization?.(e);const i=this.model.tokenization.getLineTokens(e);let n=this.getProcessedTokens(i).getLineContent();return void 0!==t&&(n=((e,t)=>{const i=Gi(e);return t+e.substring(i.length)})(n,t)),n}getProcessedTokens(e){const t=e.getLanguageId(0),i=this.languageConfigurationService.getLanguageConfiguration(t).bracketsNew.getBracketRegExp({global:!0}),n=[];return e.forEach((t=>{const o=e.getStandardTokenType(t);let s=e.getTokenText(t);(e=>2===e||3===e||1===e)(o)&&(s=s.replace(i,""));const r=e.getMetadata(t);n.push({text:s,metadata:r})})),uS.createFromTextAndMetadata(n,e.languageIdCodec)}}function aL(e,t){e.tokenization.forceTokenization(t.lineNumber);const i=e.tokenization.getLineTokens(t.lineNumber),n=Kg(i,t.column-1),o=0===n.firstCharOffset,s=i.getLanguageId(0)===n.languageId;return!o&&!s}function lL(e,t,i,n){t.tokenization.forceTokenization(i.startLineNumber);const o=t.getLanguageIdAtPosition(i.startLineNumber,i.startColumn),s=n.getLanguageConfiguration(o);if(!s)return null;const r=new sL(t,n).getProcessedTokenContextAroundRange(i),a=r.previousLineProcessedTokens.getLineContent(),l=r.beforeRangeProcessedTokens.getLineContent(),d=r.afterRangeProcessedTokens.getLineContent(),h=s.onEnter(e,a,l,d);if(!h)return null;const c=h.indentAction;let u=h.appendText;const g=h.removeText||0;u?c===Bg.Indent&&(u="\t"+u):u=c===Bg.Indent||c===Bg.IndentOutdent?"\t":"";let p=tm(t,i.startLineNumber,i.startColumn);return g&&(p=p.substring(0,p.length-g)),{indentAction:c,appendText:u,removeText:g,indentation:p}}var dL;const hL=Object.create(null);function cL(e,t){if(t<=0)return"";hL[e]||(hL[e]=["",e]);const i=hL[e];for(let n=i.length;n<=t;n++)i[n]=i[n-1]+e;return i[t]}let uL=dL=class{static unshiftIndent(e,t,i,n,o){const s=Eg.visibleColumnFromColumn(e,t,i);if(o){const e=cL(" ",n);return cL(e,Eg.prevIndentTabStop(s,n)/n)}return cL("\t",Eg.prevRenderTabStop(s,i)/i)}static shiftIndent(e,t,i,n,o){const s=Eg.visibleColumnFromColumn(e,t,i);if(o){const e=cL(" ",n);return cL(e,Eg.nextIndentTabStop(s,n)/n)}return cL("\t",Eg.nextRenderTabStop(s,i)/i)}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const i=this._selection.startLineNumber;let n=this._selection.endLineNumber;1===this._selection.endColumn&&i!==n&&(n-=1);const{tabSize:o,indentSize:s,insertSpaces:r}=this._opts,a=i===n;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let l=0,d=0;for(let h=i;h<=n;h++,l=d){d=0;const n=e.getLineContent(h);let c,u=$i(n);if((!this._opts.isUnshift||0!==n.length&&0!==u)&&(a||this._opts.isUnshift||0!==n.length)){if(-1===u&&(u=n.length),h>1&&Eg.visibleColumnFromColumn(n,u+1,o)%s!=0&&e.tokenization.isCheapToTokenize(h-1)){const t=lL(this._opts.autoIndent,e,new Yu(h-1,e.getLineMaxColumn(h-1),h-1,e.getLineMaxColumn(h-1)),this._languageConfigurationService);if(t){if(d=l,t.appendText)for(let e=0,i=t.appendText.length;e<i&&d<s&&32===t.appendText.charCodeAt(e);e++)d++;t.removeText&&(d=Math.max(0,d-t.removeText));for(let e=0;e<d&&0!==u&&32===n.charCodeAt(u-1);e++)u--}}this._opts.isUnshift&&0===u||(c=this._opts.isUnshift?dL.unshiftIndent(n,u+1,o,s,r):dL.shiftIndent(n,u+1,o,s,r),this._addEditOperation(t,new Yu(h,1,h,u+1),c),h!==i||this._selection.isEmpty()||(this._selectionStartColumnStaysPut=this._selection.startColumn<=u+1))}}}else{!this._opts.isUnshift&&this._selection.isEmpty()&&0===e.getLineLength(i)&&(this._useLastEditRangeForCursorEndPosition=!0);const o=r?cL(" ",s):"\t";for(let r=i;r<=n;r++){const n=e.getLineContent(r);let l=$i(n);if((!this._opts.isUnshift||0!==n.length&&0!==l)&&(a||this._opts.isUnshift||0!==n.length)&&(-1===l&&(l=n.length),!this._opts.isUnshift||0!==l))if(this._opts.isUnshift){l=Math.min(l,s);for(let e=0;e<l;e++)if(9===n.charCodeAt(e)){l=e+1;break}this._addEditOperation(t,new Yu(r,1,r,l+1),"")}else this._addEditOperation(t,new Yu(r,1,r,1),o),r!==i||this._selection.isEmpty()||(this._selectionStartColumnStaysPut=1===this._selection.startColumn)}}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){if(this._useLastEditRangeForCursorEndPosition){const e=t.getInverseEditOperations()[0];return new Qu(e.range.endLineNumber,e.range.endColumn,e.range.endLineNumber,e.range.endColumn)}const i=t.getTrackedSelection(this._selectionId);if(this._selectionStartColumnStaysPut){const e=this._selection.startColumn;return i.startColumn<=e?i:0===i.getDirection()?new Qu(i.startLineNumber,e,i.endLineNumber,i.endColumn):new Qu(i.endLineNumber,i.endColumn,i.startLineNumber,e)}return i}};uL=dL=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(2,Qp)],uL);class gL{constructor(e,t,i){this._range=e,this._charBeforeSelection=t,this._charAfterSelection=i}getEditOperations(e,t){t.addTrackedEditOperation(new Yu(this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),t.addTrackedEditOperation(new Yu(this._range.endLineNumber,this._range.endColumn,this._range.endLineNumber,this._range.endColumn),this._charAfterSelection||null)}computeCursorState(e,t){const i=t.getInverseEditOperations(),n=i[0].range,o=i[1].range;return new Qu(n.endLineNumber,n.endColumn,o.endLineNumber,o.endColumn-this._charAfterSelection.length)}}class pL{constructor(e,t,i){this._position=e,this._text=t,this._charAfter=i}getEditOperations(e,t){t.addTrackedEditOperation(new Yu(this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column),this._text+this._charAfter)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return new Qu(i.endLineNumber,i.startColumn,i.endLineNumber,i.endColumn-this._charAfter.length)}}function mL(e,t,i,n=!0,o){if(e<4)return null;const s=o.getLanguageConfiguration(t.tokenization.getLanguageId()).indentRulesSupport;if(!s)return null;const r=new oL(t,s,o);if(i<=1)return{indentation:"",action:null};for(let e=i-1;e>0&&""===t.getLineContent(e);e--)if(1===e)return{indentation:"",action:null};const a=function(e,t,i){const n=e.tokenization.getLanguageIdAtPosition(t,0);if(t>1){let o,s=-1;for(o=t-1;o>=1;o--){if(e.tokenization.getLanguageIdAtPosition(o,0)!==n)return s;const t=e.getLineContent(o);if(!i.shouldIgnore(o)&&!/^\s+$/.test(t)&&""!==t)return o;s=o}}return-1}(t,i,r);if(a<0)return null;if(a<1)return{indentation:"",action:null};if(r.shouldIncrease(a)||r.shouldIndentNextLine(a))return{indentation:Gi(t.getLineContent(a)),action:Bg.Indent,line:a};if(r.shouldDecrease(a))return{indentation:Gi(t.getLineContent(a)),action:null,line:a};{if(1===a)return{indentation:Gi(t.getLineContent(a)),action:null,line:a};const e=a-1,i=s.getIndentMetadata(t.getLineContent(e));if(!(3&i)&&4&i){let i=0;for(let t=e-1;t>0;t--)if(!r.shouldIndentNextLine(t)){i=t;break}return{indentation:Gi(t.getLineContent(i+1)),action:null,line:i+1}}if(n)return{indentation:Gi(t.getLineContent(a)),action:null,line:a};for(let e=a;e>0;e--){if(r.shouldIncrease(e))return{indentation:Gi(t.getLineContent(e)),action:Bg.Indent,line:e};if(r.shouldIndentNextLine(e)){let i=0;for(let t=e-1;t>0;t--)if(!r.shouldIndentNextLine(e)){i=t;break}return{indentation:Gi(t.getLineContent(i+1)),action:null,line:i+1}}if(r.shouldDecrease(e))return{indentation:Gi(t.getLineContent(e)),action:null,line:e}}return{indentation:Gi(t.getLineContent(1)),action:null,line:1}}}function fL(e,t,i,n,o,s){if(e<4)return null;const r=s.getLanguageConfiguration(i);if(!r)return null;const a=s.getLanguageConfiguration(i).indentRulesSupport;if(!a)return null;const l=new oL(t,a,s),d=mL(e,t,n,void 0,s);if(d){const i=d.line;if(void 0!==i){let s=!0;for(let e=i;e<n-1;e++)if(!/^\s*$/.test(t.getLineContent(e))){s=!1;break}if(s){const s=r.onEnter(e,"",t.getLineContent(i),"");if(s){let e=Gi(t.getLineContent(i));return s.removeText&&(e=e.substring(0,e.length-s.removeText)),s.indentAction===Bg.Indent||s.indentAction===Bg.IndentOutdent?e=o.shiftIndent(e):s.indentAction===Bg.Outdent&&(e=o.unshiftIndent(e)),l.shouldDecrease(n)&&(e=o.unshiftIndent(e)),s.appendText&&(e+=s.appendText),Gi(e)}}}return l.shouldDecrease(n)?d.action===Bg.Indent?d.indentation:o.unshiftIndent(d.indentation):d.action===Bg.Indent?o.shiftIndent(d.indentation):d.indentation}return null}function _L(e,t,i){const n=i.getLanguageConfiguration(e.getLanguageId()).indentRulesSupport;return n?t<1||t>e.getLineCount()?null:n.getIndentMetadata(e.getLineContent(t)):null}class vL{static getEdits(e,t,i,n,o){if(!o&&this._isAutoIndentType(e,t,i)){const o=[];for(const s of i){const i=this._findActualIndentationForSelection(e,t,s,n);if(null===i)return;o.push({selection:s,indentation:i})}const s=CL.getAutoClosingPairClose(e,t,i,n,!1);return this._getIndentationAndAutoClosingPairEdits(e,t,o,n,s)}}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let e=0,n=i.length;e<n;e++)if(!t.tokenization.isCheapToTokenize(i[e].getEndPosition().lineNumber))return!1;return!0}static _findActualIndentationForSelection(e,t,i,n){const o=function(e,t,i,n,o,s){const r=e.autoIndent;if(r<4)return null;if(aL(t,i.getStartPosition()))return null;const a=t.getLanguageIdAtPosition(i.startLineNumber,i.startColumn),l=s.getLanguageConfiguration(a).indentRulesSupport;if(!l)return null;const d=new sL(t,s).getProcessedTokenContextAroundRange(i),h=d.beforeRangeProcessedTokens.getLineContent(),c=d.afterRangeProcessedTokens.getLineContent(),u=h+c,g=h+n+c;if(!l.shouldDecrease(u)&&l.shouldDecrease(g)){const e=mL(r,t,i.startLineNumber,!1,s);if(!e)return null;let n=e.indentation;return e.action!==Bg.Indent&&(n=o.unshiftIndent(n)),n}const p=i.startLineNumber-1;if(p>0){const a=t.getLineContent(p);if(l.shouldIndentNextLine(a)&&l.shouldIncrease(g)){const a=mL(r,t,i.startLineNumber,!1,s),l=a?.indentation;if(void 0!==l){const s=Gi(t.getLineContent(i.startLineNumber)),r=o.shiftIndent(l)===s,a=/^\s*$/.test(u),d=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n),h=d&&d.length>0;if(r&&h&&a)return l}}}return null}(e,t,i,n,{shiftIndent:t=>VL(e,t),unshiftIndent:t=>HL(e,t)},e.languageConfigurationService);if(null===o)return null;const s=tm(t,i.startLineNumber,i.startColumn);return o===e.normalizeIndentation(s)?null:o}static _getIndentationAndAutoClosingPairEdits(e,t,i,n,o){const s=i.map((({selection:i,indentation:s})=>{if(null!==o){const r=this._getEditFromIndentationAndSelection(e,t,s,i,n,!1);return new AL(r,i,n,o)}{const o=this._getEditFromIndentationAndSelection(e,t,s,i,n,!0);return WL(o.range,o.text,!1)}}));return new Bk(4,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static _getEditFromIndentationAndSelection(e,t,i,n,o,s=!0){const r=n.startLineNumber,a=t.getLineFirstNonWhitespaceColumn(r);let l=e.normalizeIndentation(i);return 0!==a&&(l+=t.getLineContent(r).substring(a-1,n.startColumn-1)),l+=s?o:"",{range:new Yu(r,1,n.endLineNumber,n.endColumn),text:l}}}class bL{static getEdits(e,t,i,n,o,s){if(BL(t,i,n,o,s))return this._runAutoClosingOvertype(e,n,s)}static _runAutoClosingOvertype(e,t,i){const n=[];for(let e=0,o=t.length;e<o;e++){const o=t[e].getPosition(),s=new Yu(o.lineNumber,o.column,o.lineNumber,o.column+1);n[e]=new Hk(s,i)}return new Bk(4,n,{shouldPushStackElementBefore:OL(e,4),shouldPushStackElementAfter:!1})}}class wL{static getEdits(e,t,i,n,o){if(BL(e,t,i,n,o)){const e=i.map((e=>new Hk(new Yu(e.positionLineNumber,e.positionColumn,e.positionLineNumber,e.positionColumn+1),"",!1)));return new Bk(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}}class CL{static getEdits(e,t,i,n,o,s){if(!s){const s=this.getAutoClosingPairClose(e,t,i,n,o);if(null!==s)return this._runAutoClosingOpenCharType(i,n,o,s)}}static _runAutoClosingOpenCharType(e,t,i,n){const o=[];for(let s=0,r=e.length;s<r;s++){const r=e[s];o[s]=new ML(r,t,!i,n)}return new Bk(4,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static getAutoClosingPairClose(e,t,i,n,o){for(const e of i)if(!e.isEmpty())return null;const s=i.map((e=>{const t=e.getPosition();return o?{lineNumber:t.lineNumber,beforeColumn:t.column-n.length,afterColumn:t.column}:{lineNumber:t.lineNumber,beforeColumn:t.column,afterColumn:t.column}})),r=this._findAutoClosingPairOpen(e,t,s.map((e=>new rc(e.lineNumber,e.beforeColumn))),n);if(!r)return null;let a,l;if(Wk(n)?(a=e.autoClosingQuotes,l=e.shouldAutoCloseBefore.quote):e.blockCommentStartToken&&r.open.includes(e.blockCommentStartToken)?(a=e.autoClosingComments,l=e.shouldAutoCloseBefore.comment):(a=e.autoClosingBrackets,l=e.shouldAutoCloseBefore.bracket),"never"===a)return null;const d=this._findContainedAutoClosingPair(e,r),h=d?d.close:"";let c=!0;for(const i of s){const{lineNumber:o,beforeColumn:s,afterColumn:d}=i,u=t.getLineContent(o),g=u.substring(0,s-1),p=u.substring(d-1);if(p.startsWith(h)||(c=!1),p.length>0){const t=p.charAt(0);if(!this._isBeforeClosingBrace(e,p)&&!l(t))return null}if(1===r.open.length&&("'"===n||'"'===n)&&"always"!==a){const t=qy(e.wordSeparators,[]);if(g.length>0){const e=g.charCodeAt(g.length-1);if(0===t.get(e))return null}}if(!t.tokenization.isCheapToTokenize(o))return null;t.tokenization.forceTokenization(o);const m=Kg(t.tokenization.getLineTokens(o),s-1);if(!r.shouldAutoClose(m,s-m.firstCharOffset))return null;const f=r.findNeutralCharacter();if(f){const e=t.tokenization.getTokenTypeIfInsertingCharacter(o,s,f);if(!r.isOK(e))return null}}return c?r.close.substring(0,r.close.length-h.length):r.close}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),n=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const e of n)e.open!==t.open&&t.open.includes(e.open)&&t.close.endsWith(e.close)&&(!o||e.open.length>o.open.length)&&(o=e);return o}static _findAutoClosingPairOpen(e,t,i,n){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!o)return null;let s=null;for(const e of o)if(null===s||e.open.length>s.open.length){let o=!0;for(const s of i)if(t.getValueInRange(new Yu(s.lineNumber,s.column-e.open.length+1,s.lineNumber,s.column))+n!==e.open){o=!1;break}o&&(s=e)}return s}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),n=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],o=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],s=n.some((e=>t.startsWith(e.open))),r=o.some((e=>t.startsWith(e.close)));return!s&&r}}class yL{static getEdits(e,t){if("overtype"!==e.inputMode)return null;const i=t.map((e=>new qk(e.insertedTextRange)));return new Bk(4,i,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}class SL{static getEdits(e,t,i,n,o){if(!o&&this._isSurroundSelectionType(e,t,i,n))return this._runSurroundSelectionType(e,i,n)}static _runSurroundSelectionType(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=e.surroundingPairs[i];n[o]=new gL(s,i,r)}return new Bk(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _isSurroundSelectionType(e,t,i,n){if(!zL(e,n)||!e.surroundingPairs.hasOwnProperty(n))return!1;const o=Wk(n);for(const e of i){if(e.isEmpty())return!1;let i=!0;for(let n=e.startLineNumber;n<=e.endLineNumber;n++){const o=t.getLineContent(n),s=n===e.startLineNumber?e.startColumn-1:0,r=n===e.endLineNumber?e.endColumn-1:o.length,a=o.substring(s,r);if(/[^ \t]/.test(a)){i=!1;break}}if(i)return!1;if(o&&e.startLineNumber===e.endLineNumber&&e.startColumn+1===e.endColumn&&Wk(t.getValueInRange(e)))return!1}return!0}}class xL{static getEdits(e,t,i,n,o,s){if(!s&&this._isTypeInterceptorElectricChar(t,i,n)){const s=this._typeInterceptorElectricChar(e,t,i,n[0],o);if(s)return s}}static _isTypeInterceptorElectricChar(e,t,i){return!(1!==i.length||!t.tokenization.isCheapToTokenize(i[0].getEndPosition().lineNumber))}static _typeInterceptorElectricChar(e,t,i,n,o){if(!t.electricChars.hasOwnProperty(o)||!n.isEmpty())return null;const s=n.getPosition();i.tokenization.forceTokenization(s.lineNumber);const r=i.tokenization.getLineTokens(s.lineNumber);let a;try{a=t.onElectricCharacter(o,r,s.column)}catch(e){return Ie(e),null}if(!a)return null;if(a.matchOpenBracket){const n=(r.getLineContent()+o).lastIndexOf(a.matchOpenBracket)+1,l=i.bracketPairs.findMatchingBracketUp(a.matchOpenBracket,{lineNumber:s.lineNumber,column:n},500);if(l){if(l.startLineNumber===s.lineNumber)return null;const n=Gi(i.getLineContent(l.startLineNumber)),r=t.normalizeIndentation(n),a=i.getLineContent(s.lineNumber),d=i.getLineFirstNonWhitespaceColumn(s.lineNumber)||s.column,h=r+a.substring(d-1,s.column-1)+o,c=new Yu(s.lineNumber,1,s.lineNumber,s.column),u=new Hk(c,h);return new Bk(RL(h,e),[u],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!0})}}return null}}class kL{static getEdits(e,t,i,n,o){const s=[];for(let t=0,r=i.length;t<r;t++){const r="overtype"!==e.inputMode||o?Hk:zk;s[t]=new r(i[t],n)}const r=RL(n,t);return new Bk(r,s,{shouldPushStackElementBefore:OL(t,r),shouldPushStackElementAfter:!1})}}class LL{static getEdits(e,t,i,n,o){if(!o&&"\n"===n){const n=[];for(let o=0,s=i.length;o<s;o++)n[o]=this._enter(e,t,!1,i[o]);return new Bk(4,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}static _enter(e,t,i,n){if(0===e.autoIndent)return WL(n,"\n",i);if(!t.tokenization.isCheapToTokenize(n.getStartPosition().lineNumber)||1===e.autoIndent){const o=Gi(t.getLineContent(n.startLineNumber)).substring(0,n.startColumn-1);return WL(n,"\n"+e.normalizeIndentation(o),i)}const o=lL(e.autoIndent,t,n,e.languageConfigurationService);if(o){if(o.indentAction===Bg.None)return WL(n,"\n"+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===Bg.Indent)return WL(n,"\n"+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===Bg.IndentOutdent){const t=e.normalizeIndentation(o.indentation),s=e.normalizeIndentation(o.indentation+o.appendText),r="\n"+s+"\n"+t;return i?new Kk(n,r,!0):new jk(n,r,-1,s.length-t.length,!0)}if(o.indentAction===Bg.Outdent){const t=HL(e,o.indentation);return WL(n,"\n"+e.normalizeIndentation(t+o.appendText),i)}}const s=Gi(t.getLineContent(n.startLineNumber)).substring(0,n.startColumn-1);if(e.autoIndent>=4){const o=function(e,t,i,n,o){if(e<4)return null;const s=t.getLanguageIdAtPosition(i.startLineNumber,i.startColumn),r=o.getLanguageConfiguration(s).indentRulesSupport;if(!r)return null;t.tokenization.forceTokenization(i.startLineNumber);const a=new sL(t,o).getProcessedTokenContextAroundRange(i),l=a.afterRangeProcessedTokens,d=a.beforeRangeProcessedTokens,h=Gi(d.getLineContent()),c=function(e,t,i){return{tokenization:{getLineTokens:n=>n===t?i:e.tokenization.getLineTokens(n),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(t,i)=>e.getLanguageIdAtPosition(t,i)},getLineContent:n=>n===t?i.getLineContent():e.getLineContent(n)}}(t,i.startLineNumber,d),u=aL(t,i.getStartPosition()),g=Gi(t.getLineContent(i.startLineNumber)),p=mL(e,c,i.startLineNumber+1,void 0,o);if(!p){const e=u?g:h;return{beforeEnter:e,afterEnter:e}}let m=u?g:p.indentation;return p.action===Bg.Indent&&(m=n.shiftIndent(m)),r.shouldDecrease(l.getLineContent())&&(m=n.unshiftIndent(m)),{beforeEnter:u?g:h,afterEnter:m}}(e.autoIndent,t,n,{unshiftIndent:t=>HL(e,t),shiftIndent:t=>VL(e,t),normalizeIndentation:t=>e.normalizeIndentation(t)},e.languageConfigurationService);if(o){let s=e.visibleColumnFromColumn(t,n.getEndPosition());const r=n.endColumn,a=$i(t.getLineContent(n.endLineNumber));if(n=a>=0?n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,a+1)):n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new Kk(n,"\n"+e.normalizeIndentation(o.afterEnter),!0);{let t=0;return r<=a+1&&(e.insertSpaces||(s=Math.ceil(s/e.indentSize)),t=Math.min(s+1-e.normalizeIndentation(o.afterEnter).length-1,0)),new jk(n,"\n"+e.normalizeIndentation(o.afterEnter),0,t,!0)}}}return WL(n,"\n"+e.normalizeIndentation(s),i)}static lineInsertBefore(e,t,i){if(null===t||null===i)return[];const n=[];for(let o=0,s=i.length;o<s;o++){let s=i[o].positionLineNumber;if(1===s)n[o]=new Kk(new Yu(1,1,1,1),"\n");else{s--;const i=t.getLineMaxColumn(s);n[o]=this._enter(e,t,!1,new Yu(s,i,s,i))}}return n}static lineInsertAfter(e,t,i){if(null===t||null===i)return[];const n=[];for(let o=0,s=i.length;o<s;o++){const s=i[o].positionLineNumber,r=t.getLineMaxColumn(s);n[o]=this._enter(e,t,!1,new Yu(s,r,s,r))}return n}static lineBreakInsert(e,t,i){const n=[];for(let o=0,s=i.length;o<s;o++)n[o]=this._enter(e,t,!0,i[o]);return n}}class DL{static getEdits(e,t,i,n,o,s){const r=this._distributePasteToCursors(e,i,n,o,s);return r?(i=i.sort(Yu.compareRangesUsingStarts),this._distributedPaste(e,t,i,r)):this._simplePaste(e,t,i,n,o)}static _distributePasteToCursors(e,t,i,n,o){if(n)return null;if(1===t.length)return null;if(o&&o.length===t.length)return o;if("spread"===e.multiCursorPaste){10===i.charCodeAt(i.length-1)&&(i=i.substring(0,i.length-1)),13===i.charCodeAt(i.length-1)&&(i=i.substring(0,i.length-1));const e=qi(i);if(e.length===t.length)return e}return null}static _distributedPaste(e,t,i,n){const o=[];for(let t=0,s=i.length;t<s;t++){const s=e.overtypeOnPaste&&"overtype"===e.inputMode?zk:Hk;o[t]=new s(i[t],n[t])}return new Bk(0,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _simplePaste(e,t,i,n,o){const s=[];for(let t=0,r=i.length;t<r;t++){const r=i[t],a=r.getPosition();if(o&&!r.isEmpty()&&(o=!1),o&&n.indexOf("\n")!==n.length-1&&(o=!1),o){const e=new Yu(a.lineNumber,1,a.lineNumber,1);s[t]=new $k(e,n,r,!0)}else{const i=e.overtypeOnPaste&&"overtype"===e.inputMode?zk:Hk;s[t]=new i(r,n)}}return new Bk(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class EL{static getEdits(e,t,i,n,o,s,r,a){const l=n.map((e=>this._compositionType(i,e,o,s,r,a)));return new Bk(4,l,{shouldPushStackElementBefore:OL(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,o,s){if(!t.isEmpty())return null;const r=t.getPosition(),a=Math.max(1,r.column-n),l=Math.min(e.getLineMaxColumn(r.lineNumber),r.column+o),d=new Yu(r.lineNumber,a,r.lineNumber,l);return new jk(d,i,0,s)}}class NL{static getEdits(e,t,i){const n=[];for(let e=0,o=t.length;e<o;e++)n[e]=new Hk(t[e],i);const o=RL(i,e);return new Bk(o,n,{shouldPushStackElementBefore:OL(e,o),shouldPushStackElementAfter:!1})}}class IL{static getCommands(e,t,i){const n=[];for(let o=0,s=i.length;o<s;o++){const s=i[o];if(s.isEmpty()){const i=t.getLineContent(s.startLineNumber);if(/^\s*$/.test(i)&&t.tokenization.isCheapToTokenize(s.startLineNumber)){let r=this._goodIndentForLine(e,t,s.startLineNumber);r=r||"\t";const a=e.normalizeIndentation(r);if(!i.startsWith(a)){n[o]=new Hk(new Yu(s.startLineNumber,1,s.startLineNumber,i.length+1),a,!0);continue}}n[o]=this._replaceJumpToNextIndent(e,t,s,!0)}else{if(s.startLineNumber===s.endLineNumber){const i=t.getLineMaxColumn(s.startLineNumber);if(1!==s.startColumn||s.endColumn!==i){n[o]=this._replaceJumpToNextIndent(e,t,s,!1);continue}}n[o]=new uL(s,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService)}}return n}static _goodIndentForLine(e,t,i){let n=null,o="";const s=mL(e.autoIndent,t,i,!1,e.languageConfigurationService);if(s)n=s.action,o=s.indentation;else if(i>1){let n;for(n=i-1;n>=1&&!(Zi(t.getLineContent(n))>=0);n--);if(n<1)return null;const s=t.getLineMaxColumn(n),r=lL(e.autoIndent,t,new Yu(n,s,n,s),e.languageConfigurationService);r&&(o=r.indentation+r.appendText)}return n&&(n===Bg.Indent&&(o=VL(e,o)),n===Bg.Outdent&&(o=HL(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,n){let o="";const s=i.getStartPosition();if(e.insertSpaces){const i=e.visibleColumnFromColumn(t,s),n=e.indentSize,r=n-i%n;for(let e=0;e<r;e++)o+=" "}else o="\t";return new Hk(i,o,n)}}class TL extends jk{constructor(e,t,i,n,o,s){super(e,t,i,n),this._openCharacter=o,this._closeCharacter=s,this.closeCharacterRange=null,this.enclosingRange=null}_computeCursorStateWithRange(e,t,i){return this.closeCharacterRange=new Yu(t.startLineNumber,t.endColumn-this._closeCharacter.length,t.endLineNumber,t.endColumn),this.enclosingRange=new Yu(t.startLineNumber,t.endColumn-this._openCharacter.length-this._closeCharacter.length,t.endLineNumber,t.endColumn),super.computeCursorState(e,i)}}class ML extends TL{constructor(e,t,i,n){super(e,(i?t:"")+n,0,-n.length,t,n)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return this._computeCursorStateWithRange(e,i,t)}}class AL extends TL{constructor(e,t,i,n){const o=i+n;super(t,o,0,i.length,i,n),this._autoIndentationEdit=e,this._autoClosingEdit={range:t,text:o}}getEditOperations(e,t){t.addTrackedEditOperation(this._autoIndentationEdit.range,this._autoIndentationEdit.text),t.addTrackedEditOperation(this._autoClosingEdit.range,this._autoClosingEdit.text)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(2!==i.length)throw new Error("There should be two inverse edit operations!");const n=i[0].range,o=i[1].range,s=n.plusRange(o);return this._computeCursorStateWithRange(e,s,t)}}function RL(e,t){return" "===e?5===t||6===t?6:5:4}function OL(e,t){return!(!FL(e)||FL(t))||5!==e&&PL(e)!==PL(t)}function PL(e){return 6===e||5===e?"space":e}function FL(e){return 4===e||5===e||6===e}function BL(e,t,i,n,o){if("never"===e.autoClosingOvertype)return!1;if(!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let s=0,r=i.length;s<r;s++){const r=i[s];if(!r.isEmpty())return!1;const a=r.getPosition(),l=t.getLineContent(a.lineNumber);if(l.charAt(a.column-1)!==o)return!1;const d=Wk(o);if(92===(a.column>2?l.charCodeAt(a.column-2):0)&&d)return!1;if("auto"===e.autoClosingOvertype){let e=!1;for(let t=0,i=n.length;t<i;t++){const i=n[t];if(a.lineNumber===i.startLineNumber&&a.column===i.startColumn){e=!0;break}}if(!e)return!1}}return!0}function WL(e,t,i){return i?new Kk(e,t,!0):new Hk(e,t,!0)}function VL(e,t,i){return i=i||1,uL.shiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}function HL(e,t,i){return i=i||1,uL.unshiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}function zL(e,t){return Wk(t)?"quotes"===e.autoSurround||"languageDefined"===e.autoSurround:"brackets"===e.autoSurround||"languageDefined"===e.autoSurround}class UL{static indent(e,t,i){if(null===t||null===i)return[];const n=[];for(let t=0,o=i.length;t<o;t++)n[t]=new uL(i[t],{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return n}static outdent(e,t,i){const n=[];for(let t=0,o=i.length;t<o;t++)n[t]=new uL(i[t],{isUnshift:!0,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return n}static paste(e,t,i,n,o,s){return DL.getEdits(e,t,i,n,o,s)}static tab(e,t,i){return IL.getCommands(e,t,i)}static compositionType(e,t,i,n,o,s,r,a){return EL.getEdits(e,t,i,n,o,s,r,a)}static compositionEndWithInterceptors(e,t,i,n,o,s){if(!n)return null;let r=null;for(const e of n)if(null===r)r=e.insertedText;else if(r!==e.insertedText)return null;if(!r||1!==r.length)return yL.getEdits(t,n);const a=r;let l=!1;for(const e of n)if(0!==e.deletedText.length){l=!0;break}if(l){if(!zL(t,a)||!t.surroundingPairs.hasOwnProperty(a))return null;const e=Wk(a);for(const t of n){if(0!==t.deletedSelectionStart||t.deletedSelectionEnd!==t.deletedText.length)return null;if(/^[ \t]+$/.test(t.deletedText))return null;if(e&&Wk(t.deletedText))return null}const i=[];for(const e of o){if(!e.isEmpty())return null;i.push(e.getPosition())}if(i.length!==n.length)return null;const s=[];for(let e=0,o=i.length;e<o;e++)s.push(new pL(i[e],n[e].deletedText,t.surroundingPairs[a]));return new Bk(4,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const d=wL.getEdits(t,i,o,s,a);if(void 0!==d)return d;const h=CL.getEdits(t,i,o,a,!0,!1);return void 0!==h?h:yL.getEdits(t,n)}static typeWithInterceptors(e,t,i,n,o,s,r){const a=LL.getEdits(i,n,o,r,e);if(void 0!==a)return a;const l=vL.getEdits(i,n,o,r,e);if(void 0!==l)return l;const d=bL.getEdits(t,i,n,o,s,r);if(void 0!==d)return d;const h=CL.getEdits(i,n,o,r,!1,e);if(void 0!==h)return h;const c=SL.getEdits(i,n,o,r,e);if(void 0!==c)return c;const u=xL.getEdits(t,i,n,o,r,e);return void 0!==u?u:kL.getEdits(i,t,o,r,e)}static typeWithoutInterceptors(e,t,i,n,o){return NL.getEdits(e,n,o)}}class KL{constructor(e,t,i,n,o,s,r){this.deletedText=e,this.deletedSelectionStart=t,this.deletedSelectionEnd=i,this.insertedText=n,this.insertedSelectionStart=o,this.insertedSelectionEnd=s,this.insertedTextRange=r}}class jL extends Ou{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditorCommand(n,i||{})}}var qL,$L,GL;!function(e){e.metadata={description:"Scroll editor in the given direction",args:[{name:"Editor scroll argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'to': A mandatory direction value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'up', 'down'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'by': Unit to move. Default is computed based on 'to' value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'line', 'wrappedLine', 'page', 'halfPage', 'editor'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'value': Number of units to move. Default is '1'.\n\t\t\t\t\t* 'revealCursor': If 'true' reveals the cursor if it is outside view port.\n\t\t\t\t",constraint:function(e){if(!dt(e))return!1;const t=e;return!(!lt(t.to)||!pt(t.by)&&!lt(t.by)||!pt(t.value)&&!ct(t.value)||!pt(t.revealCursor)&&!gt(t.revealCursor))},schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["up","down"]},by:{type:"string",enum:["line","wrappedLine","page","halfPage","editor"]},value:{type:"number",default:1},revealCursor:{type:"boolean"}}}}]},e.RawDirection={Up:"up",Right:"right",Down:"down",Left:"left"},e.RawUnit={Line:"line",WrappedLine:"wrappedLine",Page:"page",HalfPage:"halfPage",Editor:"editor",Column:"column"},e.parse=function(t){let i,n;switch(t.to){case e.RawDirection.Up:i=1;break;case e.RawDirection.Right:i=2;break;case e.RawDirection.Down:i=3;break;case e.RawDirection.Left:i=4;break;default:return null}switch(t.by){case e.RawUnit.Line:n=1;break;case e.RawUnit.WrappedLine:n=2;break;case e.RawUnit.Page:n=3;break;case e.RawUnit.HalfPage:n=4;break;case e.RawUnit.Editor:n=5;break;case e.RawUnit.Column:n=6;break;default:n=2}return{direction:i,unit:n,value:Math.floor(t.value||1),revealCursor:!!t.revealCursor,select:!!t.select}}}(qL||(qL={})),function(e){e.metadata={description:"Reveal the given line at the given logical position",args:[{name:"Reveal line argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'lineNumber': A mandatory line number value.\n\t\t\t\t\t* 'at': Logical position at which line has to be revealed.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'top', 'center', 'bottom'\n\t\t\t\t\t\t```\n\t\t\t\t",constraint:function(e){if(!dt(e))return!1;const t=e;return!(!ct(t.lineNumber)&&!lt(t.lineNumber)||!pt(t.at)&&!lt(t.at))},schema:{type:"object",required:["lineNumber"],properties:{lineNumber:{type:["number","string"]},at:{type:"string",enum:["top","center","bottom"]}}}}]},e.RawAtArgument={Top:"top",Center:"center",Bottom:"bottom"}}($L||($L={}));class ZL{constructor(e){e.addImplementation(1e4,"code-editor",((e,t)=>{const i=e.get(sc).getFocusedCodeEditor();return!(!i||!i.hasTextFocus())&&this._runEditorCommand(e,i,t)})),e.addImplementation(1e3,"generic-dom-input-textarea",((e,t)=>{const i=Va();return!(!i||!vl(i)||(this.runDOMCommand(i),0))})),e.addImplementation(0,"generic-dom",((e,t)=>{const i=e.get(sc).getActiveCodeEditor();return!!i&&(i.focus(),this._runEditorCommand(e,i,t))}))}_runEditorCommand(e,t,i){return this.runEditorCommand(e,t,i)||!0}}!function(e){class t extends jL{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[iL.moveTo(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)])&&2!==t.revealType&&e.revealAllCursors(t.source,!0,!0))}}e.MoveTo=Vu(new t({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),e.MoveToSelect=Vu(new t({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class i extends jL{runCoreEditorCommand(e,t){e.model.pushStackElement();const i=this._getColumnSelectResult(e,e.getPrimaryCursorState(),e.getCursorColumnSelectData(),t);null!==i&&(e.setCursorStates(t.source,3,i.viewStates.map((e=>Rk.fromViewState(e)))),e.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:i.fromLineNumber,fromViewVisualColumn:i.fromVisualColumn,toViewLineNumber:i.toLineNumber,toViewVisualColumn:i.toVisualColumn}),i.reversed?e.revealTopMostCursor(t.source):e.revealBottomMostCursor(t.source))}}e.ColumnSelect=Vu(new class extends i{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(e,t,i,n){if(void 0===n.position||void 0===n.viewPosition||void 0===n.mouseColumn)return null;const o=e.model.validatePosition(n.position),s=e.coordinatesConverter.validateViewPosition(new rc(n.viewPosition.lineNumber,n.viewPosition.column),o),r=n.doColumnSelect?i.fromViewLineNumber:s.lineNumber,a=n.doColumnSelect?i.fromViewVisualColumn:n.mouseColumn-1;return Vk.columnSelect(e.cursorConfig,e,r,a,s.lineNumber,n.mouseColumn-1)}}),e.CursorColumnSelectLeft=Vu(new class extends i{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return Vk.columnSelectLeft(e.cursorConfig,e,i)}}),e.CursorColumnSelectRight=Vu(new class extends i{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return Vk.columnSelectRight(e.cursorConfig,e,i)}});class n extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return Vk.columnSelectUp(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectUp=Vu(new n({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:3600,linux:{primary:0}}})),e.CursorColumnSelectPageUp=Vu(new n({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:3595,linux:{primary:0}}}));class o extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return Vk.columnSelectDown(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectDown=Vu(new o({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:3602,linux:{primary:0}}})),e.CursorColumnSelectPageDown=Vu(new o({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:3596,linux:{primary:0}}}));class s extends jL{constructor(){super({id:"cursorMove",precondition:void 0,metadata:nL.metadata})}runCoreEditorCommand(e,t){const i=nL.parse(t);i&&this._runCursorMove(e,t.source,i)}_runCursorMove(e,t,i){e.model.pushStackElement(),e.setCursorStates(t,3,s._move(e,e.getCursorStates(),i)),e.revealAllCursors(t,!0)}static _move(e,t,i){const n=i.select,o=i.value;switch(i.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return iL.simpleMove(e,t,i.direction,n,o,i.unit);case 11:case 13:case 12:case 14:return iL.viewportMove(e,t,i.direction,n,o);default:return null}}}e.CursorMoveImpl=s,e.CursorMove=Vu(new s);class r extends jL{constructor(e){super(e),this._staticArgs=e.args}runCoreEditorCommand(e,t){let i=this._staticArgs;-1===this._staticArgs.value&&(i={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:t.pageSize||e.cursorConfig.pageSize}),e.model.pushStackElement(),e.setCursorStates(t.source,3,iL.simpleMove(e,e.getCursorStates(),i.direction,i.select,i.value,i.unit)),e.revealAllCursors(t.source,!0)}}e.CursorLeft=Vu(new r({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),e.CursorLeftSelect=Vu(new r({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:1039}})),e.CursorRight=Vu(new r({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),e.CursorRightSelect=Vu(new r({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:1041}})),e.CursorUp=Vu(new r({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),e.CursorUpSelect=Vu(new r({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),e.CursorPageUp=Vu(new r({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:11}})),e.CursorPageUpSelect=Vu(new r({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:1035}})),e.CursorDown=Vu(new r({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),e.CursorDownSelect=Vu(new r({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),e.CursorPageDown=Vu(new r({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:12}})),e.CursorPageDownSelect=Vu(new r({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:1036}})),e.CreateCursor=Vu(new class extends jL{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;let i;i=t.wholeLine?iL.line(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition):iL.moveTo(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition);const n=e.getCursorStates();if(n.length>1){const o=i.modelState?i.modelState.position:null,s=i.viewState?i.viewState.position:null;for(let i=0,r=n.length;i<r;i++){const r=n[i];if((!o||r.modelState.selection.containsPosition(o))&&(!s||r.viewState.selection.containsPosition(s)))return n.splice(i,1),e.model.pushStackElement(),void e.setCursorStates(t.source,3,n)}}n.push(i),e.model.pushStackElement(),e.setCursorStates(t.source,3,n)}}),e.LastCursorMoveToSelect=Vu(new class extends jL{constructor(){super({id:"_lastCursorMoveToSelect",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0);o[i]=iL.moveTo(e,n[i],!0,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}});class a extends jL{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,iL.moveToBeginningOfLine(e,e.getCursorStates(),this._inSelectionMode)),e.revealAllCursors(t.source,!0)}}e.CursorHome=Vu(new a({inSelectionMode:!1,id:"cursorHome",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:14,mac:{primary:14,secondary:[2063]}}})),e.CursorHomeSelect=Vu(new a({inSelectionMode:!0,id:"cursorHomeSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:1038,mac:{primary:1038,secondary:[3087]}}}));class l extends jL{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,this._exec(e.getCursorStates())),e.revealAllCursors(t.source,!0)}_exec(e){const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i],o=n.modelState.position.lineNumber;t[i]=Rk.fromModelState(n.modelState.move(this._inSelectionMode,o,1,0))}return t}}e.CursorLineStart=Vu(new l({inSelectionMode:!1,id:"cursorLineStart",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:0,mac:{primary:287}}})),e.CursorLineStartSelect=Vu(new l({inSelectionMode:!0,id:"cursorLineStartSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:0,mac:{primary:1311}}}));class d extends jL{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,iL.moveToEndOfLine(e,e.getCursorStates(),this._inSelectionMode,t.sticky||!1)),e.revealAllCursors(t.source,!0)}}e.CursorEnd=Vu(new d({inSelectionMode:!1,id:"cursorEnd",precondition:void 0,kbOpts:{args:{sticky:!1},weight:0,kbExpr:Xu.textInputFocus,primary:13,mac:{primary:13,secondary:[2065]}},metadata:{description:"Go to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:y(61,"Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}})),e.CursorEndSelect=Vu(new d({inSelectionMode:!0,id:"cursorEndSelect",precondition:void 0,kbOpts:{args:{sticky:!1},weight:0,kbExpr:Xu.textInputFocus,primary:1037,mac:{primary:1037,secondary:[3089]}},metadata:{description:"Select to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:y(62,"Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}}));class h extends jL{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,this._exec(e,e.getCursorStates())),e.revealAllCursors(t.source,!0)}_exec(e,t){const i=[];for(let n=0,o=t.length;n<o;n++){const o=t[n],s=o.modelState.position.lineNumber,r=e.model.getLineMaxColumn(s);i[n]=Rk.fromModelState(o.modelState.move(this._inSelectionMode,s,r,0))}return i}}e.CursorLineEnd=Vu(new h({inSelectionMode:!1,id:"cursorLineEnd",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:0,mac:{primary:291}}})),e.CursorLineEndSelect=Vu(new h({inSelectionMode:!0,id:"cursorLineEndSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:0,mac:{primary:1315}}}));class u extends jL{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,iL.moveToBeginningOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealAllCursors(t.source,!0)}}e.CursorTop=Vu(new u({inSelectionMode:!1,id:"cursorTop",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:2062,mac:{primary:2064}}})),e.CursorTopSelect=Vu(new u({inSelectionMode:!0,id:"cursorTopSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:3086,mac:{primary:3088}}}));class g extends jL{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,iL.moveToEndOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealAllCursors(t.source,!0)}}e.CursorBottom=Vu(new g({inSelectionMode:!1,id:"cursorBottom",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:2061,mac:{primary:2066}}})),e.CursorBottomSelect=Vu(new g({inSelectionMode:!0,id:"cursorBottomSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:3085,mac:{primary:3090}}}));class p extends jL{constructor(){super({id:"editorScroll",precondition:void 0,metadata:qL.metadata})}determineScrollMethod(e){return[6].includes(e.unit)&&[4,2].includes(e.direction)?this._runHorizontalEditorScroll.bind(this):[1,2,3,4,5,6].includes(e.unit)&&[1,3].includes(e.direction)?this._runVerticalEditorScroll.bind(this):null}runCoreEditorCommand(e,t){const i=qL.parse(t);if(!i)return;const n=this.determineScrollMethod(i);n&&n(e,t.source,i)}_runVerticalEditorScroll(e,t,i){const n=this._computeDesiredScrollTop(e,i);if(i.revealCursor){const o=e.getCompletelyVisibleViewRangeAtScrollTop(n);e.setCursorStates(t,3,[iL.findPositionInViewportIfOutside(e,e.getPrimaryCursorState(),o,i.select)])}e.viewLayout.setScrollPosition({scrollTop:n},0)}_computeDesiredScrollTop(e,t){if(1===t.unit){const i=e.viewLayout.getFutureViewport(),n=e.getCompletelyVisibleViewRangeAtScrollTop(i.top),o=e.coordinatesConverter.convertViewRangeToModelRange(n);let s;s=1===t.direction?Math.max(1,o.startLineNumber-t.value):Math.min(e.model.getLineCount(),o.startLineNumber+t.value);const r=e.coordinatesConverter.convertModelPositionToViewPosition(new rc(s,1));return e.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber)}if(5===t.unit){let i=0;return 3===t.direction&&(i=e.model.getLineCount()-e.cursorConfig.pageSize),e.viewLayout.getVerticalOffsetForLineNumber(i)}let i;i=3===t.unit?e.cursorConfig.pageSize*t.value:4===t.unit?Math.round(e.cursorConfig.pageSize/2)*t.value:t.value;const n=(1===t.direction?-1:1)*i;return e.viewLayout.getCurrentScrollTop()+n*e.cursorConfig.lineHeight}_runHorizontalEditorScroll(e,t,i){const n=this._computeDesiredScrollLeft(e,i);e.viewLayout.setScrollPosition({scrollLeft:n},0)}_computeDesiredScrollLeft(e,t){const i=(4===t.direction?-1:1)*t.value;return e.viewLayout.getCurrentScrollLeft()+i*e.cursorConfig.typicalHalfwidthCharacterWidth}}e.EditorScrollImpl=p,e.EditorScroll=Vu(new p),e.ScrollLineUp=Vu(new class extends jL{constructor(){super({id:"scrollLineUp",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:2064,mac:{primary:267}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:qL.RawDirection.Up,by:qL.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollPageUp=Vu(new class extends jL{constructor(){super({id:"scrollPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:2059,win:{primary:523},linux:{primary:523}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:qL.RawDirection.Up,by:qL.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollEditorTop=Vu(new class extends jL{constructor(){super({id:"scrollEditorTop",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:qL.RawDirection.Up,by:qL.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollLineDown=Vu(new class extends jL{constructor(){super({id:"scrollLineDown",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:2066,mac:{primary:268}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:qL.RawDirection.Down,by:qL.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollPageDown=Vu(new class extends jL{constructor(){super({id:"scrollPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:2060,win:{primary:524},linux:{primary:524}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:qL.RawDirection.Down,by:qL.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollEditorBottom=Vu(new class extends jL{constructor(){super({id:"scrollEditorBottom",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:qL.RawDirection.Down,by:qL.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollLeft=Vu(new class extends jL{constructor(){super({id:"scrollLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:qL.RawDirection.Left,by:qL.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollRight=Vu(new class extends jL{constructor(){super({id:"scrollRight",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:qL.RawDirection.Right,by:qL.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:i.source})}});class m extends jL{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[iL.word(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position)]),2!==t.revealType&&e.revealAllCursors(t.source,!0,!0))}}e.WordSelect=Vu(new m({inSelectionMode:!1,id:"_wordSelect",precondition:void 0})),e.WordSelectDrag=Vu(new m({inSelectionMode:!0,id:"_wordSelectDrag",precondition:void 0})),e.LastCursorWordSelect=Vu(new class extends jL{constructor(){super({id:"lastCursorWordSelect",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0),s=n[i];o[i]=iL.word(e,s,s.modelState.hasSelection(),t.position),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}});class f extends jL{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[iL.line(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)]),2!==t.revealType&&e.revealAllCursors(t.source,!1,!0))}}e.LineSelect=Vu(new f({inSelectionMode:!1,id:"_lineSelect",precondition:void 0})),e.LineSelectDrag=Vu(new f({inSelectionMode:!0,id:"_lineSelectDrag",precondition:void 0}));class _ extends jL{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){if(!t.position)return;const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0);o[i]=iL.line(e,n[i],this._inSelectionMode,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}}e.LastCursorLineSelect=Vu(new _({inSelectionMode:!1,id:"lastCursorLineSelect",precondition:void 0})),e.LastCursorLineSelectDrag=Vu(new _({inSelectionMode:!0,id:"lastCursorLineSelectDrag",precondition:void 0})),e.CancelSelection=Vu(new class extends jL{constructor(){super({id:"cancelSelection",precondition:Xu.hasNonEmptySelection,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[iL.cancelSelection(e,e.getPrimaryCursorState())]),e.revealAllCursors(t.source,!0)}}),e.RemoveSecondaryCursors=Vu(new class extends jL{constructor(){super({id:"removeSecondaryCursors",precondition:Xu.hasMultipleSelections,kbOpts:{weight:1,kbExpr:Xu.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[e.getPrimaryCursorState()]),e.revealAllCursors(t.source,!0),Ql(y(63,"Removed secondary cursors"))}}),e.RevealLine=Vu(new class extends jL{constructor(){super({id:"revealLine",precondition:void 0,metadata:$L.metadata})}runCoreEditorCommand(e,t){const i=t,n=i.lineNumber||0;let o="number"==typeof n?n+1:parseInt(n)+1;o<1&&(o=1);const s=e.model.getLineCount();o>s&&(o=s);const r=new Yu(o,1,o,e.model.getLineMaxColumn(o));let a=0;if(i.at)switch(i.at){case $L.RawAtArgument.Top:a=3;break;case $L.RawAtArgument.Center:a=1;break;case $L.RawAtArgument.Bottom:a=4}const l=e.coordinatesConverter.convertModelRangeToViewRange(r);e.revealRange(t.source,!1,l,a,0)}}),e.SelectAll=new class extends ZL{constructor(){super(Zu)}runDOMCommand(e){c&&(e.focus(),e.select()),e.ownerDocument.execCommand("selectAll")}runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditorCommand(n,i)}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates("keyboard",3,[iL.selectAll(e,e.getPrimaryCursorState())])}},e.SetSelection=Vu(new class extends jL{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(e,t){t.selection&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[Rk.fromModelSelection(t.selection)]))}})}(GL||(GL={}));const YL=Ac.and(Xu.textInputFocus,Xu.columnSelection);function QL(e,t){lu.registerKeybindingRule({id:e,primary:t,when:YL,weight:1})}function XL(e){return e.register(),e}var JL;QL(GL.CursorColumnSelectLeft.id,1039),QL(GL.CursorColumnSelectRight.id,1041),QL(GL.CursorColumnSelectUp.id,1040),QL(GL.CursorColumnSelectPageUp.id,1035),QL(GL.CursorColumnSelectDown.id,1042),QL(GL.CursorColumnSelectPageDown.id,1036),function(e){class t extends Ou{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditingCommand(t,n,i||{})}}e.CoreEditingCommand=t,e.LineBreakInsert=Vu(new class extends t{constructor(){super({id:"lineBreakInsert",precondition:Xu.writable,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,LL.lineBreakInsert(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection))))}}),e.Outdent=Vu(new class extends t{constructor(){super({id:"outdent",precondition:Xu.writable,kbOpts:{weight:0,kbExpr:Ac.and(Xu.editorTextFocus,Xu.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,UL.outdent(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)))),e.pushUndoStop()}}),e.Tab=Vu(new class extends t{constructor(){super({id:"tab",precondition:Xu.writable,kbOpts:{weight:0,kbExpr:Ac.and(Xu.editorTextFocus,Xu.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,UL.tab(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)))),e.pushUndoStop()}}),e.DeleteLeft=Vu(new class extends t{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(e,t,i){const[n,o]=Xk.deleteLeft(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)),t.getCursorAutoClosedCharacters());n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(2)}}),e.DeleteRight=Vu(new class extends t{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(e,t,i){const[n,o]=Xk.deleteRight(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)));n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(3)}}),e.Undo=new class extends ZL{constructor(){super($u)}runDOMCommand(e){e.ownerDocument.execCommand("undo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(104))return t.getModel().undo()}},e.Redo=new class extends ZL{constructor(){super(Gu)}runDOMCommand(e){e.ownerDocument.execCommand("redo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(104))return t.getModel().redo()}}}(JL||(JL={}));class eD extends Mu{constructor(e,t,i){super({id:e,precondition:void 0,metadata:i}),this._handlerId=t}runCommand(e,t){const i=e.get(sc).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function tD(e,t){XL(new eD("default:"+e,e)),XL(new eD(e,e,t))}tD("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]}),tD("replacePreviousChar"),tD("compositionType"),tD("compositionStart"),tD("compositionEnd"),tD("paste"),tD("cut");class iD{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,o=this._selection.endColumn;if((!this._isMovingLeft||1!==n)&&(this._isMovingLeft||o!==e.getLineMaxColumn(i)))if(this._isMovingLeft){const s=new Yu(i,n-1,i,n),r=e.getValueInRange(s);t.addEditOperation(s,null),t.addEditOperation(new Yu(i,o,i,o),r)}else{const s=new Yu(i,o,i,o+1),r=e.getValueInRange(s);t.addEditOperation(s,null),t.addEditOperation(new Yu(i,n,i,n),r)}}computeCursorState(e,t){return this._isMovingLeft?new Qu(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new Qu(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class nD extends Pu{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const e of n)i.push(new iD(e,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}Hu(class extends nD{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:x(806,"Move Selected Text Left"),precondition:Xu.writable})}}),Hu(class extends nD{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:x(807,"Move Selected Text Right"),precondition:Xu.writable})}}),Hu(class extends Pu{constructor(){super({id:"editor.action.transposeLetters",label:x(808,"Transpose Letters"),precondition:Xu.writable,kbOpts:{kbExpr:Xu.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],o=t.getSelections();for(const e of o){if(!e.isEmpty())continue;const t=e.startLineNumber,o=e.startColumn,s=i.getLineMaxColumn(t);if(1===t&&(1===o||2===o&&2===s))continue;const r=o===s?e.getPosition():Qk.rightPosition(i,e.getPosition().lineNumber,e.getPosition().column),a=Qk.leftPosition(i,r),l=Qk.leftPosition(i,a),d=i.getValueInRange(Yu.fromPositions(l,a)),h=i.getValueInRange(Yu.fromPositions(a,r)),c=Yu.fromPositions(l,r);n.push(new Hk(c,h+d))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}});const oD=oc("clipboardService"),sD=oc("productService");function rD(e,t,i,n){const o=e.getPlainTextToCopy(t,i,q),s=e.model.getEOL(),r=i&&1===t.length&&t[0].isEmpty(),a=Array.isArray(o)?o:null,l=Array.isArray(o)?o.join(s):o;let d,h=null;if(lD.forceCopyWithSyntaxHighlighting||n&&l.length<65536){const n=e.getRichTextToCopy(t,i);n&&(d=n.html,h=n.mode)}return{isFromEmptySelection:r,multicursorText:a,text:l,html:d,mode:h}}class aD{static{this.INSTANCE=new aD}constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}}const lD={forceCopyWithSyntaxHighlighting:!1},dD={getTextData(e){const t=e.getData(yp.text);let i=null;const n=e.getData("vscode-editor-data");if("string"==typeof n)try{i=JSON.parse(n),1!==i.version&&(i=null)}catch(e){}return 0===t.length&&null===i&&e.files.length>0?[Array.prototype.slice.call(e.files,0).map((e=>e.name)).join("\n"),null]:[t,i]},setTextData(e,t,i,n){e.setData(yp.text,t),"string"==typeof i&&e.setData("text/html",i),e.setData("vscode-editor-data",JSON.stringify(n))}},hD=new class{constructor(){this._nativeEditContextMapping=new Map}register(e,t){return this._nativeEditContextMapping.set(e,t),{dispose:()=>{this._nativeEditContextMapping.delete(e)}}}get(e){return this._nativeEditContextMapping.get(e)}};function cD(e,t){return{id:t,asString:async()=>e,asFile:()=>{},value:"string"==typeof e?e:void 0}}class uD{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return Ct.some(this,(([e,t])=>t.asFile()))&&t.push("files"),mD(gD(e),t)}get(e){return this._entries.get(this.toKey(e))?.[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return gD(e)}}function gD(e){return e.toLowerCase()}function pD(e,t){return mD(gD(e),t.map(gD))}function mD(e,t){if("*/*"===e)return t.length>0;if(t.includes(e))return!0;const i=e.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!i)return!1;const[n,o,s]=i;return"*"===s&&t.some((e=>e.startsWith(o+"/")))}const fD=Object.freeze({create:e=>cs(e.map((e=>e.toString()))).join("\r\n"),split:e=>e.split("\r\n"),parse:e=>fD.split(e).filter((e=>!e.startsWith("#")))});class _D{static{this.sep="."}static{this.None=new _D("@@none@@")}static{this.Empty=new _D("")}constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||""===this.value||e.value.startsWith(this.value+_D.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new _D((this.value?[this.value,...e]:e).join(_D.sep))}}const vD=oc("progressService");Object.freeze({total(){},worked(){},done(){}});class bD{static{this.None=Object.freeze({report(){}})}constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}}const wD=oc("editorProgressService"),CD={ctrlCmd:!1,alt:!1};var yD,SD,xD,kD;!function(e){e[e.Blur=1]="Blur",e[e.Gesture=2]="Gesture",e[e.Other=3]="Other"}(yD||(yD={})),function(e){e[e.NONE=0]="NONE",e[e.FIRST=1]="FIRST",e[e.SECOND=2]="SECOND",e[e.LAST=3]="LAST"}(SD||(SD={})),function(e){e[e.First=1]="First",e[e.Second=2]="Second",e[e.Last=3]="Last",e[e.Next=4]="Next",e[e.Previous=5]="Previous",e[e.NextPage=6]="NextPage",e[e.PreviousPage=7]="PreviousPage",e[e.NextSeparator=8]="NextSeparator",e[e.PreviousSeparator=9]="PreviousSeparator"}(xD||(xD={})),function(e){e[e.Title=1]="Title",e[e.Inline=2]="Inline"}(kD||(kD={})),new class{constructor(e){this.options=e}};const LD=oc("quickInputService"),DD={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:yp.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"};ru.add("workbench.contributions.dragAndDrop",new class{});class ED{static{this.INSTANCE=new ED}constructor(){}static getInstance(){return ED.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}function ND(e){if(Z&&"function"==typeof globalThis.vscode?.webUtils?.getPathForFile)return globalThis.vscode.webUtils.getPathForFile(e)}function ID(e){const t=new uD;for(const i of e.items){const e=i.type;if("string"===i.kind){const n=new Promise((e=>i.getAsString(e)));t.append(e,cD(n))}else if("file"===i.kind){const n=i.getAsFile();n&&t.append(e,TD(n))}}return t}function TD(e){const t=ND(e),i=t?uo.parse(t):void 0;return function(e,t,i){const n={id:_C(),name:e,uri:t,data:i};return{id:void 0,asString:async()=>"",asFile:()=>n,value:void 0}}(e.name,i,(async()=>new Uint8Array(await e.arrayBuffer())))}const MD=Object.freeze(["CodeEditors","CodeFiles",DD.RESOURCES,DD.INTERNAL_URI_LIST]);function AD(e,t=!1){const i=ID(e),n=i.get(DD.INTERNAL_URI_LIST);if(n)i.replace(yp.uriList,n);else if(t||!i.has(yp.uriList)){const t=[];for(const i of e.items){const e=i.getAsFile();if(e){const i=ND(e);try{i?t.push(uo.file(i).toString()):t.push(uo.parse(e.name,!0).toString())}catch{}}}t.length&&i.replace(yp.uriList,cD(fD.create(t)))}for(const e of MD)i.delete(e);return i}const RD=oc("IWorkspaceEditService");class OD{constructor(e){this.metadata=e}static convert(e){return e.edits.map((e=>{if(PD.is(e))return PD.lift(e);if(FD.is(e))return FD.lift(e);throw new Error("Unsupported edit")}))}}class PD extends OD{static is(e){return e instanceof PD||dt(e)&&uo.isUri(e.resource)&&dt(e.textEdit)}static lift(e){return e instanceof PD?e:new PD(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i}}class FD extends OD{static is(e){return e instanceof FD||dt(e)&&(Boolean(e.newResource)||Boolean(e.oldResource))}static lift(e){return e instanceof FD?e:new FD(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},n){super(n),this.oldResource=e,this.newResource=t,this.options=i}}const BD=oc("ILanguageFeaturesService"),WD=oc("IEditorCancelService"),VD=new Jc("cancellableOperation",!1,y(934,"Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));wp(WD,class{constructor(){this._tokens=new WeakMap}add(e,t){let i,n=this._tokens.get(e);return n||(n=e.invokeWithinContext((e=>({key:VD.bindTo(e.get(eu)),tokens:new Wt}))),this._tokens.set(e,n)),n.key.set(!0),i=n.tokens.push(t),()=>{i&&(i(),n.key.set(!n.tokens.isEmpty()),i=void 0)}}cancel(e){const t=this._tokens.get(e);if(!t)return;const i=t.tokens.pop();i&&(i.cancel(),t.key.set(!t.tokens.isEmpty()))}},1);class HD extends ri{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext((t=>t.get(WD).add(e,this)))}dispose(){this._unregister(),super.dispose()}}Vu(new class extends Ou{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:VD})}runEditorCommand(e,t){e.get(WD).cancel(t)}});class zD{constructor(e,t){if(this.flags=t,1&this.flags){const t=e.getModel();this.modelVersionId=t?Bi("{0}#{1}",t.uri.toString(),t.getVersionId()):null}else this.modelVersionId=null;4&this.flags?this.position=e.getPosition():this.position=null,2&this.flags?this.selection=e.getSelection():this.selection=null,8&this.flags?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof zD))return!1;const t=e;return this.modelVersionId===t.modelVersionId&&this.scrollLeft===t.scrollLeft&&this.scrollTop===t.scrollTop&&!(!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position))&&!(!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new zD(e,this.flags))}}class UD extends HD{constructor(e,t,i,n){super(e,n),this._listener=new Mt,4&t&&this._listener.add(e.onDidChangeCursorPosition((e=>{i&&Yu.containsPosition(i,e.position)||this.cancel()}))),2&t&&this._listener.add(e.onDidChangeCursorSelection((e=>{i&&Yu.containsRange(i,e.selection)||this.cancel()}))),8&t&&this._listener.add(e.onDidScrollChange((e=>this.cancel()))),1&t&&(this._listener.add(e.onDidChangeModel((e=>this.cancel()))),this._listener.add(e.onDidChangeModelContent((e=>this.cancel()))))}dispose(){this._listener.dispose(),super.dispose()}}class KD extends ri{constructor(e,t){super(t),this._listener=e.onDidChangeContent((()=>this.cancel()))}dispose(){this._listener.dispose(),super.dispose()}}var jD=i(8129),qD={};qD.styleTagTransform=zl(),qD.setAttributes=Bl(),qD.insert=Pl().bind(null,"head"),qD.domAPI=Rl(),qD.insertStyleElement=Vl(),Ml()(jD.A,qD),jD.A&&jD.A.locals&&jD.A.locals;const $D=bk.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:" ",inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class GD extends At{static{this.baseId="editor.widget.inlineProgressWidget"}constructor(e,t,i,n,o){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=ll(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=ll("span.icon");this.domNode.append(t),t.classList.add(...vh.asClassNameArray(fh.loading),"codicon-modifier-spin");const i=()=>{const e=this.editor.getOption(75);this.domNode.style.height=`${e}px`,this.domNode.style.width=`${Math.ceil(.8*e)}px`};i(),this._register(this.editor.onDidChangeConfiguration((e=>{(e.hasChanged(61)||e.hasChanged(75))&&i()}))),this._register(ga(this.domNode,Qa.CLICK,(e=>{this.delegate.cancel()})))}getId(){return GD.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}}let ZD=class extends At{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Rt),this._currentWidget=this._register(new Rt),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,n,o){const s=this._operationIdPool++;this._currentOperation=s,this.clear(),this._showPromise.value=fi((()=>{const i=Yu.fromPositions(e);this._currentDecorations.set([{range:i,options:$D}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(GD,this.id,this._editor,i,t,n))}),o??this._showDelay);try{return await i}finally{this._currentOperation===s&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};ZD=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(2,nc)],ZD);class YD{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const QD=new YD("id#");let XD={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function JD(e){XD=e}const eE=/[&<>"']/,tE=new RegExp(eE.source,"g"),iE=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,nE=new RegExp(iE.source,"g"),oE={"&":"&","<":"<",">":">",'"':""","'":"'"},sE=e=>oE[e];function rE(e,t){if(t){if(eE.test(e))return e.replace(tE,sE)}else if(iE.test(e))return e.replace(nE,sE);return e}const aE=/(^|[^\[])\^/g;function lE(e,t){let i="string"==typeof e?e:e.source;t=t||"";const n={replace:(e,t)=>{let o="string"==typeof t?t:t.source;return o=o.replace(aE,"$1"),i=i.replace(e,o),n},getRegex:()=>new RegExp(i,t)};return n}function dE(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}const hE={exec:()=>null};function cE(e,t){const i=e.replace(/\|/g,((e,t,i)=>{let n=!1,o=t;for(;--o>=0&&"\\"===i[o];)n=!n;return n?"|":" |"})).split(/ \|/);let n=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(/\\\|/g,"|");return i}function uE(e,t,i){const n=e.length;if(0===n)return"";let o=0;for(;o<n;){const s=e.charAt(n-o-1);if(s!==t||i){if(s===t||!i)break;o++}else o++}return e.slice(0,n-o)}function gE(e,t,i,n){const o=t.href,s=t.title?rE(t.title):null,r=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;const e={type:"link",raw:i,href:o,title:s,text:r,tokens:n.inlineTokens(r)};return n.state.inLink=!1,e}return{type:"image",raw:i,href:o,title:s,text:rE(r)}}class pE{options;rules;lexer;constructor(e){this.options=e||XD}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:uE(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],i=function(e,t){const i=e.match(/^(\s+)(?:```)/);if(null===i)return t;const n=i[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[i]=t;return i.length>=n.length?e.slice(n.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=uE(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:uE(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=uE(t[0],"\n").split("\n"),i="",n="";const o=[];for(;e.length>0;){let t=!1;const s=[];let r;for(r=0;r<e.length;r++)if(/^ {0,3}>/.test(e[r]))s.push(e[r]),t=!0;else{if(t)break;s.push(e[r])}e=e.slice(r);const a=s.join("\n"),l=a.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1").replace(/^ {0,3}>[ \t]?/gm,"");i=i?`${i}\n${a}`:a,n=n?`${n}\n${l}`:l;const d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,o,!0),this.lexer.state.top=d,0===e.length)break;const h=o[o.length-1];if("code"===h?.type)break;if("blockquote"===h?.type){const t=h,s=t.raw+"\n"+e.join("\n"),r=this.blockquote(s);o[o.length-1]=r,i=i.substring(0,i.length-t.raw.length)+r.raw,n=n.substring(0,n.length-t.text.length)+r.text;break}if("list"!==h?.type);else{const t=h,s=t.raw+"\n"+e.join("\n"),r=this.list(s);o[o.length-1]=r,i=i.substring(0,i.length-h.raw.length)+r.raw,n=n.substring(0,n.length-t.raw.length)+r.raw,e=s.substring(o[o.length-1].raw.length).split("\n")}}return{type:"blockquote",raw:i,tokens:o,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i=t[1].trim();const n=i.length>1,o={type:"list",raw:"",ordered:n,start:n?+i.slice(0,-1):"",loose:!1,items:[]};i=n?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=n?i:"[*+-]");const s=new RegExp(`^( {0,3}${i})((?:[\t ][^\\n]*)?(?:\\n|$))`);let r=!1;for(;e;){let i=!1,n="",a="";if(!(t=s.exec(e)))break;if(this.rules.block.hr.test(e))break;n=t[0],e=e.substring(n.length);let l=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),d=e.split("\n",1)[0],h=!l.trim(),c=0;if(this.options.pedantic?(c=2,a=l.trimStart()):h?c=t[1].length+1:(c=t[2].search(/[^ ]/),c=c>4?1:c,a=l.slice(c),c+=t[1].length),h&&/^ *$/.test(d)&&(n+=d+"\n",e=e.substring(d.length+1),i=!0),!i){const t=new RegExp(`^ {0,${Math.min(3,c-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),i=new RegExp(`^ {0,${Math.min(3,c-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),o=new RegExp(`^ {0,${Math.min(3,c-1)}}(?:\`\`\`|~~~)`),s=new RegExp(`^ {0,${Math.min(3,c-1)}}#`);for(;e;){const r=e.split("\n",1)[0];if(d=r,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),o.test(d))break;if(s.test(d))break;if(t.test(d))break;if(i.test(e))break;if(d.search(/[^ ]/)>=c||!d.trim())a+="\n"+d.slice(c);else{if(h)break;if(l.search(/[^ ]/)>=4)break;if(o.test(l))break;if(s.test(l))break;if(i.test(l))break;a+="\n"+d}h||d.trim()||(h=!0),n+=r+"\n",e=e.substring(r.length+1),l=d.slice(c)}}o.loose||(r?o.loose=!0:/\n *\n *$/.test(n)&&(r=!0));let u,g=null;this.options.gfm&&(g=/^\[[ xX]\] /.exec(a),g&&(u="[ ] "!==g[0],a=a.replace(/^\[[ xX]\] +/,""))),o.items.push({type:"list_item",raw:n,task:!!g,checked:u,loose:!1,text:a,tokens:[]}),o.raw+=n}o.items[o.items.length-1].raw=o.items[o.items.length-1].raw.trimEnd(),o.items[o.items.length-1].text=o.items[o.items.length-1].text.trimEnd(),o.raw=o.raw.trimEnd();for(let e=0;e<o.items.length;e++)if(this.lexer.state.top=!1,o.items[e].tokens=this.lexer.blockTokens(o.items[e].text,[]),!o.loose){const t=o.items[e].tokens.filter((e=>"space"===e.type)),i=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));o.loose=i}if(o.loose)for(let e=0;e<o.items.length;e++)o.items[e].loose=!0;return o}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),i=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:i,title:n}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const i=cE(t[1]),n=t[2].replace(/^\||\| *$/g,"").split("|"),o=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(i.length===n.length){for(const e of n)/^ *-+: *$/.test(e)?s.align.push("right"):/^ *:-+: *$/.test(e)?s.align.push("center"):/^ *:-+ *$/.test(e)?s.align.push("left"):s.align.push(null);for(let e=0;e<i.length;e++)s.header.push({text:i[e],tokens:this.lexer.inline(i[e]),header:!0,align:s.align[e]});for(const e of o)s.rows.push(cE(e,s.header.length).map(((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:s.align[t]}))));return s}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:rE(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=uE(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let i=0;for(let n=0;n<e.length;n++)if("\\"===e[n])n++;else if(e[n]===t[0])i++;else if(e[n]===t[1]&&(i--,i<0))return n;return-1}(t[2],"()");if(e>-1){const i=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,i).trim(),t[3]=""}}let i=t[2],n="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);e&&(i=e[1],n=e[3])}else n=t[3]?t[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(i=this.options.pedantic&&!/>$/.test(e)?i.slice(1):i.slice(1,-1)),gE(t,{href:i?i.replace(this.rules.inline.anyPunctuation,"$1"):i,title:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n},t[0],this.lexer)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){const e=t[(i[2]||i[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=i[0].charAt(0);return{type:"text",raw:e,text:e}}return gE(i,e,i[0],this.lexer)}}emStrong(e,t,i=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(n&&(!n[3]||!i.match(/[\p{L}\p{N}]/u))&&(!n[1]&&!n[2]||!i||this.rules.inline.punctuation.exec(i))){const i=[...n[0]].length-1;let o,s,r=i,a=0;const l="*"===n[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+i);null!=(n=l.exec(t));){if(o=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!o)continue;if(s=[...o].length,n[3]||n[4]){r+=s;continue}if((n[5]||n[6])&&i%3&&!((i+s)%3)){a+=s;continue}if(r-=s,r>0)continue;s=Math.min(s,s+r+a);const t=[...n[0]][0].length,l=e.slice(0,i+n.index+t+s);if(Math.min(i,s)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const d=l.slice(2,-2);return{type:"strong",raw:l,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const i=/[^ ]/.test(e),n=/^ /.test(e)&&/ $/.test(e);return i&&n&&(e=e.substring(1,e.length-1)),e=rE(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,i;return"@"===t[2]?(e=rE(t[1]),i="mailto:"+e):(e=rE(t[1]),i=e),{type:"link",raw:t[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,i;if("@"===t[2])e=rE(t[0]),i="mailto:"+e;else{let n;do{n=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(n!==t[0]);e=rE(t[0]),i="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:rE(t[0]),{type:"text",raw:t[0],text:e}}}}const mE=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,fE=/(?:[*+-]|\d{1,9}[.)])/,_E=lE(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,fE).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),vE=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,bE=/(?!\s*\])(?:\\.|[^\[\]\\])+/,wE=lE(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",bE).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),CE=lE(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,fE).getRegex(),yE="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",SE=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,xE=lE("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",SE).replace("tag",yE).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),kE=lE(vE).replace("hr",mE).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yE).getRegex(),LE={blockquote:lE(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",kE).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:wE,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:mE,html:xE,lheading:_E,list:CE,newline:/^(?: *(?:\n|$))+/,paragraph:kE,table:hE,text:/^[^\n]+/},DE=lE("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",mE).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yE).getRegex(),EE={...LE,table:DE,paragraph:lE(vE).replace("hr",mE).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",DE).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yE).getRegex()},NE={...LE,html:lE("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",SE).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:hE,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:lE(vE).replace("hr",mE).replace("heading"," *#{1,6} *[^\n]").replace("lheading",_E).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},IE=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,TE=/^( {2,}|\\)\n(?!\s*$)/,ME="\\p{P}\\p{S}",AE=lE(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,ME).getRegex(),RE=lE(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,ME).getRegex(),OE=lE("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,ME).getRegex(),PE=lE("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,ME).getRegex(),FE=lE(/\\([punct])/,"gu").replace(/punct/g,ME).getRegex(),BE=lE(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),WE=lE(SE).replace("(?:--\x3e|$)","--\x3e").getRegex(),VE=lE("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",WE).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),HE=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,zE=lE(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",HE).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),UE=lE(/^!?\[(label)\]\[(ref)\]/).replace("label",HE).replace("ref",bE).getRegex(),KE=lE(/^!?\[(ref)\](?:\[\])?/).replace("ref",bE).getRegex(),jE={_backpedal:hE,anyPunctuation:FE,autolink:BE,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:TE,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:hE,emStrongLDelim:RE,emStrongRDelimAst:OE,emStrongRDelimUnd:PE,escape:IE,link:zE,nolink:KE,punctuation:AE,reflink:UE,reflinkSearch:lE("reflink|nolink(?!\\()","g").replace("reflink",UE).replace("nolink",KE).getRegex(),tag:VE,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:hE},qE={...jE,link:lE(/^!?\[(label)\]\((.*?)\)/).replace("label",HE).getRegex(),reflink:lE(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",HE).getRegex()},$E={...jE,escape:lE(IE).replace("])","~|])").getRegex(),url:lE(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},GE={...$E,br:lE(TE).replace("{2,}","*").getRegex(),text:lE($E.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ZE={normal:LE,gfm:EE,pedantic:NE},YE={normal:jE,gfm:$E,breaks:GE,pedantic:qE};class QE{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||XD,this.options.tokenizer=this.options.tokenizer||new pE,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:ZE.normal,inline:YE.normal};this.options.pedantic?(t.block=ZE.pedantic,t.inline=YE.pedantic):this.options.gfm&&(t.block=ZE.gfm,this.options.breaks?t.inline=YE.breaks:t.inline=YE.gfm),this.tokenizer.rules=t}static get rules(){return{block:ZE,inline:YE}}static lex(e,t){return new QE(t).lex(e)}static lexInline(e,t){return new QE(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],i=!1){let n,o,s;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,i)=>t+" ".repeat(i.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((i=>!!(n=i.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),o=t[t.length-1],!o||"paragraph"!==o.type&&"text"!==o.type?t.push(n):(o.raw+="\n"+n.raw,o.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=o.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),o=t[t.length-1],!o||"paragraph"!==o.type&&"text"!==o.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(o.raw+="\n"+n.raw,o.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(s=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const i=e.slice(1);let n;this.options.extensions.startBlock.forEach((e=>{n=e.call({lexer:this},i),"number"==typeof n&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s)))o=t[t.length-1],i&&"paragraph"===o?.type?(o.raw+="\n"+n.raw,o.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):t.push(n),i=s.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),o=t[t.length-1],o&&"text"===o.type?(o.raw+="\n"+n.raw,o.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let i,n,o,s,r,a,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.anyPunctuation.exec(l));)l=l.slice(0,s.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(r||(a=""),r=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((n=>!!(i=n.call({lexer:this},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)))))if(i=this.tokenizer.escape(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.tag(e))e=e.substring(i.raw.length),n=t[t.length-1],n&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.link(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(i.raw.length),n=t[t.length-1],n&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.emStrong(e,l,a))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.codespan(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.br(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.del(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.autolink(e))e=e.substring(i.raw.length),t.push(i);else if(this.state.inLink||!(i=this.tokenizer.url(e))){if(o=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const i=e.slice(1);let n;this.options.extensions.startInline.forEach((e=>{n=e.call({lexer:this},i),"number"==typeof n&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(i=this.tokenizer.inlineText(o))e=e.substring(i.raw.length),"_"!==i.raw.slice(-1)&&(a=i.raw.slice(-1)),r=!0,n=t[t.length-1],n&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(i.raw.length),t.push(i);return t}}class XE{options;parser;constructor(e){this.options=e||XD}space(e){return""}code({text:e,lang:t,escaped:i}){const n=(t||"").match(/^\S*/)?.[0],o=e.replace(/\n$/,"")+"\n";return n?'<pre><code class="language-'+rE(n)+'">'+(i?o:rE(o,!0))+"</code></pre>\n":"<pre><code>"+(i?o:rE(o,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){const t=e.ordered,i=e.start;let n="";for(let t=0;t<e.items.length;t++){const i=e.items[t];n+=this.listitem(i)}const o=t?"ol":"ul";return"<"+o+(t&&1!==i?' start="'+i+'"':"")+">\n"+n+"</"+o+">\n"}listitem(e){let t="";if(e.task){const i=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&"paragraph"===e.tokens[0].type?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=i+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" "}):t+=i+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",i="";for(let t=0;t<e.header.length;t++)i+=this.tablecell(e.header[t]);t+=this.tablerow({text:i});let n="";for(let t=0;t<e.rows.length;t++){const o=e.rows[t];i="";for(let e=0;e<o.length;e++)i+=this.tablecell(o[e]);n+=this.tablerow({text:i})}return n&&(n=`<tbody>${n}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+n+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){const t=this.parser.parseInline(e.tokens),i=e.header?"th":"td";return(e.align?`<${i} align="${e.align}">`:`<${i}>`)+t+`</${i}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${e}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:i}){const n=this.parser.parseInline(i),o=dE(e);if(null===o)return n;let s='<a href="'+(e=o)+'"';return t&&(s+=' title="'+t+'"'),s+=">"+n+"</a>",s}image({href:e,title:t,text:i}){const n=dE(e);if(null===n)return i;let o=`<img src="${e=n}" alt="${i}"`;return t&&(o+=` title="${t}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):e.text}}class JE{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class eN{options;renderer;textRenderer;constructor(e){this.options=e||XD,this.options.renderer=this.options.renderer||new XE,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new JE}static parse(e,t){return new eN(t).parse(e)}static parseInline(e,t){return new eN(t).parseInline(e)}parse(e,t=!0){let i="";for(let n=0;n<e.length;n++){const o=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const e=o,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){i+=t||"";continue}}const s=o;switch(s.type){case"space":i+=this.renderer.space(s);continue;case"hr":i+=this.renderer.hr(s);continue;case"heading":i+=this.renderer.heading(s);continue;case"code":i+=this.renderer.code(s);continue;case"table":i+=this.renderer.table(s);continue;case"blockquote":i+=this.renderer.blockquote(s);continue;case"list":i+=this.renderer.list(s);continue;case"html":i+=this.renderer.html(s);continue;case"paragraph":i+=this.renderer.paragraph(s);continue;case"text":{let o=s,r=this.renderer.text(o);for(;n+1<e.length&&"text"===e[n+1].type;)o=e[++n],r+="\n"+this.renderer.text(o);i+=t?this.renderer.paragraph({type:"paragraph",raw:r,text:r,tokens:[{type:"text",raw:r,text:r}]}):r;continue}default:{const e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return i}parseInline(e,t){t=t||this.renderer;let i="";for(let n=0;n<e.length;n++){const o=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const e=this.options.extensions.renderers[o.type].call({parser:this},o);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){i+=e||"";continue}}const s=o;switch(s.type){case"escape":case"text":i+=t.text(s);break;case"html":i+=t.html(s);break;case"link":i+=t.link(s);break;case"image":i+=t.image(s);break;case"strong":i+=t.strong(s);break;case"em":i+=t.em(s);break;case"codespan":i+=t.codespan(s);break;case"br":i+=t.br(s);break;case"del":i+=t.del(s);break;default:{const e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return i}}class tN{options;constructor(e){this.options=e||XD}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}class iN{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(QE.lex,eN.parse);parseInline=this.parseMarkdown(QE.lexInline,eN.parseInline);Parser=eN;Renderer=XE;TextRenderer=JE;Lexer=QE;Tokenizer=pE;Hooks=tN;constructor(...e){this.use(...e)}walkTokens(e,t){let i=[];for(const n of e)switch(i=i.concat(t.call(this,n)),n.type){case"table":{const e=n;for(const n of e.header)i=i.concat(this.walkTokens(n.tokens,t));for(const n of e.rows)for(const e of n)i=i.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=n;i=i.concat(this.walkTokens(e.items,t));break}default:{const e=n;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((n=>{const o=e[n].flat(1/0);i=i.concat(this.walkTokens(o,t))})):e.tokens&&(i=i.concat(this.walkTokens(e.tokens,t)))}}return i}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const i={...e};if(i.async=this.defaults.async||i.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const i=t.renderers[e.name];t.renderers[e.name]=i?function(...t){let n=e.renderer.apply(this,t);return!1===n&&(n=i.apply(this,t)),n}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const i=t[e.level];i?i.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),i.extensions=t),e.renderer){const t=this.defaults.renderer||new XE(this.defaults);for(const i in e.renderer){if(!(i in t))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const n=i,o=e.renderer[n],s=t[n];t[n]=(...e)=>{let i=o.apply(t,e);return!1===i&&(i=s.apply(t,e)),i||""}}i.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new pE(this.defaults);for(const i in e.tokenizer){if(!(i in t))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const n=i,o=e.tokenizer[n],s=t[n];t[n]=(...e)=>{let i=o.apply(t,e);return!1===i&&(i=s.apply(t,e)),i}}i.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new tN;for(const i in e.hooks){if(!(i in t))throw new Error(`hook '${i}' does not exist`);if("options"===i)continue;const n=i,o=e.hooks[n],s=t[n];tN.passThroughHooks.has(i)?t[n]=e=>{if(this.defaults.async)return Promise.resolve(o.call(t,e)).then((e=>s.call(t,e)));const i=o.call(t,e);return s.call(t,i)}:t[n]=(...e)=>{let i=o.apply(t,e);return!1===i&&(i=s.apply(t,e)),i}}i.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,n=e.walkTokens;i.walkTokens=function(e){let i=[];return i.push(n.call(this,e)),t&&(i=i.concat(t.call(this,e))),i}}this.defaults={...this.defaults,...i}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return QE.lex(e,t??this.defaults)}parser(e,t){return eN.parse(e,t??this.defaults)}parseMarkdown(e,t){return(i,n)=>{const o={...n},s={...this.defaults,...o},r=this.onError(!!s.silent,!!s.async);if(!0===this.defaults.async&&!1===o.async)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==i)return r(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof i)return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(i):i).then((t=>e(t,s))).then((e=>s.hooks?s.hooks.processAllTokens(e):e)).then((e=>s.walkTokens?Promise.all(this.walkTokens(e,s.walkTokens)).then((()=>e)):e)).then((e=>t(e,s))).then((e=>s.hooks?s.hooks.postprocess(e):e)).catch(r);try{s.hooks&&(i=s.hooks.preprocess(i));let n=e(i,s);s.hooks&&(n=s.hooks.processAllTokens(n)),s.walkTokens&&this.walkTokens(n,s.walkTokens);let o=t(n,s);return s.hooks&&(o=s.hooks.postprocess(o)),o}catch(e){return r(e)}}}onError(e,t){return i=>{if(i.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+rE(i.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(i);throw i}}}const nN=new iN;function oN(e,t){return nN.parse(e,t)}oN.options=oN.setOptions=function(e){return nN.setOptions(e),oN.defaults=nN.defaults,JD(oN.defaults),oN},oN.getDefaults=function(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},oN.defaults=XD,oN.use=function(...e){return nN.use(...e),oN.defaults=nN.defaults,JD(oN.defaults),oN},oN.walkTokens=function(e,t){return nN.walkTokens(e,t)},oN.parseInline=nN.parseInline,oN.Parser=eN,oN.parser=eN.parse,oN.Renderer=XE,oN.TextRenderer=JE,oN.Lexer=QE,oN.lexer=QE.lex,oN.Tokenizer=pE,oN.Hooks=tN,oN.parse=oN,oN.options,oN.setOptions,oN.use,oN.walkTokens,oN.parseInline;const sN=oN,rN=(eN.parse,QE.lex);function aN(e){let t=JSON.parse(e);return t=dN(t),t}function lN(e,t){return t instanceof RegExp?{$mid:2,source:t.source,flags:t.flags}:t}function dN(e,t=0){if(!e||t>200)return e;if("object"==typeof e){switch(e.$mid){case 1:return uo.revive(e);case 2:return new RegExp(e.source,e.flags);case 17:return new Date(e.source)}if(e instanceof Mo||e instanceof Uint8Array)return e;if(Array.isArray(e))for(let i=0;i<e.length;++i)e[i]=dN(e[i],t+1);else for(const i in e)Object.hasOwnProperty.call(e,i)&&(e[i]=dN(e[i],t+1))}return e}const{entries:hN,setPrototypeOf:cN,isFrozen:uN,getPrototypeOf:gN,getOwnPropertyDescriptor:pN}=Object;let{freeze:mN,seal:fN,create:_N}=Object,{apply:vN,construct:bN}="undefined"!=typeof Reflect&&Reflect;mN||(mN=function(e){return e}),fN||(fN=function(e){return e}),vN||(vN=function(e,t,i){return e.apply(t,i)}),bN||(bN=function(e,t){return new e(...t)});const wN=AN(Array.prototype.forEach),CN=AN(Array.prototype.pop),yN=AN(Array.prototype.push),SN=AN(String.prototype.toLowerCase),xN=AN(String.prototype.toString),kN=AN(String.prototype.match),LN=AN(String.prototype.replace),DN=AN(String.prototype.indexOf),EN=AN(String.prototype.trim),NN=AN(Object.prototype.hasOwnProperty),IN=AN(RegExp.prototype.test),TN=(MN=TypeError,function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return bN(MN,t)});var MN;function AN(e){return function(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];return vN(e,t,n)}}function RN(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:SN;cN&&cN(e,null);let n=t.length;for(;n--;){let o=t[n];if("string"==typeof o){const e=i(o);e!==o&&(uN(t)||(t[n]=e),o=e)}e[o]=!0}return e}function ON(e){for(let t=0;t<e.length;t++)NN(e,t)||(e[t]=null);return e}function PN(e){const t=_N(null);for(const[i,n]of hN(e))NN(e,i)&&(Array.isArray(n)?t[i]=ON(n):n&&"object"==typeof n&&n.constructor===Object?t[i]=PN(n):t[i]=n);return t}function FN(e,t){for(;null!==e;){const i=pN(e,t);if(i){if(i.get)return AN(i.get);if("function"==typeof i.value)return AN(i.value)}e=gN(e)}return function(){return null}}const BN=mN(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),WN=mN(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),VN=mN(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),HN=mN(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),zN=mN(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),UN=mN(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),KN=mN(["#text"]),jN=mN(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),qN=mN(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),$N=mN(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),GN=mN(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ZN=fN(/\{\{[\w\W]*|[\w\W]*\}\}/gm),YN=fN(/<%[\w\W]*|[\w\W]*%>/gm),QN=fN(/\${[\w\W]*}/gm),XN=fN(/^data-[\-\w.\u00B7-\uFFFF]/),JN=fN(/^aria-[\-\w]+$/),eI=fN(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),tI=fN(/^(?:\w+script|data):/i),iI=fN(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),nI=fN(/^html$/i),oI=fN(/^[a-z][.\w]*(-[.\w]+)+$/i);var sI=Object.freeze({__proto__:null,MUSTACHE_EXPR:ZN,ERB_EXPR:YN,TMPLIT_EXPR:QN,DATA_ATTR:XN,ARIA_ATTR:JN,IS_ALLOWED_URI:eI,IS_SCRIPT_OR_DATA:tI,ATTR_WHITESPACE:iI,DOCTYPE_NAME:nI,CUSTOM_ELEMENT:oI});const rI=function(){return"undefined"==typeof window?null:window};var aI=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rI();const i=t=>e(t);if(i.version="3.1.7",i.removed=[],!t||!t.document||9!==t.document.nodeType)return i.isSupported=!1,i;let{document:n}=t;const o=n,s=o.currentScript,{DocumentFragment:r,HTMLTemplateElement:a,Node:l,Element:d,NodeFilter:h,NamedNodeMap:c=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:u,DOMParser:g,trustedTypes:p}=t,m=d.prototype,f=FN(m,"cloneNode"),_=FN(m,"remove"),v=FN(m,"nextSibling"),b=FN(m,"childNodes"),w=FN(m,"parentNode");if("function"==typeof a){const e=n.createElement("template");e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let C,y="";const{implementation:S,createNodeIterator:x,createDocumentFragment:k,getElementsByTagName:L}=n,{importNode:D}=o;let E={};i.isSupported="function"==typeof hN&&"function"==typeof w&&S&&void 0!==S.createHTMLDocument;const{MUSTACHE_EXPR:N,ERB_EXPR:I,TMPLIT_EXPR:T,DATA_ATTR:M,ARIA_ATTR:A,IS_SCRIPT_OR_DATA:R,ATTR_WHITESPACE:O,CUSTOM_ELEMENT:P}=sI;let{IS_ALLOWED_URI:F}=sI,B=null;const W=RN({},[...BN,...WN,...VN,...zN,...KN]);let V=null;const H=RN({},[...jN,...qN,...$N,...GN]);let z=Object.seal(_N(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),U=null,K=null,j=!0,q=!0,$=!1,G=!0,Z=!1,Y=!0,Q=!1,X=!1,J=!1,ee=!1,te=!1,ie=!1,ne=!0,oe=!1,se=!0,re=!1,ae={},le=null;const de=RN({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let he=null;const ce=RN({},["audio","video","img","source","image","track"]);let ue=null;const ge=RN({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pe="http://www.w3.org/1998/Math/MathML",me="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml";let _e=fe,ve=!1,be=null;const we=RN({},[pe,me,fe],xN);let Ce=null;const ye=["application/xhtml+xml","text/html"];let Se=null,xe=null;const ke=n.createElement("form"),Le=function(e){return e instanceof RegExp||e instanceof Function},De=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!xe||xe!==e){if(e&&"object"==typeof e||(e={}),e=PN(e),Ce=-1===ye.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Se="application/xhtml+xml"===Ce?xN:SN,B=NN(e,"ALLOWED_TAGS")?RN({},e.ALLOWED_TAGS,Se):W,V=NN(e,"ALLOWED_ATTR")?RN({},e.ALLOWED_ATTR,Se):H,be=NN(e,"ALLOWED_NAMESPACES")?RN({},e.ALLOWED_NAMESPACES,xN):we,ue=NN(e,"ADD_URI_SAFE_ATTR")?RN(PN(ge),e.ADD_URI_SAFE_ATTR,Se):ge,he=NN(e,"ADD_DATA_URI_TAGS")?RN(PN(ce),e.ADD_DATA_URI_TAGS,Se):ce,le=NN(e,"FORBID_CONTENTS")?RN({},e.FORBID_CONTENTS,Se):de,U=NN(e,"FORBID_TAGS")?RN({},e.FORBID_TAGS,Se):{},K=NN(e,"FORBID_ATTR")?RN({},e.FORBID_ATTR,Se):{},ae=!!NN(e,"USE_PROFILES")&&e.USE_PROFILES,j=!1!==e.ALLOW_ARIA_ATTR,q=!1!==e.ALLOW_DATA_ATTR,$=e.ALLOW_UNKNOWN_PROTOCOLS||!1,G=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Z=e.SAFE_FOR_TEMPLATES||!1,Y=!1!==e.SAFE_FOR_XML,Q=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,ie=e.RETURN_TRUSTED_TYPE||!1,J=e.FORCE_BODY||!1,ne=!1!==e.SANITIZE_DOM,oe=e.SANITIZE_NAMED_PROPS||!1,se=!1!==e.KEEP_CONTENT,re=e.IN_PLACE||!1,F=e.ALLOWED_URI_REGEXP||eI,_e=e.NAMESPACE||fe,z=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Le(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(z.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Le(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(z.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(z.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Z&&(q=!1),te&&(ee=!0),ae&&(B=RN({},KN),V=[],!0===ae.html&&(RN(B,BN),RN(V,jN)),!0===ae.svg&&(RN(B,WN),RN(V,qN),RN(V,GN)),!0===ae.svgFilters&&(RN(B,VN),RN(V,qN),RN(V,GN)),!0===ae.mathMl&&(RN(B,zN),RN(V,$N),RN(V,GN))),e.ADD_TAGS&&(B===W&&(B=PN(B)),RN(B,e.ADD_TAGS,Se)),e.ADD_ATTR&&(V===H&&(V=PN(V)),RN(V,e.ADD_ATTR,Se)),e.ADD_URI_SAFE_ATTR&&RN(ue,e.ADD_URI_SAFE_ATTR,Se),e.FORBID_CONTENTS&&(le===de&&(le=PN(le)),RN(le,e.FORBID_CONTENTS,Se)),se&&(B["#text"]=!0),Q&&RN(B,["html","head","body"]),B.table&&(RN(B,["tbody"]),delete U.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw TN('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw TN('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=e.TRUSTED_TYPES_POLICY,y=C.createHTML("")}else void 0===C&&(C=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let i=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(i=t.getAttribute(n));const o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(p,s)),null!==C&&"string"==typeof y&&(y=C.createHTML(""));mN&&mN(e),xe=e}},Ee=RN({},["mi","mo","mn","ms","mtext"]),Ne=RN({},["annotation-xml"]),Ie=RN({},["title","style","font","a","script"]),Te=RN({},[...WN,...VN,...HN]),Me=RN({},[...zN,...UN]),Ae=function(e){yN(i.removed,{element:e});try{w(e).removeChild(e)}catch(t){_(e)}},Re=function(e,t){try{yN(i.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){yN(i.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!V[e])if(ee||te)try{Ae(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Oe=function(e){let t=null,i=null;if(J)e="<remove></remove>"+e;else{const t=kN(e,/^[\r\n\t ]+/);i=t&&t[0]}"application/xhtml+xml"===Ce&&_e===fe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=C?C.createHTML(e):e;if(_e===fe)try{t=(new g).parseFromString(o,Ce)}catch(e){}if(!t||!t.documentElement){t=S.createDocument(_e,"template",null);try{t.documentElement.innerHTML=ve?y:o}catch(e){}}const s=t.body||t.documentElement;return e&&i&&s.insertBefore(n.createTextNode(i),s.childNodes[0]||null),_e===fe?L.call(t,Q?"html":"body")[0]:Q?t.documentElement:s},Pe=function(e){return x.call(e.ownerDocument||e,e,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},Fe=function(e){return e instanceof u&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof c)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Be=function(e){return"function"==typeof l&&e instanceof l},We=function(e,t,n){E[e]&&wN(E[e],(e=>{e.call(i,t,n,xe)}))},Ve=function(e){let t=null;if(We("beforeSanitizeElements",e,null),Fe(e))return Ae(e),!0;const n=Se(e.nodeName);if(We("uponSanitizeElement",e,{tagName:n,allowedTags:B}),e.hasChildNodes()&&!Be(e.firstElementChild)&&IN(/<[/\w]/g,e.innerHTML)&&IN(/<[/\w]/g,e.textContent))return Ae(e),!0;if(7===e.nodeType)return Ae(e),!0;if(Y&&8===e.nodeType&&IN(/<[/\w]/g,e.data))return Ae(e),!0;if(!B[n]||U[n]){if(!U[n]&&ze(n)){if(z.tagNameCheck instanceof RegExp&&IN(z.tagNameCheck,n))return!1;if(z.tagNameCheck instanceof Function&&z.tagNameCheck(n))return!1}if(se&&!le[n]){const t=w(e)||e.parentNode,i=b(e)||e.childNodes;if(i&&t)for(let n=i.length-1;n>=0;--n){const o=f(i[n],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,v(e))}}return Ae(e),!0}return e instanceof d&&!function(e){let t=w(e);t&&t.tagName||(t={namespaceURI:_e,tagName:"template"});const i=SN(e.tagName),n=SN(t.tagName);return!!be[e.namespaceURI]&&(e.namespaceURI===me?t.namespaceURI===fe?"svg"===i:t.namespaceURI===pe?"svg"===i&&("annotation-xml"===n||Ee[n]):Boolean(Te[i]):e.namespaceURI===pe?t.namespaceURI===fe?"math"===i:t.namespaceURI===me?"math"===i&&Ne[n]:Boolean(Me[i]):e.namespaceURI===fe?!(t.namespaceURI===me&&!Ne[n])&&!(t.namespaceURI===pe&&!Ee[n])&&!Me[i]&&(Ie[i]||!Te[i]):!("application/xhtml+xml"!==Ce||!be[e.namespaceURI]))}(e)?(Ae(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!IN(/<\/no(script|embed|frames)/i,e.innerHTML)?(Z&&3===e.nodeType&&(t=e.textContent,wN([N,I,T],(e=>{t=LN(t,e," ")})),e.textContent!==t&&(yN(i.removed,{element:e.cloneNode()}),e.textContent=t)),We("afterSanitizeElements",e,null),!1):(Ae(e),!0)},He=function(e,t,i){if(ne&&("id"===t||"name"===t)&&(i in n||i in ke))return!1;if(q&&!K[t]&&IN(M,t));else if(j&&IN(A,t));else if(!V[t]||K[t]){if(!(ze(e)&&(z.tagNameCheck instanceof RegExp&&IN(z.tagNameCheck,e)||z.tagNameCheck instanceof Function&&z.tagNameCheck(e))&&(z.attributeNameCheck instanceof RegExp&&IN(z.attributeNameCheck,t)||z.attributeNameCheck instanceof Function&&z.attributeNameCheck(t))||"is"===t&&z.allowCustomizedBuiltInElements&&(z.tagNameCheck instanceof RegExp&&IN(z.tagNameCheck,i)||z.tagNameCheck instanceof Function&&z.tagNameCheck(i))))return!1}else if(ue[t]);else if(IN(F,LN(i,O,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==DN(i,"data:")||!he[e])if($&&!IN(R,LN(i,O,"")));else if(i)return!1;return!0},ze=function(e){return"annotation-xml"!==e&&kN(e,P)},Ue=function(e){We("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:V};let o=t.length;for(;o--;){const s=t[o],{name:r,namespaceURI:a,value:l}=s,d=Se(r);let h="value"===r?l:EN(l);if(n.attrName=d,n.attrValue=h,n.keepAttr=!0,n.forceKeepAttr=void 0,We("uponSanitizeAttribute",e,n),h=n.attrValue,n.forceKeepAttr)continue;if(Re(r,e),!n.keepAttr)continue;if(!G&&IN(/\/>/i,h)){Re(r,e);continue}Z&&wN([N,I,T],(e=>{h=LN(h,e," ")}));const c=Se(e.nodeName);if(He(c,d,h))if(!oe||"id"!==d&&"name"!==d||(Re(r,e),h="user-content-"+h),Y&&IN(/((--!?|])>)|<\/(style|title)/i,h))Re(r,e);else{if(C&&"object"==typeof p&&"function"==typeof p.getAttributeType)if(a);else switch(p.getAttributeType(c,d)){case"TrustedHTML":h=C.createHTML(h);break;case"TrustedScriptURL":h=C.createScriptURL(h)}try{a?e.setAttributeNS(a,r,h):e.setAttribute(r,h),Fe(e)?Ae(e):CN(i.removed)}catch(e){}}}We("afterSanitizeAttributes",e,null)},Ke=function e(t){let i=null;const n=Pe(t);for(We("beforeSanitizeShadowDOM",t,null);i=n.nextNode();)We("uponSanitizeShadowNode",i,null),Ve(i)||(i.content instanceof r&&e(i.content),Ue(i));We("afterSanitizeShadowDOM",t,null)};return i.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,s=null,a=null,d=null;if(ve=!e,ve&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Be(e)){if("function"!=typeof e.toString)throw TN("toString is not a function");if("string"!=typeof(e=e.toString()))throw TN("dirty is not a string, aborting")}if(!i.isSupported)return e;if(X||De(t),i.removed=[],"string"==typeof e&&(re=!1),re){if(e.nodeName){const t=Se(e.nodeName);if(!B[t]||U[t])throw TN("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)n=Oe("\x3c!----\x3e"),s=n.ownerDocument.importNode(e,!0),1===s.nodeType&&"BODY"===s.nodeName||"HTML"===s.nodeName?n=s:n.appendChild(s);else{if(!ee&&!Z&&!Q&&-1===e.indexOf("<"))return C&&ie?C.createHTML(e):e;if(n=Oe(e),!n)return ee?null:ie?y:""}n&&J&&Ae(n.firstChild);const h=Pe(re?e:n);for(;a=h.nextNode();)Ve(a)||(a.content instanceof r&&Ke(a.content),Ue(a));if(re)return e;if(ee){if(te)for(d=k.call(n.ownerDocument);n.firstChild;)d.appendChild(n.firstChild);else d=n;return(V.shadowroot||V.shadowrootmode)&&(d=D.call(o,d,!0)),d}let c=Q?n.outerHTML:n.innerHTML;return Q&&B["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&IN(nI,n.ownerDocument.doctype.name)&&(c="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+c),Z&&wN([N,I,T],(e=>{c=LN(c,e," ")})),C&&ie?C.createHTML(c):c},i.setConfig=function(){De(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),X=!0},i.clearConfig=function(){xe=null,X=!1},i.isValidAttribute=function(e,t,i){xe||De({});const n=Se(e),o=Se(t);return He(n,o,i)},i.addHook=function(e,t){"function"==typeof t&&(E[e]=E[e]||[],yN(E[e],t))},i.removeHook=function(e){if(E[e])return CN(E[e])},i.removeHooks=function(e){E[e]&&(E[e]=[])},i.removeAllHooks=function(){E={}},i}();const lI=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","s","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]),dI=Object.freeze(["href","target","src","alt","title","for","name","role","tabindex","x-dispatch","required","checked","placeholder","type","start","width","height","align"]),hI="vscode-relative-path";function cI(e,t){if("*"===t.override)return!0;try{const i=new URL(e,hI+"://");return!!t.override.includes(i.protocol.replace(/:$/,""))||!(!t.allowRelativePaths||i.protocol!==hI+":"||e.trim().toLowerCase().startsWith(hI))}catch(e){return!1}}const uI=Object.freeze({ALLOWED_TAGS:[...lI],ALLOWED_ATTR:[...dI],ALLOW_UNKNOWN_PROTOCOLS:!0});function gI(e,t,i){try{const s={...uI};t?.allowedTags&&(t.allowedTags.override&&(s.ALLOWED_TAGS=[...t.allowedTags.override]),t.allowedTags.augment&&(s.ALLOWED_TAGS=[...s.ALLOWED_TAGS??[],...t.allowedTags.augment]));let r=[...dI];t?.allowedAttributes&&(t.allowedAttributes.override&&(r=[...t.allowedAttributes.override]),t.allowedAttributes.augment&&(r=[...r,...t.allowedAttributes.augment])),r=r.map((e=>"string"==typeof e?e.toLowerCase():{attributeName:e.attributeName.toLowerCase(),shouldKeep:e.shouldKeep}));const a=new Set(r.map((e=>"string"==typeof e?e:e.attributeName))),l=new Map;for(const e of r)"string"==typeof e?l.delete(e):l.set(e.attributeName,e);return s.ALLOWED_ATTR=Array.from(a),n={override:t?.allowedLinkProtocols?.override??[So.http,So.https],allowRelativePaths:t?.allowRelativeLinkPaths??!1},o={override:t?.allowedMediaProtocols?.override??[So.http,So.https],allowRelativePaths:t?.allowRelativeMediaPaths??!1},aI.addHook("afterSanitizeAttributes",(e=>{for(const t of["href","src"])if(e.hasAttribute(t)){const i=e.getAttribute(t);"href"===t?i.startsWith("#")||cI(i,n)||e.removeAttribute(t):cI(i,o)||e.removeAttribute(t)}})),t?.replaceWithPlaintext&&aI.addHook("uponSanitizeElement",mI),l.size&&aI.addHook("uponSanitizeAttribute",((e,t)=>{const i=l.get(t.attrName);if(i){const n=i.shouldKeep(e,t);"string"==typeof n?(t.keepAttr=!0,t.attrValue=n):t.keepAttr=n}else t.keepAttr=a.has(t.attrName)})),"dom"===i?aI.sanitize(e,{...s,RETURN_DOM_FRAGMENT:!0}):aI.sanitize(e,{...s,RETURN_TRUSTED_TYPE:!0})}finally{aI.removeAllHooks()}var n,o}const pI=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];function mI(e,t,i){if(!t.allowedTags[t.tagName]&&"body"!==t.tagName){const t=fI(e);e.nodeType===Node.COMMENT_NODE?e.parentElement?.insertBefore(t,e):e.parentElement?.replaceChild(t,e)}}function fI(e){let t,i;if(e.nodeType===Node.COMMENT_NODE)t=`\x3c!--${e.textContent}--\x3e`;else{const n=e.tagName.toLowerCase(),o=pI.includes(n);t=`<${n}${e.attributes.length?" "+Array.from(e.attributes).map((e=>`${e.name}="${e.value}"`)).join(" "):""}>`,o||(i=`</${n}>`)}const n=document.createDocumentFragment(),o=e.ownerDocument.createTextNode(t);for(n.appendChild(o);e.firstChild;)n.appendChild(e.firstChild);const s=i?e.ownerDocument.createTextNode(i):void 0;return s&&n.appendChild(s),n}function _I(e,t,i){ol(e,gI(t,i,"dom"))}const vI=new RegExp(`(\\\\)?\\$\\((${vh.iconNameExpression}(?:${vh.iconModifierExpression})?)\\)`,"g");function bI(e){const t=new Array;let i,n=0,o=0;for(;null!==(i=vI.exec(e));){o=i.index||0,n<o&&t.push(e.substring(n,o)),n=(i.index||0)+i[0].length;const[,s,r]=i;t.push(s?`$(${r})`:wI({id:r}))}return n<e.length&&t.push(e.substring(n)),t}function wI(e){const t=ll("span");return t.classList.add(...vh.asClassNameArray(e)),t}const CI=Object.freeze({image:({href:e,title:t,text:i})=>{let n=[],o=[];return e&&(({href:e,dimensions:n}=function(e){const t=[],i=e.split("|").map((e=>e.trim()));e=i[0];const n=i[1];if(n){const e=/height=(\d+)/.exec(n),i=/width=(\d+)/.exec(n),o=e?e[1]:"",s=i?i[1]:"",r=isFinite(parseInt(s)),a=isFinite(parseInt(o));r&&t.push(`width="${s}"`),a&&t.push(`height="${o}"`)}return{href:e,dimensions:t}}(e)),o.push(`src="${Qh(e)}"`)),i&&o.push(`alt="${Qh(i)}"`),t&&o.push(`title="${Qh(t)}"`),n.length&&(o=o.concat(n)),"<img "+o.join(" ")+">"},paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>`},link({href:e,title:t,tokens:i}){let n=this.parser.parseInline(i);return"string"!=typeof e?"":(e===n&&(n=Xh(n)),t="string"==typeof t?Qh(Xh(t)):"",`<a href="${e=(e=Xh(e)).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}" title="${t||e}" draggable="false">${n}</a>`)}});function yI(e,t={},i){const n=new Mt;let o=!1;const s=new iN(...t.markedExtensions??[]),{renderer:r,codeBlocks:a,syncCodeBlocks:l}=function(e,t,i){const n=new e.Renderer(t.markedOptions);n.image=CI.image,n.link=CI.link,n.paragraph=CI.paragraph;const o=[],s=[];return t.codeBlockRendererSync?n.code=({text:e,lang:i,raw:n})=>{const o=QD.nextId(),r=t.codeBlockRendererSync(LI(i),e,n);return s.push([o,r]),`<div class="code" data-code="${o}">${Wi(e)}</div>`}:t.codeBlockRenderer&&(n.code=({text:e,lang:i})=>{const n=QD.nextId(),s=t.codeBlockRenderer(LI(i),e);return o.push(s.then((e=>[n,e]))),`<div class="code" data-code="${n}">${Wi(e)}</div>`}),i.supportHtml||(n.html=({text:e})=>t.sanitizerConfig?.replaceWithPlaintext?Wi(e):(i.isTrusted?e.match(/^(<span[^>]+>)|(<\/\s*span>)$/):void 0)?e:""),{renderer:n,codeBlocks:o,syncCodeBlocks:s}}(s,t,e),d=function(e){let t=e.value;return t.length>1e5&&(t=`${t.substr(0,1e5)}…`),e.supportThemeIcons&&(t=t.replace(Ch,(e=>`\\${e}`))),t}(e);let h;if(t.fillInIncompleteTokens){const e={...s.defaults,...t.markedOptions,renderer:r},i=function(e){for(let t=0;t<PI;t++){const t=FI(e);if(!t)break;e=t}return e}(s.lexer(d,e));h=s.parser(i,e)}else h=s.parse(d,{...t?.markedOptions,renderer:r,async:!1});e.supportThemeIcons&&(h=bI(h).map((e=>"string"==typeof e?e:e.outerHTML)).join(""));const c=document.createElement("div");let u;if(_I(c,h,II(e,t.sanitizerConfig??{})),function(e,t,i){for(const n of i.querySelectorAll("img, audio, video, source")){const i=n.getAttribute("src");if(i){let o=i;try{e.baseUri&&(o=DI(uo.from(e.baseUri),o))}catch(e){}if(n.setAttribute("src",kI(e,o,!0)),t.sanitizerConfig?.remoteImageIsAllowed){const e=uo.parse(o);e.scheme===So.file||e.scheme===So.data||t.sanitizerConfig.remoteImageIsAllowed(e)||n.replaceWith(ll("",void 0,n.outerHTML))}}}for(const t of i.querySelectorAll("a")){const i=t.getAttribute("href");if(t.setAttribute("href",""),!i||/^data:|javascript:/i.test(i)||/^command:/i.test(i)&&!e.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(i))t.replaceWith(...t.childNodes);else{let n=kI(e,i,!1);e.baseUri&&(n=DI(uo.from(e.baseUri),i)),t.dataset.href=n}}}(e,t,c),i?(u=i,ol(i,...c.children)):u=c,a.length>0)Promise.all(a).then((e=>{if(o)return;const i=new Map(e),n=u.querySelectorAll("div[data-code]");for(const e of n){const t=i.get(e.dataset.code??"");t&&ol(e,t)}t.asyncRenderCallback?.()}));else if(l.length>0){const e=new Map(l),t=u.querySelectorAll("div[data-code]");for(const i of t){const t=e.get(i.dataset.code??"");t&&ol(i,t)}}if(t.asyncRenderCallback)for(const e of u.getElementsByTagName("img")){const i=n.add(ga(e,"load",(()=>{i.dispose(),t.asyncRenderCallback()})))}if(t.actionHandler){const i=i=>{const n=new Je(ta(u),i);(n.leftButton||n.middleButton)&&SI(e,t,n)};n.add(ga(u,"click",i)),n.add(ga(u,"auxclick",i)),n.add(ga(u,"keydown",(i=>{const n=new Ze(i);(n.equals(10)||n.equals(3))&&SI(e,t,n)})))}for(const e of[...u.getElementsByTagName("input")])if("checkbox"===e.attributes.getNamedItem("type")?.value)e.setAttribute("disabled","");else if(t.sanitizerConfig?.replaceWithPlaintext){const t=fI(e);e.parentElement?.replaceChild(t,e)}else e.remove();return{element:u,dispose:()=>{o=!0,n.dispose()}}}function SI(e,t,i){const n=i.target.closest("a[data-href]");if(qa(n))try{let i=n.dataset.href;i&&(e.baseUri&&(i=DI(uo.from(e.baseUri),i)),t.actionHandler?.(i,e))}catch(e){Ie(e)}finally{i.preventDefault()}}function xI(e,t){let i;try{i=aN(decodeURIComponent(t))}catch(e){}return i?(i=lg(i,(t=>e.uris&&e.uris[t]?uo.revive(e.uris[t]):void 0)),encodeURIComponent(JSON.stringify(i))):t}function kI(e,t,i){const n=e.uris&&e.uris[t];let o=uo.revive(n);return i?t.startsWith(So.data+":")?t:(o||(o=uo.parse(t)),Eo.uriToBrowserUri(o).toString(!0)):o?uo.parse(t).toString()===o.toString()?t:(o.query&&(o=o.with({query:xI(e,o.query)})),o.toString()):t}function LI(e){if(!e)return"";const t=e.split(/[\s+|:|,|\{|\?]/,1);return t.length?t[0]:e}function DI(e,t){return/^\w[\w\d+.-]*:/.test(t)?t:e.path.endsWith("/")?Kh(e,t).toString():Kh(Vh(e),t).toString()}const EI=Object.freeze([...lI,"input"]),NI=Object.freeze(["align","autoplay","alt","colspan","controls","draggable","height","href","loop","muted","playsinline","poster","rowspan","src","target","title","type","width","start","checked","disabled","value","data-code","data-href",{attributeName:"style",shouldKeep:(e,t)=>"SPAN"===e.tagName&&"style"===t.attrName&&/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z0-9]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z0-9]+)+\));)?(border-radius:[0-9]+px;)?$/.test(t.attrValue)},{attributeName:"class",shouldKeep:(e,t)=>"SPAN"===e.tagName&&"class"===t.attrName&&/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(t.attrValue)}]);function II(e,t){const i=e.isTrusted??!1,n=[So.http,So.https,So.mailto,So.file,So.vscodeFileResource,So.vscodeRemote,So.vscodeRemoteResource,So.vscodeNotebookCell];return i&&n.push(So.command),t.allowedLinkSchemes?.augment&&n.push(...t.allowedLinkSchemes.augment),{allowedTags:{override:t.allowedTags?.override??EI},allowedAttributes:{override:t.allowedAttributes?.override??NI},allowedLinkProtocols:{override:n},allowRelativeLinkPaths:!!e.baseUri,allowedMediaProtocols:{override:[So.http,So.https,So.data,So.file,So.vscodeFileResource,So.vscodeRemote,So.vscodeRemoteResource]},replaceWithPlaintext:t.replaceWithPlaintext}}const TI=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]);function MI(){const e=new XE;return e.code=({text:e})=>Wi(e),e.blockquote=({text:e})=>e+"\n",e.html=e=>"",e.heading=function({tokens:e}){return this.parser.parseInline(e)+"\n"},e.hr=()=>"",e.list=function({items:e}){return e.map((e=>this.listitem(e))).join("\n")+"\n"},e.listitem=({text:e})=>e+"\n",e.paragraph=function({tokens:e}){return this.parser.parseInline(e)+"\n"},e.table=function({header:e,rows:t}){return e.map((e=>this.tablecell(e))).join(" ")+"\n"+t.map((e=>e.map((e=>this.tablecell(e))).join(" "))).join("\n")+"\n"},e.tablerow=({text:e})=>e,e.tablecell=function({tokens:e}){return this.parser.parseInline(e)},e.strong=({text:e})=>e,e.em=({text:e})=>e,e.codespan=({text:e})=>Wi(e),e.br=e=>"\n",e.del=({text:e})=>e,e.image=e=>"",e.text=({text:e})=>e,e.link=({text:e})=>e,e}const AI=new Oi(MI);new Oi((()=>{const e=MI();return e.code=({text:e})=>`\n\`\`\`\n${Wi(e)}\n\`\`\`\n`,e}));function RI(e){let t="";return e.forEach((e=>{t+=e.raw})),t}function OI(e){if(e.tokens)for(let t=e.tokens.length-1;t>=0;t--){const i=e.tokens[t];if("text"===i.type){const n=i.raw.split("\n"),o=n[n.length-1];if(o.includes("`"))return BI(e);if(o.includes("**"))return KI(e,"**");if(o.match(/\*\w/))return KI(e,"*");if(o.match(/(^|\s)__\w/))return UI(e);if(o.match(/(^|\s)_\w/))return WI(e);if(o.match(/(^|\s)\[.*\]\(\w*/)||o.match(/^[^\[]*\]\([^\)]*$/)&&e.tokens.slice(0,t).some((e=>"text"===e.type&&e.raw.match(/\[[^\]]*$/)))){const i=e.tokens.slice(t+1);return"link"===i[0]?.type&&"text"===i[1]?.type&&i[1].raw.match(/^ *"[^"]*$/)||o.match(/^[^"]* +"[^"]*$/)?HI(e):VI(e)}if(o.match(/(^|\s)\[\w*[^\]]*$/))return zI(e)}}}const PI=3;function FI(e){let t,i;for(t=0;t<e.length;t++){const n=e[t];if("paragraph"===n.type&&n.raw.match(/(\n|^)\|/)){i=jI(e.slice(t));break}}const n=e.at(-1);if(!i&&"list"===n?.type){const o=function(e){const t=e.items[e.items.length-1],i=t.tokens?t.tokens[t.tokens.length-1]:void 0,n=e=>{const t=e.items.at(-1),i=t?.tokens.at(-1);return"heading"===i?.type||"list"===i?.type&&n(i)};let o;if("text"!==i?.type||"inRawBlock"in t){if(n(e)){const t=rN(e.raw.trim()+" ")[0];if("list"!==t.type)return;return t}}else o=OI(i);if(!o||"paragraph"!==o.type)return;const s=RI(e.items.slice(0,-1)),r=t.raw.match(/^(\s*(-|\d+\.|\*) +)/)?.[0];if(!r)return;const a=r+RI(t.tokens.slice(0,-1))+o.raw,l=rN(s+a)[0];return"list"===l.type?l:void 0}(n);o&&(i=[o],t=e.length-1)}if(!i&&"paragraph"===n?.type){const o=OI(n);o&&(i=[o],t=e.length-1)}if(i){const n=[...e.slice(0,t),...i];return n.links=e.links,n}if("heading"===n?.type){const t=function(e,t){if(e.raw.match(/-\s*$/))return rN(t+" ")}(n,RI(e));if(t)return t}return null}function BI(e){return KI(e,"`")}function WI(e){return KI(e,"_")}function VI(e){return KI(e,")",!1)}function HI(e){return KI(e,'")',!1)}function zI(e){return KI(e,"](https://microsoft.com)",!1)}function UI(e){return KI(e,"__")}function KI(e,t,i=!0){const n=RI(Array.isArray(e)?e:[e]),o=i?n.trimEnd():n;return rN(o+t)[0]}function jI(e){const t=RI(e),i=t.split("\n");let n,o=!1;for(let e=0;e<i.length;e++){const t=i[e].trim();if(void 0===n&&t.match(/^\s*\|/)){const e=t.match(/(\|[^\|]+)(?=\||$)/g);e&&(n=e.length)}else if("number"==typeof n){if(!t.match(/^\s*\|/))return;if(e!==i.length-1)return;o=!0}}if("number"==typeof n&&n>0){const e=o?i.slice(0,-1).join("\n"):t,s=!!e.match(/\|\s*$/),r=e+(s?"":"|")+`\n|${" --- |".repeat(n)}`;return rN(r)}}var qI=i(7201),$I={};function GI(e,t){const i=globalThis.MonacoEnvironment;if(i?.createTrustedTypesPolicy)try{return i.createTrustedTypesPolicy(e,t)}catch(e){return void Ie(e)}try{return globalThis.trustedTypes?.createPolicy(e,t)}catch(e){return void Ie(e)}}$I.styleTagTransform=zl(),$I.setAttributes=Bl(),$I.insert=Pl().bind(null,"head"),$I.domAPI=Rl(),$I.insertStyleElement=Vl(),Ml()(qI.A,$I),qI.A&&qI.A.locals&&qI.A.locals;const ZI=oc("openerService"),YI={getInitialState:()=>ex,tokenizeEncoded:(e,t,i)=>ix(0,i)};function QI(e,t,i,n,o,s,r){let a="<div>",l=n,d=0,h=!0;for(let c=0,u=t.getCount();c<u;c++){const u=t.getEndOffset(c);if(u<=n)continue;let g="";for(;l<u&&l<o;l++){const t=e.charCodeAt(l);switch(t){case 9:{let e=s-(l+d)%s;for(d+=e-1;e>0;)r&&h?(g+=" ",h=!1):(g+=" ",h=!0),e--;break}case 60:g+="<",h=!1;break;case 62:g+=">",h=!1;break;case 38:g+="&",h=!1;break;case 0:g+="�",h=!1;break;case 65279:case 8232:case 8233:case 133:g+="�",h=!1;break;case 13:g+="​",h=!1;break;case 32:r&&h?(g+=" ",h=!1):(g+=" ",h=!0);break;default:g+=String.fromCharCode(t),h=!1}}if(a+=`<span style="${t.getInlineStyle(c,i)}">${g}</span>`,u>o||l>=o)break}return a+="</div>",a}function XI(e,t,i){let n='<div class="monaco-tokenized-source">';const o=qi(e);let s=i.getInitialState();for(let e=0,r=o.length;e<r;e++){const r=o[e];e>0&&(n+="<br/>");const a=i.tokenizeEncoded(r,!0,s);uS.convertToEndOffset(a.tokens,r.length);const l=new uS(a.tokens,r,t).inflate();let d=0;for(let e=0,t=l.getCount();e<t;e++){const t=l.getClassName(e),i=l.getEndOffset(e);n+=`<span class="${t}">${Wi(r.substring(d,i))}</span>`,d=i}s=a.endState}return n+="</div>",n}class JI{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}focus(){this.domNode.focus()}setMaxWidth(e){const t=eT(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=eT(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=eT(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=eT(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=eT(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=eT(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=eT(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=eT(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){const t=eT(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const t=eT(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=eT(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function eT(e){return"number"==typeof e?`${e}px`:e}function tT(e){return new JI(e)}function iT(e,t){e instanceof JI?(e.setFontFamily(t.getMassagedFontFamily()),e.setFontWeight(t.fontWeight),e.setFontSize(t.fontSize),e.setFontFeatureSettings(t.fontFeatureSettings),e.setFontVariationSettings(t.fontVariationSettings),e.setLineHeight(t.lineHeight),e.setLetterSpacing(t.letterSpacing)):(e.style.fontFamily=t.getMassagedFontFamily(),e.style.fontWeight=t.fontWeight,e.style.fontSize=t.fontSize+"px",e.style.fontFeatureSettings=t.fontFeatureSettings,e.style.fontVariationSettings=t.fontVariationSettings,e.style.lineHeight=t.lineHeight+"px",e.style.letterSpacing=t.letterSpacing+"px")}var nT=i(6835),oT={};oT.styleTagTransform=zl(),oT.setAttributes=Bl(),oT.insert=Pl().bind(null,"head"),oT.domAPI=Rl(),oT.insertStyleElement=Vl(),Ml()(nT.A,oT),nT.A&&nT.A.locals&&nT.A.locals;var sT,rT=function(e,t){return function(i,n){t(i,n,e)}};let aT=class{static{sT=this}static{this._ttpTokenizer=GI("tokenizeToString",{createHTML:e=>e})}constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i}render(e,t,i){const n=yI(e,{codeBlockRenderer:(e,t)=>this.renderCodeBlock(e,t),actionHandler:(e,t)=>this.openMarkdownLink(e,t),...t},i);return n.element.classList.add("rendered-markdown"),n}async renderCodeBlock(e,t){let i;e?i=this._languageService.getLanguageIdByLanguageName(e):this._options.editor&&(i=this._options.editor.getModel()?.getLanguageId()),i||(i=Up);const n=await async function(e,t,i){if(!i)return XI(t,e.languageIdCodec,YI);const n=await JS.getOrCreate(i);return XI(t,e.languageIdCodec,n||YI)}(this._languageService,t,i),o=document.createElement("span");return o.innerHTML=sT._ttpTokenizer?.createHTML(n)??n,this._options.editor?iT(o,this._options.editor.getOption(59)):this._options.codeBlockFontFamily&&(o.style.fontFamily=this._options.codeBlockFontFamily),void 0!==this._options.codeBlockFontSize&&(o.style.fontSize=this._options.codeBlockFontSize),o}async openMarkdownLink(e,t){await lT(this._openerService,e,t.isTrusted)}};async function lT(e,t,i,n){try{return await e.open(t,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:dT(i),skipValidation:n})}catch(e){return Ie(e),!1}}function dT(e){return!0===e||!(!e||!Array.isArray(e.enabledCommands))&&e.enabledCommands}aT=sT=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([rT(1,Tg),rT(2,ZI)],aT);var hT,cT=function(e,t){return function(i,n){t(i,n,e)}};let uT=class{static{hT=this}static{this.ID="editor.contrib.messageController"}static{this.MESSAGE_VISIBLE=new Jc("messageVisible",!1,y(1277,"Whether the editor is currently showing an inline message"))}static get(e){return e.getContribution(hT.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Rt,this._messageListeners=new Mt,this._mouseOverMessage=!1,this._editor=e,this._visible=hT.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){if(Yl(Yh(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),Yh(e)){const i=this._messageListeners.add(yI(e,{actionHandler:(e,t)=>{this.closeMessage(),lT(this._openerService,e,t.isTrusted)}}));this._messageWidget.value=new gT(this._editor,t,i.element)}else this._messageWidget.value=new gT(this._editor,t,e);let i;this._messageListeners.add(zt.debounce(this._editor.onDidBlurEditorText,((e,t)=>t),0)((()=>{this._mouseOverMessage||this._messageWidget.value&&Oa(Va(),this._messageWidget.value.getDomNode())||this.closeMessage()}))),this._messageListeners.add(this._editor.onDidChangeCursorPosition((()=>this.closeMessage()))),this._messageListeners.add(this._editor.onDidDispose((()=>this.closeMessage()))),this._messageListeners.add(this._editor.onDidChangeModel((()=>this.closeMessage()))),this._messageListeners.add(ga(this._messageWidget.value.getDomNode(),Qa.MOUSE_ENTER,(()=>this._mouseOverMessage=!0),!0)),this._messageListeners.add(ga(this._messageWidget.value.getDomNode(),Qa.MOUSE_LEAVE,(()=>this._mouseOverMessage=!1),!0)),this._messageListeners.add(this._editor.onMouseMove((e=>{e.target.position&&(i?i.containsPosition(e.target.position)||this.closeMessage():i=new Yu(t.lineNumber-3,1,e.target.position.lineNumber+3,1))})))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(gT.fadeOut(this._messageWidget.value))}};uT=hT=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([cT(1,eu),cT(2,ZI)],uT),Vu(new(Ou.bindToContribution(uT.get))({id:"leaveEditorMessage",precondition:uT.MESSAGE_VISIBLE,handler:e=>e.closeMessage(),kbOpts:{weight:130,primary:9}}));class gT{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const s=document.createElement("div");"string"==typeof n?(s.classList.add("message"),s.textContent=n):(n.classList.add("message"),s.appendChild(n)),this._domNode.appendChild(s);const r=document.createElement("div");r.classList.add("anchor","below"),this._domNode.appendChild(r),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",2===e)}}Uu(uT.ID,uT,4);class pT{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos<this._value.length-1}cmp(e){return e.charCodeAt(0)-this._value.charCodeAt(this._pos)}value(){return this._value[this._pos]}}class mT{constructor(e=!0){this._caseSensitive=e}reset(e){return this._value=e,this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let e=!0;for(;this._to<this._value.length;this._to++)if(46===this._value.charCodeAt(this._to)){if(!e)break;this._from++}else e=!1;return this}cmp(e){return this._caseSensitive?Qi(e,this._value,0,e.length,this._from,this._to):Ji(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class fT{constructor(e=!0,t=!0){this._splitOnBackslash=e,this._caseSensitive=t}reset(e){this._from=0,this._to=0,this._value=e,this._valueLen=e.length;for(let t=e.length-1;t>=0;t--,this._valueLen--){const e=this._value.charCodeAt(t);if(!(47===e||this._splitOnBackslash&&92===e))break}return this.next()}hasNext(){return this._to<this._valueLen}next(){this._from=this._to;let e=!0;for(;this._to<this._valueLen;this._to++){const t=this._value.charCodeAt(this._to);if(47===t||this._splitOnBackslash&&92===t){if(!e)break;this._from++}else e=!1}return this}cmp(e){return this._caseSensitive?Qi(e,this._value,0,e.length,this._from,this._to):Ji(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class _T{constructor(e,t){this._ignorePathCasing=e,this._ignoreQueryAndFragment=t,this._states=[],this._stateIdx=0}reset(e){return this._value=e,this._states=[],this._value.scheme&&this._states.push(1),this._value.authority&&this._states.push(2),this._value.path&&(this._pathIterator=new fT(!1,!this._ignorePathCasing(e)),this._pathIterator.reset(e.path),this._pathIterator.value()&&this._states.push(3)),this._ignoreQueryAndFragment(e)||(this._value.query&&this._states.push(4),this._value.fragment&&this._states.push(5)),this._stateIdx=0,this}next(){return 3===this._states[this._stateIdx]&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return 3===this._states[this._stateIdx]&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(e){if(1===this._states[this._stateIdx])return Xi(e,this._value.scheme);if(2===this._states[this._stateIdx])return Xi(e,this._value.authority);if(3===this._states[this._stateIdx])return this._pathIterator.cmp(e);if(4===this._states[this._stateIdx])return Yi(e,this._value.query);if(5===this._states[this._stateIdx])return Yi(e,this._value.fragment);throw new Error}value(){if(1===this._states[this._stateIdx])return this._value.scheme;if(2===this._states[this._stateIdx])return this._value.authority;if(3===this._states[this._stateIdx])return this._pathIterator.value();if(4===this._states[this._stateIdx])return this._value.query;if(5===this._states[this._stateIdx])return this._value.fragment;throw new Error}}class vT{static{this.Val=Symbol("undefined_placeholder")}static wrap(e){return void 0===e?vT.Val:e}static unwrap(e){return e===vT.Val?void 0:e}}class bT{constructor(){this.height=1,this.value=void 0,this.key=void 0,this.left=void 0,this.mid=void 0,this.right=void 0}rotateLeft(){const e=this.right;return this.right=e.left,e.left=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){const e=this.left;return this.left=e.right,e.right=this,this.updateHeight(),e.updateHeight(),e}updateHeight(){this.height=1+Math.max(this.heightLeft,this.heightRight)}balanceFactor(){return this.heightRight-this.heightLeft}get heightLeft(){return this.left?.height??0}get heightRight(){return this.right?.height??0}}class wT{static forUris(e=()=>!1,t=()=>!1){return new wT(new _T(e,t))}static forStrings(){return new wT(new pT)}static forConfigKeys(){return new wT(new mT)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let n;this._root||(this._root=new bT,this._root.segment=i.value());const o=[];for(n=this._root;;){const e=i.cmp(n.segment);if(e>0)n.left||(n.left=new bT,n.left.segment=i.value()),o.push([-1,n]),n=n.left;else if(e<0)n.right||(n.right=new bT,n.right.segment=i.value()),o.push([1,n]),n=n.right;else{if(!i.hasNext())break;i.next(),n.mid||(n.mid=new bT,n.mid.segment=i.value()),o.push([0,n]),n=n.mid}}const s=vT.unwrap(n.value);n.value=vT.wrap(t),n.key=e;for(let e=o.length-1;e>=0;e--){const t=o[e][1];t.updateHeight();const i=t.balanceFactor();if(i<-1||i>1){const i=o[e][0],n=o[e+1][0];if(1===i&&1===n)o[e][1]=t.rotateLeft();else if(-1===i&&-1===n)o[e][1]=t.rotateRight();else if(1===i&&-1===n)t.right=o[e+1][1]=o[e+1][1].rotateRight(),o[e][1]=t.rotateLeft();else{if(-1!==i||1!==n)throw new Error;t.left=o[e+1][1]=o[e+1][1].rotateLeft(),o[e][1]=t.rotateRight()}if(e>0)switch(o[e-1][0]){case-1:o[e-1][1].left=o[e][1];break;case 1:o[e-1][1].right=o[e][1];break;case 0:o[e-1][1].mid=o[e][1]}else this._root=o[0][1]}}return s}get(e){return vT.unwrap(this._getNode(e)?.value)}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const e=t.cmp(i.segment);if(e>0)i=i.left;else if(e<0)i=i.right;else{if(!t.hasNext())break;t.next(),i=i.mid}}return i}has(e){const t=this._getNode(e);return!(void 0===t?.value&&void 0===t?.mid)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){const i=this._iter.reset(e),n=[];let o=this._root;for(;o;){const e=i.cmp(o.segment);if(e>0)n.push([-1,o]),o=o.left;else if(e<0)n.push([1,o]),o=o.right;else{if(!i.hasNext())break;i.next(),n.push([0,o]),o=o.mid}}if(o){if(t?(o.left=void 0,o.mid=void 0,o.right=void 0,o.height=1):(o.key=void 0,o.value=void 0),!o.mid&&!o.value)if(o.left&&o.right){const e=[[1,o]],t=this._min(o.right,e);if(t.key){o.key=t.key,o.value=t.value,o.segment=t.segment;const i=t.right;if(e.length>1){const[t,n]=e[e.length-1];switch(t){case-1:n.left=i;break;case 0:ot(!1);case 1:ot(!1)}}else o.right=i;const s=this._balanceByStack(e);if(n.length>0){const[e,t]=n[n.length-1];switch(e){case-1:t.left=s;break;case 0:t.mid=s;break;case 1:t.right=s}}else this._root=s}}else{const e=o.left??o.right;if(n.length>0){const[t,i]=n[n.length-1];switch(t){case-1:i.left=e;break;case 0:i.mid=e;break;case 1:i.right=e}}else this._root=e}this._root=this._balanceByStack(n)??this._root}}_min(e,t){for(;e.left;)t.push([-1,e]),e=e.left;return e}_balanceByStack(e){for(let t=e.length-1;t>=0;t--){const i=e[t][1];i.updateHeight();const n=i.balanceFactor();if(n>1?(i.right.balanceFactor()>=0||(i.right=i.right.rotateRight()),e[t][1]=i.rotateLeft()):n<-1&&(i.left.balanceFactor()<=0||(i.left=i.left.rotateLeft()),e[t][1]=i.rotateRight()),!(t>0))return e[0][1];switch(e[t-1][0]){case-1:e[t-1][1].left=e[t][1];break;case 1:e[t-1][1].right=e[t][1];break;case 0:e[t-1][1].mid=e[t][1]}}}findSubstr(e){const t=this._iter.reset(e);let i,n=this._root;for(;n;){const e=t.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else{if(!t.hasNext())break;t.next(),i=vT.unwrap(n.value)||i,n=n.mid}}return n&&vT.unwrap(n.value)||i}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let n=this._root;for(;n;){const e=i.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else{if(!i.hasNext())return n.mid?this._entries(n.mid):t?vT.unwrap(n.value):void 0;i.next(),n=n.mid}}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),void 0!==e.value&&t.push([e.key,vT.unwrap(e.value)]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}const CT=oc("contextService");function yT(e){const t=e;return"string"==typeof t?.id&&uo.isUri(t.uri)}const ST={id:"empty-window"};class xT{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const kT=(y(2032,"Code Workspace"),"4064f6ec-cb38-4ad0-af64-ee6467e63c82");var LT=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},DT=function(e,t){return function(i,n){t(i,n,e)}};class ET{constructor(e){this.copyMimeTypes=[],this.kind=e,this.providedDropEditKinds=[this.kind],this.providedPasteEditKinds=[this.kind]}async provideDocumentPasteEdits(e,t,i,n,o){const s=await this.getEdit(i,o);if(s)return{edits:[{insertText:s.insertText,title:s.title,kind:s.kind,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,n){const o=await this.getEdit(i,n);if(o)return{edits:[{insertText:o.insertText,title:o.title,kind:o.kind,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}],dispose(){}}}}class NT extends ET{static{this.id="text"}constructor(){super(_D.Empty.append("text","plain")),this.id=NT.id,this.dropMimeTypes=[yp.text],this.pasteMimeTypes=[yp.text]}async getEdit(e,t){const i=e.get(yp.text);if(!i)return;if(e.has(yp.uriList))return;const n=await i.asString();return{handledMimeType:yp.text,title:y(921,"Insert Plain Text"),insertText:n,kind:this.kind}}}class IT extends ET{constructor(){super(_D.Empty.append("uri","path","absolute")),this.dropMimeTypes=[yp.uriList],this.pasteMimeTypes=[yp.uriList]}async getEdit(e,t){const i=await AT(e);if(!i.length||t.isCancellationRequested)return;let n=0;const o=i.map((({uri:e,originalText:t})=>e.scheme===So.file?e.fsPath:(n++,t))).join(" ");let s;return s=n>0?i.length>1?y(922,"Insert Uris"):y(923,"Insert Uri"):i.length>1?y(924,"Insert Paths"):y(925,"Insert Path"),{handledMimeType:yp.uriList,insertText:o,title:s,kind:this.kind}}}let TT=class extends ET{constructor(e){super(_D.Empty.append("uri","path","relative")),this._workspaceContextService=e,this.dropMimeTypes=[yp.uriList],this.pasteMimeTypes=[yp.uriList]}async getEdit(e,t){const i=await AT(e);if(!i.length||t.isCancellationRequested)return;const n=as(i.map((({uri:e})=>{const t=this._workspaceContextService.getWorkspaceFolder(e);return t?Uh(t.uri,e):void 0})));return n.length?{handledMimeType:yp.uriList,insertText:n.join(" "),title:i.length>1?y(926,"Insert Relative Paths"):y(927,"Insert Relative Path"),kind:this.kind}:void 0}};TT=LT([DT(0,CT)],TT);class MT{constructor(){this.kind=new _D("html"),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:yp.text}]}async provideDocumentPasteEdits(e,t,i,n,o){if(n.triggerKind!==VS.PasteAs&&!n.only?.contains(this.kind))return;const s=i.get("text/html"),r=await(s?.asString());return r&&!o.isCancellationRequested?{dispose(){},edits:[{insertText:r,yieldTo:this._yieldTo,title:y(928,"Insert HTML"),kind:this.kind}]}:void 0}}async function AT(e){const t=e.get(yp.uriList);if(!t)return[];const i=await t.asString(),n=[];for(const e of fD.parse(i))try{n.push({uri:uo.parse(e),originalText:e})}catch{}return n}const RT={scheme:"*",hasAccessToAllModels:!0};let OT=class extends At{constructor(e,t){super(),this._register(e.documentDropEditProvider.register(RT,new NT)),this._register(e.documentDropEditProvider.register(RT,new IT)),this._register(e.documentDropEditProvider.register(RT,new TT(t)))}};OT=LT([DT(0,BD),DT(1,CT)],OT);let PT=class extends At{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register(RT,new NT)),this._register(e.documentPasteEditProvider.register(RT,new IT)),this._register(e.documentPasteEditProvider.register(RT,new TT(t))),this._register(e.documentPasteEditProvider.register(RT,new MT))}};PT=LT([DT(0,BD),DT(1,CT)],PT);class FT{constructor(){this.value="",this.pos=0}static{this._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13}}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return 95===e||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t,i=0,n=this.value.charCodeAt(e);if(t=FT._table[n],"number"==typeof t)return this.pos+=1,{type:t,pos:e,len:1};if(FT.isDigitCharacter(n)){t=8;do{i+=1,n=this.value.charCodeAt(e+i)}while(FT.isDigitCharacter(n));return this.pos+=i,{type:t,pos:e,len:i}}if(FT.isVariableCharacter(n)){t=9;do{n=this.value.charCodeAt(e+ ++i)}while(FT.isVariableCharacter(n)||FT.isDigitCharacter(n));return this.pos+=i,{type:t,pos:e,len:i}}t=10;do{i+=1,n=this.value.charCodeAt(e+i)}while(!isNaN(n)&&void 0===FT._table[n]&&!FT.isDigitCharacter(n)&&!FT.isVariableCharacter(n));return this.pos+=i,{type:t,pos:e,len:i}}}class BT{constructor(){this._children=[]}appendChild(e){return e instanceof WT&&this._children[this._children.length-1]instanceof WT?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),o=i.children.slice(0);o.splice(n,1,...t),i._children=o,function e(t,i){for(const n of t)n.parent=i,e(n.children,n)}(t,i)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof $T)return e;e=e.parent}}toString(){return this.children.reduce(((e,t)=>e+t.toString()),"")}len(){return 0}}class WT extends BT{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new WT(this.value)}}class VT extends BT{}class HT extends VT{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:e.index>t.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return 0===this.index}get choice(){return 1===this._children.length&&this._children[0]instanceof zT?this._children[0]:void 0}clone(){const e=new HT(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map((e=>e.clone())),e}}class zT extends BT{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof WT&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new zT;return this.options.forEach(e.appendChild,e),e}}class UT extends BT{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,(function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))}));return!i&&this._children.some((e=>e instanceof KT&&Boolean(e.elseValue)))&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof KT){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new UT;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map((e=>e.clone())),e}}class KT extends BT{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return"upcase"===this.shorthandName?e?e.toLocaleUpperCase():"":"downcase"===this.shorthandName?e?e.toLocaleLowerCase():"":"capitalize"===this.shorthandName?e?e[0].toLocaleUpperCase()+e.substr(1):"":"pascalcase"===this.shorthandName?e?this._toPascalCase(e):"":"camelcase"===this.shorthandName?e?this._toCamelCase(e):"":Boolean(e)&&"string"==typeof this.ifValue?this.ifValue:Boolean(e)||"string"!=typeof this.elseValue?e||"":this.elseValue}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((e=>e.charAt(0).toUpperCase()+e.substr(1))).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(((e,t)=>0===t?e.charAt(0).toLowerCase()+e.substr(1):e.charAt(0).toUpperCase()+e.substr(1))).join(""):e}clone(){return new KT(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class jT extends VT{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),void 0!==t&&(this._children=[new WT(t)],!0)}clone(){const e=new jT(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map((e=>e.clone())),e}}function qT(e,t){const i=[...e];for(;i.length>0;){const e=i.shift();if(!t(e))break;i.unshift(...e.children)}}class $T extends BT{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk((function(i){return i instanceof HT&&(e.push(i),t=!t||t.index<i.index?i:t),!0})),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){const{all:e}=this.placeholderInfo;return e}offset(e){let t=0,i=!1;return this.walk((n=>n===e?(i=!0,!1):(t+=n.len(),!0))),i?t:-1}fullLen(e){let t=0;return qT([e],(e=>(t+=e.len(),!0))),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof HT&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk((t=>(t instanceof jT&&t.resolve(e)&&(this._placeholders=void 0),!0))),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){const e=new $T;return this._children=this.children.map((e=>e.clone())),e}walk(e){qT(this.children,e)}}class GT{constructor(){this._scanner=new FT,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const n=new $T;return this.parseFragment(e,n),this.ensureFinalTabstop(n,i??!1,t??!1),n}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const n=new Map,o=[];t.walk((e=>(e instanceof HT&&(e.isFinalTabstop?n.set(0,void 0):!n.has(e.index)&&e.children.length>0?n.set(e.index,e.children):o.push(e)),!0)));const s=(e,i)=>{const o=n.get(e.index);if(!o)return;const r=new HT(e.index);r.transform=e.transform;for(const e of o){const t=e.clone();r.appendChild(t),t instanceof HT&&n.has(t.index)&&!i.has(t.index)&&(i.add(t.index),s(t,i),i.delete(t.index))}t.replace(e,[r])},r=new Set;for(const e of o)s(e,r);return t.children.slice(i)}ensureFinalTabstop(e,t,i){if(t||i&&e.placeholders.length>0){const t=e.placeholders.find((e=>0===e.index));t||e.appendChild(new HT(0))}}_accept(e,t){if(void 0===e||this._token.type===e){const e=!t||this._scanner.tokenText(this._token);return this._token=this._scanner.next(),e}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(14===this._token.type)return!1;if(5===this._token.type){const e=this._scanner.next();if(0!==e.type&&4!==e.type&&5!==e.type)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return!!(t=this._accept(5,!0))&&(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new WT(t)),!0)}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new HT(Number(t)):new jT(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const n=new HT(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(n),!0;if(!this._parse(n))return e.appendChild(new WT("${"+t+":")),n.children.forEach(e.appendChild,e),!0}else{if(!(n.index>0&&this._accept(7)))return this._accept(6)?this._parseTransform(n)?(e.appendChild(n),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(n),!0):this._backTo(i);{const t=new zT;for(;;){if(this._parseChoiceElement(t)){if(this._accept(2))continue;if(this._accept(7)&&(n.appendChild(t),this._accept(4)))return e.appendChild(n),!0}return this._backTo(i),!1}}}}_parseChoiceElement(e){const t=this._token,i=[];for(;2!==this._token.type&&7!==this._token.type;){let e;if(e=(e=this._accept(5,!0))?this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||e:this._accept(void 0,!0),!e)return this._backTo(t),!1;i.push(e)}return 0===i.length?(this._backTo(t),!1):(e.appendChild(new WT(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const n=new jT(t);if(!this._accept(1))return this._accept(6)?this._parseTransform(n)?(e.appendChild(n),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(n),!0):this._backTo(i);for(;;){if(this._accept(4))return e.appendChild(n),!0;if(!this._parse(n))return e.appendChild(new WT("${"+t+":")),n.children.forEach(e.appendChild,e),!0}}_parseTransform(e){const t=new UT;let i="",n="";for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(6,!0)||e,i+=e;else{if(14===this._token.type)return!1;i+=this._accept(void 0,!0)}}for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(5,!0)||this._accept(6,!0)||e,t.appendChild(new WT(e));else if(!this._parseFormatString(t)&&!this._parseAnything(t))return!1}for(;!this._accept(4);){if(14===this._token.type)return!1;n+=this._accept(void 0,!0)}try{t.regexp=new RegExp(i,n)}catch(e){return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const n=this._accept(8,!0);if(!n)return this._backTo(t),!1;if(!i)return e.appendChild(new KT(Number(n))),!0;if(this._accept(4))return e.appendChild(new KT(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1;if(this._accept(6)){const i=this._accept(9,!0);return i&&this._accept(4)?(e.appendChild(new KT(Number(n),i)),!0):(this._backTo(t),!1)}if(this._accept(11)){const t=this._until(4);if(t)return e.appendChild(new KT(Number(n),void 0,t,void 0)),!0}else if(this._accept(12)){const t=this._until(4);if(t)return e.appendChild(new KT(Number(n),void 0,void 0,t)),!0}else if(this._accept(13)){const t=this._until(1);if(t){const i=this._until(4);if(i)return e.appendChild(new KT(Number(n),void 0,t,i)),!0}}else{const t=this._until(4);if(t)return e.appendChild(new KT(Number(n),void 0,void 0,t)),!0}return this._backTo(t),!1}_parseAnything(e){return 14!==this._token.type&&(e.appendChild(new WT(this._scanner.tokenText(this._token))),this._accept(void 0),!0)}}function ZT(e,t,i){return("string"==typeof i.insertText?""===i.insertText:""===i.insertText.snippet)?{edits:i.additionalEdit?.edits??[]}:{edits:[...t.map((t=>new PD(e,{range:t,text:"string"==typeof i.insertText?GT.escape(i.insertText)+"$0":i.insertText.snippet,insertAsSnippet:!0}))),...i.additionalEdit?.edits??[]]}}function YT(e){function t(e,t){return"mimeType"in e?e.mimeType===t.handledMimeType:!!t.kind&&e.kind.contains(t.kind)}const i=new Map;for(const n of e)for(const o of n.yieldTo??[])for(const s of e)if(s!==n&&t(o,s)){let e=i.get(n);e||(e=[],i.set(n,e)),e.push(s)}if(!i.size)return Array.from(e);const n=new Set,o=[];return function e(t){if(!t.length)return[];const s=t[0];if(o.includes(s))return console.warn("Yield to cycle detected",s),t;if(n.has(s))return e(t.slice(1));let r=[];const a=i.get(s);return a&&(o.push(s),r=e(a),o.pop()),n.add(s),[...r,s,...e(t.slice(1))]}(Array.from(e))}function QT(e,t,i){let n=null,o=null;if("function"==typeof i.value?(n="value",o=i.value,0!==o.length&&console.warn("Memoize should only be used in functions with zero parameters")):"function"==typeof i.get&&(n="get",o=i.get),!o)throw new Error("not supported");const s=`$memoize$${t}`;i[n]=function(...e){return this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,e)}),this[s]}}var XT;!function(e){e.Tap="-monaco-gesturetap",e.Change="-monaco-gesturechange",e.Start="-monaco-gesturestart",e.End="-monaco-gesturesend",e.Contextmenu="-monaco-gesturecontextmenu"}(XT||(XT={}));class JT extends At{static{this.SCROLL_FRICTION=-.005}static{this.HOLD_DELAY=700}static{this.CLEAR_TAP_COUNT_TIME=400}constructor(){super(),this.dispatched=!1,this.targets=new Wt,this.ignoreTargets=new Wt,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(zt.runAndSubscribe(la,(({window:e,disposables:t})=>{t.add(ga(e.document,"touchstart",(e=>this.onTouchStart(e)),{passive:!1})),t.add(ga(e.document,"touchend",(t=>this.onTouchEnd(e,t)))),t.add(ga(e.document,"touchmove",(e=>this.onTouchMove(e)),{passive:!1}))}),{window:r,disposables:this._store}))}static addTarget(e){return JT.isTouchDevice()?(JT.INSTANCE||(JT.INSTANCE=Lt(new JT)),Tt(JT.INSTANCE.targets.push(e))):At.None}static ignoreTarget(e){return JT.isTouchDevice()?(JT.INSTANCE||(JT.INSTANCE=Lt(new JT)),Tt(JT.INSTANCE.ignoreTargets.push(e))):At.None}static isTouchDevice(){return"ontouchstart"in r||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,n=e.targetTouches.length;i<n;i++){const n=e.targetTouches.item(i);this.activeTouches[n.identifier]={id:n.identifier,initialTarget:n.target,initialTimeStamp:t,initialPageX:n.pageX,initialPageY:n.pageY,rollingTimestamps:[t],rollingPageX:[n.pageX],rollingPageY:[n.pageY]};const o=this.newGestureEvent(XT.Start,n.target);o.pageX=n.pageX,o.pageY=n.pageY,this.dispatchEvent(o)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e,t){const i=Date.now(),n=Object.keys(this.activeTouches).length;for(let o=0,s=t.changedTouches.length;o<s;o++){const s=t.changedTouches.item(o);if(!this.activeTouches.hasOwnProperty(String(s.identifier))){console.warn("move of an UNKNOWN touch",s);continue}const r=this.activeTouches[s.identifier],a=Date.now()-r.initialTimeStamp;if(a<JT.HOLD_DELAY&&Math.abs(r.initialPageX-r.rollingPageX.at(-1))<30&&Math.abs(r.initialPageY-r.rollingPageY.at(-1))<30){const e=this.newGestureEvent(XT.Tap,r.initialTarget);e.pageX=r.rollingPageX.at(-1),e.pageY=r.rollingPageY.at(-1),this.dispatchEvent(e)}else if(a>=JT.HOLD_DELAY&&Math.abs(r.initialPageX-r.rollingPageX.at(-1))<30&&Math.abs(r.initialPageY-r.rollingPageY.at(-1))<30){const e=this.newGestureEvent(XT.Contextmenu,r.initialTarget);e.pageX=r.rollingPageX.at(-1),e.pageY=r.rollingPageY.at(-1),this.dispatchEvent(e)}else if(1===n){const t=r.rollingPageX.at(-1),n=r.rollingPageY.at(-1),o=r.rollingTimestamps.at(-1)-r.rollingTimestamps[0],s=t-r.rollingPageX[0],a=n-r.rollingPageY[0],l=[...this.targets].filter((e=>r.initialTarget instanceof Node&&e.contains(r.initialTarget)));this.inertia(e,l,i,Math.abs(s)/o,s>0?1:-1,t,Math.abs(a)/o,a>0?1:-1,n)}this.dispatchEvent(this.newGestureEvent(XT.End,r.initialTarget)),delete this.activeTouches[s.identifier]}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===XT.Tap){const t=(new Date).getTime();let i=0;i=t-this._lastSetTapCountTime>JT.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=t,e.tapCount=i}else e.type!==XT.Change&&e.type!==XT.Contextmenu||(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const t of this.ignoreTargets)if(t.contains(e.initialTarget))return;const t=[];for(const i of this.targets)if(i.contains(e.initialTarget)){let n=0,o=e.initialTarget;for(;o&&o!==i;)n++,o=o.parentElement;t.push([n,i])}t.sort(((e,t)=>e[0]-t[0]));for(const[i,n]of t)n.dispatchEvent(e),this.dispatched=!0}}inertia(e,t,i,n,o,s,r,a,l){this.handle=Ca(e,(()=>{const d=Date.now(),h=d-i;let c=0,u=0,g=!0;n+=JT.SCROLL_FRICTION*h,r+=JT.SCROLL_FRICTION*h,n>0&&(g=!1,c=o*n*h),r>0&&(g=!1,u=a*r*h);const p=this.newGestureEvent(XT.Change);p.translationX=c,p.translationY=u,t.forEach((e=>e.dispatchEvent(p))),g||this.inertia(e,t,d,n,o,s+c,r,a,l+u)}))}onTouchMove(e){const t=Date.now();for(let i=0,n=e.changedTouches.length;i<n;i++){const n=e.changedTouches.item(i);if(!this.activeTouches.hasOwnProperty(String(n.identifier))){console.warn("end of an UNKNOWN touch",n);continue}const o=this.activeTouches[n.identifier],s=this.newGestureEvent(XT.Change,o.initialTarget);s.translationX=n.pageX-o.rollingPageX.at(-1),s.translationY=n.pageY-o.rollingPageY.at(-1),s.pageX=n.pageX,s.pageY=n.pageY,this.dispatchEvent(s),o.rollingPageX.length>3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(n.pageX),o.rollingPageY.push(n.pageY),o.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}!function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);s>3&&r&&Object.defineProperty(t,i,r)}([QT],JT,"isTouchDevice",null);let eM=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}});const tM=new Oi((()=>eM("mouse",!1))),iM=new Oi((()=>eM("element",!1)));function nM(e){return"element"===e?iM.value:tM.value}function oM(){return eM("element",!0)}var sM=i(8880),rM={};rM.styleTagTransform=zl(),rM.setAttributes=Bl(),rM.insert=Pl().bind(null,"head"),rM.domAPI=Rl(),rM.insertStyleElement=Vl(),Ml()(sM.A,rM),sM.A&&sM.A.locals&&sM.A.locals;let aM={showInstantHover:()=>{},showDelayedHover:()=>{},setupDelayedHover:()=>At.None,setupDelayedHoverAtMouse:()=>At.None,hideHover:()=>{},showAndFocusLastHover:()=>{},setupManagedHover:()=>({dispose:()=>{},show:()=>{},hide:()=>{},update:()=>{}}),showManagedHover:()=>{}};function lM(){return aM}Lg.white.toString(),Lg.white.toString();const dM=Object.freeze({allowedTags:{override:["b","i","u","code","span"]},allowedAttributes:{override:["class"]}});class hM extends At{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new Zt),this._onDidEscape=this._register(new Zt),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);const i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,n=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=n||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),"string"==typeof t.title&&this.setTitle(t.title),"string"==typeof t.ariaLabel&&this._element.setAttribute("aria-label",t.ariaLabel),e.appendChild(this._element),this.enabled=!t.disabled,this._register(JT.addTarget(this._element)),[Qa.CLICK,XT.Tap].forEach((e=>{this._register(ga(this._element,e,(e=>{this.enabled?this._onDidClick.fire(e):Ja(e)})))})),this._register(ga(this._element,Qa.KEY_DOWN,(e=>{const t=new Ze(e);let i=!1;this.enabled&&(t.equals(3)||t.equals(10))?(this._onDidClick.fire(e),i=!0):t.equals(9)&&(this._onDidEscape.fire(e),this._element.blur(),i=!0),i&&Ja(t,!0)}))),this._register(ga(this._element,Qa.MOUSE_OVER,(e=>{this._element.classList.contains("disabled")||this.updateBackground(!0)}))),this._register(ga(this._element,Qa.MOUSE_OUT,(e=>{this.updateBackground(!1)}))),this.focusTracker=this._register(tl(this._element)),this._register(this.focusTracker.onDidFocus((()=>{this.enabled&&this.updateBackground(!0)}))),this._register(this.focusTracker.onDidBlur((()=>{this.enabled&&this.updateBackground(!1)})))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const t=[];for(let i of bI(e))if("string"==typeof i){if(i=i.trim(),""===i)continue;const e=document.createElement("span");e.textContent=i,t.push(e)}else t.push(i);return t}updateBackground(e){let t;t=this.options.secondary?e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){if(this._label===e)return;if(Yh(this._label)&&Yh(e)&&function(e,t){return e===t||!(!e||!t)&&e.value===t.value&&e.isTrusted===t.isTrusted&&e.supportThemeIcons===t.supportThemeIcons&&e.supportHtml===t.supportHtml&&(e.baseUri===t.baseUri||!!e.baseUri&&!!t.baseUri&&Ph(uo.from(e.baseUri),uo.from(t.baseUri)))}(this._label,e))return;this._element.classList.add("monaco-text-button");const t=this.options.supportShortLabel?this._labelElement:this._element;if(Yh(e)){const i=yI(e,void 0,document.createElement("span"));i.dispose();const n=i.element.querySelector("p")?.innerHTML;n?_I(t,n,dM):ol(t)}else this.options.supportIcons?ol(t,...this.getContentElements(e)):t.textContent=e;let i="";"string"==typeof this.options.title?i=this.options.title:this.options.title&&(i=function(e){if("string"==typeof e)return e;let t=e.value??"";return t.length>1e5&&(t=`${t.substr(0,1e5)}…`),function(e,t,i={}){return gI(e,II(t,i),"trusted")}(sN(t,{async:!1,renderer:AI.value}),{isTrusted:!1},{}).toString().replace(/&(#\d+|[a-zA-Z]+);/g,(e=>TI.get(e)??e)).trim()}(e)),this.setTitle(i),this._setAriaLabel(),this._label=e}get label(){return this._label}_setAriaLabel(){"string"==typeof this.options.ariaLabel?this._element.setAttribute("aria-label",this.options.ariaLabel):"string"==typeof this.options.title&&this._element.setAttribute("aria-label",this.options.title)}set icon(e){this._setAriaLabel();const t=Array.from(this._element.classList).filter((e=>e.startsWith("codicon-")));this._element.classList.remove(...t),this._element.classList.add(...vh.asClassNameArray(e))}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}setTitle(e){this._hover||""===e?this._hover&&this._hover.update(e):this._hover=this._register(lM().setupManagedHover(this.options.hoverDelegate??nM("element"),this._element,e))}}function cM(e,t){return t&&(e.stack||e.stacktrace)?y(29,"{0}: {1}",gM(e),uM(e.stack)||uM(e.stacktrace)):gM(e)}function uM(e){return Array.isArray(e)?e.join("\n"):e}function gM(e){return"ERR_UNC_HOST_NOT_ALLOWED"===e.code?`${e.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:"string"==typeof e.code&&"number"==typeof e.errno&&"string"==typeof e.syscall?y(30,"A system error occurred ({0})",e.message):e.message||y(31,"An unknown error occurred. Please consult the log for more details.")}function pM(e=null,t=!1){if(!e)return y(32,"An unknown error occurred. Please consult the log for more details.");if(Array.isArray(e)){const i=as(e),n=pM(i[0],t);return i.length>1?y(33,"{0} ({1} errors in total)",n,i.length):n}if(lt(e))return e;if(e.detail){const i=e.detail;if(i.error)return cM(i.error,t);if(i.exception)return cM(i.exception,t)}return e.stack?cM(e,t):e.message?e.message:y(34,"An unknown error occurred. Please consult the log for more details.")}class mM extends At{onclick(e,t){this._register(ga(e,Qa.CLICK,(i=>t(new Je(ta(e),i)))))}onmousedown(e,t){this._register(ga(e,Qa.MOUSE_DOWN,(i=>t(new Je(ta(e),i)))))}onmouseover(e,t){this._register(ga(e,Qa.MOUSE_OVER,(i=>t(new Je(ta(e),i)))))}onmouseleave(e,t){this._register(ga(e,Qa.MOUSE_LEAVE,(i=>t(new Je(ta(e),i)))))}onkeydown(e,t){this._register(ga(e,Qa.KEY_DOWN,(e=>t(new Ze(e)))))}onkeyup(e,t){this._register(ga(e,Qa.KEY_UP,(e=>t(new Ze(e)))))}oninput(e,t){this._register(ga(e,Qa.INPUT,t))}onblur(e,t){this._register(ga(e,Qa.BLUR,t))}onfocus(e,t){this._register(ga(e,Qa.FOCUS,t))}ignoreGesture(e){return JT.ignoreTarget(e)}}var fM=i(5070),_M={};function vM(e,t){if(void 0!==e){const i=e.match(/^\s*var\((.+)\)$/);if(i){const e=i[1].split(",",2);return 2===e.length&&(t=vM(e[1].trim(),t)),`var(${e[0]}, ${t})`}return e}return t}function bM(e){const t=e.replaceAll(/[^_\-a-z0-9]/gi,"");return t!==e&&console.warn(`CSS ident value ${e} modified to ${t} to be safe for CSS`),t}function wM(e){return`'${e.replaceAll(/'/g,"\\000027")}'`}function CM(e){return e?SM`url('${CSS.escape(Eo.uriToBrowserUri(e).toString(!0))}')`:"url('')"}function yM(e,t=!1){const i=CSS.escape(e);return t||i===e||console.warn(`CSS class name ${e} modified to ${i} to be safe for CSS`),i}function SM(e,...t){return e.reduce(((e,i,n)=>e+i+(t[n]||"")),"")}_M.styleTagTransform=zl(),_M.setAttributes=Bl(),_M.insert=Pl().bind(null,"head"),_M.domAPI=Rl(),_M.insertStyleElement=Vl(),Ml()(fM.A,_M),fM.A&&fM.A.locals&&fM.A.locals;class xM{constructor(){this._parts=[]}push(...e){this._parts.push(...e)}join(e="\n"){return this._parts.join(e)}}const kM=new Map;class LM{constructor(){this._currentCssStyle="",this._styleSheet=void 0}setStyle(e){e!==this._currentCssStyle&&(this._currentCssStyle=e,this._styleSheet?this._styleSheet.textContent=e:this._styleSheet=DM(r.document.head,(t=>t.textContent=e)))}dispose(){this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=void 0)}}function DM(e=r.document.head,t,i){const n=document.createElement("style");if(n.type="text/css",n.media="screen",t?.(n),e.appendChild(n),i&&i.add(Tt((()=>n.remove()))),e===r.document.head){const e=new Set;kM.set(n,e),i&&i.add(Tt((()=>kM.delete(n))));for(const{window:t,disposables:o}of na()){if(t===r)continue;const s=o.add(EM(n,e,t));i?.add(s)}}return n}function EM(e,t,i){const n=new Mt,o=e.cloneNode(!0);i.document.head.appendChild(o),n.add(Tt((()=>o.remove())));for(const t of TM(e))o.sheet?.insertRule(t.cssText,o.sheet?.cssRules.length);return n.add(ja.observe(e,n,{childList:!0,subtree:c,characterData:c})((()=>{o.textContent=e.textContent}))),t.add(o),n.add(Tt((()=>t.delete(o)))),n}let NM=null;function IM(){return NM||(NM=DM()),NM}function TM(e){return e?.sheet?.rules?e.sheet.rules:e?.sheet?.cssRules?e.sheet.cssRules:[]}function MM(e,t,i=IM()){if(i&&t){i.sheet?.insertRule(`${e} {${t}}`,0);for(const n of kM.get(i)??[])MM(e,t,n)}}function AM(e,t=IM()){if(!t)return;const i=TM(t),n=[];for(let t=0;t<i.length;t++){const o=i[t];RM(o)&&-1!==o.selectorText.indexOf(e)&&n.push(t)}for(let e=n.length-1;e>=0;e--)t.sheet?.deleteRule(n[e]);for(const i of kM.get(t)??[])AM(e,i)}function RM(e){return"string"==typeof e.selectorText}class OM{get event(){return this.emitter.event}constructor(e,t,i){const n=e=>this.emitter.fire(e);this.emitter=new Zt({onWillAddFirstListener:()=>e.addEventListener(t,n,i),onDidRemoveLastListener:()=>e.removeEventListener(t,n,i)})}dispose(){this.emitter.dispose()}}class PM{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach((n=>n.splice(e,t,i)))}}function FM(e,t,i){return Math.min(Math.max(e,t),i)}class BM{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}}class WM{constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){const t=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=t,this._sum+=e,this._n<this._values.length&&(this._n+=1),this._val=this._sum/this._n,this._val}get value(){return this._val}}var VM=i(7340),HM={};HM.styleTagTransform=zl(),HM.setAttributes=Bl(),HM.insert=Pl().bind(null,"head"),HM.domAPI=Rl(),HM.insertStyleElement=Vl(),Ml()(VM.A,HM),VM.A&&VM.A.locals&&VM.A.locals;class zM extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}class UM{constructor(){this._hooks=new Mt,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,n,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=o;let s=e;try{e.setPointerCapture(t),this._hooks.add(Tt((()=>{try{e.releasePointerCapture(t)}catch(e){}})))}catch(t){s=ta(e)}this._hooks.add(ga(s,Qa.POINTER_MOVE,(e=>{e.buttons===i?(e.preventDefault(),this._pointerMoveCallback(e)):this.stopMonitoring(!0)}))),this._hooks.add(ga(s,Qa.POINTER_UP,(e=>this.stopMonitoring(!0))))}}class KM extends mM{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",void 0!==e.top&&(this.bgDomNode.style.top="0px"),void 0!==e.left&&(this.bgDomNode.style.left="0px"),void 0!==e.bottom&&(this.bgDomNode.style.bottom="0px"),void 0!==e.right&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...vh.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width="11px",this.domNode.style.height="11px",void 0!==e.top&&(this.domNode.style.top=e.top+"px"),void 0!==e.left&&(this.domNode.style.left=e.left+"px"),void 0!==e.bottom&&(this.domNode.style.bottom=e.bottom+"px"),void 0!==e.right&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new UM),this._register(ma(this.bgDomNode,Qa.POINTER_DOWN,(e=>this._arrowPointerDown(e)))),this._register(ma(this.domNode,Qa.POINTER_DOWN,(e=>this._arrowPointerDown(e)))),this._pointerdownRepeatTimer=this._register(new ya),this._pointerdownScheduleRepeatTimer=this._register(new bi)}_arrowPointerDown(e){e.target&&e.target instanceof Element&&(this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet((()=>{this._pointerdownRepeatTimer.cancelAndSet((()=>this._onActivate()),1e3/24,ta(e))}),200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,(e=>{}),(()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()})),e.preventDefault())}}class jM extends At{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new bi)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return 2!==this._visibility&&(3===this._visibility||this._rawShouldBeVisible)}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){this._isNeeded?this._shouldBeVisible?this._reveal():this._hide(!0):this._hide(!1)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet((()=>{this._domNode?.setClassName(this._visibleClassName)}),0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}}class qM extends mM{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new jM(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new UM),this._shouldRender=!0,this.domNode=tT(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(ga(this.domNode.domNode,Qa.POINTER_DOWN,(e=>this._domNodePointerDown(e))))}_createArrow(e){const t=this._register(new KM(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=tT(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),"number"==typeof i&&this.slider.setWidth(i),"number"==typeof n&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(ga(this.slider.domNode,Qa.POINTER_DOWN,(e=>{0===e.button&&(e.preventDefault(),this._sliderPointerDown(e))}))),this.onclick(this.slider.domNode,(e=>{e.leftButton&&e.stopPropagation()}))}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);i<=o&&o<=n?0===e.button&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&"number"==typeof e.offsetX&&"number"==typeof e.offsetY)t=e.offsetX,i=e.offsetY;else{const n=Na(this.domNode.domNode);t=e.pageX-n.left,i=e.pageY-n.top}const n="mouse"===e.pointerType,o=0===e.button;if(o||!n){const e=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(e):this._scrollbarState.getDesiredScrollPositionFromOffset(e))}o&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!(e.target&&e.target instanceof Element))return;const t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,(e=>{const o=this._sliderOrthogonalPointerPosition(e),s=Math.abs(o-i);if(q&&s>140)return void this._setDesiredScrollPositionNow(n.getScrollPosition());const r=this._sliderPointerPosition(e)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(r))}),(()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()})),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}class $M{constructor(e,t,i,n,o,s){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,this._scrollSize=o,this._scrollPosition=s,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new $M(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t&&(this._visibleSize=t,this._refreshComputedValues(),!0)}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t&&(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t&&(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,n,o){const s=Math.max(0,i-e),r=Math.max(0,s-2*t),a=n>0&&n>i;if(!a)return{computedAvailableSize:Math.round(s),computedIsNeeded:a,computedSliderSize:Math.round(r),computedSliderRatio:0,computedSliderPosition:0};const l=Math.round(Math.max(20,Math.floor(i*r/n))),d=(r-l)/(n-i),h=o*d;return{computedAvailableSize:Math.round(s),computedIsNeeded:a,computedSliderSize:Math.round(l),computedSliderRatio:d,computedSliderPosition:Math.round(h)}}_refreshComputedValues(){const e=$M._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return t<this._computedSliderPosition?i-=this._visibleSize:i+=this._visibleSize,i}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;const t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}}class GM extends qM{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new $M(t.horizontalHasArrows?t.arrowSize:0,2===t.horizontal?0:t.horizontalScrollbarSize,2===t.vertical?0:t.verticalScrollbarSize,n.width,n.scrollWidth,o.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows){const e=(t.arrowSize-11)/2,i=(t.horizontalScrollbarSize-11)/2;this._createArrow({className:"scra",icon:fh.scrollbarButtonLeft,top:i,left:e,bottom:void 0,right:void 0,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new et(null,1,0))}),this._createArrow({className:"scra",icon:fh.scrollbarButtonRight,top:i,left:void 0,bottom:void 0,right:e,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new et(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(2===e.horizontal?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(2===e.vertical?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class ZM extends qM{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new $M(t.verticalHasArrows?t.arrowSize:0,2===t.vertical?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const e=(t.arrowSize-11)/2,i=(t.verticalScrollbarSize-11)/2;this._createArrow({className:"scra",icon:fh.scrollbarButtonUp,top:e,left:i,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new et(null,0,1))}),this._createArrow({className:"scra",icon:fh.scrollbarButtonDown,top:void 0,left:i,bottom:e,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new et(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(2===e.vertical?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class YM{constructor(e,t,i,n,o,s,r){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,i|=0,n|=0,o|=0,s|=0,r|=0),this.rawScrollLeft=n,this.rawScrollTop=r,t<0&&(t=0),n+t>i&&(n=i-t),n<0&&(n=0),o<0&&(o=0),r+o>s&&(r=s-o),r<0&&(r=0),this.width=t,this.scrollWidth=i,this.scrollLeft=n,this.height=o,this.scrollHeight=s,this.scrollTop=r}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new YM(this._forceIntegerValues,void 0!==e.width?e.width:this.width,void 0!==e.scrollWidth?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,void 0!==e.height?e.height:this.height,void 0!==e.scrollHeight?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new YM(this._forceIntegerValues,this.width,this.scrollWidth,void 0!==e.scrollLeft?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,void 0!==e.scrollTop?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,n=this.scrollWidth!==e.scrollWidth,o=this.scrollLeft!==e.scrollLeft,s=this.height!==e.height,r=this.scrollHeight!==e.scrollHeight,a=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:n,scrollLeftChanged:o,heightChanged:s,scrollHeightChanged:r,scrollTopChanged:a}}}class QM extends At{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new Zt),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new YM(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){const i=this._state.withScrollDimensions(e,t);this._setState(i,Boolean(this._smoothScrolling)),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(0===this._smoothScrollDuration)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:void 0===e.scrollLeft?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:void 0===e.scrollTop?this._smoothScrolling.to.scrollTop:e.scrollTop};const i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let n;n=t?new eA(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{const t=this._state.withScrollPosition(e);this._smoothScrolling=eA.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())}))}hasPendingScrollAnimation(){return Boolean(this._smoothScrolling)}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);return this._setState(t,!0),this._smoothScrolling?e.isDone?(this._smoothScrolling.dispose(),void(this._smoothScrolling=null)):void(this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())}))):void 0}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class XM{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function JM(e,t){const i=t-e;return function(t){return e+i*(1-(n=1-t,Math.pow(n,3)));var n}}class eA{constructor(e,t,i,n){this.from=e,this.to=t,this.duration=n,this.startTime=i,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,i){if(Math.abs(e-t)>2.5*i){let n,o;return e<t?(n=e+.75*i,o=t-.75*i):(n=e-.75*i,o=t+.75*i),function(e,t,i){return function(n){return n<i?e(n/i):t((n-i)/(1-i))}}(JM(e,n),JM(o,t),.33)}return JM(e,t)}dispose(){null!==this.animationFrameDisposable&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){const t=(e-this.startTime)/this.duration;if(t<1){const e=this.scrollLeft(t),i=this.scrollTop(t);return new XM(e,i,!1)}return new XM(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,t,i){return eA.start(e,t,i)}static start(e,t,i){i+=10;const n=Date.now()-10;return new eA(e,t,n,i)}}var tA,iA=i(140),nA={};nA.styleTagTransform=zl(),nA.setAttributes=Bl(),nA.insert=Pl().bind(null,"head"),nA.domAPI=Rl(),nA.insertStyleElement=Vl(),Ml()(iA.A,nA),iA.A&&iA.A.locals&&iA.A.locals;class oA{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}class sA{static{this.INSTANCE=new sA}constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(-1===this._front&&-1===this._rear)return!1;let e=1,t=0,i=1,n=this._rear;for(;;){const o=n===this._front?e:Math.pow(2,-i);if(e-=o,t+=this._memory[n].score*o,n===this._front)break;n=(this._capacity+n-1)%this._capacity,i++}return t<=.5}acceptStandardWheelEvent(e){if(g){const t=d(ta(e.browserEvent));this.accept(Date.now(),e.deltaX*t,e.deltaY*t)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,i){let n=null;const o=new oA(e,t,i);-1===this._front&&-1===this._rear?(this._memory[0]=o,this._front=0,this._rear=0):(n=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=o),o.score=this._computeScore(o,n)}_computeScore(e,t){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let i=.5;if(this._isAlmostInt(e.deltaX)&&this._isAlmostInt(e.deltaY)||(i+=.25),t){const n=Math.abs(e.deltaX),o=Math.abs(e.deltaY),s=Math.abs(t.deltaX),r=Math.abs(t.deltaY),a=Math.max(Math.min(n,s),1),l=Math.max(Math.min(o,r),1),d=Math.max(n,s),h=Math.max(o,r);d%a==0&&h%l==0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(e){const t=100*Number.EPSILON;return Math.abs(Math.round(e)-e)<.01+t}}class rA extends mM{get onScroll(){return this._onScroll.event}get options(){return this._options}constructor(e,t,i){super(),this._inertialTimeout=null,this._inertialSpeed={X:0,Y:0},this._onScroll=this._register(new Zt),this._onWillScroll=this._register(new Zt),e.style.overflow="hidden",this._options=function(e){const t={lazyRender:void 0!==e.lazyRender&&e.lazyRender,className:void 0!==e.className?e.className:"",useShadows:void 0===e.useShadows||e.useShadows,handleMouseWheel:void 0===e.handleMouseWheel||e.handleMouseWheel,flipAxes:void 0!==e.flipAxes&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:void 0!==e.consumeMouseWheelIfScrollbarIsNeeded&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:void 0!==e.alwaysConsumeMouseWheel&&e.alwaysConsumeMouseWheel,scrollYToX:void 0!==e.scrollYToX&&e.scrollYToX,mouseWheelScrollSensitivity:void 0!==e.mouseWheelScrollSensitivity?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:void 0!==e.fastScrollSensitivity?e.fastScrollSensitivity:5,scrollPredominantAxis:void 0===e.scrollPredominantAxis||e.scrollPredominantAxis,mouseWheelSmoothScroll:void 0===e.mouseWheelSmoothScroll||e.mouseWheelSmoothScroll,inertialScroll:void 0!==e.inertialScroll&&e.inertialScroll,arrowSize:void 0!==e.arrowSize?e.arrowSize:11,listenOnDomNode:void 0!==e.listenOnDomNode?e.listenOnDomNode:null,horizontal:void 0!==e.horizontal?e.horizontal:1,horizontalScrollbarSize:void 0!==e.horizontalScrollbarSize?e.horizontalScrollbarSize:10,horizontalSliderSize:void 0!==e.horizontalSliderSize?e.horizontalSliderSize:0,horizontalHasArrows:void 0!==e.horizontalHasArrows&&e.horizontalHasArrows,vertical:void 0!==e.vertical?e.vertical:1,verticalScrollbarSize:void 0!==e.verticalScrollbarSize?e.verticalScrollbarSize:10,verticalHasArrows:void 0!==e.verticalHasArrows&&e.verticalHasArrows,verticalSliderSize:void 0!==e.verticalSliderSize?e.verticalSliderSize:0,scrollByPage:void 0!==e.scrollByPage&&e.scrollByPage};return t.horizontalSliderSize=void 0!==e.horizontalSliderSize?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=void 0!==e.verticalSliderSize?e.verticalSliderSize:t.verticalScrollbarSize,$&&(t.className+=" mac"),t}(t),this._scrollable=i,this._register(this._scrollable.onScroll((e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)})));const n={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new ZM(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new GM(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=tT(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=tT(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=tT(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,(e=>this._onMouseOver(e))),this.onmouseleave(this._listenOnDomNode,(e=>this._onMouseLeave(e))),this._hideTimeout=this._register(new bi),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=Et(this._mouseWheelToDispose),this._inertialTimeout&&(this._inertialTimeout.dispose(),this._inertialTimeout=null),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,$&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){void 0!==e.handleMouseWheel&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),void 0!==e.mouseWheelScrollSensitivity&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),void 0!==e.fastScrollSensitivity&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),void 0!==e.scrollPredominantAxis&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),void 0!==e.horizontal&&(this._options.horizontal=e.horizontal),void 0!==e.vertical&&(this._options.vertical=e.vertical),void 0!==e.horizontalScrollbarSize&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),void 0!==e.verticalScrollbarSize&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),void 0!==e.scrollByPage&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new et(e))}async _periodicSync(){let e=!1;0===this._inertialSpeed.X&&0===this._inertialSpeed.Y||(this._scrollable.setScrollPositionNow({scrollTop:this._scrollable.getCurrentScrollPosition().scrollTop-100*this._inertialSpeed.Y,scrollLeft:this._scrollable.getCurrentScrollPosition().scrollLeft-100*this._inertialSpeed.X}),this._inertialSpeed.X*=.9,this._inertialSpeed.Y*=.9,Math.abs(this._inertialSpeed.X)<.01&&(this._inertialSpeed.X=0),Math.abs(this._inertialSpeed.Y)<.01&&(this._inertialSpeed.Y=0),e=0!==this._inertialSpeed.X||0!==this._inertialSpeed.Y),e?(this._inertialTimeout||(this._inertialTimeout=new bi),this._inertialTimeout.cancelAndSet((()=>this._periodicSync()),1e3/60)):(this._inertialTimeout?.dispose(),this._inertialTimeout=null)}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Et(this._mouseWheelToDispose),e)){const e=e=>{this._onMouseWheel(new et(e))};this._mouseWheelToDispose.push(ga(this._listenOnDomNode,Qa.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;const t=sA.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let n=e.deltaY*this._options.mouseWheelScrollSensitivity,o=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&o+n===0?o=n=0:Math.abs(n)>=Math.abs(o)?o=0:n=0),this._options.flipAxes&&([n,o]=[o,n]);const s=!$&&e.browserEvent&&e.browserEvent.shiftKey;!this._options.scrollYToX&&!s||o||(o=n,n=0),e.browserEvent&&e.browserEvent.altKey&&(o*=this._options.fastScrollSensitivity,n*=this._options.fastScrollSensitivity);const r=this._scrollable.getFutureScrollPosition();let a={};if(n){const e=50*n,t=r.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(a,t)}if(o){const e=50*o,t=r.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(a,t)}if(a=this._scrollable.validateScrollPosition(a),this._options.inertialScroll&&(o||n)){let e=!1;0===this._inertialSpeed.X&&0===this._inertialSpeed.Y&&(e=!0),this._inertialSpeed.Y=(n<0?-1:1)*Math.abs(n)**1.02,this._inertialSpeed.X=(o<0?-1:1)*Math.abs(o)**1.02,e&&this._periodicSync()}r.scrollLeft===a.scrollLeft&&r.scrollTop===a.scrollTop||(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(a):this._scrollable.setScrollPositionNow(a),i=!0)}let n=i;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,n=i?" left":"",o=t?" top":"",s=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${o}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){this._mouseIsOver||this._isDragging||(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){this._mouseIsOver||this._isDragging||this._hideTimeout.cancelAndSet((()=>this._hide()),500)}}class aA extends rA{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const i=new QM({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:t=>Ca(ta(e),t)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class lA extends rA{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class dA extends rA{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const i=new QM({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:t=>Ca(ta(e),t)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll((e=>{e.scrollTopChanged&&(this._element.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this._element.scrollLeft=e.scrollLeft)}))),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}function hA(e,t){const i=[];for(const n of t){if(e.start>=n.range.end)continue;if(e.end<n.range.start)break;const t=tA.intersect(e,n.range);tA.isEmpty(t)||i.push({range:t,size:n.size})}return i}function cA({start:e,end:t},i){return{start:e+i,end:t+i}}!function(e){function t(e,t){if(e.start>=t.end||t.start>=e.end)return{start:0,end:0};const i=Math.max(e.start,t.start),n=Math.min(e.end,t.end);return n-i<=0?{start:0,end:0}:{start:i,end:n}}function i(e){return e.end-e.start<=0}e.intersect=t,e.isEmpty=i,e.intersects=function(e,n){return!i(t(e,n))},e.relativeComplement=function(e,t){const n=[],o={start:e.start,end:Math.min(t.start,e.end)},s={start:Math.max(t.end,e.start),end:e.end};return i(o)||n.push(o),i(s)||n.push(s),n}}(tA||(tA={}));class uA{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,i=[]){const n=i.length-t,o=hA({start:0,end:e},this.groups),s=hA({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map((e=>({range:cA(e.range,n),size:e.size}))),r=i.map(((t,i)=>({range:{start:e+i,end:e+i+1},size:t.size})));this.groups=function(...e){return function(e){const t=[];let i=null;for(const n of e){const e=n.range.start,o=n.range.end,s=n.size;i&&s===i.size?i.range.end=o:(i={range:{start:e,end:o},size:s},t.push(i))}return t}(e.reduce(((e,t)=>e.concat(t)),[]))}(o,r,s),this._size=this._paddingTop+this.groups.reduce(((e,t)=>e+t.size*(t.range.end-t.range.start)),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e<this._paddingTop)return 0;let t=0,i=this._paddingTop;for(const n of this.groups){const o=n.range.end-n.range.start,s=i+o*n.size;if(e<s)return t+Math.floor((e-i)/n.size);t+=o,i=s}return t}indexAfter(e){return Math.min(this.indexAt(e)+1,this.count)}positionAt(e){if(e<0)return-1;let t=0,i=0;for(const n of this.groups){const o=n.range.end-n.range.start,s=i+o;if(e<s)return this._paddingTop+t+(e-i)*n.size;t+=o*n.size,i=s}return-1}}class gA{constructor(e){this.renderers=e,this.cache=new Map,this.transactionNodesPendingRemoval=new Set,this.inTransaction=!1}alloc(e){let t=this.getTemplateCache(e).pop(),i=!1;if(t)i=this.transactionNodesPendingRemoval.has(t.domNode),i&&this.transactionNodesPendingRemoval.delete(t.domNode);else{const i=ll(".monaco-list-row");t={domNode:i,templateId:e,templateData:this.getRenderer(e).renderTemplate(i)}}return{row:t,isReusingConnectedDomNode:i}}release(e){e&&this.releaseRow(e)}transact(e){if(this.inTransaction)throw new Error("Already in transaction");this.inTransaction=!0;try{e()}finally{for(const e of this.transactionNodesPendingRemoval)this.doRemoveNode(e);this.transactionNodesPendingRemoval.clear(),this.inTransaction=!1}}releaseRow(e){const{domNode:t,templateId:i}=e;t&&(this.inTransaction?this.transactionNodesPendingRemoval.add(t):this.doRemoveNode(t)),this.getTemplateCache(i).push(e)}doRemoveNode(e){e.classList.remove("scrolling"),e.remove()}getTemplateCache(e){let t=this.cache.get(e);return t||(t=[],this.cache.set(e,t)),t}dispose(){this.cache.forEach(((e,t)=>{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null})),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var pA=i(4214),mA={};mA.styleTagTransform=zl(),mA.setAttributes=Bl(),mA.insert=Pl().bind(null,"head"),mA.domAPI=Rl(),mA.insertStyleElement=Vl(),Ml()(pA.A,mA),pA.A&&pA.A.locals&&pA.A.locals;var fA=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};const _A={CurrentDragAndDropData:void 0},vA={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements:e=>[e],getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class bA{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class wA{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class CA{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;t<e.files.length;t++){const i=e.files.item(t);i&&(i.size||i.type)&&this.files.push(i)}}}getData(){return{types:this.types,files:this.files}}}class yA{constructor(e){this.getSetSize=e?.getSetSize?e.getSetSize.bind(e):(e,t,i)=>i,this.getPosInSet=e?.getPosInSet?e.getPosInSet.bind(e):(e,t)=>t+1,this.getRole=e?.getRole?e.getRole.bind(e):e=>"listitem",this.isChecked=e?.isChecked?e.isChecked.bind(e):e=>{}}}class SA{static{this.InstanceCount=0}get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get scrollableElementDomNode(){return this.scrollableElement.getDomNode()}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const e of this.items)this.measureItemWidth(e);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:Ma(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,i,n=vA){if(this.virtualDelegate=t,this.domId="list_id_"+ ++SA.InstanceCount,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new gi(50),this.splicing=!1,this.dragOverAnimationStopDisposable=At.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=At.None,this.onDragLeaveTimeout=At.None,this.currentSelectionDisposable=At.None,this.disposables=new Mt,this._onDidChangeContentHeight=new Zt,this._onDidChangeContentWidth=new Zt,this.onDidChangeContentHeight=zt.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),this._horizontalScrolling=!1,n.horizontalScrolling&&n.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=this.createRangeMap(n.paddingTop??0);for(const e of i)this.renderers.set(e.templateId,e);if(this.cache=this.disposables.add(new gA(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support","boolean"!=typeof n.mouseSupport||n.mouseSupport),this._horizontalScrolling=n.horizontalScrolling??vA.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=void 0===n.paddingBottom?0:n.paddingBottom,this.accessibilityProvider=new yA(n.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",(n.transformOptimization??vA.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(JT.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new QM({forceIntegerValues:!0,smoothScrollDuration:n.smoothScrolling?125:0,scheduleAtNextAnimationFrame:e=>Ca(ta(this.domNode),e)})),this.scrollableElement=this.disposables.add(new lA(this.rowsContainer,{alwaysConsumeMouseWheel:n.alwaysConsumeMouseWheel??vA.alwaysConsumeMouseWheel,horizontal:1,vertical:n.verticalScrollMode??vA.verticalScrollMode,useShadows:n.useShadows??vA.useShadows,mouseWheelScrollSensitivity:n.mouseWheelScrollSensitivity,fastScrollSensitivity:n.fastScrollSensitivity,scrollByPage:n.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(ga(this.rowsContainer,XT.Change,(e=>this.onTouchChange(e)))),this.disposables.add(ga(this.scrollableElement.getDomNode(),"scroll",(e=>{const t=e.target,i=t.scrollTop;t.scrollTop=0,n.scrollToActiveElement&&this.setScrollTop(this.scrollTop+i)}))),this.disposables.add(ga(this.domNode,"dragover",(e=>this.onDragOver(this.toDragEvent(e))))),this.disposables.add(ga(this.domNode,"drop",(e=>this.onDrop(this.toDragEvent(e))))),this.disposables.add(ga(this.domNode,"dragleave",(e=>this.onDragLeave(this.toDragEvent(e))))),this.disposables.add(ga(this.domNode,"dragend",(e=>this.onDragEnd(e)))),n.userSelection){if(n.dnd)throw new Error("DND and user selection cannot be used simultaneously");this.disposables.add(ga(this.domNode,"mousedown",(e=>this.onPotentialSelectionStart(e))))}this.setRowLineHeight=n.setRowLineHeight??vA.setRowLineHeight,this.setRowHeight=n.setRowHeight??vA.setRowHeight,this.supportDynamicHeights=n.supportDynamicHeights??vA.supportDynamicHeights,this.dnd=n.dnd??this.disposables.add(vA.dnd),this.layout(n.initialSize?.height,n.initialSize?.width),n.scrollToActiveElement&&this._setupFocusObserver(e)}_setupFocusObserver(e){this.disposables.add(ga(e,"focus",(()=>{const t=Va();this.activeElement!==t&&null!==t&&(this.activeElement=t,this._scrollToActiveElement(this.activeElement,e))}),!0))}_scrollToActiveElement(e,t){const i=t.getBoundingClientRect(),n=e.getBoundingClientRect().top-i.top;n<0&&this.setScrollTop(this.scrollTop+n)}updateOptions(e){let t;if(void 0!==e.paddingBottom&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),void 0!==e.smoothScrolling&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),void 0!==e.horizontalScrolling&&(this.horizontalScrolling=e.horizontalScrolling),void 0!==e.scrollByPage&&(t={...t??{},scrollByPage:e.scrollByPage}),void 0!==e.mouseWheelScrollSensitivity&&(t={...t??{},mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),void 0!==e.fastScrollSensitivity&&(t={...t??{},fastScrollSensitivity:e.fastScrollSensitivity}),t&&this.scrollableElement.updateOptions(t),void 0!==e.paddingTop&&e.paddingTop!==this.rangeMap.paddingTop){const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),i=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(t,Math.max(0,this.lastRenderTop+i),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}createRangeMap(e){return new uA(e)}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o={start:e,end:e+t},s=tA.intersect(n,o),r=new Map;for(let e=s.end-1;e>=s.start;e--){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){let i=r.get(t.templateId);i||(i=[],r.set(t.templateId,i));const n=this.renderers.get(t.templateId);n&&n.disposeElement&&n.disposeElement(t.element,e,t.row.templateData,{height:t.size}),i.unshift(t.row)}t.row=null,t.stale=!0}const a={start:e+t,end:this.items.length},l=tA.intersect(a,n),d=tA.relativeComplement(a,n),h=i.map((e=>({id:String(this.itemId++),element:e,templateId:this.virtualDelegate.getTemplateId(e),size:this.virtualDelegate.getHeight(e),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(e),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:At.None,checkedDisposable:At.None,stale:!1})));let c;0===e&&t>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,h),c=this.items,this.items=h):(this.rangeMap.splice(e,t,h),c=vs(this.items,e,t,h));const u=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=cA(l,u),m=tA.intersect(g,p);for(let e=m.start;e<m.end;e++)this.updateItemInDOM(this.items[e],e);const f=tA.relativeComplement(p,g);for(const e of f)for(let t=e.start;t<e.end;t++)this.removeItemFromDOM(t);const _=d.map((e=>cA(e,u))),v=[{start:e,end:e+i.length},..._].map((e=>tA.intersect(g,e))).reverse();for(const e of v)for(let t=e.end-1;t>=e.start;t--){const e=this.items[t],i=r.get(e.templateId),n=i?.pop();this.insertItemInDOM(t,n)}for(const e of r.values())for(const t of e)this.cache.release(t);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),c.map((e=>e.element))}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=Ca(ta(this.domNode),(()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null})))}eventuallyUpdateScrollWidth(){this.horizontalScrolling?this.scrollableElementWidthDelayer.trigger((()=>this.updateScrollWidth())):this.scrollableElementWidthDelayer.cancel()}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)void 0!==t.width&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:0===e?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){return this.getVisibleRange(this.lastRenderTop,this.lastRenderHeight).start}element(e){return this.items[e].element}indexOf(e){return this.items.findIndex((t=>t.element===e))}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){const i={height:"number"==typeof e?e:Aa(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),void 0!==t&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:"number"==typeof t?t:Ma(this.domNode)})}render(e,t,i,n,o,s=!1,r=!1){const a=this.getRenderRange(t,i),l=tA.relativeComplement(a,e).reverse(),d=tA.relativeComplement(e,a);if(s){const t=tA.intersect(e,a);for(let e=t.start;e<t.end;e++)this.updateItemInDOM(this.items[e],e)}this.cache.transact((()=>{for(const e of d)for(let t=e.start;t<e.end;t++)this.removeItemFromDOM(t,r);for(const e of l)for(let t=e.end-1;t>=e.start;t--)this.insertItemInDOM(t)})),void 0!==n&&(this.rowsContainer.style.left=`-${n}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&void 0!==o&&(this.rowsContainer.style.width=`${Math.max(o,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t){const i=this.items[e];if(!i.row)if(t)i.row=t,i.stale=!0;else{const e=this.cache.alloc(i.templateId);i.row=e.row,i.stale||=e.isReusingConnectedDomNode}const n=this.accessibilityProvider.getRole(i.element)||"listitem";i.row.domNode.setAttribute("role",n);const o=this.accessibilityProvider.isChecked(i.element);if("boolean"==typeof o)i.row.domNode.setAttribute("aria-checked",String(!!o));else if(o){const e=e=>i.row.domNode.setAttribute("aria-checked",String(!!e));e(o.value),i.checkedDisposable=o.onDidChange((()=>e(o.value)))}if(i.stale||!i.row.domNode.parentElement){const t=this.items.at(e+1)?.row?.domNode??null;i.row.domNode.parentElement===this.rowsContainer&&i.row.domNode.nextElementSibling===t||this.rowsContainer.insertBefore(i.row.domNode,t),i.stale=!1}this.updateItemInDOM(i,e);const s=this.renderers.get(i.templateId);if(!s)throw new Error(`No renderer found for template id ${i.templateId}`);s?.renderElement(i.element,e,i.row.templateData,{height:i.size});const r=this.dnd.getDragURI(i.element);i.dragStartDisposable.dispose(),i.row.domNode.draggable=!!r,r&&(i.dragStartDisposable=ga(i.row.domNode,"dragstart",(e=>this.onDragStart(i.element,r,e)))),this.horizontalScrolling&&(this.measureItemWidth(i),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=Ma(e.row.domNode);const t=ta(e.row.domNode).getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2==0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e,t){const i=this.items[e];if(i.dragStartDisposable.dispose(),i.checkedDisposable.dispose(),i.row){const n=this.renderers.get(i.templateId);n&&n.disposeElement&&n.disposeElement(i.element,e,i.row.templateData,{height:i.size,onScroll:t}),this.cache.release(i.row),i.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return zt.map(this.disposables.add(new OM(this.domNode,"click")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onMouseDblClick(){return zt.map(this.disposables.add(new OM(this.domNode,"dblclick")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onMouseMiddleClick(){return zt.filter(zt.map(this.disposables.add(new OM(this.domNode,"auxclick")).event,(e=>this.toMouseEvent(e)),this.disposables),(e=>1===e.browserEvent.button),this.disposables)}get onMouseDown(){return zt.map(this.disposables.add(new OM(this.domNode,"mousedown")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onMouseOver(){return zt.map(this.disposables.add(new OM(this.domNode,"mouseover")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onMouseOut(){return zt.map(this.disposables.add(new OM(this.domNode,"mouseout")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onContextMenu(){return zt.any(zt.map(this.disposables.add(new OM(this.domNode,"contextmenu")).event,(e=>this.toMouseEvent(e)),this.disposables),zt.map(this.disposables.add(new OM(this.domNode,XT.Contextmenu)).event,(e=>this.toGestureEvent(e)),this.disposables))}get onTouchStart(){return zt.map(this.disposables.add(new OM(this.domNode,"touchstart")).event,(e=>this.toTouchEvent(e)),this.disposables)}get onTap(){return zt.map(this.disposables.add(new OM(this.rowsContainer,XT.Tap)).event,(e=>this.toGestureEvent(e)),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element,sector:this.getTargetSector(e,t)}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth,void 0,!0),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){if(!i.dataTransfer)return;const n=this.dnd.getDragElements(e);let o;i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(DD.TEXT,t),this.dnd.getDragLabel&&(o=this.dnd.getDragLabel(n,i)),void 0===o&&(o=String(n.length)),function(e,t,i,n=[]){if(!e.dataTransfer)return;const o=ll(".monaco-drag-image");o.textContent=i,o.classList.add(...n),(e=>{for(;e&&!e.classList.contains("monaco-workbench");)e=e.parentElement;return e||t.ownerDocument.body})(t).appendChild(o),e.dataTransfer.setDragImage(o,-10,-10),setTimeout((()=>o.remove()),0)}(i,this.domNode,o,[this.domId]),this.domNode.classList.add("dragging"),this.currentDragData=new bA(n),_A.CurrentDragAndDropData=new wA(n),this.dnd.onDragStart?.(this.currentDragData,i)}onPotentialSelectionStart(e){this.currentSelectionDisposable.dispose();const t=ia(this.domNode),i=this.currentSelectionDisposable=new Mt,n=i.add(new Mt);n.add(ga(this.domNode,"selectstart",(()=>{n.add(ga(t,"mousemove",(e=>{!1===t.getSelection()?.isCollapsed&&this.setupDragAndDropScrollTopAnimation(e)}))),i.add(Tt((()=>{const e=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.currentSelectionBounds=void 0,this.render(e,this.lastRenderTop,this.lastRenderHeight,void 0,void 0)}))),i.add(ga(t,"selectionchange",(()=>{const e=t.getSelection();if(!e||e.isCollapsed)return void(n.isDisposed&&i.dispose());let o=this.getIndexOfListElement(e.anchorNode),s=this.getIndexOfListElement(e.focusNode);void 0!==o&&void 0!==s&&(s<o&&([o,s]=[s,o]),this.currentSelectionBounds={start:o,end:s})})))}))),n.add(ga(t,"mouseup",(()=>{n.dispose(),this.teardownDragAndDropScrollTopAnimation(),!1!==t.getSelection()?.isCollapsed&&i.dispose()})))}getIndexOfListElement(e){if(e&&this.domNode.contains(e))for(;e&&e!==this.domNode;){if(e.dataset?.index)return Number(e.dataset.index);e=e.parentElement}}onDragOver(e){if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),_A.CurrentDragAndDropData&&"vscode-ui"===_A.CurrentDragAndDropData.getData())return!1;if(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer)return!1;if(!this.currentDragData)if(_A.CurrentDragAndDropData)this.currentDragData=_A.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new CA}const t=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.sector,e.browserEvent);if(this.canDrop="boolean"==typeof t?t:t.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;let i;e.browserEvent.dataTransfer.dropEffect="boolean"!=typeof t&&0===t.effect?.type?"copy":"move",i="boolean"!=typeof t&&t.feedback?t.feedback:void 0===e.index?[-1]:[e.index],i=cs(i).filter((e=>e>=-1&&e<this.length)).sort(((e,t)=>e-t)),i=-1===i[0]?[-1]:i;let n="boolean"!=typeof t&&t.effect&&t.effect.position?t.effect.position:"drop-target";if(o=this.currentDragFeedback,s=i,(Array.isArray(o)&&Array.isArray(s)?es(o,s):o===s)&&this.currentDragFeedbackPosition===n)return!0;var o,s;if(this.currentDragFeedback=i,this.currentDragFeedbackPosition=n,this.currentDragFeedbackDisposable.dispose(),-1===i[0])this.domNode.classList.add(n),this.rowsContainer.classList.add(n),this.currentDragFeedbackDisposable=Tt((()=>{this.domNode.classList.remove(n),this.rowsContainer.classList.remove(n)}));else{if(i.length>1&&"drop-target"!==n)throw new Error("Can't use multiple feedbacks with position different than 'over'");"drop-target-after"===n&&i[0]<this.length-1&&(i[0]+=1,n="drop-target-before");for(const e of i){const t=this.items[e];t.dropTarget=!0,t.row?.domNode.classList.add(n)}this.currentDragFeedbackDisposable=Tt((()=>{for(const e of i){const t=this.items[e];t.dropTarget=!1,t.row?.domNode.classList.remove(n)}}))}return!0}onDragLeave(e){this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=fi((()=>this.clearDragOverFeedback()),100,this.disposables),this.currentDragData&&this.dnd.onDragLeave?.(this.currentDragData,e.element,e.index,e.browserEvent)}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,_A.CurrentDragAndDropData=void 0,t&&e.browserEvent.dataTransfer&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.sector,e.browserEvent))}onDragEnd(e){this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,_A.CurrentDragAndDropData=void 0,this.dnd.onDragEnd?.(e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=At.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const e=Ea(this.domNode).top;this.dragOverAnimationDisposable=function(e,t){const i=()=>{t(),n=Ca(e,i)};let n=Ca(e,i);return Tt((()=>n.dispose()))}(ta(this.domNode),this.animateDragAndDropScrollTop.bind(this,e))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=fi((()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}),1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(void 0===this.dragOverMouseY)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getTargetSector(e,t){if(void 0===t)return;const i=e.offsetY/this.items[t].size;return FM(Math.floor(i/.25),0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;(qa(i)||Ga(i))&&i!==this.rowsContainer&&t.contains(i);){const e=i.getAttribute("data-index");if(e){const t=Number(e);if(!isNaN(t))return t}i=i.parentElement}}getVisibleRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}getRenderRange(e,t){const i=this.getVisibleRange(e,t);if(this.currentSelectionBounds){const e=this.rangeMap.count;i.start=Math.min(i.start,this.currentSelectionBounds.start,e),i.end=Math.min(Math.max(i.end,this.currentSelectionBounds.end+1),e)}return i}_rerender(e,t,i){const n=this.getRenderRange(e,t);let o,s;e===this.elementTop(n.start)?(o=n.start,s=0):n.end-n.start>1&&(o=n.start+1,s=this.elementTop(o)-e);let r=0;for(;;){const a=this.getRenderRange(e,t);let l=!1;for(let e=a.start;e<a.end;e++){const t=this.probeDynamicHeight(e);0!==t&&this.rangeMap.splice(e,1,[this.items[e]]),r+=t,l=l||0!==t}if(!l){0!==r&&this.eventuallyUpdateScrollDimensions();const t=tA.relativeComplement(n,a);for(const e of t)for(let t=e.start;t<e.end;t++)this.items[t].row&&this.removeItemFromDOM(t);const l=tA.relativeComplement(a,n).reverse();for(const e of l)for(let t=e.end-1;t>=e.start;t--)this.insertItemInDOM(t);for(let e=a.start;e<a.end;e++)this.items[e].row&&this.updateItemInDOM(this.items[e],e);if("number"==typeof o){const t=this.scrollable.getFutureScrollPosition().scrollTop-e,n=this.elementTop(o)-s+t;this.setScrollTop(n,i)}return void this._onDidChangeContentHeight.fire(this.contentHeight)}}}probeDynamicHeight(e){const t=this.items[e];if(this.virtualDelegate.getDynamicHeight){const e=this.virtualDelegate.getDynamicHeight(t.element);if(null!==e){const i=t.size;return t.size=e,t.lastDynamicHeightWidth=this.renderWidth,e-i}}if(!t.hasDynamicHeight||t.lastDynamicHeightWidth===this.renderWidth)return 0;if(this.virtualDelegate.hasDynamicHeight&&!this.virtualDelegate.hasDynamicHeight(t.element))return 0;const i=t.size;if(t.row)return t.row.domNode.style.height="",t.size=t.row.domNode.offsetHeight,0!==t.size||Oa(t.row.domNode,ta(t.row.domNode).document.body)||console.warn("Measuring item node that is not in DOM! Add ListView to the DOM before measuring row height!",(new Error).stack),t.lastDynamicHeightWidth=this.renderWidth,t.size-i;const{row:n}=this.cache.alloc(t.templateId);n.domNode.style.height="",this.rowsContainer.appendChild(n.domNode);const o=this.renderers.get(t.templateId);if(!o)throw new Ve("Missing renderer for templateId: "+t.templateId);return o.renderElement(t.element,e,n.templateData),t.size=n.domNode.offsetHeight,o.disposeElement?.(t.element,e,n.templateData),this.virtualDelegate.setDynamicHeight?.(t.element,t.size),t.lastDynamicHeightWidth=this.renderWidth,n.domNode.remove(),this.cache.release(n),t.size-i}getElementDomId(e){return`${this.domId}_${e}`}dispose(){for(const e of this.items)if(e.dragStartDisposable.dispose(),e.checkedDisposable.dispose(),e.row){const t=this.renderers.get(e.row.templateId);t&&(t.disposeElement?.(e.element,-1,e.row.templateData,void 0),t.disposeTemplate(e.row.templateData))}this.items=[],this.domNode?.remove(),this.dragOverAnimationDisposable?.dispose(),this.disposables.dispose()}}fA([QT],SA.prototype,"onMouseClick",null),fA([QT],SA.prototype,"onMouseDblClick",null),fA([QT],SA.prototype,"onMouseMiddleClick",null),fA([QT],SA.prototype,"onMouseDown",null),fA([QT],SA.prototype,"onMouseOver",null),fA([QT],SA.prototype,"onMouseOut",null),fA([QT],SA.prototype,"onContextMenu",null),fA([QT],SA.prototype,"onTouchStart",null),fA([QT],SA.prototype,"onTap",null);var xA,kA,LA=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};class DA{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){const n=this.renderedElements.findIndex((e=>e.templateData===i));if(n>=0){const e=this.renderedElements[n];this.trait.unrender(i),e.index=t}else{const e={index:t,templateData:i};this.renderedElements.push(e)}this.trait.renderIndex(t,i)}splice(e,t,i){const n=[];for(const o of this.renderedElements)o.index<e?n.push(o):o.index>=e+t&&n.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=n}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex((t=>t.templateData===e));t<0||this.renderedElements.splice(t,1)}}class EA{get onChange(){return this._onChange.event}get name(){return this._trait}get renderer(){return new DA(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new Zt}splice(e,t,i){const n=i.length-t,o=e+t,s=[];let r=0;for(;r<this.sortedIndexes.length&&this.sortedIndexes[r]<e;)s.push(this.sortedIndexes[r++]);for(let t=0;t<i.length;t++)i[t]&&s.push(t+e);for(;r<this.sortedIndexes.length&&this.sortedIndexes[r]>=o;)s.push(this.sortedIndexes[r++]+n);this.renderer.splice(e,t,i.length),this._set(s,s)}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(GA),t)}_set(e,t,i){const n=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const s=$A(o,e);return this.renderer.renderIndexes(s),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return ts(this.sortedIndexes,e,GA)>=0}dispose(){Et(this._onChange)}}LA([QT],EA.prototype,"renderer",null);class NA extends EA{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class IA{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,new Array(i.length).fill(!1));const n=this.trait.get().map((e=>this.identityProvider.getId(this.view.element(e)).toString()));if(0===n.length)return this.trait.splice(e,t,new Array(i.length).fill(!1));const o=new Set(n),s=i.map((e=>o.has(this.identityProvider.getId(e).toString())));this.trait.splice(e,t,s)}}function TA(e,t){return!!e.classList.contains(t)||!e.classList.contains("monaco-list")&&!!e.parentElement&&TA(e.parentElement,t)}function MA(e){return TA(e,"monaco-editor")}function AA(e){return TA(e,"monaco-tree-sticky-row")}function RA(e){return e.classList.contains("monaco-tree-sticky-container")}function OA(e){return!!("A"===e.tagName&&e.classList.contains("monaco-button")||"DIV"===e.tagName&&e.classList.contains("monaco-button-dropdown"))||!e.classList.contains("monaco-list")&&!!e.parentElement&&OA(e.parentElement)}class PA{get onKeyDown(){return zt.chain(this.disposables.add(new OM(this.view.domNode,"keydown")).event,(e=>e.filter((e=>!vl(e.target))).map((e=>new Ze(e)))))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new Mt,this.multipleSelectionDisposables=new Mt,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown((e=>{switch(e.keyCode){case 3:return this.onEnter(e);case 16:return this.onUpArrow(e);case 18:return this.onDownArrow(e);case 11:return this.onPageUpArrow(e);case 12:return this.onPageDownArrow(e);case 9:return this.onEscape(e);case 31:this.multipleSelectionSupport&&($?e.metaKey:e.ctrlKey)&&this.onCtrlA(e)}})))}updateOptions(e){void 0!==e.multipleSelectionSupport&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(us(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}LA([QT],PA.prototype,"onKeyDown",null),function(e){e[e.Automatic=0]="Automatic",e[e.Trigger=1]="Trigger"}(xA||(xA={})),function(e){e[e.Idle=0]="Idle",e[e.Typing=1]="Typing"}(kA||(kA={}));const FA=new class{mightProducePrintableCharacter(e){return!(e.ctrlKey||e.metaKey||e.altKey)&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30||e.keyCode>=98&&e.keyCode<=107||e.keyCode>=85&&e.keyCode<=95)}};class BA{constructor(e,t,i,n,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=n,this.delegate=o,this.enabled=!1,this.state=kA.Idle,this.mode=xA.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new Mt,this.disposables=new Mt,this.updateOptions(e.options)}updateOptions(e){e.typeNavigationEnabled??1?this.enable():this.disable(),this.mode=e.typeNavigationMode??xA.Automatic}enable(){if(this.enabled)return;let e=!1;const t=zt.chain(this.enabledDisposables.add(new OM(this.view.domNode,"keydown")).event,(t=>t.filter((e=>!vl(e.target))).filter((()=>this.mode===xA.Automatic||this.triggered)).map((e=>new Ze(e))).filter((t=>e||this.keyboardNavigationEventFilter(t))).filter((e=>this.delegate.mightProducePrintableCharacter(e))).forEach((e=>Ja(e,!0))).map((e=>e.browserEvent.key)))),i=zt.debounce(t,(()=>null),800,void 0,void 0,void 0,this.enabledDisposables),n=zt.reduce(zt.any(t,i),((e,t)=>null===t?null:(e||"")+t),void 0,this.enabledDisposables);n(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t((()=>e=!0),void 0,this.enabledDisposables),i((()=>e=!1),void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){const e=this.list.getFocus();if(e.length>0&&e[0]===this.previouslyFocused){const t=this.list.options.accessibilityProvider?.getAriaLabel(this.list.element(e[0]));"string"==typeof t?Yl(t):t&&Yl(t.get())}this.previouslyFocused=-1}onInput(e){if(!e)return this.state=kA.Idle,void(this.triggered=!1);const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===kA.Idle?1:0;this.state=kA.Typing;for(let t=0;t<this.list.length;t++){const o=(i+t+n)%this.list.length,s=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(o)),r=s&&s.toString();if(this.list.options.typeNavigationEnabled){if(void 0!==r){if(bd(e,r))return this.previouslyFocused=i,this.list.setFocus([o]),void this.list.reveal(o);const t=jd(e,r);if(t&&t[0].end-t[0].start>1&&1===t.length)return this.previouslyFocused=i,this.list.setFocus([o]),void this.list.reveal(o)}}else if(void 0===r||bd(e,r))return this.previouslyFocused=i,this.list.setFocus([o]),void this.list.reveal(o)}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class WA{constructor(e,t){this.list=e,this.view=t,this.disposables=new Mt;const i=zt.chain(this.disposables.add(new OM(t.domNode,"keydown")).event,(e=>e.filter((e=>!vl(e.target))).map((e=>new Ze(e))))),n=zt.chain(i,(e=>e.filter((e=>!(2!==e.keyCode||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)))));n(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(0===t.length)return;const i=this.view.domElement(t[0]);if(!i)return;const n=i.querySelector("[tabIndex]");if(!n||!qa(n)||-1===n.tabIndex)return;const o=ta(n).getComputedStyle(n);"hidden"!==o.visibility&&"none"!==o.display&&(e.preventDefault(),e.stopPropagation(),n.focus())}dispose(){this.disposables.dispose()}}function VA(e){return $?e.browserEvent.metaKey:e.browserEvent.ctrlKey}function HA(e){return e.browserEvent.shiftKey}const zA={isSelectionSingleChangeEvent:VA,isSelectionRangeChangeEvent:HA};class UA{get onPointer(){return this._onPointer.event}constructor(e){this.list=e,this.disposables=new Mt,this._onPointer=this.disposables.add(new Zt),!1!==e.options.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||zA),this.mouseSupport=void 0===e.options.mouseSupport||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(JT.addTarget(e.getHTMLElement()))),zt.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){void 0!==e.multipleSelectionSupport&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||zA))}isSelectionSingleChangeEvent(e){return!!this.multipleSelectionController&&this.multipleSelectionController.isSelectionSingleChangeEvent(e)}isSelectionRangeChangeEvent(e){return!!this.multipleSelectionController&&this.multipleSelectionController.isSelectionRangeChangeEvent(e)}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){MA(e.browserEvent.target)||Va()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(vl(e.browserEvent.target)||MA(e.browserEvent.target))return;const t=void 0===e.index?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport)return;if(vl(e.browserEvent.target)||MA(e.browserEvent.target))return;if(e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;return void 0===t?(this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),void this.list.setAnchor(void 0)):this.isSelectionChangeEvent(e)?this.changeSelection(e):(this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),Za(i=e.browserEvent)&&2===i.button||this.list.setSelection([t],e.browserEvent),void this._onPointer.fire(e));var i}onDoubleClick(e){if(vl(e.browserEvent.target)||MA(e.browserEvent.target))return;if(this.isSelectionChangeEvent(e))return;if(e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){void 0===i&&(i=this.list.getFocus()[0]??t,this.list.setAnchor(i));const n=us(Math.min(i,t),Math.max(i,t)+1),o=this.list.getSelection(),s=function(e,t){const i=e.indexOf(t);if(-1===i)return[];const n=[];let o=i-1;for(;o>=0&&e[o]===t-(i-o);)n.push(e[o--]);for(n.reverse(),o=i;o<e.length&&e[o]===t+(o-i);)n.push(e[o++]);return n}($A(o,[i]),i);if(0===s.length)return;const r=$A(n,function(e,t){const i=[];let n=0,o=0;for(;n<e.length||o<t.length;)if(n>=e.length)i.push(t[o++]);else if(o>=t.length)i.push(e[n++]);else{if(e[n]===t[o]){n++,o++;continue}e[n]<t[o]?i.push(e[n++]):o++}return i}(o,s));this.list.setSelection(r,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const i=this.list.getSelection(),n=i.filter((e=>e!==t));this.list.setFocus([t]),this.list.setAnchor(t),i.length===n.length?this.list.setSelection([...n,t],e.browserEvent):this.list.setSelection(n,e.browserEvent)}}dispose(){this.disposables.dispose()}}class KA{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){const t=this.selectorSuffix&&`.${this.selectorSuffix}`,i=[];e.listBackground&&i.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&i.push(`\n\t\t\t\t.monaco-drag-image${t},\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }\n\t\t\t`),e.listFocusAndSelectionForeground&&i.push(`\n\t\t\t\t.monaco-drag-image${t},\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }\n\t\t\t`),e.listInactiveFocusForeground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&i.push(`.monaco-list${t} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(i.push(`.monaco-list${t} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&i.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const n=vM(e.listFocusAndSelectionOutline,vM(e.listSelectionOutline,e.listFocusOutline??""));n&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused.selected { outline: 1px solid ${n}; outline-offset: -1px;}`),e.listFocusOutline&&i.push(`\n\t\t\t\t.monaco-drag-image${t},\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.focused,\n\t\t\t\t.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }\n\t\t\t`);const o=vM(e.listSelectionOutline,e.listInactiveFocusOutline??"");o&&i.push(`.monaco-list${t} .monaco-list-row.focused.selected { outline: 1px dotted ${o}; outline-offset: -1px; }`),e.listSelectionOutline&&i.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&i.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&i.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropOverBackground&&i.push(`\n\t\t\t\t.monaco-list${t}.drop-target,\n\t\t\t\t.monaco-list${t} .monaco-list-rows.drop-target,\n\t\t\t\t.monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropOverBackground} !important; color: inherit !important; }\n\t\t\t`),e.listDropBetweenBackground&&(i.push(`\n\t\t\t.monaco-list${t} .monaco-list-rows.drop-target-before .monaco-list-row:first-child::before,\n\t\t\t.monaco-list${t} .monaco-list-row.drop-target-before::before {\n\t\t\t\tcontent: ""; position: absolute; top: 0px; left: 0px; width: 100%; height: 1px;\n\t\t\t\tbackground-color: ${e.listDropBetweenBackground};\n\t\t\t}`),i.push(`\n\t\t\t.monaco-list${t} .monaco-list-rows.drop-target-after .monaco-list-row:last-child::after,\n\t\t\t.monaco-list${t} .monaco-list-row.drop-target-after::after {\n\t\t\t\tcontent: ""; position: absolute; bottom: 0px; left: 0px; width: 100%; height: 1px;\n\t\t\t\tbackground-color: ${e.listDropBetweenBackground};\n\t\t\t}`)),e.tableColumnsBorder&&i.push(`\n\t\t\t\t.monaco-table > .monaco-split-view2,\n\t\t\t\t.monaco-table > .monaco-split-view2 .monaco-sash.vertical::before,\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2,\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\t\t\tborder-color: ${e.tableColumnsBorder};\n\t\t\t\t}\n\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2,\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\t\t\tborder-color: transparent;\n\t\t\t\t}\n\t\t\t`),e.tableOddRowsBackgroundColor&&i.push(`\n\t\t\t\t.monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {\n\t\t\t\t\tbackground-color: ${e.tableOddRowsBackgroundColor};\n\t\t\t\t}\n\t\t\t`),this.styleElement.textContent=i.join("\n")}}const jA={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:Lg.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:Lg.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:Lg.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},qA={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){},dispose(){}}};function $A(e,t){const i=[];let n=0,o=0;for(;n<e.length||o<t.length;)if(n>=e.length)i.push(t[o++]);else if(o>=t.length)i.push(e[n++]);else{if(e[n]===t[o]){i.push(e[n]),n++,o++;continue}e[n]<t[o]?i.push(e[n++]):i.push(t[o++])}return i}const GA=(e,t)=>e-t;class ZA{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map((t=>t.renderTemplate(e)))}renderElement(e,t,i,n){let o=0;for(const s of this.renderers)s.renderElement(e,t,i[o++],n)}disposeElement(e,t,i,n){let o=0;for(const s of this.renderers)s.disposeElement?.(e,t,i[o],n),o+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class YA{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return{container:e,disposables:new Mt}}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e),o=n&&"string"!=typeof n?n:Or(n);i.disposables.add(ar((e=>{this.setAriaLabel(e.readObservable(o),i.container)})));const s=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);"number"==typeof s?i.container.setAttribute("aria-level",`${s}`):i.container.removeAttribute("aria-level")}setAriaLabel(e,t){e?t.setAttribute("aria-label",e):t.removeAttribute("aria-label")}disposeElement(e,t,i){i.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}}class QA{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){this.dnd.onDragStart?.(e,t)}onDragOver(e,t,i,n,o){return this.dnd.onDragOver(e,t,i,n,o)}onDragLeave(e,t,i,n){this.dnd.onDragLeave?.(e,t,i,n)}onDragEnd(e){this.dnd.onDragEnd?.(e)}drop(e,t,i,n,o){this.dnd.drop(e,t,i,n,o)}dispose(){this.dnd.dispose()}}class XA{get onDidChangeFocus(){return zt.map(this.eventBufferer.wrapEvent(this.focus.onChange),(e=>this.toListEvent(e)),this.disposables)}get onDidChangeSelection(){return zt.map(this.eventBufferer.wrapEvent(this.selection.onChange),(e=>this.toListEvent(e)),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=zt.chain(this.disposables.add(new OM(this.view.domNode,"keydown")).event,(t=>t.map((e=>new Ze(e))).filter((t=>e=58===t.keyCode||t.shiftKey&&68===t.keyCode)).map((e=>Ja(e,!0))).filter((()=>!1)))),i=zt.chain(this.disposables.add(new OM(this.view.domNode,"keyup")).event,(t=>t.forEach((()=>e=!1)).map((e=>new Ze(e))).filter((e=>58===e.keyCode||e.shiftKey&&68===e.keyCode)).map((e=>Ja(e,!0))).map((({browserEvent:e})=>{const t=this.getFocus(),i=t.length?t[0]:void 0;return{index:i,element:void 0!==i?this.view.element(i):void 0,anchor:void 0!==i?this.view.domElement(i):this.view.domNode,browserEvent:e}})))),n=zt.chain(this.view.onContextMenu,(t=>t.filter((t=>!e)).map((({element:e,index:t,browserEvent:i})=>({element:e,index:t,anchor:new Je(ta(this.view.domNode),i),browserEvent:i})))));return zt.any(t,i,n)}get onKeyDown(){return this.disposables.add(new OM(this.view.domNode,"keydown")).event}get onDidFocus(){return zt.signal(this.disposables.add(new OM(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return zt.signal(this.disposables.add(new OM(this.view.domNode,"blur",!0)).event)}constructor(e,t,i,n,o=qA){this.user=e,this._options=o,this.focus=new EA("focused"),this.anchor=new EA("anchor"),this.eventBufferer=new ti,this._ariaLabel="",this.disposables=new Mt,this._onDidDispose=new Zt,this.onDidDispose=this._onDidDispose.event;const s=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?this._options.accessibilityProvider?.getWidgetRole():"list";this.selection=new NA("listbox"!==s);const r=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(r.push(new YA(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant?.(this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map((e=>new ZA(e.templateId,[...r,e])));const a={...o,dnd:o.dnd&&new QA(this,o.dnd)};if(this.view=this.createListView(t,i,n,a),this.view.domNode.setAttribute("role",s),o.styleController)this.styleController=o.styleController(this.view.domId);else{const e=DM(this.view.domNode);this.styleController=new KA(e,this.view.domId)}if(this.spliceable=new PM([new IA(this.focus,this.view,o.identityProvider),new IA(this.selection,this.view,o.identityProvider),new IA(this.anchor,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new WA(this,this.view)),("boolean"!=typeof o.keyboardSupport||o.keyboardSupport)&&(this.keyboardController=new PA(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const e=o.keyboardNavigationDelegate||FA;this.typeNavigationController=new BA(this,this.view,o.keyboardNavigationLabelProvider,o.keyboardNavigationEventFilter??(()=>!0),e),this.disposables.add(this.typeNavigationController)}if(this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider){const e=this.accessibilityProvider.getWidgetAriaLabel(),t=e&&"string"!=typeof e?e:Or(e);this.disposables.add(ar((e=>{this.ariaLabel=e.readObservable(t)})))}!1!==this._options.multipleSelectionSupport&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,n){return new SA(e,t,i,n)}createMouseController(e){return new UA(this)}updateOptions(e={}){this._options={...this._options,...e},this.typeNavigationController?.updateOptions(this._options),void 0!==this._options.multipleSelectionController&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),this.keyboardController?.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new zM(this.user,`Invalid start index: ${e}`);if(t<0)throw new zM(this.user,`Invalid delete count: ${t}`);0===t&&0===i.length||this.eventBufferer.bufferEvents((()=>this.spliceable.splice(e,t,i)))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}indexOf(e){return this.view.indexOf(e)}indexAt(e){return this.view.indexAt(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const t of e)if(t<0||t>=this.length)throw new zM(this.user,`Invalid index ${t}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map((e=>this.view.element(e)))}setAnchor(e){if(void 0!==e){if(e<0||e>=this.length)throw new zM(this.user,`Invalid index ${e}`);this.anchor.set([e])}else this.anchor.set([])}getAnchor(){return this.anchor.get().at(0)}getAnchorElement(){const e=this.getAnchor();return void 0===e?void 0:this.element(e)}setFocus(e,t){for(const t of e)if(t<0||t>=this.length)throw new zM(this.user,`Invalid index ${t}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,n){if(0===this.length)return;const o=this.focus.get(),s=this.findNextIndex(o.length>0?o[0]+e:0,t,n);s>-1&&this.setFocus([s],i)}focusPrevious(e=1,t=!1,i,n){if(0===this.length)return;const o=this.focus.get(),s=this.findPreviousIndex(o.length>0?o[0]-e:0,t,n);s>-1&&this.setFocus([s],i)}async focusNextPage(e,t){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=0===i?0:i-1;const n=this.getFocus()[0];if(n!==i&&(void 0===n||i>n)){const o=this.findPreviousIndex(i,!1,t);o>-1&&n!==o?this.setFocus([o],e):this.setFocus([i],e)}else{const o=this.view.getScrollTop();let s=o+this.view.renderHeight;i>n&&(s-=this.view.elementHeight(i)),this.view.setScrollTop(s),this.view.getScrollTop()!==o&&(this.setFocus([]),await mi(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,i=()=>0){let n;const o=i(),s=this.view.getScrollTop()+o;n=0===s?this.view.indexAt(s):this.view.indexAfter(s-1);const r=this.getFocus()[0];if(r!==n&&(void 0===r||r>=n)){const i=this.findNextIndex(n,!1,t);i>-1&&r!==i?this.setFocus([i],e):this.setFocus([n],e)}else{const n=s;this.view.setScrollTop(s-this.view.renderHeight-o),this.view.getScrollTop()+i()!==n&&(this.setFocus([]),await mi(0),await this.focusPreviousPage(e,t,i))}}focusLast(e,t){if(0===this.length)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(0===this.length)return;const n=this.findNextIndex(e,!1,i);n>-1&&this.setFocus([n],t)}findNextIndex(e,t=!1,i){for(let n=0;n<this.length;n++){if(e>=this.length&&!t)return-1;if(e%=this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let n=0;n<this.length;n++){if(e<0&&!t)return-1;if(e=(this.length+e%this.length)%this.length,!i||i(this.element(e)))return e;e--}return-1}getFocus(){return this.focus.get()}getFocusedElements(){return this.getFocus().map((e=>this.view.element(e)))}reveal(e,t,i=0){if(e<0||e>=this.length)throw new zM(this.user,`Invalid index ${e}`);const n=this.view.getScrollTop(),o=this.view.elementTop(e),s=this.view.elementHeight(e);if(ct(t)){const e=s-this.view.renderHeight+i;this.view.setScrollTop(e*FM(t,0,1)+o-i)}else{const e=o+s,t=n+this.view.renderHeight;o<n+i&&e>=t||(o<n+i||e>=t&&s>=this.view.renderHeight?this.view.setScrollTop(o-i):e>=t&&this.view.setScrollTop(e-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new zM(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),n=this.view.elementTop(e),o=this.view.elementHeight(e);if(n<i+t||n+o>i+this.view.renderHeight)return null;const s=o-this.view.renderHeight+t;return Math.abs((i+t-n)/s)}getHTMLElement(){return this.view.domNode}getScrollableElement(){return this.view.scrollableElementDomNode}getElementID(e){return this.view.getElementDomId(e)}getElementTop(e){return this.view.elementTop(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map((e=>this.view.element(e))),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){const e=this.focus.get();if(e.length>0){let t;this.accessibilityProvider?.getActiveDescendantId&&(t=this.accessibilityProvider.getActiveDescendantId(this.view.element(e[0]))),this.view.domNode.setAttribute("aria-activedescendant",t||this.view.getElementDomId(e[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",0===e.length),this.view.domNode.classList.toggle("selection-single",1===e.length),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}LA([QT],XA.prototype,"onDidChangeFocus",null),LA([QT],XA.prototype,"onDidChangeSelection",null),LA([QT],XA.prototype,"onContextMenu",null),LA([QT],XA.prototype,"onKeyDown",null),LA([QT],XA.prototype,"onDidFocus",null),LA([QT],XA.prototype,"onDidBlur",null);var JA=i(7619),eR={};eR.styleTagTransform=zl(),eR.setAttributes=Bl(),eR.insert=Pl().bind(null,"head"),eR.domAPI=Rl(),eR.insertStyleElement=Vl(),Ml()(JA.A,eR),JA.A&&JA.A.locals&&JA.A.locals;const tR=ll,iR="selectOption.entry.template";class nR{get templateId(){return iR}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=il(e,tR(".option-text")),t.detail=il(e,tR(".option-detail")),t.decoratorRight=il(e,tR(".option-decorator-right")),t}renderElement(e,t,i){const n=i,o=e.text,s=e.detail,r=e.decoratorRight,a=e.isDisabled;n.text.textContent=o,n.detail.textContent=s||"",n.decoratorRight.textContent=r||"",a?n.root.classList.add("option-disabled"):n.root.classList.remove("option-disabled")}disposeTemplate(e){}}class oR extends At{static{this.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN=32}static{this.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN=2}static{this.DEFAULT_MINIMUM_VISIBLE_OPTIONS=3}constructor(e,t,i,n,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=n,this.selectBoxOptions=o||Object.create(null),"number"!=typeof this.selectBoxOptions.minBottomMargin?this.selectBoxOptions.minBottomMargin=oR.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding","string"==typeof this.selectBoxOptions.ariaLabel&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),"string"==typeof this.selectBoxOptions.ariaDescription&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new Zt,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}setTitle(e){!this._hover&&e?this._hover=this._register(lM().setupManagedHover(nM("mouse"),this.selectElement,e)):this._hover&&this._hover.update(e)}getHeight(){return 22}getTemplateId(){return iR}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=ll(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=il(this.selectDropDownContainer,tR(".select-box-details-pane"));const t=il(this.selectDropDownContainer,tR(".select-box-dropdown-container-width-control")),i=il(t,tR(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",il(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=DM(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(ga(this.selectDropDownContainer,Qa.DRAG_START,(e=>{Ja(e,!0)})))}registerListeners(){let e;this._register(ma(this.selectElement,"change",(e=>{this.selected=e.target.selectedIndex,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)}))),this._register(ga(this.selectElement,Qa.CLICK,(e=>{Ja(e),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()}))),this._register(ga(this.selectElement,Qa.MOUSE_DOWN,(e=>{Ja(e)}))),this._register(ga(this.selectElement,"touchstart",(t=>{e=this._isVisible}))),this._register(ga(this.selectElement,"touchend",(t=>{Ja(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()}))),this._register(ga(this.selectElement,Qa.KEY_DOWN,(e=>{const t=new Ze(e);let i=!1;$?18!==t.keyCode&&16!==t.keyCode&&10!==t.keyCode&&3!==t.keyCode||(i=!0):(18===t.keyCode&&t.altKey||16===t.keyCode&&t.altKey||10===t.keyCode||3===t.keyCode)&&(i=!0),i&&(this.showSelectDropDown(),Ja(e,!0))})))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){es(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach(((e,t)=>{this.selectElement.add(this.createOption(e.text,t,e.isDisabled)),"string"==typeof e.description&&(this._hasDetails=!0)}))),void 0!==t&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){this.selectList?.splice(0,this.selectList.length,this.options)}select(e){e>=0&&e<this.options.length?this.selected=e:e>this.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join("\n")}styleSelectElement(){const e=this.styles.selectBackground??"",t=this.styles.selectForeground??"",i=this.styles.selectBorder??"";this.selectElement.style.backgroundColor=e,this.selectElement.style.color=t,this.selectElement.style.borderColor=i}styleList(){const e=this.styles.selectBackground??"",t=vM(this.styles.selectListBackground,e);this.selectDropDownListContainer.style.backgroundColor=t,this.selectionDetailsPane.style.backgroundColor=t;const i=this.styles.focusBorder??"";this.selectDropDownContainer.style.outlineColor=i,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}showSelectDropDown(){this.selectionDetailsPane.textContent="",this.contextViewProvider&&!this._isVisible&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){this.contextViewProvider&&this._isVisible&&(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{this.selectDropDownContainer.remove()}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach(((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)})),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=ta(this.selectElement),i=Na(this.selectElement),n=ta(this.selectElement).getComputedStyle(this.selectElement),o=parseFloat(n.getPropertyValue("--dropdown-padding-top"))+parseFloat(n.getPropertyValue("--dropdown-padding-bottom")),s=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),r=i.top-oR.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,a=this.selectElement.offsetWidth,l=this.setWidthControlElement(this.widthControlElement),d=Math.max(l,Math.round(a)).toString()+"px";this.selectDropDownContainer.style.width=d,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let h=this.selectList.contentHeight;this._hasDetails&&void 0===this._cachedMaxDetailsHeight&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const c=this._hasDetails?this._cachedMaxDetailsHeight:0,u=h+o+c,g=Math.floor((s-o-c)/this.getHeight()),p=Math.floor((r-o-c)/this.getHeight());if(e)return!(i.top+i.height>t.innerHeight-22||i.top<oR.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||g<1&&p<1||(g<oR.DEFAULT_MINIMUM_VISIBLE_OPTIONS&&p>g&&this.options.length>g?(this._dropDownPosition=1,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),0));if(i.top+i.height>t.innerHeight-22||i.top<oR.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||0===this._dropDownPosition&&g<1||1===this._dropDownPosition&&p<1)return this.hideSelectDropDown(!0),!1;if(0===this._dropDownPosition){if(this._isVisible&&g+p<1)return this.hideSelectDropDown(!0),!1;u>s&&(h=g*this.getHeight())}else u>r&&(h=p*this.getHeight());return this.selectList.layout(h),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=h+o+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=h+o+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=d,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}return!1}setWidthControlElement(e){let t=0;if(e){let i=0,n=0;this.options.forEach(((e,t)=>{const o=e.detail?e.detail.length:0,s=e.decoratorRight?e.decoratorRight.length:0,r=e.text.length+o+s;r>n&&(i=t,n=r)})),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=Ta(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=il(e,tR(".select-box-dropdown-list-container")),this.listRenderer=new nR,this.selectList=this._register(new XA("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:e=>{let t=e.text;return e.detail&&(t+=`. ${e.detail}`),e.decoratorRight&&(t+=`. ${e.decoratorRight}`),e.description&&(t+=`. ${e.description}`),t},getWidgetAriaLabel:()=>y(16,"Select Box"),getRole:()=>$?"":"option",getWidgetRole:()=>"listbox"}})),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new OM(this.selectDropDownListContainer,"keydown")),i=zt.chain(t.event,(e=>e.filter((()=>this.selectList.length>0)).map((e=>new Ze(e)))));this._register(zt.chain(i,(e=>e.filter((e=>3===e.keyCode))))(this.onEnter,this)),this._register(zt.chain(i,(e=>e.filter((e=>2===e.keyCode))))(this.onEnter,this)),this._register(zt.chain(i,(e=>e.filter((e=>9===e.keyCode))))(this.onEscape,this)),this._register(zt.chain(i,(e=>e.filter((e=>16===e.keyCode))))(this.onUpArrow,this)),this._register(zt.chain(i,(e=>e.filter((e=>18===e.keyCode))))(this.onDownArrow,this)),this._register(zt.chain(i,(e=>e.filter((e=>12===e.keyCode))))(this.onPageDown,this)),this._register(zt.chain(i,(e=>e.filter((e=>11===e.keyCode))))(this.onPageUp,this)),this._register(zt.chain(i,(e=>e.filter((e=>14===e.keyCode))))(this.onHome,this)),this._register(zt.chain(i,(e=>e.filter((e=>13===e.keyCode))))(this.onEnd,this)),this._register(zt.chain(i,(e=>e.filter((e=>e.keyCode>=21&&e.keyCode<=56||e.keyCode>=85&&e.keyCode<=113))))(this.onCharacter,this)),this._register(ga(this.selectList.getHTMLElement(),Qa.POINTER_UP,(e=>this.onPointerUp(e)))),this._register(this.selectList.onMouseOver((e=>void 0!==e.index&&this.selectList.setFocus([e.index])))),this._register(this.selectList.onDidChangeFocus((e=>this.onListFocus(e)))),this._register(ga(this.selectDropDownContainer,Qa.FOCUS_OUT,(e=>{this._isVisible&&!Oa(e.relatedTarget,this.selectDropDownContainer)&&this.onListBlur()}))),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;Ja(e);const t=e.target;if(!t)return;if(t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const n=Number(i.getAttribute("data-index")),o=i.classList.contains("option-disabled");n>=0&&n<this.options.length&&!o&&(this.selected=n,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]),this.selected!==this._currentSelection&&(this._currentSelection=this.selected,this._onDidSelect.fire({index:this.selectElement.selectedIndex,selected:this.options[this.selected].text}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)),this.hideSelectDropDown(!0))}onListBlur(){this._sticky||(this.selected!==this._currentSelection&&this.select(this._currentSelection),this.hideSelectDropDown(!1))}renderDescriptionMarkdown(e,t){const i=e=>{for(let t=0;t<e.childNodes.length;t++){const n=e.childNodes.item(t);"img"===(n.tagName&&n.tagName.toLowerCase())?n.remove():i(n)}},n=yI({value:e,supportThemeIcons:!0},{actionHandler:t});return n.element.classList.add("select-box-description-markdown"),i(n.element),n.element}onListFocus(e){this._isVisible&&this._hasDetails&&this.updateDetail(e.indexes[0])}updateDetail(e){this.selectionDetailsPane.textContent="";const t=this.options[e],i=t?.description??"";if(i){if(t?.descriptionIsMarkdown){const e=t.descriptionMarkdownActionHandler;this.selectionDetailsPane.appendChild(this.renderDescriptionMarkdown(i,e))}else this.selectionDetailsPane.textContent=i;this.selectionDetailsPane.style.display="block"}else this.selectionDetailsPane.style.display="none";this._skipLayout=!0,this.contextViewProvider.layout(),this._skipLayout=!1}onEscape(e){Ja(e),this.select(this._currentSelection),this.hideSelectDropDown(!0)}onEnter(e){Ja(e),this.selected!==this._currentSelection&&(this._currentSelection=this.selected,this._onDidSelect.fire({index:this.selectElement.selectedIndex,selected:this.options[this.selected].text}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)),this.hideSelectDropDown(!0)}onDownArrow(e){if(this.selected<this.options.length-1){Ja(e,!0);const t=this.options[this.selected+1].isDisabled;if(t&&this.options.length>this.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(Ja(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){Ja(e),this.selectList.focusPreviousPage(),setTimeout((()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected<this.options.length-1&&(this.selected++,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)}),1)}onPageDown(e){Ja(e),this.selectList.focusNextPage(),setTimeout((()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)}),1)}onHome(e){Ja(e),this.options.length<2||(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){Ja(e),this.options.length<2||(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=Le.toString(e.keyCode);let i=-1;for(let n=0;n<this.options.length-1;n++)if(i=(n+this.selected+1)%this.options.length,this.options[i].text.charAt(0).toUpperCase()===t&&!this.options[i].isDisabled){this.select(i),this.selectList.setFocus([i]),this.selectList.reveal(this.selectList.getFocus()[0]),Ja(e);break}}dispose(){this.hideSelectDropDown(!1),super.dispose()}}class sR extends At{constructor(e,t,i,n){super(),this.selected=0,this.selectBoxOptions=n||Object.create(null),this.options=[],this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box","string"==typeof this.selectBoxOptions.ariaLabel&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),"string"==typeof this.selectBoxOptions.ariaDescription&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=this._register(new Zt),this.styles=i,this.registerListeners(),this.setOptions(e,t)}registerListeners(){this._register(JT.addTarget(this.selectElement)),[XT.Tap].forEach((e=>{this._register(ga(this.selectElement,e,(e=>{this.selectElement.focus()})))})),this._register(ma(this.selectElement,"click",(e=>{Ja(e,!0)}))),this._register(ma(this.selectElement,"change",(e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})}))),this._register(ma(this.selectElement,"keydown",(e=>{let t=!1;$?18!==e.keyCode&&16!==e.keyCode&&10!==e.keyCode||(t=!0):(18===e.keyCode&&e.altKey||10===e.keyCode||3===e.keyCode)&&(t=!0),t&&e.stopPropagation()})))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){this.options&&es(this.options,e)||(this.options=e,this.selectElement.options.length=0,this.options.forEach(((e,t)=>{this.selectElement.add(this.createOption(e.text,t,e.isDisabled))}))),void 0!==t&&this.select(t)}select(e){0===this.options.length?this.selected=0:e>=0&&e<this.options.length?this.selected=e:e>this.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected<this.options.length&&"string"==typeof this.options[this.selected].text?this.selectElement.title=this.options[this.selected].text:this.selectElement.title=""}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){e.classList.add("select-container"),e.appendChild(this.selectElement),this.setOptions(this.options,this.selected),this.applyStyles()}applyStyles(){this.selectElement&&(this.selectElement.style.backgroundColor=this.styles.selectBackground??"",this.selectElement.style.color=this.styles.selectForeground??"",this.selectElement.style.borderColor=this.styles.selectBorder??"")}createOption(e,t,i){const n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}}class rR extends mM{constructor(e,t,i,n,o){super(),this.selectBoxDelegate=$&&!o?.useCustomDrawn?new sR(e,t,n,o):new oR(e,t,i,n,o),this._register(this.selectBoxDelegate)}get onDidSelect(){return this.selectBoxDelegate.onDidSelect}setOptions(e,t){this.selectBoxDelegate.setOptions(e,t)}select(e){this.selectBoxDelegate.select(e)}focus(){this.selectBoxDelegate.focus()}blur(){this.selectBoxDelegate.blur()}setFocusable(e){this.selectBoxDelegate.setFocusable(e)}render(e){this.selectBoxDelegate.render(e)}}var aR=i(4566),lR={};lR.styleTagTransform=zl(),lR.setAttributes=Bl(),lR.insert=Pl().bind(null,"head"),lR.domAPI=Rl(),lR.insertStyleElement=Vl(),Ml()(aR.A,lR),aR.A&&aR.A.locals&&aR.A.locals;class dR extends At{get action(){return this._action}constructor(e,t,i={}){super(),this.options=i,this._context=e||this,this._action=t,t instanceof dc&&this._register(t.onDidChange((e=>{this.element&&this.handleActionChangeEvent(e)})))}handleActionChangeEvent(e){void 0!==e.enabled&&this.updateEnabled(),void 0!==e.checked&&this.updateChecked(),void 0!==e.class&&this.updateClass(),void 0!==e.label&&(this.updateLabel(),this.updateTooltip()),void 0!==e.tooltip&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new hc)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(JT.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,c&&this._register(ga(e,Qa.DRAG_START,(e=>e.dataTransfer?.setData(DD.TEXT,this._action.label))))),this._register(ga(t,XT.Tap,(e=>this.onClick(e,!0)))),this._register(ga(t,Qa.MOUSE_DOWN,(e=>{i||Ja(e,!0),this._action.enabled&&0===e.button&&t.classList.add("active")}))),$&&this._register(ga(t,Qa.CONTEXT_MENU,(e=>{0===e.button&&!0===e.ctrlKey&&this.onClick(e)}))),this._register(ga(t,Qa.CLICK,(e=>{Ja(e,!0),this.options&&this.options.isMenu||this.onClick(e)}))),this._register(ga(t,Qa.DBLCLICK,(e=>{Ja(e,!0)}))),[Qa.MOUSE_UP,Qa.MOUSE_OUT].forEach((e=>{this._register(ga(t,e,(e=>{Ja(e),t.classList.remove("active")})))}))}onClick(e,t=!1){Ja(e,!0);const i=ft(this._context)?this.options?.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,i)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getClass(){return this.action.class}getTooltip(){return this.action.tooltip}getHoverContents(){return this.getTooltip()}updateTooltip(){if(!this.element)return;const e=this.getHoverContents()??"";if(this.updateAriaLabel(),this.customHover||""===e)this.customHover&&this.customHover.update(e);else{const t=this.options.hoverDelegate??nM("element");this.customHover=this._store.add(lM().setupManagedHover(t,this.element,e))}}updateAriaLabel(){if(this.element){const e=this.getTooltip()??"";this.element.setAttribute("aria-label",e)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class hR extends dR{constructor(e,t,i){super(e,t,i={...i,icon:void 0!==i.icon&&i.icon,label:void 0===i.label||i.label}),this.options=i,this.cssClass=""}render(e){super.render(e),_t(this.element);const t=document.createElement("a");if(t.classList.add("action-label"),t.setAttribute("role",this.getDefaultAriaRole()),this.label=t,this.element.appendChild(t),this.options.label&&this.options.keybinding&&!this.options.keybindingNotRenderedWithLabel){const e=document.createElement("span");e.classList.add("keybinding"),e.textContent=this.options.keybinding,this.element.appendChild(e)}this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===cc.ID?"presentation":this.options.isMenu?"menuitem":this.options.isTabList?"tab":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label,this.options.keybinding&&(e=y(0,"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getClass(),this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):this.label?.classList.remove("codicon")}updateEnabled(){this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),this.element?.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),this.element?.classList.add("disabled"))}updateAriaLabel(){if(this.label){const e=this.getTooltip()??"";this.label.setAttribute("aria-label",e)}}updateChecked(){this.label&&(void 0!==this.action.checked?(this.label.classList.toggle("checked",this.action.checked),this.options.isTabList?this.label.setAttribute("aria-selected",this.action.checked?"true":"false"):(this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox"))):(this.label.classList.remove("checked"),this.label.removeAttribute(this.options.isTabList?"aria-selected":"aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class cR extends dR{constructor(e,t,i,n,o,s,r){super(e,t),this.selectBox=new rR(i,n,o,s,r),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect((e=>this.runAction(e.selected,e.index))))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){this.selectBox?.focus()}blur(){this.selectBox?.blur()}render(e){this.selectBox.render(e)}}class uR extends At{get onDidBlur(){return this._onDidBlur.event}get onDidCancel(){return this._onDidCancel.event}get onDidRun(){return this._onDidRun.event}get onWillRun(){return this._onWillRun.event}constructor(e,t={}){let i,n;switch(super(),this._actionRunnerDisposables=this._register(new Mt),this.viewItemDisposables=this._register(new Ft),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new Zt),this._onDidCancel=this._register(new Zt({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.cancelHasListener=!1,this._onDidRun=this._register(new Zt),this._onWillRun=this._register(new Zt),this.options=t,this._context=t.context??null,this._orientation=this.options.orientation??0,this._triggerKeys={keyDown:this.options.triggerKeys?.keyDown??!1,keys:this.options.triggerKeys?.keys??[3,10]},this._hoverDelegate=t.hoverDelegate??this._register(oM()),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new hc,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun((e=>this._onDidRun.fire(e)))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun((e=>this._onWillRun.fire(e)))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",this._orientation){case 0:i=[15],n=[17];break;case 1:i=[16],n=[18],this.domNode.className+=" vertical"}this._register(ga(this.domNode,Qa.KEY_DOWN,(e=>{const t=new Ze(e);let o=!0;const s="number"==typeof this.focusedItem?this.viewItems[this.focusedItem]:void 0;i&&(t.equals(i[0])||t.equals(i[1]))?o=this.focusPrevious():n&&(t.equals(n[0])||t.equals(n[1]))?o=this.focusNext():t.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():t.equals(14)?o=this.focusFirst():t.equals(13)?o=this.focusLast():t.equals(2)&&s instanceof dR&&s.trapsArrowNavigation?o=this.focusNext(void 0,!0):this.isTriggerKeyEvent(t)?this._triggerKeys.keyDown?this.doTrigger(t):this.triggerKeyDown=!0:o=!1,o&&(t.preventDefault(),t.stopPropagation())}))),this._register(ga(this.domNode,Qa.KEY_UP,(e=>{const t=new Ze(e);this.isTriggerKeyEvent(t)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(t)),t.preventDefault(),t.stopPropagation()):(t.equals(2)||t.equals(1026)||t.equals(16)||t.equals(18)||t.equals(15)||t.equals(17))&&this.updateFocusedItem()}))),this.focusTracker=this._register(tl(this.domNode)),this._register(this.focusTracker.onDidBlur((()=>{Va()!==this.domNode&&Oa(Va(),this.domNode)||(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)}))),this._register(this.focusTracker.onDidFocus((()=>this.updateFocusedItem()))),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=1?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const e=this.viewItems.find((e=>e instanceof dR&&e.isEnabled()));e instanceof dR&&e.setFocusable(!0)}else this.viewItems.forEach((e=>{e instanceof dR&&e.setFocusable(!1)}))}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach((i=>{t=t||e.equals(i)})),t}updateFocusedItem(){for(let e=0;e<this.actionsList.children.length;e++){const t=this.actionsList.children[e];if(Oa(Va(),t)){this.focusedItem=e,this.viewItems[this.focusedItem]?.showHover?.();break}}}get context(){return this._context}set context(e){this._context=e,this.viewItems.forEach((t=>t.setActionContext(e)))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun((e=>this._onDidRun.fire(e)))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun((e=>this._onWillRun.fire(e)))),this.viewItems.forEach((t=>t.actionRunner=e))}getContainer(){return this.domNode}getAction(e){if("number"==typeof e)return this.viewItems[e]?.action;if(qa(e)){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let t=0;t<this.actionsList.childNodes.length;t++)if(this.actionsList.childNodes[t]===e)return this.viewItems[t].action}}push(e,t={}){const i=Array.isArray(e)?e:[e];let n=ct(t.index)?t.index:null;if(i.forEach((e=>{const i=document.createElement("li");let o;i.className="action-item",i.setAttribute("role","presentation");const s={hoverDelegate:this._hoverDelegate,...t,isTabList:"tablist"===this.options.ariaRole};this.options.actionViewItemProvider&&(o=this.options.actionViewItemProvider(e,s)),o||(o=new hR(this.context,e,s)),this.options.allowContextMenu||this.viewItemDisposables.set(o,ga(i,Qa.CONTEXT_MENU,(e=>{Ja(e,!0)}))),o.actionRunner=this._actionRunner,o.setActionContext(this.context),o.render(i),null===n||n<0||n>=this.actionsList.children.length?(this.actionsList.appendChild(i),this.viewItems.push(o)):(this.actionsList.insertBefore(i,this.actionsList.children[n]),this.viewItems.splice(n,0,o),n++)})),this.focusable){let e=!1;for(const t of this.viewItems){if(!(t instanceof dR))continue;let i;i=!(e||t.action.id===cc.ID||!t.isEnabled()&&this.options.focusOnlyEnabledItems),i?(t.setFocusable(!0),e=!0):t.setFocusable(!1)}}"number"==typeof this.focusedItem&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=Et(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),ca(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return 0===this.viewItems.length}focus(e){let t,i=!1;if(void 0===e?i=!0:"number"==typeof e?t=e:"boolean"==typeof e&&(i=e),i&&void 0===this.focusedItem){const e=this.viewItems.findIndex((e=>e.isEnabled()));this.focusedItem=-1===e?void 0:e,this.updateFocus(void 0,void 0,!0)}else void 0!==t&&(this.focusedItem=t),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e,t){if(void 0===this.focusedItem)this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const i=this.focusedItem;let n;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=i,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,n=this.viewItems[this.focusedItem]}while(this.focusedItem!==i&&(this.options.focusOnlyEnabledItems&&!n.isEnabled()||n.action.id===cc.ID));return this.updateFocus(void 0,void 0,t),!0}focusPrevious(e){if(void 0===this.focusedItem)this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===cc.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){void 0===this.focusedItem&&this.actionsList.focus({preventScroll:t}),void 0!==this.previouslyFocusedItem&&this.previouslyFocusedItem!==this.focusedItem&&this.viewItems[this.previouslyFocusedItem]?.blur();const n=void 0!==this.focusedItem?this.viewItems[this.focusedItem]:void 0;if(n){let o=!0;bt(n.focus)||(o=!1),this.options.focusOnlyEnabledItems&&bt(n.isEnabled)&&!n.isEnabled()&&(o=!1),n.action.id===cc.ID&&(o=!1),o?(i||this.previouslyFocusedItem!==this.focusedItem)&&(n.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),o&&n.showHover?.()}}doTrigger(e){if(void 0===this.focusedItem)return;const t=this.viewItems[this.focusedItem];if(t instanceof dR){const i=null===t._context||void 0===t._context?e:t._context;this.run(t._action,i)}}async run(e,t){await this._actionRunner.run(e,t)}dispose(){this._context=void 0,this.viewItems=Et(this.viewItems),this.getContainer().remove(),super.dispose()}}var gR=i(6745),pR={};pR.styleTagTransform=zl(),pR.setAttributes=Bl(),pR.insert=Pl().bind(null,"head"),pR.domAPI=Rl(),pR.insertStyleElement=Vl(),Ml()(gR.A,pR),gR.A&&gR.A.locals&&gR.A.locals;class mR{constructor(e,t,i=t){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=i}toLabel(e,t,i){if(0===t.length)return null;const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=i(s);if(null===r)return null;n[o]=wR(s,r,this.modifierLabels[e])}return n.join(" ")}}const fR=new mR({ctrlKey:"⌃",shiftKey:"⇧",altKey:"⌥",metaKey:"⌘",separator:""},{ctrlKey:y(35,"Ctrl"),shiftKey:y(36,"Shift"),altKey:y(37,"Alt"),metaKey:y(38,"Windows"),separator:"+"},{ctrlKey:y(39,"Ctrl"),shiftKey:y(40,"Shift"),altKey:y(41,"Alt"),metaKey:y(42,"Super"),separator:"+"}),_R=new mR({ctrlKey:y(43,"Control"),shiftKey:y(44,"Shift"),altKey:y(45,"Option"),metaKey:y(46,"Command"),separator:"+"},{ctrlKey:y(47,"Control"),shiftKey:y(48,"Shift"),altKey:y(49,"Alt"),metaKey:y(50,"Windows"),separator:"+"},{ctrlKey:y(51,"Control"),shiftKey:y(52,"Shift"),altKey:y(53,"Alt"),metaKey:y(54,"Super"),separator:"+"}),vR=new mR({ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Cmd",separator:"+"},{ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Super",separator:"+"}),bR=new mR({ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"cmd",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"win",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"meta",separator:"+"});function wR(e,t,i){if(null===t)return"";const n=[];return e.ctrlKey&&n.push(i.ctrlKey),e.shiftKey&&n.push(i.shiftKey),e.altKey&&n.push(i.altKey),e.metaKey&&n.push(i.metaKey),""!==t&&n.push(t),n.join(i.separator)}var CR=i(5422),yR={};yR.styleTagTransform=zl(),yR.setAttributes=Bl(),yR.insert=Pl().bind(null,"head"),yR.domAPI=Rl(),yR.insertStyleElement=Vl(),Ml()(CR.A,yR),CR.A&&CR.A.locals&&CR.A.locals;const SR=ll,xR={keybindingLabelBackground:void 0,keybindingLabelForeground:void 0,keybindingLabelBorder:void 0,keybindingLabelBottomBorder:void 0,keybindingLabelShadow:void 0};class kR extends At{constructor(e,t,i){super(),this.os=t,this.keyElements=new Set,this.options=i||Object.create(null);const n=this.options.keybindingLabelForeground;this.domNode=il(e,SR(".monaco-keybinding")),n&&(this.domNode.style.color=n),this.hover=this._register(lM().setupManagedHover(nM("mouse"),this.domNode,"")),this.didEverRender=!1,e.appendChild(this.domNode)}set(e,t){this.didEverRender&&this.keybinding===e&&kR.areSame(this.matches,t)||(this.keybinding=e,this.matches=t,this.render())}render(){if(this.clear(),this.keybinding){const e=this.keybinding.getChords();e[0]&&this.renderChord(this.domNode,e[0],this.matches?this.matches.firstPart:null);for(let t=1;t<e.length;t++)il(this.domNode,SR("span.monaco-keybinding-key-chord-separator",void 0," ")),this.renderChord(this.domNode,e[t],this.matches?this.matches.chordPart:null);const t=this.options.disableTitle?void 0:this.keybinding.getAriaLabel()||void 0;this.hover.update(t),this.domNode.setAttribute("aria-label",t||"")}else this.options&&this.options.renderUnboundKeybindings&&this.renderUnbound(this.domNode);this.didEverRender=!0}clear(){ca(this.domNode),this.keyElements.clear()}renderChord(e,t,i){const n=fR.modifierLabels[this.os];t.ctrlKey&&this.renderKey(e,n.ctrlKey,Boolean(i?.ctrlKey),n.separator),t.shiftKey&&this.renderKey(e,n.shiftKey,Boolean(i?.shiftKey),n.separator),t.altKey&&this.renderKey(e,n.altKey,Boolean(i?.altKey),n.separator),t.metaKey&&this.renderKey(e,n.metaKey,Boolean(i?.metaKey),n.separator);const o=t.keyLabel;o&&this.renderKey(e,o,Boolean(i?.keyCode),"")}renderKey(e,t,i,n){il(e,this.createKeyElement(t,i?".highlight":"")),n&&il(e,SR("span.monaco-keybinding-key-separator",void 0,n))}renderUnbound(e){il(e,this.createKeyElement(y(15,"Unbound")))}createKeyElement(e,t=""){const i=SR("span.monaco-keybinding-key"+t,void 0,e);return this.keyElements.add(i),this.options.keybindingLabelBackground&&(i.style.backgroundColor=this.options.keybindingLabelBackground),this.options.keybindingLabelBorder&&(i.style.borderColor=this.options.keybindingLabelBorder),this.options.keybindingLabelBottomBorder&&(i.style.borderBottomColor=this.options.keybindingLabelBottomBorder),this.options.keybindingLabelShadow&&(i.style.boxShadow=`inset 0 -1px 0 ${this.options.keybindingLabelShadow}`),i}static areSame(e,t){return e===t||!e&&!t||!!e&&!!t&&cg(e.firstPart,t.firstPart)&&cg(e.chordPart,t.chordPart)}}const LR=oc("contextViewService"),DR=oc("contextMenuService"),ER=oc("keybindingService"),NR={keybindingLabelBackground:Af(rb),keybindingLabelForeground:Af(ab),keybindingLabelBorder:Af(lb),keybindingLabelBottomBorder:Af(db),keybindingLabelShadow:Af($_)},IR={buttonForeground:Af(Vv),buttonSeparator:Af(Hv),buttonBackground:Af(zv),buttonHoverBackground:Af(Uv),buttonSecondaryForeground:Af(jv),buttonSecondaryBackground:Af(qv),buttonSecondaryHoverBackground:Af($v),buttonBorder:Af(Kv)},TR={progressBarBackground:Af(r_)},MR={inputActiveOptionBorder:Af(Sv),inputActiveOptionForeground:Af(Lv),inputActiveOptionBackground:Af(kv)},AR=(Af(Gv),Af(Zv),Af(Yv),Af(Qv),Af(Xv),Af(Jv),Af(eb),{checkboxBackground:Af(tb),checkboxBorder:Af(nb),checkboxForeground:Af(ib),checkboxDisabledBackground:Af(ob),checkboxDisabledForeground:Af(sb)}),RR=(Af(d_),Af(h_),Af($_),Af(G_),Af(dv),Af(hv),Af(cv),Af(Jf),{inputBackground:Af(wv),inputForeground:Af(Cv),inputBorder:Af(yv),inputValidationInfoBorder:Af(Nv),inputValidationInfoBackground:Af(Dv),inputValidationInfoForeground:Af(Ev),inputValidationWarningBorder:Af(Mv),inputValidationWarningBackground:Af(Iv),inputValidationWarningForeground:Af(Tv),inputValidationErrorBorder:Af(Ov),inputValidationErrorBackground:Af(Av),inputValidationErrorForeground:Af(Rv)}),OR={listFilterWidgetBackground:Af(Ib),listFilterWidgetOutline:Af(Tb),listFilterWidgetNoMatchesOutline:Af(Mb),listFilterWidgetShadow:Af(Ab),inputBoxStyles:RR,toggleStyles:MR},PR={badgeBackground:Af(e_),badgeForeground:Af(t_),badgeBorder:Af(Qf)},FR=(Af(Q_),Af(Y_),Af(X_),Af(X_),Af(J_),{listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:Af(hb),listFocusForeground:Af(cb),listFocusOutline:Af(ub),listActiveSelectionBackground:Af(pb),listActiveSelectionForeground:Af(mb),listActiveSelectionIconForeground:Af(fb),listFocusAndSelectionOutline:Af(gb),listFocusAndSelectionBackground:Af(pb),listFocusAndSelectionForeground:Af(mb),listInactiveSelectionBackground:Af(_b),listInactiveSelectionIconForeground:Af(bb),listInactiveSelectionForeground:Af(vb),listInactiveFocusBackground:Af(wb),listInactiveFocusOutline:Af(Cb),listHoverBackground:Af(yb),listHoverForeground:Af(Sb),listDropOverBackground:Af(xb),listDropBetweenBackground:Af(kb),listSelectionOutline:Af(Xf),listHoverOutline:Af(Xf),treeIndentGuidesStroke:Af(Rb),treeInactiveIndentGuidesStroke:Af(Ob),treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:Af(i_),tableColumnsBorder:Af(Pb),tableOddRowsBackgroundColor:Af(Fb)});function BR(e){return function(e,t){const i={...t};for(const t in e){const n=e[t];i[t]=void 0!==n?Af(n):void 0}return i}(e,FR)}const WR={selectBackground:Af(Pv),selectListBackground:Af(Fv),selectForeground:Af(Bv),decoratorRightForeground:Af(Zb),selectBorder:Af(Wv),focusBorder:Af(Yf),listFocusBackground:Af(ew),listInactiveSelectionIconForeground:Af(Jb),listFocusForeground:Af(Xb),listFocusOutline:Rf(Xf,Lg.transparent.toString()),listHoverBackground:Af(yb),listHoverForeground:Af(Sb),listHoverOutline:Af(Xf),selectListBorder:Af(c_),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropOverBackground:void 0,listDropBetweenBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},VR={shadowColor:Af($_),borderColor:Af(Wb),foregroundColor:Af(Vb),backgroundColor:Af(Hb),selectionForegroundColor:Af(zb),selectionBackgroundColor:Af(Ub),selectionBorderColor:Af(Kb),separatorColor:Af(jb),scrollbarShadow:Af(i_),scrollbarSliderBackground:Af(n_),scrollbarSliderHoverBackground:Af(o_),scrollbarSliderActiveBackground:Af(s_)},HR=oc("layoutService");var zR=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},UR=function(e,t){return function(i,n){t(i,n,e)}};const KR="acceptSelectedCodeAction",jR="previewSelectedCodeAction";class qR{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){i.text.textContent=e.group?.title??e.label??""}disposeTemplate(e){}}class $R{get templateId(){return"separator"}renderTemplate(e){e.classList.add("separator");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){i.text.textContent=e.label??""}disposeTemplate(e){}}let GR=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const n=document.createElement("span");return n.className="description",e.append(n),{container:e,icon:t,text:i,description:n,keybinding:new kR(e,se)}}renderElement(e,t,i){if(e.group?.icon?(i.icon.className=vh.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=Af(e.group.icon.color.id))):(i.icon.className=vh.asClassName(fh.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;!function(e,...t){e?dl(...t):hl(...t)}(!e.hideIcon,i.icon),i.text.textContent=JR(e.label),e.keybinding?(i.description.textContent=e.keybinding.getLabel(),i.description.style.display="inline",i.description.style.letterSpacing="0.5px"):e.description?(i.description.textContent=JR(e.description),i.description.style.display="inline"):(i.description.textContent="",i.description.style.display="none");const n=this._keybindingService.lookupKeybinding(KR)?.getLabel(),o=this._keybindingService.lookupKeybinding(jR)?.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.tooltip?i.container.title=e.tooltip:e.disabled?i.container.title=e.label:n&&o?this._supportsPreview&&e.canPreview?i.container.title=y(1638,"{0} to Apply, {1} to Preview",n,o):i.container.title=y(1639,"{0} to Apply",n):i.container.title=""}disposeTemplate(e){e.keybinding.dispose()}};GR=zR([UR(1,ER)],GR);class ZR extends UIEvent{constructor(){super("acceptSelectedAction")}}class YR extends UIEvent{constructor(){super("previewSelectedAction")}}function QR(e){if("action"===e.kind)return e.label}let XR=class extends At{constructor(e,t,i,n,o,s,r,a){super(),this._delegate=n,this._contextViewService=s,this._keybindingService=r,this._layoutService=a,this._actionLineHeight=28,this._headerLineHeight=28,this._separatorLineHeight=8,this.cts=this._register(new ri),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const l={getHeight:e=>{switch(e.kind){case"header":return this._headerLineHeight;case"separator":return this._separatorLineHeight;default:return this._actionLineHeight}},getTemplateId:e=>e.kind};this._list=this._register(new XA(e,this.domNode,l,[new GR(t,this._keybindingService),new qR,new $R],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:QR},accessibilityProvider:{getAriaLabel:e=>{if("action"===e.kind){let t=e.label?JR(e?.label):"";return e.description&&(t=t+", "+JR(e.description)),e.disabled&&(t=y(1640,"{0}, Disabled Reason: {1}",t,e.disabled)),t}return null},getWidgetAriaLabel:()=>y(1641,"Action Widget"),getRole:e=>"action"===e.kind?"option":"separator",getWidgetRole:()=>"listbox",...o}})),this._list.style(FR),this._register(this._list.onMouseClick((e=>this.onListClick(e)))),this._register(this._list.onMouseOver((e=>this.onListHover(e)))),this._register(this._list.onDidChangeFocus((()=>this.onFocus()))),this._register(this._list.onDidChangeSelection((e=>this.onListSelection(e)))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&"action"===e.kind}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter((e=>"header"===e.kind)).length,i=this._allMenuItems.filter((e=>"separator"===e.kind)).length,n=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight+i*this._separatorLineHeight-i*this._actionLineHeight;this._list.layout(n);let o=e;if(this._allMenuItems.length>=50)o=380;else{const t=this._allMenuItems.map(((e,t)=>{const i=this.domNode.ownerDocument.getElementById(this._list.getElementID(t));if(i){i.style.width="auto";const e=i.getBoundingClientRect().width;return i.style.width="",e}return 0}));o=Math.max(...t,e)}const s=Math.min(n,.7*this._layoutService.getContainer(ta(this.domNode)).clientHeight);return this._list.layout(s,o),this.domNode.style.height=`${s}px`,this._list.domFocus(),o}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(0===t.length)return;const i=t[0],n=this._list.element(i);if(!this.focusCondition(n))return;const o=e?new YR:new ZR;this._list.setSelection([i],o)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof YR):this._list.setSelection([])}onFocus(){const e=this._list.getFocus();if(0===e.length)return;const t=e[0],i=this._list.element(t);this._delegate.onFocus?.(i.item)}async onListHover(e){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&"action"===t.kind){const e=await this._delegate.onHover(t.item,this.cts.token);t.canPreview=e?e.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus("number"==typeof e.index?[e.index]:[])}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};function JR(e){return e.replace(/\r\n|\r|\n/g," ")}XR=zR([UR(5,LR),UR(6,ER),UR(7,HR)],XR);var eO=function(e,t){return function(i,n){t(i,n,e)}};Ff("actionBar.toggledBackground",kv,y(1642,"Background color for toggled action items in action bar."));const tO={Visible:new Jc("codeActionMenuVisible",!1,y(1643,"Whether the action widget list is visible"))},iO=oc("actionWidgetService");let nO=class extends At{get isVisible(){return tO.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new Rt)}show(e,t,i,n,o,s,r,a){const l=tO.Visible.bindTo(this._contextKeyService),d=this._instantiationService.createInstance(XR,e,t,i,n,a);this._contextViewService.showContextView({getAnchor:()=>o,render:e=>(l.set(!0),this._renderWidget(e,d,r??[])),onHide:e=>{l.reset(),this._onWidgetClosed(e)}},s,!1)}acceptSelected(e){this._list.value?.acceptSelected(e)}focusPrevious(){this._list?.value?.focusPrevious()}focusNext(){this._list?.value?.focusNext()}hide(e){this._list.value?.hide(e),this._list.clear()}_renderWidget(e,t,i){const n=document.createElement("div");if(n.classList.add("action-widget"),e.appendChild(n),this._list.value=t,!this._list.value)throw new Error("List has no value");n.appendChild(this._list.value.domNode);const o=new Mt,s=document.createElement("div"),r=e.appendChild(s);r.classList.add("context-view-block"),o.add(ga(r,Qa.MOUSE_DOWN,(e=>e.stopPropagation())));const a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-pointerBlock"),o.add(ga(l,Qa.POINTER_MOVE,(()=>l.remove()))),o.add(ga(l,Qa.MOUSE_DOWN,(()=>l.remove())));let d=0;if(i.length){const e=this._createActionBar(".action-widget-action-bar",i);e&&(n.appendChild(e.getContainer().parentElement),o.add(e),d=e.getContainer().offsetWidth)}const h=this._list.value?.layout(d);n.style.width=`${h}px`;const c=o.add(tl(e));return o.add(c.onDidBlur((()=>this.hide(!0)))),o}_createActionBar(e,t){if(!t.length)return;const i=ll(e),n=new uR(i);return n.push(t,{icon:!1,label:!0}),n}_onWidgetClosed(e){this._list.value?.hide(e)}};nO=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([eO(0,LR),eO(1,eu),eO(2,nc)],nO),wp(iO,nO,1);const oO=1100;var sO;wu(class extends bu{constructor(){super({id:"hideCodeActionWidget",title:x(1644,"Hide action widget"),precondition:tO.Visible,keybinding:{weight:oO,primary:9,secondary:[1033]}})}run(e){e.get(iO).hide(!0)}}),wu(class extends bu{constructor(){super({id:"selectPrevCodeAction",title:x(1645,"Select previous action"),precondition:tO.Visible,keybinding:{weight:oO,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(e){const t=e.get(iO);t instanceof nO&&t.focusPrevious()}}),wu(class extends bu{constructor(){super({id:"selectNextCodeAction",title:x(1646,"Select next action"),precondition:tO.Visible,keybinding:{weight:oO,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(e){const t=e.get(iO);t instanceof nO&&t.focusNext()}}),wu(class extends bu{constructor(){super({id:KR,title:x(1647,"Accept selected action"),precondition:tO.Visible,keybinding:{weight:oO,primary:3,secondary:[2137]}})}run(e){const t=e.get(iO);t instanceof nO&&t.acceptSelected()}}),wu(class extends bu{constructor(){super({id:jR,title:x(1648,"Preview selected action"),precondition:tO.Visible,keybinding:{weight:oO,primary:2051}})}run(e){const t=e.get(iO);t instanceof nO&&t.acceptSelected(!0)}}),function(e){e[e.Ignore=0]="Ignore",e[e.Info=1]="Info",e[e.Warning=2]="Warning",e[e.Error=3]="Error"}(sO||(sO={})),function(e){const t="error",i="warning",n="info";e.fromValue=function(o){return o?on(t,o)?e.Error:on(i,o)||on("warn",o)?e.Warning:on(n,o)?e.Info:e.Ignore:e.Ignore},e.toString=function(o){switch(o){case e.Error:return t;case e.Warning:return i;case e.Info:return n;default:return"ignore"}}}(sO||(sO={}));const rO=sO;var aO=rO;const lO=oc("notificationService");class dO{}var hO=i(9926),cO={};cO.styleTagTransform=zl(),cO.setAttributes=Bl(),cO.insert=Pl().bind(null,"head"),cO.domAPI=Rl(),cO.insertStyleElement=Vl(),Ml()(hO.A,cO),hO.A&&hO.A.locals&&hO.A.locals;var uO,gO=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},pO=function(e,t){return function(i,n){t(i,n,e)}};let mO=class extends At{static{uO=this}static{this.baseId="editor.widget.postEditWidget"}constructor(e,t,i,n,o,s,r,a,l,d,h){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=o,this.edits=s,this.onSelectNewEdit=r,this.additionalActions=a,this._keybindingService=d,this._actionWidgetService=h,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(l),this.visibleContext.set(!0),this._register(Tt((()=>this.visibleContext.reset()))),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Tt((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition((e=>{this.dispose()}))),this._register(zt.runAndSubscribe(d.onDidUpdateKeybindings,(()=>{this._updateButtonTitle()})))}_updateButtonTitle(){const e=this._keybindingService.lookupKeybinding(this.showCommand.id)?.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=ll(".post-edit-widget"),this.button=this._register(new hM(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(ga(this.domNode,Qa.CLICK,(()=>this.showSelector())))}getId(){return uO.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){const e=Na(this.button.element),t={x:e.left+e.width,y:e.top+e.height};this._actionWidgetService.show("postEditWidget",!1,this.edits.allEdits.map(((e,t)=>({kind:"action",item:e,label:e.title,disabled:!1,canPreview:!1,group:{title:"",icon:vh.fromId(t===this.edits.activeEditIndex?fh.check.id:fh.blank.id)}}))),{onHide:()=>{this.editor.focus()},onSelect:e=>{this._actionWidgetService.hide(!1);const t=this.edits.allEdits.findIndex((t=>t===e));if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}},t,this.editor.getDomNode()??void 0,this.additionalActions)}};mO=uO=gO([pO(8,eu),pO(9,ER),pO(10,iO)],mO);let fO=class extends At{constructor(e,t,i,n,o,s,r,a){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._getAdditionalActions=o,this._instantiationService=s,this._bulkEditService=r,this._notificationService=a,this._currentWidget=this._register(new Rt),this._register(zt.any(t.onDidChangeModel,t.onDidChangeModelContent)((()=>this.clear())))}async applyEditAndShowIfNeeded(e,t,i,n,o){if(!e.length||!this._editor.hasModel())return;const s=this._editor.getModel(),r=t.allEdits.at(t.activeEditIndex);if(!r)return;const a=async s=>{const r=this._editor.getModel();r&&(await r.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:s,allEdits:t.allEdits},i,n,o))},l=(n,o)=>{Re(n)||(this._notificationService.error(o),i&&this.show(e[0],t,a))},d=new UD(this._editor,3,void 0,o);let h;try{h=await function(e,t){return new Promise(((i,n)=>{const o=t.onCancellationRequested((()=>{o.dispose(),n(new Oe)}));e.then(i,n).finally((()=>o.dispose()))}))}(n(r,d.token),d.token)}catch(e){return l(e,y(932,"Error resolving edit '{0}':\n{1}",r.title,pM(e)))}finally{d.dispose()}if(o.isCancellationRequested)return;const c=ZT(s.uri,e,h),u=e[0],g=s.deltaDecorations([],[{range:u,options:{description:"paste-line-suffix",stickiness:0}}]);let p,m;this._editor.focus();try{p=await this._bulkEditService.apply(c,{editor:this._editor,token:o}),m=s.getDecorationRange(g[0])}catch(e){return l(e,y(933,"Error applying edit '{0}':\n{1}",r.title,pM(e)))}finally{s.deltaDecorations(g,[])}o.isCancellationRequested||i&&p.isApplied&&t.allEdits.length>1&&this.show(m??u,t,a)}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(mO,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i,this._getAdditionalActions()))}clear(){this._currentWidget.clear()}tryShowSelector(){this._currentWidget.value?.showSelector()}};fO=gO([pO(5,nc),pO(6,RD),pO(7,lO)],fO);var _O,vO=function(e,t){return function(i,n){t(i,n,e)}};const bO="editor.changePasteType",wO=new Jc("pasteWidgetVisible",!1,y(912,"Whether the paste widget is showing")),CO="application/vnd.code.copymetadata";let yO=class extends At{static{_O=this}static{this.ID="editor.contrib.copyPasteActionController"}static get(e){return e.getContribution(_O.ID)}constructor(e,t,i,n,o,s,r,a,l,d){super(),this._logService=i,this._bulkEditService=n,this._clipboardService=o,this._commandService=s,this._configService=r,this._languageFeaturesService=a,this._quickInputService=l,this._progressService=d,this._editor=e;const h=e.getContainerDomNode();this._register(ga(h,"copy",(e=>this.handleCopy(e)))),this._register(ga(h,"cut",(e=>this.handleCopy(e)))),this._register(ga(h,"paste",(e=>this.handlePaste(e)),!0)),this._pasteProgressManager=this._register(new ZD("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(fO,"pasteIntoEditor",e,wO,{id:bO,label:y(913,"Show paste options...")},(()=>_O._configureDefaultAction?[_O._configureDefaultAction]:[])))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}async pasteAs(e){this._logService.trace("CopyPasteController.pasteAs"),this._editor.focus();try{this._logService.trace("Before calling editor.action.clipboardPasteAction"),this._pasteAsActionContext={preferred:e},await this._commandService.executeCommand("editor.action.clipboardPasteAction")}finally{this._pasteAsActionContext=void 0}}clearWidgets(){this._postPasteWidgetManager.clear()}isPasteAsEnabled(){return this._editor.getOption(97).enabled}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){let t=null;if(e.clipboardData){const[i,n]=dD.getTextData(e.clipboardData),o=n||aD.INSTANCE.get(i);t=o?.id||null,this._logService.trace("CopyPasteController#handleCopy for id : ",t," with text.length : ",i.length)}else this._logService.trace("CopyPasteController#handleCopy");if(!this._editor.hasTextFocus())return;if(this._clipboardService.clearInternalState?.(),!e.clipboardData||!this.isPasteAsEnabled())return;const i=this._editor.getModel(),n=this._editor.getSelections();if(!i||!n?.length)return;const o=this._editor.getOption(45);let s=n;const r=1===n.length&&n[0].isEmpty();if(r){if(!o)return;s=[new Yu(s[0].startLineNumber,1,s[0].startLineNumber,1+i.getLineLength(s[0].startLineNumber))]}const a=this._editor._getViewModel()?.getPlainTextToCopy(n,o,q),l={multicursorText:Array.isArray(a)?a:null,pasteOnNewLine:r,mode:null},d=this._languageFeaturesService.documentPasteEditProvider.ordered(i).filter((e=>!!e.prepareDocumentPaste));if(!d.length)return void this.setCopyMetadata(e.clipboardData,{defaultPastePayload:l});const h=ID(e.clipboardData),c=d.flatMap((e=>e.copyMimeTypes??[])),u=t??_C();this.setCopyMetadata(e.clipboardData,{id:u,providerCopyMimeTypes:c,defaultPastePayload:l});const g=d.map((e=>({providerMimeTypes:e.copyMimeTypes,operation:hi((t=>e.prepareDocumentPaste(i,s,h,t).catch((e=>{console.error(e)}))))})));_O._currentCopyOperation?.operations.forEach((e=>e.operation.cancel())),_O._currentCopyOperation={handle:u,operations:g}}async handlePaste(e){if(e.clipboardData){const[t,i]=dD.getTextData(e.clipboardData),n=i||aD.INSTANCE.get(t);this._logService.trace("CopyPasteController#handlePaste for id : ",n?.id)}else this._logService.trace("CopyPasteController#handlePaste");if(!e.clipboardData||!this._editor.hasTextFocus())return;uT.get(this._editor)?.closeMessage(),this._currentPasteOperation?.cancel(),this._currentPasteOperation=void 0;const t=this._editor.getModel(),i=this._editor.getSelections();if(!i?.length||!t)return;if(this._editor.getOption(104)||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;const n=this.fetchCopyMetadata(e);this._logService.trace("CopyPasteController#handlePaste with metadata : ",n?.id," and text.length : ",e.clipboardData.getData("text/plain").length);const o=AD(e.clipboardData);o.delete(CO);const s=Array.from(e.clipboardData.files).map((e=>e.type)),r=[...e.clipboardData.types,...s,...n?.providerCopyMimeTypes??[],yp.uriList],a=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter((e=>{const t=this._pasteAsActionContext?.preferred;return!(t&&!this.providerMatchesPreference(e,t))&&e.pasteMimeTypes?.some((e=>pD(e,r)))}));a.length?(e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferred,a,i,o,n):this.doPasteInline(a,i,o,n,e)):this._pasteAsActionContext?.preferred&&(this.showPasteAsNoEditMessage(i,this._pasteAsActionContext.preferred),e.preventDefault(),e.stopImmediatePropagation())}showPasteAsNoEditMessage(e,t){const i="only"in t?t.only.value:"preferences"in t?t.preferences.length?t.preferences.map((e=>e.value)).join(", "):y(914,"empty"):t.providerId;uT.get(this._editor)?.showMessage(y(915,"No paste edits for '{0}' found",i),e[0].getStartPosition())}doPasteInline(e,t,i,n,o){this._logService.trace("CopyPasteController#doPasteInline");const s=this._editor;if(!s.hasModel())return;const r=new UD(s,3,void 0),a=hi((async s=>{const l=this._editor;if(!l.hasModel())return;const d=l.getModel(),h=new Mt,c=h.add(new ri(s));h.add(r.token.onCancellationRequested((()=>c.cancel())));const u=c.token;try{if(await this.mergeInDataFromCopy(e,i,n,u),u.isCancellationRequested)return;const s=e.filter((e=>this.isSupportedPasteProvider(e,i)));if(!s.length||1===s.length&&s[0]instanceof NT)return this.applyDefaultPasteHandler(i,n,u,o);const r={triggerKind:VS.Automatic},a=await this.getPasteEdits(s,i,d,t,r,u);if(h.add(a),u.isCancellationRequested)return;if(1===a.edits.length&&a.edits[0].provider instanceof NT)return this.applyDefaultPasteHandler(i,n,u,o);if(a.edits.length){const e="afterPaste"===l.getOption(97).showPasteSelector;return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:this.getInitialActiveEditIndex(d,a.edits),allEdits:a.edits},e,(async(e,i)=>{if(!e.provider.resolveDocumentPasteEdit)return e;const n=e.provider.resolveDocumentPasteEdit(e,i),o=new Li,s=await this._pasteProgressManager.showWhile(t[0].getEndPosition(),y(916,"Resolving paste edit for '{0}'. Click to cancel",e.title),ci(Promise.race([o.p,n]),i),{cancel:()=>o.cancel()},0);return s&&(e.insertText=s.insertText,e.additionalEdit=s.additionalEdit),e}),u)}await this.applyDefaultPasteHandler(i,n,u,o)}finally{h.dispose(),this._currentPasteOperation===a&&(this._currentPasteOperation=void 0)}}));this._pasteProgressManager.showWhile(t[0].getEndPosition(),y(917,"Running paste handlers. Click to cancel and do basic paste"),a,{cancel:async()=>{a.cancel(),r.token.isCancellationRequested||await this.applyDefaultPasteHandler(i,n,r.token,o)}}).finally((()=>{r.dispose()})),this._currentPasteOperation=a}showPasteAsPick(e,t,i,n,o){this._logService.trace("CopyPasteController#showPasteAsPick");const s=hi((async r=>{const a=this._editor;if(!a.hasModel())return;const l=a.getModel(),d=new Mt,h=d.add(new UD(a,3,void 0,r));try{if(await this.mergeInDataFromCopy(t,n,o,h.token),h.token.isCancellationRequested)return;let s=t.filter((t=>this.isSupportedPasteProvider(t,n,e)));e&&(s=s.filter((t=>this.providerMatchesPreference(t,e))));const r={triggerKind:VS.PasteAs,only:e&&"only"in e?e.only:void 0};let a,c=d.add(await this.getPasteEdits(s,n,l,i,r,h.token));if(h.token.isCancellationRequested)return;if(e&&(c={edits:c.edits.filter((t=>"only"in e?e.only.contains(t.kind):"preferences"in e?e.preferences.some((e=>e.contains(t.kind))):e.providerId===t.provider.id)),dispose:c.dispose}),!c.edits.length)return void(e&&this.showPasteAsNoEditMessage(i,e));if(e)a=c.edits.at(0);else{const e={id:"editor.pasteAs.default",label:y(918,"Configure default paste action"),edit:void 0},t=await this._quickInputService.pick([...c.edits.map((e=>({label:e.title,description:e.kind?.value,edit:e}))),..._O._configureDefaultAction?[{type:"separator"},{label:_O._configureDefaultAction.label,edit:void 0}]:[]],{placeHolder:y(919,"Select Paste Action")});if(t===e)return void _O._configureDefaultAction?.run();a=t?.edit}if(!a)return;const u=ZT(l.uri,i,a);await this._bulkEditService.apply(u,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}}));this._progressService.withProgress({location:10,title:y(920,"Running paste handlers")},(()=>s))}setCopyMetadata(e,t){this._logService.trace("CopyPasteController#setCopyMetadata new id : ",t.id),e.setData(CO,JSON.stringify(t))}fetchCopyMetadata(e){if(this._logService.trace("CopyPasteController#fetchCopyMetadata"),!e.clipboardData)return;const t=e.clipboardData.getData(CO);if(t)try{return JSON.parse(t)}catch{return}const[i,n]=dD.getTextData(e.clipboardData);return n?{defaultPastePayload:{mode:n.mode,multicursorText:n.multicursorText??null,pasteOnNewLine:!!n.isFromEmptySelection}}:void 0}async mergeInDataFromCopy(e,t,i,n){if(this._logService.trace("CopyPasteController#mergeInDataFromCopy with metadata : ",i?.id),i?.id&&_O._currentCopyOperation?.handle===i.id){const i=_O._currentCopyOperation.operations.filter((t=>e.some((e=>e.pasteMimeTypes.some((e=>pD(e,t.providerMimeTypes))))))).map((e=>e.operation)),o=await Promise.all(i);if(n.isCancellationRequested)return;for(const e of o.reverse())if(e)for(const[i,n]of e)t.replace(i,n)}if(!t.has(yp.uriList)){const e=await this._clipboardService.readResources();if(n.isCancellationRequested)return;e.length&&t.append(yp.uriList,cD(fD.create(e)))}}async getPasteEdits(e,t,i,n,o,s){const r=new Mt,a=await ci(Promise.all(e.map((async e=>{try{const a=await(e.provideDocumentPasteEdits?.(i,n,t,o,s));return a&&r.add(a),a?.edits?.map((t=>({...t,provider:e})))}catch(e){return void(Re(e)||console.error(e))}}))),s),l=as(a??[]).flat().filter((e=>!o.only||o.only.contains(e.kind)));return{edits:YT(l),dispose:()=>r.dispose()}}async applyDefaultPasteHandler(e,t,i,n){const o=e.get(yp.text)??e.get("text"),s=await(o?.asString())??"";if(i.isCancellationRequested)return;const r={clipboardEvent:n,text:s,pasteOnNewLine:t?.defaultPastePayload.pasteOnNewLine??!1,multicursorText:t?.defaultPastePayload.multicursorText??null,mode:null};this._logService.trace("CopyPasteController#applyDefaultPasteHandler for id : ",t?.id),this._editor.trigger("keyboard","paste",r)}isSupportedPasteProvider(e,t,i){return!!e.pasteMimeTypes?.some((e=>t.matches(e)))&&(!i||this.providerMatchesPreference(e,i))}providerMatchesPreference(e,t){return"only"in t?e.providedPasteEditKinds.some((e=>t.only.contains(e))):"preferences"in t?t.preferences.some((e=>t.preferences.some((t=>t.contains(e))))):e.id===t.providerId}getInitialActiveEditIndex(e,t){const i=this._configService.getValue("editor.pasteAs.preferences",{resource:e.uri});for(const e of Array.isArray(i)?i:[]){const i=new _D(e),n=t.findIndex((e=>i.contains(e.kind)));if(n>=0)return n}return 0}};yO=_O=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([vO(1,nc),vO(2,yu),vO(3,RD),vO(4,oD),vO(5,mc),vO(6,up),vO(7,BD),vO(8,LD),vO(9,vD)],yO);const SO="9_cutcopypaste",xO=Z||document.queryCommandSupported("cut"),kO=Z||document.queryCommandSupported("copy"),LO=void 0!==navigator.clipboard&&!c||document.queryCommandSupported("paste");function DO(e){return e.register(),e}const EO=xO?DO(new Au({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Z?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:gu.MenubarEditMenu,group:"2_ccp",title:y(809,"Cu&&t"),order:1},{menuId:gu.EditorContext,group:SO,title:y(810,"Cut"),when:Xu.writable,order:1},{menuId:gu.CommandPalette,group:"",title:y(811,"Cut"),order:1},{menuId:gu.SimpleEditorContext,group:SO,title:y(812,"Cut"),when:Xu.writable,order:1}]})):void 0,NO=kO?DO(new Au({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Z?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:gu.MenubarEditMenu,group:"2_ccp",title:y(813,"&&Copy"),order:2},{menuId:gu.EditorContext,group:SO,title:y(814,"Copy"),order:2},{menuId:gu.CommandPalette,group:"",title:y(815,"Copy"),order:1},{menuId:gu.SimpleEditorContext,group:SO,title:y(816,"Copy"),order:2}]})):void 0;fu.appendMenuItem(gu.MenubarEditMenu,{submenu:gu.MenubarCopy,title:x(821,"Copy As"),group:"2_ccp",order:3}),fu.appendMenuItem(gu.EditorContext,{submenu:gu.EditorContextCopy,title:x(822,"Copy As"),group:SO,order:3}),fu.appendMenuItem(gu.EditorContext,{submenu:gu.EditorContextShare,title:x(823,"Share"),group:"11_share",order:-1,when:Ac.and(Ac.notEquals("resourceScheme","output"),Xu.editorTextFocus)}),fu.appendMenuItem(gu.ExplorerContext,{submenu:gu.ExplorerContextShare,title:x(824,"Share"),group:"11_share",order:-1});const IO=LO?DO(new Au({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Z?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:gu.MenubarEditMenu,group:"2_ccp",title:y(817,"&&Paste"),order:4},{menuId:gu.EditorContext,group:SO,title:y(818,"Paste"),when:Xu.writable,order:4},{menuId:gu.CommandPalette,group:"",title:y(819,"Paste"),order:1},{menuId:gu.SimpleEditorContext,group:SO,title:y(820,"Paste"),when:Xu.writable,order:4}]})):void 0;function TO(e,t){e&&(e.addImplementation(1e4,"code-editor",((e,i)=>{const n=e.get(yu);n.trace("registerExecCommandImpl (addImplementation code-editor for : ",t,")");const o=e.get(sc).getFocusedCodeEditor();if(o&&o.hasTextFocus()){const e=o.getOption(45),i=o.getSelection();return i&&i.isEmpty()&&!e||(o.getOption(170)&&"cut"===t?(MO(o),n.trace("registerExecCommandImpl (before execCommand copy)"),o.getContainerDomNode().ownerDocument.execCommand("copy"),o.trigger(void 0,"cut",void 0),n.trace("registerExecCommandImpl (after execCommand copy)")):(MO(o),n.trace("registerExecCommandImpl (before execCommand "+t+")"),o.getContainerDomNode().ownerDocument.execCommand(t),n.trace("registerExecCommandImpl (after execCommand "+t+")"))),!0}return!1})),e.addImplementation(0,"generic-dom",((e,i)=>{const n=e.get(yu);return n.trace("registerExecCommandImpl (addImplementation generic-dom for : ",t,")"),n.trace("registerExecCommandImpl (before execCommand "+t+")"),Ua().execCommand(t),n.trace("registerExecCommandImpl (after execCommand "+t+")"),!0})))}function MO(e){if(e.getOption(170)){const t=hD.get(e.getId());t&&t.onWillCopy()}}TO(EO,"cut"),TO(NO,"copy"),IO&&(IO.addImplementation(1e4,"code-editor",((e,t)=>{const i=e.get(yu);i.trace("registerExecCommandImpl (addImplementation code-editor for : paste)");const n=e.get(sc),o=e.get(oD),s=e.get(Cu),r=e.get(sD),a=n.getFocusedCodeEditor();if(a&&a.hasModel()&&a.hasTextFocus()){if(a.getOption(170)){const e=hD.get(a.getId());e&&e.onWillPaste()}const e=Ht.create(!0);i.trace("registerExecCommandImpl (before triggerPaste)");const t=o.triggerPaste(Ka().vscodeWindowId);return t?(i.trace("registerExecCommandImpl (triggerPaste defined)"),t.then((async()=>{if(i.trace("registerExecCommandImpl (after triggerPaste)"),"stable"!==r.quality){const t=e.elapsed();s.publicLog2("editorAsyncPaste",{duration:t})}return yO.get(a)?.finishedPaste()??Promise.resolve()}))):(i.trace("registerExecCommandImpl (triggerPaste undefined)"),!Y||(i.trace("registerExecCommandImpl (Paste handling on web)"),(async()=>{const e=await o.readText();if(""!==e){const t=aD.INSTANCE.get(e);let n=!1,o=null,s=null;t&&(n=a.getOption(45)&&!!t.isFromEmptySelection,o=void 0!==t.multicursorText?t.multicursorText:null,s=t.mode),i.trace("registerExecCommandImpl (clipboardText.length : ",e.length," id : ",t?.id,")"),a.trigger("keyboard","paste",{text:e,pasteOnNewLine:n,multicursorText:o,mode:s})}})()))}return!1})),IO.addImplementation(0,"generic-dom",((e,t)=>(e.get(yu).trace("registerExecCommandImpl (addImplementation generic-dom for : paste)"),e.get(oD).triggerPaste(Ka().vscodeWindowId)??!1)))),kO&&Hu(class extends Pu{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:x(825,"Copy with Syntax Highlighting"),precondition:void 0,kbOpts:{kbExpr:Xu.textInputFocus,primary:0,weight:100}})}run(e,t){const i=e.get(yu);i.trace("ExecCommandCopyWithSyntaxHighlightingAction#run"),t.hasModel()&&(!t.getOption(45)&&t.getSelection().isEmpty()||(lD.forceCopyWithSyntaxHighlighting=!0,t.focus(),i.trace("ExecCommandCopyWithSyntaxHighlightingAction (before execCommand copy)"),t.getContainerDomNode().ownerDocument.execCommand("copy"),i.trace("ExecCommandCopyWithSyntaxHighlightingAction (after execCommand copy)"),lD.forceCopyWithSyntaxHighlighting=!1))}});const AO={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,renderGutterMenu:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0,useTrueInlineView:!1},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0,compactMode:!1};class RO{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class OO{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class PO{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return BO(e,t)}compute(e,t,i){return i}}class FO{constructor(e,t){this.newValue=e,this.didChange=t}}function BO(e,t){if("object"!=typeof e||"object"!=typeof t||!e||!t)return new FO(t,e!==t);if(Array.isArray(e)||Array.isArray(t)){const i=Array.isArray(e)&&Array.isArray(t)&&es(e,t);return new FO(t,!i)}let i=!1;for(const n in t)if(t.hasOwnProperty(n)){const o=BO(e[n],t[n]);o.didChange&&(e[n]=o.newValue,i=!0)}return new FO(e,i)}class WO{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return BO(e,t)}validate(e){return this.defaultValue}}class VO{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return BO(e,t)}validate(e){return void 0===e?this.defaultValue:e}compute(e,t,i){return i}}function HO(e,t){return void 0===e?t:"false"!==e&&Boolean(e)}class zO extends VO{constructor(e,t,i,n=void 0){void 0!==n&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return HO(e,this.defaultValue)}}function UO(e,t,i,n){if(void 0===e)return t;let o=parseInt(e,10);return isNaN(o)?t:(o=Math.max(i,o),o=Math.min(n,o),0|o)}class KO extends VO{static clampedInt(e,t,i,n){return UO(e,t,i,n)}constructor(e,t,i,n,o,s=void 0){void 0!==s&&(s.type="integer",s.default=i,s.minimum=n,s.maximum=o),super(e,t,i,s),this.minimum=n,this.maximum=o}validate(e){return KO.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function jO(e,t,i,n){if(void 0===e)return t;const o=qO.float(e,t);return qO.clamp(o,i,n)}class qO extends VO{static clamp(e,t,i){return e<t?t:e>i?i:e}static float(e,t){if("number"==typeof e)return e;if(void 0===e)return t;const i=parseFloat(e);return isNaN(i)?t:i}constructor(e,t,i,n,o,s,r){void 0!==o&&(o.type="number",o.default=i,o.minimum=s,o.maximum=r),super(e,t,i,o),this.validationFn=n,this.minimum=s,this.maximum=r}validate(e){return this.validationFn(qO.float(e,this.defaultValue))}}class $O extends VO{static string(e,t){return"string"!=typeof e?t:e}constructor(e,t,i,n=void 0){void 0!==n&&(n.type="string",n.default=i),super(e,t,i,n)}validate(e){return $O.string(e,this.defaultValue)}}function GO(e,t,i,n){return"string"!=typeof e?t:n&&e in n?n[e]:-1===i.indexOf(e)?t:e}class ZO extends VO{constructor(e,t,i,n,o=void 0){void 0!==o&&(o.type="string",o.enum=n,o.default=i),super(e,t,i,o),this._allowedValues=n}validate(e){return GO(e,this.defaultValue,this._allowedValues)}}class YO extends PO{constructor(e,t,i,n,o,s,r=void 0){void 0!==r&&(r.type="string",r.enum=o,r.default=n),super(e,t,i,r),this._allowedValues=o,this._convert=s}validate(e){return"string"!=typeof e||-1===this._allowedValues.indexOf(e)?this.defaultValue:this._convert(e)}}var QO,XO;function JO(e){switch(e){case"line":return QO.Line;case"block":return QO.Block;case"underline":return QO.Underline;case"line-thin":return QO.LineThin;case"block-outline":return QO.BlockOutline;case"underline-thin":return QO.UnderlineThin}}!function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin"}(QO||(QO={}));class eP extends PO{static{this.OFF='"liga" off, "calt" off'}static{this.ON='"liga" on, "calt" on'}constructor(){super(60,"fontLigatures",eP.OFF,{anyOf:[{type:"boolean",description:y(224,"Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:y(225,"Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:y(226,"Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return void 0===e?this.defaultValue:"string"==typeof e?"false"===e||0===e.length?eP.OFF:"true"===e?eP.ON:e:Boolean(e)?eP.ON:eP.OFF}}class tP extends PO{static{this.OFF="normal"}static{this.TRANSLATE="translate"}constructor(){super(63,"fontVariations",tP.OFF,{anyOf:[{type:"boolean",description:y(227,"Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:y(228,"Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:y(229,"Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return void 0===e?this.defaultValue:"string"==typeof e?"false"===e?tP.OFF:"true"===e?tP.TRANSLATE:e:Boolean(e)?tP.TRANSLATE:tP.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}class iP extends PO{static{this.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"]}static{this.MINIMUM_VALUE=1}static{this.MAXIMUM_VALUE=1e3}constructor(){super(62,"fontWeight",fP.fontWeight,{anyOf:[{type:"number",minimum:iP.MINIMUM_VALUE,maximum:iP.MAXIMUM_VALUE,errorMessage:y(231,'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:iP.SUGGESTION_VALUES}],default:fP.fontWeight,description:y(232,'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return"normal"===e||"bold"===e?e:String(KO.clampedInt(e,fP.fontWeight,iP.MINIMUM_VALUE,iP.MAXIMUM_VALUE))}}class nP extends WO{constructor(){super(165)}compute(e,t,i){return nP.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let n=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(n=Math.max(n,t-1));const o=(i+e.viewLineCount+n)/(e.pixelRatio*e.height);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:n,desiredRatio:o,minimapLineCount:Math.floor(e.viewLineCount/o)}}static _computeMinimapLayout(e,t){const i=e.outerWidth,n=e.outerHeight,o=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(o*n),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:n};const s=t.stableMinimapLayoutInput,r=s&&e.outerHeight===s.outerHeight&&e.lineHeight===s.lineHeight&&e.typicalHalfwidthCharacterWidth===s.typicalHalfwidthCharacterWidth&&e.pixelRatio===s.pixelRatio&&e.scrollBeyondLastLine===s.scrollBeyondLastLine&&e.paddingTop===s.paddingTop&&e.paddingBottom===s.paddingBottom&&e.minimap.enabled===s.minimap.enabled&&e.minimap.side===s.minimap.side&&e.minimap.size===s.minimap.size&&e.minimap.showSlider===s.minimap.showSlider&&e.minimap.renderCharacters===s.minimap.renderCharacters&&e.minimap.maxColumn===s.minimap.maxColumn&&e.minimap.scale===s.minimap.scale&&e.verticalScrollbarWidth===s.verticalScrollbarWidth&&e.isViewportWrapping===s.isViewportWrapping,a=e.lineHeight,l=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,h=e.minimap.renderCharacters;let c=o>=2?Math.round(2*e.minimap.scale):e.minimap.scale;const u=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,m=e.verticalScrollbarWidth,f=e.viewLineCount,_=e.remainingWidth,v=e.isViewportWrapping,b=h?2:3;let w=Math.floor(o*n);const C=w/o;let y=!1,S=!1,x=b*c,k=c/o,L=1;if("fill"===g||"fit"===g){const{typicalViewportLineCount:i,extraLinesBeforeFirstLine:s,extraLinesBeyondLastLine:l,desiredRatio:h,minimapLineCount:u}=nP.computeContainedMinimapLineCount({viewLineCount:f,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:n,lineHeight:a,pixelRatio:o});if(f/u>1)y=!0,S=!0,c=1,x=1,k=c/o;else{let n=!1,d=c+1;if("fit"===g){const e=Math.ceil((s+f+l)*x);v&&r&&_<=t.stableFitRemainingWidth?(n=!0,d=t.stableFitMaxMinimapScale):n=e>w}if("fill"===g||n){y=!0;const n=c;x=Math.min(a*o,Math.max(1,Math.floor(1/h))),v&&r&&_<=t.stableFitRemainingWidth&&(d=t.stableFitMaxMinimapScale),c=Math.min(d,Math.max(1,Math.floor(x/b))),c>n&&(L=Math.min(2,c/n)),k=c/o/L,w=Math.ceil(Math.max(i,s+f+l)*x),v?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=_,t.stableFitMaxMinimapScale=c):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const D=Math.floor(u*k),E=Math.min(D,Math.max(0,Math.floor((_-m-2)*k/(l+k)))+8);let N=Math.floor(o*E);const I=N/o;return N=Math.floor(N*L),{renderMinimap:h?1:2,minimapLeft:"left"===p?0:i-E-m,minimapWidth:E,minimapHeightIsEditorHeight:y,minimapIsSampling:S,minimapScale:c,minimapLineHeight:x,minimapCanvasInnerWidth:N,minimapCanvasInnerHeight:w,minimapCanvasOuterWidth:I,minimapCanvasOuterHeight:C}}static computeLayout(e,t){const i=0|t.outerWidth,n=0|t.outerHeight,o=0|t.lineHeight,s=0|t.lineNumbersDigitCount,r=t.typicalHalfwidthCharacterWidth,a=t.maxDigitWidth,l=t.pixelRatio,d=t.viewLineCount,h=e.get(154),c="inherit"===h?e.get(153):h,u="inherit"===c?e.get(149):c,g=e.get(152),p=t.isDominatedByLongLines,m=e.get(66),f=0!==e.get(76).renderType,_=e.get(77),v=e.get(119),b=e.get(96),w=e.get(81),C=e.get(117),y=C.verticalScrollbarSize,S=C.verticalHasArrows,x=C.arrowSize,k=C.horizontalScrollbarSize,L=e.get(52),D="never"!==e.get(126);let E=e.get(74);L&&D&&(E+=16);let N=0;if(f){const e=Math.max(s,_);N=Math.round(e*a)}let I=0;m&&(I=o*t.glyphMarginDecorationLaneCount);let T=0,M=T+I,A=M+N,R=A+E;const O=i-I-N-E;let P=!1,F=!1,B=-1;2===e.get(2)&&"inherit"===c&&p?(P=!0,F=!0):"on"===u||"bounded"===u?F=!0:"wordWrapColumn"===u&&(B=g);const W=nP._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:o,typicalHalfwidthCharacterWidth:r,pixelRatio:l,scrollBeyondLastLine:v,paddingTop:b.top,paddingBottom:b.bottom,minimap:w,verticalScrollbarWidth:y,viewLineCount:d,remainingWidth:O,isViewportWrapping:F},t.memory||new OO);0!==W.renderMinimap&&0===W.minimapLeft&&(T+=W.minimapWidth,M+=W.minimapWidth,A+=W.minimapWidth,R+=W.minimapWidth);const V=O-W.minimapWidth,H=Math.max(1,Math.floor((V-y-2)/r)),z=S?x:0;return F&&(B=Math.max(1,H),"bounded"===u&&(B=Math.min(B,g))),{width:i,height:n,glyphMarginLeft:T,glyphMarginWidth:I,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:M,lineNumbersWidth:N,decorationsLeft:A,decorationsWidth:E,contentLeft:R,contentWidth:V,minimap:W,viewportColumn:H,isWordWrapMinified:P,isViewportWrapping:F,wrappingColumn:B,verticalScrollbarWidth:y,horizontalScrollbarHeight:k,overviewRuler:{top:z,width:y,height:n-2*z,right:0}}}}function oP(e){const t=e.get(112);return"editable"===t?e.get(104):"on"!==t}function sP(e){return!e.get(172)}function rP(e,t){if("string"!=typeof e)return t;switch(e){case"hidden":return 2;case"visible":return 3;default:return 1}}!function(e){e.Off="off",e.OnCode="onCode",e.On="on"}(XO||(XO={}));const aP="inUntrustedWorkspace",lP="editor.unicodeHighlight.allowedCharacters",dP="editor.unicodeHighlight.invisibleCharacters",hP="editor.unicodeHighlight.nonBasicASCII",cP="editor.unicodeHighlight.ambiguousCharacters",uP="editor.unicodeHighlight.includeComments",gP="editor.unicodeHighlight.includeStrings",pP="editor.unicodeHighlight.allowedLocales";function mP(e,t,i){const n=i.indexOf(e);return-1===n?t:i[n]}const fP={fontFamily:$?"Menlo, Monaco, 'Courier New', monospace":q?"Consolas, 'Courier New', monospace":"'Droid Sans Mono', 'monospace', monospace",fontWeight:"normal",fontSize:$?12:14,lineHeight:0,letterSpacing:0},_P=[];function vP(e){return _P[e.id]=e,e}const bP={acceptSuggestionOnCommitCharacter:vP(new zO(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:y(429,"Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:vP(new ZO(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",y(430,"Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:y(431,"Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:vP(new class extends PO{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[y(198,"Use platform APIs to detect when a Screen Reader is attached."),y(199,"Optimize for usage with a Screen Reader."),y(200,"Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:y(201,"Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return 0===i?e.accessibilitySupport:i}}),accessibilityPageSize:vP(new KO(3,"accessibilityPageSize",500,1,1073741824,{description:y(432,"Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),tags:["accessibility"]})),allowOverflow:vP(new zO(4,"allowOverflow",!0)),allowVariableLineHeights:vP(new zO(5,"allowVariableLineHeights",!0,{description:y(433,"Controls whether to allow using variable line heights in the editor.")})),allowVariableFonts:vP(new zO(6,"allowVariableFonts",!0,{description:y(434,"Controls whether to allow using variable fonts in the editor.")})),allowVariableFontsInAccessibilityMode:vP(new zO(7,"allowVariableFontsInAccessibilityMode",!1,{description:y(435,"Controls whether to allow using variable fonts in the editor in the accessibility mode."),tags:["accessibility"]})),ariaLabel:vP(new $O(8,"ariaLabel",y(436,"Editor content"))),ariaRequired:vP(new zO(9,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:vP(new zO(12,"screenReaderAnnounceInlineSuggestion",!0,{description:y(437,"Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:vP(new ZO(10,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",y(438,"Use language configurations to determine when to autoclose brackets."),y(439,"Autoclose brackets only when the cursor is to the left of whitespace."),""],description:y(440,"Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:vP(new ZO(11,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",y(441,"Use language configurations to determine when to autoclose comments."),y(442,"Autoclose comments only when the cursor is to the left of whitespace."),""],description:y(443,"Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:vP(new ZO(13,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",y(444,"Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:y(445,"Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:vP(new ZO(14,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",y(446,"Type over closing quotes or brackets only if they were automatically inserted."),""],description:y(447,"Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:vP(new ZO(15,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",y(448,"Use language configurations to determine when to autoclose quotes."),y(449,"Autoclose quotes only when the cursor is to the left of whitespace."),""],description:y(450,"Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:vP(new YO(16,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],(function(e){switch(e){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}),{enumDescriptions:[y(451,"The editor will not insert indentation automatically."),y(452,"The editor will keep the current line's indentation."),y(453,"The editor will keep the current line's indentation and honor language defined brackets."),y(454,"The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),y(455,"The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:y(456,"Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),autoIndentOnPaste:vP(new zO(17,"autoIndentOnPaste",!1,{description:y(457,"Controls whether the editor should automatically auto-indent the pasted content.")})),autoIndentOnPasteWithinString:vP(new zO(18,"autoIndentOnPasteWithinString",!0,{description:y(458,"Controls whether the editor should automatically auto-indent the pasted content when pasted within a string. This takes effect when autoIndentOnPaste is true.")})),automaticLayout:vP(new zO(19,"automaticLayout",!1)),autoSurround:vP(new ZO(20,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[y(459,"Use language configurations to determine when to automatically surround selections."),y(460,"Surround with quotes but not brackets."),y(461,"Surround with brackets but not quotes."),""],description:y(462,"Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:vP(new class extends PO{constructor(){const e={enabled:Ig.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:Ig.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(21,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:y(349,"Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:y(350,"Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:HO(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:HO(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}),bracketPairGuides:vP(new class extends PO{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(22,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[y(351,"Enables bracket pair guides."),y(352,"Enables bracket pair guides only for the active bracket pair."),y(353,"Disables bracket pair guides.")],default:e.bracketPairs,description:y(354,"Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[y(355,"Enables horizontal guides as addition to vertical bracket pair guides."),y(356,"Enables horizontal guides only for the active bracket pair."),y(357,"Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:y(358,"Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:y(359,"Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:y(360,"Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[y(361,"Highlights the active indent guide."),y(362,"Highlights the active indent guide even if bracket guides are highlighted."),y(363,"Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:y(364,"Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{bracketPairs:mP(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:mP(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:HO(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:HO(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:mP(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}),stickyTabStops:vP(new zO(132,"stickyTabStops",!1,{description:y(463,"Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:vP(new zO(23,"codeLens",!0,{description:y(464,"Controls whether the editor shows CodeLens.")})),codeLensFontFamily:vP(new $O(24,"codeLensFontFamily","",{description:y(465,"Controls the font family for CodeLens.")})),codeLensFontSize:vP(new KO(25,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:y(466,"Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:vP(new zO(26,"colorDecorators",!0,{description:y(467,"Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:vP(new ZO(168,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[y(468,"Make the color picker appear both on click and hover of the color decorator"),y(469,"Make the color picker appear on hover of the color decorator"),y(470,"Make the color picker appear on click of the color decorator")],description:y(471,"Controls the condition to make a color picker appear from a color decorator.")})),colorDecoratorsLimit:vP(new KO(27,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:y(472,"Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:vP(new zO(28,"columnSelection",!1,{description:y(473,"Enable that the selection with the mouse and keys is doing column selection.")})),comments:vP(new class extends PO{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(29,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:y(202,"Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:y(203,"Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertSpace:HO(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:HO(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}),contextmenu:vP(new zO(30,"contextmenu",!0)),copyWithSyntaxHighlighting:vP(new zO(31,"copyWithSyntaxHighlighting",!0,{description:y(474,"Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:vP(new YO(32,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],(function(e){switch(e){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}),{description:y(475,"Control the cursor animation style.")})),cursorSmoothCaretAnimation:vP(new ZO(33,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[y(476,"Smooth caret animation is disabled."),y(477,"Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),y(478,"Smooth caret animation is always enabled.")],description:y(479,"Controls whether the smooth caret animation should be enabled.")})),cursorStyle:vP(new YO(34,"cursorStyle",QO.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],JO,{description:y(480,"Controls the cursor style in insert input mode.")})),overtypeCursorStyle:vP(new YO(92,"overtypeCursorStyle",QO.Block,"block",["line","block","underline","line-thin","block-outline","underline-thin"],JO,{description:y(481,"Controls the cursor style in overtype input mode.")})),cursorSurroundingLines:vP(new KO(35,"cursorSurroundingLines",0,0,1073741824,{description:y(482,"Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:vP(new ZO(36,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[y(483,"`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),y(484,"`cursorSurroundingLines` is enforced always.")],markdownDescription:y(485,"Controls when `#editor.cursorSurroundingLines#` should be enforced.")})),cursorWidth:vP(new KO(37,"cursorWidth",0,0,1073741824,{markdownDescription:y(486,"Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),cursorHeight:vP(new KO(38,"cursorHeight",0,0,1073741824,{markdownDescription:y(487,"Controls the height of the cursor when `#editor.cursorStyle#` is set to `line`. Cursor's max height depends on line height.")})),disableLayerHinting:vP(new zO(39,"disableLayerHinting",!1)),disableMonospaceOptimizations:vP(new zO(40,"disableMonospaceOptimizations",!1)),domReadOnly:vP(new zO(41,"domReadOnly",!1)),dragAndDrop:vP(new zO(42,"dragAndDrop",!0,{description:y(488,"Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:vP(new class extends zO{constructor(){super(45,"emptySelectionClipboard",!0,{description:y(204,"Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}),dropIntoEditor:vP(new class extends PO{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(43,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:y(421,"Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:y(422,"Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),enum:["afterDrop","never"],enumDescriptions:[y(423,"Show the drop selector widget after a file is dropped into the editor."),y(424,"Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:HO(t.enabled,this.defaultValue.enabled),showDropSelector:GO(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}),editContext:vP(new zO(44,"editContext",!0,{description:y(489,"Sets whether the EditContext API should be used instead of the text area to power input in the editor."),included:de||ue||Z})),renderRichScreenReaderContent:vP(new zO(107,"renderRichScreenReaderContent",!1,{markdownDescription:y(490,"Whether to render rich screen reader content when the `#editor.editContext#` setting is enabled.")})),stickyScroll:vP(new class extends PO{constructor(){const e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(131,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:y(259,"Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:20,description:y(260,"Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:y(261,"Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:y(262,"Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:HO(t.enabled,this.defaultValue.enabled),maxLineCount:KO.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:GO(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:HO(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}),experimentalGpuAcceleration:vP(new ZO(46,"experimentalGpuAcceleration","off",["off","on"],{tags:["experimental"],enumDescriptions:[y(491,"Use regular DOM-based rendering."),y(492,"Use GPU acceleration.")],description:y(493,"Controls whether to use the experimental GPU acceleration to render the editor.")})),experimentalWhitespaceRendering:vP(new ZO(47,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[y(494,"Use a new rendering method with svgs."),y(495,"Use a new rendering method with font characters."),y(496,"Use the stable rendering method.")],description:y(497,"Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:vP(new $O(48,"extraEditorClassName","")),fastScrollSensitivity:vP(new qO(49,"fastScrollSensitivity",5,(e=>e<=0?5:e),{markdownDescription:y(498,"Scrolling speed multiplier when pressing `Alt`.")})),find:vP(new class extends PO{constructor(){const e={cursorMoveOnType:!0,findOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0,history:"workspace",replaceHistory:"workspace"};super(50,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:y(205,"Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[y(206,"Never seed search string from the editor selection."),y(207,"Always seed search string from the editor selection, including word at cursor position."),y(208,"Only seed search string from the editor selection.")],description:y(209,"Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[y(210,"Never turn on Find in Selection automatically (default)."),y(211,"Always turn on Find in Selection automatically."),y(212,"Turn on Find in Selection automatically when multiple lines of content are selected.")],description:y(213,"Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:y(214,"Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:$},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:y(215,"Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:y(216,"Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")},"editor.find.history":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[y(217,"Do not store search history from the find widget."),y(218,"Store search history across the active workspace")],description:y(219,"Controls how the find widget history should be stored")},"editor.find.replaceHistory":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[y(220,"Do not store history from the replace widget."),y(221,"Store replace history across the active workspace")],description:y(222,"Controls how the replace widget history should be stored")},"editor.find.findOnType":{type:"boolean",default:e.findOnType,description:y(223,"Controls whether the Find Widget should search as you type.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{cursorMoveOnType:HO(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),findOnType:HO(t.findOnType,this.defaultValue.findOnType),seedSearchStringFromSelection:"boolean"==typeof e.seedSearchStringFromSelection?e.seedSearchStringFromSelection?"always":"never":GO(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:"boolean"==typeof e.autoFindInSelection?e.autoFindInSelection?"always":"never":GO(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:HO(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:HO(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:HO(t.loop,this.defaultValue.loop),history:GO(t.history,this.defaultValue.history,["never","workspace"]),replaceHistory:GO(t.replaceHistory,this.defaultValue.replaceHistory,["never","workspace"])}}}),fixedOverflowWidgets:vP(new zO(51,"fixedOverflowWidgets",!1)),folding:vP(new zO(52,"folding",!0,{description:y(499,"Controls whether the editor has code folding enabled.")})),foldingStrategy:vP(new ZO(53,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[y(500,"Use a language-specific folding strategy if available, else the indentation-based one."),y(501,"Use the indentation-based folding strategy.")],description:y(502,"Controls the strategy for computing folding ranges.")})),foldingHighlight:vP(new zO(54,"foldingHighlight",!0,{description:y(503,"Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:vP(new zO(55,"foldingImportsByDefault",!1,{description:y(504,"Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:vP(new KO(56,"foldingMaximumRegions",5e3,10,65e3,{description:y(505,"The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:vP(new zO(57,"unfoldOnClickAfterEndOfLine",!1,{description:y(506,"Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:vP(new $O(58,"fontFamily",fP.fontFamily,{description:y(507,"Controls the font family.")})),fontInfo:vP(new class extends WO{constructor(){super(59)}compute(e,t,i){return e.fontInfo}}),fontLigatures2:vP(new eP),fontSize:vP(new class extends VO{constructor(){super(61,"fontSize",fP.fontSize,{type:"number",minimum:6,maximum:100,default:fP.fontSize,description:y(230,"Controls the font size in pixels.")})}validate(e){const t=qO.float(e,this.defaultValue);return 0===t?fP.fontSize:qO.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}),fontWeight:vP(new iP),fontVariations:vP(new tP),formatOnPaste:vP(new zO(64,"formatOnPaste",!1,{description:y(508,"Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:vP(new zO(65,"formatOnType",!1,{description:y(509,"Controls whether the editor should automatically format the line after typing.")})),glyphMargin:vP(new zO(66,"glyphMargin",!0,{description:y(510,"Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:vP(new class extends PO{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",multipleTests:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:"",alternativeTestsCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[y(233,"Show Peek view of the results (default)"),y(234,"Go to the primary result and show a Peek view"),y(235,"Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(67,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:y(236,"This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":{description:y(237,"Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:y(238,"Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:y(239,"Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:y(240,"Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:y(241,"Controls the behavior the 'Go to References'-command when multiple target locations exist."),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:y(242,"Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:y(243,"Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:y(244,"Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:y(245,"Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:y(246,"Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{multiple:GO(t.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:t.multipleDefinitions??GO(t.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:t.multipleTypeDefinitions??GO(t.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:t.multipleDeclarations??GO(t.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:t.multipleImplementations??GO(t.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:t.multipleReferences??GO(t.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),multipleTests:t.multipleTests??GO(t.multipleTests,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:$O.string(t.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:$O.string(t.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:$O.string(t.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:$O.string(t.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:$O.string(t.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand),alternativeTestsCommand:$O.string(t.alternativeTestsCommand,this.defaultValue.alternativeTestsCommand)}}}),hideCursorInOverviewRuler:vP(new zO(68,"hideCursorInOverviewRuler",!1,{description:y(511,"Controls whether the cursor should be hidden in the overview ruler.")})),hover:vP(new class extends PO{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(69,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:y(247,"Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:y(248,"Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:y(249,"Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,markdownDescription:y(250,"Controls the delay in milliseconds after which the hover is hidden. Requires `#editor.hover.sticky#` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:y(251,"Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:HO(t.enabled,this.defaultValue.enabled),delay:KO.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:HO(t.sticky,this.defaultValue.sticky),hidingDelay:KO.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:HO(t.above,this.defaultValue.above)}}}),inDiffEditor:vP(new zO(70,"inDiffEditor",!1)),inertialScroll:vP(new zO(158,"inertialScroll",!1,{description:y(512,"Make scrolling inertial - mostly useful with touchpad on linux.")})),letterSpacing:vP(new qO(72,"letterSpacing",fP.letterSpacing,(e=>qO.clamp(e,-5,20)),{description:y(513,"Controls the letter spacing in pixels.")})),lightbulb:vP(new class extends PO{constructor(){const e={enabled:XO.OnCode};super(73,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",enum:[XO.Off,XO.OnCode,XO.On],default:e.enabled,enumDescriptions:[y(255,"Disable the code action menu."),y(256,"Show the code action menu when the cursor is on lines with code."),y(257,"Show the code action menu when the cursor is on lines with code or on empty lines.")],description:y(258,"Enables the Code Action lightbulb in the editor.")}})}validate(e){return e&&"object"==typeof e?{enabled:GO(e.enabled,this.defaultValue.enabled,[XO.Off,XO.OnCode,XO.On])}:this.defaultValue}}),lineDecorationsWidth:vP(new class extends PO{constructor(){super(74,"lineDecorationsWidth",10)}validate(e){return"string"==typeof e&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):KO.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?KO.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}),lineHeight:vP(new class extends qO{constructor(){super(75,"lineHeight",fP.lineHeight,(e=>qO.clamp(e,0,150)),{markdownDescription:y(272,"Controls the line height. \n - Use 0 to automatically compute the line height from the font size.\n - Values between 0 and 8 will be used as a multiplier with the font size.\n - Values greater than or equal to 8 will be used as effective values.")},0,150)}compute(e,t,i){return e.fontInfo.lineHeight}}),lineNumbers:vP(new class extends PO{constructor(){super(76,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[y(303,"Line numbers are not rendered."),y(304,"Line numbers are rendered as absolute number."),y(305,"Line numbers are rendered as distance in lines to cursor position."),y(306,"Line numbers are rendered every 10 lines.")],default:"on",description:y(307,"Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return void 0!==e&&("function"==typeof e?(t=4,i=e):t="interval"===e?3:"relative"===e?2:"on"===e?1:0),{renderType:t,renderFn:i}}}),lineNumbersMinChars:vP(new KO(77,"lineNumbersMinChars",5,1,300)),linkedEditing:vP(new zO(78,"linkedEditing",!1,{description:y(514,"Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:vP(new zO(79,"links",!0,{description:y(515,"Controls whether the editor should detect links and make them clickable.")})),matchBrackets:vP(new ZO(80,"matchBrackets","always",["always","near","never"],{description:y(516,"Highlight matching brackets.")})),minimap:vP(new class extends PO{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:"none",renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,markSectionHeaderRegex:"\\bMARK:\\s*(?<separator>-?)\\s*(?<label>.*)$",sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(81,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:y(273,"Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"string",enum:["none","mouseover","scroll"],enumDescriptions:[y(274,"The minimap is always shown."),y(275,"The minimap is hidden when mouse is not over the minimap and shown when mouse is over the minimap."),y(276,"The minimap is only shown when the editor is scrolled")],default:e.autohide,description:y(277,"Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[y(278,"The minimap has the same size as the editor contents (and might scroll)."),y(279,"The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),y(280,"The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:y(281,"Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:y(282,"Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:y(283,"Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:y(284,"Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:y(285,"Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:y(286,"Limit the width of the minimap to render at most a certain number of columns.")},"editor.minimap.showRegionSectionHeaders":{type:"boolean",default:e.showRegionSectionHeaders,description:y(287,"Controls whether named regions are shown as section headers in the minimap.")},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:e.showMarkSectionHeaders,description:y(288,"Controls whether MARK: comments are shown as section headers in the minimap.")},"editor.minimap.markSectionHeaderRegex":{type:"string",default:e.markSectionHeaderRegex,description:y(289,"Defines the regular expression used to find section headers in comments. The regex must contain a named match group `label` (written as `(?<label>.+)`) that encapsulates the section header, otherwise it will not work. Optionally you can include another match group named `separator`. Use \\n in the pattern to match multi-line headers.")},"editor.minimap.sectionHeaderFontSize":{type:"number",default:e.sectionHeaderFontSize,description:y(290,"Controls the font size of section headers in the minimap.")},"editor.minimap.sectionHeaderLetterSpacing":{type:"number",default:e.sectionHeaderLetterSpacing,description:y(291,"Controls the amount of space (in pixels) between characters of section header. This helps the readability of the header in small font sizes.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;let i=this.defaultValue.markSectionHeaderRegex;const n=e.markSectionHeaderRegex;if("string"==typeof n)try{new RegExp(n,"d"),i=n}catch{}return{enabled:HO(t.enabled,this.defaultValue.enabled),autohide:GO(t.autohide,this.defaultValue.autohide,["none","mouseover","scroll"]),size:GO(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:GO(t.side,this.defaultValue.side,["right","left"]),showSlider:GO(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:HO(t.renderCharacters,this.defaultValue.renderCharacters),scale:KO.clampedInt(t.scale,1,1,3),maxColumn:KO.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:HO(t.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:HO(t.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),markSectionHeaderRegex:i,sectionHeaderFontSize:qO.clamp(t.sectionHeaderFontSize??this.defaultValue.sectionHeaderFontSize,4,32),sectionHeaderLetterSpacing:qO.clamp(t.sectionHeaderLetterSpacing??this.defaultValue.sectionHeaderLetterSpacing,0,5)}}}),mouseStyle:vP(new ZO(82,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:vP(new qO(83,"mouseWheelScrollSensitivity",1,(e=>0===e?1:e),{markdownDescription:y(517,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:vP(new zO(84,"mouseWheelZoom",!1,{markdownDescription:$?y(518,"Zoom the font of the editor when using mouse wheel and holding `Cmd`."):y(519,"Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:vP(new zO(85,"multiCursorMergeOverlapping",!0,{description:y(520,"Merge multiple cursors when they are overlapping.")})),multiCursorModifier:vP(new YO(86,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],(function(e){return"ctrlCmd"===e?$?"metaKey":"ctrlKey":"altKey"}),{markdownEnumDescriptions:[y(521,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),y(522,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:y(523,"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),mouseMiddleClickAction:vP(new ZO(87,"mouseMiddleClickAction","default",["default","openLink","ctrlLeftClick"],{description:y(524,"Controls what happens when middle mouse button is clicked in the editor.")})),multiCursorPaste:vP(new ZO(88,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[y(525,"Each cursor pastes a single line of the text."),y(526,"Each cursor pastes the full text.")],markdownDescription:y(527,"Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:vP(new KO(89,"multiCursorLimit",1e4,1,1e5,{markdownDescription:y(528,"Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:vP(new ZO(90,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[y(529,"Does not highlight occurrences."),y(530,"Highlights occurrences only in the current file."),y(531,"Experimental: Highlights occurrences across all valid open files.")],markdownDescription:y(532,"Controls whether occurrences should be highlighted across open files.")})),occurrencesHighlightDelay:vP(new KO(91,"occurrencesHighlightDelay",0,0,2e3,{description:y(533,"Controls the delay in milliseconds after which occurrences are highlighted."),tags:["preview"]})),overtypeOnPaste:vP(new zO(93,"overtypeOnPaste",!0,{description:y(534,"Controls whether pasting should overtype.")})),overviewRulerBorder:vP(new zO(94,"overviewRulerBorder",!0,{description:y(535,"Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:vP(new KO(95,"overviewRulerLanes",3,0,3)),padding:vP(new class extends PO{constructor(){super(96,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:y(292,"Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:y(293,"Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{top:KO.clampedInt(t.top,0,0,1e3),bottom:KO.clampedInt(t.bottom,0,0,1e3)}}}),pasteAs:vP(new class extends PO{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(97,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:y(425,"Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:y(426,"Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),enum:["afterPaste","never"],enumDescriptions:[y(427,"Show the paste selector widget after content is pasted into the editor."),y(428,"Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:HO(t.enabled,this.defaultValue.enabled),showPasteSelector:GO(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}),parameterHints:vP(new class extends PO{constructor(){const e={enabled:!0,cycle:!0};super(98,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:y(294,"Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:y(295,"Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:HO(t.enabled,this.defaultValue.enabled),cycle:HO(t.cycle,this.defaultValue.cycle)}}}),peekWidgetDefaultFocus:vP(new ZO(99,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[y(536,"Focus the tree when opening peek"),y(537,"Focus the editor when opening peek")],description:y(538,"Controls whether to focus the inline editor or the tree in the peek widget.")})),placeholder:vP(new class extends PO{constructor(){super(100,"placeholder",void 0)}validate(e){return void 0===e?this.defaultValue:"string"==typeof e?e:this.defaultValue}}),definitionLinkOpensInPeek:vP(new zO(101,"definitionLinkOpensInPeek",!1,{description:y(539,"Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:vP(new class extends PO{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[y(296,"Quick suggestions show inside the suggest widget"),y(297,"Quick suggestions show as ghost text"),y(298,"Quick suggestions are disabled")]}];super(102,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:y(299,"Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:y(300,"Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:y(301,"Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:y(302,"Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the {0}-setting which controls if suggestions are triggered by special characters.","`#editor.suggestOnTriggerCharacters#`")}),this.defaultValue=e}validate(e){if("boolean"==typeof e){const t=e?"on":"off";return{comments:t,strings:t,other:t}}if(!e||"object"!=typeof e)return this.defaultValue;const{other:t,comments:i,strings:n}=e,o=["on","inline","off"];let s,r,a;return s="boolean"==typeof t?t?"on":"off":GO(t,this.defaultValue.other,o),r="boolean"==typeof i?i?"on":"off":GO(i,this.defaultValue.comments,o),a="boolean"==typeof n?n?"on":"off":GO(n,this.defaultValue.strings,o),{other:s,comments:r,strings:a}}}),quickSuggestionsDelay:vP(new KO(103,"quickSuggestionsDelay",10,0,1073741824,{description:y(540,"Controls the delay in milliseconds after which quick suggestions will show up."),experiment:{mode:"auto"}})),readOnly:vP(new zO(104,"readOnly",!1)),readOnlyMessage:vP(new class extends PO{constructor(){super(105,"readOnlyMessage",void 0)}validate(e){return e&&"object"==typeof e?e:this.defaultValue}}),renameOnType:vP(new zO(106,"renameOnType",!1,{description:y(541,"Controls whether the editor auto renames on type."),markdownDeprecationMessage:y(542,"Deprecated, use `#editor.linkedEditing#` instead.")})),renderControlCharacters:vP(new zO(108,"renderControlCharacters",!0,{description:y(543,"Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:vP(new ZO(109,"renderFinalNewline",G?"dimmed":"on",["off","on","dimmed"],{description:y(544,"Render last line number when the file ends with a newline.")})),renderLineHighlight:vP(new ZO(110,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",y(545,"Highlights both the gutter and the current line.")],description:y(546,"Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:vP(new zO(111,"renderLineHighlightOnlyWhenFocus",!1,{description:y(547,"Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:vP(new ZO(112,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:vP(new ZO(113,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",y(548,"Render whitespace characters except for single spaces between words."),y(549,"Render whitespace characters only on selected text."),y(550,"Render only trailing whitespace characters."),""],description:y(551,"Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:vP(new KO(114,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:vP(new zO(115,"roundedSelection",!0,{description:y(552,"Controls whether selections should have rounded corners.")})),rulers:vP(new class extends PO{constructor(){const e=[],t={type:"number",description:y(308,"Number of monospace characters at which this editor ruler will render.")};super(116,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:y(309,"Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:y(310,"Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){const t=[];for(const i of e)if("number"==typeof i)t.push({column:KO.clampedInt(i,0,0,1e4),color:null});else if(i&&"object"==typeof i){const e=i;t.push({column:KO.clampedInt(e.column,0,0,1e4),color:e.color})}return t.sort(((e,t)=>e.column-t.column)),t}return this.defaultValue}}),scrollbar:vP(new class extends PO{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1,ignoreHorizontalScrollbarInContentHeight:!1};super(117,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[y(311,"The vertical scrollbar will be visible only when necessary."),y(312,"The vertical scrollbar will always be visible."),y(313,"The vertical scrollbar will always be hidden.")],default:"auto",description:y(314,"Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[y(315,"The horizontal scrollbar will be visible only when necessary."),y(316,"The horizontal scrollbar will always be visible."),y(317,"The horizontal scrollbar will always be hidden.")],default:"auto",description:y(318,"Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:y(319,"The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:y(320,"The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:y(321,"Controls whether clicks scroll by page or jump to click position.")},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:e.ignoreHorizontalScrollbarInContentHeight,description:y(322,"When set, the horizontal scrollbar will not increase the size of the editor's content.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e,i=KO.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=KO.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:KO.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:rP(t.vertical,this.defaultValue.vertical),horizontal:rP(t.horizontal,this.defaultValue.horizontal),useShadows:HO(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:HO(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:HO(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:HO(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:HO(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:KO.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:KO.clampedInt(t.verticalSliderSize,n,0,1e3),scrollByPage:HO(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:HO(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}}),scrollBeyondLastColumn:vP(new KO(118,"scrollBeyondLastColumn",4,0,1073741824,{description:y(553,"Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:vP(new zO(119,"scrollBeyondLastLine",!0,{description:y(554,"Controls whether the editor will scroll beyond the last line.")})),scrollOnMiddleClick:vP(new zO(171,"scrollOnMiddleClick",!1,{description:y(555,"Controls whether the editor will scroll when the middle button is pressed.")})),scrollPredominantAxis:vP(new zO(120,"scrollPredominantAxis",!0,{description:y(556,"Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:vP(new zO(121,"selectionClipboard",!0,{description:y(557,"Controls whether the Linux primary clipboard should be supported."),included:G})),selectionHighlight:vP(new zO(122,"selectionHighlight",!0,{description:y(558,"Controls whether the editor should highlight matches similar to the selection.")})),selectionHighlightMaxLength:vP(new KO(123,"selectionHighlightMaxLength",200,0,1073741824,{description:y(559,"Controls how many characters can be in the selection before similiar matches are not highlighted. Set to zero for unlimited.")})),selectionHighlightMultiline:vP(new zO(124,"selectionHighlightMultiline",!1,{description:y(560,"Controls whether the editor should highlight selection matches that span multiple lines.")})),selectOnLineNumbers:vP(new zO(125,"selectOnLineNumbers",!0)),showFoldingControls:vP(new ZO(126,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[y(561,"Always show the folding controls."),y(562,"Never show the folding controls and reduce the gutter size."),y(563,"Only show the folding controls when the mouse is over the gutter.")],description:y(564,"Controls when the folding controls on the gutter are shown.")})),showUnused:vP(new zO(127,"showUnused",!0,{description:y(565,"Controls fading out of unused code.")})),showDeprecated:vP(new zO(157,"showDeprecated",!0,{description:y(566,"Controls strikethrough deprecated variables.")})),inlayHints:vP(new class extends PO{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1,maximumLength:43};super(159,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:y(263,"Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[y(264,"Inlay hints are enabled"),y(265,"Inlay hints are showing by default and hide when holding {0}",$?"Ctrl+Option":"Ctrl+Alt"),y(266,"Inlay hints are hidden by default and show when holding {0}",$?"Ctrl+Option":"Ctrl+Alt"),y(267,"Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:y(268,"Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:y(269,"Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:y(270,"Enables the padding around the inlay hints in the editor.")},"editor.inlayHints.maximumLength":{type:"number",default:e.maximumLength,markdownDescription:y(271,"Maximum overall length of inlay hints, for a single line, before they get truncated by the editor. Set to `0` to never truncate")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return"boolean"==typeof t.enabled&&(t.enabled=t.enabled?"on":"off"),{enabled:GO(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:KO.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:$O.string(t.fontFamily,this.defaultValue.fontFamily),padding:HO(t.padding,this.defaultValue.padding),maximumLength:KO.clampedInt(t.maximumLength,this.defaultValue.maximumLength,0,Number.MAX_SAFE_INTEGER)}}}),snippetSuggestions:vP(new ZO(128,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[y(567,"Show snippet suggestions on top of other suggestions."),y(568,"Show snippet suggestions below other suggestions."),y(569,"Show snippets suggestions with other suggestions."),y(570,"Do not show snippet suggestions.")],description:y(571,"Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:vP(new class extends PO{constructor(){super(129,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:y(413,"Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:y(414,"Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return e&&"object"==typeof e?{selectLeadingAndTrailingWhitespace:HO(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:HO(e.selectSubwords,this.defaultValue.selectSubwords)}:this.defaultValue}}),smoothScrolling:vP(new zO(130,"smoothScrolling",!1,{description:y(572,"Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:vP(new KO(133,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:vP(new class extends PO{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(134,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[y(365,"Insert suggestion without overwriting text right of the cursor."),y(366,"Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:y(367,"Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:y(368,"Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:y(369,"Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:y(370,"Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[y(371,"Always select a suggestion when automatically triggering IntelliSense."),y(372,"Never select a suggestion when automatically triggering IntelliSense."),y(373,"Select a suggestion only when triggering IntelliSense from a trigger character."),y(374,"Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:y(375,"Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions ({0} and {1}) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.","`#editor.quickSuggestions#`","`#editor.suggestOnTriggerCharacters#`")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:y(376,"Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:y(377,"Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:y(378,"Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:y(379,"Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:y(380,"Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:y(381,"This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:y(382,"This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:y(383,"When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:y(384,"When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:y(385,"When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:y(386,"When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:y(387,"When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:y(388,"When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:y(389,"When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:y(390,"When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:y(391,"When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:y(392,"When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:y(393,"When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:y(394,"When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:y(395,"When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:y(396,"When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:y(397,"When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:y(398,"When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:y(399,"When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:y(400,"When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:y(401,"When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:y(402,"When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:y(403,"When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:y(404,"When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:y(405,"When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:y(406,"When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:y(407,"When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:y(408,"When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:y(409,"When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:y(410,"When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:y(411,"When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:y(412,"When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertMode:GO(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:HO(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:HO(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:HO(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:HO(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:GO(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:HO(t.showIcons,this.defaultValue.showIcons),showStatusBar:HO(t.showStatusBar,this.defaultValue.showStatusBar),preview:HO(t.preview,this.defaultValue.preview),previewMode:GO(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:HO(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:HO(t.showMethods,this.defaultValue.showMethods),showFunctions:HO(t.showFunctions,this.defaultValue.showFunctions),showConstructors:HO(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:HO(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:HO(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:HO(t.showFields,this.defaultValue.showFields),showVariables:HO(t.showVariables,this.defaultValue.showVariables),showClasses:HO(t.showClasses,this.defaultValue.showClasses),showStructs:HO(t.showStructs,this.defaultValue.showStructs),showInterfaces:HO(t.showInterfaces,this.defaultValue.showInterfaces),showModules:HO(t.showModules,this.defaultValue.showModules),showProperties:HO(t.showProperties,this.defaultValue.showProperties),showEvents:HO(t.showEvents,this.defaultValue.showEvents),showOperators:HO(t.showOperators,this.defaultValue.showOperators),showUnits:HO(t.showUnits,this.defaultValue.showUnits),showValues:HO(t.showValues,this.defaultValue.showValues),showConstants:HO(t.showConstants,this.defaultValue.showConstants),showEnums:HO(t.showEnums,this.defaultValue.showEnums),showEnumMembers:HO(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:HO(t.showKeywords,this.defaultValue.showKeywords),showWords:HO(t.showWords,this.defaultValue.showWords),showColors:HO(t.showColors,this.defaultValue.showColors),showFiles:HO(t.showFiles,this.defaultValue.showFiles),showReferences:HO(t.showReferences,this.defaultValue.showReferences),showFolders:HO(t.showFolders,this.defaultValue.showFolders),showTypeParameters:HO(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:HO(t.showSnippets,this.defaultValue.showSnippets),showUsers:HO(t.showUsers,this.defaultValue.showUsers),showIssues:HO(t.showIssues,this.defaultValue.showIssues)}}}),inlineSuggest:vP(new class extends PO{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1,fontFamily:"default",syntaxHighlightingEnabled:!0,minShowDelay:0,suppressInSnippetMode:!1,edits:{enabled:!0,showCollapsed:!1,renderSideBySide:"auto",allowCodeShifting:"always"},triggerCommandOnProviderChange:!0,experimental:{suppressInlineSuggestions:"",showOnSuggestConflict:"never",emptyResponseInformation:!0}};super(71,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:y(330,"Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[y(331,"Show the inline suggestion toolbar whenever an inline suggestion is shown."),y(332,"Show the inline suggestion toolbar when hovering over an inline suggestion."),y(333,"Never show the inline suggestion toolbar.")],description:y(334,"Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.syntaxHighlightingEnabled":{type:"boolean",default:e.syntaxHighlightingEnabled,description:y(335,"Controls whether to show syntax highlighting for inline suggestions in the editor.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:y(336,"Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")},"editor.inlineSuggest.suppressInSnippetMode":{type:"boolean",default:e.suppressInSnippetMode,description:y(337,"Controls whether inline suggestions are suppressed when in snippet mode.")},"editor.inlineSuggest.minShowDelay":{type:"number",default:0,minimum:0,maximum:1e4,description:y(338,"Controls the minimal delay in milliseconds after which inline suggestions are shown after typing.")},"editor.inlineSuggest.experimental.suppressInlineSuggestions":{type:"string",default:e.experimental.suppressInlineSuggestions,tags:["experimental"],description:y(339,"Suppresses inline completions for specified extension IDs -- comma separated."),experiment:{mode:"auto"}},"editor.inlineSuggest.experimental.emptyResponseInformation":{type:"boolean",default:e.experimental.emptyResponseInformation,tags:["experimental"],description:y(340,"Controls whether to send request information from the inline suggestion provider."),experiment:{mode:"auto"}},"editor.inlineSuggest.triggerCommandOnProviderChange":{type:"boolean",default:e.triggerCommandOnProviderChange,tags:["experimental"],description:y(341,"Controls whether to trigger a command when the inline suggestion provider changes."),experiment:{mode:"auto"}},"editor.inlineSuggest.experimental.showOnSuggestConflict":{type:"string",default:e.experimental.showOnSuggestConflict,tags:["experimental"],enum:["always","never","whenSuggestListIsIncomplete"],description:y(342,"Controls whether to show inline suggestions when there is a suggest conflict."),experiment:{mode:"auto"}},"editor.inlineSuggest.fontFamily":{type:"string",default:e.fontFamily,description:y(343,"Controls the font family of the inline suggestions.")},"editor.inlineSuggest.edits.allowCodeShifting":{type:"string",default:e.edits.allowCodeShifting,description:y(344,"Controls whether showing a suggestion will shift the code to make space for the suggestion inline."),enum:["always","horizontal","never"],tags:["nextEditSuggestions"]},"editor.inlineSuggest.edits.renderSideBySide":{type:"string",default:e.edits.renderSideBySide,description:y(345,"Controls whether larger suggestions can be shown side by side."),enum:["auto","never"],enumDescriptions:[y(346,"Larger suggestions will show side by side if there is enough space, otherwise they will be shown below."),y(347,"Larger suggestions are never shown side by side and will always be shown below.")],tags:["nextEditSuggestions"]},"editor.inlineSuggest.edits.showCollapsed":{type:"boolean",default:e.edits.showCollapsed,description:y(348,"Controls whether the suggestion will show as collapsed until jumping to it."),tags:["nextEditSuggestions"]}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:HO(t.enabled,this.defaultValue.enabled),mode:GO(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:GO(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:HO(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:HO(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:$O.string(t.fontFamily,this.defaultValue.fontFamily),syntaxHighlightingEnabled:HO(t.syntaxHighlightingEnabled,this.defaultValue.syntaxHighlightingEnabled),minShowDelay:KO.clampedInt(t.minShowDelay,0,0,1e4),suppressInSnippetMode:HO(t.suppressInSnippetMode,this.defaultValue.suppressInSnippetMode),edits:{enabled:HO(t.edits?.enabled,this.defaultValue.edits.enabled),showCollapsed:HO(t.edits?.showCollapsed,this.defaultValue.edits.showCollapsed),allowCodeShifting:GO(t.edits?.allowCodeShifting,this.defaultValue.edits.allowCodeShifting,["always","horizontal","never"]),renderSideBySide:GO(t.edits?.renderSideBySide,this.defaultValue.edits.renderSideBySide,["never","auto"])},triggerCommandOnProviderChange:HO(t.triggerCommandOnProviderChange,this.defaultValue.triggerCommandOnProviderChange),experimental:{suppressInlineSuggestions:$O.string(t.experimental?.suppressInlineSuggestions,this.defaultValue.experimental.suppressInlineSuggestions),showOnSuggestConflict:GO(t.experimental?.showOnSuggestConflict,this.defaultValue.experimental.showOnSuggestConflict,["always","never","whenSuggestListIsIncomplete"]),emptyResponseInformation:HO(t.experimental?.emptyResponseInformation,this.defaultValue.experimental.emptyResponseInformation)}}}}),inlineCompletionsAccessibilityVerbose:vP(new zO(169,"inlineCompletionsAccessibilityVerbose",!1,{description:y(573,"Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:vP(new KO(135,"suggestFontSize",0,0,1e3,{markdownDescription:y(574,"Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:vP(new KO(136,"suggestLineHeight",0,0,1e3,{markdownDescription:y(575,"Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:vP(new zO(137,"suggestOnTriggerCharacters",!0,{description:y(576,"Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:vP(new ZO(138,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[y(577,"Always select the first suggestion."),y(578,"Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),y(579,"Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:y(580,"Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:vP(new ZO(139,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[y(581,"Tab complete will insert the best matching suggestion when pressing tab."),y(582,"Disable tab completions."),y(583,"Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:y(584,"Enables tab completions.")})),tabIndex:vP(new KO(140,"tabIndex",0,-1,1073741824)),trimWhitespaceOnDelete:vP(new zO(141,"trimWhitespaceOnDelete",!1,{description:y(585,"Controls whether the editor will also delete the next line's indentation whitespace when deleting a newline.")})),unicodeHighlight:vP(new class extends PO{constructor(){const e={nonBasicASCII:aP,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:aP,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(142,"unicodeHighlight",e,{[hP]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,aP],default:e.nonBasicASCII,description:y(323,"Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[dP]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:y(324,"Controls whether characters that just reserve space or have no width at all are highlighted.")},[cP]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:y(325,"Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[uP]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,aP],default:e.includeComments,description:y(326,"Controls whether characters in comments should also be subject to Unicode highlighting.")},[gP]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,aP],default:e.includeStrings,description:y(327,"Controls whether characters in strings should also be subject to Unicode highlighting.")},[lP]:{restricted:!0,type:"object",default:e.allowedCharacters,description:y(328,"Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[pP]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:y(329,"Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(cg(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},i=!0)),t.allowedLocales&&e&&(cg(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},i=!0));const n=super.applyUpdate(e,t);return i?new FO(n.newValue,!0):n}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{nonBasicASCII:mP(t.nonBasicASCII,aP,[!0,!1,aP]),invisibleCharacters:HO(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:HO(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:mP(t.includeComments,aP,[!0,!1,aP]),includeStrings:mP(t.includeStrings,aP,[!0,!1,aP]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if("object"!=typeof e||!e)return t;const i={};for(const[t,n]of Object.entries(e))!0===n&&(i[t]=!0);return i}}),unusualLineTerminators:vP(new ZO(143,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[y(586,"Unusual line terminators are automatically removed."),y(587,"Unusual line terminators are ignored."),y(588,"Unusual line terminators prompt to be removed.")],description:y(589,"Remove unusual line terminators that might cause problems.")})),useShadowDOM:vP(new zO(144,"useShadowDOM",!0)),useTabStops:vP(new zO(145,"useTabStops",!0,{description:y(590,"Spaces and tabs are inserted and deleted in alignment with tab stops.")})),wordBreak:vP(new ZO(146,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[y(591,"Use the default line break rule."),y(592,"Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:y(593,"Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSegmenterLocales:vP(new class extends PO{constructor(){const e=[];super(147,"wordSegmenterLocales",e,{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:y(415,"Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"array",items:{type:"string"},default:e})}validate(e){if("string"==typeof e&&(e=[e]),Array.isArray(e)){const t=[];for(const i of e)if("string"==typeof i)try{Intl.Segmenter.supportedLocalesOf(i).length>0&&t.push(i)}catch{}return t}return this.defaultValue}}),wordSeparators:vP(new $O(148,"wordSeparators",Mg,{description:y(594,"Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:vP(new ZO(149,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[y(595,"Lines will never wrap."),y(596,"Lines will wrap at the viewport width."),y(597,"Lines will wrap at `#editor.wordWrapColumn#`."),y(598,"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:y(599,"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:vP(new $O(150,"wordWrapBreakAfterCharacters"," \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:vP(new $O(151,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:vP(new KO(152,"wordWrapColumn",80,1,1073741824,{markdownDescription:y(600,"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:vP(new ZO(153,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:vP(new ZO(154,"wordWrapOverride2","inherit",["off","on","inherit"])),wrapOnEscapedLineFeeds:vP(new zO(160,"wrapOnEscapedLineFeeds",!1,{markdownDescription:y(601,'Controls whether literal `\\n` shall trigger a wordWrap when `#editor.wordWrap#` is enabled.\n\nFor example:\n```c\nchar* str="hello\\nworld"\n```\nwill be displayed as\n```c\nchar* str="hello\\n\n world"\n```')})),effectiveCursorStyle:vP(new class extends WO{constructor(){super(161)}compute(e,t,i){return"overtype"===e.inputMode?t.get(92):t.get(34)}}),editorClassName:vP(new class extends WO{constructor(){super(162)}compute(e,t,i){const n=["monaco-editor"];return t.get(48)&&n.push(t.get(48)),e.extraEditorClassName&&n.push(e.extraEditorClassName),"default"===t.get(82)?n.push("mouse-default"):"copy"===t.get(82)&&n.push("mouse-copy"),t.get(127)&&n.push("showUnused"),t.get(157)&&n.push("showDeprecated"),n.join(" ")}}),defaultColorDecorators:vP(new ZO(167,"defaultColorDecorators","auto",["auto","always","never"],{enumDescriptions:[y(602,"Show default color decorators only when no extension provides colors decorators."),y(603,"Always show default color decorators."),y(604,"Never show default color decorators.")],description:y(605,"Controls whether inline color decorations should be shown using the default document color provider.")})),pixelRatio:vP(new class extends WO{constructor(){super(163)}compute(e,t,i){return e.pixelRatio}}),tabFocusMode:vP(new zO(164,"tabFocusMode",!1,{markdownDescription:y(606,"Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:vP(new nP),wrappingInfo:vP(new class extends WO{constructor(){super(166)}compute(e,t,i){const n=t.get(165);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}}),wrappingIndent:vP(new class extends PO{constructor(){super(155,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[y(416,"No indentation. Wrapped lines begin at column 1."),y(417,"Wrapped lines get the same indentation as the parent."),y(418,"Wrapped lines get +1 indentation toward the parent."),y(419,"Wrapped lines get +2 indentation toward the parent.")],description:y(420,"Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,i){return 2===t.get(2)?0:i}}),wrappingStrategy:vP(new class extends PO{constructor(){super(156,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[y(252,"Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),y(253,"Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:y(254,"Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return GO(e,"simple",["simple","advanced"])}compute(e,t,i){return 2===t.get(2)?"advanced":i}}),effectiveEditContextEnabled:vP(new class extends WO{constructor(){super(170)}compute(e,t){return e.editContextSupported&&t.get(44)}}),effectiveAllowVariableFonts:vP(new class extends WO{constructor(){super(172)}compute(e,t){return 2===e.accessibilitySupport?t.get(7):t.get(6)}})},wP=Object.freeze({id:"editor",order:5,type:"object",title:y(144,"Editor"),scope:6}),CP={...wP,properties:{"editor.tabSize":{type:"number",default:Ig.tabSize,minimum:1,maximum:100,markdownDescription:y(145,"The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:y(146,'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:Ig.insertSpaces,markdownDescription:y(147,"Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:Ig.detectIndentation,markdownDescription:y(148,"Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:Ig.trimAutoWhitespace,description:y(149,"Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:Ig.largeFileOptimizations,description:y(150,"Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[y(151,"Turn off Word Based Suggestions."),y(152,"Only suggest words from the active document."),y(153,"Suggest words from all open documents of the same language."),y(154,"Suggest words from all open documents.")],description:y(155,"Controls whether completions should be computed based on words in the document and from which documents they are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[y(156,"Semantic highlighting enabled for all color themes."),y(157,"Semantic highlighting disabled for all color themes."),y(158,"Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:y(159,"Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:y(160,"Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:y(161,"Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!0,description:y(162,"Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:y(163,"Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:y(164,"Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.experimental.treeSitterTelemetry":{type:"boolean",default:!1,markdownDescription:y(165,"Controls whether tree sitter parsing should be turned on and telemetry collected. Setting `#editor.experimental.preferTreeSitter#` for specific languages will take precedence."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.css":{type:"boolean",default:!1,markdownDescription:y(166,"Controls whether tree sitter parsing should be turned on for css. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for css."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.typescript":{type:"boolean",default:!1,markdownDescription:y(167,"Controls whether tree sitter parsing should be turned on for typescript. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for typescript."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.ini":{type:"boolean",default:!1,markdownDescription:y(168,"Controls whether tree sitter parsing should be turned on for ini. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for ini."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.regex":{type:"boolean",default:!1,markdownDescription:y(169,"Controls whether tree sitter parsing should be turned on for regex. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for regex."),tags:["experimental"],experiment:{mode:"auto"}},"editor.language.brackets":{type:["array","null"],default:null,description:y(170,"Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:y(171,"The opening bracket character or string sequence.")},{type:"string",description:y(172,"The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:y(173,"Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:y(174,"The opening bracket character or string sequence.")},{type:"string",description:y(175,"The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:AO.maxComputationTime,description:y(176,"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:AO.maxFileSize,description:y(177,"Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:AO.renderSideBySide,description:y(178,"Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:AO.renderSideBySideInlineBreakpoint,description:y(179,"If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:AO.useInlineViewWhenSpaceIsLimited,description:y(180,"If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:AO.renderMarginRevertIcon,description:y(181,"When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.renderGutterMenu":{type:"boolean",default:AO.renderGutterMenu,description:y(182,"When enabled, the diff editor shows a special gutter for revert and stage actions.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:AO.ignoreTrimWhitespace,description:y(183,"When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:AO.renderIndicators,description:y(184,"Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:AO.diffCodeLens,description:y(185,"Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:AO.diffWordWrap,markdownEnumDescriptions:[y(186,"Lines will never wrap."),y(187,"Lines will wrap at the viewport width."),y(188,"Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:AO.diffAlgorithm,markdownEnumDescriptions:[y(189,"Uses the legacy diffing algorithm."),y(190,"Uses the advanced diffing algorithm.")]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:AO.hideUnchangedRegions.enabled,markdownDescription:y(191,"Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:AO.hideUnchangedRegions.revealLineCount,markdownDescription:y(192,"Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:AO.hideUnchangedRegions.minimumLineCount,markdownDescription:y(193,"Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:AO.hideUnchangedRegions.contextLineCount,markdownDescription:y(194,"Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:AO.experimental.showMoves,markdownDescription:y(195,"Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:AO.experimental.showEmptyDecorations,description:y(196,"Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")},"diffEditor.experimental.useTrueInlineView":{type:"boolean",default:AO.experimental.useTrueInlineView,description:y(197,"If enabled and the editor uses the inline view, word changes are rendered inline.")}}};function yP(e){return void 0!==e.type||void 0!==e.anyOf}for(const e of _P){const t=e.schema;if(void 0!==t)if(yP(t))CP.properties[`editor.${e.name}`]=t;else for(const e in t)Object.hasOwnProperty.call(t,e)&&(CP.properties[e]=t[e])}let SP=null;function xP(){return null===SP&&(SP=Object.create(null),Object.keys(CP.properties).forEach((e=>{SP[e]=!0}))),SP}ru.as(kp).registerConfiguration(CP);const kP=oc("accessibilitySignalService");Symbol("AcknowledgeDocCommentsToken");class LP{static register(e){return new LP(e.fileName)}static{this.error=LP.register({fileName:"error.mp3"})}static{this.warning=LP.register({fileName:"warning.mp3"})}static{this.success=LP.register({fileName:"success.mp3"})}static{this.foldedArea=LP.register({fileName:"foldedAreas.mp3"})}static{this.break=LP.register({fileName:"break.mp3"})}static{this.quickFixes=LP.register({fileName:"quickFixes.mp3"})}static{this.taskCompleted=LP.register({fileName:"taskCompleted.mp3"})}static{this.taskFailed=LP.register({fileName:"taskFailed.mp3"})}static{this.terminalBell=LP.register({fileName:"terminalBell.mp3"})}static{this.diffLineInserted=LP.register({fileName:"diffLineInserted.mp3"})}static{this.diffLineDeleted=LP.register({fileName:"diffLineDeleted.mp3"})}static{this.diffLineModified=LP.register({fileName:"diffLineModified.mp3"})}static{this.requestSent=LP.register({fileName:"requestSent.mp3"})}static{this.responseReceived1=LP.register({fileName:"responseReceived1.mp3"})}static{this.responseReceived2=LP.register({fileName:"responseReceived2.mp3"})}static{this.responseReceived3=LP.register({fileName:"responseReceived3.mp3"})}static{this.responseReceived4=LP.register({fileName:"responseReceived4.mp3"})}static{this.clear=LP.register({fileName:"clear.mp3"})}static{this.save=LP.register({fileName:"save.mp3"})}static{this.format=LP.register({fileName:"format.mp3"})}static{this.voiceRecordingStarted=LP.register({fileName:"voiceRecordingStarted.mp3"})}static{this.voiceRecordingStopped=LP.register({fileName:"voiceRecordingStopped.mp3"})}static{this.progress=LP.register({fileName:"progress.mp3"})}static{this.chatEditModifiedFile=LP.register({fileName:"chatEditModifiedFile.mp3"})}static{this.editsKept=LP.register({fileName:"editsKept.mp3"})}static{this.editsUndone=LP.register({fileName:"editsUndone.mp3"})}static{this.nextEditSuggestion=LP.register({fileName:"nextEditSuggestion.mp3"})}static{this.terminalCommandSucceeded=LP.register({fileName:"terminalCommandSucceeded.mp3"})}static{this.chatUserActionRequired=LP.register({fileName:"chatUserActionRequired.mp3"})}static{this.codeActionTriggered=LP.register({fileName:"codeActionTriggered.mp3"})}static{this.codeActionApplied=LP.register({fileName:"codeActionApplied.mp3"})}constructor(e){this.fileName=e}}class DP{constructor(e){this.randomOneOf=e}}class EP{constructor(e,t,i,n,o,s,r=!1){this.sound=e,this.name=t,this.legacySoundSettingsKey=i,this.settingsKey=n,this.legacyAnnouncementSettingsKey=o,this.announcementMessage=s,this.managesOwnEnablement=r}static{this._signals=new Set}static register(e){const t=new DP("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new EP(t,e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage,e.managesOwnEnablement);return EP._signals.add(i),i}static{this.errorAtPosition=EP.register({name:y(1561,"Error at Position"),sound:LP.error,announcementMessage:y(1562,"Error"),settingsKey:"accessibility.signals.positionHasError",delaySettingsKey:"accessibility.signalOptions.delays.errorAtPosition"})}static{this.warningAtPosition=EP.register({name:y(1563,"Warning at Position"),sound:LP.warning,announcementMessage:y(1564,"Warning"),settingsKey:"accessibility.signals.positionHasWarning",delaySettingsKey:"accessibility.signalOptions.delays.warningAtPosition"})}static{this.errorOnLine=EP.register({name:y(1565,"Error on Line"),sound:LP.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:y(1566,"Error on Line"),settingsKey:"accessibility.signals.lineHasError"})}static{this.warningOnLine=EP.register({name:y(1567,"Warning on Line"),sound:LP.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:y(1568,"Warning on Line"),settingsKey:"accessibility.signals.lineHasWarning"})}static{this.foldedArea=EP.register({name:y(1569,"Folded Area on Line"),sound:LP.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:y(1570,"Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"})}static{this.break=EP.register({name:y(1571,"Breakpoint on Line"),sound:LP.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:y(1572,"Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"})}static{this.inlineSuggestion=EP.register({name:y(1573,"Inline Suggestion on Line"),sound:LP.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"})}static{this.nextEditSuggestion=EP.register({name:y(1574,"Next Edit Suggestion on Line"),sound:LP.nextEditSuggestion,legacySoundSettingsKey:"audioCues.nextEditSuggestion",settingsKey:"accessibility.signals.nextEditSuggestion",announcementMessage:y(1575,"Next Edit Suggestion")})}static{this.terminalQuickFix=EP.register({name:y(1576,"Terminal Quick Fix"),sound:LP.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:y(1577,"Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"})}static{this.onDebugBreak=EP.register({name:y(1578,"Debugger Stopped on Breakpoint"),sound:LP.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:y(1579,"Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"})}static{this.noInlayHints=EP.register({name:y(1580,"No Inlay Hints on Line"),sound:LP.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:y(1581,"No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"})}static{this.taskCompleted=EP.register({name:y(1582,"Task Completed"),sound:LP.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:y(1583,"Task Completed"),settingsKey:"accessibility.signals.taskCompleted"})}static{this.taskFailed=EP.register({name:y(1584,"Task Failed"),sound:LP.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:y(1585,"Task Failed"),settingsKey:"accessibility.signals.taskFailed"})}static{this.terminalCommandFailed=EP.register({name:y(1586,"Terminal Command Failed"),sound:LP.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:y(1587,"Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"})}static{this.terminalCommandSucceeded=EP.register({name:y(1588,"Terminal Command Succeeded"),sound:LP.terminalCommandSucceeded,announcementMessage:y(1589,"Command Succeeded"),settingsKey:"accessibility.signals.terminalCommandSucceeded"})}static{this.terminalBell=EP.register({name:y(1590,"Terminal Bell"),sound:LP.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:y(1591,"Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"})}static{this.notebookCellCompleted=EP.register({name:y(1592,"Notebook Cell Completed"),sound:LP.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:y(1593,"Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"})}static{this.notebookCellFailed=EP.register({name:y(1594,"Notebook Cell Failed"),sound:LP.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:y(1595,"Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"})}static{this.diffLineInserted=EP.register({name:y(1596,"Diff Line Inserted"),sound:LP.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"})}static{this.diffLineDeleted=EP.register({name:y(1597,"Diff Line Deleted"),sound:LP.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"})}static{this.diffLineModified=EP.register({name:y(1598,"Diff Line Modified"),sound:LP.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"})}static{this.chatEditModifiedFile=EP.register({name:y(1599,"Chat Edit Modified File"),sound:LP.chatEditModifiedFile,announcementMessage:y(1600,"File Modified from Chat Edits"),settingsKey:"accessibility.signals.chatEditModifiedFile"})}static{this.chatRequestSent=EP.register({name:y(1601,"Chat Request Sent"),sound:LP.requestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:y(1602,"Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"})}static{this.chatResponseReceived=EP.register({name:y(1603,"Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[LP.responseReceived1,LP.responseReceived2,LP.responseReceived3,LP.responseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"})}static{this.codeActionTriggered=EP.register({name:y(1604,"Code Action Request Triggered"),sound:LP.codeActionTriggered,legacySoundSettingsKey:"audioCues.codeActionRequestTriggered",legacyAnnouncementSettingsKey:"accessibility.alert.codeActionRequestTriggered",announcementMessage:y(1605,"Code Action Request Triggered"),settingsKey:"accessibility.signals.codeActionTriggered"})}static{this.codeActionApplied=EP.register({name:y(1606,"Code Action Applied"),legacySoundSettingsKey:"audioCues.codeActionApplied",sound:LP.codeActionApplied,settingsKey:"accessibility.signals.codeActionApplied"})}static{this.progress=EP.register({name:y(1607,"Progress"),sound:LP.progress,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.progress",announcementMessage:y(1608,"Progress"),settingsKey:"accessibility.signals.progress"})}static{this.clear=EP.register({name:y(1609,"Clear"),sound:LP.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:y(1610,"Clear"),settingsKey:"accessibility.signals.clear"})}static{this.save=EP.register({name:y(1611,"Save"),sound:LP.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:y(1612,"Save"),settingsKey:"accessibility.signals.save"})}static{this.format=EP.register({name:y(1613,"Format"),sound:LP.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:y(1614,"Format"),settingsKey:"accessibility.signals.format"})}static{this.voiceRecordingStarted=EP.register({name:y(1615,"Voice Recording Started"),sound:LP.voiceRecordingStarted,legacySoundSettingsKey:"audioCues.voiceRecordingStarted",settingsKey:"accessibility.signals.voiceRecordingStarted"})}static{this.voiceRecordingStopped=EP.register({name:y(1616,"Voice Recording Stopped"),sound:LP.voiceRecordingStopped,legacySoundSettingsKey:"audioCues.voiceRecordingStopped",settingsKey:"accessibility.signals.voiceRecordingStopped"})}static{this.editsKept=EP.register({name:y(1617,"Edits Kept"),sound:LP.editsKept,announcementMessage:y(1618,"Edits Kept"),settingsKey:"accessibility.signals.editsKept"})}static{this.editsUndone=EP.register({name:y(1619,"Undo Edits"),sound:LP.editsUndone,announcementMessage:y(1620,"Edits Undone"),settingsKey:"accessibility.signals.editsUndone"})}static{this.chatUserActionRequired=EP.register({name:y(1621,"Chat User Action Required"),sound:LP.chatUserActionRequired,announcementMessage:y(1622,"Chat User Action Required"),settingsKey:"accessibility.signals.chatUserActionRequired",managesOwnEnablement:!0})}}const NP=new class{constructor(){this.QuickFix=new _D("quickfix"),this.Refactor=new _D("refactor"),this.RefactorExtract=this.Refactor.append("extract"),this.RefactorInline=this.Refactor.append("inline"),this.RefactorMove=this.Refactor.append("move"),this.RefactorRewrite=this.Refactor.append("rewrite"),this.Notebook=new _D("notebook"),this.Source=new _D("source"),this.SourceOrganizeImports=this.Source.append("organizeImports"),this.SourceFixAll=this.Source.append("fixAll"),this.SurroundWith=this.Refactor.append("surround")}};var IP;function TP(e,t,i){return!(!t.contains(e)||i&&t.contains(i))}!function(e){e.Refactor="refactor",e.RefactorPreview="refactor preview",e.Lightbulb="lightbulb",e.Default="other (default)",e.SourceAction="source action",e.QuickFix="quick fix action",e.FixAll="fix all",e.OrganizeImports="organize imports",e.AutoFix="auto fix",e.QuickFixHover="quick fix hover window",e.OnSave="save participants",e.ProblemsView="problems view"}(IP||(IP={}));class MP{static fromUser(e,t){return e&&"object"==typeof e?new MP(MP.getKindFromUser(e,t.kind),MP.getApplyFromUser(e,t.apply),MP.getPreferredUser(e)):new MP(t.kind,t.apply,!1)}static getApplyFromUser(e,t){switch("string"==typeof e.apply?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return"string"==typeof e.kind?new _D(e.kind):t}static getPreferredUser(e){return"boolean"==typeof e.preferred&&e.preferred}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class AP{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}async resolve(e){if(this.provider?.resolveCodeAction&&!this.action.edit){let t;try{t=await this.provider.resolveCodeAction(this.action,e)}catch(e){Te(e)}t&&(this.action.edit=t.edit)}return this}}const RP="editor.action.codeAction",OP="editor.action.quickFix",PP="editor.action.autoFix",FP="editor.action.refactor",BP="editor.action.sourceAction",WP="editor.action.organizeImports",VP="editor.action.fixAll";class HP extends At{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return e.isAI&&!t.isAI?1:!e.isAI&&t.isAI?-1:hs(e.diagnostics)?hs(t.diagnostics)?HP.codeActionsPreferredComparator(e,t):-1:hs(t.diagnostics)?1:HP.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(HP.codeActionsComparator),this.validActions=this.allActions.filter((({action:e})=>!e.disabled))}get hasAutoFix(){return this.validActions.some((({action:e})=>!!e.kind&&NP.QuickFix.contains(new _D(e.kind))&&!!e.isPreferred))}get hasAIFix(){return this.validActions.some((({action:e})=>!!e.isAI))}get allAIFixes(){return this.validActions.every((({action:e})=>!!e.isAI))}}const zP={actions:[],documentation:void 0};async function UP(e,t,i,n,o,s){const r=n.filter||{},a={...r,excludes:[...r.excludes||[],NP.Notebook]},l={only:r.include?.value,trigger:n.type},d=new KD(t,s),h=2===n.type,c=function(e,t,i){return e.all(t).filter((e=>!e.providedCodeActionKinds||e.providedCodeActionKinds.some((e=>function(e,t){return!(e.include&&!e.include.intersects(t)||e.excludes&&e.excludes.some((i=>TP(t,i,e.include)))||!e.includeSourceActions&&NP.Source.contains(t))}(i,new _D(e))))))}(e,t,h?a:r),u=new Mt,g=c.map((async e=>{const n=setTimeout((()=>o.report(e)),1250);try{const n=await e.provideCodeActions(t,i,l,d.token);if(d.token.isCancellationRequested)return n?.dispose(),zP;n&&u.add(n);const o=(n?.actions||[]).filter((e=>e&&function(e,t){const i=t.kind?new _D(t.kind):void 0;return!(!(!e.include||i&&e.include.contains(i))||e.excludes&&i&&e.excludes.some((t=>TP(i,t,e.include)))||!e.includeSourceActions&&i&&NP.Source.contains(i)||e.onlyIncludePreferredActions&&!t.isPreferred)}(r,e))),s=function(e,t,i){if(!e.documentation)return;const n=e.documentation.map((e=>({kind:new _D(e.kind),command:e.command})));if(i){let e;for(const t of n)t.kind.contains(i)&&(e?e.kind.contains(t.kind)&&(e=t):e=t);if(e)return e?.command}for(const e of t)if(e.kind)for(const t of n)if(t.kind.contains(new _D(e.kind)))return t.command}(e,o,r.include);return{actions:o.map((t=>new AP(t,e))),documentation:s}}catch(e){if(Re(e))throw e;return Te(e),zP}finally{clearTimeout(n)}})),p=e.onDidChange((()=>{es(e.all(t),c)||d.cancel()}));try{const i=await Promise.all(g),o=i.map((e=>e.actions)).flat(),s=[...as(i.map((e=>e.documentation))),...KP(e,t,n,o)],r=new HP(o,s,u);return u.add(r),r}catch(e){throw u.dispose(),e}finally{p.dispose(),d.dispose()}}function*KP(e,t,i,n){if(t&&n.length)for(const o of e.all(t))o._getAdditionalMenuItems&&(yield*o._getAdditionalMenuItems?.({trigger:i.type,only:i.filter?.include?.value},n.map((e=>e.action))))}var jP,qP,$P;async function GP(e,t,i,n,o=oi.None){const s=e.get(RD),r=e.get(mc),a=e.get(Cu),l=e.get(lO),d=e.get(kP);if(a.publicLog2("codeAction.applyCodeAction",{codeActionTitle:t.action.title,codeActionKind:t.action.kind,codeActionIsPreferred:!!t.action.isPreferred,reason:i}),d.playSignal(EP.codeActionTriggered),await t.resolve(o),!o.isCancellationRequested){if(t.action.edit?.edits.length&&!(await s.apply(t.action.edit,{editor:n?.editor,label:t.action.title,quotableLabel:t.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:i!==jP.OnSave,showPreview:n?.preview,reason:MC({kind:t.action.kind,providerId:KS.fromExtensionId(t.provider?.extensionId)})})).isApplied)return;if(t.action.command)try{await r.executeCommand(t.action.command.id,...t.action.command.arguments||[])}catch(e){const t=function(e){return"string"==typeof e?e:e instanceof Error&&"string"==typeof e.message?e.message:void 0}(e);l.error("string"==typeof t?t:y(826,"An unknown error occurred while applying the code action"))}setTimeout((()=>d.playSignal(EP.codeActionApplied)),1e3)}}!function(e){e.OnSave="onSave",e.FromProblemsView="fromProblemsView",e.FromCodeActions="fromCodeActions",e.FromAILightbulb="fromAILightbulb",e.FromProblemsHover="fromProblemsHover"}(jP||(jP={})),fc.registerCommand("_executeCodeActionProvider",(async function(e,t,i,n,o){if(!(t instanceof uo))throw Pe();const{codeActionProvider:s}=e.get(BD),r=e.get(ac).getModel(t);if(!r)throw Pe();const a=Qu.isISelection(i)?Qu.liftSelection(i):Yu.isIRange(i)?r.validateRange(i):void 0;if(!a)throw Pe();const l="string"==typeof n?new _D(n):void 0,d=await UP(s,r,a,{type:1,triggerAction:IP.Default,filter:{includeSourceActions:!0,include:l}},bD.None,oi.None),h=[],c=Math.min(d.validActions.length,"number"==typeof o?o:0);for(let e=0;e<c;e++)h.push(d.validActions[e].resolve(oi.None));try{return await Promise.all(h),d.validActions.map((e=>e.action))}finally{setTimeout((()=>d.dispose()),100)}})),function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"}(qP||(qP={})),function(e){e.compare=function(e,t){return t-e};const t=Object.create(null);t[e.Error]=y(1715,"Error"),t[e.Warning]=y(1716,"Warning"),t[e.Info]=y(1717,"Info"),e.toString=function(e){return t[e]||""};const i=Object.create(null);i[e.Error]=y(1718,"Errors"),i[e.Warning]=y(1719,"Warnings"),i[e.Info]=y(1720,"Infos"),e.toStringPlural=function(e){return i[e]||""},e.fromSeverity=function(t){switch(t){case rO.Error:return e.Error;case rO.Warning:return e.Warning;case rO.Info:return e.Info;case rO.Ignore:return e.Hint}},e.toSeverity=function(t){switch(t){case e.Error:return rO.Error;case e.Warning:return rO.Warning;case e.Info:return rO.Info;case e.Hint:return rO.Ignore}}}(qP||(qP={})),function(e){const t="";function i(e,i){const n=[t];return e.source?n.push(e.source.replace("¦","\\¦")):n.push(t),e.code?"string"==typeof e.code?n.push(e.code.replace("¦","\\¦")):n.push(e.code.value.replace("¦","\\¦")):n.push(t),void 0!==e.severity&&null!==e.severity?n.push(qP.toString(e.severity)):n.push(t),e.message&&i?n.push(e.message.replace("¦","\\¦")):n.push(t),void 0!==e.startLineNumber&&null!==e.startLineNumber?n.push(e.startLineNumber.toString()):n.push(t),void 0!==e.startColumn&&null!==e.startColumn?n.push(e.startColumn.toString()):n.push(t),void 0!==e.endLineNumber&&null!==e.endLineNumber?n.push(e.endLineNumber.toString()):n.push(t),void 0!==e.endColumn&&null!==e.endColumn?n.push(e.endColumn.toString()):n.push(t),n.push(t),n.join("¦")}e.makeKey=function(e){return i(e,!0)},e.makeKeyOptionalMessage=i}($P||($P={}));const ZP=oc("markerService");var YP;let QP=class{static{YP=this}static{this.codeActionCommands=[FP,RP,BP,WP,VP]}constructor(e){this.keybindingService=e}getResolver(){const e=new Oi((()=>this.keybindingService.getKeybindings().filter((e=>YP.codeActionCommands.indexOf(e.command)>=0)).filter((e=>e.resolvedKeybinding)).map((e=>{let t=e.commandArgs;return e.command===WP?t={kind:NP.SourceOrganizeImports.value}:e.command===VP&&(t={kind:NP.SourceFixAll.value}),{resolvedKeybinding:e.resolvedKeybinding,...MP.fromUser(t,{kind:_D.None,apply:"never"})}}))));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.value);return i?.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new _D(e.kind);return t.filter((e=>e.kind.contains(i))).filter((t=>!t.preferred||e.isPreferred)).reduceRight(((e,t)=>e?e.kind.contains(t.kind)?t:e:t),void 0)}};QP=YP=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,ER)],QP);var XP=i(2171),JP={};JP.styleTagTransform=zl(),JP.setAttributes=Bl(),JP.insert=Pl().bind(null,"head"),JP.domAPI=Rl(),JP.insertStyleElement=Vl(),Ml()(XP.A,JP),XP.A&&XP.A.locals&&XP.A.locals;var eF=i(714),tF={};tF.styleTagTransform=zl(),tF.setAttributes=Bl(),tF.insert=Pl().bind(null,"head"),tF.domAPI=Rl(),tF.insertStyleElement=Vl(),Ml()(eF.A,tF),eF.A&&eF.A.locals&&eF.A.locals;var iF=i(1029),nF={};nF.styleTagTransform=zl(),nF.setAttributes=Bl(),nF.insert=Pl().bind(null,"head"),nF.domAPI=Rl(),nF.insertStyleElement=Vl(),Ml()(iF.A,nF),iF.A&&iF.A.locals&&iF.A.locals,Ff("symbolIcon.arrayForeground",$f,y(1480,"The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.booleanForeground",$f,y(1481,"The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},y(1482,"The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.colorForeground",$f,y(1483,"The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.constantForeground",$f,y(1484,"The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},y(1485,"The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},y(1486,"The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},y(1487,"The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},y(1488,"The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},y(1489,"The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.fileForeground",$f,y(1490,"The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.folderForeground",$f,y(1491,"The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},y(1492,"The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},y(1493,"The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.keyForeground",$f,y(1494,"The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.keywordForeground",$f,y(1495,"The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},y(1496,"The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.moduleForeground",$f,y(1497,"The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.namespaceForeground",$f,y(1498,"The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.nullForeground",$f,y(1499,"The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.numberForeground",$f,y(1500,"The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.objectForeground",$f,y(1501,"The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.operatorForeground",$f,y(1502,"The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.packageForeground",$f,y(1503,"The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.propertyForeground",$f,y(1504,"The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.referenceForeground",$f,y(1505,"The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.snippetForeground",$f,y(1506,"The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.stringForeground",$f,y(1507,"The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.structForeground",$f,y(1508,"The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.textForeground",$f,y(1509,"The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.typeParameterForeground",$f,y(1510,"The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.unitForeground",$f,y(1511,"The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ff("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},y(1512,"The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const oF=Object.freeze({kind:_D.Empty,title:y(862,"More Actions...")}),sF=Object.freeze([{kind:NP.QuickFix,title:y(863,"Quick Fix")},{kind:NP.RefactorExtract,title:y(864,"Extract"),icon:fh.wrench},{kind:NP.RefactorInline,title:y(865,"Inline"),icon:fh.wrench},{kind:NP.RefactorRewrite,title:y(866,"Rewrite"),icon:fh.wrench},{kind:NP.RefactorMove,title:y(867,"Move"),icon:fh.wrench},{kind:NP.SurroundWith,title:y(868,"Surround With"),icon:fh.surroundWith},{kind:NP.Source,title:y(869,"Source Action"),icon:fh.symbolFile},oF]),rF=new Jc("supportedCodeAction",""),aF="_typescript.applyFixAllCodeAction";class lF extends At{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new bi),this._register(this._markerService.onMarkerChanged((e=>this._onMarkerChanges(e)))),this._register(this._editor.onDidChangeCursorPosition((()=>this._tryAutoTrigger())))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some((e=>Ph(e,t.uri)))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet((()=>{this.trigger({type:2,triggerAction:IP.Default})}),this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getSelection();if(1===e.type)return t;const i=this._editor.getOption(73).enabled;if(i!==XO.Off){if(i===XO.On)return t;if(i===XO.OnCode){if(!t.isEmpty())return t;const e=this._editor.getModel(),{lineNumber:i,column:n}=t.getPosition(),o=e.getLineContent(i);if(0===o.length)return;if(1===n){if(/\s/.test(o[0]))return}else if(n===e.getLineMaxColumn(i)){if(/\s/.test(o[o.length-1]))return}else if(/\s/.test(o[n-2])&&/\s/.test(o[n-1]))return}return t}}}var dF;!function(e){e.Empty={type:0},e.Triggered=class{constructor(e,t,i){this.trigger=e,this.position=t,this._cancellablePromise=i,this.type=1,this.actions=i.catch((e=>{if(Re(e))return hF;throw e}))}cancel(){this._cancellablePromise.cancel()}}}(dF||(dF={}));const hF=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class cF extends At{constructor(e,t,i,n,o,s){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=o,this._configurationService=s,this._codeActionOracle=this._register(new Rt),this._state=dF.Empty,this._onDidChangeState=this._register(new Zt),this.onDidChangeState=this._onDidChangeState.event,this.codeActionsDisposable=this._register(new Rt),this._disposed=!1,this._supportedCodeActions=rF.bindTo(n),this._register(this._editor.onDidChangeModel((()=>this._update()))),this._register(this._editor.onDidChangeModelLanguage((()=>this._update()))),this._register(this._registry.onDidChange((()=>this._update()))),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(73)&&this._update()}))),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(dF.Empty,!0))}_settingEnabledNearbyQuickfixes(){const e=this._editor?.getModel();return!!this._configurationService&&this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:e?.uri})}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(dF.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(104)){const t=this._registry.all(e).flatMap((e=>e.providedCodeActionKinds??[]));this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new lF(this._editor,this._markerService,(t=>{if(!t)return void this.setState(dF.Empty);const i=t.selection.getStartPosition(),n=hi((async i=>{if(this._settingEnabledNearbyQuickfixes()&&1===t.trigger.type&&(t.trigger.triggerAction===IP.QuickFix||t.trigger.filter?.include?.contains(NP.QuickFix))){const n=await UP(this._registry,e,t.selection,t.trigger,bD.None,i);this.codeActionsDisposable.value=n;const o=[...n.allActions];if(i.isCancellationRequested)return n.dispose(),hF;const s=n.validActions?.some((e=>e.action.kind&&NP.QuickFix.contains(new _D(e.action.kind))&&!e.action.isAI)),r=this._markerService.read({resource:e.uri});if(s){for(const e of n.validActions)e.action.command?.arguments?.some((e=>"string"==typeof e&&e.includes(aF)))&&(e.action.diagnostics=[...r.filter((e=>e.relatedInformation))]);return{validActions:n.validActions,allActions:o,documentation:n.documentation,hasAutoFix:n.hasAutoFix,hasAIFix:n.hasAIFix,allAIFixes:n.allAIFixes,dispose:()=>{this.codeActionsDisposable.value=n}}}if(!s&&r.length>0){const s=t.selection.getPosition();let a=s,l=Number.MAX_VALUE;const d=[...n.validActions];for(const h of r){const c=h.endColumn,u=h.endLineNumber,g=h.startLineNumber;if(u===s.lineNumber||g===s.lineNumber){a=new rc(u,c);const h={type:t.trigger.type,triggerAction:t.trigger.triggerAction,filter:{include:t.trigger.filter?.include?t.trigger.filter?.include:NP.QuickFix},autoApply:t.trigger.autoApply,context:{notAvailableMessage:t.trigger.context?.notAvailableMessage||"",position:a}},g=new Qu(a.lineNumber,a.column,a.lineNumber,a.column),p=await UP(this._registry,e,g,h,bD.None,i);if(i.isCancellationRequested)return p.dispose(),hF;if(0!==p.validActions.length){for(const e of p.validActions)e.action.command?.arguments?.some((e=>"string"==typeof e&&e.includes(aF)))&&(e.action.diagnostics=[...r.filter((e=>e.relatedInformation))]);0===n.allActions.length&&o.push(...p.allActions),Math.abs(s.column-c)<l?d.unshift(...p.validActions):d.push(...p.validActions)}l=Math.abs(s.column-c)}}const h=d.filter(((e,t,i)=>i.findIndex((t=>t.action.title===e.action.title))===t));return h.sort(((e,t)=>e.action.isPreferred&&!t.action.isPreferred?-1:!e.action.isPreferred&&t.action.isPreferred||e.action.isAI&&!t.action.isAI?1:!e.action.isAI&&t.action.isAI?-1:0)),{validActions:h,allActions:o,documentation:n.documentation,hasAutoFix:n.hasAutoFix,hasAIFix:n.hasAIFix,allAIFixes:n.allAIFixes,dispose:()=>{this.codeActionsDisposable.value=n}}}}if(1===t.trigger.type){const n=await UP(this._registry,e,t.selection,t.trigger,bD.None,i);return this.codeActionsDisposable.value=n,n}const n=await UP(this._registry,e,t.selection,t.trigger,bD.None,i);return this.codeActionsDisposable.value=n,n}));1===t.trigger.type&&this._progressService?.showWhile(n,250);const o=new dF.Triggered(t.trigger,i,n);let s=!1;1===this._state.type&&(s=1===this._state.trigger.type&&1===o.type&&2===o.trigger.type&&this._state.position!==o.position),s?setTimeout((()=>{this.setState(o)}),500):this.setState(o)}),void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:IP.Default})}else this._supportedCodeActions.reset()}trigger(e){this._codeActionOracle.value?.trigger(e),this.codeActionsDisposable.dispose()}setState(e,t){e!==this._state&&(1===this._state.type&&this._state.cancel(),this._state=e,t||this._disposed||this._onDidChangeState.fire(e))}}var uF,gF,pF=i(4169),mF={};mF.styleTagTransform=zl(),mF.setAttributes=Bl(),mF.insert=Pl().bind(null,"head"),mF.domAPI=Rl(),mF.insertStyleElement=Vl(),Ml()(pF.A,mF),pF.A&&pF.A.locals&&pF.A.locals,function(e){e.getDefinition=function(e,t){let i=e.defaults;for(;vh.isThemeIcon(i);){const e=vF.getIcon(i.id);if(!e)return;i=e.defaults}return i}}(uF||(uF={})),function(e){e.toJSONObject=function(e){return{weight:e.weight,style:e.style,src:e.src.map((e=>({format:e.format,location:e.location.toString()})))}},e.fromJSONObject=function(e){const t=e=>lt(e)?e:void 0;if(e&&Array.isArray(e.src)&&e.src.every((e=>lt(e.format)&<(e.location))))return{weight:t(e.weight),style:t(e.style),src:e.src.map((e=>({format:e.format,location:uo.parse(e.location)})))}}}(gF||(gF={}));const fF=/^([\w_-]+)$/,_F=y(2006,"The font ID must only contain letters, numbers, underscores and dashes."),vF=new class extends At{constructor(){super(),this._onDidChange=this._register(new Zt),this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:y(2007,"The id of the font to use. If not set, the font that is defined first is used."),pattern:fF.source,patternErrorMessage:_F},fontCharacter:{type:"string",description:y(2008,"The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${vh.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,n){const o=this.iconsById[e];if(o){if(i&&!o.description){o.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const t=this.iconReferenceSchema.enum.indexOf(e);-1!==t&&(this.iconReferenceSchema.enumDescriptions[t]=i),this._onDidChange.fire()}return o}const s={id:e,description:i,defaults:t,deprecationMessage:n};this.iconsById[e]=s;const r={$ref:"#/definitions/icons"};return n&&(r.deprecationMessage=n),i&&(r.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=r,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map((e=>this.iconsById[e]))}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(e,t)=>e.id.localeCompare(t.id),t=e=>{for(;vh.isThemeIcon(e.defaults);)e=this.iconsById[e.defaults.id];return`codicon codicon-${e?e.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const n=Object.keys(this.iconsById).map((e=>this.iconsById[e]));for(const o of n.filter((e=>!!e.description)).sort(e))i.push(`|<i class="${t(o)}"></i>|${o.id}|${vh.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of n.filter((e=>!vh.isThemeIcon(e.defaults))).sort(e))i.push(`|<i class="${t(o)}"></i>|${o.id}|`);return i.join("\n")}};function bF(e,t,i,n){return vF.registerIcon(e,t,i,n)}function wF(){return vF}ru.add("base.contributions.icons",vF),function(){const e=mh();for(const t in e){const i="\\"+e[t].toString(16);vF.registerIcon(t,{fontCharacter:i})}}();const CF="vscode://schemas/icons",yF=ru.as(Sp);yF.registerSchema(CF,vF.getIconSchema());const SF=new Ci((()=>yF.notifySchemaChanged(CF)),200);vF.onDidChange((()=>{SF.isScheduled()||SF.schedule()}));const xF=bF("widget-close",fh.close,y(2009,"Icon for the close action in widgets."));bF("goto-previous-location",fh.arrowUp,y(2010,"Icon for goto previous editor location.")),bF("goto-next-location",fh.arrowDown,y(2011,"Icon for goto next editor location.")),vh.modify(fh.sync,"spin"),vh.modify(fh.loading,"spin");var kF;const LF=bF("gutter-lightbulb",fh.lightBulb,y(870,"Icon which spawns code actions menu from the gutter when there is no space in the editor.")),DF=bF("gutter-lightbulb-auto-fix",fh.lightbulbAutofix,y(871,"Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.")),EF=bF("gutter-lightbulb-sparkle",fh.lightbulbSparkle,y(872,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.")),NF=bF("gutter-lightbulb-aifix-auto-fix",fh.lightbulbSparkleAutofix,y(873,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.")),IF=bF("gutter-lightbulb-sparkle-filled",fh.sparkleFilled,y(874,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available."));var TF;!function(e){e.Hidden={type:0},e.Showing=class{constructor(e,t,i,n){this.actions=e,this.trigger=t,this.editorPosition=i,this.widgetPosition=n,this.type=1}}}(TF||(TF={}));let MF=class extends At{static{kF=this}static{this.GUTTER_DECORATION=bk.register({description:"codicon-gutter-lightbulb-decoration",glyphMarginClassName:vh.asClassName(fh.lightBulb),glyphMargin:{position:gg.Left},stickiness:1})}static{this.ID="editor.contrib.lightbulbWidget"}static{this._posPref=[0]}constructor(e,t){var i,n;super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new Zt),this.onClick=this._onClick.event,this._state=TF.Hidden,this._gutterState=TF.Hidden,this._iconClasses=[],this.lightbulbClasses=["codicon-"+LF.id,"codicon-"+NF.id,"codicon-"+DF.id,"codicon-"+EF.id,"codicon-"+IF.id],this.gutterDecoration=kF.GUTTER_DECORATION,this._domNode=ll("div.lightBulbWidget"),this._domNode.role="listbox",this._register(JT.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent((e=>{const t=this._editor.getModel();(1!==this.state.type||!t||this.state.editorPosition.lineNumber>=t.getLineCount())&&this.hide(),(1!==this.gutterState.type||!t||this.gutterState.editorPosition.lineNumber>=t.getLineCount())&&this.gutterHide()}))),this._register((n=e=>{if(1!==this.state.type)return;this._editor.focus(),e.preventDefault();const{top:t,height:i}=Na(this._domNode),n=this._editor.getOption(75);let o=Math.floor(n/3);null!==this.state.widgetPosition.position&&this.state.widgetPosition.position.lineNumber<this.state.editorPosition.lineNumber&&(o+=n),this._onClick.fire({x:e.posx,y:t+i+o,actions:this.state.actions,trigger:this.state.trigger})},fa(i=this._domNode,pa(ta(i),n),undefined))),this._register(ga(this._domNode,"mouseenter",(e=>{1&~e.buttons||this.hide()}))),this._register(zt.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,(()=>{this._preferredKbLabel=this._keybindingService.lookupKeybinding(PP)?.getLabel()??void 0,this._quickFixKbLabel=this._keybindingService.lookupKeybinding(OP)?.getLabel()??void 0,this._updateLightBulbTitleAndIcon()}))),this._register(this._editor.onMouseDown((async e=>{if(!e.target.element||!this.lightbulbClasses.some((t=>e.target.element&&e.target.element.classList.contains(t))))return;if(1!==this.gutterState.type)return;this._editor.focus();const{top:t,height:i}=Na(e.target.element),n=this._editor.getOption(75);let o=Math.floor(n/3);null!==this.gutterState.widgetPosition.position&&this.gutterState.widgetPosition.position.lineNumber<this.gutterState.editorPosition.lineNumber&&(o+=n),this._onClick.fire({x:e.event.posx,y:t+i+o,actions:this.gutterState.actions,trigger:this.gutterState.trigger})})))}dispose(){super.dispose(),this._editor.removeContentWidget(this),this._gutterDecorationID&&this._removeGutterDecoration(this._gutterDecorationID)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return 1===this._state.type?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.gutterHide(),this.hide();if(!this._editor.hasTextFocus())return this.gutterHide(),this.hide();if(!this._editor.getOptions().get(73).enabled)return this.gutterHide(),this.hide();const n=this._editor.getModel();if(!n)return this.gutterHide(),this.hide();const{lineNumber:o,column:s}=n.validatePosition(i),r=n.getOptions().tabSize,a=this._editor.getOptions().get(59),l=jC(n.getLineContent(o),r),d=a.spaceWidth*l>22,h=e=>e>2&&this._editor.getTopForLineNumber(e)===this._editor.getTopForLineNumber(e-1),c=this._editor.getLineDecorations(o);let u=!1;if(c)for(const e of c){const t=e.options.glyphMarginClassName;if(t&&!this.lightbulbClasses.some((e=>t.includes(e)))){u=!0;break}}let g=o,p=1;if(!d){const r=e=>{const t=n.getLineContent(e);return/^\s*$|^\s+/.test(t)||t.length<=p};if(o>1&&!h(o-1)){const s=o===n.getLineCount(),a=o>1&&r(o-1),l=!s&&r(o+1),d=r(o),h=!l&&!a;if(!(l||a||u))return this.gutterState=new TF.Showing(e,t,i,{position:{lineNumber:g,column:p},preference:kF._posPref}),this.renderGutterLightbub(),this.hide();a||s||a&&!d?g-=1:(l||h&&d)&&(g+=1)}else if(1!==o||o!==n.getLineCount()&&(r(o+1)||r(o))){if(o<n.getLineCount()&&!h(o+1))g+=1;else if(s*a.spaceWidth<22)return this.hide()}else{if(this.gutterState=new TF.Showing(e,t,i,{position:{lineNumber:g,column:p},preference:kF._posPref}),!u)return this.renderGutterLightbub(),this.hide();this.gutterHide()}p=/^\S\s*$/.test(n.getLineContent(g))?2:1}this.state=new TF.Showing(e,t,i,{position:{lineNumber:g,column:p},preference:kF._posPref}),this._gutterDecorationID&&(this._removeGutterDecoration(this._gutterDecorationID),this.gutterHide());const m=e.validActions;e.validActions[0].action.kind;m.length,this._editor.layoutContentWidget(this)}hide(){this.state!==TF.Hidden&&(this.state=TF.Hidden,this._editor.layoutContentWidget(this))}gutterHide(){this.gutterState!==TF.Hidden&&(this._gutterDecorationID&&this._removeGutterDecoration(this._gutterDecorationID),this.gutterState=TF.Hidden)}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}get gutterState(){return this._gutterState}set gutterState(e){this._gutterState=e,this._updateGutterLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){if(this._domNode.classList.remove(...this._iconClasses),this._iconClasses=[],1!==this.state.type)return;let e,t=!1;this.state.actions.allAIFixes?(e=fh.sparkleFilled,1===this.state.actions.validActions.length&&(t=!0)):e=this.state.actions.hasAutoFix?this.state.actions.hasAIFix?fh.lightbulbSparkleAutofix:fh.lightbulbAutofix:this.state.actions.hasAIFix?fh.lightbulbSparkle:fh.lightBulb,this._updateLightbulbTitle(this.state.actions.hasAutoFix,t),this._iconClasses=vh.asClassNameArray(e),this._domNode.classList.add(...this._iconClasses)}_updateGutterLightBulbTitleAndIcon(){if(1!==this.gutterState.type)return;let e,t=!1;this.gutterState.actions.allAIFixes?(e=IF,1===this.gutterState.actions.validActions.length&&(t=!0)):e=this.gutterState.actions.hasAutoFix?this.gutterState.actions.hasAIFix?NF:DF:this.gutterState.actions.hasAIFix?EF:LF,this._updateLightbulbTitle(this.gutterState.actions.hasAutoFix,t);const i=bk.register({description:"codicon-gutter-lightbulb-decoration",glyphMarginClassName:vh.asClassName(e),glyphMargin:{position:gg.Left},stickiness:1});this.gutterDecoration=i}renderGutterLightbub(){const e=this._editor.getSelection();e&&(void 0===this._gutterDecorationID?this._addGutterDecoration(e.startLineNumber):this._updateGutterDecoration(this._gutterDecorationID,e.startLineNumber))}_addGutterDecoration(e){this._editor.changeDecorations((t=>{this._gutterDecorationID=t.addDecoration(new Yu(e,0,e,0),this.gutterDecoration)}))}_removeGutterDecoration(e){this._editor.changeDecorations((t=>{t.removeDecoration(e),this._gutterDecorationID=void 0}))}_updateGutterDecoration(e,t){this._editor.changeDecorations((i=>{i.changeDecoration(e,new Yu(t,0,t,0)),i.changeDecorationOptions(e,this.gutterDecoration)}))}_updateLightbulbTitle(e,t){1===this.state.type&&(t?this.title=y(875,"Run: {0}",this.state.actions.validActions[0].action.title):e&&this._preferredKbLabel?this.title=y(876,"Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel):!e&&this._quickFixKbLabel?this.title=y(877,"Show Code Actions ({0})",this._quickFixKbLabel):e||(this.title=y(878,"Show Code Actions")))}set title(e){this._domNode.title=e}};MF=kF=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,ER)],MF);var AF,RF=function(e,t){return function(i,n){t(i,n,e)}};let OF=class extends At{static{AF=this}static{this.ID="editor.contrib.codeActionController"}static get(e){return e.getContribution(AF.ID)}constructor(e,t,i,n,o,s,r,a,l,d,h){super(),this._commandService=r,this._configurationService=a,this._actionWidgetService=l,this._instantiationService=d,this._progressService=h,this._activeCodeActions=this._register(new Rt),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new cF(this._editor,o.codeActionProvider,t,i,s,a)),this._register(this._model.onDidChangeState((e=>this.update(e)))),this._lightBulbWidget=new Oi((()=>{const e=this._editor.getContribution(MF.ID);return e&&this._register(e.onClick((e=>this.showCodeActionsFromLightbulb(e.actions,e)))),e})),this._resolver=n.createInstance(QP),this._register(this._editor.onDidLayoutChange((()=>this._actionWidgetService.hide())))}dispose(){this._disposed=!0,super.dispose()}async showCodeActionsFromLightbulb(e,t){if(e.allAIFixes&&1===e.validActions.length){const t=e.validActions[0],i=t.action.command;return i&&"inlineChat.start"===i.id&&i.arguments&&i.arguments.length>=1&&(i.arguments[0]={...i.arguments[0],autoSend:!1}),void await this.applyCodeAction(t,!1,!1,jP.FromAILightbulb)}await this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!0})}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,n){if(!this._editor.hasModel())return;uT.get(this._editor)?.closeMessage();const o=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:n,context:{notAvailableMessage:e,position:o}})}_trigger(e){return this._model.trigger(e)}async applyCodeAction(e,t,i,n){const o=this._progressService.show(!0,500);try{await this._instantiationService.invokeFunction(GP,e,n,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:IP.QuickFix,filter:{}}),o.done()}}hideLightBulbWidget(){this._lightBulbWidget.rawValue?.hide(),this._lightBulbWidget.rawValue?.gutterHide()}async update(e){if(1!==e.type)return void this.hideLightBulbWidget();let t;try{t=await e.actions}catch(e){return void Ie(e)}if(this._disposed)return;const i=this._editor.getSelection();if(i?.startLineNumber===e.position.lineNumber)if(this._lightBulbWidget.value?.update(t,e.trigger,e.position),1===e.trigger.type){if(e.trigger.filter?.include){const i=this.tryGetValidActionToApply(e.trigger,t);if(i){try{this.hideLightBulbWidget(),await this.applyCodeAction(i,!1,!1,jP.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){const i=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(i&&i.action.disabled)return uT.get(this._editor)?.showMessage(i.action.disabled,e.trigger.context.position),void t.dispose()}}const i=!!e.trigger.filter?.include;if(e.trigger.context&&(!t.allActions.length||!i&&!t.validActions.length))return uT.get(this._editor)?.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=t,void t.dispose();this._activeCodeActions.value=t,this.showCodeActionList(t,this.toCoords(e.position),{includeDisabledActions:i,fromLightbulb:!1})}else this._actionWidgetService.isVisible?t.dispose():this._activeCodeActions.value=t}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length)return"first"===e.autoApply&&0===t.validActions.length||"ifSingle"===e.autoApply&&1===t.allActions.length?t.allActions.find((({action:e})=>e.disabled)):void 0}tryGetValidActionToApply(e,t){if(t.validActions.length)return"first"===e.autoApply&&t.validActions.length>0||"ifSingle"===e.autoApply&&1===t.validActions.length?t.validActions[0]:void 0}static{this.DECORATION=bk.register({description:"quickfix-highlight",className:"quickfix-edit-highlight"})}async showCodeActionList(e,t,i){const n=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const s=i.includeDisabledActions&&(this._showDisabled||0===e.validActions.length)?e.allActions:e.validActions;if(!s.length)return;const r=rc.isIPosition(t)?this.toCoords(t):t,a={onSelect:async(e,t)=>{this.applyCodeAction(e,!0,!!t,i.fromLightbulb?jP.FromAILightbulb:jP.FromCodeActions),this._actionWidgetService.hide(!1),n.clear()},onHide:e=>{this._editor?.focus(),n.clear()},onHover:async(e,t)=>{if(t.isCancellationRequested)return;let i=!1;const n=e.action.kind;if(n){const e=new _D(n);i=[NP.RefactorExtract,NP.RefactorInline,NP.RefactorRewrite,NP.RefactorMove,NP.Source].some((t=>t.contains(e)))}return{canPreview:i||!!e.action.edit?.edits.length}},onFocus:e=>{if(e&&e.action){const t=e.action.ranges,i=e.action.diagnostics;if(n.clear(),t&&t.length>0){const e=i&&i?.length>1?i.map((e=>({range:e,options:AF.DECORATION}))):t.map((e=>({range:e,options:AF.DECORATION})));n.set(e)}else if(i&&i.length>0){const e=i.map((e=>({range:e,options:AF.DECORATION})));n.set(e);const t=i[0];if(t.startLineNumber&&t.startColumn){const e=this._editor.getModel()?.getWordAtPosition({lineNumber:t.startLineNumber,column:t.startColumn})?.word;Ql(y(859,"Context: {0} at line {1} and column {2}.",e,t.startLineNumber,t.startColumn))}}}else n.clear()}};this._actionWidgetService.show("codeActionWidget",!0,function(e,t,i){if(!t)return e.map((e=>({kind:"action",item:e,group:oF,disabled:!!e.action.disabled,label:e.action.disabled||e.action.title,canPreview:!!e.action.edit?.edits.length})));const n=sF.map((e=>({group:e,actions:[]})));for(const t of e){const e=t.action.kind?new _D(t.action.kind):_D.None;for(const i of n)if(i.group.kind.contains(e)){i.actions.push(t);break}}const o=[];for(const e of n)if(e.actions.length){o.push({kind:"header",group:e.group});for(const t of e.actions){const n=e.group;o.push({kind:"action",item:t,group:t.action.isAI?{title:n.title,kind:n.kind,icon:fh.sparkle}:n,label:t.action.title,disabled:!!t.action.disabled,keybinding:i(t.action)})}}return o}(s,this._shouldShowHeaders(),this._resolver.getResolver()),a,r,o,this._getActionBarActions(e,t,i))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=Na(this._editor.getDomNode());return{x:i.left+t.left,y:i.top+t.top+t.height}}_shouldShowHeaders(){const e=this._editor?.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:e?.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const n=e.documentation.map((e=>({id:e.id,label:e.title,tooltip:e.tooltip??"",class:void 0,enabled:!0,run:()=>this._commandService.executeCommand(e.id,...e.arguments??[])})));return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&n.push(this._showDisabled?{id:"hideMoreActions",label:y(860,"Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:y(861,"Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),n}};function PF(e){return Ac.regex(rF.keys()[0],new RegExp("(\\s|^)"+Vi(e.value)+"\\b"))}OF=AF=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([RF(1,ZP),RF(2,eu),RF(3,nc),RF(4,BD),RF(5,wD),RF(6,mc),RF(7,up),RF(8,iO),RF(9,nc),RF(10,wD)],OF),hw(((e,t)=>{var i;(i=e.getColor(L_))&&t.addRule(`.monaco-editor .quickfix-edit-highlight { background-color: ${i}; }`);const n=e.getColor(E_);n&&t.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${nw(e.type)?"dotted":"solid"} ${n}; box-sizing: border-box; }`)}));const FF={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:y(827,"Kind of the code action to run.")},apply:{type:"string",description:y(828,"Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[y(829,"Always apply the first returned code action."),y(830,"Apply the first returned code action if it is the only one."),y(831,"Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:y(832,"Controls if only preferred code actions should be returned.")}}};function BF(e,t,i,n,o=IP.Default){if(e.hasModel()){const s=OF.get(e);s?.manualTriggerAtCurrentPosition(t,o,i,n)}}Uu(OF.ID,OF,3),Uu(MF.ID,MF,4),Hu(class extends Pu{constructor(){super({id:OP,label:x(849,"Quick Fix..."),precondition:Ac.and(Xu.writable,Xu.hasCodeActionsProvider),kbOpts:{kbExpr:Xu.textInputFocus,primary:2137,weight:100}})}run(e,t){return BF(t,y(833,"No code actions available"),void 0,void 0,IP.QuickFix)}}),Hu(class extends Pu{constructor(){super({id:FP,label:x(850,"Refactor..."),precondition:Ac.and(Xu.writable,Xu.hasCodeActionsProvider),kbOpts:{kbExpr:Xu.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:Ac.and(Xu.writable,PF(NP.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:FF}]}})}run(e,t,i){const n=MP.fromUser(i,{kind:NP.Refactor,apply:"never"});return BF(t,"string"==typeof i?.kind?n.preferred?y(838,"No preferred refactorings for '{0}' available",i.kind):y(839,"No refactorings for '{0}' available",i.kind):n.preferred?y(840,"No preferred refactorings available"):y(841,"No refactorings available"),{include:NP.Refactor.contains(n.kind)?n.kind:_D.None,onlyIncludePreferredActions:n.preferred},n.apply,IP.Refactor)}}),Hu(class extends Pu{constructor(){super({id:BP,label:x(851,"Source Action..."),precondition:Ac.and(Xu.writable,Xu.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:Ac.and(Xu.writable,PF(NP.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:FF}]}})}run(e,t,i){const n=MP.fromUser(i,{kind:NP.Source,apply:"never"});return BF(t,"string"==typeof i?.kind?n.preferred?y(842,"No preferred source actions for '{0}' available",i.kind):y(843,"No source actions for '{0}' available",i.kind):n.preferred?y(844,"No preferred source actions available"):y(845,"No source actions available"),{include:NP.Source.contains(n.kind)?n.kind:_D.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply,IP.SourceAction)}}),Hu(class extends Pu{constructor(){super({id:WP,label:x(852,"Organize Imports"),precondition:Ac.and(Xu.writable,PF(NP.SourceOrganizeImports)),kbOpts:{kbExpr:Xu.textInputFocus,primary:1581,weight:100},metadata:{description:x(853,"Organize imports in the current file. Also called 'Optimize Imports' by some tools")}})}run(e,t){return BF(t,y(846,"No organize imports action available"),{include:NP.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",IP.OrganizeImports)}}),Hu(class extends Pu{constructor(){super({id:PP,label:x(855,"Auto Fix..."),precondition:Ac.and(Xu.writable,PF(NP.QuickFix)),kbOpts:{kbExpr:Xu.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return BF(t,y(848,"No auto fixes available"),{include:NP.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",IP.AutoFix)}}),Hu(class extends Pu{constructor(){super({id:VP,label:x(854,"Fix All"),precondition:Ac.and(Xu.writable,PF(NP.SourceFixAll))})}run(e,t){return BF(t,y(847,"No fix all action available"),{include:NP.SourceFixAll,includeSourceActions:!0},"ifSingle",IP.FixAll)}}),Vu(new class extends Ou{constructor(){super({id:RP,precondition:Ac.and(Xu.writable,Xu.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:FF}]}})}runEditorCommand(e,t,i){const n=MP.fromUser(i,{kind:_D.Empty,apply:"ifSingle"});return BF(t,"string"==typeof i?.kind?n.preferred?y(834,"No preferred code actions for '{0}' available",i.kind):y(835,"No code actions for '{0}' available",i.kind):n.preferred?y(836,"No preferred code actions available"):y(837,"No code actions available"),{include:n.kind,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}),ru.as(kp).registerConfiguration({...wP,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:6,description:y(856,"Enable/disable showing group headers in the Code Action menu."),default:!0}}}),ru.as(kp).registerConfiguration({...wP,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:6,description:y(857,"Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}}),ru.as(kp).registerConfiguration({...wP,properties:{"editor.codeActions.triggerOnFocusChange":{type:"boolean",scope:6,markdownDescription:y(858,"Enable triggering {0} when {1} is set to {2}. Code Actions must be set to {3} to be triggered for window and focus changes.","`#editor.codeActionsOnSave#`","`#files.autoSave#`","`afterDelay`","`always`"),default:!1}}});const WF=oc("markerDecorationsService");let VF=class{static{this.ID="editor.contrib.markerDecorations"}constructor(e,t){}dispose(){}};VF=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,WF)],VF),Uu(VF.ID,VF,0);var HF=i(6049),zF={};zF.styleTagTransform=zl(),zF.setAttributes=Bl(),zF.insert=Pl().bind(null,"head"),zF.domAPI=Rl(),zF.insertStyleElement=Vl(),Ml()(HF.A,zF),HF.A&&HF.A.locals&&HF.A.locals;class UF extends At{constructor(e,t){super(),this._onDidChange=this._register(new Zt),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null;const t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()};let i=!1,n=!1;const o=()=>{if(i&&!n)try{i=!1,n=!0,t()}finally{Ca(ta(this._referenceDomElement),(()=>{n=!1,o()}))}};this._resizeObserver=new ResizeObserver((t=>{e=t&&t[0]&&t[0].contentRect?{width:t[0].contentRect.width,height:t[0].contentRect.height}:null,i=!0,o()})),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,n=0;t?(i=t.width,n=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,n=this._referenceDomElement.clientHeight),i=Math.max(5,i),n=Math.max(5,n),this._width===i&&this._height===n||(this._width=i,this._height=n,e&&this._onDidChange.fire())}}class KF extends At{constructor(e){super(),this._onDidChange=this._register(new Zt),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){this._mediaQueryList?.removeEventListener("change",this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),t&&this._onDidChange.fire()}}class jF extends At{get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new Zt),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);const t=this._register(new KF(e));this._register(t.onDidChange((()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)})))}_getPixelRatio(e){const t=document.createElement("canvas").getContext("2d");return(e.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)}}const qF=new class{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){const t=sa(e);let i=this.mapWindowIdToPixelRatioMonitor.get(t);return i||(i=Lt(new jF(e)),this.mapWindowIdToPixelRatioMonitor.set(t,i),Lt(zt.once(ha)((({vscodeWindowId:e})=>{e===t&&(i?.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))})))),i}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}};class $F{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class GF{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),this._container?.remove(),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");iT(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");iT(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const n=document.createElement("div");iT(n,this._bareFontInfo),n.style.fontStyle="italic",e.appendChild(n);const o=[];for(const e of this._requests){let s;0===e.type&&(s=t),2===e.type&&(s=i),1===e.type&&(s=n),s.appendChild(document.createElement("br"));const r=document.createElement("span");GF._render(r,e),s.appendChild(r),o.push(r)}this._container=e,this._testElements=o}static _render(e,t){if(" "===t.chr){let t=" ";for(let e=0;e<8;e++)t+=t;e.innerText=t}else{let i=t.chr;for(let e=0;e<8;e++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e<t;e++){const t=this._requests[e],i=this._testElements[e];t.fulfill(i.offsetWidth/256)}}}const ZF=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new Zt,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(e){e=Math.min(Math.max(-5,e),20),this._zoomLevel!==e&&(this._zoomLevel=e,this._onDidChangeZoomLevel.fire(this._zoomLevel))}},YF=$?1.5:1.35;class QF{static createFromValidatedSettings(e,t,i){const n=e.get(58),o=e.get(62),s=e.get(61),r=e.get(60),a=e.get(63),l=e.get(75),d=e.get(72);return QF._create(n,o,s,r,a,l,d,t,i)}static _create(e,t,i,n,o,s,r,a,l){0===s?s=YF*i:s<8&&(s*=i),(s=Math.round(s))<8&&(s=8);const d=1+(l?0:.1*ZF.getZoomLevel());return i*=d,s*=d,o===tP.TRANSLATE&&("normal"===t||"bold"===t?o=tP.OFF:(o=`'wght' ${parseInt(t,10)}`,t="normal")),new QF({pixelRatio:a,fontFamily:e,fontWeight:t,fontSize:i,fontFeatureSettings:n,fontVariationSettings:o,lineHeight:s,letterSpacing:r})}constructor(e){this._bareFontInfoBrand=void 0,this.pixelRatio=e.pixelRatio,this.fontFamily=String(e.fontFamily),this.fontWeight=String(e.fontWeight),this.fontSize=e.fontSize,this.fontFeatureSettings=e.fontFeatureSettings,this.fontVariationSettings=e.fontVariationSettings,this.lineHeight=0|e.lineHeight,this.letterSpacing=e.letterSpacing}getId(){return`${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`}getMassagedFontFamily(){const e=fP.fontFamily,t=QF._wrapInQuotes(this.fontFamily);return e&&this.fontFamily!==e?`${t}, ${e}`:t}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}}class XF extends QF{constructor(e,t){super(e),this._editorStylingBrand=void 0,this.version=2,this.isTrusted=t,this.isMonospace=e.isMonospace,this.typicalHalfwidthCharacterWidth=e.typicalHalfwidthCharacterWidth,this.typicalFullwidthCharacterWidth=e.typicalFullwidthCharacterWidth,this.canUseHalfwidthRightwardsArrow=e.canUseHalfwidthRightwardsArrow,this.spaceWidth=e.spaceWidth,this.middotWidth=e.middotWidth,this.wsmiddotWidth=e.wsmiddotWidth,this.maxDigitWidth=e.maxDigitWidth}equals(e){return this.fontFamily===e.fontFamily&&this.fontWeight===e.fontWeight&&this.fontSize===e.fontSize&&this.fontFeatureSettings===e.fontFeatureSettings&&this.fontVariationSettings===e.fontVariationSettings&&this.lineHeight===e.lineHeight&&this.letterSpacing===e.letterSpacing&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.typicalFullwidthCharacterWidth===e.typicalFullwidthCharacterWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.maxDigitWidth===e.maxDigitWidth}}class JF{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map((e=>this._values[e]))}}const eB=new class extends At{constructor(){super(...arguments),this._cache=new Map,this._evictUntrustedReadingsTimeout=-1,this._onDidChange=this._register(new Zt),this.onDidChange=this._onDidChange.event}dispose(){-1!==this._evictUntrustedReadingsTimeout&&(clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearAllFontInfos(){this._cache.clear(),this._onDidChange.fire()}_ensureCache(e){const t=sa(e);let i=this._cache.get(t);return i||(i=new JF,this._cache.set(t,i)),i}_writeToCache(e,t,i){this._ensureCache(e).put(t,i),i.isTrusted||-1!==this._evictUntrustedReadingsTimeout||(this._evictUntrustedReadingsTimeout=e.setTimeout((()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings(e)}),5e3))}_evictUntrustedReadings(e){const t=this._ensureCache(e),i=t.getValues();let n=!1;for(const e of i)e.isTrusted||(n=!0,t.remove(e));n&&this._onDidChange.fire()}readFontInfo(e,t){const i=this._ensureCache(e);if(!i.has(t)){let i=this._actualReadFontInfo(e,t);(i.typicalHalfwidthCharacterWidth<=2||i.typicalFullwidthCharacterWidth<=2||i.spaceWidth<=2||i.maxDigitWidth<=2)&&(i=new XF({pixelRatio:qF.getInstance(e).value,fontFamily:i.fontFamily,fontWeight:i.fontWeight,fontSize:i.fontSize,fontFeatureSettings:i.fontFeatureSettings,fontVariationSettings:i.fontVariationSettings,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,isMonospace:i.isMonospace,typicalHalfwidthCharacterWidth:Math.max(i.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(i.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:i.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(i.spaceWidth,5),middotWidth:Math.max(i.middotWidth,5),wsmiddotWidth:Math.max(i.wsmiddotWidth,5),maxDigitWidth:Math.max(i.maxDigitWidth,5)},!1)),this._writeToCache(e,t,i)}return i.get(t)}_createRequest(e,t,i,n){const o=new $F(e,t);return i.push(o),n?.push(o),o}_actualReadFontInfo(e,t){const i=[],n=[],o=this._createRequest("n",0,i,n),s=this._createRequest("m",0,i,null),r=this._createRequest(" ",0,i,n),a=this._createRequest("0",0,i,n),l=this._createRequest("1",0,i,n),d=this._createRequest("2",0,i,n),h=this._createRequest("3",0,i,n),c=this._createRequest("4",0,i,n),u=this._createRequest("5",0,i,n),g=this._createRequest("6",0,i,n),p=this._createRequest("7",0,i,n),m=this._createRequest("8",0,i,n),f=this._createRequest("9",0,i,n),_=this._createRequest("→",0,i,n),v=this._createRequest("→",0,i,null),b=this._createRequest("·",0,i,n),w=this._createRequest(String.fromCharCode(11825),0,i,null),C="|/-_ilm%";for(let e=0,t=8;e<t;e++)this._createRequest(C.charAt(e),0,i,n),this._createRequest(C.charAt(e),1,i,n),this._createRequest(C.charAt(e),2,i,n);!function(e,t,i){new GF(t,i).read(e)}(e,t,i);const y=Math.max(a.width,l.width,d.width,h.width,c.width,u.width,g.width,p.width,m.width,f.width);let S=t.fontFeatureSettings===eP.OFF;const x=n[0].width;for(let e=1,t=n.length;S&&e<t;e++){const t=x-n[e].width;if(t<-.001||t>.001){S=!1;break}}let k=!0;return S&&v.width!==x&&(k=!1),v.width>_.width&&(k=!1),new XF({pixelRatio:qF.getInstance(e).value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:S,typicalHalfwidthCharacterWidth:o.width,typicalFullwidthCharacterWidth:s.width,canUseHalfwidthRightwardsArrow:k,spaceWidth:r.width,middotWidth:b.width,wsmiddotWidth:w.width,maxDigitWidth:y},!0)}};class tB{static{this.items=[]}constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=tB._read(e,this.key);this.migrate(t,(t=>tB._read(e,t)),((t,i)=>tB._write(e,t,i)))}static _read(e,t){if(void 0===e)return;const i=t.indexOf(".");if(i>=0){const n=t.substring(0,i);return this._read(e[n],t.substring(i+1))}return e[t]}static _write(e,t,i){const n=t.indexOf(".");if(n>=0){const o=t.substring(0,n);return e[o]=e[o]||{},void this._write(e[o],t.substring(n+1),i)}e[t]=i}}function iB(e,t){tB.items.push(new tB(e,t))}function nB(e,t){iB(e,((i,n,o)=>{if(void 0!==i)for(const[n,s]of t)if(i===n)return void o(e,s)}))}nB("wordWrap",[[!0,"on"],[!1,"off"]]),nB("lineNumbers",[[!0,"on"],[!1,"off"]]),nB("cursorBlinking",[["visible","solid"]]),nB("renderWhitespace",[[!0,"boundary"],[!1,"none"]]),nB("renderLineHighlight",[[!0,"line"],[!1,"none"]]),nB("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]),nB("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]),nB("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]),nB("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]),nB("autoIndent",[[!1,"advanced"],[!0,"full"]]),nB("matchBrackets",[[!0,"always"],[!1,"never"]]),nB("renderFinalNewline",[[!0,"on"],[!1,"off"]]),nB("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]),nB("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]),nB("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]),nB("defaultColorDecorators",[[!0,"auto"],[!1,"never"]]),nB("minimap.autohide",[[!0,"mouseover"],[!1,"none"]]),iB("autoClosingBrackets",((e,t,i)=>{!1===e&&(i("autoClosingBrackets","never"),void 0===t("autoClosingQuotes")&&i("autoClosingQuotes","never"),void 0===t("autoSurround")&&i("autoSurround","never"))})),iB("renderIndentGuides",((e,t,i)=>{void 0!==e&&(i("renderIndentGuides",void 0),void 0===t("guides.indentation")&&i("guides.indentation",!!e))})),iB("highlightActiveIndentGuide",((e,t,i)=>{void 0!==e&&(i("highlightActiveIndentGuide",void 0),void 0===t("guides.highlightActiveIndentation")&&i("guides.highlightActiveIndentation",!!e))}));const oB={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};iB("suggest.filteredTypes",((e,t,i)=>{if(e&&"object"==typeof e){for(const n of Object.entries(oB))!1===e[n[0]]&&void 0===t(`suggest.${n[1]}`)&&i(`suggest.${n[1]}`,!1);i("suggest.filteredTypes",void 0)}})),iB("quickSuggestions",((e,t,i)=>{if("boolean"==typeof e){const t=e?"on":"off";i("quickSuggestions",{comments:t,strings:t,other:t})}})),iB("experimental.stickyScroll.enabled",((e,t,i)=>{"boolean"==typeof e&&(i("experimental.stickyScroll.enabled",void 0),void 0===t("stickyScroll.enabled")&&i("stickyScroll.enabled",e))})),iB("experimental.stickyScroll.maxLineCount",((e,t,i)=>{"number"==typeof e&&(i("experimental.stickyScroll.maxLineCount",void 0),void 0===t("stickyScroll.maxLineCount")&&i("stickyScroll.maxLineCount",e))})),iB("editor.experimentalEditContextEnabled",((e,t,i)=>{"boolean"==typeof e&&(i("editor.experimentalEditContextEnabled",void 0),void 0===t("editor.editContext")&&i("editor.editContext",e))})),iB("codeActionsOnSave",((e,t,i)=>{if(e&&"object"==typeof e){let t=!1;const n={};for(const i of Object.entries(e))"boolean"==typeof i[1]?(t=!0,n[i[0]]=i[1]?"explicit":"never"):n[i[0]]=i[1];t&&i("codeActionsOnSave",n)}})),iB("codeActionWidget.includeNearbyQuickfixes",((e,t,i)=>{"boolean"==typeof e&&(i("codeActionWidget.includeNearbyQuickfixes",void 0),void 0===t("codeActionWidget.includeNearbyQuickFixes")&&i("codeActionWidget.includeNearbyQuickFixes",e))})),iB("lightbulb.enabled",((e,t,i)=>{"boolean"==typeof e&&i("lightbulb.enabled",e?void 0:"off")})),iB("inlineSuggest.edits.codeShifting",((e,t,i)=>{"boolean"==typeof e&&(i("inlineSuggest.edits.codeShifting",void 0),i("inlineSuggest.edits.allowCodeShifting",e?"always":"never"))}));const sB=new class{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new Zt,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}},rB=oc("accessibilityService"),aB=new Jc("accessibilityModeEnabled",!1);let lB=class extends At{constructor(e,t,i,n,o){super(),this._accessibilityService=o,this._onDidChange=this._register(new Zt),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new Zt),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new OO,this.isSimpleWidget=e,this.contextMenuId=t,this._containerObserver=this._register(new UF(n,i.dimension)),this._targetWindowId=ta(n).vscodeWindowId,this._rawOptions=gB(i),this._validatedOptions=uB.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(19)&&this._containerObserver.startObserving(),this._register(ZF.onDidChangeZoomLevel((()=>this._recomputeOptions()))),this._register(sB.onDidChangeTabFocus((()=>this._recomputeOptions()))),this._register(this._containerObserver.onDidChange((()=>this._recomputeOptions()))),this._register(eB.onDidChange((()=>this._recomputeOptions()))),this._register(qF.getInstance(ta(n)).onDidChange((()=>this._recomputeOptions()))),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized((()=>this._recomputeOptions()))),this._register(Nk.onDidChangeInputMode((()=>this._recomputeOptions())))}_recomputeOptions(){const e=this._computeOptions(),t=uB.checkEquals(this.options,e);null!==t&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=QF.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),n={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:this._validatedOptions.get(164)||sB.getTabFocusMode(),inputMode:Nk.getInputMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount,editContextSupported:e.editContextSupported};return uB.computeOptions(this._validatedOptions,n)}_readEnvConfiguration(){return{extraEditorClassName:dB(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:u||c,pixelRatio:qF.getInstance(ra(this._targetWindowId,!0).window).value,editContextSupported:"function"==typeof globalThis.EditContext,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return eB.readFontInfo(ra(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=gB(e);uB.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=uB.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){const t=function(e){let t=0;for(;e;)e=Math.floor(e/10),t++;return t||1}(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};function dB(){let e="";return p||m?(e+="no-minimap-shadow ",e+="enable-user-select "):e+="no-user-select ",$&&(e+="mac "),e}lB=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(4,rB)],lB);class hB{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class cB{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw new Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}}class uB{static validateOptions(e){const t=new hB;for(const i of _P){const n="_never_"===i.name?void 0:e[i.name];t._write(i.id,i.validate(n))}return t}static computeOptions(e,t){const i=new cB;for(const n of _P)i._write(n.id,n.compute(t,i,e._read(n.id)));return i}static _deepEquals(e,t){if("object"!=typeof e||"object"!=typeof t||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return!(!Array.isArray(e)||!Array.isArray(t))&&es(e,t);if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!uB._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let n=!1;for(const o of _P){const s=!uB._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=s,s&&(n=!0)}return n?new RO(i):null}static applyUpdate(e,t){let i=!1;for(const n of _P)if(t.hasOwnProperty(n.name)){const o=n.applyUpdate(e[n.name],t[n.name]);e[n.name]=o.newValue,i=i||o.didChange}return i}}function gB(e){const t=rg(e);return function(e){tB.items.forEach((t=>t.apply(e)))}(t),t}var pB;!function(e){const t={total:0,min:Number.MAX_VALUE,max:0},i={...t},n={...t},o={...t};let s=0;const r={keydown:0,input:0,render:0};function a(){1===r.keydown&&(performance.mark("keydown/end"),r.keydown=2)}function l(){performance.mark("input/start"),r.input=1,c()}function d(){1===r.input&&(performance.mark("input/end"),r.input=2)}function h(){1===r.render&&(performance.mark("render/end"),r.render=2)}function c(){setTimeout(u)}function u(){2===r.keydown&&2===r.input&&2===r.render&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),g("keydown",t),g("input",i),g("render",n),g("inputlatency",o),s++,performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),r.keydown=0,r.input=0,r.render=0)}function g(e,t){const i=performance.getEntriesByName(e)[0].duration;t.total+=i,t.min=Math.min(t.min,i),t.max=Math.max(t.max,i)}function p(e){return{average:e.total/s,max:e.max,min:e.min}}function m(e){e.total=0,e.min=Number.MAX_VALUE,e.max=0}e.onKeyDown=function(){u(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),r.keydown=1,queueMicrotask(a)},e.onBeforeInput=l,e.onInput=function(){0===r.input&&l(),queueMicrotask(d)},e.onKeyUp=function(){u()},e.onSelectionChange=function(){u()},e.onRenderStart=function(){2===r.keydown&&2===r.input&&0===r.render&&(performance.mark("render/start"),r.render=1,queueMicrotask(h),c())},e.getAndClearMeasurements=function(){if(0===s)return;const e={keydown:p(t),input:p(i),render:p(n),total:p(o),sampleCount:s};return m(t),m(i),m(n),m(o),s=0,e}}(pB||(pB={}));class mB{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new fB(this.x-e.scrollX,this.y-e.scrollY)}}class fB{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new mB(this.clientX+e.scrollX,this.clientY+e.scrollY)}}class _B{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}}class vB{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function bB(e){const t=Na(e);return new _B(t.left,t.top,t.width,t.height)}function wB(e,t,i){const n=t.width/e.offsetWidth,o=t.height/e.offsetHeight,s=(i.x-t.x)/n,r=(i.y-t.y)/o;return new vB(s,r)}class CB extends Je{constructor(e,t,i){super(ta(i),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new mB(this.posx,this.posy),this.editorPos=bB(i),this.relativePos=wB(i,this.editorPos,this.pos)}}class yB{constructor(e){this._editorViewDomNode=e}_create(e){return new CB(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return ga(e,Qa.CONTEXT_MENU,(e=>{t(this._create(e))}))}onMouseUp(e,t){return ga(e,Qa.MOUSE_UP,(e=>{t(this._create(e))}))}onMouseDown(e,t){return ga(e,Qa.MOUSE_DOWN,(e=>{t(this._create(e))}))}onPointerDown(e,t){return ga(e,Qa.POINTER_DOWN,(e=>{t(this._create(e),e.pointerId)}))}onMouseLeave(e,t){return ga(e,Qa.MOUSE_LEAVE,(e=>{t(this._create(e))}))}onMouseMove(e,t){return ga(e,Qa.MOUSE_MOVE,(e=>t(this._create(e))))}}class SB{constructor(e){this._editorViewDomNode=e}_create(e){return new CB(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return ga(e,"pointerup",(e=>{t(this._create(e))}))}onPointerDown(e,t){return ga(e,Qa.POINTER_DOWN,(e=>{t(this._create(e),e.pointerId)}))}onPointerLeave(e,t){return ga(e,Qa.POINTER_LEAVE,(e=>{t(this._create(e))}))}onPointerMove(e,t){return ga(e,"pointermove",(e=>t(this._create(e))))}}class xB extends At{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new UM),this._keydownListener=null}startMonitoring(e,t,i,n,o){this._keydownListener=ma(e.ownerDocument,"keydown",(e=>{e.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,e.browserEvent)}),!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,(e=>{n(new CB(e,!0,this._editorViewDomNode))}),(e=>{this._keydownListener.dispose(),o(e)}))}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class kB{static{this._idPool=0}constructor(e){this._editor=e,this._instanceId=++kB._idPool,this._counter=0,this._rules=new Ft,this._garbageCollectionScheduler=new Ci((()=>this.garbageCollect()),1e3)}dispose(){this._rules.dispose(),this._garbageCollectionScheduler.dispose()}createClassNameRef(e){const t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){const t=this.computeUniqueKey(e);let i=this._rules.get(t);if(!i){const n=this._counter++;i=new LB(t,`dyn-rule-${this._instanceId}-${n}`,Ba(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,i)}return i}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||this._rules.deleteAndDispose(e.key)}}class LB{constructor(e,t,i,n){this.key=e,this.className=t,this.properties=n,this._referenceCount=0,this._styleElementDisposables=new Mt,this._styleElement=DM(i,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(const e in t){const n=t[e];let o;o="object"==typeof n?Af(n.id):n,i+=`\n\t${DB(e)}: ${o};`}return i+="\n}",i}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function DB(e){return e.replace(/(^[A-Z])/,(([e])=>e.toLowerCase())).replace(/([A-Z])/g,(([e])=>`-${e.toLowerCase()}`))}class EB extends At{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,n=e.length;i<n;i++){const n=e[i];switch(n.type){case 0:this.onCompositionStart(n)&&(t=!0);break;case 1:this.onCompositionEnd(n)&&(t=!0);break;case 2:this.onConfigurationChanged(n)&&(t=!0);break;case 3:this.onCursorStateChanged(n)&&(t=!0);break;case 4:this.onDecorationsChanged(n)&&(t=!0);break;case 5:this.onFlushed(n)&&(t=!0);break;case 6:this.onFocusChanged(n)&&(t=!0);break;case 7:this.onLanguageConfigurationChanged(n)&&(t=!0);break;case 8:this.onLineMappingChanged(n)&&(t=!0);break;case 9:this.onLinesChanged(n)&&(t=!0);break;case 10:this.onLinesDeleted(n)&&(t=!0);break;case 11:this.onLinesInserted(n)&&(t=!0);break;case 12:this.onRevealRangeRequest(n)&&(t=!0);break;case 13:this.onScrollChanged(n)&&(t=!0);break;case 15:this.onTokensChanged(n)&&(t=!0);break;case 14:this.onThemeChanged(n)&&(t=!0);break;case 16:this.onTokensColorsChanged(n)&&(t=!0);break;case 17:this.onZonesChanged(n)&&(t=!0);break;default:console.info("View received unknown event: "),console.info(n)}}t&&(this._shouldRender=!0)}}class NB extends EB{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class IB{static write(e,t){e.setAttribute("data-mprt",String(t))}static read(e){const t=e.getAttribute("data-mprt");return null===t?0:parseInt(t,10)}static collect(e,t){const i=[];let n=0;for(;e&&e!==e.ownerDocument.body&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(i[n++]=this.read(e)),e=e.parentElement;const o=new Uint8Array(n);for(let e=0;e<n;e++)o[e]=i[n-e-1];return o}}class TB{constructor(e,t){this._restrictedRenderingContextBrand=void 0,this._viewLayout=e,this.viewportData=t,this.scrollWidth=this._viewLayout.getScrollWidth(),this.scrollHeight=this._viewLayout.getScrollHeight(),this.visibleRange=this.viewportData.visibleRange,this.bigNumbersDelta=this.viewportData.bigNumbersDelta;const i=this._viewLayout.getCurrentViewport();this.scrollTop=i.top,this.scrollLeft=i.left,this.viewportWidth=i.width,this.viewportHeight=i.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e,t){return this._viewLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t){return this._viewLayout.getVerticalOffsetAfterLineNumber(e,t)}getLineHeightForLineNumber(e){return this._viewLayout.getLineHeightForLineNumber(e)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}class MB extends TB{constructor(e,t,i,n){super(e,t),this._renderingContextBrand=void 0,this._viewLines=i,this._viewLinesGpu=n}linesVisibleRangesForRange(e,t){const i=this._viewLines.linesVisibleRangesForRange(e,t);if(!this._viewLinesGpu)return i??null;const n=this._viewLinesGpu.linesVisibleRangesForRange(e,t);return i?n?i.concat(n).sort(((e,t)=>e.lineNumber-t.lineNumber)):i:n}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)??this._viewLinesGpu?.visibleRangeForPosition(e)??null}}class AB{constructor(e,t,i,n){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=n}}class RB{static from(e){const t=new Array(e.length);for(let i=0,n=e.length;i<n;i++){const n=e[i];t[i]=new RB(n.left,n.width)}return t}constructor(e,t){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(t)}toString(){return`[${this.left},${this.width}]`}}class OB{constructor(e,t){this._floatHorizontalRangeBrand=void 0,this.left=e,this.width=t}toString(){return`[${this.left},${this.width}]`}static compare(e,t){return e.left-t.left}}class PB{constructor(e,t){this.outsideRenderedLine=e,this.originalLeft=t,this.left=Math.round(this.originalLeft)}}class FB{constructor(e,t){this.outsideRenderedLine=e,this.ranges=t}}class BB{static _createRange(){return this._handyReadyRange||(this._handyReadyRange=document.createRange()),this._handyReadyRange}static _detachRange(e,t){e.selectNodeContents(t)}static _readClientRects(e,t,i,n,o){const s=this._createRange();try{return s.setStart(e,t),s.setEnd(i,n),s.getClientRects()}catch(e){return null}finally{this._detachRange(s,o)}}static _mergeAdjacentRanges(e){if(1===e.length)return e;e.sort(OB.compare);const t=[];let i=0,n=e[0];for(let o=1,s=e.length;o<s;o++){const s=e[o];n.left+n.width+.9>=s.left?n.width=Math.max(n.width,s.left+s.width-n.left):(t[i++]=n,n=s)}return t[i++]=n,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||0===e.length)return null;const n=[];for(let o=0,s=e.length;o<s;o++){const s=e[o];n[o]=new OB(Math.max(0,(s.left-t)/i),s.width/i)}return this._mergeAdjacentRanges(n)}static readHorizontalRanges(e,t,i,n,o,s){const r=e.children.length-1;if(0>r)return null;if((t=Math.min(r,Math.max(0,t)))===(n=Math.min(r,Math.max(0,n)))&&i===o&&0===i&&!e.children[t].firstChild){const i=e.children[t].getClientRects();return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(i,s.clientRectDeltaLeft,s.clientRectScale)}t!==n&&n>0&&0===o&&(n--,o=1073741824);let a=e.children[t].firstChild,l=e.children[n].firstChild;if(a&&l||(!a&&0===i&&t>0&&(a=e.children[t-1].firstChild,i=1073741824),!l&&0===o&&n>0&&(l=e.children[n-1].firstChild,o=1073741824)),!a||!l)return null;i=Math.min(a.textContent.length,Math.max(0,i)),o=Math.min(l.textContent.length,Math.max(0,o));const d=this._readClientRects(a,i,l,o,s.endNode);return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(d,s.clientRectDeltaLeft,s.clientRectScale)}}class WB{constructor(e,t,i,n){this.startColumn=e,this.endColumn=t,this.className=i,this.type=n,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(!WB._equals(e[n],t[n]))return!1;return!0}static extractWrapped(e,t,i){if(0===e.length)return e;const n=t+1,o=i+1,s=i-t,r=[];let a=0;for(const t of e)t.endColumn<=n||t.startColumn>=o||(r[a++]=new WB(Math.max(1,t.startColumn-n+1),Math.min(s+1,t.endColumn-n+1),t.className,t.type));return r}static filter(e,t,i,n){if(0===e.length)return[];const o=[];let s=0;for(let r=0,a=e.length;r<a;r++){const a=e[r],l=a.range;if(l.endLineNumber<t||l.startLineNumber>t)continue;if(l.isEmpty()&&(0===a.type||3===a.type))continue;const d=l.startLineNumber===t?l.startColumn:i,h=l.endLineNumber===t?l.endColumn:n;o[s++]=new WB(d,h,a.inlineClassName,a.type)}return o}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;const i=WB._typeCompare(e.type,t.type);return 0!==i?i:e.className!==t.className?e.className<t.className?-1:1:0}}class VB{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.className=i,this.metadata=n}}class HB{constructor(){this.stopOffsets=[],this.classNames=[],this.metadata=[],this.count=0}static _metadata(e){let t=0;for(let i=0,n=e.length;i<n;i++)t|=e[i];return t}consumeLowerThan(e,t,i){for(;this.count>0&&this.stopOffsets[0]<e;){let e=0;for(;e+1<this.count&&this.stopOffsets[e]===this.stopOffsets[e+1];)e++;i.push(new VB(t,this.stopOffsets[e],this.classNames.join(" "),HB._metadata(this.metadata))),t=this.stopOffsets[e]+1,this.stopOffsets.splice(0,e+1),this.classNames.splice(0,e+1),this.metadata.splice(0,e+1),this.count-=e+1}return this.count>0&&t<e&&(i.push(new VB(t,e-1,this.classNames.join(" "),HB._metadata(this.metadata))),t=e),t}insert(e,t,i){if(0===this.count||this.stopOffsets[this.count-1]<=e)this.stopOffsets.push(e),this.classNames.push(t),this.metadata.push(i);else for(let n=0;n<this.count;n++)if(this.stopOffsets[n]>=e){this.stopOffsets.splice(n,0,e),this.classNames.splice(n,0,t),this.metadata.splice(n,0,i);break}this.count++}}class zB{static normalize(e,t){if(0===t.length)return[];const i=[],n=new HB;let o=0;for(let s=0,r=t.length;s<r;s++){const r=t[s];let a=r.startColumn,l=r.endColumn;const d=r.className,h=1===r.type?2:2===r.type?4:0;a>1&&ln(e.charCodeAt(a-2))&&a--,l>1&&ln(e.charCodeAt(l-2))&&l--;const c=a-1,u=l-2;o=n.consumeLowerThan(c,o,i),0===n.count&&(o=c),n.insert(u,d,h)}return n.consumeLowerThan(1073741824,o,i),i}}class UB{constructor(e,t,i,n){this.endIndex=e,this.type=t,this.metadata=i,this.containsRTL=n,this._linePartBrand=void 0}isWhitespace(){return!!(1&this.metadata)}isPseudoAfter(){return!!(4&this.metadata)}}class KB{get isLTR(){return!this.containsRTL&&this.textDirection!==pg.RTL}constructor(e,t,i,n,o,s,r,a,l,d,h,c,u,g,p,m,f,_,v,b,w,C=!1){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=o,this.containsRTL=s,this.fauxIndentLength=r,this.lineTokens=a,this.lineDecorations=l.sort(WB.compare),this.tabSize=d,this.startVisibleColumn=h,this.spaceWidth=c,this.stopRenderingLineAfter=p,this.renderWhitespace="all"===m?4:"boundary"===m?1:"selection"===m?2:"trailing"===m?3:0,this.renderControlCharacters=f,this.fontLigatures=_,this.selectionsOnLine=v&&v.sort(((e,t)=>e.start<t.start?-1:1)),this.renderNewLineWhenEmpty=C,this.textDirection=b,this.verticalScrollbarSize=w,Math.abs(g-c)<Math.abs(u-c)?(this.renderSpaceWidth=g,this.renderSpaceCharCode=11825):(this.renderSpaceWidth=u,this.renderSpaceCharCode=183)}sameSelection(e){if(null===this.selectionsOnLine)return null===e;if(null===e)return!1;if(e.length!==this.selectionsOnLine.length)return!1;for(let t=0;t<this.selectionsOnLine.length;t++)if(!this.selectionsOnLine[t].equals(e[t]))return!1;return!0}equals(e){return this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineContent===e.lineContent&&this.continuesWithWrappedLine===e.continuesWithWrappedLine&&this.isBasicASCII===e.isBasicASCII&&this.containsRTL===e.containsRTL&&this.fauxIndentLength===e.fauxIndentLength&&this.tabSize===e.tabSize&&this.startVisibleColumn===e.startVisibleColumn&&this.spaceWidth===e.spaceWidth&&this.renderSpaceWidth===e.renderSpaceWidth&&this.renderSpaceCharCode===e.renderSpaceCharCode&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.fontLigatures===e.fontLigatures&&WB.equalsArr(this.lineDecorations,e.lineDecorations)&&this.lineTokens.equals(e.lineTokens)&&this.sameSelection(e.selectionsOnLine)&&this.textDirection===e.textDirection&&this.verticalScrollbarSize===e.verticalScrollbarSize&&this.renderNewLineWhenEmpty===e.renderNewLineWhenEmpty}}class jB{constructor(e,t){this.partIndex=e,this.charIndex=t}}class qB{static getPartIndex(e){return(4294901760&e)>>>16}static getCharIndex(e){return(65535&e)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,n){const o=(t<<16|i)>>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=n}getHorizontalOffset(e){return 0===this._horizontalOffset.length?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return 0===this.length?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),i=qB.getPartIndex(t),n=qB.getCharIndex(t);return new jB(i,n)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(0===this.length)return 0;const n=(e<<16|i)>>>0;let o=0,s=this.length-1;for(;o+1<s;){const e=o+s>>>1,t=this._data[e];if(t===n)return e;t>n?s=e:o=e}if(o===s)return o;const r=this._data[o],a=this._data[s];if(r===n)return o;if(a===n)return s;const l=qB.getPartIndex(r),d=qB.getCharIndex(r);let h;return h=l!==qB.getPartIndex(a)?t:qB.getCharIndex(a),i-d<=h-i?o:s}}class $B{constructor(e,t){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsForeignElements=t}}function GB(e,t){if(0===e.lineContent.length){if(e.lineDecorations.length>0){t.appendString("<span>");let i=0,n=0,o=0;for(const s of e.lineDecorations)1!==s.type&&2!==s.type||(t.appendString('<span class="'),t.appendString(s.className),t.appendString('"></span>'),1===s.type&&(o|=1,i++),2===s.type&&(o|=2,n++));t.appendString("</span>");const s=new qB(1,i+n);return s.setColumnInfo(1,i,0,0),new $B(s,o)}return e.renderNewLineWhenEmpty?t.appendString("<span><span>\n</span></span>"):t.appendString("<span><span></span></span>"),new $B(new qB(0,0),0)}return function(e,t){const i=e.fontIsMonospace,n=e.canUseHalfwidthRightwardsArrow,o=e.containsForeignElements,s=e.lineContent,r=e.len,a=e.isOverflowing,l=e.overflowingCharCount,d=e.parts,h=e.fauxIndentLength,c=e.tabSize,u=e.startVisibleColumn,g=e.spaceWidth,p=e.renderSpaceCharCode,m=e.renderWhitespace,f=e.renderControlCharacters,_=new qB(r+1,d.length);let v=!1,b=0,w=u,C=0,S=0,x=0;t.appendString("<span>");for(let e=0,a=d.length;e<a;e++){const a=d[e],l=a.endIndex,u=a.type,y=a.containsRTL,k=0!==m&&a.isWhitespace(),L=k&&!i&&("mtkw"===u||!o),D=b===l&&a.isPseudoAfter();if(C=0,t.appendString("<span "),y&&t.appendString('style="unicode-bidi:isolate" '),t.appendString('class="'),t.appendString(L?"mtkz":u),t.appendASCIICharCode(34),k){let i=0;{let e=b,t=w;for(;e<l;e++){const n=0|(9===s.charCodeAt(e)?c-t%c:1);i+=n,e>=h&&(t+=n)}}for(L&&(t.appendString(' style="width:'),t.appendString(String(g*i)),t.appendString('px"')),t.appendASCIICharCode(62);b<l;b++){let i,o;if(_.setColumnInfo(b+1,e-x,C,S),x=0,9===s.charCodeAt(b)){i=c-w%c|0,o=i,!n||o>1?t.appendCharCode(8594):t.appendCharCode(65515);for(let e=2;e<=o;e++)t.appendCharCode(160)}else i=2,o=1,t.appendCharCode(p),t.appendCharCode(8204);C+=i,S+=o,b>=h&&(w+=o)}}else for(t.appendASCIICharCode(62);b<l;b++){_.setColumnInfo(b+1,e-x,C,S),x=0;const i=s.charCodeAt(b);let n=1,o=1;switch(i){case 9:n=c-w%c,o=n;for(let e=1;e<=n;e++)t.appendCharCode(160);break;case 32:t.appendCharCode(160);break;case 60:t.appendString("<");break;case 62:t.appendString(">");break;case 38:t.appendString("&");break;case 0:f?t.appendCharCode(9216):t.appendString("�");break;case 65279:case 8232:case 8233:case 133:t.appendCharCode(65533);break;default:yn(i)&&o++,f&&i<32?t.appendCharCode(9216+i):f&&127===i?t.appendCharCode(9249):f&&XB(i)?(t.appendString("[U+"),t.appendString(JB(i)),t.appendString("]"),n=8,o=n):t.appendCharCode(i)}C+=n,S+=o,b>=h&&(w+=o)}D?x++:x=0,b>=r&&!v&&a.isPseudoAfter()&&(v=!0,_.setColumnInfo(b+1,e,C,S)),t.appendString("</span>")}return v||_.setColumnInfo(r+1,d.length-1,C,S),a&&(t.appendString('<span class="mtkoverflow">'),t.appendString(y(792,"Show more ({0})",function(e){return e<1024?y(793,"{0} chars",e):e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}(l))),t.appendString("</span>")),t.appendString("</span>"),new $B(_,o)}(function(e){const t=e.lineContent;let i,n,o;-1!==e.stopRenderingLineAfter&&e.stopRenderingLineAfter<t.length?(i=!0,n=t.length-e.stopRenderingLineAfter,o=e.stopRenderingLineAfter):(i=!1,n=0,o=t.length);let s=function(e,t,i,n,o){const s=[];let r=0;n>0&&(s[r++]=new UB(n,"",0,!1));let a=n;for(let l=0,d=i.getCount();l<d;l++){const d=i.getEndOffset(l);if(d<=n)continue;const h=i.getClassName(l);if(d>=o){const i=!!t&&_n(e.substring(a,o));s[r++]=new UB(o,h,0,i);break}const c=!!t&&_n(e.substring(a,d));s[r++]=new UB(d,h,0,c),a=d}return s}(t,e.containsRTL,e.lineTokens,e.fauxIndentLength,o);e.renderControlCharacters&&!e.isBasicASCII&&(s=function(e,t){const i=[];let n=new UB(0,"",0,!1),o=0;for(const s of t){const t=s.endIndex;for(;o<t;o++)XB(e.charCodeAt(o))&&(o>n.endIndex&&(n=new UB(o,s.type,s.metadata,s.containsRTL),i.push(n)),n=new UB(o+1,"mtkcontrol",s.metadata,!1),i.push(n));o>n.endIndex&&(n=new UB(t,s.type,s.metadata,s.containsRTL),i.push(n))}return i}(t,s)),(4===e.renderWhitespace||1===e.renderWhitespace||2===e.renderWhitespace&&e.selectionsOnLine||3===e.renderWhitespace&&!e.continuesWithWrappedLine)&&(s=function(e,t,i,n){const o=e.continuesWithWrappedLine,s=e.fauxIndentLength,r=e.tabSize,a=e.startVisibleColumn,l=e.useMonospaceOptimizations,d=e.selectionsOnLine,h=1===e.renderWhitespace,c=3===e.renderWhitespace,u=e.renderSpaceWidth!==e.spaceWidth,g=[];let p=0,m=0,f=n[m].type,_=n[m].containsRTL,v=n[m].endIndex;const b=n.length;let w,C=!1,y=$i(t);-1===y?(C=!0,y=i,w=i):w=Zi(t);let S=!1,x=0,k=d&&d[x],L=a%r;for(let e=s;e<i;e++){const o=t.charCodeAt(e);let a;if(k&&k.endExclusive<=e&&(x++,k=d&&d[x]),e<y||e>w)a=!0;else if(9===o)a=!0;else if(32===o)if(h)if(S)a=!0;else{const n=e+1<i?t.charCodeAt(e+1):0;a=32===n||9===n}else a=!0;else a=!1;if(a&&d&&(a=!!k&&k.start<=e&&e<k.endExclusive),a&&c&&(a=C||e>w),a&&_&&e>=y&&e<=w&&(a=!1),S){if(!a||!l&&L>=r){if(u)for(let t=(p>0?g[p-1].endIndex:s)+1;t<=e;t++)g[p++]=new UB(t,"mtkw",1,!1);else g[p++]=new UB(e,"mtkw",1,!1);L%=r}}else(e===v||a&&e>s)&&(g[p++]=new UB(e,f,0,_),L%=r);for(9===o?L=r:yn(o)?L+=2:L++,S=a;e===v&&(m++,m<b);)f=n[m].type,_=n[m].containsRTL,v=n[m].endIndex}let D=!1;if(S)if(o&&h){const e=i>0?t.charCodeAt(i-1):0,n=i>1?t.charCodeAt(i-2):0;32===e&&32!==n&&9!==n||(D=!0)}else D=!0;if(D)if(u)for(let e=(p>0?g[p-1].endIndex:s)+1;e<=i;e++)g[p++]=new UB(e,"mtkw",1,!1);else g[p++]=new UB(i,"mtkw",1,!1);else g[p++]=new UB(i,f,0,_);return g}(e,t,o,s));let r=0;if(e.lineDecorations.length>0){for(let t=0,i=e.lineDecorations.length;t<i;t++){const i=e.lineDecorations[t];3===i.type||1===i.type?r|=1:2===i.type&&(r|=2)}s=function(e,t,i,n){n.sort(WB.compare);const o=zB.normalize(e,n),s=o.length;let r=0;const a=[];let l=0,d=0;for(let e=0,t=i.length;e<t;e++){const t=i[e],n=t.endIndex,h=t.type,c=t.metadata,u=t.containsRTL;for(;r<s&&o[r].startOffset<n;){const e=o[r];if(e.startOffset>d&&(d=e.startOffset,a[l++]=new UB(d,h,c,u)),!(e.endOffset+1<=n)){d=n,a[l++]=new UB(d,h+" "+e.className,c|e.metadata,u);break}d=e.endOffset+1,a[l++]=new UB(d,h+" "+e.className,c|e.metadata,u),r++}n>d&&(d=n,a[l++]=new UB(d,h,c,u))}const h=i[i.length-1].endIndex;if(r<s&&o[r].startOffset===h)for(;r<s&&o[r].startOffset===h;){const e=o[r];a[l++]=new UB(d,e.className,e.metadata,!1),r++}return a}(t,0,s,e.lineDecorations)}return e.containsRTL||(s=function(e,t,i){let n=0;const o=[];let s=0;if(i)for(let i=0,r=t.length;i<r;i++){const r=t[i],a=r.endIndex;if(n+50<a){const t=r.type,i=r.metadata,l=r.containsRTL;let d=-1,h=n;for(let r=n;r<a;r++)32===e.charCodeAt(r)&&(d=r),-1!==d&&r-h>=50&&(o[s++]=new UB(d+1,t,i,l),h=d+1,d=-1);h!==a&&(o[s++]=new UB(a,t,i,l))}else o[s++]=r;n=a}else for(let e=0,i=t.length;e<i;e++){const i=t[e],r=i.endIndex,a=r-n;if(a>50){const e=i.type,t=i.metadata,l=i.containsRTL,d=Math.ceil(a/50);for(let i=1;i<d;i++){const r=n+50*i;o[s++]=new UB(r,e,t,l)}o[s++]=new UB(r,e,t,l)}else o[s++]=i;n=r}return o}(t,s,!e.isBasicASCII||e.fontLigatures)),new QB(e.useMonospaceOptimizations,e.canUseHalfwidthRightwardsArrow,t,o,i,n,s,r,e.fauxIndentLength,e.tabSize,e.startVisibleColumn,e.spaceWidth,e.renderSpaceCharCode,e.renderWhitespace,e.renderControlCharacters)}(e),t)}class ZB{constructor(e,t,i){this.characterMapping=e,this.html=t,this.containsForeignElements=i}}function YB(e){const t=new Xg(1e4),i=GB(e,t);return new ZB(i.characterMapping,t.build(),i.containsForeignElements)}class QB{constructor(e,t,i,n,o,s,r,a,l,d,h,c,u,g,p){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=n,this.isOverflowing=o,this.overflowingCharCount=s,this.parts=r,this.containsForeignElements=a,this.fauxIndentLength=l,this.tabSize=d,this.startVisibleColumn=h,this.spaceWidth=c,this.renderSpaceCharCode=u,this.renderWhitespace=g,this.renderControlCharacters=p}}function XB(e){return e<32?9!==e:127===e||e>=8234&&e<=8238||e>=8294&&e<=8297||e>=8206&&e<=8207||1564===e}function JB(e){return e.toString(16).toUpperCase().padStart(4,"0")}const eW=!!Z||!(G||c||p);let tW=!0;class iW{static{this.CLASS_NAME="view-line"}constructor(e,t){this._viewGpuContext=e,this._options=t,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(!this._renderedViewLine)throw new Error("I have no rendered view line to set the dom node to...");this._renderedViewLine.domNode=tT(e)}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return!(!nw(this._options.themeType)&&2!==this._renderedViewLine?.input.renderWhitespace||(this._isMaybeInvalid=!0,0))}renderLine(e,t,i,n,o){if(this._options.useGpu&&this._viewGpuContext?.canRender(this._options,n,e))return this._renderedViewLine?.domNode?.domNode.remove(),this._renderedViewLine=null,!1;if(!1===this._isMaybeInvalid)return!1;this._isMaybeInvalid=!1;const s=n.getViewLineRenderingData(e),r=this._options,a=WB.filter(s.inlineDecorations,e,s.minColumn,s.maxColumn),l=s.hasVariableFonts||"off"===r.experimentalWhitespaceRendering?r.renderWhitespace:"none",d=!s.hasVariableFonts;let h=null;if(nw(r.themeType)||"selection"===l){const t=n.selections;for(const i of t){if(i.endLineNumber<e||i.startLineNumber>e)continue;const t=i.startLineNumber===e?i.startColumn:s.minColumn,n=i.endLineNumber===e?i.endColumn:s.maxColumn;t<n&&(nw(r.themeType)&&a.push(new WB(t,n,"inline-selected-text",0)),"selection"===l&&(h||(h=[]),h.push(new cm(t-1,n-1))))}}const c=new KB(r.useMonospaceOptimizations,r.canUseHalfwidthRightwardsArrow,s.content,s.continuesWithWrappedLine,s.isBasicASCII,s.containsRTL,s.minColumn-1,s.tokens,a,s.tabSize,s.startVisibleColumn,r.spaceWidth,r.middotWidth,r.wsmiddotWidth,r.stopRenderingLineAfter,l,r.renderControlCharacters,r.fontLigatures!==eP.OFF,h,s.textDirection,r.verticalScrollbarSize);if(this._renderedViewLine&&this._renderedViewLine.input.equals(c))return!1;o.appendString("<div "),s.textDirection===pg.RTL?o.appendString('dir="rtl" '):s.containsRTL&&o.appendString('dir="ltr" '),o.appendString('style="top:'),o.appendString(String(t)),o.appendString("px;height:"),o.appendString(String(i)),o.appendString("px;line-height:"),o.appendString(String(i)),s.textDirection===pg.RTL&&(o.appendString("px;padding-right:"),o.appendString(String(r.verticalScrollbarSize))),o.appendString('px;" class="'),o.appendString(iW.CLASS_NAME),o.appendString('">');const u=GB(c,o);o.appendString("</div>");let g=null;return d&&tW&&eW&&s.isBasicASCII&&c.isLTR&&r.useMonospaceOptimizations&&0===u.containsForeignElements&&(g=new nW(this._renderedViewLine?this._renderedViewLine.domNode:null,c,u.characterMapping)),g||(g=rW(this._renderedViewLine?this._renderedViewLine.domNode:null,c,u.characterMapping,u.containsForeignElements)),this._renderedViewLine=g,!0}layoutLine(e,t,i){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(i),this._renderedViewLine.domNode.setLineHeight(i))}isRenderedRTL(){return!!this._renderedViewLine&&this._renderedViewLine.input.textDirection===pg.RTL}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return!this._renderedViewLine||this._renderedViewLine.getWidthIsFast()}needsMonospaceFontCheck(){return!!this._renderedViewLine&&this._renderedViewLine instanceof nW}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof nW?this._renderedViewLine.monospaceAssumptionsAreValid():tW}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof nW&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,n){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));const o=this._renderedViewLine.input.stopRenderingLineAfter;if(-1!==o&&t>o+1&&i>o+1)return new FB(!0,[new OB(this.getWidth(n),0)]);-1!==o&&t>o+1&&(t=o+1),-1!==o&&i>o+1&&(i=o+1);const s=this._renderedViewLine.getVisibleRangesForRange(e,t,i,n);return s&&s.length>0?new FB(!1,s):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}class nW{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const n=Math.floor(t.lineContent.length/300);if(n>0){this._keyColumnPixelOffsetCache=new Float32Array(n);for(let e=0;e<n;e++)this._keyColumnPixelOffsetCache[e]=-1}else this._keyColumnPixelOffsetCache=null;this._characterMapping=i,this._charWidth=t.spaceWidth}getWidth(e){if(!this.domNode||this.input.lineContent.length<300){const e=this._characterMapping.getHorizontalOffset(this._characterMapping.length);return Math.round(this._charWidth*e)}return-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e?.markDidDomLayout()),this._cachedWidth}getWidthIsFast(){return this.input.lineContent.length<300||-1!==this._cachedWidth}monospaceAssumptionsAreValid(){if(!this.domNode)return tW;if(this.input.lineContent.length<300){const e=this.getWidth(null),t=this.domNode.domNode.firstChild.offsetWidth;Math.abs(e-t)>=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),tW=!1)}return tW}toSlowRenderedLine(){return rW(this.domNode,this.input,this._characterMapping,0)}getVisibleRangesForRange(e,t,i,n){const o=this._getColumnPixelOffset(e,t,n),s=this._getColumnPixelOffset(e,i,n);return[new OB(o,s-o)]}_getColumnPixelOffset(e,t,i){if(t<=300){const e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}const n=Math.floor((t-1)/300)-1,o=300*(n+1)+1;let s=-1;if(this._keyColumnPixelOffsetCache&&(s=this._keyColumnPixelOffsetCache[n],-1===s&&(s=this._actualReadPixelOffset(e,o,i),this._keyColumnPixelOffsetCache[n]=s)),-1===s){const e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}const r=this._characterMapping.getHorizontalOffset(o),a=this._characterMapping.getHorizontalOffset(t);return s+this._charWidth*(a-r)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;const n=this._characterMapping.getDomPosition(t),o=BB.readHorizontalRanges(this._getReadingTarget(this.domNode),n.partIndex,n.charIndex,n.partIndex,n.charIndex,i);return o&&0!==o.length?o[0].left:-1}getColumnOfNodeOffset(e,t){return aW(this._characterMapping,e,t)}}class oW{constructor(e,t,i,n){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=n,this._cachedWidth=-1,this._pixelOffsetCache=null,t.isLTR){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let e=0,t=this._characterMapping.length;e<=t;e++)this._pixelOffsetCache[e]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e?.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return-1!==this._cachedWidth}getVisibleRangesForRange(e,t,i,n){if(!this.domNode)return null;if(null!==this._pixelOffsetCache){const o=this._readPixelOffset(this.domNode,e,t,n);if(-1===o)return null;const s=this._readPixelOffset(this.domNode,e,i,n);return-1===s?null:[new OB(o,s-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,n)}_readVisibleRangesForRange(e,t,i,n,o){if(i===n){const n=this._readPixelOffset(e,t,i,o);return-1===n?null:[new OB(n,0)]}return this._readRawVisibleRangesForRange(e,i,n,o)}_readPixelOffset(e,t,i,n){if(this.input.isLTR&&0===this._characterMapping.length){if(0===this._containsForeignElements)return 0;if(2===this._containsForeignElements)return 0;if(1===this._containsForeignElements)return this.getWidth(n);const t=this._getReadingTarget(e);return t.firstChild?(n.markDidDomLayout(),t.firstChild.offsetWidth):0}if(null!==this._pixelOffsetCache){const o=this._pixelOffsetCache[i];if(-1!==o)return o;const s=this._actualReadPixelOffset(e,t,i,n);return this._pixelOffsetCache[i]=s,s}return this._actualReadPixelOffset(e,t,i,n)}_actualReadPixelOffset(e,t,i,n){if(0===this._characterMapping.length){const t=BB.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,n);return t&&0!==t.length?t[0].left:-1}if(this.input.isLTR&&i===this._characterMapping.length&&this._isWhitespaceOnly&&0===this._containsForeignElements)return this.getWidth(n);const o=this._characterMapping.getDomPosition(i),s=BB.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,n);if(!s||0===s.length)return-1;const r=s[0].left;if(this.input.isBasicASCII){const e=this._characterMapping.getHorizontalOffset(i),t=Math.round(this.input.spaceWidth*e);if(Math.abs(t-r)<=1)return t}return r}_readRawVisibleRangesForRange(e,t,i,n){if(this.input.isLTR&&1===t&&i===this._characterMapping.length)return[new OB(0,this.getWidth(n))];const o=this._characterMapping.getDomPosition(t),s=this._characterMapping.getDomPosition(i);return BB.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,s.partIndex,s.charIndex,n)}getColumnOfNodeOffset(e,t){return aW(this._characterMapping,e,t)}}class sW extends oW{_readVisibleRangesForRange(e,t,i,n,o){const s=super._readVisibleRangesForRange(e,t,i,n,o);if(!s||0===s.length||i===n||1===i&&n===this._characterMapping.length)return s;if(this.input.isLTR){const i=this._readPixelOffset(e,t,n,o);if(-1!==i){const e=s[s.length-1];e.left<i&&(e.width=i-e.left)}}return s}}const rW=u?function(e,t,i,n){return new sW(e,t,i,n)}:function(e,t,i,n){return new oW(e,t,i,n)};function aW(e,t,i){const n=t.textContent.length;let o=-1;for(;t;)t=t.previousSibling,o++;return e.getColumn(new jB(o,i),n)}class lW{constructor(e=null){this.hitTarget=e,this.type=0}}class dW{get hitTarget(){return this.spanNode}constructor(e,t,i){this.position=e,this.spanNode=t,this.injectedText=i,this.type=1}}var hW;!function(e){e.createFromDOMInfo=function(e,t,i){const n=e.getPositionFromDOMInfo(t,i);return n?new dW(n,t,null):new lW(t)}}(hW||(hW={}));class cW{constructor(e,t){this.lastViewCursorsRenderData=e,this.lastTextareaPosition=t}}class uW{static _deduceRage(e,t=null){return!t&&e?new Yu(e.lineNumber,e.column,e.lineNumber,e.column):t??null}static createUnknown(e,t,i){return{type:0,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createTextarea(e,t){return{type:1,element:e,mouseColumn:t,position:null,range:null}}static createMargin(e,t,i,n,o,s){return{type:e,element:t,mouseColumn:i,position:n,range:o,detail:s}}static createViewZone(e,t,i,n,o){return{type:e,element:t,mouseColumn:i,position:n,range:this._deduceRage(n),detail:o}}static createContentText(e,t,i,n,o){return{type:6,element:e,mouseColumn:t,position:i,range:this._deduceRage(i,n),detail:o}}static createContentEmpty(e,t,i,n){return{type:7,element:e,mouseColumn:t,position:i,range:this._deduceRage(i),detail:n}}static createContentWidget(e,t,i){return{type:9,element:e,mouseColumn:t,position:null,range:null,detail:i}}static createScrollbar(e,t,i){return{type:11,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createOverlayWidget(e,t,i){return{type:12,element:e,mouseColumn:t,position:null,range:null,detail:i}}static createOutsideEditor(e,t,i,n){return{type:13,element:null,mouseColumn:e,position:t,range:this._deduceRage(t),outsidePosition:i,outsideDistance:n}}static _typeToString(e){return 1===e?"TEXTAREA":2===e?"GUTTER_GLYPH_MARGIN":3===e?"GUTTER_LINE_NUMBERS":4===e?"GUTTER_LINE_DECORATIONS":5===e?"GUTTER_VIEW_ZONE":6===e?"CONTENT_TEXT":7===e?"CONTENT_EMPTY":8===e?"CONTENT_VIEW_ZONE":9===e?"CONTENT_WIDGET":10===e?"OVERVIEW_RULER":11===e?"SCROLLBAR":12===e?"OVERLAY_WIDGET":"UNKNOWN"}static toString(e){return this._typeToString(e.type)+": "+e.position+" - "+e.range+" - "+JSON.stringify(e.detail)}}class gW{static isTextArea(e){return 2===e.length&&3===e[0]&&7===e[1]}static isChildOfViewLines(e){return e.length>=4&&3===e[0]&&8===e[3]}static isStrictChildOfViewLines(e){return e.length>4&&3===e[0]&&8===e[3]}static isChildOfScrollableElement(e){return e.length>=2&&3===e[0]&&6===e[1]}static isChildOfMinimap(e){return e.length>=2&&3===e[0]&&9===e[1]}static isChildOfContentWidgets(e){return e.length>=4&&3===e[0]&&1===e[3]}static isChildOfOverflowGuard(e){return e.length>=1&&3===e[0]}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&2===e[0]}static isChildOfOverlayWidgets(e){return e.length>=2&&3===e[0]&&4===e[1]}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&5===e[0]}}class pW{constructor(e,t,i){this.viewModel=e.viewModel;const n=e.configuration.options;this.layoutInfo=n.get(165),this.viewDomNode=t.viewDomNode,this.viewLinesGpu=t.viewLinesGpu,this.lineHeight=n.get(75),this.stickyTabStops=n.get(132),this.typicalHalfwidthCharacterWidth=n.get(59).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return pW.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const n=i.verticalOffset+i.height/2,o=e.viewModel.getLineCount();let s,r=null,a=null;return i.afterLineNumber!==o&&(a=new rc(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new rc(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),s=null===a?r:null===r?a:t<n?r:a,{viewZoneId:i.id,afterLineNumber:i.afterLineNumber,positionBefore:r,positionAfter:a,position:s}}return null}getFullLineRangeAtCoord(e){if(this._context.viewLayout.isAfterLines(e)){const e=this._context.viewModel.getLineCount(),t=this._context.viewModel.getLineMaxColumn(e);return{range:new Yu(e,t,e,t),isAfterLines:!0}}const t=this._context.viewLayout.getLineNumberAtVerticalOffset(e),i=this._context.viewModel.getLineMaxColumn(t);return{range:new Yu(t,1,t,i),isAfterLines:!1}}getLineNumberAtVerticalOffset(e){return this._context.viewLayout.getLineNumberAtVerticalOffset(e)}isAfterLines(e){return this._context.viewLayout.isAfterLines(e)}isInTopPadding(e){return this._context.viewLayout.isInTopPadding(e)}isInBottomPadding(e){return this._context.viewLayout.isInBottomPadding(e)}getVerticalOffsetForLineNumber(e){return this._context.viewLayout.getVerticalOffsetForLineNumber(e)}findAttribute(e,t){return pW._findAttribute(e,t,this._viewHelper.viewDomNode)}static _findAttribute(e,t,i){for(;e&&e!==e.ownerDocument.body;){if(e.hasAttribute&&e.hasAttribute(t))return e.getAttribute(t);if(e===i)return null;e=e.parentNode}return null}getLineWidth(e){return this._viewHelper.getLineWidth(e)}isRtl(e){return this.viewModel.getTextDirection(e)===pg.RTL}visibleRangeForPosition(e,t){return this._viewHelper.visibleRangeForPosition(e,t)}getPositionFromDOMInfo(e,t){return this._viewHelper.getPositionFromDOMInfo(e,t)}getCurrentScrollTop(){return this._context.viewLayout.getCurrentScrollTop()}getCurrentScrollLeft(){return this._context.viewLayout.getCurrentScrollLeft()}}class mW{constructor(e,t,i,n){this.editorPos=t,this.pos=i,this.relativePos=n,this.mouseVerticalOffset=Math.max(0,e.getCurrentScrollTop()+this.relativePos.y),this.mouseContentHorizontalOffset=e.getCurrentScrollLeft()+this.relativePos.x-e.layoutInfo.contentLeft,this.isInMarginArea=this.relativePos.x<e.layoutInfo.contentLeft&&this.relativePos.x>=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,bW._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class fW extends mW{get target(){return this._useHitTestTarget?this.hitTestResult.value.hitTarget:this._eventTarget}get targetPath(){return this._targetPathCacheElement!==this.target&&(this._targetPathCacheElement=this.target,this._targetPathCacheValue=IB.collect(this.target,this._ctx.viewDomNode)),this._targetPathCacheValue}constructor(e,t,i,n,o){super(e,t,i,n),this.hitTestResult=new Oi((()=>bW.doHitTest(this._ctx,this))),this._targetPathCacheElement=null,this._targetPathCacheValue=new Uint8Array(0),this._ctx=e,this._eventTarget=o;const s=Boolean(this._eventTarget);this._useHitTestTarget=!s}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}\n\ttarget: ${this.target?this.target.outerHTML:null}`}get wouldBenefitFromHitTestTargetSwitch(){return!this._useHitTestTarget&&null!==this.hitTestResult.value.hitTarget&&this.target!==this.hitTestResult.value.hitTarget}switchToHitTestTarget(){this._useHitTestTarget=!0}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?Eg.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return uW.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return uW.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,i,n){return uW.createMargin(e,this.target,this._getMouseColumn(t),t,i,n)}fulfillViewZone(e,t,i){return uW.createViewZone(e,this.target,this._getMouseColumn(t),t,i)}fulfillContentText(e,t,i){return uW.createContentText(this.target,this._getMouseColumn(e),e,t,i)}fulfillContentEmpty(e,t){return uW.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return uW.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return uW.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return uW.createOverlayWidget(this.target,this._getMouseColumn(),e)}}const _W={isAfterLines:!0};function vW(e){return{isAfterLines:!1,horizontalDistanceToText:e}}class bW{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=IB.collect(t,this._viewHelper.viewDomNode);return!!(gW.isChildOfContentWidgets(i)||gW.isChildOfOverflowingContentWidgets(i)||gW.isChildOfOverlayWidgets(i)||gW.isChildOfOverflowingOverlayWidgets(i))}createMouseTarget(e,t,i,n,o){const s=new pW(this._context,this._viewHelper,e),r=new fW(s,t,i,n,o);try{const e=bW._createMouseTarget(s,r);if(6===e.type&&s.stickyTabStops&&null!==e.position){const t=bW._snapToSoftTabBoundary(e.position,s.viewModel),i=Yu.fromPositions(t,t).plusRange(e.range);return r.fulfillContentText(t,i,e.detail)}return e}catch(e){return r.fulfillUnknown()}}static _createMouseTarget(e,t){if(null===t.target)return t.fulfillUnknown();const i=t;let n=null;return gW.isChildOfOverflowGuard(t.targetPath)||gW.isChildOfOverflowingContentWidgets(t.targetPath)||gW.isChildOfOverflowingOverlayWidgets(t.targetPath)||(n=n||t.fulfillUnknown()),n=n||bW._hitTestContentWidget(e,i),n=n||bW._hitTestOverlayWidget(e,i),n=n||bW._hitTestMinimap(e,i),n=n||bW._hitTestScrollbarSlider(e,i),n=n||bW._hitTestViewZone(e,i),n=n||bW._hitTestMargin(e,i),n=n||bW._hitTestViewCursor(e,i),n=n||bW._hitTestTextArea(e,i),n=n||bW._hitTestViewLines(e,i),n=n||bW._hitTestScrollbar(e,i),n||t.fulfillUnknown()}static _hitTestContentWidget(e,t){if(gW.isChildOfContentWidgets(t.targetPath)||gW.isChildOfOverflowingContentWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillContentWidget(i):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(gW.isChildOfOverlayWidgets(t.targetPath)||gW.isChildOfOverflowingOverlayWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillOverlayWidget(i):t.fulfillUnknown()}return null}static _hitTestViewCursor(e,t){if(t.target){const i=e.lastRenderData.lastViewCursorsRenderData;for(const e of i)if(t.target===e.domNode)return t.fulfillContentText(e.position,null,{mightBeForeignElement:!1,injectedText:null})}if(t.isInContentArea){const i=e.lastRenderData.lastViewCursorsRenderData,n=t.mouseContentHorizontalOffset,o=t.mouseVerticalOffset;for(const s of i){if(n<s.contentLeft)continue;if(n>s.contentLeft+s.width)continue;const i=e.getVerticalOffsetForLineNumber(s.position.lineNumber);if(i<=o&&o<=i+s.height)return t.fulfillContentText(s.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const e=t.isInContentArea?8:5;return t.fulfillViewZone(e,i.position,i)}return null}static _hitTestTextArea(e,t){return gW.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),n=i.range.getStartPosition();let o=Math.abs(t.relativePos.x);const s={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};if(o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth){const r=e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(i.range.getStartPosition()),a=e.viewModel.glyphLanes.getLanesAtLine(r.lineNumber);return s.glyphMarginLane=a[Math.floor(o/e.lineHeight)],t.fulfillMargin(2,n,i.range,s)}return o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,n,i.range,s):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,n,i.range,s))}return null}static _hitTestViewLines(e,t){if(!gW.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new rc(1,1),_W);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const i=e.viewModel.getLineCount(),n=e.viewModel.getLineMaxColumn(i);return t.fulfillContentEmpty(new rc(i,n),_W)}if(gW.isStrictChildOfViewLines(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineLength(i),o=e.getLineWidth(i);if(0===n){const e=vW(t.mouseContentHorizontalOffset-o);return t.fulfillContentEmpty(new rc(i,1),e)}if(e.isRtl(i)){if(t.mouseContentHorizontalOffset+o<=e.layoutInfo.contentWidth-e.layoutInfo.verticalScrollbarWidth){const n=vW(t.mouseContentHorizontalOffset-o),s=new rc(i,e.viewModel.getLineMaxColumn(i));return t.fulfillContentEmpty(s,n)}}else if(t.mouseContentHorizontalOffset>=o){const n=vW(t.mouseContentHorizontalOffset-o),s=new rc(i,e.viewModel.getLineMaxColumn(i));return t.fulfillContentEmpty(s,n)}}else if(e.viewLinesGpu){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(0===e.viewModel.getLineLength(i)){const n=e.getLineWidth(i),o=vW(t.mouseContentHorizontalOffset-n);return t.fulfillContentEmpty(new rc(i,1),o)}const n=e.getLineWidth(i);if(e.isRtl(i)){if(t.mouseContentHorizontalOffset+n<=e.layoutInfo.contentWidth-e.layoutInfo.verticalScrollbarWidth){const o=vW(t.mouseContentHorizontalOffset-n),s=new rc(i,e.viewModel.getLineMaxColumn(i));return t.fulfillContentEmpty(s,o)}}else if(t.mouseContentHorizontalOffset>=n){const o=vW(t.mouseContentHorizontalOffset-n),s=new rc(i,e.viewModel.getLineMaxColumn(i));return t.fulfillContentEmpty(s,o)}const o=e.viewLinesGpu.getPositionAtCoordinate(i,t.mouseContentHorizontalOffset);if(o){const e={injectedText:null,mightBeForeignElement:!1};return t.fulfillContentText(o,Yu.fromPositions(o,o),e)}}const i=t.hitTestResult.value;return 1===i.type?bW.createMouseTargetFromHitTestPosition(e,t,i.spanNode,i.position,i.injectedText):t.wouldBenefitFromHitTestTargetSwitch?(t.switchToHitTestTarget(),this._createMouseTarget(e,t)):t.fulfillUnknown()}static _hitTestMinimap(e,t){if(gW.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new rc(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(gW.isChildOfScrollableElement(t.targetPath)&&t.target&&1===t.target.nodeType){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new rc(i,n))}}return null}static _hitTestScrollbar(e,t){if(gW.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new rc(i,n))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(165),n=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return bW._getMouseColumn(n,t.get(59).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,n,o){const s=n.lineNumber,r=n.column,a=e.getLineWidth(s);if(t.mouseContentHorizontalOffset>a){const e=vW(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(n,e)}const l=e.visibleRangeForPosition(s,r);if(!l)return t.fulfillUnknown(n);const d=l.left;if(Math.abs(t.mouseContentHorizontalOffset-d)<1)return t.fulfillContentText(n,null,{mightBeForeignElement:!!o,injectedText:o});const h=[];if(h.push({offset:l.left,column:r}),r>1){const t=e.visibleRangeForPosition(s,r-1);t&&h.push({offset:t.left,column:r-1})}if(r<e.viewModel.getLineMaxColumn(s)){const t=e.visibleRangeForPosition(s,r+1);t&&h.push({offset:t.left,column:r+1})}h.sort(((e,t)=>e.offset-t.offset));const c=t.pos.toClientCoordinates(ta(e.viewDomNode)),u=i.getBoundingClientRect(),g=u.left<=c.clientX&&c.clientX<=u.right;let p=null;for(let e=1;e<h.length;e++){const i=h[e-1],o=h[e];if(i.offset<=t.mouseContentHorizontalOffset&&t.mouseContentHorizontalOffset<=o.offset){p=new Yu(s,i.column,s,o.column);const e=Math.abs(i.offset-t.mouseContentHorizontalOffset),r=Math.abs(o.offset-t.mouseContentHorizontalOffset);n=new rc(s,e<r?i.column:o.column);break}}return t.fulfillContentText(n,p,{mightBeForeignElement:!g||!!o,injectedText:o})}static _doHitTestWithCaretRangeFromPoint(e,t){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.getVerticalOffsetForLineNumber(i),o=n+e.lineHeight;if(!(i===e.viewModel.getLineCount()&&t.mouseVerticalOffset>o)){const i=Math.floor((n+o)/2);let s=t.pos.y+(i-t.mouseVerticalOffset);s<=t.editorPos.y&&(s=t.editorPos.y+1),s>=t.editorPos.y+t.editorPos.height&&(s=t.editorPos.y+t.editorPos.height-1);const r=new mB(t.pos.x,s),a=this._actualDoHitTestWithCaretRangeFromPoint(e,r.toClientCoordinates(ta(e.viewDomNode)));if(1===a.type)return a}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(ta(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=Wa(e.viewDomNode);let n;if(n=i?void 0===i.caretRangeFromPoint?function(e,t,i){const n=document.createRange();let o=e.elementFromPoint(t,i);if(o?.hasChildNodes()){for(;o&&o.firstChild&&o.firstChild.nodeType!==o.firstChild.TEXT_NODE&&o.lastChild&&o.lastChild.firstChild;)o=o.lastChild;const e=o.getBoundingClientRect(),i=ta(o),s=`${i.getComputedStyle(o,null).getPropertyValue("font-style")} ${i.getComputedStyle(o,null).getPropertyValue("font-variant")} ${i.getComputedStyle(o,null).getPropertyValue("font-weight")} ${i.getComputedStyle(o,null).getPropertyValue("font-size")}/${i.getComputedStyle(o,null).getPropertyValue("line-height")} ${i.getComputedStyle(o,null).getPropertyValue("font-family")}`,r=o.innerText;let a,l=e.left,d=0;if(t>e.left+e.width)d=r.length;else{const e=wW.getInstance();for(let i=0;i<r.length+1;i++){if(a=e.getCharWidth(r.charAt(i),s)/2,l+=a,t<l){d=i;break}l+=a}}n.setStart(o.firstChild,d),n.setEnd(o.firstChild,d)}return n}(i,t.clientX,t.clientY):i.caretRangeFromPoint(t.clientX,t.clientY):e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!n||!n.startContainer)return new lW;const o=n.startContainer;if(o.nodeType===o.TEXT_NODE){const t=o.parentNode,i=t?t.parentNode:null,s=i?i.parentNode:null;return(s&&s.nodeType===s.ELEMENT_NODE?s.className:null)===iW.CLASS_NAME?hW.createFromDOMInfo(e,t,n.startOffset):new lW(o.parentNode)}if(o.nodeType===o.ELEMENT_NODE){const t=o.parentNode,i=t?t.parentNode:null;return(i&&i.nodeType===i.ELEMENT_NODE?i.className:null)===iW.CLASS_NAME?hW.createFromDOMInfo(e,o,o.textContent.length):new lW(o)}return new lW}static _doHitTestWithCaretPositionFromPoint(e,t){const i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const t=i.offsetNode.parentNode,n=t?t.parentNode:null,o=n?n.parentNode:null;return(o&&o.nodeType===o.ELEMENT_NODE?o.className:null)===iW.CLASS_NAME?hW.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new lW(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const t=i.offsetNode.parentNode,n=t&&t.nodeType===t.ELEMENT_NODE?t.className:null,o=t?t.parentNode:null,s=o&&o.nodeType===o.ELEMENT_NODE?o.className:null;if(n===iW.CLASS_NAME){const t=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(t)return hW.createFromDOMInfo(e,t,0)}else if(s===iW.CLASS_NAME)return hW.createFromDOMInfo(e,i.offsetNode,0)}return new lW(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:n}=t.model.getOptions(),o=Zk.atomicPosition(i,e.column-1,n,2);return-1!==o?new rc(e.lineNumber,o+1):e}static doHitTest(e,t){let i=new lW;if("function"==typeof e.viewDomNode.ownerDocument.caretRangeFromPoint?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(ta(e.viewDomNode)))),1===i.type){const t=e.viewModel.getInjectedTextAt(i.position),n=e.viewModel.normalizePosition(i.position,2);!t&&n.equals(i.position)||(i=new dW(n,i.spanNode,t))}return i}}class wW{static{this._INSTANCE=null}static getInstance(){return wW._INSTANCE||(wW._INSTANCE=new wW),wW._INSTANCE}constructor(){this._cache={},this._canvas=document.createElement("canvas")}getCharWidth(e,t){const i=e+t;if(this._cache[i])return this._cache[i];const n=this._canvas.getContext("2d");n.font=t;const o=n.measureText(e).width;return this._cache[i]=o,o}}class CW extends At{constructor(e,t,i,n){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=this._createDragScrollingOperation(e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class yW extends At{constructor(e,t,i,n,o,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._position=o,this._mouseEvent=s,this._lastTime=Date.now(),this._animationFrameDisposable=Ca(ta(s.browserEvent),(()=>this._execute()))}dispose(){this._animationFrameDisposable.dispose(),super.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){const e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}}class SW extends CW{_createDragScrollingOperation(e,t){return new xW(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}}class xW extends yW{_getScrollSpeed(){const e=this._context.configuration.options.get(75),t=this._context.configuration.options.get(165).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(75),t=this._getScrollSpeed()*(this._tick()/1e3)*e,i="above"===this._position.outsidePosition?-t:t;this._context.viewModel.viewLayout.deltaScrollNow(0,i),this._viewHelper.renderNow();const n=this._context.viewLayout.getLinesViewportData(),o="above"===this._position.outsidePosition?n.startLineNumber:n.endLineNumber;let s;{const e=bB(this._viewHelper.viewDomNode),t=this._context.configuration.options.get(165).horizontalScrollbarHeight,i=new mB(this._mouseEvent.pos.x,e.y+e.height-t-.1),n=wB(this._viewHelper.viewDomNode,e,i);s=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),e,i,n,null)}s.position&&s.position.lineNumber===o||(s="above"===this._position.outsidePosition?uW.createOutsideEditor(this._position.mouseColumn,new rc(o,1),"above",this._position.outsideDistance):uW.createOutsideEditor(this._position.mouseColumn,new rc(o,this._context.viewModel.getLineMaxColumn(o)),"below",this._position.outsideDistance)),this._dispatchMouse(s,!0,2),this._animationFrameDisposable=Ca(ta(s.element),(()=>this._execute()))}}class kW extends CW{_createDragScrollingOperation(e,t){return new LW(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}}class LW extends yW{_getScrollSpeed(){const e=this._context.configuration.options.get(59).typicalFullwidthCharacterWidth,t=this._context.configuration.options.get(165).contentWidth/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(59).typicalFullwidthCharacterWidth,t=this._getScrollSpeed()*(this._tick()/1e3)*e*.5,i="left"===this._position.outsidePosition?-t:t;if(this._context.viewModel.viewLayout.deltaScrollNow(i,0),this._viewHelper.renderNow(),!this._position.position)return;const n=this._position.position.lineNumber;let o;{const e=bB(this._viewHelper.viewDomNode),t=this._context.configuration.options.get(165).horizontalScrollbarHeight,i=new mB(this._mouseEvent.pos.x,e.y+e.height-t-.1),n=wB(this._viewHelper.viewDomNode,e,i);o=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),e,i,n,null)}o="left"===this._position.outsidePosition?uW.createOutsideEditor(o.mouseColumn,new rc(n,o.mouseColumn),"left",this._position.outsideDistance):uW.createOutsideEditor(o.mouseColumn,new rc(n,o.mouseColumn),"right",this._position.outsideDistance),this._dispatchMouse(o,!0,2),this._animationFrameDisposable=Ca(ta(o.element),(()=>this._execute()))}}class DW extends EB{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new bW(this._context,i),this._mouseDownOperation=this._register(new EW(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,((e,t)=>this._createMouseTarget(e,t)),(e=>this._getMouseColumn(e)))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(165).height;const n=new yB(this.viewHelper.viewDomNode);this._register(n.onContextMenu(this.viewHelper.viewDomNode,(e=>this._onContextMenu(e,!0)))),this._register(n.onMouseMove(this.viewHelper.viewDomNode,(e=>{this._onMouseMove(e),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=ga(this.viewHelper.viewDomNode.ownerDocument,"mousemove",(e=>{this.viewHelper.viewDomNode.contains(e.target)||this._onMouseLeave(new CB(e,!1,this.viewHelper.viewDomNode))})))}))),this._register(n.onMouseUp(this.viewHelper.viewDomNode,(e=>this._onMouseUp(e)))),this._register(n.onMouseLeave(this.viewHelper.viewDomNode,(e=>this._onMouseLeave(e))));let o=0;this._register(n.onPointerDown(this.viewHelper.viewDomNode,((e,t)=>{o=t}))),this._register(ga(this.viewHelper.viewDomNode,Qa.POINTER_UP,(e=>{this._mouseDownOperation.onPointerUp()}))),this._register(n.onMouseDown(this.viewHelper.viewDomNode,(e=>this._onMouseDown(e,o)))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=sA.INSTANCE;let t=0,i=ZF.getZoomLevel(),n=!1,o=0;function s(e){return $?(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey:e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey}this._register(ga(this.viewHelper.viewDomNode,Qa.MOUSE_WHEEL,(r=>{if(this.viewController.emitMouseWheel(r),!this._context.configuration.options.get(84))return;const a=new et(r);if(e.acceptStandardWheelEvent(a),e.isPhysicalMouseWheel()){if(s(r)){const e=ZF.getZoomLevel(),t=a.deltaY>0?1:-1;ZF.setZoomLevel(e+t),a.preventDefault(),a.stopPropagation()}}else Date.now()-t>50&&(i=ZF.getZoomLevel(),n=s(r),o=0),t=Date.now(),o+=a.deltaY,n&&(ZF.setZoomLevel(i+o/5),a.preventDefault(),a.stopPropagation())}),{capture:!0,passive:!1}))}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(165)){const e=this._context.configuration.options.get(165).height;this._height!==e&&(this._height=e,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const i=new fB(e,t).toPageCoordinates(ta(this.viewHelper.viewDomNode)),n=bB(this.viewHelper.viewDomNode);if(i.y<n.y||i.y>n.y+n.height||i.x<n.x||i.x>n.x+n.width)return null;const o=wB(this.viewHelper.viewDomNode,n,i);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),n,i,o,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const t=Wa(this.viewHelper.viewDomNode);t&&(i=t.elementsFromPoint(e.posx,e.posy).find((e=>this.viewHelper.viewDomNode.contains(e))))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),this._mouseDownOperation.isActive()||e.timestamp<this.lastMouseLeaveTime||this.viewController.emitMouseMove({event:e,target:this._createMouseTarget(e,!0)})}_onMouseLeave(e){this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),this.lastMouseLeaveTime=(new Date).getTime(),this.viewController.emitMouseLeave({event:e,target:null})}_onMouseUp(e){this.viewController.emitMouseUp({event:e,target:this._createMouseTarget(e,!0)})}_onMouseDown(e,t){const i=this._createMouseTarget(e,!0),n=6===i.type||7===i.type,o=2===i.type||3===i.type||4===i.type,s=3===i.type,r=this._context.configuration.options.get(125),a=8===i.type||5===i.type,l=9===i.type;let d=e.leftButton||e.middleButton;$&&e.leftButton&&e.ctrlKey&&(d=!1);const h=()=>{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(n||s&&r))h(),this._mouseDownOperation.start(i.type,e,t);else if(o)e.preventDefault();else if(a){const n=i.detail;d&&this.viewHelper.shouldSuppressMouseDownOnViewZone(n.viewZoneId)&&(h(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else l&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(h(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}}class EW extends At{constructor(e,t,i,n,o,s){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=n,this._createMouseTarget=o,this._getMouseColumn=s,this._mouseMoveMonitor=this._register(new xB(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new SW(this._context,this._viewHelper,this._mouseTargetFactory,((e,t,i)=>this._dispatchMouse(e,t,i)))),this._leftRightDragScrolling=this._register(new kW(this._context,this._viewHelper,this._mouseTargetFactory,((e,t,i)=>this._dispatchMouse(e,t,i)))),this._mouseState=new NW,this._currentSelection=new Qu(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):13===t.type?"above"===t.outsidePosition||"below"===t.outsidePosition?(this._topBottomDragScrolling.start(t,e),this._leftRightDragScrolling.stop()):(this._leftRightDragScrolling.start(t,e),this._topBottomDragScrolling.stop()):(this._topBottomDragScrolling.stop(),this._leftRightDragScrolling.stop(),this._dispatchMouse(t,!0,1)))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(3===e),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const n=this._findMousePosition(t,!0);if(!n||!n.position)return;this._mouseState.trySetCount(t.detail,n.position),t.detail=this._mouseState.count;const o=this._context.configuration.options;if(!o.get(104)&&o.get(42)&&!o.get(28)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&6===n.type&&n.position&&this._currentSelection.containsPosition(n.position))return this._mouseState.isDragAndDrop=!0,this._isActive=!0,void this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,(e=>this._onMouseDownThenMove(e)),(e=>{const t=this._findMousePosition(this._lastMouseEvent,!1);Ya(e)?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:t?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()}));this._mouseState.isDragAndDrop=!1,this._dispatchMouse(n,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,(e=>this._onMouseDownThenMove(e)),(()=>this._stop())))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop(),this._leftRightDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.viewModel,n=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posy<t.y){const i=t.y-e.posy,s=Math.max(n.getCurrentScrollTop()-i,0),r=pW.getZoneAtCoord(this._context,s);if(r){const e=this._helpPositionJumpOverViewZone(r);if(e)return uW.createOutsideEditor(o,e,"above",i)}const a=n.getLineNumberAtVerticalOffset(s);return uW.createOutsideEditor(o,new rc(a,1),"above",i)}if(e.posy>t.y+t.height){const s=e.posy-t.y-t.height,r=n.getCurrentScrollTop()+e.relativePos.y,a=pW.getZoneAtCoord(this._context,r);if(a){const e=this._helpPositionJumpOverViewZone(a);if(e)return uW.createOutsideEditor(o,e,"below",s)}const l=n.getLineNumberAtVerticalOffset(r);return uW.createOutsideEditor(o,new rc(l,i.getLineMaxColumn(l)),"below",s)}const s=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+e.relativePos.y),r=this._context.configuration.options.get(165),a=r.contentLeft;if(e.relativePos.x<=a){const t=a-e.relativePos.x;return uW.createOutsideEditor(o,new rc(s,1),"left",t)}const l=0===r.minimap.minimapLeft?r.width-r.verticalScrollbarWidth:r.minimap.minimapLeft;if(e.relativePos.x>=l){const t=e.relativePos.x-l;return uW.createOutsideEditor(o,new rc(s,i.getLineMaxColumn(s)),"right",t)}return null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const n=this._createMouseTarget(e,t);if(!n.position)return null;if(8===n.type||5===n.type){const e=this._helpPositionJumpOverViewZone(n.detail);if(e)return uW.createViewZone(n.type,n.element,n.mouseColumn,e,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new rc(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,n=e.positionAfter;return i&&n?i.isBefore(t)?i:n:null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:6===e.type&&null!==e.detail.injectedText})}}class NW{static{this.CLEAR_MOUSE_DOWN_COUNT_TIME=400}get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const i=(new Date).getTime();i-this._lastSetMouseDownCountTime>NW.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}class IW{static{this.EMPTY=new IW("",0,0,null,void 0)}constructor(e,t,i,n,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=n,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),n=e.getSelectionStart(),o=e.getSelectionEnd();let s;return t&&i.substring(0,n)===t.value.substring(0,t.selectionStart)&&(s=t.newlineCountBeforeSelection),new IW(i,n,o,null,s)}collapseSelection(){return this.selectionStart===this.value.length?this:new IW(this.value,this.value.length,this.value.length,null,void 0)}isWrittenToTextArea(e,t){const i=this.value===e.getValue();return t?this.selectionStart===e.getSelectionStart()&&this.selectionEnd===e.getSelectionEnd()&&i:i}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){if(e<=this.selectionStart){const t=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,t,-1)}if(e>=this.selectionEnd){const t=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,t,1)}const t=this.value.substring(this.selectionStart,e);if(-1===t.indexOf(String.fromCharCode(8230)))return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,t,1);const i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,i,-1)}_finishDeduceEditorPosition(e,t,i){let n=0,o=-1;for(;-1!==(o=t.indexOf("\n",o+1));)n++;return[e,i*t.length,n]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const n=Math.min(rn(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(an(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd),s=(e.value.substring(n,e.value.length-o),t.value.substring(n,t.value.length-o)),r=e.selectionStart-n,a=e.selectionEnd-n;if(t.selectionStart-n===t.selectionEnd-n){return{text:s,replacePrevCharCnt:e.selectionStart-n,replaceNextCharCnt:0,positionDelta:0}}return{text:s,replacePrevCharCnt:a-r,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(rn(e.value,t.value),e.selectionEnd),n=Math.min(an(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-n),s=t.value.substring(i,t.value.length-n),r=(e.selectionStart,e.selectionEnd-i),a=(t.selectionStart,t.selectionEnd-i);return{text:s,replacePrevCharCnt:r,replaceNextCharCnt:o.length-r,positionDelta:a-s.length}}static fromScreenReaderContentState(e){return new IW(e.value,e.selectionStart,e.selectionEnd,e.selection,e.newlineCountBeforeSelection)}}var TW,MW=function(e,t){return function(i,n){t(i,n,e)}};!function(e){e.Tap="-monaco-textarea-synthetic-tap"}(TW||(TW={}));class AW{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){const t={text:e=e||"",replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}let RW=class extends At{get textAreaState(){return this._textAreaState}constructor(e,t,i,n,o,s){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._accessibilityService=o,this._logService=s,this._onFocus=this._register(new Zt),this.onFocus=this._onFocus.event,this._onBlur=this._register(new Zt),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new Zt),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new Zt),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new Zt),this.onCut=this._onCut.event,this._onPaste=this._register(new Zt),this.onPaste=this._onPaste.event,this._onType=this._register(new Zt),this.onType=this._onType.event,this._onCompositionStart=this._register(new Zt),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new Zt),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new Zt),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new Zt),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new Rt),this._asyncTriggerCut=this._register(new Ci((()=>this._onCut.fire()),0)),this._textAreaState=IW.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent("ctor"),this._register(zt.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,(()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new Ci((()=>this.writeNativeTextAreaContent("asyncFocusGain")),0)):this._asyncFocusGainWriteScreenReaderContent.clear()}))),this._hasFocus=!1,this._currentComposition=null;let r=null;this._register(this._textArea.onKeyDown((e=>{const t=new Ze(e);(114===t.keyCode||this._currentComposition&&1===t.keyCode)&&t.stopPropagation(),t.equals(9)&&t.preventDefault(),r=t,this._onKeyDown.fire(t)}))),this._register(this._textArea.onKeyUp((e=>{const t=new Ze(e);this._onKeyUp.fire(t)}))),this._register(this._textArea.onCompositionStart((e=>{const t=new AW;if(this._currentComposition)this._currentComposition=t;else{if(this._currentComposition=t,2===this._OS&&r&&r.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===e.data&&("ArrowRight"===r.code||"ArrowLeft"===r.code))return t.handleCompositionUpdate("x"),void this._onCompositionStart.fire({data:e.data});this._browser.isAndroid,this._onCompositionStart.fire({data:e.data})}}))),this._register(this._textArea.onCompositionUpdate((e=>{const t=this._currentComposition;if(!t)return;if(this._browser.isAndroid){const t=IW.readFromTextArea(this._textArea,this._textAreaState),i=IW.deduceAndroidCompositionInput(this._textAreaState,t);return this._textAreaState=t,this._onType.fire(i),void this._onCompositionUpdate.fire(e)}const i=t.handleCompositionUpdate(e.data);this._textAreaState=IW.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(i),this._onCompositionUpdate.fire(e)}))),this._register(this._textArea.onCompositionEnd((e=>{const t=this._currentComposition;if(!t)return;if(this._currentComposition=null,this._browser.isAndroid){const e=IW.readFromTextArea(this._textArea,this._textAreaState),t=IW.deduceAndroidCompositionInput(this._textAreaState,e);return this._textAreaState=e,this._onType.fire(t),void this._onCompositionEnd.fire()}const i=t.handleCompositionUpdate(e.data);this._textAreaState=IW.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(i),this._onCompositionEnd.fire()}))),this._register(this._textArea.onInput((e=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const t=IW.readFromTextArea(this._textArea,this._textAreaState),i=IW.deduceInput(this._textAreaState,t,2===this._OS);(0!==i.replacePrevCharCnt||1!==i.text.length||!ln(i.text.charCodeAt(0))&&127!==i.text.charCodeAt(0))&&(this._textAreaState=t,""===i.text&&0===i.replacePrevCharCnt&&0===i.replaceNextCharCnt&&0===i.positionDelta||("insertFromPaste"===e.inputType?this._onPaste.fire({text:i.text,metadata:aD.INSTANCE.get(i.text)}):this._onType.fire(i)))}))),this._register(this._textArea.onCut((e=>{this._logService.trace("TextAreaInput#onCut",e),this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(e),this._asyncTriggerCut.schedule()}))),this._register(this._textArea.onCopy((e=>{this._logService.trace("TextAreaInput#onCopy",e),this._ensureClipboardGetsEditorSelection(e)}))),this._register(this._textArea.onPaste((e=>{if(this._logService.trace("TextAreaInput#onPaste",e),this._textArea.setIgnoreSelectionChangeTime("received paste event"),e.preventDefault(),!e.clipboardData)return;let[t,i]=dD.getTextData(e.clipboardData);this._logService.trace("TextAreaInput#onPaste with id : ",i?.id," with text.length: ",t.length),t&&(i=i||aD.INSTANCE.get(t),this._logService.trace("TextAreaInput#onPaste (before onPaste)"),this._onPaste.fire({text:t,metadata:i}))}))),this._register(this._textArea.onFocus((()=>{const e=this._hasFocus;this._setHasFocus(!0),this._accessibilityService.isScreenReaderOptimized()&&this._browser.isSafari&&!e&&this._hasFocus&&(this._asyncFocusGainWriteScreenReaderContent.value||(this._asyncFocusGainWriteScreenReaderContent.value=new Ci((()=>this.writeNativeTextAreaContent("asyncFocusGain")),0)),this._asyncFocusGainWriteScreenReaderContent.value.schedule())}))),this._register(this._textArea.onBlur((()=>{this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)}))),this._register(this._textArea.onSyntheticTap((()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())})))}_installSelectionChangeListener(){let e=0;return ga(this._textArea.ownerDocument,"selectionchange",(t=>{if(pB.onSelectionChange(),!this._hasFocus)return;if(this._currentComposition)return;if(!this._browser.isChrome)return;const i=Date.now(),n=i-e;if(e=i,n<5)return;const o=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100)return;if(!this._textAreaState.selection)return;const s=this._textArea.getValue();if(this._textAreaState.value!==s)return;const r=this._textArea.getSelectionStart(),a=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===r&&this._textAreaState.selectionEnd===a)return;const l=this._textAreaState.deduceEditorPosition(r),d=this._host.deduceModelPosition(l[0],l[1],l[2]),h=this._textAreaState.deduceEditorPosition(a),c=this._host.deduceModelPosition(h[0],h[1],h[2]),u=new Qu(d.lineNumber,d.column,c.lineNumber,c.column);this._onSelectionChangeRequest.fire(u)}))}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeNativeTextAreaContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.isWrittenToTextArea(this._textArea,this._hasFocus)||this._logService.trace(`writeTextAreaState(reason: ${e})`),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeNativeTextAreaContent(e){!this._accessibilityService.isScreenReaderOptimized()&&"render"===e||this._currentComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent())}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy();let i;this._logService.getLevel()===xu.Trace&&(i=_C());const n={version:1,id:i,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};aD.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,"\n"):t.text,n),e.preventDefault(),e.clipboardData&&dD.setTextData(e.clipboardData,t.text,t.html,n),this._logService.trace("TextAreaEditContextInput#_ensureClipboardGetsEditorSelection with id : ",i," with text.length: ",t.text.length)}};RW=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([MW(4,rB),MW(5,yu)],RW);class OW extends At{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this._onSyntheticTap=this._register(new Zt),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this.onKeyDown=this._register(new OM(this._actual,"keydown")).event,this.onKeyPress=this._register(new OM(this._actual,"keypress")).event,this.onKeyUp=this._register(new OM(this._actual,"keyup")).event,this.onCompositionStart=this._register(new OM(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new OM(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new OM(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new OM(this._actual,"beforeinput")).event,this.onInput=this._register(new OM(this._actual,"input")).event,this.onCut=this._register(new OM(this._actual,"cut")).event,this.onCopy=this._register(new OM(this._actual,"copy")).event,this.onPaste=this._register(new OM(this._actual,"paste")).event,this.onFocus=this._register(new OM(this._actual,"focus")).event,this.onBlur=this._register(new OM(this._actual,"blur")).event,this._register(this.onKeyDown((()=>pB.onKeyDown()))),this._register(this.onBeforeInput((()=>pB.onBeforeInput()))),this._register(this.onInput((()=>pB.onInput()))),this._register(this.onKeyUp((()=>pB.onKeyUp()))),this._register(ga(this._actual,TW.Tap,(()=>this._onSyntheticTap.fire())))}hasFocus(){const e=Wa(this._actual);return e?e.activeElement===this._actual:!!this._actual.isConnected&&Va()===this._actual}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return"backward"===this._actual.selectionDirection?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return"backward"===this._actual.selectionDirection?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const n=this._actual;let o=null;const s=Wa(n);o=s?s.activeElement:Va();const r=ta(o),a=o===n,l=n.selectionStart,d=n.selectionEnd;if(a&&l===t&&d===i)c&&r.parent!==r&&n.focus();else{if(a)return this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),void(c&&r.parent!==r&&n.focus());try{const e=function(e){const t=[];for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)t[i]=e.scrollTop,e=e.parentNode;return t}(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),function(e,t){for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)e.scrollTop!==t[i]&&(e.scrollTop=t[i]),e=e.parentNode}(n,e)}catch(e){}}}}class PW extends DW{constructor(e,t,i){super(e,t,i),this._register(JT.addTarget(this.viewHelper.linesContentDomNode)),this._register(ga(this.viewHelper.linesContentDomNode,XT.Tap,(e=>this.onTap(e)))),this._register(ga(this.viewHelper.linesContentDomNode,XT.Change,(e=>this.onChange(e)))),this._register(ga(this.viewHelper.linesContentDomNode,XT.Contextmenu,(e=>this._onContextMenu(new CB(e,!1,this.viewHelper.viewDomNode),!1)))),this._lastPointerType="mouse",this._register(ga(this.viewHelper.linesContentDomNode,"pointerdown",(e=>{const t=e.pointerType;this._lastPointerType="mouse"!==t?"touch"===t?"touch":"pen":"mouse"})));const n=new SB(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,(e=>this._onMouseMove(e)))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,(e=>this._onMouseUp(e)))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,(e=>this._onMouseLeave(e)))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,((e,t)=>this._onMouseDown(e,t))))}onTap(e){e.initialTarget&&this.viewHelper.linesContentDomNode.contains(e.initialTarget)&&(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){"touch"===this._lastPointerType&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),"pen"===this._lastPointerType&&this._dispatchGesture(e,!0)}_dispatchGesture(e,t){const i=this._createMouseTarget(new CB(e,!1,this.viewHelper.viewDomNode),!1);i.position&&this.viewController.dispatchMouse({position:i.position,mouseColumn:i.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:6===i.type&&null!==i.detail.injectedText})}_onMouseDown(e,t){"touch"!==e.browserEvent.pointerType&&super._onMouseDown(e,t)}}class FW extends DW{constructor(e,t,i){super(e,t,i),this._register(JT.addTarget(this.viewHelper.linesContentDomNode)),this._register(ga(this.viewHelper.linesContentDomNode,XT.Tap,(e=>this.onTap(e)))),this._register(ga(this.viewHelper.linesContentDomNode,XT.Change,(e=>this.onChange(e)))),this._register(ga(this.viewHelper.linesContentDomNode,XT.Contextmenu,(e=>this._onContextMenu(new CB(e,!1,this.viewHelper.viewDomNode),!1))))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new CB(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const e=document.createEvent("CustomEvent");e.initEvent(TW.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(e),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class BW extends At{constructor(e,t,i){super(),(X||ge&&J)&&pe?this.handler=this._register(new PW(e,t,i)):r.TouchEvent?this.handler=this._register(new FW(e,t,i)):this.handler=this._register(new DW(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class WW{constructor(e,t,i,n){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=n}paste(e,t,i,n){this.commandDelegate.paste(e,t,i,n)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,n){this.commandDelegate.compositionType(e,t,i,n)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){GL.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<t?new rc(e.lineNumber,t):e}_hasMulticursorModifier(e){switch(this.configuration.options.get(86)){case"altKey":return e.altKey;case"ctrlKey":return e.ctrlKey;case"metaKey":return e.metaKey;default:return!1}}_hasNonMulticursorModifier(e){switch(this.configuration.options.get(86)){case"altKey":return e.ctrlKey||e.metaKey;case"ctrlKey":return e.altKey||e.metaKey;case"metaKey":return e.ctrlKey||e.altKey;default:return!1}}dispatchMouse(e){const t=this.configuration.options,i=G&&t.get(121),n=t.get(28),o=t.get(171);e.middleButton&&!i?o||this._columnSelect(e.position,e.mouseColumn,e.inSelectionMode):e.startedOnLineNumbers?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelect(e.position,e.revealType):this._createCursor(e.position,!0):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount>=4?this._selectAll():3===e.mouseDownCount?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):2===e.mouseDownCount?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey||n?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){GL.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){GL.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),GL.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),GL.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){GL.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){GL.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){GL.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){GL.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){GL.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){GL.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){GL.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){GL.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){GL.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}class VW{constructor(e){this._lineFactory=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new Ve("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(0===this.getCount())return null;const i=this.getStartLineNumber(),n=this.getEndLineNumber();if(t<i){const i=t-e+1;return this._rendLineNumberStart-=i,null}if(e>n)return null;let o=0,s=0;for(let r=i;r<=n;r++){const i=r-this._rendLineNumberStart;e<=r&&r<=t&&(0===s?(o=i,s=1):s++)}if(e<i){let n=0;n=t<i?t-e+1:i-e,this._rendLineNumberStart-=n}return this._lines.splice(o,s)}onLinesChanged(e,t){const i=e+t-1;if(0===this.getCount())return!1;const n=this.getStartLineNumber(),o=this.getEndLineNumber();let s=!1;for(let t=e;t<=i;t++)t>=n&&t<=o&&(this._lines[t-this._rendLineNumberStart].onContentChanged(),s=!0);return s}onLinesInserted(e,t){if(0===this.getCount())return null;const i=t-e+1,n=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=n)return this._rendLineNumberStart+=i,null;if(e>o)return null;if(i+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const s=[];for(let e=0;e<i;e++)s[e]=this._lineFactory.createLine();const r=e-this._rendLineNumberStart,a=this._lines.slice(0,r),l=this._lines.slice(r,this._lines.length-i),d=this._lines.slice(this._lines.length-i,this._lines.length);return this._lines=a.concat(s).concat(l),d}onTokensChanged(e){if(0===this.getCount())return!1;const t=this.getStartLineNumber(),i=this.getEndLineNumber();let n=!1;for(let o=0,s=e.length;o<s;o++){const s=e[o];if(s.toLineNumber<t||s.fromLineNumber>i)continue;const r=Math.max(t,s.fromLineNumber),a=Math.min(i,s.toLineNumber);for(let e=r;e<=a;e++){const t=e-this._rendLineNumberStart;this._lines[t].onTokensChanged(),n=!0}}return n}}class HW{constructor(e,t){this._viewContext=e,this._lineFactory=t,this.domNode=this._createDomNode(),this._linesCollection=new VW(this._lineFactory)}_createDomNode(){const e=tT(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(165)}onFlushed(e,t){if(t){const e=this._linesCollection.getStartLineNumber(),t=this._linesCollection.getEndLineNumber();for(let i=e;i<=t;i++)this._linesCollection.getLine(i).getDomNode()?.remove()}return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let e=0,i=t.length;e<i;e++){const i=t[e].getDomNode();i?.remove()}return!0}onLinesInserted(e){const t=this._linesCollection.onLinesInserted(e.fromLineNumber,e.toLineNumber);if(t)for(let e=0,i=t.length;e<i;e++){const i=t[e].getDomNode();i?.remove()}return!0}onScrollChanged(e){return e.scrollTopChanged}onTokensChanged(e){return this._linesCollection.onTokensChanged(e.ranges)}onZonesChanged(e){return!0}getStartLineNumber(){return this._linesCollection.getStartLineNumber()}getEndLineNumber(){return this._linesCollection.getEndLineNumber()}getVisibleLine(e){return this._linesCollection.getLine(e)}renderLines(e){const t=this._linesCollection._get(),i=new zW(this.domNode.domNode,this._lineFactory,e,this._viewContext),n={rendLineNumberStart:t.rendLineNumberStart,lines:t.lines,linesLength:t.lines.length},o=i.render(n,e.startLineNumber,e.endLineNumber,e.relativeVerticalOffset);this._linesCollection._set(o.rendLineNumberStart,o.lines)}}class zW{static{this._ttPolicy=GI("editorViewLayer",{createHTML:e=>e})}constructor(e,t,i,n){this._domNode=e,this._lineFactory=t,this._viewportData=i,this._viewContext=n}render(e,t,i,n){const o={rendLineNumberStart:e.rendLineNumberStart,lines:e.lines.slice(0),linesLength:e.linesLength};if(o.rendLineNumberStart+o.linesLength-1<t||i<o.rendLineNumberStart){o.rendLineNumberStart=t,o.linesLength=i-t+1,o.lines=[];for(let e=t;e<=i;e++)o.lines[e-t]=this._lineFactory.createLine();return this._finishRendering(o,!0,n),o}if(this._renderUntouchedLines(o,Math.max(t-o.rendLineNumberStart,0),Math.min(i-o.rendLineNumberStart,o.linesLength-1),n,t),o.rendLineNumberStart>t){const e=t,s=Math.min(i,o.rendLineNumberStart-1);e<=s&&(this._insertLinesBefore(o,e,s,n,t),o.linesLength+=s-e+1)}else if(o.rendLineNumberStart<t){const e=Math.min(o.linesLength,t-o.rendLineNumberStart);e>0&&(this._removeLinesBefore(o,e),o.linesLength-=e)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1<i){const e=o.rendLineNumberStart+o.linesLength,s=i;e<=s&&(this._insertLinesAfter(o,e,s,n,t),o.linesLength+=s-e+1)}else if(o.rendLineNumberStart+o.linesLength-1>i){const e=Math.max(0,i-o.rendLineNumberStart+1),t=o.linesLength-1-e+1;t>0&&(this._removeLinesAfter(o,t),o.linesLength-=t)}return this._finishRendering(o,!1,n),o}_renderUntouchedLines(e,t,i,n,o){const s=e.rendLineNumberStart,r=e.lines;for(let e=t;e<=i;e++){const t=s+e;r[e].layoutLine(t,n[t-o],this._lineHeightForLineNumber(t))}}_insertLinesBefore(e,t,i,n,o){const s=[];let r=0;for(let e=t;e<=i;e++)s[r++]=this._lineFactory.createLine();e.lines=s.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i<t;i++){const t=e.lines[i].getDomNode();t?.remove()}e.lines.splice(0,t)}_insertLinesAfter(e,t,i,n,o){const s=[];let r=0;for(let e=t;e<=i;e++)s[r++]=this._lineFactory.createLine();e.lines=e.lines.concat(s)}_removeLinesAfter(e,t){const i=e.linesLength-t;for(let n=0;n<t;n++){const t=e.lines[i+n].getDomNode();t?.remove()}e.lines.splice(i,t)}_finishRenderingNewLines(e,t,i,n){zW._ttPolicy&&(i=zW._ttPolicy.createHTML(i));const o=this._domNode.lastChild;t||!o?this._domNode.innerHTML=i:o.insertAdjacentHTML("afterend",i);let s=this._domNode.lastChild;for(let t=e.linesLength-1;t>=0;t--){const i=e.lines[t];n[t]&&(i.setDomNode(s),s=s.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const n=document.createElement("div");zW._ttPolicy&&(t=zW._ttPolicy.createHTML(t)),n.innerHTML=t;for(let t=0;t<e.linesLength;t++){const o=e.lines[t];if(i[t]){const e=n.firstChild,t=o.getDomNode();t.parentNode.replaceChild(e,t),o.setDomNode(e)}}}static{this._sb=new Xg(1e5)}_finishRendering(e,t,i){const n=zW._sb,o=e.linesLength,s=e.lines,r=e.rendLineNumberStart,a=[];{n.reset();let l=!1;for(let e=0;e<o;e++){const t=s[e];if(a[e]=!1,t.getDomNode())continue;const o=e+r;t.renderLine(o,i[e],this._lineHeightForLineNumber(o),this._viewportData,n)&&(a[e]=!0,l=!0)}l&&this._finishRenderingNewLines(e,t,n.build(),a)}{n.reset();let t=!1;const l=[];for(let e=0;e<o;e++){const o=s[e];if(l[e]=!1,a[e])continue;const d=e+r;o.renderLine(d,i[e],this._lineHeightForLineNumber(d),this._viewportData,n)&&(l[e]=!0,t=!0)}t&&this._finishRenderingInvalidLines(e,n.build(),l)}}_lineHeightForLineNumber(e){return this._viewContext.viewLayout.getLineHeightForLineNumber(e)}}class UW extends NB{constructor(e){super(e),this._dynamicOverlays=[],this._isFocused=!1,this._visibleLines=new HW(this._context,{createLine:()=>new KW(this._dynamicOverlays)}),this.domNode=this._visibleLines.domNode;const t=this._context.configuration.options.get(59);iT(this.domNode,t),this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;e<t;e++)if(this._dynamicOverlays[e].shouldRender())return!0;return!1}dispose(){super.dispose();for(let e=0,t=this._dynamicOverlays.length;e<t;e++)this._dynamicOverlays[e].dispose();this._dynamicOverlays=[]}getDomNode(){return this.domNode}addDynamicOverlay(e){this._dynamicOverlays.push(e)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e);const t=this._context.configuration.options.get(59);return iT(this.domNode,t),!0}onFlushed(e){return this._visibleLines.onFlushed(e)}onFocusChanged(e){return this._isFocused=e.isFocused,!0}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onScrollChanged(e){return this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._visibleLines.onZonesChanged(e)}prepareRender(e){const t=this._dynamicOverlays.filter((e=>e.shouldRender()));for(let i=0,n=t.length;i<n;i++){const n=t[i];n.prepareRender(e),n.onDidRender()}}render(e){this._viewOverlaysRender(e),this.domNode.toggleClassName("focused",this._isFocused)}_viewOverlaysRender(e){this._visibleLines.renderLines(e.viewportData)}}class KW{constructor(e){this._dynamicOverlays=e,this._domNode=null,this._renderedContent=null}getDomNode(){return this._domNode?this._domNode.domNode:null}setDomNode(e){this._domNode=tT(e)}onContentChanged(){}onTokensChanged(){}renderLine(e,t,i,n,o){let s="";for(let t=0,i=this._dynamicOverlays.length;t<i;t++)s+=this._dynamicOverlays[t].render(n.startLineNumber,e);return this._renderedContent!==s&&(this._renderedContent=s,o.appendString('<div style="top:'),o.appendString(String(t)),o.appendString("px;height:"),o.appendString(String(i)),o.appendString("px;line-height:"),o.appendString(String(i)),o.appendString('px;">'),o.appendString(s),o.appendString("</div>"),!0)}layoutLine(e,t,i){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(i),this._domNode.setLineHeight(i))}}class jW extends UW{constructor(e){super(e);const t=this._context.configuration.options.get(165);this._contentWidth=t.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const t=this._context.configuration.options.get(165);return this._contentWidth=t.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class qW extends UW{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(165);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),iT(this.domNode,t.get(59))}onConfigurationChanged(e){const t=this._context.configuration.options;iT(this.domNode,t.get(59));const i=t.get(165);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class $W{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){this.onKeyDown?.(e)}emitKeyUp(e){this.onKeyUp?.(e)}emitContextMenu(e){this.onContextMenu?.(this._convertViewToModelMouseEvent(e))}emitMouseMove(e){this.onMouseMove?.(this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){this.onMouseLeave?.(this._convertViewToModelMouseEvent(e))}emitMouseDown(e){this.onMouseDown?.(this._convertViewToModelMouseEvent(e))}emitMouseUp(e){this.onMouseUp?.(this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){this.onMouseDrag?.(this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){this.onMouseDrop?.(this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){this.onMouseDropCanceled?.()}emitMouseWheel(e){this.onMouseWheel?.(e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return $W.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i={...e};return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),5!==i.type&&8!==i.type||(i.detail=this.convertViewToModelViewZoneData(i.detail,t)),i}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new rc(e.afterLineNumber,1)).lineNumber}}}var GW=i(2035),ZW={};ZW.styleTagTransform=zl(),ZW.setAttributes=Bl(),ZW.insert=Pl().bind(null,"head"),ZW.domAPI=Rl(),ZW.insertStyleElement=Vl(),Ml()(GW.A,ZW),GW.A&&GW.A.locals&&GW.A.locals;class YW extends NB{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=tT(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("blockDecorations-container"),this.update()}update(){let e=!1;const t=this._context.configuration.options.get(165),i=t.contentWidth-t.verticalScrollbarWidth;this.contentWidth!==i&&(this.contentWidth=i,e=!0);const n=t.contentLeft;return this.contentLeft!==n&&(this.contentLeft=n,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){let t=0;const i=e.getDecorationsInViewport();for(const n of i){if(!n.options.blockClassName)continue;let i,o,s=this.blocks[t];s||(s=this.blocks[t]=tT(document.createElement("div")),this.domNode.appendChild(s)),n.options.blockIsAfterEnd?(i=e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!1),o=e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!0)):(i=e.getVerticalOffsetForLineNumber(n.range.startLineNumber,!0),o=n.range.isEmpty()&&!n.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(n.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!0));const[r,a,l,d]=n.options.blockPadding??[0,0,0,0];s.setClassName("blockDecorations-block "+n.options.blockClassName),s.setLeft(this.contentLeft-d),s.setWidth(this.contentWidth+d+a),s.setTop(i-e.scrollTop-r),s.setHeight(o-i+r+l),t++}for(let e=t;e<this.blocks.length;e++)this.blocks[e].domNode.remove();this.blocks.length=t}}class QW extends NB{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=tT(document.createElement("div")),IB.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=tT(document.createElement("div")),IB.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesDeleted(e){return this._updateAnchorsViewPositions(),!0}onLinesInserted(e){return this._updateAnchorsViewPositions(),!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}_updateAnchorsViewPositions(){const e=Object.keys(this._widgets);for(const t of e)this._widgets[t].updateAnchorViewPosition()}addWidget(e){const t=new XW(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,i,n,o){this._widgets[e.getId()].setPosition(t,i,n,o),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t];delete this._widgets[t];const i=e.domNode.domNode;i.remove(),i.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return!!this._widgets.hasOwnProperty(e)&&this._widgets[e].suppressMouseDown}onBeforeRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].render(e)}}class XW{constructor(e,t,i){this._primaryAnchor=new JW(null,null),this._secondaryAnchor=new JW(null,null),this._context=e,this._viewDomNode=t,this._actual=i;const n=this._context.configuration.options,o=n.get(165),s=n.get(4);this.domNode=tT(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=!!this._actual.allowEditorOverflow&&s,this.suppressMouseDown=this._actual.suppressMouseDown||!1,this._fixedOverflowWidgets=n.get(51),this._contentWidth=o.contentWidth,this._contentLeft=o.contentLeft,this._affinity=null,this._preference=[],this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setDisplay("none"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){const t=this._context.configuration.options;if(e.hasChanged(165)){const e=t.get(165);this._contentLeft=e.contentLeft,this._contentWidth=e.contentWidth,this._maxWidth=this._getMaxWidth()}}updateAnchorViewPosition(){this._setPosition(this._affinity,this._primaryAnchor.modelPosition,this._secondaryAnchor.modelPosition)}_setPosition(e,t,i){function n(e,t,i){if(!e)return new JW(null,null);const n=t.model.validatePosition(e);if(t.coordinatesConverter.modelPositionIsVisible(n)){const o=t.coordinatesConverter.convertModelPositionToViewPosition(n,i??void 0);return new JW(e,o)}return new JW(e,null)}this._affinity=e,this._primaryAnchor=n(t,this._context.viewModel,this._affinity),this._secondaryAnchor=n(i,this._context.viewModel,this._affinity)}_getMaxWidth(){const e=this.domNode.domNode.ownerDocument,t=e.defaultView;return this.allowEditorOverflow?t?.innerWidth||e.documentElement.offsetWidth||e.body.offsetWidth:this._contentWidth}setPosition(e,t,i,n){this._setPosition(n,e,t),this._preference=i,this._primaryAnchor.viewPosition&&this._preference&&this._preference.length>0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,n){const o=e.top,s=o,r=e.top+e.height,a=o-i,l=s>=i,d=r,h=n.viewportHeight-r>=i;let c=e.left;return c+t>n.scrollLeft+n.viewportWidth&&(c=n.scrollLeft+n.viewportWidth-t),c<n.scrollLeft&&(c=n.scrollLeft),{fitsAbove:l,aboveTop:a,fitsBelow:h,belowTop:d,left:c}}_layoutHorizontalSegmentInPage(e,t,i,n){const o=Math.max(15,t.left-n),s=Math.min(t.left+t.width+n,e.width-15),r=this._viewDomNode.domNode.ownerDocument.defaultView;let a=t.left+i-(r?.scrollX??0);if(a+n>s){const e=a-(s-n);a-=e,i-=e}if(a<o){const e=a-o;a-=e,i-=e}return[i,a]}_layoutBoxInPage(e,t,i,n){const o=e.top-i,s=e.top+e.height,r=Na(this._viewDomNode.domNode),a=this._viewDomNode.domNode.ownerDocument,l=a.defaultView,d=r.top+o-(l?.scrollY??0),h=r.top+s-(l?.scrollY??0),c=ka(a.body),[u,g]=this._layoutHorizontalSegmentInPage(c,r,e.left-n.scrollLeft+this._contentLeft,t),p=d>=22,m=h+i<=c.height-22;return this._fixedOverflowWidgets?{fitsAbove:p,aboveTop:Math.max(d,22),fitsBelow:m,belowTop:h,left:g}:{fitsAbove:p,aboveTop:o,fitsBelow:m,belowTop:s,left:u}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new eV(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){return{primary:t(this._primaryAnchor.viewPosition,this._affinity),secondary:t(this._secondaryAnchor.viewPosition?.lineNumber===this._primaryAnchor.viewPosition?.lineNumber?this._secondaryAnchor.viewPosition:null,this._affinity)};function t(t,i){if(!t)return null;const n=e.visibleRangeForPosition(t);if(!n)return null;const o=1===t.column&&3===i?0:n.left,s=e.getVerticalOffsetForLineNumber(t.lineNumber)-e.scrollTop,r=e.getLineHeightForLineNumber(t.lineNumber);return new tV(s,o,r)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const n=this._context.configuration.options.get(59);let o=t.left;return o=o<e.left?Math.max(o,e.left-i+n.typicalFullwidthCharacterWidth):Math.min(o,e.left+i-n.typicalFullwidthCharacterWidth),new tV(e.top,o,e.height)}_prepareRenderWidget(e){if(!this._preference||0===this._preference.length)return null;const{primary:t,secondary:i}=this._getAnchorsCoordinates(e);if(!t)return{kind:"offViewport",preserveFocus:this.domNode.domNode.contains(this.domNode.domNode.ownerDocument.activeElement)};if(-1===this._cachedDomNodeOffsetWidth||-1===this._cachedDomNodeOffsetHeight){let e=null;if("function"==typeof this._actual.beforeRender&&(e=iV(this._actual.beforeRender,this._actual)),e)this._cachedDomNodeOffsetWidth=e.width,this._cachedDomNodeOffsetHeight=e.height;else{const e=this.domNode.domNode.getBoundingClientRect();this._cachedDomNodeOffsetWidth=Math.round(e.width),this._cachedDomNodeOffsetHeight=Math.round(e.height)}}const n=this._reduceAnchorCoordinates(t,i,this._cachedDomNodeOffsetWidth);let o;o=this.allowEditorOverflow?this._layoutBoxInPage(n,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e):this._layoutBoxInViewport(n,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e);for(let e=1;e<=2;e++)for(const t of this._preference)if(1===t){if(!o)return null;if(2===e||o.fitsAbove)return{kind:"inViewport",coordinate:new eV(o.aboveTop,o.left),position:1}}else{if(2!==t)return this.allowEditorOverflow?{kind:"inViewport",coordinate:this._prepareRenderWidgetAtExactPositionOverflowing(new eV(n.top,n.left)),position:0}:{kind:"inViewport",coordinate:new eV(n.top,n.left),position:0};if(!o)return null;if(2===e||o.fitsBelow)return{kind:"inViewport",coordinate:new eV(o.belowTop,o.left),position:2}}return null}onBeforeRender(e){this._primaryAnchor.viewPosition&&this._preference&&(this._primaryAnchor.viewPosition.lineNumber<e.startLineNumber||this._primaryAnchor.viewPosition.lineNumber>e.endLineNumber||this.domNode.setMaxWidth(this._maxWidth))}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData||"offViewport"===this._renderData.kind)return this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,"offViewport"===this._renderData?.kind&&this._renderData.preserveFocus?this.domNode.setTop(-1e3):this.domNode.setVisibility("hidden")),void("function"==typeof this._actual.afterRender&&iV(this._actual.afterRender,this._actual,null,null));this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),"function"==typeof this._actual.afterRender&&iV(this._actual.afterRender,this._actual,this._renderData.position,this._renderData.coordinate)}}class JW{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class eV{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class tV{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function iV(e,t,...i){try{return e.call(t,...i)}catch{return null}}var nV=i(8405),oV={};oV.styleTagTransform=zl(),oV.setAttributes=Bl(),oV.insert=Pl().bind(null,"head"),oV.domAPI=Rl(),oV.insertStyleElement=Vl(),Ml()(nV.A,oV),nV.A&&nV.A.locals&&nV.A.locals;class sV extends EB{}class rV extends sV{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(165);this._renderLineHighlight=t.get(110),this._renderLineHighlightOnlyWhenFocus=t.get(111),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new Qu(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=new Set;for(const e of this._selections)t.add(e.positionLineNumber);const i=Array.from(t);i.sort(((e,t)=>e-t)),es(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);const n=this._selections.every((e=>e.isEmpty()));return this._selectionIsEmpty!==n&&(this._selectionIsEmpty=n,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(165);return this._renderLineHighlight=t.get(110),this._renderLineHighlightOnlyWhenFocus=t.get(111),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return!!this._renderLineHighlightOnlyWhenFocus&&(this._focused=e.isFocused,!0)}prepareRender(e){if(!this._shouldRenderThis())return void(this._renderData=null);const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=[];for(let e=t;e<=i;e++)n[e-t]="";if(this._wordWrap){const o=this._renderOne(e,!1);for(const e of this._cursorLineNumbers){const s=this._context.viewModel.coordinatesConverter,r=s.convertViewPositionToModelPosition(new rc(e,1)).lineNumber,a=s.convertModelPositionToViewPosition(new rc(r,1)).lineNumber,l=s.convertModelPositionToViewPosition(new rc(r,this._context.viewModel.model.getLineMaxColumn(r))).lineNumber,d=Math.max(a,t),h=Math.min(l,i);for(let e=d;e<=h;e++)n[e-t]=o}}const o=this._renderOne(e,!0);for(const e of this._cursorLineNumbers)e<t||e>i||(n[e-t]=o);this._renderData=n}render(e,t){if(!this._renderData)return"";const i=t-e;return i>=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return("gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class aV extends rV{_renderOne(e,t){return`<div class="${"current-line"+(this._shouldRenderInMargin()?" current-line-both":"")+(t?" current-line-exact":"")}" style="width:${Math.max(e.scrollWidth,this._contentWidth)}px;"></div>`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class lV extends rV{_renderOne(e,t){return`<div class="${"current-line"+(this._shouldRenderInMargin()?" current-line-margin":"")+(this._shouldRenderOther()?" current-line-margin-both":"")+(this._shouldRenderInMargin()&&t?" current-line-exact-margin":"")}" style="width:${this._contentLeft}px"></div>`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}hw(((e,t)=>{const i=e.getColor(uw);if(i&&(t.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${i}; border: none; }`)),!i||i.isTransparent()||e.defines(gw)){const i=e.getColor(gw);i&&(t.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${i}; }`),nw(e.type)&&(t.addRule(".monaco-editor .view-overlays .current-line-exact { border-width: 1px; }"),t.addRule(".monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }")))}}));var dV=i(3093),hV={};hV.styleTagTransform=zl(),hV.setAttributes=Bl(),hV.insert=Pl().bind(null,"head"),hV.domAPI=Rl(),hV.insertStyleElement=Vl(),Ml()(dV.A,hV),dV.A&&dV.A.locals&&dV.A.locals;class cV extends sV{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let i=[],n=0;for(let e=0,o=t.length;e<o;e++){const o=t[e];o.options.className&&(i[n++]=o)}i=i.sort(((e,t)=>{if(e.options.zIndex<t.options.zIndex)return-1;if(e.options.zIndex>t.options.zIndex)return 1;const i=e.options.className,n=t.options.className;return i<n?-1:i>n?1:Yu.compareRangesUsingStarts(e.range,t.range)}));const o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,r=[];for(let e=o;e<=s;e++)r[e-o]="";this._renderWholeLineDecorations(e,i,r),this._renderNormalDecorations(e,i,r),this._renderResult=r}_renderWholeLineDecorations(e,t,i){const n=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber;for(let e=0,s=t.length;e<s;e++){const s=t[e];if(!s.options.isWholeLine)continue;const r='<div class="cdr '+s.options.className+'" style="left:0;width:100%;"></div>',a=Math.max(s.range.startLineNumber,n),l=Math.min(s.range.endLineNumber,o);for(let e=a;e<=l;e++)i[e-n]+=r}}_renderNormalDecorations(e,t,i){const n=e.visibleRange.startLineNumber;let o=null,s=!1,r=null,a=!1;for(let l=0,d=t.length;l<d;l++){const d=t[l];if(d.options.isWholeLine)continue;const h=d.options.className,c=Boolean(d.options.showIfCollapsed);let u=d.range;c&&1===u.endColumn&&u.endLineNumber!==u.startLineNumber&&(u=new Yu(u.startLineNumber,u.startColumn,u.endLineNumber-1,this._context.viewModel.getLineMaxColumn(u.endLineNumber-1))),o===h&&s===c&&Yu.areIntersectingOrTouching(r,u)?r=Yu.plusRange(r,u):(null!==o&&this._renderNormalDecoration(e,r,o,a,s,n,i),o=h,s=c,r=u,a=d.options.shouldFillLineOnLineBreak??!1)}null!==o&&this._renderNormalDecoration(e,r,o,a,s,n,i)}_renderNormalDecoration(e,t,i,n,o,s,r){const a=e.linesVisibleRangesForRange(t,"findMatch"===i);if(a)for(let e=0,t=a.length;e<t;e++){const t=a[e];if(t.outsideRenderedLine)continue;const l=t.lineNumber-s;if(o&&1===t.ranges.length){const e=t.ranges[0];if(e.width<this._typicalHalfwidthCharacterWidth){const i=Math.round(e.left+e.width/2),n=Math.max(0,Math.round(i-this._typicalHalfwidthCharacterWidth/2));t.ranges[0]=new RB(n,this._typicalHalfwidthCharacterWidth)}}for(let e=0,o=t.ranges.length;e<o;e++){const s=n&&t.continuesOnNextLine&&1===o,a=t.ranges[e],d='<div class="cdr '+i+'" style="left:'+String(a.left)+"px;width:"+(s?"100%;":String(a.width)+"px;")+'"></div>';r[l]+=d}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class uV extends NB{constructor(e,t,i,n){super(e);const o=this._context.configuration.options,s=o.get(117),r=o.get(83),a=o.get(49),l=o.get(120),d=o.get(158),h={listenOnDomNode:i.domNode,className:"editor-scrollable "+aw(e.theme.type),useShadows:!1,lazyRender:!0,vertical:s.vertical,horizontal:s.horizontal,verticalHasArrows:s.verticalHasArrows,horizontalHasArrows:s.horizontalHasArrows,verticalScrollbarSize:s.verticalScrollbarSize,verticalSliderSize:s.verticalSliderSize,horizontalScrollbarSize:s.horizontalScrollbarSize,horizontalSliderSize:s.horizontalSliderSize,handleMouseWheel:s.handleMouseWheel,alwaysConsumeMouseWheel:s.alwaysConsumeMouseWheel,arrowSize:s.arrowSize,mouseWheelScrollSensitivity:r,fastScrollSensitivity:a,scrollPredominantAxis:l,scrollByPage:s.scrollByPage,inertialScroll:d};this.scrollbar=this._register(new lA(t.domNode,h,this._context.viewLayout.getScrollable())),IB.write(this.scrollbar.getDomNode(),6),this.scrollbarDomNode=tT(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const c=(e,t,i)=>{const n={};if(t){const t=e.scrollTop;t&&(n.scrollTop=this._context.viewLayout.getCurrentScrollTop()+t,e.scrollTop=0)}if(i){const t=e.scrollLeft;t&&(n.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+t,e.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(n,1)};this._register(ga(i.domNode,"scroll",(e=>c(i.domNode,!0,!0)))),this._register(ga(t.domNode,"scroll",(e=>c(t.domNode,!0,!1)))),this._register(ga(n.domNode,"scroll",(e=>c(n.domNode,!0,!1)))),this._register(ga(this.scrollbarDomNode.domNode,"scroll",(e=>c(this.scrollbarDomNode.domNode,!0,!1))))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(165);this.scrollbarDomNode.setLeft(t.contentLeft),"right"===e.get(81).side?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(117)||e.hasChanged(83)||e.hasChanged(49)){const e=this._context.configuration.options,t=e.get(117),i=e.get(83),n=e.get(49),o=e.get(120),s={vertical:t.vertical,horizontal:t.horizontal,verticalScrollbarSize:t.verticalScrollbarSize,horizontalScrollbarSize:t.horizontalScrollbarSize,scrollByPage:t.scrollByPage,handleMouseWheel:t.handleMouseWheel,mouseWheelScrollSensitivity:i,fastScrollSensitivity:n,scrollPredominantAxis:o};this.scrollbar.updateOptions(s)}return e.hasChanged(165)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+aw(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}var gV=i(8081),pV={};pV.styleTagTransform=zl(),pV.setAttributes=Bl(),pV.insert=Pl().bind(null,"head"),pV.domAPI=Rl(),pV.insertStyleElement=Vl(),Ml()(gV.A,pV),gV.A&&gV.A.locals&&gV.A.locals;class mV{constructor(e,t,i,n,o){this.startLineNumber=e,this.endLineNumber=t,this.className=i,this.tooltip=n,this._decorationToRenderBrand=void 0,this.zIndex=o??0}}class fV{constructor(e,t,i){this.className=e,this.zIndex=t,this.tooltip=i}}class _V{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class vV extends sV{_render(e,t,i){const n=[];for(let i=e;i<=t;i++)n[i-e]=new _V;if(0===i.length)return n;i.sort(((e,t)=>e.className===t.className?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.className<t.className?-1:1));let o=null,s=0;for(let r=0,a=i.length;r<a;r++){const a=i[r],l=a.className,d=a.zIndex;let h=Math.max(a.startLineNumber,e)-e;const c=Math.min(a.endLineNumber,t)-e;o===l?(h=Math.max(s+1,h),s=Math.max(s,c)):(o=l,s=c);for(let e=h;e<=s;e++)n[e].add(new fV(l,d,a.tooltip))}return n}}class bV extends NB{constructor(e){super(e),this._widgets={},this._context=e;const t=this._context.configuration.options,i=t.get(165);this.domNode=tT(document.createElement("div")),this.domNode.setClassName("glyph-margin-widgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this._lineHeight=t.get(75),this._glyphMargin=t.get(66),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._glyphMarginDecorationLaneCount=i.glyphMarginDecorationLaneCount,this._managedDomNodes=[],this._decorationGlyphsToRender=[]}dispose(){this._managedDomNodes=[],this._decorationGlyphsToRender=[],this._widgets={},super.dispose()}getWidgets(){return Object.values(this._widgets)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(165);return this._lineHeight=t.get(75),this._glyphMargin=t.get(66),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._glyphMarginDecorationLaneCount=i.glyphMarginDecorationLaneCount,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}addWidget(e){const t=tT(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:e.getPosition(),domNode:t,renderInfo:null},t.setPosition("absolute"),t.setDisplay("none"),t.setAttribute("widgetId",e.getId()),this.domNode.appendChild(t),this.setShouldRender()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return!(i.preference.lane===t.lane&&i.preference.zIndex===t.zIndex&&Yu.equalsRange(i.preference.range,t.range)||(i.preference=t,this.setShouldRender(),0))}removeWidget(e){const t=e.getId();if(this._widgets[t]){const e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.remove(),this.setShouldRender()}}_collectDecorationBasedGlyphRenderRequest(e,t){const i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o=e.getDecorationsInViewport();for(const e of o){const o=e.options.glyphMarginClassName;if(!o)continue;const s=Math.max(e.range.startLineNumber,i),r=Math.min(e.range.endLineNumber,n),a=e.options.glyphMargin?.position??gg.Center,l=e.options.zIndex??0;for(let e=s;e<=r;e++){const i=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new rc(e,0)),n=this._context.viewModel.glyphLanes.getLanesAtLine(i.lineNumber).indexOf(a);t.push(new wV(e,n,l,o))}}}_collectWidgetBasedGlyphRenderRequest(e,t){const i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber;for(const e of Object.values(this._widgets)){const o=e.preference.range,{startLineNumber:s,endLineNumber:r}=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(Yu.lift(o));if(!s||!r||r<i||s>n)continue;const a=Math.max(s,i),l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new rc(a,0)),d=this._context.viewModel.glyphLanes.getLanesAtLine(l.lineNumber).indexOf(e.preference.lane);t.push(new CV(a,d,e.preference.zIndex,e))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort(((e,t)=>e.lineNumber===t.lineNumber?e.laneIndex===t.laneIndex?e.zIndex===t.zIndex?t.type===e.type?0===e.type&&0===t.type?e.className<t.className?-1:1:0:t.type-e.type:t.zIndex-e.zIndex:e.laneIndex-t.laneIndex:e.lineNumber-t.lineNumber)),t}prepareRender(e){if(!this._glyphMargin)return void(this._decorationGlyphsToRender=[]);for(const e of Object.values(this._widgets))e.renderInfo=null;const t=new ks(this._collectSortedGlyphRenderRequests(e)),i=[];for(;t.length>0;){const e=t.peek();if(!e)break;const n=t.takeWhile((t=>t.lineNumber===e.lineNumber&&t.laneIndex===e.laneIndex));if(!n||0===n.length)break;const o=n[0];if(0===o.type){const e=[];for(const t of n){if(t.zIndex!==o.zIndex||t.type!==o.type)break;0!==e.length&&e[e.length-1]===t.className||e.push(t.className)}i.push(o.accept(e.join(" ")))}else o.widget.renderInfo={lineNumber:o.lineNumber,laneIndex:o.laneIndex}}this._decorationGlyphsToRender=i}render(e){if(!this._glyphMargin){for(const e of Object.values(this._widgets))e.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){const e=this._managedDomNodes.pop();e?.domNode.remove()}return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const i of Object.values(this._widgets))if(i.renderInfo){const n=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+i.renderInfo.laneIndex*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(n),i.domNode.setLeft(o),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}else i.domNode.setDisplay("none");for(let i=0;i<this._decorationGlyphsToRender.length;i++){const n=this._decorationGlyphsToRender[i],o=n.lineNumber,s=e.viewportData.relativeVerticalOffset[o-e.viewportData.startLineNumber],r=this._glyphMarginLeft+n.laneIndex*this._lineHeight;let a;i<this._managedDomNodes.length?a=this._managedDomNodes[i]:(a=tT(document.createElement("div")),this._managedDomNodes.push(a),this.domNode.appendChild(a));const l=this._context.viewLayout.getLineHeightForLineNumber(o);a.setClassName("cgmr codicon "+n.combinedClassName),a.setPosition("absolute"),a.setTop(s),a.setLeft(r),a.setWidth(t),a.setHeight(l)}for(;this._managedDomNodes.length>this._decorationGlyphsToRender.length;){const e=this._managedDomNodes.pop();e?.domNode.remove()}}}class wV{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.className=n,this.type=0}accept(e){return new yV(this.lineNumber,this.laneIndex,e)}}class CV{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.widget=n,this.type=1}}class yV{constructor(e,t,i){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=i}}var SV=i(3777),xV={};xV.styleTagTransform=zl(),xV.setAttributes=Bl(),xV.insert=Pl().bind(null,"head"),xV.domAPI=Rl(),xV.insertStyleElement=Vl(),Ml()(SV.A,xV),SV.A&&SV.A.locals&&SV.A.locals;class kV extends sV{constructor(e){super(),this._context=e,this._primaryPosition=null;const t=this._context.configuration.options,i=t.get(166),n=t.get(59);this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(22),this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(166),n=t.get(59);return this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(22),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();return!this._primaryPosition?.equals(t)&&(this._primaryPosition=t,!0)}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onLanguageConfigurationChanged(e){return!0}prepareRender(e){if(!this._bracketPairGuideOptions.indentation&&!1===this._bracketPairGuideOptions.bracketPairs)return void(this._renderResult=null);const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=e.scrollWidth,o=this._primaryPosition,s=this.getGuidesByLine(t,Math.min(i+1,this._context.viewModel.getLineCount()),o),r=[];for(let o=t;o<=i;o++){const i=o-t,a=s[i];let l="";const d=e.visibleRangeForPosition(new rc(o,1))?.left??0;for(const t of a){const i=-1===t.column?d+(t.visibleColumn-1)*this._spaceWidth:e.visibleRangeForPosition(new rc(o,t.column)).left;if(i>n||this._maxIndentLeft>0&&i>this._maxIndentLeft)break;const s=t.horizontalLine?t.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",r=t.horizontalLine?(e.visibleRangeForPosition(new rc(o,t.horizontalLine.endColumn))?.left??i+this._spaceWidth)-i:this._spaceWidth;l+=`<div class="core-guide ${t.className} ${s}" style="left:${i}px;width:${r}px"></div>`}r[i]=l}this._renderResult=r}getGuidesByLine(e,t,i){const n=!1!==this._bracketPairGuideOptions.bracketPairs?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:!0===this._bracketPairGuideOptions.bracketPairsHorizontal?PC.Enabled:"active"===this._bracketPairGuideOptions.bracketPairsHorizontal?PC.EnabledForActive:PC.Disabled,includeInactive:!0===this._bracketPairGuideOptions.bracketPairs}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let s=0,r=0,a=0;if(!1!==this._bracketPairGuideOptions.highlightActiveIndentation&&i){const n=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);s=n.startLineNumber,r=n.endLineNumber,a=n.indent}const{indentSize:l}=this._context.viewModel.model.getOptions(),d=[];for(let i=e;i<=t;i++){const t=new Array;d.push(t);const h=n?n[i-e]:[],c=new ks(h),u=o?o[i-e]:0;for(let e=1;e<=u;e++){const n=(e-1)*l+1,o=("always"===this._bracketPairGuideOptions.highlightActiveIndentation||0===h.length)&&s<=i&&i<=r&&e===a;t.push(...c.takeWhile((e=>e.visibleColumn<n))||[]);const d=c.peek();d&&d.visibleColumn===n&&!d.horizontalLine||t.push(new qC(n,-1,"core-guide-indent lvl-"+(e-1)%30+(o?" indent-active":""),null,-1,-1))}t.push(...c.takeWhile((e=>!0))||[])}return d}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function LV(e){if(!e||!e.isTransparent())return e}hw(((e,t)=>{const i=[{bracketColor:$w,guideColor:eC,guideColorActive:rC},{bracketColor:Gw,guideColor:tC,guideColorActive:aC},{bracketColor:Zw,guideColor:iC,guideColorActive:lC},{bracketColor:Yw,guideColor:nC,guideColorActive:dC},{bracketColor:Qw,guideColor:oC,guideColorActive:hC},{bracketColor:Xw,guideColor:sC,guideColorActive:cC}],n=new ZC,o=[{indentColor:xw,indentColorActive:Iw},{indentColor:kw,indentColorActive:Tw},{indentColor:Lw,indentColorActive:Mw},{indentColor:Dw,indentColorActive:Aw},{indentColor:Ew,indentColorActive:Rw},{indentColor:Nw,indentColorActive:Ow}],s=i.map((t=>{const i=e.getColor(t.bracketColor),n=e.getColor(t.guideColor),o=e.getColor(t.guideColorActive),s=LV(LV(n)??i?.transparent(.3)),r=LV(LV(o)??i);if(s&&r)return{guideColor:s,guideColorActive:r}})).filter(mt),r=o.map((t=>{const i=e.getColor(t.indentColor),n=e.getColor(t.indentColorActive),o=LV(i),s=LV(n);if(o&&s)return{indentColor:o,indentColorActive:s}})).filter(mt);if(s.length>0){for(let e=0;e<30;e++){const i=s[e%s.length];t.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(e).replace(/ /g,".")} { --guide-color: ${i.guideColor}; --guide-color-active: ${i.guideColorActive}; }`)}t.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),t.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),t.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),t.addRule(`.monaco-editor .vertical.${n.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),t.addRule(`.monaco-editor .horizontal-top.${n.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),t.addRule(`.monaco-editor .horizontal-bottom.${n.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(r.length>0){for(let e=0;e<30;e++){const i=r[e%r.length];t.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${e} { --indent-color: ${i.indentColor}; --indent-color-active: ${i.indentColorActive}; }`)}t.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),t.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}}));var DV=i(6953),EV={};EV.styleTagTransform=zl(),EV.setAttributes=Bl(),EV.insert=Pl().bind(null,"head"),EV.domAPI=Rl(),EV.insertStyleElement=Vl(),Ml()(DV.A,EV),DV.A&&DV.A.locals&&DV.A.locals;class NV extends sV{static{this.CLASS_NAME="line-numbers"}constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new rc(1,1),this._renderResult=null,this._activeModelLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(75);const t=e.get(76);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(109);const i=e.get(165);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeModelLineNumber!==this._lastCursorModelPosition.lineNumber&&(this._activeModelLineNumber=this._lastCursorModelPosition.lineNumber,i=!0),2!==this._renderLineNumbers&&3!==this._renderLineNumbers||(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return e.affectsLineNumber}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new rc(e,1));if(1!==t.column)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(2===this._renderLineNumbers){const e=Math.abs(this._lastCursorModelPosition.lineNumber-i);return 0===e?'<span class="relative-current-line-number">'+i+"</span>":String(e)}return 3===this._renderLineNumbers?this._lastCursorModelPosition.lineNumber===i||i%10==0||i===this._context.viewModel.getLineCount()?String(i):"":String(i)}prepareRender(e){if(0===this._renderLineNumbers)return void(this._renderResult=null);const t=G?this._lineHeight%2==0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o=this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter((e=>!!e.options.lineNumberClassName));o.sort(((e,t)=>Yu.compareRangesUsingEnds(e.range,t.range)));let s=0;const r=this._context.viewModel.getLineCount(),a=[];for(let e=i;e<=n;e++){const n=e-i,l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new rc(e,1)).lineNumber;let d=this._getLineRenderLineNumber(e),h="";for(;s<o.length&&o[s].range.endLineNumber<e;)s++;for(let t=s;t<o.length;t++){const{range:i,options:n}=o[t];i.startLineNumber<=e&&(h+=" "+n.lineNumberClassName)}d||h?(e===r&&0===this._context.viewModel.getLineLength(e)&&("off"===this._renderFinalNewline&&(d=""),"dimmed"===this._renderFinalNewline&&(h+=" dimmed-line-number")),l===this._activeModelLineNumber&&(h+=" active-line-number"),a[n]=`<div class="${NV.CLASS_NAME}${t}${h}" style="left:${this._lineNumbersLeft}px;width:${this._lineNumbersWidth}px;">${d}</div>`):a[n]=""}this._renderResult=a}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}hw(((e,t)=>{const i=e.getColor(Cw),n=e.getColor(Fw);n?t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n}; }`):i&&t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i.transparent(.4)}; }`)}));var IV=i(266),TV={};TV.styleTagTransform=zl(),TV.setAttributes=Bl(),TV.insert=Pl().bind(null,"head"),TV.domAPI=Rl(),TV.insertStyleElement=Vl(),Ml()(IV.A,TV),IV.A&&IV.A.locals&&IV.A.locals;const MV="monaco-mouse-cursor-text";var AV=i(3113),RV={};RV.styleTagTransform=zl(),RV.setAttributes=Bl(),RV.insert=Pl().bind(null,"head"),RV.domAPI=Rl(),RV.insertStyleElement=Vl(),Ml()(AV.A,RV),AV.A&&AV.A.locals&&AV.A.locals;class OV{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}}class PV{constructor(e,t){this.themeType=t;const i=e.options,n=i.get(59);this.renderWhitespace=i.get(113),this.experimentalWhitespaceRendering=i.get(47),this.renderControlCharacters=i.get(108),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(40),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(75),this.stopRenderingLineAfter=i.get(133),this.fontLigatures=i.get(60),this.verticalScrollbarSize=i.get(117).verticalScrollbarSize,this.useGpu="on"===i.get(46)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.experimentalWhitespaceRendering===e.experimentalWhitespaceRendering&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures&&this.verticalScrollbarSize===e.verticalScrollbarSize&&this.useGpu===e.useGpu}}class FV{constructor(){this._currentVisibleRange=new Yu(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class BV{constructor(e,t,i,n,o,s,r){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=n,this.startScrollTop=o,this.stopScrollTop=s,this.scrollType=r,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class WV{constructor(e,t,i,n,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=n,this.scrollType=o,this.type="selections";let s=t[0].startLineNumber,r=t[0].endLineNumber;for(let e=1,i=t.length;e<i;e++){const i=t[e];s=Math.min(s,i.startLineNumber),r=Math.max(r,i.endLineNumber)}this.minLineNumber=s,this.maxLineNumber=r}}class VV extends NB{static{this.HORIZONTAL_EXTRA_PX=30}constructor(e,t,i){super(e);const n=this._context.configuration,o=this._context.configuration.options,s=o.get(59),r=o.get(166);this._lineHeight=o.get(75),this._typicalHalfwidthCharacterWidth=s.typicalHalfwidthCharacterWidth,this._isViewportWrapping=r.isViewportWrapping,this._revealHorizontalRightPadding=o.get(114),this._cursorSurroundingLines=o.get(35),this._cursorSurroundingLinesStyle=o.get(36),this._canUseLayerHinting=!o.get(39),this._viewLineOptions=new PV(n,this._context.theme.type),this._linesContent=i,this._textRangeRestingSpot=document.createElement("div"),this._visibleLines=new HW(this._context,{createLine:()=>new iW(t,this._viewLineOptions)}),this.domNode=this._visibleLines.domNode,IB.write(this.domNode,8),this.domNode.setClassName(`view-lines ${MV}`),iT(this.domNode,s),this._maxLineWidth=0,this._asyncUpdateLineWidths=new Ci((()=>{this._updateLineWidthsSlow()}),200),this._asyncCheckMonospaceFontAssumptions=new Ci((()=>{this._checkMonospaceFontAssumptions()}),2e3),this._lastRenderedData=new FV,this._horizontalRevealRequest=null,this._stickyScrollEnabled=o.get(131).enabled,this._maxNumberStickyLines=o.get(131).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(166)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(59),n=t.get(166);return this._lineHeight=t.get(75),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping,this._revealHorizontalRightPadding=t.get(114),this._cursorSurroundingLines=t.get(35),this._cursorSurroundingLinesStyle=t.get(36),this._canUseLayerHinting=!t.get(39),this._stickyScrollEnabled=t.get(131).enabled,this._maxNumberStickyLines=t.get(131).maxLineCount,iT(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(165)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new PV(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const e=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let t=e;t<=i;t++)this._visibleLines.getVisibleLine(t).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let e=t;e<=i;e++)n=this._visibleLines.getVisibleLine(e).onSelectionChanged()||n;return n}onDecorationsChanged(e){{const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++)this._visibleLines.getVisibleLine(i).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e,this._viewLineOptions.useGpu);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(-1===t)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new BV(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new WV(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const n=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,n),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTop<t||e.scrollTop>i)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const i=this._getViewLineDomNode(e);if(null===i)return null;const n=this._getLineNumberFor(i);if(-1===n)return null;if(n<1||n>this._context.viewModel.getLineCount())return null;if(1===this._context.viewModel.getLineMaxColumn(n))return new rc(n,1);const o=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();if(n<o||n>s)return null;let r=this._visibleLines.getVisibleLine(n).getColumnOfNodeOffset(e,t);const a=this._context.viewModel.getLineMinColumn(n);return r<a&&(r=a),new rc(n,r)}_getViewLineDomNode(e){for(;e&&1===e.nodeType;){if(e.className===iW.CLASS_NAME)return e;e=e.parentElement}return null}_getLineNumberFor(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let n=t;n<=i;n++)if(e===this._visibleLines.getVisibleLine(n).getDomNode())return n;return-1}getLineWidth(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();if(e<t||e>i)return-1;const n=new OV(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getWidth(n);return this._updateLineWidthsSlowIfDomDidLayout(n),o}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,n=Yu.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;const o=[];let s=0;const r=new OV(this.domNode.domNode,this._textRangeRestingSpot);let a=0;t&&(a=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new rc(n.startLineNumber,1)).lineNumber);const l=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let e=n.startLineNumber;e<=n.endLineNumber;e++){if(e<l||e>d)continue;const h=e===n.startLineNumber?n.startColumn:1,c=e!==i,u=c?this._context.viewModel.getLineMaxColumn(e):n.endColumn,g=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,h,u,r);if(g){if(t&&e<i){const t=a;if(a=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new rc(e+1,1)).lineNumber,t!==a){const e=g.ranges[g.ranges.length-1];e.width+=this._typicalHalfwidthCharacterWidth,this._context.viewModel.getTextDirection(t)===pg.RTL&&(e.left-=this._typicalHalfwidthCharacterWidth)}}o[s++]=new AB(g.outsideRenderedLine,e,RB.from(g.ranges),c)}}return this._updateLineWidthsSlowIfDomDidLayout(r),0===s?null:o}_visibleRangesForLineRange(e,t,i){if(this.shouldRender())return null;if(e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber())return null;const n=new OV(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,n);return this._updateLineWidthsSlowIfDomDidLayout(n),o}_lineIsRenderedRTL(e){return!(e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber())&&this._visibleLines.getVisibleLine(e).isRenderedRTL()}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new PB(t.outsideRenderedLine,t.ranges[0].left):null}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){e.didDomLayout&&(this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow()))}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=1,o=!0;for(let s=t;s<=i;s++){const t=this._visibleLines.getVisibleLine(s);!e||t.getWidthIsFast()?n=Math.max(n,t.getWidth(null)):o=!1}return o&&1===t&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++){const i=this._visibleLines.getVisibleLine(o);if(i.needsMonospaceFontCheck()){const n=i.getWidth(null);n>t&&(t=n,e=o)}}if(-1!==e&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let e=i;e<=n;e++)this._visibleLines.getVisibleLine(e).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const t=this._horizontalRevealRequest;if(e.startLineNumber<=t.minLineNumber&&t.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const e=this._computeScrollLeftToReveal(t);e&&(this._isViewportWrapping||e.hasRTL||this._ensureMaxLineWidth(e.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:e.scrollLeft},t.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),G&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++)if(this._visibleLines.getVisibleLine(i).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth<t&&(this._maxLineWidth=t,this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth))}_computeScrollTopToRevealRange(e,t,i,n,o,s){const r=e.top,a=e.height,l=r+a;let d,h,c;if(o&&o.length>0){let e=o[0].startLineNumber,t=o[0].endLineNumber;for(let i=1,n=o.length;i<n;i++){const n=o[i];e=Math.min(e,n.startLineNumber),t=Math.max(t,n.endLineNumber)}d=!1,h=this._context.viewLayout.getVerticalOffsetForLineNumber(e),c=this._context.viewLayout.getVerticalOffsetForLineNumber(t)+this._lineHeight}else{if(!n)return-1;d=!0,h=this._context.viewLayout.getVerticalOffsetForLineNumber(n.startLineNumber),c=this._context.viewLayout.getVerticalOffsetForLineNumber(n.endLineNumber)+this._lineHeight}let u,g=0,p=0;if("mouse"!==t&&!i||"default"!==this._cursorSurroundingLinesStyle){const e=a/this._lineHeight,t=Math.max(this._cursorSurroundingLines,this._stickyScrollEnabled?this._maxNumberStickyLines:0),i=Math.min(e/2,t);g=i*this._lineHeight,p=Math.max(0,i-1)*this._lineHeight}else i||(g=this._lineHeight);if(i||0!==s&&4!==s||(p+=this._lineHeight),h-=g,c+=p,c-h>a){if(!d)return-1;u=h}else if(5===s||6===s)if(6===s&&r<=h&&c<=l)u=r;else{const e=h-Math.max(5*this._lineHeight,.2*a),t=c-a;u=Math.max(t,e)}else if(1===s||2===s)if(2===s&&r<=h&&c<=l)u=r;else{const e=(h+c)/2;u=Math.max(0,e-a/2)}else u=this._computeMinimumScrolling(r,l,h,c,3===s,4===s);return u}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(165),n=t.left,o=n+t.width-i.verticalScrollbarWidth;let s=1073741824,r=0,a=!1;if("range"===e.type){a=this._lineIsRenderedRTL(e.lineNumber);const t=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!t)return null;for(const e of t.ranges)s=Math.min(s,Math.round(e.left)),r=Math.max(r,Math.round(e.left+e.width))}else for(const t of e.selections){if(t.startLineNumber!==t.endLineNumber)return null;const e=this._visibleRangesForLineRange(t.startLineNumber,t.startColumn,t.endColumn);if(a||=this._lineIsRenderedRTL(t.startLineNumber),!e)return null;for(const t of e.ranges)s=Math.min(s,Math.round(t.left)),r=Math.max(r,Math.round(t.left+t.width))}return e.minimalReveal||(s=Math.max(0,s-VV.HORIZONTAL_EXTRA_PX),r+=this._revealHorizontalRightPadding),"selections"===e.type&&r-s>t.width?null:{scrollLeft:this._computeMinimumScrolling(n,o,s,r),maxHorizontalOffset:r,hasRTL:a}}_computeMinimumScrolling(e,t,i,n,o,s){o=!!o,s=!!s;const r=(t|=0)-(e|=0);return(n|=0)-(i|=0)<r?o?i:s?Math.max(0,n-r):i<e?i:n>t?Math.max(0,n-r):e:i}}var HV=i(7375),zV={};zV.styleTagTransform=zl(),zV.setAttributes=Bl(),zV.insert=Pl().bind(null,"head"),zV.domAPI=Rl(),zV.insertStyleElement=Vl(),Ml()(HV.A,zV),HV.A&&HV.A.locals&&HV.A.locals;class UV extends vV{constructor(e){super(),this._context=e;const t=this._context.configuration.options.get(165);this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options.get(165);return this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let n=0;for(let e=0,o=t.length;e<o;e++){const o=t[e],s=o.options.linesDecorationsClassName,r=o.options.zIndex;s&&(i[n++]=new mV(o.range.startLineNumber,o.range.endLineNumber,s,o.options.linesDecorationsTooltip??null,r));const a=o.options.firstLineDecorationClassName;a&&(i[n++]=new mV(o.range.startLineNumber,o.range.startLineNumber,a,o.options.linesDecorationsTooltip??null,r))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o='" style="left:'+this._decorationsLeft.toString()+"px;width:"+this._decorationsWidth.toString()+'px;"></div>',s=[];for(let e=t;e<=i;e++){const i=e-t,r=n[i].getDecorations();let a="";for(const e of r){let t='<div class="cldr '+e.className;null!==e.tooltip&&(t+='" title="'+e.tooltip),t+=o,a+=t}s[i]=a}this._renderResult=s}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}var KV=i(8731),jV={};jV.styleTagTransform=zl(),jV.setAttributes=Bl(),jV.insert=Pl().bind(null,"head"),jV.domAPI=Rl(),jV.insertStyleElement=Vl(),Ml()(KV.A,jV),KV.A&&KV.A.locals&&KV.A.locals;class qV extends NB{static{this.CLASS_NAME="glyph-margin"}static{this.OUTER_CLASS_NAME="margin"}constructor(e){super(e);const t=this._context.configuration.options,i=t.get(165);this._canUseLayerHinting=!t.get(39),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=tT(document.createElement("div")),this._domNode.setClassName(qV.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=tT(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(qV.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(165);return this._canUseLayerHinting=!t.get(39),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}}var $V=i(3313),GV={};GV.styleTagTransform=zl(),GV.setAttributes=Bl(),GV.insert=Pl().bind(null,"head"),GV.domAPI=Rl(),GV.insertStyleElement=Vl(),Ml()($V.A,GV),$V.A&&$V.A.locals&&$V.A.locals;class ZV extends vV{constructor(e){super(),this._context=e,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let n=0;for(let e=0,o=t.length;e<o;e++){const o=t[e],s=o.options.marginClassName,r=o.options.zIndex;s&&(i[n++]=new mV(o.range.startLineNumber,o.range.endLineNumber,s,null,r))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o=[];for(let e=t;e<=i;e++){const i=e-t,s=n[i].getDecorations();let r="";for(const e of s)r+='<div class="cmdr '+e.className+'" style=""></div>';o[i]=r}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}var YV=i(6493),QV={};QV.styleTagTransform=zl(),QV.setAttributes=Bl(),QV.insert=Pl().bind(null,"head"),QV.domAPI=Rl(),QV.insertStyleElement=Vl(),Ml()(YV.A,QV),YV.A&&YV.A.locals&&YV.A.locals;class XV{static{this.Empty=new XV(0,0,0,0)}constructor(e,t,i,n){this._rgba8Brand=void 0,this.r=XV._clamp(e),this.g=XV._clamp(t),this.b=XV._clamp(i),this.a=XV._clamp(n)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:0|e}}class JV extends At{static{this._INSTANCE=null}static getInstance(){return this._INSTANCE||(this._INSTANCE=Lt(new JV)),this._INSTANCE}constructor(){super(),this._onDidChange=new Zt,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(JS.onDidChange((e=>{e.changedColorMap&&this._updateColorMap()})))}_updateColorMap(){const e=JS.getColorMap();if(!e)return this._colors=[XV.Empty],void(this._backgroundIsLight=!0);this._colors=[XV.Empty];for(let t=1;t<e.length;t++){const i=e[t].rgba;this._colors[t]=new XV(i.r,i.g,i.b,Math.round(255*i.a))}const t=e[2].getRelativeLuminance();this._backgroundIsLight=t>=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}const eH=(()=>{const e=[];for(let t=32;t<=126;t++)e.push(t);return e.push(65533),e})();class tH{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=tH.soften(e,.8),this.charDataLight=tH.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=Vy(e[n]*t);return i}renderChar(e,t,i,n,o,s,r,a,l,d,h){const c=1*this.scale,u=2*this.scale,g=h?1:u;if(t+c>e.width||i+g>e.height)return void console.warn("bad render request outside image data");const p=d?this.charDataLight:this.charDataNormal,m=((e,t)=>(e-=32)<0||e>96?t<=2?(e+96)%96:95:e)(n,l),f=4*e.width,_=r.r,v=r.g,b=r.b,w=o.r-_,C=o.g-v,y=o.b-b,S=Math.max(s,a),x=e.data;let k=m*c*u,L=i*f+4*t;for(let e=0;e<g;e++){let e=L;for(let t=0;t<c;t++){const t=p[k++]/255*(s/255);x[e++]=_+w*t,x[e++]=v+C*t,x[e++]=b+y*t,x[e++]=S}L+=f}}blockRenderChar(e,t,i,n,o,s,r,a){const l=1*this.scale,d=2*this.scale,h=a?1:d;if(t+l>e.width||i+h>e.height)return void console.warn("bad render request outside image data");const c=4*e.width,u=o/255*.5,g=s.r,p=s.g,m=s.b,f=g+(n.r-g)*u,_=p+(n.g-p)*u,v=m+(n.b-m)*u,b=Math.max(o,r),w=e.data;let C=i*c+4*t;for(let e=0;e<h;e++){let e=C;for(let t=0;t<l;t++)w[e++]=f,w[e++]=_,w[e++]=v,w[e++]=b;C+=c}}}const iH={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15},nH=e=>{const t=new Uint8ClampedArray(e.length/2);for(let i=0;i<e.length;i+=2)t[i>>1]=iH[e[i]]<<4|15&iH[e[i+1]];return t},oH={1:tt((()=>nH("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792"))),2:tt((()=>nH("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126")))};class sH{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return i=oH[e]?new tH(oH[e](),e):sH.createFromSampleData(sH.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height="16px",t.height=16,t.width=960,t.style.width="960px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let n=0;for(const e of eH)i.fillText(String.fromCharCode(e),n,8),n+=10;return i.getImageData(0,0,960,16)}static createFromSampleData(e,t){if(61440!==e.length)throw new Error("Unexpected source in MinimapCharRenderer");const i=sH._downsample(e,t);return new tH(i,t)}static _downsampleChar(e,t,i,n,o){const s=1*o,r=2*o;let a=n,l=0;for(let n=0;n<r;n++){const o=n/r*16,d=(n+1)/r*16;for(let n=0;n<s;n++){const r=n/s*10,h=(n+1)/s*10;let c=0,u=0;for(let i=o;i<d;i++){const n=t+3840*Math.floor(i),o=1-(i-Math.floor(i));for(let t=r;t<h;t++){const i=1-(t-Math.floor(t)),s=n+4*Math.floor(t),r=i*o;u+=r,c+=e[s]*e[s+3]/255*r}}const g=c/u;l=Math.max(l,g),i[a++]=Vy(g)}}return l}static _downsample(e,t){const i=2*t*1*t,n=96*i,o=new Uint8ClampedArray(n);let s=0,r=0,a=0;for(let n=0;n<96;n++)a=Math.max(a,this._downsampleChar(e,r,o,s,t)),s+=i,r+=40;if(a>0){const e=255/a;for(let t=0;t<n;t++)o[t]*=e}return o}}const rH=q?'"Segoe WPC", "Segoe UI", sans-serif':$?"-apple-system, BlinkMacSystemFont, sans-serif":'system-ui, "Ubuntu", "Droid Sans", sans-serif';class aH{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}function lH(e,t){return!(t.options.hideInCommentTokens&&dH(e,t)||t.options.hideInStringTokens&&hH(e,t))}function dH(e,t){return cH(e,t.range,(e=>1===e))}function hH(e,t){return cH(e,t.range,(e=>2===e))}function cH(e,t,i){for(let n=t.startLineNumber;n<=t.endLineNumber;n++){const o=e.tokenization.getLineTokens(n),s=n===t.startLineNumber,r=n===t.endLineNumber;let a=s?o.findTokenIndexAtOffset(t.startColumn-1):0;for(;a<o.getCount()&&!(r&&o.getStartOffset(a)>t.endColumn-1);){if(!i(o.getStandardTokenType(a)))return!1;a++}}return!0}class uH{constructor(e,t,i){const n=e.options,o=n.get(163),s=n.get(165),r=s.minimap,a=n.get(59),l=n.get(81);this.renderMinimap=r.renderMinimap,this.size=l.size,this.minimapHeightIsEditorHeight=r.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=n.get(119),this.paddingTop=n.get(96).top,this.paddingBottom=n.get(96).bottom,this.showSlider=l.showSlider,this.autohide=l.autohide,this.pixelRatio=o,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.lineHeight=n.get(75),this.minimapLeft=r.minimapLeft,this.minimapWidth=r.minimapWidth,this.minimapHeight=s.height,this.canvasInnerWidth=r.minimapCanvasInnerWidth,this.canvasInnerHeight=r.minimapCanvasInnerHeight,this.canvasOuterWidth=r.minimapCanvasOuterWidth,this.canvasOuterHeight=r.minimapCanvasOuterHeight,this.isSampling=r.minimapIsSampling,this.editorHeight=s.height,this.fontScale=r.minimapScale,this.minimapLineHeight=r.minimapLineHeight,this.minimapCharWidth=1*this.fontScale,this.sectionHeaderFontFamily=rH,this.sectionHeaderFontSize=l.sectionHeaderFontSize*o,this.sectionHeaderLetterSpacing=l.sectionHeaderLetterSpacing,this.sectionHeaderFontColor=uH._getSectionHeaderColor(t,i.getColor(1)),this.charRenderer=tt((()=>sH.create(this.fontScale,a.fontFamily))),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=uH._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=uH._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(vv);return i?new XV(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(bv);return t?XV._clamp(Math.round(255*t.rgba.a)):255}static _getSectionHeaderColor(e,t){const i=e.getColor(l_);return i?new XV(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.sectionHeaderFontSize===e.sectionHeaderFontSize&&this.sectionHeaderLetterSpacing===e.sectionHeaderLetterSpacing&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class gH{constructor(e,t,i,n,o,s,r,a,l){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,this.sliderTop=o,this.sliderHeight=s,this.topPaddingLineCount=r,this.startLineNumber=a,this.endLineNumber=l}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumber,e.endLineNumber);return t>i?null:[t,i]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,i,n,o,s,r,a,l,d,h){const c=e.pixelRatio,u=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/u),p=e.lineHeight;if(e.minimapHeightIsEditorHeight){let t=a*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(t+=Math.max(0,o-e.lineHeight-e.paddingBottom));const i=Math.max(1,Math.floor(o*o/t)),n=Math.max(0,e.minimapHeight-i),s=n/(d-o),h=l*s,c=n>0,u=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),g=Math.floor(e.paddingTop/e.lineHeight);return new gH(l,d,c,s,h,i,g,1,Math.min(r,u))}let m;if(s&&i!==r){const e=i-t+1;m=Math.floor(e*u/c)}else{const e=o/p;m=Math.floor(e*u/c)}const f=Math.floor(e.paddingTop/p);let _,v=Math.floor(e.paddingBottom/p);if(e.scrollBeyondLastLine){const e=o/p;v=Math.max(v,e-1)}_=v>0?(f+r+v-o/p-1)*u/c:Math.max(0,(f+r)*u/c-m),_=Math.min(e.minimapHeight-m,_);const b=_/(d-o),w=l*b;if(g>=f+r+v)return new gH(l,d,_>0,b,w,m,f,1,r);{let i,o;i=t>1?t+f:Math.max(1,l/p);let s=Math.max(1,Math.floor(i-w*c/u));s<f?(o=f-s+1,s=1):(o=0,s=Math.max(1,s-f)),h&&h.scrollHeight===d&&(h.scrollTop>l&&(s=Math.min(s,h.startLineNumber),o=Math.max(o,h.topPaddingLineCount)),h.scrollTop<l&&(s=Math.max(s,h.startLineNumber),o=Math.min(o,h.topPaddingLineCount)));const a=Math.min(r,s-o+g-1),_=(l-n)/p;let v;return v=l>=e.paddingTop?(t-s+o+_)*u/c:l/e.paddingTop*(o+_)*u/c,new gH(l,d,!0,b,v,m,o,s,a)}}}class pH{static{this.INVALID=new pH(-1)}constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}class mH{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new VW({createLine:()=>pH.INVALID}),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const t=this._renderedLines._get().lines;for(let e=0,i=t.length;e<i;e++)if(-1===t[e].dy)return!1;return!0}scrollEquals(e){return this.renderedLayout.startLineNumber===e.startLineNumber&&this.renderedLayout.endLineNumber===e.endLineNumber}_get(){const e=this._renderedLines._get();return{imageData:this._imageData,rendLineNumberStart:e.rendLineNumberStart,lines:e.lines}}onLinesChanged(e,t){return this._renderedLines.onLinesChanged(e,t)}onLinesDeleted(e,t){this._renderedLines.onLinesDeleted(e,t)}onLinesInserted(e,t){this._renderedLines.onLinesInserted(e,t)}onTokensChanged(e){return this._renderedLines.onTokensChanged(e)}}class fH{constructor(e,t,i,n){this._backgroundFillData=fH._createBackgroundFillData(t,i,n),this._buffers=[e.createImageData(t,i),e.createImageData(t,i)],this._lastUsedBuffer=0}getBuffer(){this._lastUsedBuffer=1-this._lastUsedBuffer;const e=this._buffers[this._lastUsedBuffer];return e.data.set(this._backgroundFillData),e}static _createBackgroundFillData(e,t,i){const n=i.r,o=i.g,s=i.b,r=i.a,a=new Uint8ClampedArray(e*t*4);let l=0;for(let i=0;i<t;i++)for(let t=0;t<e;t++)a[l]=n,a[l+1]=o,a[l+2]=s,a[l+3]=r,l+=4;return a}}class _H{static compute(e,t,i){if(0===e.renderMinimap||!e.isSampling)return[null,[]];const{minimapLineCount:n}=nP.computeContainedMinimapLineCount({viewLineCount:t,scrollBeyondLastLine:e.scrollBeyondLastLine,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:e.editorHeight,lineHeight:e.lineHeight,pixelRatio:e.pixelRatio}),o=t/n,s=o/2;if(!i||0===i.minimapLines.length){const e=[];if(e[0]=1,n>1){for(let t=0,i=n-1;t<i;t++)e[t]=Math.round(t*o+s);e[n-1]=t}return[new _H(o,e),[]]}const r=i.minimapLines,a=r.length,l=[];let d=0,h=0,c=1,u=[],g=null;for(let e=0;e<n;e++){const i=Math.max(c,Math.round(e*o)),p=Math.max(i,Math.round((e+1)*o));for(;d<a&&r[d]<i;){if(u.length<10){const e=d+1+h;g&&"deleted"===g.type&&g._oldIndex===d-1?g.deleteToLineNumber++:(g={type:"deleted",_oldIndex:d,deleteFromLineNumber:e,deleteToLineNumber:e},u.push(g)),h--}d++}let m;if(d<a&&r[d]<=p)m=r[d],d++;else if(m=0===e?1:e+1===n?t:Math.round(e*o+s),u.length<10){const t=d+1+h;g&&"inserted"===g.type&&g._i===e-1?g.insertToLineNumber++:(g={type:"inserted",_i:e,insertFromLineNumber:t,insertToLineNumber:t},u.push(g)),h++}l[e]=m,c=m}if(u.length<10)for(;d<a;){const e=d+1+h;g&&"deleted"===g.type&&g._oldIndex===d-1?g.deleteToLineNumber++:(g={type:"deleted",_oldIndex:d,deleteFromLineNumber:e,deleteToLineNumber:e},u.push(g)),h--,d++}else u=[{type:"flush"}];return[new _H(o,l),u]}constructor(e,t){this.samplingRatio=e,this.minimapLines=t}modelLineToMinimapLine(e){return Math.min(this.minimapLines.length,Math.max(1,Math.round(e/this.samplingRatio)))}modelLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e)-1;for(;i>0&&this.minimapLines[i-1]>=e;)i--;let n=this.modelLineToMinimapLine(t)-1;for(;n+1<this.minimapLines.length&&this.minimapLines[n+1]<=t;)n++;if(i===n){const n=this.minimapLines[i];if(n<e||n>t)return null}return[i+1,n+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),n=this.modelLineToMinimapLine(t);return e!==t&&n===i&&(n===this.minimapLines.length?i>1&&i--:n++),[i,n]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,n=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]<e.fromLineNumber);o--)this.minimapLines[o]<=e.toLineNumber?(this.minimapLines[o]=Math.max(1,e.fromLineNumber-1),i=Math.min(i,o),n=Math.max(n,o)):this.minimapLines[o]-=t;return[i,n]}onLinesInserted(e){const t=e.toLineNumber-e.fromLineNumber+1;for(let i=this.minimapLines.length-1;i>=0&&!(this.minimapLines[i]<e.fromLineNumber);i--)this.minimapLines[i]+=t}}class vH extends NB{constructor(e){super(e),this._sectionHeaderCache=new ad(10,1.5),this.tokensColorTracker=JV.getInstance(),this._selections=[],this._minimapSelections=null,this.options=new uH(this._context.configuration,this._context.theme,this.tokensColorTracker);const[t]=_H.compute(this.options,this._context.viewModel.getLineCount(),null);this._samplingState=t,this._shouldCheckSampling=!1,this._actual=new bH(e.theme,this)}dispose(){this._actual.dispose(),super.dispose()}getDomNode(){return this._actual.getDomNode()}_onOptionsMaybeChanged(){const e=new uH(this._context.configuration,this._context.theme,this.tokensColorTracker);return!this.options.equals(e)&&(this.options=e,this._recreateLineSampling(),this._actual.onDidChangeOptions(),!0)}onConfigurationChanged(e){return this._onOptionsMaybeChanged()}onCursorStateChanged(e){return this._selections=e.selections,this._minimapSelections=null,this._actual.onSelectionChanged()}onDecorationsChanged(e){return!!e.affectsMinimap&&this._actual.onDecorationsChanged()}onFlushed(e){return this._samplingState&&(this._shouldCheckSampling=!0),this._actual.onFlushed()}onLinesChanged(e){if(this._samplingState){const t=this._samplingState.modelLineRangeToMinimapLineRange(e.fromLineNumber,e.fromLineNumber+e.count-1);return!!t&&this._actual.onLinesChanged(t[0],t[1]-t[0]+1)}return this._actual.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){if(this._samplingState){const[t,i]=this._samplingState.onLinesDeleted(e);return t<=i&&this._actual.onLinesChanged(t+1,i-t+1),this._shouldCheckSampling=!0,!0}return this._actual.onLinesDeleted(e.fromLineNumber,e.toLineNumber)}onLinesInserted(e){return this._samplingState?(this._samplingState.onLinesInserted(e),this._shouldCheckSampling=!0,!0):this._actual.onLinesInserted(e.fromLineNumber,e.toLineNumber)}onScrollChanged(e){return this._actual.onScrollChanged(e)}onThemeChanged(e){return this._actual.onThemeChanged(),this._onOptionsMaybeChanged(),!0}onTokensChanged(e){if(this._samplingState){const t=[];for(const i of e.ranges){const e=this._samplingState.modelLineRangeToMinimapLineRange(i.fromLineNumber,i.toLineNumber);e&&t.push({fromLineNumber:e[0],toLineNumber:e[1]})}return!!t.length&&this._actual.onTokensChanged(t)}return this._actual.onTokensChanged(e.ranges)}onTokensColorsChanged(e){return this._onOptionsMaybeChanged(),this._actual.onTokensColorsChanged()}onZonesChanged(e){return this._actual.onZonesChanged()}prepareRender(e){this._shouldCheckSampling&&(this._shouldCheckSampling=!1,this._recreateLineSampling())}render(e){let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber;this._samplingState&&(t=this._samplingState.modelLineToMinimapLine(t),i=this._samplingState.modelLineToMinimapLine(i));const n={viewportContainsWhitespaceGaps:e.viewportData.whitespaceViewportData.length>0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(n)}_recreateLineSampling(){this._minimapSelections=null;const e=Boolean(this._samplingState),[t,i]=_H.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const e of i)switch(e.type){case"deleted":this._actual.onLinesDeleted(e.deleteFromLineNumber,e.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(e.insertFromLineNumber,e.insertToLineNumber);break;case"flush":this._actual.onFlushed()}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){const n=[];for(let o=0,s=t-e+1;o<s;o++)i[o]?n[o]=this._context.viewModel.getViewLineData(this._samplingState.minimapLines[e+o-1]):n[o]=null;return n}return this._context.viewModel.getMinimapLinesRenderingData(e,t,i).data}getSelections(){if(null===this._minimapSelections)if(this._samplingState){this._minimapSelections=[];for(const e of this._selections){const[t,i]=this._samplingState.decorationLineRangeToMinimapLineRange(e.startLineNumber,e.endLineNumber);this._minimapSelections.push(new Qu(t,e.startColumn,i,e.endColumn))}}else this._minimapSelections=this._selections;return this._minimapSelections}getMinimapDecorationsInViewport(e,t){return this._getMinimapDecorationsInViewport(e,t).filter((e=>!e.options.minimap?.sectionHeaderStyle))}getSectionHeaderDecorationsInViewport(e,t){const i=this.options.sectionHeaderFontSize/this.options.minimapLineHeight;return e=Math.floor(Math.max(1,e-i)),this._getMinimapDecorationsInViewport(e,t).filter((e=>!!e.options.minimap?.sectionHeaderStyle))}_getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){const n=this._samplingState.minimapLines[e-1],o=this._samplingState.minimapLines[t-1];i=new Yu(n,1,o,this._context.viewModel.getLineMaxColumn(o))}else i=new Yu(e,1,t,this._context.viewModel.getLineMaxColumn(t));const n=this._context.viewModel.getMinimapDecorationsInRange(i);if(this._samplingState){const e=[];for(const t of n){if(!t.options.minimap)continue;const i=t.range,n=this._samplingState.modelLineToMinimapLine(i.startLineNumber),o=this._samplingState.modelLineToMinimapLine(i.endLineNumber);e.push(new aH(new Yu(n,i.startColumn,o,i.endColumn),t.options))}return e}return n}getSectionHeaderText(e,t){const i=e.options.minimap?.sectionHeaderText;if(!i)return null;const n=this._sectionHeaderCache.get(i);if(n)return n;const o=t(i);return this._sectionHeaderCache.set(i,o),o}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new Yu(e,1,e,1),1,0)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},1)}}class bH extends At{constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._isMouseOverMinimap=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(pv),this._domNode=tT(document.createElement("div")),IB.write(this._domNode,9),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=tT(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=tT(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=tT(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=tT(document.createElement("div")),this._slider.setPosition("absolute"),this._slider.setClassName("minimap-slider"),this._slider.setLayerHinting(!0),this._slider.setContain("strict"),this._domNode.appendChild(this._slider),this._sliderHorizontal=tT(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._hideDelayedScheduler=this._register(new Ci((()=>this._hideImmediatelyIfMouseIsOutside()),500)),this._register(ma(this._domNode.domNode,Qa.MOUSE_OVER,(()=>{this._isMouseOverMinimap=!0}))),this._register(ma(this._domNode.domNode,Qa.MOUSE_LEAVE,(()=>{this._isMouseOverMinimap=!1}))),this._pointerDownListener=ma(this._domNode.domNode,Qa.POINTER_DOWN,(e=>{e.preventDefault();const t="mouse"===e.pointerType,i=0===e.button;if(0!==this._model.options.renderMinimap&&this._lastRenderData)if("proportional"===this._model.options.size){if(i||!t){const t=this._model.options.minimapLineHeight,i=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*e.offsetY;let n=Math.floor(i/t)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;n=Math.min(n,this._model.getLineCount()),this._model.revealLineNumber(n)}}else if(i&&this._lastRenderData){const t=Na(this._slider.domNode),i=t.top+t.height/2;this._startSliderDragging(e,i,this._lastRenderData.renderedLayout)}})),this._sliderPointerMoveMonitor=new UM,this._sliderPointerDownListener=ma(this._slider.domNode,Qa.POINTER_DOWN,(e=>{e.preventDefault(),e.stopPropagation(),0===e.button&&this._lastRenderData&&this._startSliderDragging(e,e.pageY,this._lastRenderData.renderedLayout)})),this._gestureDisposable=JT.addTarget(this._domNode.domNode),this._sliderTouchStartListener=ga(this._domNode.domNode,XT.Start,(e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(e))}),{passive:!1}),this._sliderTouchMoveListener=ga(this._domNode.domNode,XT.Change,(e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(e)}),{passive:!1}),this._sliderTouchEndListener=ma(this._domNode.domNode,XT.End,(e=>{e.preventDefault(),e.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)}))}_hideSoon(){this._hideDelayedScheduler.cancel(),this._hideDelayedScheduler.schedule()}_hideImmediatelyIfMouseIsOutside(){this._isMouseOverMinimap?this._hideSoon():this._domNode.toggleClassName("active",!1)}_startSliderDragging(e,t,i){if(!(e.target&&e.target instanceof Element))return;const n=e.pageX;this._slider.toggleClassName("active",!0);const o=(e,o)=>{const s=Na(this._domNode.domNode),r=Math.min(Math.abs(o-n),Math.abs(o-s.left),Math.abs(o-s.left-s.width));if(q&&r>140)return void this._model.setScrollTop(i.scrollTop);const a=e-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(a))};e.pageY!==t&&o(e.pageY,n),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,(e=>o(e.pageY,e.pageX)),(()=>{this._slider.toggleClassName("active",!1)}))}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return"always"===this._model.options.showSlider?e.push("slider-always"):e.push("slider-mouseover"),"mouseover"===this._model.options.autohide?e.push("minimap-autohide-mouseover"):"scroll"===this._model.options.autohide&&e.push("minimap-autohide-scroll"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new fH(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return!!this._lastRenderData&&this._lastRenderData.onLinesChanged(e,t)}onLinesDeleted(e,t){return this._lastRenderData?.onLinesDeleted(e,t),!0}onLinesInserted(e,t){return this._lastRenderData?.onLinesInserted(e,t),!0}onScrollChanged(e){return"scroll"===this._model.options.autohide&&(e.scrollTopChanged||e.scrollHeightChanged)&&(this._domNode.toggleClassName("active",!0),this._hideSoon()),this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(pv),this._renderDecorations=!0,!0}onTokensChanged(e){return!!this._lastRenderData&&this._lastRenderData.onTokensChanged(e)}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(0===this._model.options.renderMinimap)return this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),void this._sliderHorizontal.setHeight(0);e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const t=gH.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(t.sliderNeeded?"block":"none"),this._slider.setTop(t.sliderTop),this._slider.setHeight(t.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(t.sliderHeight),this.renderDecorations(t),this._lastRenderData=this.renderLines(t)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(Yu.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort(((e,t)=>(e.options.zIndex||0)-(t.options.zIndex||0)));const{canvasInnerWidth:n,canvasInnerHeight:o}=this._model.options,s=this._model.options.minimapLineHeight,r=this._model.options.minimapCharWidth,a=this._model.getOptions().tabSize,l=this._decorationsCanvas.domNode.getContext("2d");l.clearRect(0,0,n,o);const d=new wH(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(l,t,d,e,s),this._renderDecorationsLineHighlights(l,i,d,e,s);const h=new wH(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(l,t,h,e,s,a,r,n),this._renderDecorationsHighlights(l,i,h,e,s,a,r,n),this._renderSectionHeaders(e)}}_renderSelectionLineHighlights(e,t,i,n,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let s=0,r=0;for(const a of t){const t=n.intersectWithViewport(a);if(!t)continue;const[l,d]=t;for(let e=l;e<=d;e++)i.set(e,!0);const h=n.getYForLineNumber(l,o),c=n.getYForLineNumber(d,o);r>=h||(r>s&&e.fillRect(8,s,e.canvas.width,r-s),s=h),r=c}r>s&&e.fillRect(8,s,e.canvas.width,r-s)}_renderDecorationsLineHighlights(e,t,i,n,o){const s=new Map;for(let r=t.length-1;r>=0;r--){const a=t[r],l=a.options.minimap;if(!l||1!==l.position)continue;const d=n.intersectWithViewport(a.range);if(!d)continue;const[h,c]=d,u=l.getColor(this._theme.value);if(!u||u.isTransparent())continue;let g=s.get(u.toString());g||(g=u.transparent(.5).toString(),s.set(u.toString(),g)),e.fillStyle=g;for(let t=h;t<=c;t++){if(i.has(t))continue;i.set(t,!0);const s=n.getYForLineNumber(h,o);e.fillRect(8,s,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,n,o,s,r,a){if(this._selectionColor&&!this._selectionColor.isTransparent())for(const l of t){const t=n.intersectWithViewport(l);if(!t)continue;const[d,h]=t;for(let t=d;t<=h;t++)this.renderDecorationOnLine(e,i,l,this._selectionColor,n,t,o,o,s,r,a)}}_renderDecorationsHighlights(e,t,i,n,o,s,r,a){for(const l of t){const t=l.options.minimap;if(!t)continue;const d=n.intersectWithViewport(l.range);if(!d)continue;const[h,c]=d,u=t.getColor(this._theme.value);if(u&&!u.isTransparent())for(let d=h;d<=c;d++)switch(t.position){case 1:this.renderDecorationOnLine(e,i,l.range,u,n,d,o,o,s,r,a);continue;case 2:{const t=n.getYForLineNumber(d,o),i=2;this.renderDecoration(e,u,i,t,2,o);continue}}}}renderDecorationOnLine(e,t,i,n,o,s,r,a,l,d,h){const c=o.getYForLineNumber(s,a);if(c+r<0||c>this._model.options.canvasInnerHeight)return;const{startLineNumber:u,endLineNumber:g}=i,p=u===s?i.startColumn:1,m=g===s?i.endColumn:this._model.getLineMaxColumn(s),f=this.getXOffsetForPosition(t,s,p,l,d,h),_=this.getXOffsetForPosition(t,s,m,l,d,h);this.renderDecoration(e,n,f,c,_-f,r)}getXOffsetForPosition(e,t,i,n,o,s){if(1===i)return 8;if((i-1)*o>=s)return s;let r=e.get(t);if(!r){const i=this._model.getLineContent(t);r=[8];let a=8;for(let e=1;e<i.length+1;e++){const t=i.charCodeAt(e-1),l=a+(9===t?n*o:yn(t)?2*o:o);if(l>=s){r[e]=s;break}r[e]=l,a=l}e.set(t,r)}return i-1<r.length?r[i-1]:s}renderDecoration(e,t,i,n,o,s){e.fillStyle=t&&t.toString()||"",e.fillRect(i,n,o,s)}_renderSectionHeaders(e){const t=this._model.options.minimapLineHeight,i=this._model.options.sectionHeaderFontSize,n=this._model.options.sectionHeaderLetterSpacing,o=1.5*i,{canvasInnerWidth:s}=this._model.options,r=this._model.options.backgroundColor,a=`rgb(${r.r} ${r.g} ${r.b} / .7)`,l=this._model.options.sectionHeaderFontColor,d=`rgb(${l.r} ${l.g} ${l.b})`,h=d,c=this._decorationsCanvas.domNode.getContext("2d");c.letterSpacing=n+"px",c.font="500 "+i+"px "+this._model.options.sectionHeaderFontFamily,c.strokeStyle=h,c.lineWidth=.4;const u=this._model.getSectionHeaderDecorationsInViewport(e.startLineNumber,e.endLineNumber);u.sort(((e,t)=>e.range.startLineNumber-t.range.startLineNumber));const g=bH._fitSectionHeader.bind(null,c,s-8);for(const n of u){const r=e.getYForLineNumber(n.range.startLineNumber,t)+i,l=r-i,h=l+2,u=this._model.getSectionHeaderText(n,g);bH._renderSectionLabel(c,u,2===n.options.minimap?.sectionHeaderStyle,a,d,s,l,o,r,h)}}static _fitSectionHeader(e,t,i){if(!i)return i;const n=e.measureText(i).width,o=e.measureText("…").width;if(n<=t||n<=o)return i;const s=i.length,r=n/i.length,a=Math.floor((t-o)/r)-1;let l=Math.ceil(a/2);for(;l>0&&/\s/.test(i[l-1]);)--l;return i.substring(0,l)+"…"+i.substring(s-(a-l))}static _renderSectionLabel(e,t,i,n,o,s,r,a,l,d){t&&(e.fillStyle=n,e.fillRect(0,r,s,a),e.fillStyle=o,e.fillText(t,8,l)),i&&(e.beginPath(),e.moveTo(0,d),e.lineTo(s,d),e.closePath(),e.stroke())}renderLines(e){const t=e.startLineNumber,i=e.endLineNumber,n=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const t=this._lastRenderData._get();return new mH(e,t.imageData,t.lines)}const o=this._getBuffer();if(!o)return null;const[s,r,a]=bH._renderUntouchedLines(o,e.topPaddingLineCount,t,i,n,this._lastRenderData),l=this._model.getMinimapLinesRenderingData(t,i,a),d=this._model.getOptions().tabSize,h=this._model.options.defaultBackgroundColor,c=this._model.options.backgroundColor,u=this._model.options.foregroundAlpha,g=this._model.tokensColorTracker,p=g.backgroundIsLight(),m=this._model.options.renderMinimap,f=this._model.options.charRenderer(),_=this._model.options.fontScale,v=this._model.options.minimapCharWidth,b=(1===m?2:3)*_,w=n>b?Math.floor((n-b)/2):0,C=c.a/255,y=new XV(Math.round((c.r-h.r)*C+h.r),Math.round((c.g-h.g)*C+h.g),Math.round((c.b-h.b)*C+h.b),255);let S=e.topPaddingLineCount*n;const x=[];for(let e=0,s=i-t+1;e<s;e++)a[e]&&bH._renderLine(o,y,c.a,p,m,v,g,u,f,S,w,d,l[e],_,n),x[e]=new pH(S),S+=n;const k=-1===s?0:s,L=(-1===r?o.height:r)-k;return this._canvas.domNode.getContext("2d").putImageData(o,0,0,0,k,o.width,L),new mH(e,o,x)}static _renderUntouchedLines(e,t,i,n,o,s){const r=[];if(!s){for(let e=0,t=n-i+1;e<t;e++)r[e]=!0;return[-1,-1,r]}const a=s._get(),l=a.imageData.data,d=a.rendLineNumberStart,h=a.lines,c=h.length,u=e.width,g=e.data,p=(n-i+1)*o*u*4;let m=-1,f=-1,_=-1,v=-1,b=-1,w=-1,C=t*o;for(let e=i;e<=n;e++){const t=e-i,n=e-d,s=n>=0&&n<c?h[n].dy:-1;if(-1===s){r[t]=!0,C+=o;continue}const a=s*u*4,y=(s+o)*u*4,S=C*u*4,x=(C+o)*u*4;v===a&&w===S?(v=y,w=x):(-1!==_&&(g.set(l.subarray(_,v),b),-1===m&&0===_&&_===b&&(m=v),-1===f&&v===p&&_===b&&(f=_)),_=a,v=y,b=S,w=x),r[t]=!1,C+=o}return-1!==_&&(g.set(l.subarray(_,v),b),-1===m&&0===_&&_===b&&(m=v),-1===f&&v===p&&_===b&&(f=_)),[-1===m?-1:m/(4*u),-1===f?-1:f/(4*u),r]}static _renderLine(e,t,i,n,o,s,r,a,l,d,h,c,u,g,p){const m=u.content,f=u.tokens,_=e.width-s,v=1===p;let b=8,w=0,C=0;for(let u=0,p=f.getCount();u<p;u++){const p=f.getEndOffset(u),y=f.getForeground(u),S=r.getColor(y);for(;w<p;w++){if(b>_)return;const r=m.charCodeAt(w);if(9===r){const e=c-(w+C)%c;C+=e-1,b+=e*s}else if(32===r)b+=s;else{const c=yn(r)?2:1;for(let u=0;u<c;u++)if(2===o?l.blockRenderChar(e,b,d+h,S,a,t,i,v):l.renderChar(e,b,d+h,r,S,a,t,i,g,n,v),b+=s,b>_)return}}}}}class wH{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let e=0,t=this._endLineNumber-this._startLineNumber+1;e<t;e++)this._values[e]=i}has(e){return this.get(e)!==this._defaultValue}set(e,t){e<this._startLineNumber||e>this._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return e<this._startLineNumber||e>this._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}var CH=i(213),yH={};yH.styleTagTransform=zl(),yH.setAttributes=Bl(),yH.insert=Pl().bind(null,"head"),yH.domAPI=Rl(),yH.insertStyleElement=Vl(),Ml()(CH.A,yH),CH.A&&CH.A.locals&&CH.A.locals;class SH extends NB{constructor(e,t){super(e),this._viewDomNode=t;const i=this._context.configuration.options.get(165);this._widgets={},this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,this._viewDomNodeRect={top:0,left:0,width:0,height:0},this._domNode=tT(document.createElement("div")),IB.write(this._domNode,4),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=tT(document.createElement("div")),IB.write(this.overflowingOverlayWidgetsDomNode,5),this.overflowingOverlayWidgetsDomNode.setClassName("overflowingOverlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options.get(165);return this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,!0}_widgetCanOverflow(e){const t=this._context.configuration.options.get(4);return!!e.allowEditorOverflow&&t}addWidget(e){const t=tT(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._widgetCanOverflow(e)?this.overflowingOverlayWidgetsDomNode.appendChild(t):this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const i=this._widgets[e.getId()],n=t?t.preference:null,o=t?.stackOridinal;return i.preference===n&&i.stack===o?(this._updateMaxMinWidth(),!1):(i.preference=n,i.stack=o,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){let e=0;const t=Object.keys(this._widgets);for(let i=0,n=t.length;i<n;i++){const n=t[i],o=this._widgets[n],s=o.widget.getMinContentWidthInPx?.();void 0!==s&&(e=Math.max(e,s))}this._context.viewLayout.setOverlayWidgetsMinWidth(e)}_renderWidget(e,t){const i=e.domNode;if(null===e.preference)return void i.setTop("");const n=2*this._verticalScrollbarWidth+this._minimapWidth;if(0===e.preference||1===e.preference){if(1===e.preference){const e=i.domNode.clientHeight;i.setTop(this._editorHeight-e-2*this._horizontalScrollbarHeight)}else i.setTop(0);void 0!==e.stack?(i.setTop(t[e.preference]),t[e.preference]+=i.domNode.clientWidth):i.setRight(n)}else if(2===e.preference)i.domNode.style.right="50%",void 0!==e.stack?(i.setTop(t[2]),t[2]+=i.domNode.clientHeight):i.setTop(0);else{const{top:t,left:n}=e.preference;if(this._context.configuration.options.get(51)&&this._widgetCanOverflow(e.widget)){const e=this._viewDomNodeRect;i.setTop(t+e.top),i.setLeft(n+e.left),i.setPosition("fixed")}else i.setTop(t),i.setLeft(n),i.setPosition("absolute")}}prepareRender(e){this._viewDomNodeRect=Na(this._viewDomNode.domNode)}render(e){this._domNode.setWidth(this._editorWidth);const t=Object.keys(this._widgets),i=Array.from({length:3},(()=>0));t.sort(((e,t)=>(this._widgets[e].stack||0)-(this._widgets[t].stack||0)));for(let e=0,n=t.length;e<n;e++){const n=t[e];this._renderWidget(this._widgets[n],i)}}}class xH{constructor(e,t,i,n){this._viewportBrand=void 0,this.top=0|e,this.left=0|t,this.width=0|i,this.height=0|n}}class kH{constructor(e,t){this.tabSize=e,this.data=t}}class LH{constructor(e,t,i,n,o,s,r){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=n,this.startVisibleColumn=o,this.tokens=s,this.inlineDecorations=r}}class DH{constructor(e,t,i,n,o,s,r,a,l,d,h,c){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=n,this.isBasicASCII=DH.isBasicASCII(i,s),this.containsRTL=DH.containsRTL(i,this.isBasicASCII,o),this.tokens=r,this.inlineDecorations=a,this.tabSize=l,this.startVisibleColumn=d,this.textDirection=h,this.hasVariableFonts=c}static isBasicASCII(e,t){return!t||bn(e)}static containsRTL(e,t,i){return!(t||!i)&&_n(e)}}class EH{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.color<t.color?-1:e.color>t.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&es(e.data,t.data)}static equalsArr(e,t){return es(e,t,EH.equals)}}class NH{constructor(e,t){const i=e.options;this.lineHeight=i.get(75),this.pixelRatio=i.get(163),this.overviewRulerLanes=i.get(95),this.renderBorder=i.get(94);const n=t.getColor(Ww);this.borderColor=n?n.toString():null,this.hideCursor=i.get(68);const o=t.getColor(pw);this.cursorColorSingle=o?o.transparent(.7).toString():null;const s=t.getColor(fw);this.cursorColorPrimary=s?s.transparent(.7).toString():null;const r=t.getColor(vw);this.cursorColorSecondary=r?r.transparent(.7).toString():null,this.themeType=t.type;const a=i.get(81),l=a.enabled,d=a.side,h=t.getColor(Vw),c=JS.getDefaultBackground();this.backgroundColor=h||(l&&"right"===d?c:null);const u=i.get(165).overviewRuler;this.top=u.top,this.right=u.right,this.domWidth=u.width,this.domHeight=u.height,0===this.overviewRulerLanes?(this.canvasWidth=0,this.canvasHeight=0):(this.canvasWidth=this.domWidth*this.pixelRatio|0,this.canvasHeight=this.domHeight*this.pixelRatio|0);const[g,p]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=g,this.w=p}_initLanes(e,t,i){const n=t-e;if(i>=3){const t=Math.floor(n/3),i=Math.floor(n/3),o=n-t-i,s=e+t;return[[0,e,s,e,e+t+o,e,s,e],[0,t,o,t+o,i,t+o+i,o+i,t+o+i]]}if(2===i){const t=Math.floor(n/2),i=n-t;return[[0,e,e,e,e+t,e,e,e],[0,t,t,t,i,t+i,t+i,t+i]]}return[[0,e,e,e,e,e,e,e],[0,n,n,n,n,n,n,n]]}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColorSingle===e.cursorColorSingle&&this.cursorColorPrimary===e.cursorColorPrimary&&this.cursorColorSecondary===e.cursorColorSecondary&&this.themeType===e.themeType&&Lg.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}class IH extends NB{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=tT(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=JS.onDidChange((e=>{e.changedColorMap&&this._updateSettings(!0)})),this._cursorPositions=[{position:new rc(1,1),color:this._settings.cursorColorSingle}]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new NH(this._context.configuration,this._context.theme);return!(this._settings&&this._settings.equals(t)||(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),0))}_markRenderingIsNeeded(){return this._actualShouldRender=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return!!this._updateSettings(!1)&&this._markRenderingIsNeeded()}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t<i;t++){let n=this._settings.cursorColorSingle;i>1&&(n=0===t?this._settings.cursorColorPrimary:this._settings.cursorColorSecondary),this._cursorPositions.push({position:e.selections[t].getPosition(),color:n})}return this._cursorPositions.sort(((e,t)=>rc.compare(e.position,t.position))),this._markRenderingIsMaybeNeeded()}onDecorationsChanged(e){return!!e.affectsOverviewRuler&&this._markRenderingIsMaybeNeeded()}onFlushed(e){return this._markRenderingIsNeeded()}onScrollChanged(e){return!!e.scrollHeightChanged&&this._markRenderingIsNeeded()}onZonesChanged(e){return this._markRenderingIsNeeded()}onThemeChanged(e){return!!this._updateSettings(!1)&&this._markRenderingIsNeeded()}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render(),this._actualShouldRender=0}_render(){const e=this._settings.backgroundColor;if(0===this._settings.overviewRulerLanes)return this._domNode.setBackgroundColor(e?Lg.Format.CSS.formatHexA(e):""),void this._domNode.setDisplay("none");const t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(EH.compareByRenderingProps),1!==this._actualShouldRender||EH.equalsArr(this._renderedDecorations,t)||(this._actualShouldRender=2),1!==this._actualShouldRender||es(this._renderedCursorPositions,this._cursorPositions,((e,t)=>e.position.lineNumber===t.position.lineNumber&&e.color===t.color))||(this._actualShouldRender=2),1===this._actualShouldRender)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,n=this._settings.canvasHeight,o=this._settings.lineHeight,s=this._context.viewLayout,r=n/this._context.viewLayout.getScrollHeight(),a=6*this._settings.pixelRatio|0,l=a/2|0,d=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(d.fillStyle=Lg.Format.CSS.formatHexA(e),d.fillRect(0,0,i,n)):(d.clearRect(0,0,i,n),d.fillStyle=Lg.Format.CSS.formatHexA(e),d.fillRect(0,0,i,n)):d.clearRect(0,0,i,n);const h=this._settings.x,c=this._settings.w;for(const e of t){const t=e.color,i=e.data;d.fillStyle=t;let u=0,g=0,p=0;for(let e=0,t=i.length/3;e<t;e++){const t=i[3*e],m=i[3*e+1],f=i[3*e+2];let _=s.getVerticalOffsetForLineNumber(m)*r|0,v=(s.getVerticalOffsetForLineNumber(f)+o)*r|0;if(v-_<a){let e=(_+v)/2|0;e<l?e=l:e+l>n&&(e=n-l),_=e-l,v=e+l}_>p+1||t!==u?(0!==e&&d.fillRect(h[u],g,c[u],p-g),u=t,g=_,p=v):v>p&&(p=v)}d.fillRect(h[u],g,c[u],p-g)}if(!this._settings.hideCursor){const e=2*this._settings.pixelRatio|0,t=e/2|0,i=this._settings.x[7],o=this._settings.w[7];let a=-100,l=-100,h=null;for(let c=0,u=this._cursorPositions.length;c<u;c++){const u=this._cursorPositions[c].color;if(!u)continue;const g=this._cursorPositions[c].position;let p=s.getVerticalOffsetForLineNumber(g.lineNumber)*r|0;p<t?p=t:p+t>n&&(p=n-t);const m=p-t,f=m+e;m>l+1||u!==h?(0!==c&&h&&d.fillRect(i,a,o,l-a),a=m,l=f):f>l&&(l=f),h=u,d.fillStyle=u}h&&d.fillRect(i,a,o,l-a)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(d.beginPath(),d.lineWidth=1,d.strokeStyle=this._settings.borderColor,d.moveTo(0,0),d.lineTo(0,n),d.moveTo(1,0),d.lineTo(i,0),d.stroke())}}class TH{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=0|e,this.to=0|t,this.colorId=0|i}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class MH{constructor(e,t,i,n){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=n,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber:e.color<t.color?-1:1}setColorZone(e){this._colorZone=e}getColorZones(){return this._colorZone}}class AH{constructor(e){this._getVerticalOffsetForLine=e,this._zones=[],this._colorZonesInvalid=!1,this._lineHeight=0,this._domWidth=0,this._domHeight=0,this._outerHeight=0,this._pixelRatio=1,this._lastAssignedId=0,this._color2Id=Object.create(null),this._id2Color=[]}getId2Color(){return this._id2Color}setZones(e){this._zones=e,this._zones.sort(MH.compare)}setLineHeight(e){return this._lineHeight!==e&&(this._lineHeight=e,this._colorZonesInvalid=!0,!0)}setPixelRatio(e){this._pixelRatio=e,this._colorZonesInvalid=!0}getDOMWidth(){return this._domWidth}getCanvasWidth(){return this._domWidth*this._pixelRatio}setDOMWidth(e){return this._domWidth!==e&&(this._domWidth=e,this._colorZonesInvalid=!0,!0)}getDOMHeight(){return this._domHeight}getCanvasHeight(){return this._domHeight*this._pixelRatio}setDOMHeight(e){return this._domHeight!==e&&(this._domHeight=e,this._colorZonesInvalid=!0,!0)}getOuterHeight(){return this._outerHeight}setOuterHeight(e){return this._outerHeight!==e&&(this._outerHeight=e,this._colorZonesInvalid=!0,!0)}resolveColorZones(){const e=this._colorZonesInvalid,t=Math.floor(this._lineHeight),i=Math.floor(this.getCanvasHeight()),n=i/Math.floor(this._outerHeight),o=Math.floor(4*this._pixelRatio/2),s=[];for(let r=0,a=this._zones.length;r<a;r++){const a=this._zones[r];if(!e){const e=a.getColorZones();if(e){s.push(e);continue}}const l=this._getVerticalOffsetForLine(a.startLineNumber),d=0===a.heightInLines?this._getVerticalOffsetForLine(a.endLineNumber)+t:l+a.heightInLines*t,h=Math.floor(n*l),c=Math.floor(n*d);let u=Math.floor((h+c)/2),g=c-u;g<o&&(g=o),u-g<0&&(u=g),u+g>i&&(u=i-g);const p=a.color;let m=this._color2Id[p];m||(m=++this._lastAssignedId,this._color2Id[p]=m,this._id2Color[m]=p);const f=new TH(u-g,u+g,m);a.setColorZone(f),s.push(f)}return this._colorZonesInvalid=!1,s.sort(TH.compare),s}}class RH extends EB{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=tT(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new AH((e=>this._context.viewLayout.getVerticalOffsetForLineNumber(e))),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(75)),this._zoneManager.setPixelRatio(i.get(163)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(75)&&(this._zoneManager.setLineHeight(t.get(75)),this._render()),e.hasChanged(163)&&(this._zoneManager.setPixelRatio(t.get(163)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(0===this._zoneManager.getOuterHeight())return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),n=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,n,e),!0}_renderOneLane(e,t,i,n){let o=0,s=0,r=0;for(const a of t){const t=a.colorId,l=a.from,d=a.to;t!==o?(e.fillRect(0,s,n,r-s),o=t,e.fillStyle=i[o],s=l,r=d):r>=l?r=Math.max(r,d):(e.fillRect(0,s,n,r-s),s=l,r=d)}e.fillRect(0,s,n,r-s)}}var OH=i(1637),PH={};PH.styleTagTransform=zl(),PH.setAttributes=Bl(),PH.insert=Pl().bind(null,"head"),PH.domAPI=Rl(),PH.insertStyleElement=Vl(),Ml()(OH.A,PH),OH.A&&OH.A.locals&&OH.A.locals;class FH extends NB{constructor(e){super(e),this.domNode=tT(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(116),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(116),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e<t){const{tabSize:i}=this._context.viewModel.model.getOptions(),n=i;let o=t-e;for(;o>0;){const e=tT(document.createElement("div"));e.setClassName("view-ruler"),e.setWidth(n),this.domNode.appendChild(e),this._renderedRulers.push(e),o--}return}let i=e-t;for(;i>0;){const e=this._renderedRulers.pop();this.domNode.removeChild(e),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t<i;t++){const i=this._renderedRulers[t],n=this._rulers[t];i.setBoxShadow(n.color?`1px 0 0 0 ${n.color} inset`:""),i.setHeight(Math.min(e.scrollHeight,1e6)),i.setLeft(n.column*this._typicalHalfwidthCharacterWidth)}}}var BH=i(9133),WH={};WH.styleTagTransform=zl(),WH.setAttributes=Bl(),WH.insert=Pl().bind(null,"head"),WH.domAPI=Rl(),WH.insertStyleElement=Vl(),Ml()(BH.A,WH),BH.A&&BH.A.locals&&BH.A.locals;class VH extends NB{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;const t=this._context.configuration.options.get(117);this._useShadows=t.useShadows,this._domNode=tT(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true")}dispose(){super.dispose()}_updateShouldShow(){const e=this._useShadows&&this._scrollTop>0;return this._shouldShow!==e&&(this._shouldShow=e,!0)}getDomNode(){return this._domNode}_updateWidth(){const e=this._context.configuration.options.get(165);0===e.minimap.renderMinimap||e.minimap.minimapWidth>0&&0===e.minimap.minimapLeft?this._width=e.width:this._width=e.width-e.verticalScrollbarWidth}onConfigurationChanged(e){const t=this._context.configuration.options.get(117);return this._useShadows=t.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}var HH=i(8829),zH={};zH.styleTagTransform=zl(),zH.setAttributes=Bl(),zH.insert=Pl().bind(null,"head"),zH.domAPI=Rl(),zH.insertStyleElement=Vl(),Ml()(HH.A,zH),HH.A&&HH.A.locals&&HH.A.locals;class UH{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class KH{constructor(e,t){this.lineNumber=e,this.ranges=t}}function jH(e){return new UH(e)}function qH(e){return new KH(e.lineNumber,e.ranges.map(jH))}class $H extends sV{static{this.SELECTION_CLASS_NAME="selected-text"}static{this.SELECTION_TOP_LEFT="top-left-radius"}static{this.SELECTION_BOTTOM_LEFT="bottom-left-radius"}static{this.SELECTION_TOP_RIGHT="top-right-radius"}static{this.SELECTION_BOTTOM_RIGHT="bottom-right-radius"}static{this.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background"}static{this.ROUNDED_PIECE_WIDTH=10}constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._roundedSelection=t.get(115),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._roundedSelection=t.get(115),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t<i;t++)if(e[t].ranges.length>1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){const n=this._typicalHalfwidthCharacterWidth/4;let o=null,s=null;if(i&&i.length>0&&t.length>0){const n=t[0].lineNumber;if(n===e.startLineNumber)for(let e=0;!o&&e<i.length;e++)i[e].lineNumber===n&&(o=i[e].ranges[0]);const r=t[t.length-1].lineNumber;if(r===e.endLineNumber)for(let e=i.length-1;!s&&e>=0;e--)i[e].lineNumber===r&&(s=i[e].ranges[0]);o&&!o.startStyle&&(o=null),s&&!s.startStyle&&(s=null)}for(let e=0,i=t.length;e<i;e++){const r=t[e].ranges[0],a=r.left,l=r.left+r.width,d={top:0,bottom:0},h={top:0,bottom:0};if(e>0){const i=t[e-1].ranges[0].left,o=t[e-1].ranges[0].left+t[e-1].ranges[0].width;GH(a-i)<n?d.top=2:a>i&&(d.top=1),GH(l-o)<n?h.top=2:i<l&&l<o&&(h.top=1)}else o&&(d.top=o.startStyle.top,h.top=o.endStyle.top);if(e+1<i){const i=t[e+1].ranges[0].left,o=t[e+1].ranges[0].left+t[e+1].ranges[0].width;GH(a-i)<n?d.bottom=2:i<a&&a<o&&(d.bottom=1),GH(l-o)<n?h.bottom=2:l<o&&(h.bottom=1)}else s&&(d.bottom=s.startStyle.bottom,h.bottom=s.endStyle.bottom);r.startStyle=d,r.endStyle=h}}_getVisibleRangesWithStyle(e,t,i){const n=(t.linesVisibleRangesForRange(e,!0)||[]).map(qH);return!this._visibleRangesHaveGaps(n)&&this._roundedSelection&&this._enrichVisibleRangesWithStyle(t.visibleRange,n,i),n}_createSelectionPiece(e,t,i,n,o){return'<div class="cslr '+i+'" style="top:'+e.toString()+"px;bottom:"+t.toString()+"px;left:"+n.toString()+"px;width:"+o.toString()+'px;"></div>'}_actualRenderOneSelection(e,t,i,n){if(0===n.length)return;const o=!!n[0].ranges[0].startStyle,s=n[0].lineNumber,r=n[n.length-1].lineNumber;for(let a=0,l=n.length;a<l;a++){const l=n[a],d=l.lineNumber,h=d-t,c=i&&d===s?1:0,u=i&&d!==s&&d===r?1:0;let g="",p="";for(let e=0,t=l.ranges.length;e<t;e++){const t=l.ranges[e];if(o){const e=t.startStyle,i=t.endStyle;if(1===e.top||1===e.bottom){g+=this._createSelectionPiece(c,u,$H.SELECTION_CLASS_NAME,t.left-$H.ROUNDED_PIECE_WIDTH,$H.ROUNDED_PIECE_WIDTH);let i=$H.EDITOR_BACKGROUND_CLASS_NAME;1===e.top&&(i+=" "+$H.SELECTION_TOP_RIGHT),1===e.bottom&&(i+=" "+$H.SELECTION_BOTTOM_RIGHT),g+=this._createSelectionPiece(c,u,i,t.left-$H.ROUNDED_PIECE_WIDTH,$H.ROUNDED_PIECE_WIDTH)}if(1===i.top||1===i.bottom){g+=this._createSelectionPiece(c,u,$H.SELECTION_CLASS_NAME,t.left+t.width,$H.ROUNDED_PIECE_WIDTH);let e=$H.EDITOR_BACKGROUND_CLASS_NAME;1===i.top&&(e+=" "+$H.SELECTION_TOP_LEFT),1===i.bottom&&(e+=" "+$H.SELECTION_BOTTOM_LEFT),g+=this._createSelectionPiece(c,u,e,t.left+t.width,$H.ROUNDED_PIECE_WIDTH)}}let i=$H.SELECTION_CLASS_NAME;if(o){const e=t.startStyle,n=t.endStyle;0===e.top&&(i+=" "+$H.SELECTION_TOP_LEFT),0===e.bottom&&(i+=" "+$H.SELECTION_BOTTOM_LEFT),0===n.top&&(i+=" "+$H.SELECTION_TOP_RIGHT),0===n.bottom&&(i+=" "+$H.SELECTION_BOTTOM_RIGHT)}p+=this._createSelectionPiece(c,u,i,t.left,t.width)}e[h][0]+=g,e[h][1]+=p}}prepareRender(e){const t=[],i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber;for(let e=i;e<=n;e++)t[e-i]=["",""];const o=[];for(let n=0,s=this._selections.length;n<s;n++){const s=this._selections[n];if(s.isEmpty()){o[n]=null;continue}const r=this._getVisibleRangesWithStyle(s,e,this._previousFrameVisibleRangesWithStyle[n]);o[n]=r,this._actualRenderOneSelection(t,i,this._selections.length>1,r)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map((([e,t])=>e+t))}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function GH(e){return e<0?-e:e}hw(((e,t)=>{const i=e.getColor(y_);i&&!i.isTransparent()&&t.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${i}; }`)}));var ZH,YH=i(2289),QH={};QH.styleTagTransform=zl(),QH.setAttributes=Bl(),QH.insert=Pl().bind(null,"head"),QH.domAPI=Rl(),QH.insertStyleElement=Vl(),Ml()(YH.A,QH),YH.A&&YH.A.locals&&YH.A.locals;class XH{constructor(e,t,i,n,o,s,r){this.top=e,this.left=t,this.paddingLeft=i,this.width=n,this.height=o,this.textContent=s,this.textContentClassName=r}}!function(e){e[e.Single=0]="Single",e[e.MultiPrimary=1]="MultiPrimary",e[e.MultiSecondary=2]="MultiSecondary"}(ZH||(ZH={}));class JH{constructor(e,t){this._context=e;const i=this._context.configuration.options,n=i.get(59);this._cursorStyle=i.get(161),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(i.get(37),this._typicalHalfwidthCharacterWidth),this._lineCursorHeight=i.get(38),this._isVisible=!0,this._domNode=tT(document.createElement("div")),this._domNode.setClassName(`cursor ${MV}`),this._domNode.setHeight(this._context.viewLayout.getLineHeightForLineNumber(1)),this._domNode.setTop(0),this._domNode.setLeft(0),iT(this._domNode,n),this._domNode.setDisplay("none"),this._position=new rc(1,1),this._pluralityClass="",this.setPlurality(t),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}setPlurality(e){switch(e){default:case ZH.Single:this._pluralityClass="";break;case ZH.MultiPrimary:this._pluralityClass="cursor-primary";break;case ZH.MultiSecondary:this._pluralityClass="cursor-secondary"}}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(59);return this._cursorStyle=t.get(161),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(37),this._typicalHalfwidthCharacterWidth),this._lineCursorHeight=t.get(38),iT(this._domNode,i),!0}onCursorPositionChanged(e,t){return this._domNode.domNode.style.transitionProperty=t?"none":"",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[n,o]=function(e,t){t>0&&dn(e.charCodeAt(t))&&t--;const i=t+pn(e,t);return[i-mn(e,i),i]}(i,t-1);return[new rc(e,n+1),i.substring(n,o)]}_prepareRender(e){let t="",i="";const[n,o]=this._getGraphemeAwarePosition(),s=this._context.viewLayout.getLineHeightForLineNumber(n.lineNumber),r=0===this._lineCursorHeight?s:Math.min(s,this._lineCursorHeight),a=(s-r)/2;if(this._cursorStyle===QO.Line||this._cursorStyle===QO.LineThin){const s=e.visibleRangeForPosition(n);if(!s||s.outsideRenderedLine)return null;const l=ta(this._domNode.domNode);let d;this._cursorStyle===QO.Line?(d=cl(l,this._lineCursorWidth>0?this._lineCursorWidth:2),d>2&&(t=o,i=this._getTokenClassName(n))):d=cl(l,1);let h=s.left,c=0;d>=2&&h>=1&&(c=1,h-=c);const u=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta+a;return new XH(u,h,c,d,r,t,i)}const l=e.linesVisibleRangesForRange(new Yu(n.lineNumber,n.column,n.lineNumber,n.column+o.length),!1);if(!l||0===l.length)return null;const d=l[0];if(d.outsideRenderedLine||0===d.ranges.length)return null;const h=d.ranges[0],c="\t"===o||h.width<1?this._typicalHalfwidthCharacterWidth:h.width;this._cursorStyle===QO.Block&&(t=o,i=this._getTokenClassName(n));let u=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta,g=s;return this._cursorStyle!==QO.Underline&&this._cursorStyle!==QO.UnderlineThin||(u+=s-2,g=2),new XH(u,h.left,0,c,g,t,i)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),i=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(i)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${this._pluralityClass} ${MV} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}class ez extends NB{static{this.BLINK_INTERVAL=500}constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(104),this._cursorBlinking=t.get(32),this._cursorStyle=t.get(161),this._cursorSmoothCaretAnimation=t.get(33),this._editContextEnabled=t.get(170),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new JH(this._context,ZH.Single),this._secondaryCursors=[],this._renderData=[],this._domNode=tT(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new bi,this._cursorFlatBlinkInterval=new ya,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(104),this._cursorBlinking=t.get(32),this._cursorStyle=t.get(161),this._cursorSmoothCaretAnimation=t.get(33),this._editContextEnabled=t.get(170),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let t=0,i=this._secondaryCursors.length;t<i;t++)this._secondaryCursors[t].onConfigurationChanged(e);return!0}_onCursorPositionChanged(e,t,i){const n=this._secondaryCursors.length!==t.length||"explicit"===this._cursorSmoothCaretAnimation&&3!==i;if(this._primaryCursor.setPlurality(t.length?ZH.MultiPrimary:ZH.Single),this._primaryCursor.onCursorPositionChanged(e,n),this._updateBlinking(),this._secondaryCursors.length<t.length){const e=t.length-this._secondaryCursors.length;for(let t=0;t<e;t++){const e=new JH(this._context,ZH.MultiSecondary);this._domNode.domNode.insertBefore(e.getDomNode().domNode,this._primaryCursor.getDomNode().domNode.nextSibling),this._secondaryCursors.push(e)}}else if(this._secondaryCursors.length>t.length){const e=this._secondaryCursors.length-t.length;for(let t=0;t<e;t++)this._domNode.removeChild(this._secondaryCursors[0].getDomNode()),this._secondaryCursors.splice(0,1)}for(let e=0;e<t.length;e++)this._secondaryCursors[e].onCursorPositionChanged(t[e],n)}onCursorStateChanged(e){const t=[];for(let i=0,n=e.selections.length;i<n;i++)t[i]=e.selections[i].getPosition();this._onCursorPositionChanged(t[0],t.slice(1),e.reason);const i=e.selections[0].isEmpty();return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,this._updateDomClassName()),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onFocusChanged(e){return this._editorHasFocus=e.isFocused,this._updateBlinking(),!1}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return!0}onTokensChanged(e){const t=t=>{for(let i=0,n=e.ranges.length;i<n;i++)if(e.ranges[i].fromLineNumber<=t.lineNumber&&t.lineNumber<=e.ranges[i].toLineNumber)return!0;return!1};if(t(this._primaryCursor.getPosition()))return!0;for(const e of this._secondaryCursors)if(t(e.getPosition()))return!0;return!1}onZonesChanged(e){return!0}_getCursorBlinking(){return this._isComposingInput&&!this._editContextEnabled?0:this._editorHasFocus?this._readOnly?5:this._cursorBlinking:0}_updateBlinking(){this._startCursorBlinkAnimation.cancel(),this._cursorFlatBlinkInterval.cancel();const e=this._getCursorBlinking(),t=0===e,i=5===e;t?this._hide():this._show(),this._blinkingEnabled=!1,this._updateDomClassName(),t||i||(1===e?this._cursorFlatBlinkInterval.cancelAndSet((()=>{this._isVisible?this._hide():this._show()}),ez.BLINK_INTERVAL,ta(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet((()=>{this._blinkingEnabled=!0,this._updateDomClassName()}),ez.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case QO.Line:e+=" cursor-line-style";break;case QO.Block:e+=" cursor-block-style";break;case QO.Underline:e+=" cursor-underline-style";break;case QO.LineThin:e+=" cursor-line-thin-style";break;case QO.BlockOutline:e+=" cursor-block-outline-style";break;case QO.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return"on"!==this._cursorSmoothCaretAnimation&&"explicit"!==this._cursorSmoothCaretAnimation||(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].show();this._isVisible=!0}_hide(){this._primaryCursor.hide();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].hide();this._isVisible=!1}prepareRender(e){this._primaryCursor.prepareRender(e);for(let t=0,i=this._secondaryCursors.length;t<i;t++)this._secondaryCursors[t].prepareRender(e)}render(e){const t=[];let i=0;const n=this._primaryCursor.render(e);n&&(t[i++]=n);for(let n=0,o=this._secondaryCursors.length;n<o;n++){const o=this._secondaryCursors[n].render(e);o&&(t[i++]=o)}this._renderData=t}getLastRenderData(){return this._renderData}}hw(((e,t)=>{const i=[{class:".cursor",foreground:pw,background:mw},{class:".cursor-primary",foreground:fw,background:_w},{class:".cursor-secondary",foreground:vw,background:bw}];for(const n of i){const i=e.getColor(n.foreground);if(i){let o=e.getColor(n.background);o||(o=i.opposite()),t.addRule(`.monaco-editor .cursors-layer ${n.class} { background-color: ${i}; border-color: ${i}; color: ${o}; }`),nw(e.type)&&t.addRule(`.monaco-editor .cursors-layer.has-selection ${n.class} { border-left: 1px solid ${o}; border-right: 1px solid ${o}; }`)}}}));const tz=()=>{throw new Error("Invalid change accessor")};class iz extends NB{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(165);this._lineHeight=t.get(75),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=tT(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=tT(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const i of e)t.set(i.id,i);let i=!1;return this._context.viewModel.changeWhitespace((e=>{const n=Object.keys(this._zones);for(let o=0,s=n.length;o<s;o++){const s=n[o],r=this._zones[s],a=this._computeWhitespaceProps(r.delegate);r.isInHiddenArea=a.isInHiddenArea;const l=t.get(s);!l||l.afterLineNumber===a.afterViewLineNumber&&l.height===a.heightInPx||(e.changeOneWhitespace(s,a.afterViewLineNumber,a.heightInPx),this._safeCallOnComputedHeight(r.delegate,a.heightInPx),i=!0)}})),i}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(165);return this._lineHeight=t.get(75),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,e.hasChanged(75)&&this._recomputeWhitespacesProps(),!0}onLineMappingChanged(e){return this._recomputeWhitespacesProps()}onLinesDeleted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}onLinesInserted(e){return!0}_getZoneOrdinal(e){return e.ordinal??e.afterColumn??1e4}_computeWhitespaceProps(e){if(0===e.afterLineNumber)return{isInHiddenArea:!1,afterViewLineNumber:0,heightInPx:this._heightInPixels(e),minWidthInPx:this._minWidthInPixels(e)};let t,i;if(void 0!==e.afterColumn)t=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:e.afterColumn});else{const i=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:1}).lineNumber;t=new rc(i,this._context.viewModel.model.getLineMaxColumn(i))}i=t.column===this._context.viewModel.model.getLineMaxColumn(t.lineNumber)?this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber+1,column:1}):this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber,column:t.column+1});const n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t,e.afterColumnAffinity,!0),o=e.showInHiddenAreas||this._context.viewModel.coordinatesConverter.modelPositionIsVisible(i);return{isInHiddenArea:!o,afterViewLineNumber:n.lineNumber,heightInPx:o?this._heightInPixels(e):0,minWidthInPx:this._minWidthInPixels(e)}}changeViewZones(e){let t=!1;return this._context.viewModel.changeWhitespace((i=>{const n={addZone:e=>(t=!0,this._addZone(i,e)),removeZone:e=>{e&&(t=this._removeZone(i,e)||t)},layoutZone:e=>{e&&(t=this._layoutZone(i,e)||t)}};!function(e,t){try{return e(t)}catch(e){Ie(e)}}(e,n),n.addZone=tz,n.removeZone=tz,n.layoutZone=tz})),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),n={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:tT(t.domNode),marginDomNode:t.marginDomNode?tT(t.marginDomNode):null};return this._safeCallOnComputedHeight(n.delegate,i.heightInPx),n.domNode.setPosition("absolute"),n.domNode.domNode.style.width="100%",n.domNode.setDisplay("none"),n.domNode.setAttribute("monaco-view-zone",n.whitespaceId),this.domNode.appendChild(n.domNode),n.marginDomNode&&(n.marginDomNode.setPosition("absolute"),n.marginDomNode.domNode.style.width="100%",n.marginDomNode.setDisplay("none"),n.marginDomNode.setAttribute("monaco-view-zone",n.whitespaceId),this.marginDomNode.appendChild(n.marginDomNode)),this._zones[n.whitespaceId]=n,this.setShouldRender(),n.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.remove(),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.remove()),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],n=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=n.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,n.afterViewLineNumber,n.heightInPx),this._safeCallOnComputedHeight(i.delegate,n.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){if(this._zones.hasOwnProperty(e)){const t=this._zones[e];return Boolean(t.delegate.suppressMouseDown)}return!1}_heightInPixels(e){return"number"==typeof e.heightInPx?e.heightInPx:"number"==typeof e.heightInLines?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return"number"==typeof e.minWidthInPx?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if("function"==typeof e.onComputedHeight)try{e.onComputedHeight(t)}catch(e){Ie(e)}}_safeCallOnDomNodeTop(e,t){if("function"==typeof e.onDomNodeTop)try{e.onDomNodeTop(t)}catch(e){Ie(e)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(const e of t)this._zones[e.id].isInHiddenArea||(i[e.id]=e,n=!0);const o=Object.keys(this._zones);for(let t=0,n=o.length;t<n;t++){const n=o[t],s=this._zones[n];let r=0,a=0,l="none";i.hasOwnProperty(n)?(r=i[n].verticalOffset-e.bigNumbersDelta,a=i[n].height,l="block",s.isVisible||(s.domNode.setAttribute("monaco-visible-view-zone","true"),s.isVisible=!0),this._safeCallOnDomNodeTop(s.delegate,e.getScrolledTopFromAbsoluteTop(i[n].verticalOffset))):(s.isVisible&&(s.domNode.removeAttribute("monaco-visible-view-zone"),s.isVisible=!1),this._safeCallOnDomNodeTop(s.delegate,e.getScrolledTopFromAbsoluteTop(-1e6))),s.domNode.setTop(r),s.domNode.setHeight(a),s.domNode.setDisplay(l),s.marginDomNode&&(s.marginDomNode.setTop(r),s.marginDomNode.setHeight(a),s.marginDomNode.setDisplay(l))}n&&(this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth)),this.marginDomNode.setWidth(this._contentLeft))}}var nz=i(8189),oz={};oz.styleTagTransform=zl(),oz.setAttributes=Bl(),oz.insert=Pl().bind(null,"head"),oz.domAPI=Rl(),oz.insertStyleElement=Vl(),Ml()(nz.A,oz),nz.A&&nz.A.locals&&nz.A.locals;class sz extends sV{constructor(e){super(),this._context=e,this._options=new rz(this._context.configuration),this._selection=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=new rz(this._context.configuration);return this._options.equals(t)?e.hasChanged(165):(this._options=t,!0)}onCursorStateChanged(e){return this._selection=e.selections,"selection"===this._options.renderWhitespace}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}prepareRender(e){if("none"===this._options.renderWhitespace)return void(this._renderResult=null);const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber-t+1,n=new Array(i);for(let e=0;e<i;e++)n[e]=!0;this._renderResult=[];for(let t=e.viewportData.startLineNumber;t<=e.viewportData.endLineNumber;t++){const i=t-e.viewportData.startLineNumber,n=this._context.viewModel.getViewLineRenderingData(t);let o=null;if("selection"===this._options.renderWhitespace){const e=this._selection;for(const i of e){if(i.endLineNumber<t||i.startLineNumber>t)continue;const e=i.startLineNumber===t?i.startColumn:n.minColumn,s=i.endLineNumber===t?i.endColumn:n.maxColumn;e<s&&(o||(o=[]),o.push(new cm(e-1,s-1)))}}this._renderResult[i]=this._applyRenderWhitespace(e,t,o,n)}}_applyRenderWhitespace(e,t,i,n){if(n.hasVariableFonts)return"";if("selection"===this._options.renderWhitespace&&!i)return"";if("trailing"===this._options.renderWhitespace&&n.continuesWithWrappedLine)return"";const o=this._context.theme.getColor(ww),s=this._options.renderWithSVG,r=n.content,a=-1===this._options.stopRenderingLineAfter?r.length:Math.min(this._options.stopRenderingLineAfter,r.length),l=n.continuesWithWrappedLine,d=n.minColumn-1,h="boundary"===this._options.renderWhitespace,c="trailing"===this._options.renderWhitespace,u=e.getLineHeightForLineNumber(t),g=this._options.middotWidth,p=this._options.wsmiddotWidth,m=this._options.spaceWidth,f=Math.abs(p-m)<Math.abs(g-m)?11825:183,_=this._options.canUseHalfwidthRightwardsArrow;let v,b="",w=!1,C=$i(r);-1===C?(w=!0,C=a,v=a):v=Zi(r);let y=0,S=i&&i[y],x=0;for(let n=d;n<a;n++){const o=r.charCodeAt(n);if(S&&S.endExclusive<=n&&(y++,S=i&&i[y]),9!==o&&32!==o)continue;if(c&&!w&&n<=v)continue;if(h&&n>=C&&n<=v&&32===o){const e=n-1>=0?r.charCodeAt(n-1):0,t=n+1<a?r.charCodeAt(n+1):0;if(32!==e&&32!==t)continue}if(h&&l&&n===a-1){const e=n-1>=0?r.charCodeAt(n-1):0;if(32===o&&32!==e&&9!==e)continue}if(i&&!(S&&S.start<=n&&n<S.endExclusive))continue;const d=e.visibleRangeForPosition(new rc(t,n+1));d&&(s?(x=Math.max(x,d.left),b+=9===o?this._renderArrow(u,m,d.left):`<circle cx="${(d.left+m/2).toFixed(2)}" cy="${(u/2).toFixed(2)}" r="${(m/7).toFixed(2)}" />`):b+=9===o?`<div class="mwh" style="left:${d.left}px;height:${u}px;">${_?String.fromCharCode(65515):String.fromCharCode(8594)}</div>`:`<div class="mwh" style="left:${d.left}px;height:${u}px;">${String.fromCharCode(f)}</div>`)}return s?(x=Math.round(x+m),`<svg style="bottom:0;position:absolute;width:${x}px;height:${u}px" viewBox="0 0 ${x} ${u}" xmlns="http://www.w3.org/2000/svg" fill="${o}">`+b+"</svg>"):b}_renderArrow(e,t,i){const n=e/2,o=i,s={x:0,y:t/7/2},r={x:.8*t,y:s.y},a={x:r.x-.2*r.x,y:r.y+.2*r.x},l={x:a.x+.1*r.x,y:a.y+.1*r.x},d={x:l.x+.35*r.x,y:l.y-.35*r.x};return`<path d="M ${[s,r,a,l,d,{x:d.x,y:-d.y},{x:l.x,y:-l.y},{x:a.x,y:-a.y},{x:r.x,y:-r.y},{x:s.x,y:-s.y}].map((e=>`${(o+e.x).toFixed(2)} ${(n+e.y).toFixed(2)}`)).join(" L ")}" />`}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class rz{constructor(e){const t=e.options,i=t.get(59),n=t.get(47);"off"===n?(this.renderWhitespace="none",this.renderWithSVG=!1):"svg"===n?(this.renderWhitespace=t.get(113),this.renderWithSVG=!0):(this.renderWhitespace=t.get(113),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(75),this.stopRenderingLineAfter=t.get(133)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}class az{constructor(e,t,i,n){this.selections=e,this.startLineNumber=0|t.startLineNumber,this.endLineNumber=0|t.endLineNumber,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=0|t.bigNumbersDelta,this.lineHeight=0|t.lineHeight,this.whitespaceViewportData=i,this._model=n,this.visibleRange=new Yu(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewportViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}class lz{get type(){return this._theme.type}get value(){return this._theme}constructor(e){this._theme=e}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class dz{constructor(e,t,i){this.configuration=e,this.theme=new lz(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}const hz=new Float32Array([1,0,1,1,0,1,0,0,0,1,1,0]);function cz(e){if(!e)throw new Error(`Value "${e}" cannot be null`);return e}function uz(e,t,i){let n=new t.ResizeObserver((t=>{const o=t.find((t=>t.target===e));if(!o)return;if(!("devicePixelContentBoxSize"in o))return n?.disconnect(),void(n=void 0);const s=o.devicePixelContentBoxSize[0].inlineSize,r=o.devicePixelContentBoxSize[0].blockSize;s>0&&r>0&&i(s,r)}));try{n.observe(e,{box:["device-pixel-content-box"]})}catch{throw n.disconnect(),n=void 0,new Ve("Could not observe device pixel dimensions")}return Tt((()=>n?.disconnect()))}let gz=0;class pz extends At{get cacheKey(){return`${this.fontFamily}_${this.fontSize}px`}constructor(e,t,i,n){super(),this.fontSize=e,this.fontFamily=t,this.devicePixelRatio=i,this._decorationStyleCache=n,this.id=gz++,this._workGlyph={source:null,boundingBox:{left:0,bottom:0,right:0,top:0},originOffset:{x:0,y:0},fontBoundingBoxAscent:0,fontBoundingBoxDescent:0},this._workGlyphConfig={chars:void 0,tokenMetadata:0,decorationStyleSetId:0},this._antiAliasing=$?"greyscale":"subpixel";const o=Math.ceil(this.fontSize*i);this._canvas=new OffscreenCanvas(3*o,3*o),this._ctx=cz(this._canvas.getContext("2d",{willReadFrequently:!0,alpha:"greyscale"===this._antiAliasing})),this._ctx.textBaseline="top",this._ctx.fillStyle="#FFFFFF",this._ctx.font=`${o}px ${this.fontFamily}`,this._textMetrics=this._ctx.measureText("A")}rasterizeGlyph(e,t,i,n){return""===e?{source:this._canvas,boundingBox:{top:0,left:0,bottom:-1,right:-1},originOffset:{x:0,y:0},fontBoundingBoxAscent:0,fontBoundingBoxDescent:0}:this._workGlyphConfig.chars===e&&this._workGlyphConfig.tokenMetadata===t&&this._workGlyphConfig.decorationStyleSetId===i?this._workGlyph:(this._workGlyphConfig.chars=e,this._workGlyphConfig.tokenMetadata=t,this._workGlyphConfig.decorationStyleSetId=i,this._rasterizeGlyph(e,t,i,n))}_rasterizeGlyph(e,t,i,n){const o=Math.ceil(this.fontSize*this.devicePixelRatio),s=3*o;this._canvas.width!==s&&(this._canvas.width=s,this._canvas.height=s),this._ctx.save();const r=(15&t)/10,a=n[of.getBackground(t)],l=this._decorationStyleCache.getStyleSet(i);"subpixel"===this._antiAliasing?(this._ctx.fillStyle=a,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height)):this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height);const d=new Xg(200),h=of.getFontStyle(t);1&h&&d.appendString("italic "),void 0!==l?.bold?l.bold&&d.appendString("bold "):2&h&&d.appendString("bold "),d.appendString(`${o}px ${this.fontFamily}`),this._ctx.font=d.build();const c=o,u=o;this._ctx.fillStyle=void 0!==l?.color?`#${l.color.toString(16).padStart(8,"0")}`:n[of.getForeground(t)],this._ctx.textBaseline="top",void 0!==l?.opacity&&(this._ctx.globalAlpha=l.opacity),this._ctx.fillText(e,c+r,u),this._ctx.restore();const g=this._ctx.getImageData(0,0,this._canvas.width,this._canvas.height);if("subpixel"===this._antiAliasing){const e=parseInt(a.substring(1,3),16),t=parseInt(a.substring(3,5),16),i=parseInt(a.substring(5,7),16);this._clearColor(g,e,t,i),this._ctx.putImageData(g,0,0)}return this._findGlyphBoundingBox(g,this._workGlyph.boundingBox),this._workGlyph.source=this._canvas,this._workGlyph.originOffset.x=this._workGlyph.boundingBox.left-c,this._workGlyph.originOffset.y=this._workGlyph.boundingBox.top-u,this._workGlyph.fontBoundingBoxAscent=this._textMetrics.fontBoundingBoxAscent,this._workGlyph.fontBoundingBoxDescent=this._textMetrics.fontBoundingBoxDescent,this._workGlyph}_clearColor(e,t,i,n){for(let o=0;o<e.data.length;o+=4)e.data[o]===t&&e.data[o+1]===i&&e.data[o+2]===n&&(e.data[o+3]=0)}_findGlyphBoundingBox(e,t){const i=this._canvas.height,n=this._canvas.width;let o=!1;for(let s=0;s<i;s++){for(let i=0;i<n;i++){const r=s*n*4+4*i+3;if(0!==e.data[r]){t.top=s,o=!0;break}}if(o)break}t.left=0,o=!1;for(let s=0;s<n;s++){for(let r=0;r<i;r++){const i=r*n*4+4*s+3;if(0!==e.data[i]){t.left=s,o=!0;break}}if(o)break}t.right=n,o=!1;for(let s=n-1;s>=t.left;s--){for(let r=0;r<i;r++){const i=r*n*4+4*s+3;if(0!==e.data[i]){t.right=s,o=!0;break}}if(o)break}t.bottom=t.top,o=!1;for(let s=i-1;s>=0;s--){for(let i=0;i<n;i++){const r=s*n*4+4*i+3;if(0!==e.data[r]){t.bottom=s,o=!0;break}}if(o)break}}getTextMetrics(e){return this._ctx.measureText(e)}}!function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);s>3&&r&&Object.defineProperty(t,i,r)}([QT],pz.prototype,"cacheKey",null);let mz=class extends At{constructor(e){super(),this._logService=e,this._tasks=[],this._i=0,this._register(Tt((()=>this.clear())))}enqueue(e){this._tasks.push(e),this._start()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,i=0,n=e.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(t=Date.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,Date.now()-t),i=Math.max(t,i),o=e.timeRemaining(),1.5*i>o)return n-t<-20&&this._logService.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-t))}ms`),void this._start();n=o}this.clear()}};mz=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,yu)],mz);const fz="requestIdleCallback"in Ka()?class extends mz{_requestCallback(e){return Ka().requestIdleCallback(e)}_cancelCallback(e){Ka().cancelIdleCallback(e)}}:class extends mz{_requestCallback(e){return Ka().setTimeout((()=>e(this._createDeadline(16))))}_cancelCallback(e){Ka().clearTimeout(e)}_createDeadline(e){const t=Date.now()+e;return{timeRemaining:()=>Math.max(0,t-Date.now())}}};class _z{constructor(e,t){this._canvas=e,this._textureIndex=t,this._currentRow={x:0,y:0,h:0},this._allocatedGlyphs=new Set,this._nextIndex=0,this._ctx=cz(this._canvas.getContext("2d",{willReadFrequently:!0}))}allocate(e){const t=e.boundingBox.right-e.boundingBox.left+1,i=e.boundingBox.bottom-e.boundingBox.top+1;if(t>this._canvas.width||i>this._canvas.height)throw new Ve("Glyph is too large for the atlas page");if(e.boundingBox.right-e.boundingBox.left+1>this._canvas.width-this._currentRow.x&&(this._currentRow.x=0,this._currentRow.y+=this._currentRow.h,this._currentRow.h=1),this._currentRow.y+e.boundingBox.bottom-e.boundingBox.top+1>this._canvas.height)return;this._ctx.drawImage(e.source,e.boundingBox.left,e.boundingBox.top,t,i,this._currentRow.x,this._currentRow.y,t,i);const n={pageIndex:this._textureIndex,glyphIndex:this._nextIndex++,x:this._currentRow.x,y:this._currentRow.y,w:t,h:i,originOffsetX:e.originOffset.x,originOffsetY:e.originOffset.y,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent};return this._currentRow.x+=t,this._currentRow.h=Math.max(this._currentRow.h,i),this._allocatedGlyphs.add(n),n}getUsagePreview(){const e=this._canvas.width,t=this._canvas.height,i=new OffscreenCanvas(e,t),n=cz(i.getContext("2d"));n.fillStyle="#808080",n.fillRect(0,0,e,t);const o=new Map,s=new Map;for(const e of this._allocatedGlyphs)o.set(e.y,Math.max(o.get(e.y)??0,e.h)),s.set(e.y,Math.max(s.get(e.y)??0,e.x+e.w));for(const e of this._allocatedGlyphs)n.fillStyle="#4040FF",n.fillRect(e.x,e.y,e.w,e.h),n.fillStyle="#FF0000",n.fillRect(e.x,e.y+e.h,e.w,o.get(e.y)-e.h);for(const[t,i]of s.entries())t!==this._currentRow.y&&(n.fillStyle="#FF0000",n.fillRect(i,t,e-i,o.get(t)));return i.convertToBlob()}getStats(){const e=this._canvas.width,t=this._canvas.height;let i=0,n=0;const o=e*t,s=new Map,r=new Map;for(const e of this._allocatedGlyphs)s.set(e.y,Math.max(s.get(e.y)??0,e.h)),r.set(e.y,Math.max(r.get(e.y)??0,e.x+e.w));for(const e of this._allocatedGlyphs)i+=e.w*e.h,n+=e.w*(s.get(e.y)-e.h);for(const[t,i]of r.entries())t!==this._currentRow.y&&(n+=(e-i)*s.get(t));return[`page${this._textureIndex}:`,` Total: ${o} (${e}x${t})`,` Used: ${i} (${(i/o*100).toPrecision(2)}%)`,` Wasted: ${n} (${(n/o*100).toPrecision(2)}%)`,`Efficiency: ${(i/(i+n)*100).toPrecision(2)}%`].join("\n")}}class vz{constructor(e,t,i){this._canvas=e,this._textureIndex=t,this._slabs=[],this._activeSlabsByDims=new hd,this._unusedRects=[],this._openRegionsByHeight=new Map,this._openRegionsByWidth=new Map,this._allocatedGlyphs=new Set,this._nextIndex=0,this._ctx=cz(this._canvas.getContext("2d",{willReadFrequently:!0})),this._slabW=Math.min(i?.slabW??64<<Math.max(Math.floor(Ka().devicePixelRatio)-1,0),this._canvas.width),this._slabH=Math.min(i?.slabH??this._slabW,this._canvas.height),this._slabsPerRow=Math.floor(this._canvas.width/this._slabW),this._slabsPerColumn=Math.floor(this._canvas.height/this._slabH)}allocate(e){const t=e.boundingBox.right-e.boundingBox.left+1,i=e.boundingBox.bottom-e.boundingBox.top+1;if(t>this._canvas.width||i>this._canvas.height)throw new Ve("Glyph is too large for the atlas page");if(t>this._slabW||i>this._slabH){if(this._allocatedGlyphs.size>0)return;let e=this._canvas.width;for(;t<e/2&&i<e/2;)e/=2;this._slabW=e,this._slabH=e,this._slabsPerRow=Math.floor(this._canvas.width/this._slabW),this._slabsPerColumn=Math.floor(this._canvas.height/this._slabH)}const n={w:t,h:i};let o,s,r=this._activeSlabsByDims.get(n.w,n.h);if(r){const e=Math.floor(this._slabW/r.entryW)*Math.floor(this._slabH/r.entryH);r.count>=e&&(r=void 0)}if(!r)if(t<i){const e=this._openRegionsByWidth.get(t);if(e?.length)for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.w>=t&&r.h>=i){o=r.x,s=r.y,t<r.w&&this._unusedRects.push({x:r.x+t,y:r.y,w:r.w-t,h:i}),r.y+=i,r.h-=i,0===r.h&&(n===e.length-1?e.pop():this._unusedRects.splice(n,1));break}}}else{const e=this._openRegionsByHeight.get(i);if(e?.length)for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.w>=t&&r.h>=i){o=r.x,s=r.y,i<r.h&&this._unusedRects.push({x:r.x,y:r.y+i,w:t,h:r.h-i}),r.x+=t,r.w-=t,0===r.h&&(n===e.length-1?e.pop():this._unusedRects.splice(n,1));break}}}if(void 0===o||void 0===s){if(!r){if(this._slabs.length>=this._slabsPerRow*this._slabsPerColumn)return;r={x:Math.floor(this._slabs.length%this._slabsPerRow)*this._slabW,y:Math.floor(this._slabs.length/this._slabsPerRow)*this._slabH,entryW:n.w,entryH:n.h,count:0};const e=this._slabW%r.entryW,t=this._slabH%r.entryH;e&&bz(this._openRegionsByWidth,e,{x:r.x+this._slabW-e,w:e,y:r.y,h:this._slabH-(t??0)}),t&&bz(this._openRegionsByHeight,t,{x:r.x,w:this._slabW,y:r.y+this._slabH-t,h:t}),this._slabs.push(r),this._activeSlabsByDims.set(r,n.w,n.h)}const e=Math.floor(this._slabW/r.entryW);o=r.x+Math.floor(r.count%e)*r.entryW,s=r.y+Math.floor(r.count/e)*r.entryH,r.count++}this._ctx.drawImage(e.source,e.boundingBox.left,e.boundingBox.top,t,i,o,s,t,i);const a={pageIndex:this._textureIndex,glyphIndex:this._nextIndex++,x:o,y:s,w:t,h:i,originOffsetX:e.originOffset.x,originOffsetY:e.originOffset.y,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent};return this._allocatedGlyphs.add(a),a}getUsagePreview(){const e=this._canvas.width,t=this._canvas.height,i=new OffscreenCanvas(e,t),n=cz(i.getContext("2d"));n.fillStyle="#808080",n.fillRect(0,0,e,t);let o=0,s=0,r=0,a=0;const l=64<<Math.floor(Ka().devicePixelRatio)-1,d=l;for(const e of this._slabs){let t=0,i=0;for(let s=0;s<e.count;s++)t+e.entryW>l&&(t=0,i+=e.entryH),n.fillStyle="#FF0000",n.fillRect(e.x+t,e.y+i,e.entryW,e.entryH),o+=e.entryW*e.entryH,t+=e.entryW;const s=Math.floor(l/e.entryW),a=Math.floor(d/e.entryH);r+=l*d-e.entryW*s*e.entryH*a}for(const e of this._allocatedGlyphs)s+=e.w*e.h,n.fillStyle="#4040FF",n.fillRect(e.x,e.y,e.w,e.h);const h=Array.from(this._openRegionsByWidth.values()).flat().concat(Array.from(this._openRegionsByHeight.values()).flat());for(const e of h)n.fillStyle="#FF000088",n.fillRect(e.x,e.y,e.w,e.h),a+=e.w*e.h;return n.globalAlpha=.5,n.drawImage(this._canvas,0,0),n.globalAlpha=1,i.convertToBlob()}getStats(){const e=this._canvas.width,t=this._canvas.height;let i=0,n=0,o=0,s=0,r=0;const a=e*t,l=64<<Math.floor(Ka().devicePixelRatio)-1,d=l;for(const e of this._slabs){let t=0,n=0;for(let o=0;o<e.count;o++)t+e.entryW>l&&(t=0,n+=e.entryH),i+=e.entryW*e.entryH,t+=e.entryW;const s=Math.floor(l/e.entryW),r=Math.floor(d/e.entryH);o+=l*d-e.entryW*s*e.entryH*r}for(const e of this._allocatedGlyphs)n+=e.w*e.h;const h=Array.from(this._openRegionsByWidth.values()).flat().concat(Array.from(this._openRegionsByHeight.values()).flat());for(const e of h)r+=e.w*e.h;s=i-(n-(o-r));const c=n/(n+s+r);return[`page[${this._textureIndex}]:`,` Total: ${a}px (${e}x${t})`,` Used: ${n}px (${(n/a*100).toFixed(2)}%)`,` Wasted: ${s}px (${(s/a*100).toFixed(2)}%)`,`Restricted: ${r}px (${(r/a*100).toFixed(2)}%) (hard to allocate)`,`Efficiency: ${1===c?"100":(100*c).toFixed(2)}%`,` Slabs: ${this._slabs.length} of ${Math.floor(this._canvas.width/l)*Math.floor(this._canvas.height/d)}`].join("\n")}}function bz(e,t,i){let n=e.get(t);n||(n=[],e.set(t,n)),n.push(i)}var wz,Cz=function(e,t){return function(i,n){t(i,n,e)}};let yz=class extends At{static{wz=this}get version(){return this._version}static{this.maximumGlyphCount=5e3}get usedArea(){return this._usedArea}get source(){return this._canvas}get glyphs(){return this._glyphInOrderSet.values()}constructor(e,t,i,n,o){switch(super(),this._logService=n,this._version=0,this._usedArea={left:0,top:0,right:0,bottom:0},this._glyphMap=new hd,this._glyphInOrderSet=new Set,this._canvas=new OffscreenCanvas(t,t),this._colorMap=o.getColorTheme().tokenColorMap,i){case"shelf":this._allocator=new _z(this._canvas,e);break;case"slab":this._allocator=new vz(this._canvas,e);break;default:this._allocator=i(this._canvas,e)}this._register(Tt((()=>{this._canvas.width=1,this._canvas.height=1})))}getGlyph(e,t,i,n){return this._glyphMap.get(t,i,n,e.cacheKey)??this._createGlyph(e,t,i,n)}_createGlyph(e,t,i,n){if(this._glyphInOrderSet.size>=wz.maximumGlyphCount)return;const o=e.rasterizeGlyph(t,i,n,this._colorMap),s=this._allocator.allocate(o);return void 0!==s?(this._glyphMap.set(s,t,i,n,e.cacheKey),this._glyphInOrderSet.add(s),this._version++,this._usedArea.right=Math.max(this._usedArea.right,s.x+s.w-1),this._usedArea.bottom=Math.max(this._usedArea.bottom,s.y+s.h-1),this._logService.getLevel()===xu.Trace&&this._logService.trace("New glyph",{chars:t,tokenMetadata:i,decorationStyleSetId:n,rasterizedGlyph:o,glyph:s}),s):void 0}getUsagePreview(){return this._allocator.getUsagePreview()}getStats(){return this._allocator.getStats()}};yz=wz=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Cz(3,yu),Cz(4,sw)],yz);var Sz,xz=function(e,t){return function(i,n){t(i,n,e)}};let kz=class extends At{static{Sz=this}static{this.maximumPageCount=16}get pages(){return this._pages}constructor(e,t,i,n,o){super(),this._maxTextureSize=e,this._decorationStyleCache=i,this._themeService=n,this._instantiationService=o,this._warmUpTask=this._register(new Rt),this._warmedUpRasterizers=new Set,this._pages=[],this._glyphPageIndex=new hd,this._onDidDeleteGlyphs=this._register(new Zt),this.onDidDeleteGlyphs=this._onDidDeleteGlyphs.event,this._allocatorType=t?.allocatorType??"slab",this._register(zt.runAndSubscribe(this._themeService.onDidColorThemeChange,(()=>{this._colorMap&&this.clear(),this._colorMap=this._themeService.getColorTheme().tokenColorMap})));const s=Math.max(1,Math.floor(Ka().devicePixelRatio));this.pageSize=Math.min(1024*s,this._maxTextureSize),this._initFirstPage(),this._register(Tt((()=>Et(this._pages))))}_initFirstPage(){const e=this._instantiationService.createInstance(yz,0,this.pageSize,this._allocatorType);this._pages.push(e);const t=new pz(1,"",1,this._decorationStyleCache);e.getGlyph(t,"",0,0),t.dispose()}clear(){for(const e of this._pages)e.dispose();this._pages.length=0,this._glyphPageIndex.clear(),this._warmedUpRasterizers.clear(),this._warmUpTask.clear(),this._initFirstPage(),this._onDidDeleteGlyphs.fire()}getGlyph(e,t,i,n,o){return i&=-2048,i|=Math.floor(o%1*10),this._warmedUpRasterizers.has(e.id)||(this._warmUpAtlas(e),this._warmedUpRasterizers.add(e.id)),this._tryGetGlyph(this._glyphPageIndex.get(t,i,n,e.cacheKey)??0,e,t,i,n)}_tryGetGlyph(e,t,i,n,o){return this._glyphPageIndex.set(e,i,n,o,t.cacheKey),this._pages[e].getGlyph(t,i,n,o)??(e+1<this._pages.length?this._tryGetGlyph(e+1,t,i,n,o):void 0)??this._getGlyphFromNewPage(t,i,n,o)}_getGlyphFromNewPage(e,t,i,n){if(this._pages.length>=Sz.maximumPageCount)throw new Error(`Attempt to create a texture atlas page past the limit ${Sz.maximumPageCount}`);return this._pages.push(this._instantiationService.createInstance(yz,this._pages.length,this.pageSize,this._allocatorType)),this._glyphPageIndex.set(this._pages.length-1,t,i,n,e.cacheKey),this._pages[this._pages.length-1].getGlyph(e,t,i,n)}getStats(){return this._pages.map((e=>e.getStats()))}_warmUpAtlas(e){const t=this._colorMap;if(!t)throw new Ve("Cannot warm atlas without color map");this._warmUpTask.value?.clear();const i=this._warmUpTask.value=this._instantiationService.createInstance(fz);for(let n=65;n<=90;n++)for(const o of t.keys())i.enqueue((()=>{for(let t=0;t<1;t+=.1)this.getGlyph(e,String.fromCharCode(n),o<<15&16744448,0,t)}));for(let n=97;n<=122;n++)for(const o of t.keys())i.enqueue((()=>{for(let t=0;t<1;t+=.1)this.getGlyph(e,String.fromCharCode(n),o<<15&16744448,0,t)}));for(let n=33;n<=126;n++)for(const o of t.keys())i.enqueue((()=>{for(let t=0;t<1;t+=.1)this.getGlyph(e,String.fromCharCode(n),o<<15&16744448,0,t)}))}};var Lz;function Dz(e){return{object:e,dispose:()=>e.destroy()}}kz=Sz=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([xz(3,sw),xz(4,nc)],kz),function(e){e.requestDevice=async function(e){try{if(!navigator.gpu)throw new Error("This browser does not support WebGPU");const e=await navigator.gpu.requestAdapter();if(!e)throw new Error("This browser supports WebGPU but it appears to be disabled");return Dz(await e.requestDevice())}catch(t){throw e&&e(t.message),t}},e.createBuffer=function(e,t,i){const n=e.createBuffer(t);return i&&e.queue.writeBuffer(n,0,bt(i)?i():i),Dz(n)},e.createTexture=function(e,t){return Dz(e.createTexture(t))}}(Lz||(Lz={}));class Ez{get dataOffset(){return this._startIndex}get dirtySize(){if(void 0!==this._startIndex&&void 0!==this._endIndex)return this._endIndex-this._startIndex+1}get isDirty(){return void 0!==this._startIndex}flag(e,t=1){return this._flag(e),t>1&&this._flag(e+t-1),e}_flag(e){(void 0===this._startIndex||e<this._startIndex)&&(this._startIndex=e),(void 0===this._endIndex||e>this._endIndex)&&(this._endIndex=e)}clear(){this._startIndex=void 0,this._endIndex=void 0}}class Nz extends At{get entryCount(){return this._entries.size}get dirtyTracker(){return this._dirtyTracker}constructor(e,t){super(),this.propertySpecs=e,this.capacity=t,this._dirtyTracker=new Ez,this._propertySpecsMap=new Map,this._entries=new Wt,this._onDidChange=this._register(new Zt),this._onDidChangeBuffer=this._register(new Zt),this.onDidChangeBuffer=this._onDidChangeBuffer.event,this.view=new Float32Array(t*e.length),this.buffer=this.view.buffer,this._entrySize=e.length;for(let t=0;t<e.length;t++){const i={offset:t,...e[t]};this._propertySpecsMap.set(i.name,i)}this._register(Tt((()=>Et(this._entries))))}createEntry(e){this._entries.size===this.capacity&&(this._expandBuffer(),this._onDidChangeBuffer.fire());const t=new Iz(this.view,this._propertySpecsMap,this._dirtyTracker,this._entries.size,e),i=this._entries.push(t),n=[];return n.push(zt.forward(t.onDidChange,this._onDidChange)),n.push(t.onWillDispose((()=>{const e=t.i;i(),this.view.set(this.view.subarray(e*this._entrySize+2,this._entries.size*this._entrySize+2),e*this._entrySize);for(const t of this._entries)t.i>e&&t.i--;this._dirtyTracker.flag(e,(this._entries.size-e)*this._entrySize),Et(n)}))),t}_expandBuffer(){this.capacity*=2;const e=new Float32Array(this.capacity*this._entrySize);e.set(this.view),this.view=e,this.buffer=this.view.buffer}}class Iz extends At{constructor(e,t,i,n,o){super(),this._view=e,this._propertySpecsMap=t,this._dirtyTracker=i,this.i=n,this._onDidChange=this._register(new Zt),this.onDidChange=this._onDidChange.event,this._onWillDispose=this._register(new Zt),this.onWillDispose=this._onWillDispose.event;for(const e of this._propertySpecsMap.values())this._view[this.i*this._propertySpecsMap.size+e.offset]=o[e.name];this._dirtyTracker.flag(this.i*this._propertySpecsMap.size,this._propertySpecsMap.size)}dispose(){this._onWillDispose.fire(),super.dispose()}setRaw(e){if(e.length!==this._propertySpecsMap.size)throw new Error(`Data length ${e.length} does not match the number of properties in the collection (${this._propertySpecsMap.size})`);this._view.set(e,this.i*this._propertySpecsMap.size),this._dirtyTracker.flag(this.i*this._propertySpecsMap.size,this._propertySpecsMap.size)}}class Tz extends EB{constructor(e,t,i,n,o,s){super(),this._context=e,this._contentLeft=t,this._devicePixelRatio=i,this._canvas=n,this._ctx=o,this._shapeBindBuffer=this._register(new Rt),this._initialized=!1,this._shapeCollection=this._register(new Nz([{name:"x"},{name:"y"},{name:"width"},{name:"height"},{name:"red"},{name:"green"},{name:"blue"},{name:"alpha"}],32)),this._context.addEventHandler(this),this._initWebgpu(s)}async _initWebgpu(e){if(this._device=await e,this._store.isDisposed)return;const t=navigator.gpu.getPreferredCanvasFormat();let i;this._ctx.configure({device:this._device,format:t,alphaMode:"premultiplied"}),this._renderPassColorAttachment={view:null,loadOp:"load",storeOp:"store"},this._renderPassDescriptor={label:"Monaco rectangle renderer render pass",colorAttachments:[this._renderPassColorAttachment]};{const e=new Float32Array(6),t=(t=this._canvas.width,i=this._canvas.height)=>(e[0]=t,e[1]=i,e[2]=Math.ceil(this._context.configuration.options.get(165).contentLeft*Ka().devicePixelRatio),e[3]=0,e[4]=e[0]-e[2],e[5]=e[1]-e[3],e);i=this._register(Lz.createBuffer(this._device,{label:"Monaco rectangle renderer uniform buffer",size:24,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST},(()=>t()))).object,this._register(uz(this._canvas,Ka(),((e,n)=>{this._device.queue.writeBuffer(i,0,t(e,n))})))}this._scrollOffsetBindBuffer=this._register(Lz.createBuffer(this._device,{label:"Monaco rectangle renderer scroll offset buffer",size:2*Float32Array.BYTES_PER_ELEMENT,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})).object,this._scrollOffsetValueBuffer=new Float32Array(2);const n=()=>Lz.createBuffer(this._device,{label:"Monaco rectangle renderer shape buffer",size:this._shapeCollection.buffer.byteLength,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST});this._shapeBindBuffer.value=n(),this._register(zt.runAndSubscribe(this._shapeCollection.onDidChangeBuffer,(()=>{this._shapeBindBuffer.value=n(),this._pipeline&&this._updateBindGroup(this._pipeline,i)}))),this._vertexBuffer=this._register(Lz.createBuffer(this._device,{label:"Monaco rectangle renderer vertex buffer",size:hz.byteLength,usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST},hz)).object;const o=this._device.createShaderModule({label:"Monaco rectangle renderer shader module",code:"\n\nstruct Vertex {\n\t@location(0) position: vec2f,\n};\n\nstruct LayoutInfo {\n\tcanvasDims: vec2f,\n\tviewportOffset: vec2f,\n\tviewportDims: vec2f,\n}\n\nstruct ScrollOffset {\n\toffset: vec2f,\n}\n\nstruct Shape {\n\tposition: vec2f,\n\tsize: vec2f,\n\tcolor: vec4f,\n};\n\nstruct VSOutput {\n\t@builtin(position) position: vec4f,\n\t@location(1) color: vec4f,\n};\n\n// Uniforms\n@group(0) @binding(1) var<uniform> layoutInfo: LayoutInfo;\n\n// Storage buffers\n@group(0) @binding(0) var<storage, read> shapes: array<Shape>;\n@group(0) @binding(2) var<uniform> scrollOffset: ScrollOffset;\n\n@vertex fn vs(\n\tvert: Vertex,\n\t@builtin(instance_index) instanceIndex: u32,\n\t@builtin(vertex_index) vertexIndex : u32\n) -> VSOutput {\n\tlet shape = shapes[instanceIndex];\n\n\tvar vsOut: VSOutput;\n\tvsOut.position = vec4f(\n\t\t(\n\t\t\t// Top left corner\n\t\t\tvec2f(-1, 1) +\n\t\t\t// Convert pixel position to clipspace\n\t\t\tvec2f( 2, -2) / layoutInfo.canvasDims *\n\t\t\t// Shape position and size\n\t\t\t(layoutInfo.viewportOffset - scrollOffset.offset + shape.position + vert.position * shape.size)\n\t\t),\n\t\t0.0,\n\t\t1.0\n\t);\n\tvsOut.color = shape.color;\n\treturn vsOut;\n}\n\n@fragment fn fs(vsOut: VSOutput) -> @location(0) vec4f {\n\treturn vsOut.color;\n}\n"});this._pipeline=this._device.createRenderPipeline({label:"Monaco rectangle renderer render pipeline",layout:"auto",vertex:{module:o,buffers:[{arrayStride:2*Float32Array.BYTES_PER_ELEMENT,attributes:[{shaderLocation:0,offset:0,format:"float32x2"}]}]},fragment:{module:o,targets:[{format:t,blend:{color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"},alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"}}}]}}),this._updateBindGroup(this._pipeline,i),this._initialized=!0}_updateBindGroup(e,t){this._bindGroup=this._device.createBindGroup({label:"Monaco rectangle renderer bind group",layout:e.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this._shapeBindBuffer.value.object}},{binding:1,resource:{buffer:t}},{binding:2,resource:{buffer:this._scrollOffsetBindBuffer}}]})}register(e,t,i,n,o,s,r,a){return this._shapeCollection.createEntry({x:e,y:t,width:i,height:n,red:o,green:s,blue:r,alpha:a})}onScrollChanged(e){if(this._device){const e=Ka().devicePixelRatio;this._scrollOffsetValueBuffer[0]=this._context.viewLayout.getCurrentScrollLeft()*e,this._scrollOffsetValueBuffer[1]=this._context.viewLayout.getCurrentScrollTop()*e,this._device.queue.writeBuffer(this._scrollOffsetBindBuffer,0,this._scrollOffsetValueBuffer)}return!0}_update(){if(!this._device)return;const e=this._shapeCollection;e.dirtyTracker.isDirty&&(this._device.queue.writeBuffer(this._shapeBindBuffer.value.object,0,e.buffer,e.dirtyTracker.dataOffset,e.dirtyTracker.dirtySize*e.view.BYTES_PER_ELEMENT),e.dirtyTracker.clear())}draw(e){if(!this._initialized)return;this._update();const t=this._device.createCommandEncoder({label:"Monaco rectangle renderer command encoder"});this._renderPassColorAttachment.view=this._ctx.getCurrentTexture().createView();const i=t.beginRenderPass(this._renderPassDescriptor);i.setPipeline(this._pipeline),i.setVertexBuffer(0,this._vertexBuffer),i.setBindGroup(0,this._bindGroup);const n=Math.ceil(this._contentLeft.get()*this._devicePixelRatio.get());i.setScissorRect(n,0,this._canvas.width-n,this._canvas.height),i.draw(hz.length/2,this._shapeCollection.entryCount),i.end();const o=t.finish();this._device.queue.submit([o])}}var Mz=i(1469),Az={};Az.styleTagTransform=zl(),Az.setAttributes=Bl(),Az.insert=Pl().bind(null,"head"),Az.domAPI=Rl(),Az.insertStyleElement=Vl(),Ml()(Mz.A,Az),Mz.A&&Mz.A.locals&&Mz.A.locals;class Rz extends At{constructor(){super(),this._ruleCache=new Map,this._container=ll("div.monaco-decoration-css-rule-extractor"),this._dummyElement=ll("span"),this._container.appendChild(this._dummyElement),this._register(Tt((()=>this._container.remove())))}getStyleRules(e,t){const i=this._ruleCache.get(t);if(i)return i;this._dummyElement.className=t,e.appendChild(this._container);const n=this._getStyleRules(t);return this._ruleCache.set(t,n),e.removeChild(this._container),n}_getStyleRules(e){const t=[],i=[...Ua().styleSheets];for(let n=0;n<i.length;n++){const o=i[n];for(const n of o.cssRules)if(n instanceof CSSImportRule)n.styleSheet&&i.push(n.styleSheet);else if(n instanceof CSSStyleRule){const i=`.${e}`,o=n.selectorText.indexOf(i);if(-1!==o){const e=o+i.length;(n.selectorText.length===e||n.selectorText.substring(e,e+1).match(/[ :]/))&&t.push(n)}}}return t}}class Oz{constructor(){this._nextId=1,this._cacheById=new Map,this._cacheByStyle=new hd}getOrCreateEntry(e,t,i){if(void 0===e&&void 0===t&&void 0===i)return 0;const n=this._cacheByStyle.get(e??0,t?1:0,void 0===i?"":i.toFixed(2));if(n)return n.id;const o=this._nextId++,s={id:o,color:e,bold:t,opacity:i};return this._cacheById.set(o,s),this._cacheByStyle.set(s,e??0,t?1:0,void 0===i?"":i.toFixed(2)),o}getStyleSet(e){if(0!==e)return this._cacheById.get(e)}}var Pz,Fz=function(e,t){return function(i,n){t(i,n,e)}};let Bz=class extends At{static{Pz=this}static{this._decorationCssRuleExtractor=new Rz}static get decorationCssRuleExtractor(){return Pz._decorationCssRuleExtractor}static{this._decorationStyleCache=new Oz}static get decorationStyleCache(){return Pz._decorationStyleCache}static get atlas(){if(!Pz._atlas)throw new Ve("Cannot call ViewGpuContext.textureAtlas before device is resolved");return Pz._atlas}get atlas(){return Pz.atlas}constructor(e,t,i,n){super(),this._instantiationService=t,this._notificationService=i,this.configurationService=n,this.maxGpuCols=2e3,this.canvas=tT(document.createElement("canvas")),this.canvas.setClassName("editorCanvas"),this._register(zt.runAndSubscribe(n.onDidChangeConfiguration,(e=>{if(!e||e.affectsConfiguration("editor.scrollbar.verticalScrollbarSize")){const e=n.getValue("editor").scrollbar?.verticalScrollbarSize??14;this.canvas.domNode.style.boxSizing="border-box",this.canvas.domNode.style.paddingRight=`${e}px`}}))),this.ctx=cz(this.canvas.domNode.getContext("webgpu")),Pz.device||(Pz.device=Lz.requestDevice((e=>{const t=[{label:y(73,"Use DOM-based rendering"),run:()=>this.configurationService.updateValue("editor.experimentalGpuAcceleration","off")}];this._notificationService.prompt(aO.Warning,e,t)})).then((e=>(Pz.deviceSync=e.object,Pz._atlas||(Pz._atlas=this._instantiationService.createInstance(kz,e.object.limits.maxTextureDimension2D,void 0,Pz.decorationStyleCache)),e.object))));const o=Js(this,Ka().devicePixelRatio);this._register(ga(Ka(),"resize",(()=>{o.set(Ka().devicePixelRatio,void 0)}))),this.devicePixelRatio=o,this._register(Wr(this.devicePixelRatio,(()=>Pz.atlas?.clear())));const s=Js(this,{width:this.canvas.domNode.width,height:this.canvas.domNode.height});this._register(uz(this.canvas.domNode,Ka(),((e,t)=>{this.canvas.domNode.width=e,this.canvas.domNode.height=t,s.set({width:e,height:t},void 0)}))),this.canvasDevicePixelDimensions=s;const r=Js(this,0);this._register(this.configurationService.onDidChangeConfiguration((t=>{r.set(e.configuration.options.get(165).contentLeft,void 0)}))),this.contentLeft=r,this.rectangleRenderer=this._instantiationService.createInstance(Tz,e,this.contentLeft,this.devicePixelRatio,this.canvas.domNode,this.ctx,Pz.device)}canRender(e,t,i){const n=t.getViewLineRenderingData(i);if(n.containsRTL||n.maxColumn>this.maxGpuCols)return!1;if(n.inlineDecorations.length>0){let e=!0;for(const t of n.inlineDecorations){if(0!==t.type){e=!1;break}const i=Pz._decorationCssRuleExtractor.getStyleRules(this.canvas.domNode,t.inlineClassName);if(e&&=i.every((e=>{if(e.selectorText.includes(":"))return!1;for(const t of e.style)if(!Vz(t,e.style))return!1;return!0})),!e)break}return e}return!0}canRenderDetailed(e,t,i){const n=t.getViewLineRenderingData(i),o=[];if(n.containsRTL&&o.push("containsRTL"),n.maxColumn>this.maxGpuCols&&o.push("maxColumn > maxGpuCols"),n.inlineDecorations.length>0){let e=!0;const t=[],i=[],s=[];for(const o of n.inlineDecorations){if(0!==o.type){t.push(o.type),e=!1;continue}const n=Pz._decorationCssRuleExtractor.getStyleRules(this.canvas.domNode,o.inlineClassName);e&&=n.every((e=>{if(e.selectorText.includes(":"))return i.push(e.selectorText),!1;for(const t of e.style)if(!Vz(t,e.style))return s.push(`${t}: ${e.style[t]}`),!1;return!0}))}t.length>0&&o.push(`inlineDecorations with unsupported types (${t.map((e=>`\`${e}\``)).join(", ")})`),s.length>0&&o.push(`inlineDecorations with unsupported CSS rules (${s.map((e=>`\`${e}\``)).join(", ")})`),i.length>0&&o.push(`inlineDecorations with unsupported CSS selectors (${i.map((e=>`\`${e}\``)).join(", ")})`)}return o}};Bz=Pz=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Fz(1,nc),Fz(2,lO),Fz(3,up)],Bz);const Wz=["color","font-weight","opacity"];function Vz(e,t){return!!Wz.includes(e)}function Hz(e,t){return e.isBasicASCII&&t.useMonospaceOptimizations?new zz(e):new Uz(e)}class zz{constructor(e){this._content=e.content}getSegmentAtIndex(e){return this._content[e]}}class Uz{constructor(e){this._segments=[];const t=e.content,i=By(void 0,{granularity:"grapheme"}).value,n=Array.from(i.segment(t));let o=0;for(let e=0;e<t.length;e++){const t=n[o];if(!t)break;t.index===e?(o++,this._segments.push(t)):this._segments.push(void 0)}}getSegmentAtIndex(e){return this._segments[e]?.segment}}class Kz extends EB{get glyphRasterizer(){return this._glyphRasterizer.value}constructor(e,t,i,n){super(),this._context=e,this._viewGpuContext=t,this._device=i,this._glyphRasterizer=n,this._context.addEventHandler(this)}}const jz=`\nstruct GlyphInfo {\n\tposition: vec2f,\n\tsize: vec2f,\n\torigin: vec2f,\n};\n\nstruct Vertex {\n\t@location(0) position: vec2f,\n};\n\nstruct Cell {\n\tposition: vec2f,\n\tunused1: vec2f,\n\tglyphIndex: f32,\n\ttextureIndex: f32\n};\n\nstruct LayoutInfo {\n\tcanvasDims: vec2f,\n\tviewportOffset: vec2f,\n\tviewportDims: vec2f,\n}\n\nstruct ScrollOffset {\n\toffset: vec2f\n}\n\nstruct VSOutput {\n\t@builtin(position) position: vec4f,\n\t@location(1) layerIndex: f32,\n\t@location(0) texcoord: vec2f,\n};\n\n// Uniforms\n@group(0) @binding(4) var<uniform> layoutInfo: LayoutInfo;\n@group(0) @binding(5) var<uniform> atlasDims: vec2f;\n@group(0) @binding(6) var<uniform> scrollOffset: ScrollOffset;\n\n// Storage buffers\n@group(0) @binding(0) var<storage, read> glyphInfo: array<array<GlyphInfo, ${yz.maximumGlyphCount}>, ${kz.maximumPageCount}>;\n@group(0) @binding(1) var<storage, read> cells: array<Cell>;\n\n@vertex fn vs(\n\tvert: Vertex,\n\t@builtin(instance_index) instanceIndex: u32,\n\t@builtin(vertex_index) vertexIndex : u32\n) -> VSOutput {\n\tlet cell = cells[instanceIndex];\n\tvar glyph = glyphInfo[u32(cell.textureIndex)][u32(cell.glyphIndex)];\n\n\tvar vsOut: VSOutput;\n\t// Multiple vert.position by 2,-2 to get it into clipspace which ranged from -1 to 1\n\tvsOut.position = vec4f(\n\t\t// Make everything relative to top left instead of center\n\t\tvec2f(-1, 1) +\n\t\t((vert.position * vec2f(2, -2)) / layoutInfo.canvasDims) * glyph.size +\n\t\t((cell.position * vec2f(2, -2)) / layoutInfo.canvasDims) +\n\t\t((glyph.origin * vec2f(2, -2)) / layoutInfo.canvasDims) +\n\t\t(((layoutInfo.viewportOffset - scrollOffset.offset * vec2(1, -1)) * 2) / layoutInfo.canvasDims),\n\t\t0.0,\n\t\t1.0\n\t);\n\n\tvsOut.layerIndex = cell.textureIndex;\n\t// Textures are flipped from natural direction on the y-axis, so flip it back\n\tvsOut.texcoord = vert.position;\n\tvsOut.texcoord = (\n\t\t// Glyph offset (0-1)\n\t\t(glyph.position / atlasDims) +\n\t\t// Glyph coordinate (0-1)\n\t\t(vsOut.texcoord * (glyph.size / atlasDims))\n\t);\n\n\treturn vsOut;\n}\n\n@group(0) @binding(2) var ourSampler: sampler;\n@group(0) @binding(3) var ourTexture: texture_2d_array<f32>;\n\n@fragment fn fs(vsOut: VSOutput) -> @location(0) vec4f {\n\treturn textureSample(ourTexture, ourSampler, vsOut.texcoord, u32(vsOut.layerIndex));\n}\n`;class qz extends Kz{static{this.maxSupportedColumns=2e3}get bindGroupEntries(){return[{binding:1,resource:{buffer:this._cellBindBuffer}},{binding:6,resource:{buffer:this._scrollOffsetBindBuffer}}]}constructor(e,t,i,n){super(e,t,i,n),this.type="viewport",this.wgsl=jz,this._cellBindBufferLineCapacity=63,this._activeDoubleBufferIndex=0,this._visibleObjectCount=0,this._scrollInitialized=!1,this._onDidChangeBindGroupEntries=this._register(new Zt),this.onDidChangeBindGroupEntries=this._onDidChangeBindGroupEntries.event,this._rebuildCellBuffer(this._cellBindBufferLineCapacity),this._scrollOffsetBindBuffer=this._register(Lz.createBuffer(this._device,{label:"Monaco scroll offset buffer",size:2*Float32Array.BYTES_PER_ELEMENT,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})).object,this._scrollOffsetValueBuffer=new Float32Array(2)}_rebuildCellBuffer(e){this._cellBindBuffer?.destroy();const t=32*(Math.floor(e/32)+1),i=t*qz.maxSupportedColumns*6*Float32Array.BYTES_PER_ELEMENT;this._cellBindBuffer=this._register(Lz.createBuffer(this._device,{label:"Monaco full file cell buffer",size:i,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST})).object,this._cellValueBuffers=[new ArrayBuffer(i),new ArrayBuffer(i)],this._cellBindBufferLineCapacity=t,this._onDidChangeBindGroupEntries.fire()}onConfigurationChanged(e){return!0}onDecorationsChanged(e){return!0}onTokensChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onLinesChanged(e){return!0}onScrollChanged(e){const t=Ka().devicePixelRatio;return this._scrollOffsetValueBuffer[0]=(e?.scrollLeft??this._context.viewLayout.getCurrentScrollLeft())*t,this._scrollOffsetValueBuffer[1]=(e?.scrollTop??this._context.viewLayout.getCurrentScrollTop())*t,this._device.queue.writeBuffer(this._scrollOffsetBindBuffer,0,this._scrollOffsetValueBuffer),!0}onThemeChanged(e){return!0}onLineMappingChanged(e){return!0}onZonesChanged(e){return!0}reset(){for(const e of[0,1]){const t=new Float32Array(this._cellValueBuffers[e]);t.fill(0,0,t.length),this._device.queue.writeBuffer(this._cellBindBuffer,0,t.buffer,0,t.byteLength)}}update(e,t){let i,n,o,s,r,a,l,d,h="",c=0,u=0,g=0,p=0,m=0,f=0,_=0,v=0,b=0,w=0,C=0,y=0;const S=Ka().devicePixelRatio;let x;this._scrollInitialized||(this.onScrollChanged(),this._scrollInitialized=!0),this._cellBindBufferLineCapacity<e.endLineNumber-e.startLineNumber+1&&this._rebuildCellBuffer(e.endLineNumber-e.startLineNumber+1);const k=new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]);k.fill(0);const L=6*qz.maxSupportedColumns;for(u=e.startLineNumber;u<=e.endLineNumber;u++)if(this._viewGpuContext.canRender(t,e,u)){a=e.getViewLineRenderingData(u),f=0,x=Hz(a,t),c=t.spaceWidth*S,p=0,d=a.tokens,v=a.minColumn-1,b=0;for(let C=0,y=d.getCount();C<y;C++)if(b=d.getEndOffset(C),!(b<=v)){for(w=d.getMetadata(C),g=v;g<b&&!(g>qz.maxSupportedColumns);g++){if(i=x.getSegmentAtIndex(g),void 0===i)continue;for(l of(h=i,a.isBasicASCII&&t.useMonospaceOptimizations||(c=this.glyphRasterizer.getTextMetrics(h).width),s=void 0,o=void 0,r=void 0,a.inlineDecorations)){if(u<l.range.startLineNumber||u>l.range.endLineNumber||u===l.range.startLineNumber&&g<l.range.startColumn-1||u===l.range.endLineNumber&&g>=l.range.endColumn-1)continue;const e=Bz.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode,l.inlineClassName);for(const t of e)for(const e of t.style){const i=t.styleMap.get(e)?.toString()??"";switch(e){case"color":{const e=Lg.Format.CSS.parse(i);if(!e)throw new Ve("Invalid color format "+i);s=e.toNumber32Bit();break}case"font-weight":o=$z(i)>=400;break;case"opacity":r=Gz(i);break;default:throw new Ve("Unexpected inline decoration style")}}}if(" "===h||"\t"===h){if(_=6*((u-1)*qz.maxSupportedColumns+g),k.fill(0,_,_+6),"\t"===h){const e=g+f;f=Eg.nextRenderTabStop(g+f,a.tabSize),p+=c*(f-e),f-=g+1}else p+=c;continue}const d=Bz.decorationStyleCache.getOrCreateEntry(s,o,r);n=this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer,h,w,d,p),m=Math.round(e.relativeVerticalOffset[u-e.startLineNumber]*S+Math.floor((e.lineHeight*S-(n.fontBoundingBoxAscent+n.fontBoundingBoxDescent))/2)+n.fontBoundingBoxAscent),_=6*((u-e.startLineNumber)*qz.maxSupportedColumns+g),k[_+0]=Math.floor(p),k[_+1]=m,k[_+4]=n.glyphIndex,k[_+5]=n.pageIndex,p+=c}v=b}C=6*((u-e.startLineNumber)*qz.maxSupportedColumns+b),y=(u-e.startLineNumber)*qz.maxSupportedColumns*6,k.fill(0,C,y)}const D=(e.endLineNumber-e.startLineNumber+1)*L;return this._device.queue.writeBuffer(this._cellBindBuffer,0,k.buffer,0,(e.endLineNumber-e.startLineNumber)*L*Float32Array.BYTES_PER_ELEMENT),this._activeDoubleBufferIndex=this._activeDoubleBufferIndex?0:1,this._visibleObjectCount=D,D}draw(e,t){if(this._visibleObjectCount<=0)throw new Ve("Attempt to draw 0 objects");e.draw(hz.length/2,this._visibleObjectCount)}}function $z(e){switch(e){case"lighter":case"normal":return 400;case"bolder":case"bold":return 700}return parseInt(e)}function Gz(e){return e.endsWith("%")?parseFloat(e.substring(0,e.length-1))/100:e.match(/^\d+(?:\.\d*)/)?parseFloat(e):1}class Zz extends Kz{static{this.maxSupportedLines=3e3}static{this.maxSupportedColumns=200}get bindGroupEntries(){return[{binding:1,resource:{buffer:this._cellBindBuffer}},{binding:6,resource:{buffer:this._scrollOffsetBindBuffer}}]}constructor(e,t,i,n){super(e,t,i,n),this.type="fullfile",this.wgsl=jz,this._activeDoubleBufferIndex=0,this._upToDateLines=[new Set,new Set],this._visibleObjectCount=0,this._finalRenderedLine=0,this._scrollInitialized=!1,this._queuedBufferUpdates=[[],[]];const o=Zz.maxSupportedLines*Zz.maxSupportedColumns*6*Float32Array.BYTES_PER_ELEMENT;this._cellBindBuffer=this._register(Lz.createBuffer(this._device,{label:"Monaco full file cell buffer",size:o,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST})).object,this._cellValueBuffers=[new ArrayBuffer(o),new ArrayBuffer(o)],this._scrollOffsetBindBuffer=this._register(Lz.createBuffer(this._device,{label:"Monaco scroll offset buffer",size:2*Float32Array.BYTES_PER_ELEMENT,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})).object,this._scrollOffsetValueBuffer=new Float32Array(2)}onConfigurationChanged(e){return this._invalidateAllLines(),this._queueBufferUpdate(e),!0}onDecorationsChanged(e){return this._invalidateAllLines(),!0}onTokensChanged(e){for(const t of e.ranges)this._invalidateLineRange(t.fromLineNumber,t.toLineNumber);return!0}onLinesDeleted(e){return this._invalidateLinesFrom(e.fromLineNumber),this._queueBufferUpdate(e),!0}onLinesInserted(e){return this._invalidateLinesFrom(e.fromLineNumber),!0}onLinesChanged(e){return this._invalidateLineRange(e.fromLineNumber,e.fromLineNumber+e.count),!0}onScrollChanged(e){const t=Ka().devicePixelRatio;return this._scrollOffsetValueBuffer[0]=(e?.scrollLeft??this._context.viewLayout.getCurrentScrollLeft())*t,this._scrollOffsetValueBuffer[1]=(e?.scrollTop??this._context.viewLayout.getCurrentScrollTop())*t,this._device.queue.writeBuffer(this._scrollOffsetBindBuffer,0,this._scrollOffsetValueBuffer),!0}onThemeChanged(e){return this._invalidateAllLines(),!0}onLineMappingChanged(e){return this._invalidateAllLines(),this._queueBufferUpdate(e),!0}onZonesChanged(e){return this._invalidateAllLines(),this._queueBufferUpdate(e),!0}_invalidateAllLines(){this._upToDateLines[0].clear(),this._upToDateLines[1].clear()}_invalidateLinesFrom(e){for(const t of[0,1]){const i=this._upToDateLines[t];for(const t of i)t>=e&&i.delete(t)}}_invalidateLineRange(e,t){for(let i=e;i<=t;i++)this._upToDateLines[0].delete(i),this._upToDateLines[1].delete(i)}reset(){this._invalidateAllLines();for(const e of[0,1]){const t=new Float32Array(this._cellValueBuffers[e]);t.fill(0,0,t.length),this._device.queue.writeBuffer(this._cellBindBuffer,0,t.buffer,0,t.byteLength)}this._finalRenderedLine=0}update(e,t){let i,n,o,s,r,a,l,d,h="",c=0,u=0,g=0,p=0,m=0,f=0,_=0,v=0,b=0,w=0,C=0,y=0;const S=Ka().devicePixelRatio;let x;this._scrollInitialized||(this.onScrollChanged(),this._scrollInitialized=!0);const k=new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]),L=6*Zz.maxSupportedColumns,D=this._upToDateLines[this._activeDoubleBufferIndex];let E=3e3,N=0;const I=this._queuedBufferUpdates[this._activeDoubleBufferIndex];for(;I.length;){const e=I.shift();switch(e.type){case 2:case 8:case 17:k.fill(0),E=1,N=Math.max(N,this._finalRenderedLine),this._finalRenderedLine=0;break;case 10:{const t=(e.fromLineNumber-1)*Zz.maxSupportedColumns*6,i=e.toLineNumber*Zz.maxSupportedColumns*6,n=(this._finalRenderedLine-(e.toLineNumber-e.fromLineNumber+1))*Zz.maxSupportedColumns*6;k.set(k.subarray(i),t),k.fill(0,n),E=Math.min(E,e.fromLineNumber),N=Math.max(N,this._finalRenderedLine),this._finalRenderedLine-=e.toLineNumber-e.fromLineNumber+1;break}}}for(u=e.startLineNumber;u<=e.endLineNumber;u++)if(this._viewGpuContext.canRender(t,e,u)){if(!D.has(u)){E=Math.min(E,u),N=Math.max(N,u),a=e.getViewLineRenderingData(u),f=0,x=Hz(a,t),c=t.spaceWidth*S,p=0,d=a.tokens,v=a.minColumn-1,b=0;for(let C=0,y=d.getCount();C<y;C++)if(b=d.getEndOffset(C),!(b<=v)){for(w=d.getMetadata(C),g=v;g<b&&!(g>Zz.maxSupportedColumns);g++){if(i=x.getSegmentAtIndex(g),void 0===i)continue;for(l of(h=i,a.isBasicASCII&&t.useMonospaceOptimizations||(c=this.glyphRasterizer.getTextMetrics(h).width),s=void 0,o=void 0,r=void 0,a.inlineDecorations)){if(u<l.range.startLineNumber||u>l.range.endLineNumber||u===l.range.startLineNumber&&g<l.range.startColumn-1||u===l.range.endLineNumber&&g>=l.range.endColumn-1)continue;const e=Bz.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode,l.inlineClassName);for(const t of e)for(const e of t.style){const i=t.styleMap.get(e)?.toString()??"";switch(e){case"color":{const e=Lg.Format.CSS.parse(i);if(!e)throw new Ve("Invalid color format "+i);s=e.toNumber32Bit();break}case"font-weight":o=Yz(i)>=400;break;case"opacity":r=Qz(i);break;default:throw new Ve("Unexpected inline decoration style")}}}if(" "===h||"\t"===h){if(_=6*((u-1)*Zz.maxSupportedColumns+g),k.fill(0,_,_+6),"\t"===h){const e=g+f;f=Eg.nextRenderTabStop(g+f,a.tabSize),p+=c*(f-e),f-=g+1}else p+=c;continue}const d=Bz.decorationStyleCache.getOrCreateEntry(s,o,r);n=this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer,h,w,d,p),m=Math.round(e.relativeVerticalOffset[u-e.startLineNumber]*S+Math.floor((e.lineHeight*S-(n.fontBoundingBoxAscent+n.fontBoundingBoxDescent))/2)+n.fontBoundingBoxAscent),_=6*((u-1)*Zz.maxSupportedColumns+g),k[_+0]=Math.floor(p),k[_+1]=m,k[_+4]=n.glyphIndex,k[_+5]=n.pageIndex,p+=c}v=b}C=6*((u-1)*Zz.maxSupportedColumns+b),y=u*Zz.maxSupportedColumns*6,k.fill(0,C,y),D.add(u)}}else C=(u-1)*Zz.maxSupportedColumns*6,y=u*Zz.maxSupportedColumns*6,k.fill(0,C,y),E=Math.min(E,u),N=Math.max(N,u);const T=(e.endLineNumber-e.startLineNumber+1)*L;return E=Math.min(E,Zz.maxSupportedLines),N=Math.min(N,Zz.maxSupportedLines),E<=N&&this._device.queue.writeBuffer(this._cellBindBuffer,(E-1)*L*Float32Array.BYTES_PER_ELEMENT,k.buffer,(E-1)*L*Float32Array.BYTES_PER_ELEMENT,(N-E+1)*L*Float32Array.BYTES_PER_ELEMENT),this._finalRenderedLine=Math.max(this._finalRenderedLine,N),this._activeDoubleBufferIndex=this._activeDoubleBufferIndex?0:1,this._visibleObjectCount=T,T}draw(e,t){if(this._visibleObjectCount<=0)throw new Ve("Attempt to draw 0 objects");e.draw(hz.length/2,this._visibleObjectCount,void 0,(t.startLineNumber-1)*Zz.maxSupportedColumns)}_queueBufferUpdate(e){this._queuedBufferUpdates[0].push(e),this._queuedBufferUpdates[1].push(e)}}function Yz(e){switch(e){case"lighter":case"normal":return 400;case"bolder":case"bold":return 700}return parseInt(e)}function Qz(e){return e.endsWith("%")?parseFloat(e.substring(0,e.length-1))/100:e.match(/^\d+(?:\.\d*)/)?parseFloat(e):1}var Xz=function(e,t){return function(i,n){t(i,n,e)}};let Jz=class extends NB{constructor(e,t,i,n){super(e),this._viewGpuContext=t,this._instantiationService=i,this._logService=n,this._atlasGpuTextureVersions=[],this._initialized=!1,this._glyphRasterizer=this._register(new Rt),this._renderStrategy=this._register(new Rt),this.canvas=this._viewGpuContext.canvas.domNode,this._register(ar((e=>{this._viewGpuContext.canvasDevicePixelDimensions.read(e);const t=this._lastViewportData;t&&setTimeout((()=>{t===this._lastViewportData&&this.renderText(t)}))}))),this.initWebgpu()}async initWebgpu(){if(this._device=Bz.deviceSync||await Bz.device,this._store.isDisposed)return;const e=Bz.atlas;this._register(e.onDidDeleteGlyphs((()=>{this._atlasGpuTextureVersions.length=0,this._atlasGpuTextureVersions[0]=0,this._atlasGpuTextureVersions[1]=0,this._renderStrategy.value.reset()})));const t=navigator.gpu.getPreferredCanvasFormat();let i,n;this._viewGpuContext.ctx.configure({device:this._device,format:t,alphaMode:"premultiplied"}),this._renderPassColorAttachment={view:null,loadOp:"load",storeOp:"store"},this._renderPassDescriptor={label:"Monaco render pass",colorAttachments:[this._renderPassColorAttachment]};{const e=new Float32Array(6),t=(t=this.canvas.width,i=this.canvas.height)=>(e[0]=t,e[1]=i,e[2]=Math.ceil(this._context.configuration.options.get(165).contentLeft*Ka().devicePixelRatio),e[3]=0,e[4]=e[0]-e[2],e[5]=e[1]-e[3],e);i=this._register(Lz.createBuffer(this._device,{label:"Monaco uniform buffer",size:24,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST},(()=>t()))).object,this._register(Wr(this._viewGpuContext.canvasDevicePixelDimensions,(({width:e,height:n})=>{this._device.queue.writeBuffer(i,0,t(e,n))}))),this._register(Wr(this._viewGpuContext.contentLeft,(()=>{this._device.queue.writeBuffer(i,0,t())})))}n=this._register(Lz.createBuffer(this._device,{label:"Monaco atlas info uniform buffer",size:8,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST},(()=>{const t=new Float32Array(2);return t[0]=e.pageSize,t[1]=e.pageSize,t}))).object;const o=this._context.configuration.options.get(58),s=this._context.configuration.options.get(61);this._glyphRasterizer.value=this._register(new pz(s,o,this._viewGpuContext.devicePixelRatio.get(),Bz.decorationStyleCache)),this._register(Wr(this._viewGpuContext.devicePixelRatio,(()=>{this._refreshGlyphRasterizer()}))),this._renderStrategy.value=this._instantiationService.createInstance(Zz,this._context,this._viewGpuContext,this._device,this._glyphRasterizer),this._glyphStorageBuffer=this._register(Lz.createBuffer(this._device,{label:"Monaco glyph storage buffer",size:kz.maximumPageCount*(24*yz.maximumGlyphCount),usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST})).object,this._atlasGpuTextureVersions[0]=0,this._atlasGpuTextureVersions[1]=0,this._atlasGpuTexture=this._register(Lz.createTexture(this._device,{label:"Monaco atlas texture",format:"rgba8unorm",size:{width:e.pageSize,height:e.pageSize,depthOrArrayLayers:kz.maximumPageCount},dimension:"2d",usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT})).object,this._updateAtlasStorageBufferAndTexture(),this._vertexBuffer=this._register(Lz.createBuffer(this._device,{label:"Monaco vertex buffer",size:hz.byteLength,usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST},hz)).object;const r=this._device.createShaderModule({label:"Monaco shader module",code:this._renderStrategy.value.wgsl});if(this._pipeline=this._device.createRenderPipeline({label:"Monaco render pipeline",layout:"auto",vertex:{module:r,buffers:[{arrayStride:2*Float32Array.BYTES_PER_ELEMENT,attributes:[{shaderLocation:0,offset:0,format:"float32x2"}]}]},fragment:{module:r,targets:[{format:t,blend:{color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"},alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"}}}]}}),this._rebuildBindGroup=()=>{this._bindGroup=this._device.createBindGroup({label:"Monaco bind group",layout:this._pipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this._glyphStorageBuffer}},{binding:2,resource:this._device.createSampler({label:"Monaco atlas sampler",magFilter:"nearest",minFilter:"nearest"})},{binding:3,resource:this._atlasGpuTexture.createView()},{binding:4,resource:{buffer:i}},{binding:5,resource:{buffer:n}},...this._renderStrategy.value.bindGroupEntries]})},this._rebuildBindGroup(),this._initialized=!0,this._initViewportData){for(const e of this._initViewportData)this.renderText(e);this._initViewportData=void 0}}_refreshRenderStrategy(e){if("viewport"===this._renderStrategy.value?.type)return;if(e.endLineNumber<Zz.maxSupportedLines&&this._viewportMaxColumn(e)<Zz.maxSupportedColumns)return;this._logService.trace(`File is larger than ${Zz.maxSupportedLines} lines or ${Zz.maxSupportedColumns} columns, switching to viewport render strategy`);const t=this._instantiationService.createInstance(qz,this._context,this._viewGpuContext,this._device,this._glyphRasterizer);this._renderStrategy.value=t,this._register(t.onDidChangeBindGroupEntries((()=>this._rebuildBindGroup?.()))),this._rebuildBindGroup?.()}_viewportMaxColumn(e){let t,i=0;for(let n=e.startLineNumber;n<=e.endLineNumber;n++)t=e.getViewLineRenderingData(n),i=Math.max(i,t.maxColumn);return i}_updateAtlasStorageBufferAndTexture(){for(const[e,t]of Bz.atlas.pages.entries()){if(e>=kz.maximumPageCount){console.log(`Attempt to upload atlas page [${e}], only ${kz.maximumPageCount} are supported currently`);continue}if(t.version===this._atlasGpuTextureVersions[e])continue;this._logService.trace("Updating atlas page[",e,"] from version ",this._atlasGpuTextureVersions[e]," to version ",t.version);const i=6*yz.maximumGlyphCount,n=new Float32Array(i);let o=0;for(const e of t.glyphs)n[o+0]=e.x,n[o+0+1]=e.y,n[o+2]=e.w,n[o+2+1]=e.h,n[o+4]=e.originOffsetX,n[o+4+1]=e.originOffsetY,o+=6;if(o/6>yz.maximumGlyphCount)throw new Error(`Attempting to write more glyphs (${o/6}) than the GPUBuffer can hold (${yz.maximumGlyphCount})`);this._device.queue.writeBuffer(this._glyphStorageBuffer,6*e*yz.maximumGlyphCount*Float32Array.BYTES_PER_ELEMENT,n,0,6*yz.maximumGlyphCount),t.usedArea.right-t.usedArea.left>0&&t.usedArea.bottom-t.usedArea.top>0&&this._device.queue.copyExternalImageToTexture({source:t.source},{texture:this._atlasGpuTexture,origin:{x:t.usedArea.left,y:t.usedArea.top,z:e}},{width:t.usedArea.right-t.usedArea.left+1,height:t.usedArea.bottom-t.usedArea.top+1}),this._atlasGpuTextureVersions[e]=t.version}}prepareRender(e){throw new Ve("Should not be called")}render(e){throw new Ve("Should not be called")}onConfigurationChanged(e){return this._refreshGlyphRasterizer(),!0}onCursorStateChanged(e){return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onLineMappingChanged(e){return!0}onRevealRangeRequest(e){return!0}onScrollChanged(e){return!0}onThemeChanged(e){return!0}onZonesChanged(e){return!0}_refreshGlyphRasterizer(){const e=this._glyphRasterizer.value;if(!e)return;const t=this._context.configuration.options.get(58),i=this._context.configuration.options.get(61),n=this._viewGpuContext.devicePixelRatio.get();e.fontFamily===t&&e.fontSize===i&&e.devicePixelRatio===n||(this._glyphRasterizer.value=new pz(i,t,n,Bz.decorationStyleCache))}renderText(e){if(this._initialized)return this._refreshRenderStrategy(e),this._renderText(e);this._initViewportData=this._initViewportData??[],this._initViewportData.push(e)}_renderText(e){this._viewGpuContext.rectangleRenderer.draw(e);const t=new PV(this._context.configuration,this._context.theme.type);this._renderStrategy.value.update(e,t),this._updateAtlasStorageBufferAndTexture();const i=this._device.createCommandEncoder({label:"Monaco command encoder"});this._renderPassColorAttachment.view=this._viewGpuContext.ctx.getCurrentTexture().createView({label:"Monaco canvas texture view"});const n=i.beginRenderPass(this._renderPassDescriptor);n.setPipeline(this._pipeline),n.setVertexBuffer(0,this._vertexBuffer);const o=Math.ceil(this._viewGpuContext.contentLeft.get()*this._viewGpuContext.devicePixelRatio.get());n.setScissorRect(o,0,this.canvas.width-o,this.canvas.height),n.setBindGroup(0,this._bindGroup),this._renderStrategy.value.draw(n,e),n.end();const s=i.finish();this._device.queue.submit([s]),this._lastViewportData=e,this._lastViewLineOptions=t}linesVisibleRangesForRange(e,t){if(!this._lastViewportData)return null;const i=e.endLineNumber,n=Yu.intersectRanges(e,this._lastViewportData.visibleRange);if(!n)return null;const o=this._lastViewportData.startLineNumber,s=this._lastViewportData.endLineNumber,r=this._lastViewportData,a=this._lastViewLineOptions;if(!r||!a)return null;const l=[];let d=0;t&&(d=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new rc(n.startLineNumber,1)).lineNumber);for(let e=n.startLineNumber;e<=n.endLineNumber;e++){if(e<o||e>s)continue;const r=e===n.startLineNumber?n.startColumn:1,h=e!==i,c=h?this._context.viewModel.getLineMaxColumn(e):n.endColumn,u=this._visibleRangesForLineRange(e,r,c);if(u){if(t&&e<i){const t=d;d=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new rc(e+1,1)).lineNumber,t!==d&&(u.ranges[u.ranges.length-1].width+=a.spaceWidth)}l.push(new AB(u.outsideRenderedLine,e,RB.from(u.ranges),h))}}return 0===l.length?null:l}_visibleRangesForLineRange(e,t,i){if(this.shouldRender())return null;const n=this._lastViewportData,o=this._lastViewLineOptions;if(!n||!o||e<n.startLineNumber||e>n.endLineNumber)return null;const s=n.getViewLineRenderingData(e),r=s.content;let a;s.isBasicASCII&&o.useMonospaceOptimizations||(a=Hz(s,o));let l="",d=0,h=0;for(let e=0;e<t-1;e++){if(s.isBasicASCII&&o.useMonospaceOptimizations)l=r.charAt(e);else{if(l=a.getSegmentAtIndex(e),void 0===l)continue;h+=this._renderStrategy.value.glyphRasterizer.getTextMetrics(l).width/Ka().devicePixelRatio-o.spaceWidth}"\t"===l?d=Eg.nextRenderTabStop(d,s.tabSize):d++}let c=d,u=0;for(let e=t-1;e<i-1;e++){if(s.isBasicASCII&&o.useMonospaceOptimizations)l=r.charAt(e);else{if(l=a.getSegmentAtIndex(e),void 0===l)continue;u+=this._renderStrategy.value.glyphRasterizer.getTextMetrics(l).width/Ka().devicePixelRatio-o.spaceWidth}"\t"===l?c=Eg.nextRenderTabStop(c,s.tabSize):c++}return new FB(!1,[new OB(d*o.spaceWidth+h,(c-d)*o.spaceWidth+u)])}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new PB(t.outsideRenderedLine,t.ranges[0].left):null}getLineWidth(e){if(!this._lastViewportData||!this._lastViewLineOptions)return;if(!this._viewGpuContext.canRender(this._lastViewLineOptions,this._lastViewportData,e))return;const t=this._lastViewportData.getViewLineRenderingData(e),i=this._visibleRangesForLineRange(e,1,t.maxColumn),n=i?.ranges.at(-1);return n?n.width:void 0}getPositionAtCoordinate(e,t){if(!this._lastViewportData||!this._lastViewLineOptions)return;if(!this._viewGpuContext.canRender(this._lastViewLineOptions,this._lastViewportData,e))return;const i=this._lastViewportData.getViewLineRenderingData(e),n=i.content,o=Ka().devicePixelRatio,s=t*o,r=this._lastViewLineOptions.spaceWidth*o,a=Hz(i,this._lastViewLineOptions);let l=0,d=0,h=0,c=0;for(let e=0;e<n.length;e++){const t=a.getSegmentAtIndex(e);if(void 0!==t){if("\t"===t){const t=e+h;h=Eg.nextRenderTabStop(e+h,i.tabSize),d=r*(h-t),h-=e+1}else d=i.isBasicASCII&&this._lastViewLineOptions.useMonospaceOptimizations?r:this._renderStrategy.value.glyphRasterizer.getTextMetrics(t).width;if(s<l+d/2)break;l+=d,c++}else c++}return new rc(e,c+1)}};Jz=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Xz(2,nc),Xz(3,yu)],Jz);var eU=i(8169),tU={};tU.styleTagTransform=zl(),tU.setAttributes=Bl(),tU.insert=Pl().bind(null,"head"),tU.domAPI=Rl(),tU.insertStyleElement=Vl(),Ml()(eU.A,tU),eU.A&&eU.A.locals&&eU.A.locals;const iU=new class{constructor(){this._onDidChange=new Zt,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}};class nU extends NB{}class oU{_getPageOfLine(e,t){return Math.floor((e-1)/t)}_getRangeForPage(e,t){const i=e*t;return new Yu(i+1,1,i+t+1,1)}fromEditorSelection(e,t,i,n){const o=500,s=this._getPageOfLine(t.startLineNumber,i),r=this._getRangeForPage(s,i),a=this._getPageOfLine(t.endLineNumber,i),l=this._getRangeForPage(a,i);let d=r.intersectRanges(new Yu(1,1,t.startLineNumber,t.startColumn));if(n&&e.getValueLengthInRange(d,1)>o){const t=e.modifyPosition(d.getEndPosition(),-500);d=Yu.fromPositions(t,d.getEndPosition())}const h=e.getValueInRange(d,1),c=e.getLineCount(),u=e.getLineMaxColumn(c);let g=l.intersectRanges(new Yu(t.endLineNumber,t.endColumn,c,u));if(n&&e.getValueLengthInRange(g,1)>o){const t=e.modifyPosition(g.getStartPosition(),o);g=Yu.fromPositions(g.getStartPosition(),t)}const p=e.getValueInRange(g,1);let m,f,_;if(s===a||s+1===a)m=e.getValueInRange(t,1);else{const i=r.intersectRanges(t),n=l.intersectRanges(t);m=e.getValueInRange(i,1)+String.fromCharCode(8230)+e.getValueInRange(n,1)}return n&&m.length>1e3&&(m=m.substring(0,o)+String.fromCharCode(8230)+m.substring(m.length-o,m.length)),0===t.getDirection()?(f=h.length,_=h.length+m.length):(_=h.length,f=h.length+m.length),{value:h+m+p,selection:t,selectionStart:f,selectionEnd:_,startPositionWithinEditor:d.getStartPosition(),newlineCountBeforeSelection:d.endLineNumber-d.startLineNumber}}}function sU(e,t){if(1===e.get(2)){const e=t.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode")?.getAriaLabel(),i=t.lookupKeybinding("workbench.action.showCommands")?.getAriaLabel(),n=t.lookupKeybinding("workbench.action.openGlobalKeybindings")?.getAriaLabel(),o=y(56,"The editor is not accessible at this time.");return e?y(57,"{0} To enable screen reader optimized mode, use {1}",o,e):i?y(58,"{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",o,i):n?y(59,"{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",o,n):o}return e.get(8)}function rU(e){let t=0,i=-1;for(;i=e.indexOf("\n",i+1),-1!==i;)t++;return t}var aU=function(e,t){return function(i,n){t(i,n,e)}};class lU{constructor(e,t,i,n,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=n,this.distanceToModelLineEnd=o,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new rc(this.modelLineNumber,this.distanceToModelLineStart+1),i=new rc(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(this._previousPresentation=e||{foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const dU=c;let hU=class extends nU{constructor(e,t,i,n,o,s){super(e),this._keybindingService=o,this._instantiationService=s,this._primaryCursorPosition=new rc(1,1),this._primaryCursorVisibleRange=null,this._viewController=i,this._visibleRangeProvider=n,this._scrollLeft=0,this._scrollTop=0;const r=this._context.configuration.options,a=r.get(165);this._setAccessibilityOptions(r),this._contentLeft=a.contentLeft,this._contentWidth=a.contentWidth,this._contentHeight=a.height,this._fontInfo=r.get(59),this._emptySelectionClipboard=r.get(45),this._copyWithSyntaxHighlighting=r.get(31),this._visibleTextArea=null,this._selections=[new Qu(1,1,1,1)],this._modelSelections=[new Qu(1,1,1,1)],this._lastRenderPosition=null,this.textArea=tT(document.createElement("textarea")),IB.write(this.textArea,7),this.textArea.setClassName(`inputarea ${MV}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:l}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=l*this._fontInfo.spaceWidth+"px",this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",sU(r,this._keybindingService)),this.textArea.setAttribute("aria-required",r.get(9)?"true":"false"),this.textArea.setAttribute("tabindex",String(r.get(140))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",y(60,"editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",r.get(104)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=tT(document.createElement("div")),this.textAreaCover.setPosition("absolute"),t.appendChild(this.textArea),t.appendChild(this.textAreaCover);const d=new oU,h={getDataToCopy:()=>rD(this._context.viewModel,this._modelSelections,this._emptySelectionClipboard,this._copyWithSyntaxHighlighting),getScreenReaderContent:()=>{if(1===this._accessibilitySupport){const e=this._selections[0];if($&&e.isEmpty()){const t=e.getStartPosition();let i=this._getWordBeforePosition(t);if(0===i.length&&(i=this._getCharacterBeforePosition(t)),i.length>0)return new IW(i,i.length,i.length,Yu.fromPositions(t),0)}const t=500;if($&&!e.isEmpty()&&this._context.viewModel.getValueLengthInRange(e,0)<t){const t=this._context.viewModel.getValueInRange(e,0);return new IW(t,0,t.length,e,0)}if(p&&!e.isEmpty()){const e="vscode-placeholder";return new IW(e,0,e.length,null,void 0)}return IW.EMPTY}if(f){const e=this._selections[0];if(e.isEmpty()){const t=e.getStartPosition(),[i,n]=this._getAndroidWordAtPosition(t);if(i.length>0)return new IW(i,n,n,Yu.fromPositions(t),0)}return IW.EMPTY}const e=d.fromEditorSelection(this._context.viewModel,this._selections[0],this._accessibilityPageSize,0===this._accessibilitySupport);return IW.fromScreenReaderContentState(e)},deduceModelPosition:(e,t,i)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(e,t,i)},u=this._register(new OW(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(RW,h,u,se,{isAndroid:f,isChrome:g,isFirefox:c,isSafari:p})),this._register(this._textAreaInput.onKeyDown((e=>{this._viewController.emitKeyDown(e)}))),this._register(this._textAreaInput.onKeyUp((e=>{this._viewController.emitKeyUp(e)}))),this._register(this._textAreaInput.onPaste((e=>{let t=!1,i=null,n=null;e.metadata&&(t=this._emptySelectionClipboard&&!!e.metadata.isFromEmptySelection,i=void 0!==e.metadata.multicursorText?e.metadata.multicursorText:null,n=e.metadata.mode),this._viewController.paste(e.text,t,i,n)}))),this._register(this._textAreaInput.onCut((()=>{this._viewController.cut()}))),this._register(this._textAreaInput.onType((e=>{e.replacePrevCharCnt||e.replaceNextCharCnt||e.positionDelta?this._viewController.compositionType(e.text,e.replacePrevCharCnt,e.replaceNextCharCnt,e.positionDelta):this._viewController.type(e.text)}))),this._register(this._textAreaInput.onSelectionChangeRequest((e=>{this._viewController.setSelection(e)}))),this._register(this._textAreaInput.onCompositionStart((e=>{const t=this.textArea.domNode,i=this._modelSelections[0],{distanceToModelLineStart:n,widthOfHiddenTextBefore:o}=(()=>{const e=t.value.substring(0,Math.min(t.selectionStart,t.selectionEnd)),n=e.lastIndexOf("\n"),o=e.substring(n+1),s=o.lastIndexOf("\t"),r=o.length-s-1,a=i.getStartPosition(),l=Math.min(a.column-1,r),d=a.column-1-l,h=o.substring(0,o.length-l),{tabSize:c}=this._context.viewModel.model.getOptions(),u=function(e,t,i,n){if(0===t.length)return 0;const o=e.createElement("div");o.style.position="absolute",o.style.top="-50000px",o.style.width="50000px";const s=e.createElement("span");iT(s,i),s.style.whiteSpace="pre",s.style.tabSize=n*i.spaceWidth+"px",s.append(t),o.appendChild(s),e.body.appendChild(o);const r=s.offsetWidth;return o.remove(),r}(this.textArea.domNode.ownerDocument,h,this._fontInfo,c);return{distanceToModelLineStart:d,widthOfHiddenTextBefore:u}})(),{distanceToModelLineEnd:s}=(()=>{const e=t.value.substring(Math.max(t.selectionStart,t.selectionEnd)),n=e.indexOf("\n"),o=-1===n?e:e.substring(0,n),s=o.indexOf("\t"),r=-1===s?o.length:o.length-s-1,a=i.getEndPosition(),l=Math.min(this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column,r);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column-l}})();this._context.viewModel.revealRange("keyboard",!0,Yu.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new lU(this._context,i.startLineNumber,n,o,s),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${MV} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()}))),this._register(this._textAreaInput.onCompositionUpdate((e=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())}))),this._register(this._textAreaInput.onCompositionEnd((()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${MV}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()}))),this._register(this._textAreaInput.onFocus((()=>{this._context.viewModel.setHasFocus(!0)}))),this._register(this._textAreaInput.onBlur((()=>{this._context.viewModel.setHasFocus(!1)}))),this._register(iU.onDidChange((()=>{this._ensureReadOnlyAttribute()})))}get domNode(){return this.textArea}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose(),this.textArea.domNode.remove(),this.textAreaCover.domNode.remove()}_getAndroidWordAtPosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=qy('`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',[]);let n=!0,o=e.column,s=!0,r=e.column,a=0;for(;a<50&&(n||s);){if(n&&o<=1&&(n=!1),n){const e=t.charCodeAt(o-2);0!==i.get(e)?n=!1:o--}if(s&&r>t.length&&(s=!1),s){const e=t.charCodeAt(r-1);0!==i.get(e)?s=!1:r++}a++}return[t.substring(o-1,r-1),e.column-o]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=qy(this._context.configuration.options.get(148),[]);let n=e.column,o=0;for(;n>1;){const s=t.charCodeAt(n-2);if(0!==i.get(s)||o>50)return t.substring(n-1,e.column-1);o++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const t=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!ln(t.charCodeAt(0)))return t}return""}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);2===this._accessibilitySupport&&t===bP.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const i=e.get(165).wrappingColumn;if(-1!==i&&1!==this._accessibilitySupport){const t=e.get(59);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(i*t.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=dU?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(165);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(59),this._emptySelectionClipboard=t.get(45),this._copyWithSyntaxHighlighting=t.get(31),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:n}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=n*this._fontInfo.spaceWidth+"px",this.textArea.setAttribute("aria-label",sU(t,this._keybindingService)),this.textArea.setAttribute("aria-required",t.get(9)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(140))),(e.hasChanged(41)||e.hasChanged(104))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeNativeTextAreaContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeNativeTextAreaContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focus(){this._textAreaInput.focusTextArea()}refreshFocusState(){this._textAreaInput.refreshFocusState()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}_ensureReadOnlyAttribute(){const e=this._context.configuration.options;!iU.enabled||e.get(41)&&e.get(104)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){this._primaryCursorPosition=new rc(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),this._visibleTextArea?.prepareRender(e)}render(e){this._textAreaInput.writeNativeTextAreaContent("render"),this._render()}_render(){if(this._visibleTextArea){const e=this._visibleTextArea.visibleTextareaStart,t=this._visibleTextArea.visibleTextareaEnd,i=this._visibleTextArea.startPosition,n=this._visibleTextArea.endPosition;if(i&&n&&e&&t&&t.left>=this._scrollLeft&&e.left<=this._scrollLeft+this._contentWidth){const o=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,s=rU(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let r=this._visibleTextArea.widthOfHiddenLineTextBefore,a=this._contentLeft+e.left-this._scrollLeft,l=t.left-e.left+1;if(a<this._contentLeft){const e=this._contentLeft-a;a+=e,r+=e,l-=e}l>this._contentWidth&&(l=this._contentWidth);const d=this._context.viewLayout.getLineHeightForLineNumber(i.lineNumber),h=this._context.viewModel.getFontSizeAtPosition(this._primaryCursorPosition),c=this._context.viewModel.getViewLineData(i.lineNumber),u=c.tokens.findTokenIndexAtOffset(i.column-1),g=u===c.tokens.findTokenIndexAtOffset(n.column-1),p=this._visibleTextArea.definePresentation(g?c.tokens.getPresentation(u):null);this.textArea.domNode.scrollTop=s*d,this.textArea.domNode.scrollLeft=r,this._doRender({lastRenderPosition:null,top:o,left:a,width:l,height:d,useCover:!1,color:(JS.getColorMap()||[])[p.foreground],italic:p.italic,bold:p.bold,underline:p.underline,strikethrough:p.strikethrough,fontSize:h})}return}if(!this._primaryCursorVisibleRange)return void this._renderAtTopLeft();const e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(e<this._contentLeft||e>this._contentLeft+this._contentWidth)return void this._renderAtTopLeft();const t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(t<0||t>this._contentHeight)this._renderAtTopLeft();else if($||2===this._accessibilitySupport){const i=this._primaryCursorPosition.lineNumber,n=this._context.viewLayout.getLineHeightForLineNumber(i);this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:n,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const o=this._textAreaInput.textAreaState.newlineCountBeforeSelection??rU(this.textArea.domNode.value.substring(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=o*n}else this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:dU?0:1,useCover:!1})}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:dU?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;iT(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setLineHeight(e.height),t.setFontSize(e.fontSize??this._fontInfo.fontSize),t.setColor(e.color?Lg.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const n=this._context.configuration.options;n.get(66)?i.setClassName("monaco-editor-background textAreaCover "+qV.OUTER_CLASS_NAME):0!==n.get(76).renderType?i.setClassName("monaco-editor-background textAreaCover "+NV.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};hU=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([aU(4,ER),aU(5,nc)],hU);var cU=i(2699),uU={};uU.styleTagTransform=zl(),uU.setAttributes=Bl(),uU.insert=Pl().bind(null,"head"),uU.domAPI=Rl(),uU.insertStyleElement=Vl(),Ml()(cU.A,uU),cU.A&&cU.A.locals&&cU.A.locals;let gU=class extends At{constructor(e,t,i){super(),this._domNode=t,this._onFocusChange=i,this._isFocused=!1,this._isPaused=!1,this._register(ga(this._domNode,"focus",(()=>{e.trace("NativeEditContext.focus"),this._isPaused||this.refreshFocusState()}))),this._register(ga(this._domNode,"blur",(()=>{e.trace("NativeEditContext.blur"),this._isPaused||this._handleFocusedChanged(!1)})))}pause(){this._isPaused=!0}resume(){this._isPaused=!1,this.refreshFocusState()}_handleFocusedChanged(e){this._isFocused!==e&&(this._isFocused=e,this._onFocusChange(this._isFocused))}focus(){this._domNode.focus(),this.refreshFocusState()}refreshFocusState(){const e=Wa(this._domNode),t=e?e.activeElement:Va(),i=this._domNode===t;this._handleFocusedChanged(i)}get isFocused(){return this._isFocused}};function pU(e,t,i,n){return e.addEventListener(t,i,n),{dispose(){e.removeEventListener(t,i)}}}gU=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,yu)],gU);const mU=GI("richScreenReaderContent",{createHTML:e=>e}),fU="data-line-number";let _U=class extends At{constructor(e,t,i,n){super(),this._domNode=e,this._context=t,this._viewController=i,this._accessibilityService=n,this._selectionChangeListener=this._register(new Rt),this._accessibilityPageSize=1,this._ignoreSelectionChangeTime=0,this._state=wU.NULL,this._strategy=new CU,this._renderedLines=new Map,this._renderedSelection=new Qu(1,1,1,1),this.onConfigurationChanged(this._context.configuration.options)}updateScreenReaderContent(e){const t=Ka().document.activeElement;if(t&&t===this._domNode.domNode)if(this._accessibilityService.isScreenReaderOptimized()){const t=this._getScreenReaderContentLineIntervals(e);this._state.equals(t)||(this._state=t,this._renderedLines=this._renderScreenReaderContent(t)),this._renderedSelection.equalsSelection(e)||(this._renderedSelection=e,this._setSelectionOnScreenReaderContent(this._context,this._renderedLines,e))}else this._state=wU.NULL,this._setIgnoreSelectionChangeTime("setValue"),this._domNode.domNode.textContent=""}updateScrollTop(e){const t=this._state.intervals;if(!t.length)return;const i=this._context.viewModel.viewLayout,n=t[0].startLine,o=i.getVerticalOffsetForLineNumber(n),s=i.getVerticalOffsetForLineNumber(e.positionLineNumber);this._domNode.domNode.scrollTop=s-o}onFocusChange(e){this._selectionChangeListener.value=e?this._setSelectionChangeListener():void 0}onConfigurationChanged(e){this._accessibilityPageSize=e.get(3)}onWillCut(){this._setIgnoreSelectionChangeTime("onCut")}onWillPaste(){this._setIgnoreSelectionChangeTime("onWillPaste")}_setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}_setSelectionChangeListener(){let e=0;return ga(this._domNode.domNode.ownerDocument,"selectionchange",(()=>{if(Ka().document.activeElement!==this._domNode.domNode)return;if(!this._accessibilityService.isScreenReaderOptimized()||!iU.enabled)return;const t=Date.now(),i=t-e;if(e=t,i<5)return;const n=t-this._ignoreSelectionChangeTime;if(this._ignoreSelectionChangeTime=0,n<100)return;const o=this._getEditorSelectionFromDomRange();o&&this._viewController.setSelection(o)}))}_renderScreenReaderContent(e){const t=[],i=new Map;for(const n of e.intervals)for(let e=n.startLine;e<=n.endLine;e++){const n=this._renderLine(e);i.set(e,n),t.push(n.domNode)}return this._setIgnoreSelectionChangeTime("setValue"),this._domNode.domNode.replaceChildren(...t),i}_renderLine(e){const t=this._context.viewModel,i=t.getViewLineRenderingData(e),n=this._context.configuration.options,o=n.get(59),s=n.get(133),r=n.get(108),a=n.get(60),l=n.get(40),d=WB.filter(i.inlineDecorations,e,i.minColumn,i.maxColumn),h=o.isMonospace&&!l,c=a!==eP.OFF;let u;u="off"===n.get(47)?n.get(113):"none";const g=new KB(h,o.canUseHalfwidthRightwardsArrow,i.content,i.continuesWithWrappedLine,i.isBasicASCII,i.containsRTL,i.minColumn-1,i.tokens,d,i.tabSize,i.startVisibleColumn,o.spaceWidth,o.middotWidth,o.wsmiddotWidth,s,u,r,c,null,null,0,!0),p=new Xg(1e4),m=GB(g,p),f=p.build(),_=mU?.createHTML(f)??f,v=t.viewLayout.getLineHeightForLineNumber(e)+"px",b=document.createElement("div");return b.innerHTML=_,b.style.lineHeight=v,b.style.height=v,b.setAttribute(fU,e.toString()),new vU(b,m.characterMapping)}_setSelectionOnScreenReaderContent(e,t,i){const n=Ka().document.getSelection();if(!n)return;const o=i.startLineNumber,s=i.endLineNumber,r=t.get(o),a=t.get(s);if(!r||!a)return;const l=e.viewModel,d=l.model,h=l.coordinatesConverter,c=new Yu(o,1,o,i.selectionStartColumn),u=h.convertViewRangeToModelRange(c),g=d.getCharacterCountInRange(u),p=new Yu(s,1,s,i.positionColumn),m=h.convertViewRangeToModelRange(p),f=d.getCharacterCountInRange(m),_=r.characterMapping.getDomPosition(g),v=a.characterMapping.getDomPosition(f),b=r.domNode.firstChild,w=a.domNode.firstChild,C=b.childNodes,y=w.childNodes,S=C.item(_.partIndex),x=y.item(v.partIndex);S.firstChild&&x.firstChild&&(this._setIgnoreSelectionChangeTime("setRange"),n.setBaseAndExtent(S.firstChild,1===i.startColumn?0:_.charIndex+1,x.firstChild,1===i.endColumn?0:v.charIndex+1))}_getScreenReaderContentLineIntervals(e){return this._strategy.fromEditorSelection(this._context.viewModel,e,this._accessibilityPageSize)}_getEditorSelectionFromDomRange(){if(!this._renderedLines)return;const e=Ka().document.getSelection();if(!e)return;if(0===e.rangeCount)return;const t=e.getRangeAt(0),i=t.startContainer,n=t.endContainer,o=i.parentElement,s=n.parentElement;if(!(o&&qa(o)&&s&&qa(s)))return;const r=o.parentElement?.parentElement,a=s.parentElement?.parentElement;if(!r||!a)return;const l=r.getAttribute(fU),d=a.getAttribute(fU);if(!l||!d)return;const h=parseInt(l),c=parseInt(d),u=this._renderedLines.get(h)?.characterMapping,g=this._renderedLines.get(c)?.characterMapping;if(!u||!g)return;const p=aW(u,o,t.startOffset),m=aW(g,s,t.endOffset);return"forward"===e.direction?new Qu(h,p,c,m):new Qu(c,m,h,p)}};_U=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(3,rB)],_U);class vU{constructor(e,t){this.domNode=e,this.characterMapping=t}}class bU{constructor(e,t){this.startLine=e,this.endLine=t}}class wU{constructor(e,t){this.intervals=t;let i="";for(const n of t)for(let t=n.startLine;t<=n.endLine;t++)i+=e.getLineContent(t)+"\n";this.value=i}equals(e){return this.value===e.value}static get NULL(){return new wU({getLineContent:()=>"",getLineCount:()=>1,getLineMaxColumn:()=>1,getValueInRange:()=>"",getValueLengthInRange:()=>0,modifyPosition:(e,t)=>e},[])}}class CU{constructor(){}_getPageOfLine(e,t){return Math.floor((e-1)/t)}_getRangeForPage(e,t,i){const n=t*i,o=n+1,s=Math.min(n+i,e.getLineCount());return new bU(o,s)}fromEditorSelection(e,t,i){const n=this._getPageOfLine(t.startLineNumber,i),o=this._getRangeForPage(e,n,i),s=this._getPageOfLine(t.endLineNumber,i),r=this._getRangeForPage(e,s,i),a=[{startLine:o.startLine,endLine:o.endLine}];return n+1<s&&a.push({startLine:r.startLine,endLine:r.endLine}),new wU(e,a)}}class yU{constructor(e){this.replacements=e;let t=-1;for(const i of e){if(!(i.replaceRange.start>=t))throw new Ve(`Edits must be disjoint and sorted. Found ${i} after ${t}`);t=i.replaceRange.endExclusive}}toString(){return`[${this.replacements.map((e=>e.toString())).join(", ")}]`}normalize(){const e=[];let t;for(const i of this.replacements)if(0!==i.getNewLength()||0!==i.replaceRange.length){if(t&&t.replaceRange.endExclusive===i.replaceRange.start){const e=t.tryJoinTouching(i);if(e){t=e;continue}}t&&e.push(t),t=i}return t&&e.push(t),this._createNew(e)}compose(e){const t=this.normalize(),i=e.normalize();if(t.isEmpty())return i;if(i.isEmpty())return t;const n=[...t.replacements],o=[];let s=0;for(const e of i.replacements){for(;;){const t=n[0];if(!t||t.replaceRange.start+s+t.getNewLength()>=e.replaceRange.start)break;n.shift(),o.push(t),s+=t.getNewLength()-t.replaceRange.length}const t=s;let i,r;for(;;){const t=n[0];if(!t||t.replaceRange.start+s>e.replaceRange.endExclusive)break;i||(i=t),r=t,n.shift(),s+=t.getNewLength()-t.replaceRange.length}if(i){const a=Math.min(i.replaceRange.start,e.replaceRange.start-t),l=e.replaceRange.start-(i.replaceRange.start+t);if(l>0){const e=i.slice(cm.emptyAt(a),new cm(0,l));o.push(e)}if(!r)throw new Ve("Invariant violation: lastIntersecting is undefined");const d=r.replaceRange.endExclusive+s-e.replaceRange.endExclusive;if(d>0){const e=r.slice(cm.ofStartAndLength(r.replaceRange.endExclusive,0),new cm(r.getNewLength()-d,r.getNewLength()));n.unshift(e),s-=e.getNewLength()-e.replaceRange.length}const h=new cm(a,e.replaceRange.endExclusive-s),c=e.slice(h,new cm(0,e.getNewLength()));o.push(c)}else o.push(e.delta(-s))}for(;;){const e=n.shift();if(!e)break;o.push(e)}return this._createNew(o).normalize()}getNewRanges(){const e=[];let t=0;for(const i of this.replacements)e.push(cm.ofStartAndLength(i.replaceRange.start+t,i.getNewLength())),t+=i.getLengthDelta();return e}isEmpty(){return 0===this.replacements.length}}class SU{constructor(e){this.replaceRange=e}delta(e){return this.slice(this.replaceRange.delta(e),new cm(0,this.getNewLength()))}getLengthDelta(){return this.getNewLength()-this.replaceRange.length}toString(){return`{ ${this.replaceRange.toString()} -> ${this.getNewLength()} }`}get isEmpty(){return 0===this.getNewLength()&&0===this.replaceRange.length}getRangeAfterReplace(){return new cm(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}}class xU extends yU{apply(e){const t=[];let i=0;for(const n of this.replacements)t.push(e.substring(i,n.replaceRange.start)),t.push(n.newText),i=n.replaceRange.endExclusive;return t.push(e.substring(i)),t.join("")}}class kU extends SU{constructor(e,t){super(e),this.newText=t}getNewLength(){return this.newText.length}toString(){return`${this.replaceRange} -> ${JSON.stringify(this.newText)}`}replace(e){return e.substring(0,this.replaceRange.start)+this.newText+e.substring(this.replaceRange.endExclusive)}removeCommonSuffixPrefix(e){const t=e.substring(this.replaceRange.start,this.replaceRange.endExclusive),i=rn(t,this.newText),n=Math.min(t.length-i,this.newText.length-i,an(t,this.newText)),o=new cm(this.replaceRange.start+i,this.replaceRange.endExclusive-n),s=this.newText.substring(i,this.newText.length-n);return new DU(o,s)}removeCommonSuffixAndPrefix(e){return this.removeCommonSuffix(e).removeCommonPrefix(e)}removeCommonPrefix(e){const t=rn(this.replaceRange.substring(e),this.newText);return 0===t?this:this.slice(this.replaceRange.deltaStart(t),new cm(t,this.newText.length))}removeCommonSuffix(e){const t=an(this.replaceRange.substring(e),this.newText);return 0===t?this:this.slice(this.replaceRange.deltaEnd(-t),new cm(0,this.newText.length-t))}toJson(){return{txt:this.newText,pos:this.replaceRange.start,len:this.replaceRange.length}}}class LU extends xU{static{this.empty=new LU([])}static compose(e){if(0===e.length)return LU.empty;let t=e[0];for(let i=1;i<e.length;i++)t=t.compose(e[i]);return t}constructor(e){super(e)}_createNew(e){return new LU(e)}}class DU extends kU{static insert(e,t){return new DU(cm.emptyAt(e),t)}static replace(e,t){return new DU(e,t)}equals(e){return this.replaceRange.equals(e.replaceRange)&&this.newText===e.newText}tryJoinTouching(e){return new DU(this.replaceRange.joinRightTouching(e.replaceRange),this.newText+e.newText)}slice(e,t){return new DU(e,t?t.substring(this.newText):this.newText)}}function EU(e,t){e=e.slice();const i=[];let n=0;for(const o of t.replacements){for(;;){const t=e[0];if(!t||t.endExclusive>=o.replaceRange.start)break;e.shift(),i.push(t.delta(n))}const t=[];for(;;){const i=e[0];if(!i||!i.intersectsOrTouches(o.replaceRange))break;e.shift(),t.push(i)}for(let i=t.length-1;i>=0;i--){let n=t[i];const s=n.intersect(o.replaceRange).length;n=n.deltaEnd(-s+(0===i?o.newText.length:0));const r=n.start-o.replaceRange.start;r>0&&(n=n.delta(-r)),0!==i&&(n=n.delta(o.newText.length)),n=n.delta(-(o.newText.length-o.replaceRange.length)),e.unshift(n)}n+=o.newText.length-o.replaceRange.length}for(;;){const t=e[0];if(!t)break;e.shift(),i.push(t.delta(n))}return i}class NU{getOffsetRange(e){return new cm(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return Yu.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringReplacement(e){return new IU.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new IU.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){const t=e.replacements.map((e=>this.getTextReplacement(e)));return new IU.deps.TextEdit(t)}}class IU{static{this._deps=void 0}static get deps(){if(!this._deps)throw new Error("Dependencies not set. Call _setDependencies first.");return this._deps}}class TU extends NU{constructor(e){super(),this.text=e,this.lineStartOffsetByLineIdx=[],this.lineEndOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;t<e.length;t++)"\n"===e.charAt(t)&&(this.lineStartOffsetByLineIdx.push(t+1),t>0&&"\r"===e.charAt(t-1)?this.lineEndOffsetByLineIdx.push(t-1):this.lineEndOffsetByLineIdx.push(t));this.lineEndOffsetByLineIdx.push(e.length)}getOffset(e){const t=this._validatePosition(e);return this.lineStartOffsetByLineIdx[t.lineNumber-1]+t.column-1}_validatePosition(e){if(e.lineNumber<1)return new rc(1,1);const t=this.textLength.lineCount+1;if(e.lineNumber>t){const e=this.getLineLength(t);return new rc(t,e+1)}if(e.column<1)return new rc(e.lineNumber,1);const i=this.getLineLength(e.lineNumber);return e.column-1>i?new rc(e.lineNumber,i+1):e}getPosition(e){const t=mm(this.lineStartOffsetByLineIdx,(t=>t<=e)),i=t+1,n=e-this.lineStartOffsetByLineIdx[t]+1;return new rc(i,n)}get textLength(){const e=this.lineStartOffsetByLineIdx.length-1;return new IU.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}}class MU{constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new rc(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getValueOfOffsetRange(e){return this.getValueOfRange(this.getTransformer().getRange(e))}getLineLength(e){return this.getValueOfRange(new Yu(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new TU(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new Yu(e,1,e,Number.MAX_SAFE_INTEGER))}}class AU extends MU{constructor(e,t){ot(t>=1),super(),this._getLineContent=e,this._lineCount=t}getValueOfRange(e){if(e.startLineNumber===e.endLineNumber)return this._getLineContent(e.startLineNumber).substring(e.startColumn-1,e.endColumn-1);let t=this._getLineContent(e.startLineNumber).substring(e.startColumn-1);for(let i=e.startLineNumber+1;i<e.endLineNumber;i++)t+="\n"+this._getLineContent(i);return t+="\n"+this._getLineContent(e.endLineNumber).substring(0,e.endColumn-1),t}getLineLength(e){return this._getLineContent(e).length}get length(){const e=this._getLineContent(this._lineCount);return new xm(this._lineCount-1,e.length)}}class RU extends AU{constructor(e){super((t=>e[t-1]),e.length)}}class OU extends MU{constructor(e){super(),this.value=e,this._t=new TU(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}}class PU{static fromStringEdit(e,t){const i=e.replacements.map((e=>FU.fromStringReplacement(e,t)));return new PU(i)}static fromParallelReplacementsUnsorted(e){const t=e.slice().sort(Cs((e=>e.range),Yu.compareRangesUsingStarts));return new PU(t)}constructor(e){this.replacements=e,rt((()=>at(e,((e,t)=>e.range.getEndPosition().isBeforeOrEqual(t.range.getStartPosition())))))}mapPosition(e){let t=0,i=0,n=0;for(const o of this.replacements){const s=o.range.getStartPosition();if(e.isBeforeOrEqual(s))break;const r=o.range.getEndPosition(),a=xm.ofText(o.text);if(e.isBefore(r)){const e=new rc(s.lineNumber+t,s.column+(s.lineNumber+t===i?n:0));return BU(e,a.addToPosition(e))}s.lineNumber+t!==i&&(n=0),t+=a.lineCount-(o.range.endLineNumber-o.range.startLineNumber),0===a.lineCount?r.lineNumber!==s.lineNumber?n+=a.columnCount-(r.column-1):n+=a.columnCount-(r.column-s.column):n=a.columnCount,i=r.lineNumber+t}return new rc(e.lineNumber+t,e.column+(e.lineNumber+t===i?n:0))}mapRange(e){const t=function(e){return e instanceof rc?e:e.getStartPosition()}(this.mapPosition(e.getStartPosition())),i=function(e){return e instanceof rc?e:e.getEndPosition()}(this.mapPosition(e.getEndPosition()));return BU(t,i)}apply(e){let t="",i=new rc(1,1);for(const n of this.replacements){const o=n.range,s=o.getStartPosition(),r=o.getEndPosition(),a=BU(i,s);a.isEmpty()||(t+=e.getValueOfRange(a)),t+=n.text,i=r}const n=BU(i,e.endPositionExclusive);return n.isEmpty()||(t+=e.getValueOfRange(n)),t}applyToString(e){const t=new OU(e);return this.apply(t)}getNewRanges(){const e=[];let t=0,i=0,n=0;for(const o of this.replacements){const s=xm.ofText(o.text),r=rc.lift({lineNumber:o.range.startLineNumber+i,column:o.range.startColumn+(o.range.startLineNumber===t?n:0)}),a=s.createRange(r);e.push(a),i=a.endLineNumber-o.range.endLineNumber,n=a.endColumn-o.range.endColumn,t=o.range.endLineNumber}return e}toReplacement(e){if(0===this.replacements.length)throw new Ve;if(1===this.replacements.length)return this.replacements[0];const t=this.replacements[0].range.getStartPosition(),i=this.replacements[this.replacements.length-1].range.getEndPosition();let n="";for(let t=0;t<this.replacements.length;t++){const i=this.replacements[t];if(n+=i.text,t<this.replacements.length-1){const o=this.replacements[t+1],s=Yu.fromPositions(i.range.getEndPosition(),o.range.getStartPosition());n+=e.getValueOfRange(s)}}return new FU(Yu.fromPositions(t,i),n)}toString(e){return void 0===e?this.replacements.map((e=>e.toString())).join("\n"):"string"==typeof e?this.toString(new OU(e)):0===this.replacements.length?"":this.replacements.map((t=>{const i=10,n=e.getValueOfRange(t.range),o=Yu.fromPositions(new rc(Math.max(1,t.range.startLineNumber-1),1),t.range.getStartPosition());let s=e.getValueOfRange(o);s.length>i&&(s="..."+s.substring(s.length-i));const r=Yu.fromPositions(t.range.getEndPosition(),new rc(t.range.endLineNumber+1,1));let a=e.getValueOfRange(r);a.length>i&&(a=a.substring(0,i)+"...");let l=n;if(l.length>i){const e=Math.floor(5);l=l.substring(0,e)+"..."+l.substring(l.length-e)}let d=t.text;if(d.length>i){const e=Math.floor(5);d=d.substring(0,e)+"..."+d.substring(d.length-e)}return 0===l.length?`${s}❰${d}❱${a}`:`${s}❰${l}↦${d}❱${a}`})).join("\n")}}class FU{static joinReplacements(e,t){if(0===e.length)throw new Ve;if(1===e.length)return e[0];const i=e[0].range.getStartPosition(),n=e[e.length-1].range.getEndPosition();let o="";for(let i=0;i<e.length;i++){const n=e[i];if(o+=n.text,i<e.length-1){const s=e[i+1],r=Yu.fromPositions(n.range.getEndPosition(),s.range.getStartPosition());o+=t.getValueOfRange(r)}}return new FU(Yu.fromPositions(i,n),o)}static fromStringReplacement(e,t){return new FU(t.getTransformer().getRange(e.replaceRange),e.newText)}static delete(e){return new FU(e,"")}constructor(e,t){this.range=e,this.text=t}get isEmpty(){return this.range.isEmpty()&&0===this.text.length}static equals(e,t){return e.range.equalsRange(t.range)&&e.text===t.text}equals(e){return FU.equals(this,e)}removeCommonPrefixAndSuffix(e){return this.removeCommonPrefix(e).removeCommonSuffix(e)}removeCommonPrefix(e){const t=e.getValueOfRange(this.range).replaceAll("\r\n","\n"),i=this.text.replaceAll("\r\n","\n"),n=rn(t,i),o=xm.ofText(t.substring(0,n)).addToPosition(this.range.getStartPosition()),s=i.substring(n),r=Yu.fromPositions(o,this.range.getEndPosition());return new FU(r,s)}removeCommonSuffix(e){const t=e.getValueOfRange(this.range).replaceAll("\r\n","\n"),i=this.text.replaceAll("\r\n","\n"),n=an(t,i),o=xm.ofText(t.substring(0,t.length-n)).addToPosition(this.range.getStartPosition()),s=i.substring(0,i.length-n),r=Yu.fromPositions(this.range.getStartPosition(),o);return new FU(r,s)}toString(){const e=this.range.getStartPosition(),t=this.range.getEndPosition();return`(${e.lineNumber},${e.column} -> ${t.lineNumber},${t.column}): "${this.text}"`}}function BU(e,t){if(e.lineNumber===t.lineNumber&&e.column===Number.MAX_SAFE_INTEGER)return Yu.fromPositions(t,t);if(!e.isBeforeOrEqual(t))throw new Ve("start must be before end");return new Yu(e.lineNumber,e.column,t.lineNumber,t.column)}var WU;WU={StringEdit:LU,StringReplacement:DU,TextReplacement:FU,TextEdit:PU,TextLength:xm},IU._deps=WU;let VU=class extends At{constructor(e,t,i,n){super(),this._domNode=e,this._context=t,this._viewController=i,this._accessibilityService=n,this._selectionChangeListener=this._register(new Rt),this._accessibilityPageSize=1,this._ignoreSelectionChangeTime=0,this._strategy=new oU,this.onConfigurationChanged(this._context.configuration.options)}updateScreenReaderContent(e){const t=this._domNode.domNode,i=Ka().document.activeElement;if(i&&i===t)if(this._accessibilityService.isScreenReaderOptimized()){this._state=this._getScreenReaderContentState(e),t.textContent!==this._state.value&&(this._setIgnoreSelectionChangeTime("setValue"),t.textContent=this._state.value);const i=Ka().document.getSelection();if(!i)return;const n=this._getScreenReaderRange(this._state.selectionStart,this._state.selectionEnd);if(!n)return;this._setIgnoreSelectionChangeTime("setRange"),i.setBaseAndExtent(n.anchorNode,n.anchorOffset,n.focusNode,n.focusOffset)}else this._state=void 0,this._setIgnoreSelectionChangeTime("setValue"),this._domNode.domNode.textContent=""}updateScrollTop(e){if(!this._state)return;const t=this._context.viewModel.viewLayout,i=this._state.startPositionWithinEditor.lineNumber,n=t.getVerticalOffsetForLineNumber(i),o=t.getVerticalOffsetForLineNumber(e.positionLineNumber);this._domNode.domNode.scrollTop=o-n}onFocusChange(e){this._selectionChangeListener.value=e?this._setSelectionChangeListener():void 0}onConfigurationChanged(e){this._accessibilityPageSize=e.get(3)}onWillCut(){this._setIgnoreSelectionChangeTime("onCut")}onWillPaste(){this._setIgnoreSelectionChangeTime("onWillPaste")}_setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}_setSelectionChangeListener(){let e=0;return ga(this._domNode.domNode.ownerDocument,"selectionchange",(()=>{const t=this._accessibilityService.isScreenReaderOptimized();if(!this._state||!t||!iU.enabled)return;if(Ka().document.activeElement!==this._domNode.domNode)return;const i=Ka().document.getSelection();if(!i)return;if(0===i.rangeCount)return;const n=i.getRangeAt(0),o=Date.now(),s=o-e;if(e=o,s<5)return;const r=o-this._ignoreSelectionChangeTime;this._ignoreSelectionChangeTime=0,r<100||this._viewController.setSelection(this._getEditorSelectionFromDomRange(this._context,this._state,i.direction,n))}))}_getScreenReaderContentState(e){const t=this._strategy.fromEditorSelection(this._context.viewModel,e,this._accessibilityPageSize,0===this._accessibilityService.getAccessibilitySupport()),i=this._context.viewModel.model.getPositionAt(1/0);let n=t.value;return 1===i.column&&e.getEndPosition().equals(i)&&(n+="\n"),t.value=n,t}_getScreenReaderRange(e,t){const i=this._domNode.domNode.firstChild;if(!i)return;const n=new globalThis.Range;return n.setStart(i,e),n.setEnd(i,t),{anchorNode:i,anchorOffset:e,focusNode:i,focusOffset:t}}_getEditorSelectionFromDomRange(e,t,i,n){const o=e.viewModel,s=o.model,r=o.coordinatesConverter.convertViewPositionToModelPosition(t.startPositionWithinEditor),a=s.getOffsetAt(r);let l=n.startOffset+a,d=n.endOffset+a;if(1===s.getEndOfLineSequence()){const e=t.value,i=new TU(e),o=i.getPosition(n.startOffset),s=i.getPosition(n.endOffset);l+=o.lineNumber-1,d+=s.lineNumber-1}const h=s.getPositionAt(l),c=s.getPositionAt(d),u="forward"===i?h:c,g="forward"===i?c:h;return Qu.fromPositions(u,g)}};VU=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(3,rB)],VU);var HU=function(e,t){return function(i,n){t(i,n,e)}};let zU=class extends At{constructor(e,t,i,n,o){super(),this._domNode=e,this._context=t,this._viewController=i,this._keybindingService=n,this._accessibilityService=o,this._contentLeft=1,this._contentWidth=1,this._contentHeight=1,this._divWidth=1,this._primarySelection=new Qu(1,1,1,1),this._primaryCursorVisibleRange=null,this._state=this._register(new Rt),this._instantiateScreenReaderContent(),this._updateConfigurationSettings(),this._updateDomAttributes()}onWillPaste(){this._state.value?.onWillPaste()}onWillCut(){this._state.value?.onWillCut()}handleFocusChange(e){this._state.value?.onFocusChange(e),this.writeScreenReaderContent()}onConfigurationChanged(e){this._instantiateScreenReaderContent(),this._updateConfigurationSettings(),this._updateDomAttributes(),e.hasChanged(2)&&this.writeScreenReaderContent()}_instantiateScreenReaderContent(){const e=this._context.configuration.options.get(107);this._renderRichContent!==e&&(this._renderRichContent=e,this._state.value=this._createScreenReaderContent(e))}_createScreenReaderContent(e){return e?new _U(this._domNode,this._context,this._viewController,this._accessibilityService):new VU(this._domNode,this._context,this._viewController,this._accessibilityService)}_updateConfigurationSettings(){const e=this._context.configuration.options,t=e.get(165),i=t.wrappingColumn;this._contentLeft=t.contentLeft,this._contentWidth=t.contentWidth,this._contentHeight=t.height,this._fontInfo=e.get(59),this._divWidth=Math.round(i*this._fontInfo.typicalHalfwidthCharacterWidth),this._state.value?.onConfigurationChanged(e)}_updateDomAttributes(){const e=this._context.configuration.options;this._domNode.domNode.setAttribute("role","textbox"),this._domNode.domNode.setAttribute("aria-required",e.get(9)?"true":"false"),this._domNode.domNode.setAttribute("aria-multiline","true"),this._domNode.domNode.setAttribute("aria-autocomplete",e.get(104)?"none":"both"),this._domNode.domNode.setAttribute("aria-roledescription",y(55,"editor")),this._domNode.domNode.setAttribute("aria-label",sU(e,this._keybindingService));const t=this._context.viewModel.model.getOptions().tabSize,i=e.get(59).spaceWidth;this._domNode.domNode.style.tabSize=t*i+"px";const n=e.get(154),o="inherit"===n?e.get(153):n,s="inherit"===o?e.get(149):o;this._domNode.domNode.style.textWrap="off"===s?"nowrap":"wrap"}onCursorStateChanged(e){this._primarySelection=e.selections[0]??new Qu(1,1,1,1)}prepareRender(e){this.writeScreenReaderContent(),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primarySelection.getPosition())}render(e){if(!this._primaryCursorVisibleRange)return void this._renderAtTopLeft();const t=this._context.viewLayout.getCurrentScrollLeft(),i=this._contentLeft+this._primaryCursorVisibleRange.left-t;if(i<this._contentLeft||i>this._contentLeft+this._contentWidth)return void this._renderAtTopLeft();const n=this._context.viewLayout.getCurrentScrollTop(),o=this._primarySelection.positionLineNumber,s=this._context.viewLayout.getVerticalOffsetForLineNumber(o)-n;if(s<0||s>this._contentHeight)return void this._renderAtTopLeft();const r=this._context.viewLayout.getLineHeightForLineNumber(o);this._doRender(s,this._contentLeft,this._divWidth,r),this._state.value?.updateScrollTop(this._primarySelection)}_renderAtTopLeft(){this._doRender(0,0,this._contentWidth,1)}_doRender(e,t,i,n){iT(this._domNode,this._fontInfo),this._domNode.setTop(e),this._domNode.setLeft(t),this._domNode.setWidth(i),this._domNode.setHeight(n),this._domNode.setLineHeight(n)}setAriaOptions(e){e.activeDescendant?(this._domNode.setAttribute("aria-haspopup","true"),this._domNode.setAttribute("aria-autocomplete","list"),this._domNode.setAttribute("aria-activedescendant",e.activeDescendant)):(this._domNode.setAttribute("aria-haspopup","false"),this._domNode.setAttribute("aria-autocomplete","both"),this._domNode.removeAttribute("aria-activedescendant")),e.role&&this._domNode.setAttribute("role",e.role)}writeScreenReaderContent(){this._state.value?.updateScreenReaderContent(this._primarySelection)}};var UU;zU=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([HU(3,ER),HU(4,rB)],zU),function(e){e.create=function(e,t){return new e.EditContext(t)}}(UU||(UU={}));var KU,jU=function(e,t){return function(i,n){t(i,n,e)}};!function(e){e.NONE="edit-context-composition-none",e.SECONDARY="edit-context-composition-secondary",e.PRIMARY="edit-context-composition-primary"}(KU||(KU={}));let qU=class extends nU{constructor(e,t,i,n,o,s,r){super(t),this._viewController=n,this._visibleRangeProvider=o,this.logService=r,this._previousEditContextSelection=new cm(0,0),this._editContextPrimarySelection=new Qu(1,1,1,1),this._decorations=[],this._primarySelection=new Qu(1,1,1,1),this._targetWindowId=-1,this._scrollTop=0,this._scrollLeft=0,this.domNode=new JI(document.createElement("div")),this.domNode.setClassName("native-edit-context"),this._imeTextArea=new JI(document.createElement("textarea")),this._imeTextArea.setClassName("ime-text-area"),this._imeTextArea.setAttribute("readonly","true"),this._imeTextArea.setAttribute("tabindex","-1"),this._imeTextArea.setAttribute("aria-hidden","true"),this.domNode.setAttribute("autocorrect","off"),this.domNode.setAttribute("autocapitalize","off"),this.domNode.setAttribute("autocomplete","off"),this.domNode.setAttribute("spellcheck","false"),this._updateDomAttributes(),i.appendChild(this.domNode),i.appendChild(this._imeTextArea),this._parent=i.domNode,this._focusTracker=this._register(new gU(r,this.domNode.domNode,(e=>{r.trace("NativeEditContext#handleFocusChange : ",e),this._screenReaderSupport.handleFocusChange(e),this._context.viewModel.setHasFocus(e)})));const a=ta(this.domNode.domNode);let l;this._editContext=UU.create(a),this.setEditContextOnDomNode(),this._screenReaderSupport=this._register(s.createInstance(zU,this.domNode,t,this._viewController)),this._register(ga(this.domNode.domNode,"copy",(e=>{this.logService.trace("NativeEditContext#copy"),this._ensureClipboardGetsEditorSelection(e)}))),this._register(ga(this.domNode.domNode,"cut",(e=>{this.logService.trace("NativeEditContext#cut"),this._screenReaderSupport.onWillCut(),this._ensureClipboardGetsEditorSelection(e),this.logService.trace("NativeEditContext#cut (before viewController.cut)"),this._viewController.cut()}))),this._register(ga(this.domNode.domNode,"keyup",(e=>this._onKeyUp(e)))),this._register(ga(this.domNode.domNode,"keydown",(async e=>this._onKeyDown(e)))),this._register(ga(this._imeTextArea.domNode,"keyup",(e=>this._onKeyUp(e)))),this._register(ga(this._imeTextArea.domNode,"keydown",(async e=>this._onKeyDown(e)))),this._register(ga(this.domNode.domNode,"beforeinput",(async e=>{"insertParagraph"!==e.inputType&&"insertLineBreak"!==e.inputType||this._onType(this._viewController,{text:"\n",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0})}))),this._register(ga(this.domNode.domNode,"paste",(e=>{if(this.logService.trace("NativeEditContext#paste"),e.preventDefault(),!e.clipboardData)return;let[t,i]=dD.getTextData(e.clipboardData);if(this.logService.trace("NativeEditContext#paste with id : ",i?.id," with text.length: ",t.length),!t)return;i=i||aD.INSTANCE.get(t);let n=!1,o=null,s=null;i&&(n=this._context.configuration.options.get(45)&&!!i.isFromEmptySelection,o=void 0!==i.multicursorText?i.multicursorText:null,s=i.mode),this.logService.trace("NativeEditContext#paste (before viewController.paste)"),this._viewController.paste(t,n,o,s)}))),this._register(pU(this._editContext,"textformatupdate",(e=>this._handleTextFormatUpdate(e)))),this._register(pU(this._editContext,"characterboundsupdate",(e=>this._updateCharacterBounds(e)))),this._register(pU(this._editContext,"textupdate",(e=>{const t=e.text;if(1===t.length){const i=t.charCodeAt(0);if(ln(i))return void(l=t);if(dn(i)&&l){const i={text:l+t,selectionEnd:e.selectionEnd,selectionStart:e.selectionStart,updateRangeStart:e.updateRangeStart-1,updateRangeEnd:e.updateRangeEnd-1};return l=void 0,void this._emitTypeEvent(this._viewController,i)}}this._emitTypeEvent(this._viewController,e)}))),this._register(pU(this._editContext,"compositionstart",(e=>{this._updateEditContext(),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()}))),this._register(pU(this._editContext,"compositionend",(e=>{this._updateEditContext(),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})));let d=!1;this._register(iU.onDidChange((()=>{iU.enabled&&d&&(this._focusTracker.resume(),this.domNode.focus(),d=!1),!iU.enabled&&this.isFocused()&&(this._focusTracker.pause(),this._imeTextArea.focus(),d=!0)}))),this._register(hD.register(e,this))}dispose(){this.domNode.domNode.editContext=void 0,this.domNode.domNode.blur(),this.domNode.domNode.remove(),this._imeTextArea.domNode.remove(),super.dispose()}setAriaOptions(e){this._screenReaderSupport.setAriaOptions(e)}getLastRenderData(){return this._primarySelection.getPosition()}prepareRender(e){this._screenReaderSupport.prepareRender(e),this._updateSelectionAndControlBounds(e)}render(e){this._screenReaderSupport.render(e)}onCursorStateChanged(e){return this._primarySelection=e.modelSelections[0]??new Qu(1,1,1,1),this._screenReaderSupport.onCursorStateChanged(e),this._updateEditContext(),!0}onConfigurationChanged(e){return this._screenReaderSupport.onConfigurationChanged(e),this._updateDomAttributes(),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.fromLineNumber+e.count-1),!0}onLinesDeleted(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.toLineNumber),!0}onLinesInserted(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.toLineNumber),!0}_updateEditContextOnLineChange(e,t){this._editContextPrimarySelection.endLineNumber<e||this._editContextPrimarySelection.startLineNumber>t||this._updateEditContext()}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}onWillPaste(){this.logService.trace("NativeEditContext#onWillPaste"),this._onWillPaste()}_onWillPaste(){this._screenReaderSupport.onWillPaste()}onWillCopy(){this.logService.trace("NativeEditContext#onWillCopy"),this.logService.trace("NativeEditContext#isFocused : ",this.domNode.domNode===Va())}writeScreenReaderContent(){this._screenReaderSupport.writeScreenReaderContent()}isFocused(){return this._focusTracker.isFocused}focus(){this._focusTracker.focus(),this.refreshFocusState()}refreshFocusState(){this._focusTracker.refreshFocusState()}setEditContextOnDomNode(){const e=ta(this.domNode.domNode),t=sa(e);this._targetWindowId!==t&&(this.domNode.domNode.editContext=this._editContext,this._targetWindowId=t)}_onKeyUp(e){this._viewController.emitKeyUp(new Ze(e))}_onKeyDown(e){const t=new Ze(e);114===t.keyCode&&t.stopPropagation(),this._viewController.emitKeyDown(t)}_updateDomAttributes(){const e=this._context.configuration.options;this.domNode.domNode.setAttribute("tabindex",String(e.get(140)))}_updateEditContext(){const e=this._getNewEditContextState();e&&(this._editContext.updateText(0,Number.MAX_SAFE_INTEGER,e.text??" "),this._editContext.updateSelection(e.selectionStartOffset,e.selectionEndOffset),this._editContextPrimarySelection=e.editContextPrimarySelection,this._previousEditContextSelection=new cm(e.selectionStartOffset,e.selectionEndOffset))}_emitTypeEvent(e,t){if(!this._editContext)return;const i=this._previousEditContextSelection.endExclusive,n=this._previousEditContextSelection.start;this._previousEditContextSelection=new cm(t.selectionStart,t.selectionEnd);let o=0,s=0;t.updateRangeEnd>i&&(o=t.updateRangeEnd-i),t.updateRangeStart<n&&(s=n-t.updateRangeStart);let r="";n<t.updateRangeStart&&(r+=this._editContext.text.substring(n,t.updateRangeStart)),r+=t.text,i>t.updateRangeEnd&&(r+=this._editContext.text.substring(t.updateRangeEnd,i));let a=0;t.selectionStart===t.selectionEnd&&n===i&&(a=t.selectionStart-(t.updateRangeStart+t.text.length));const l={text:r,replacePrevCharCnt:s,replaceNextCharCnt:o,positionDelta:a};this._onType(e,l)}_onType(e,t){t.replacePrevCharCnt||t.replaceNextCharCnt||t.positionDelta?e.compositionType(t.text,t.replacePrevCharCnt,t.replaceNextCharCnt,t.positionDelta):e.type(t.text)}_getNewEditContextState(){const e=this._primarySelection,t=this._context.viewModel.model;if(!t.isValidRange(e))return;const i=e.startLineNumber,n=e.endLineNumber,o=t.getLineMaxColumn(n),s=new Yu(i,1,n,o),r=t.getValueInRange(s,0);return{text:r,selectionStartOffset:e.startColumn-1,selectionEndOffset:r.length+e.endColumn-o,editContextPrimarySelection:e}}_editContextStartPosition(){return new rc(this._editContextPrimarySelection.startLineNumber,1)}_handleTextFormatUpdate(e){if(!this._editContext)return;const t=e.getTextFormats(),i=this._editContextStartPosition(),n=[];t.forEach((e=>{const t=this._context.viewModel.model,o=t.getOffsetAt(i),s=t.getPositionAt(o+e.rangeStart),r=t.getPositionAt(o+e.rangeEnd),a=Yu.fromPositions(s,r),l=e.underlineThickness.toLowerCase();let d=KU.NONE;switch(l){case"thin":d=KU.SECONDARY;break;case"thick":d=KU.PRIMARY}n.push({range:a,options:{description:"textFormatDecoration",inlineClassName:d}})})),this._decorations=this._context.viewModel.model.deltaDecorations(this._decorations,n)}_updateSelectionAndControlBounds(e){if(!this._parent)return;const t=this._context.configuration.options.get(165).contentLeft,i=this._parent.getBoundingClientRect(),n=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(this._primarySelection),o=this._context.viewLayout.getVerticalOffsetForLineNumber(n.startLineNumber),s=i.top+o-this._scrollTop,r=this._context.viewLayout.getVerticalOffsetAfterLineNumber(n.endLineNumber)-o;let a,l=i.left+t-this._scrollLeft;if(this._primarySelection.isEmpty()){const t=e.visibleRangeForPosition(n.getStartPosition());t&&(l+=t.left),a=0}else a=i.width-t;const d=new DOMRect(l,s,a,r);this._editContext.updateSelectionBounds(d),this._editContext.updateControlBounds(d)}_updateCharacterBounds(e){if(!this._parent)return;const t=this._context.configuration.options,i=t.get(59).typicalHalfwidthCharacterWidth,n=t.get(165).contentLeft,o=this._parent.getBoundingClientRect(),s=[],r=new TU(this._editContext.text);for(let t=e.rangeStart;t<e.rangeEnd;t++){const e=r.getPosition(t),a=this._editContextPrimarySelection.startLineNumber-1,l=new rc(a+e.lineNumber,e.column),d=l.delta(0,1),h=Yu.fromPositions(l,d),c=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(h),u=this._visibleRangeProvider.linesVisibleRangesForRange(c,!0)??[],g=c.startLineNumber,p=this._context.viewLayout.getVerticalOffsetForLineNumber(g),m=o.top+p-this._scrollTop;let f=0,_=i;if(u.length>0)for(const e of u[0].ranges){f=e.left,_=e.width;break}const v=this._context.viewLayout.getLineHeightForLineNumber(g);s.push(new DOMRect(o.left+n+f-this._scrollLeft,m,_,v))}this._editContext.updateCharacterBounds(e.rangeStart,s)}_ensureClipboardGetsEditorSelection(e){const t=this._context.configuration.options,i=t.get(45),n=t.get(31),o=this._context.viewModel.getCursorStates().map((e=>e.modelState.selection)),s=rD(this._context.viewModel,o,i,n);let r;this.logService.getLevel()===xu.Trace&&(r=_C());const a={version:1,id:r,isFromEmptySelection:s.isFromEmptySelection,multicursorText:s.multicursorText,mode:s.mode};aD.INSTANCE.set(c?s.text.replace(/\r\n/g,"\n"):s.text,a),e.preventDefault(),e.clipboardData&&dD.setTextData(e.clipboardData,s.text,s.html,a),this.logService.trace("NativeEditContext#_ensureClipboardGetsEditorSelectios with id : ",r," with text.length: ",s.text.length)}};qU=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([jU(5,nc),jU(6,yu)],qU);class $U extends NB{constructor(e,t){super(e),this._viewGpuContext=t,this._gpuShapes=[],this._register(ar((e=>this._updateEntries(e))))}onConfigurationChanged(e){return this._updateEntries(void 0),!0}prepareRender(e){}render(e){}_updateEntries(e){const t=this._context.configuration.options,i=t.get(116),n=t.get(59).typicalHalfwidthCharacterWidth,o=this._viewGpuContext.devicePixelRatio.read(e);for(let e=0,t=i.length;e<t;e++){const t=i[e],s=this._gpuShapes[e],r=t.color?Lg.fromHex(t.color):this._context.theme.getColor(Bw)??Lg.white,a=[t.column*n*o,0,Math.max(1,Math.ceil(o)),Number.MAX_SAFE_INTEGER,r.rgba.r/255,r.rgba.g/255,r.rgba.b/255,r.rgba.a];s?s.setRaw(a):this._gpuShapes[e]=this._viewGpuContext.rectangleRenderer.register(...a)}for(;this._gpuShapes.length>i.length;)this._gpuShapes.splice(-1,1)[0].dispose()}}var GU=i(3413),ZU={};ZU.styleTagTransform=zl(),ZU.setAttributes=Bl(),ZU.insert=Pl().bind(null,"head"),ZU.domAPI=Rl(),ZU.insertStyleElement=Vl(),Ml()(GU.A,ZU),GU.A&&GU.A.locals&&GU.A.locals;class YU extends sV{static{this.CLASS_NAME="gpu-mark"}constructor(e,t){super(),this._viewGpuContext=t,this._context=e,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return!0}onCursorStateChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return!0}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=e.viewportData,o=new PV(this._context.configuration,this._context.theme.type),s=[];for(let e=t;e<=i;e++){const i=e-t,r=this._viewGpuContext.canRenderDetailed(o,n,e);s[i]=r.length?`<div class="${YU.CLASS_NAME}" title="Cannot render on GPU: ${r.join(", ")}"></div>`:""}this._renderResult=s}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}let QU=class extends EB{constructor(e,t,i,n,o,s,r,a,l){super(),this._instantiationService=l,this._shouldRecomputeGlyphMarginLanes=!1,this._ownerID=t,this._widgetFocusTracker=this._register(new eK(e,a)),this._register(this._widgetFocusTracker.onChange((()=>{this._context.viewModel.setHasWidgetFocus(this._widgetFocusTracker.hasFocus())}))),this._selections=[new Qu(1,1,1,1)],this._renderAnimationFrame=null,this._overflowGuardContainer=tT(document.createElement("div")),IB.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._viewController=new WW(n,s,r,i),this._context=new dz(n,o,s),this._context.addEventHandler(this),this._viewParts=[],this._editContextEnabled=this._context.configuration.options.get(170),this._accessibilitySupport=this._context.configuration.options.get(2),this._editContext=this._instantiateEditContext(),this._viewParts.push(this._editContext),this._linesContent=tT(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=tT(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),"on"===this._context.configuration.options.get(46)&&(this._viewGpuContext=this._instantiationService.createInstance(Bz,this._context)),this._scrollbar=new uV(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new VV(this._context,this._viewGpuContext,this._linesContent),this._viewGpuContext&&(this._viewLinesGpu=this._instantiationService.createInstance(Jz,this._context,this._viewGpuContext)),this._viewZones=new iz(this._context),this._viewParts.push(this._viewZones);const d=new IH(this._context);this._viewParts.push(d);const h=new VH(this._context);this._viewParts.push(h);const c=new jW(this._context);this._viewParts.push(c),c.addDynamicOverlay(new aV(this._context)),c.addDynamicOverlay(new $H(this._context)),c.addDynamicOverlay(new kV(this._context)),c.addDynamicOverlay(new cV(this._context)),c.addDynamicOverlay(new sz(this._context));const u=new qW(this._context);this._viewParts.push(u),u.addDynamicOverlay(new lV(this._context)),u.addDynamicOverlay(new ZV(this._context)),u.addDynamicOverlay(new UV(this._context)),u.addDynamicOverlay(new NV(this._context)),this._viewGpuContext&&u.addDynamicOverlay(new YU(this._context,this._viewGpuContext)),this._glyphMarginWidgets=new bV(this._context),this._viewParts.push(this._glyphMarginWidgets);const g=new qV(this._context);g.getDomNode().appendChild(this._viewZones.marginDomNode),g.getDomNode().appendChild(u.getDomNode()),g.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(g),this._contentWidgets=new QW(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new ez(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new SH(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const p=this._viewGpuContext?new $U(this._context,this._viewGpuContext):new FH(this._context);this._viewParts.push(p);const m=new YW(this._context);this._viewParts.push(m);const f=new vH(this._context);if(this._viewParts.push(f),d){const e=this._scrollbar.getOverviewRulerLayoutInfo();e.parent.insertBefore(d.getDomNode(),e.insertBefore)}this._linesContent.appendChild(c.getDomNode()),"domNode"in p&&this._linesContent.appendChild(p.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(g.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._viewGpuContext&&this._overflowGuardContainer.appendChild(this._viewGpuContext.canvas),this._overflowGuardContainer.appendChild(h.getDomNode()),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(f.getDomNode()),this._overflowGuardContainer.appendChild(m.domNode),this.domNode.appendChild(this._overflowGuardContainer),a?(a.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),a.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new BW(this._context,this._viewController,this._createPointerHandlerHelper()))}_instantiateEditContext(){return this._context.configuration.options.get(170)?this._instantiationService.createInstance(qU,this._ownerID,this._context,this._overflowGuardContainer,this._viewController,this._createTextAreaHandlerHelper()):this._instantiationService.createInstance(hU,this._context,this._overflowGuardContainer,this._viewController,this._createTextAreaHandlerHelper())}_updateEditContext(){const e=this._context.configuration.options.get(170),t=this._context.configuration.options.get(2);if(this._editContextEnabled===e&&this._accessibilitySupport===t)return;this._editContextEnabled=e,this._accessibilitySupport=t;const i=this._editContext.isFocused(),n=this._viewParts.indexOf(this._editContext);this._editContext.dispose(),this._editContext=this._instantiateEditContext(),i&&this._editContext.focus(),-1!==n&&this._viewParts.splice(n,1,this._editContext)}_computeGlyphMarginLanes(){const e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes;let i=[],n=0;i=i.concat(e.getAllMarginDecorations().map((e=>{const t=e.options.glyphMargin?.position??gg.Center;return n=Math.max(n,e.range.endLineNumber),{range:e.range,lane:t,persist:e.options.glyphMargin?.persistLane}}))),i=i.concat(this._glyphMarginWidgets.getWidgets().map((t=>{const i=e.validateRange(t.preference.range);return n=Math.max(n,i.endLineNumber),{range:i,lane:t.preference.lane}}))),i.sort(((e,t)=>Yu.compareRangesUsingStarts(e.range,t.range))),t.reset(n);for(const e of i)t.push(e.lane,e.range,e.persist);return t}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,viewLinesGpu:this._viewLinesGpu,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._editContext.domNode.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._editContext.getLastRenderData();return new cW(e,t)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>{this._flushAccumulatedAndRenderNow();const i=new rc(e,t);return this._viewLines.visibleRangeForPosition(i)??this._viewLinesGpu?.visibleRangeForPosition(i)??null},getLineWidth:e=>{if(this._flushAccumulatedAndRenderNow(),this._viewLinesGpu){const t=this._viewLinesGpu.getLineWidth(e);if(void 0!==t)return t}return this._viewLines.getLineWidth(e)}}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e)),linesVisibleRangesForRange:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.linesVisibleRangesForRange(e,t))}}_applyLayout(){const e=this._context.configuration.options.get(165);this.domNode.setWidth(e.width),this.domNode.setHeight(e.height),this._overflowGuardContainer.setWidth(e.width),this._overflowGuardContainer.setHeight(e.height),this._linesContent.setWidth(16777216),this._linesContent.setHeight(16777216)}_getEditorClassName(){const e=this._editContext.isFocused()?" focused":"";return this._context.configuration.options.get(162)+" "+aw(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._updateEditContext(),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){null!==this._renderAnimationFrame&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewGpuContext?.dispose(),this._viewLines.dispose(),this._viewLinesGpu?.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){if(this._store.isDisposed)throw new Ve;if(null===this._renderAnimationFrame){this._editContext instanceof qU&&this._editContext.setEditContextOnDomNode();const e=this._createCoordinatedRendering();this._renderAnimationFrame=JU.INSTANCE.scheduleCoordinatedRendering({window:ta(this.domNode?.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new Ve;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new Ve;return e.renderText()},prepareRender:(t,i)=>{if(this._store.isDisposed)throw new Ve;return e.prepareRender(t,i)},render:(t,i)=>{if(this._store.isDisposed)throw new Ve;return e.render(t,i)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();XU((()=>e.prepareRenderText()));const t=XU((()=>e.renderText()));if(t){const[i,n]=t;XU((()=>e.prepareRender(i,n))),XU((()=>e.render(i,n)))}}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_createCoordinatedRendering(){return{prepareRenderText:()=>{if(this._shouldRecomputeGlyphMarginLanes){this._shouldRecomputeGlyphMarginLanes=!1;const e=this._computeGlyphMarginLanes();this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes)}pB.onRenderStart()},renderText:()=>{if(!this.domNode.domNode.isConnected)return null;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&0===e.length)return null;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new az(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);return this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender()),this._viewLinesGpu?.shouldRender()&&(this._viewLinesGpu.renderText(i),this._viewLinesGpu.onDidRender()),[e,new MB(this._context.viewLayout,i,this._viewLines,this._viewLinesGpu)]},prepareRender:(e,t)=>{for(const i of e)i.prepareRender(t)},render:(e,t)=>{for(const i of e)i.render(t),i.onDidRender()}}}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new rc(n.lineNumber,n.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?$W.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new RH(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const e of this._viewParts)e.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._editContext.writeScreenReaderContent(e)}focus(){this._editContext.focus()}isFocused(){return this._editContext.isFocused()}isWidgetFocused(){return this._widgetFocusTracker.hasFocus()}setAriaOptions(e){this._editContext.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){this._contentWidgets.setWidgetPosition(e.widget,e.position?.position??null,e.position?.secondaryPosition??null,e.position?.preference??null,e.position?.positionAffinity??null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){this._overlayWidgets.setWidgetPosition(e.widget,e.position)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};function XU(e){try{return e()}catch(e){return Ie(e),null}}QU=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(8,nc)],QU);class JU{static{this.INSTANCE=new JU}constructor(){this._coordinatedRenderings=[],this._animationFrameRunners=new Map}scheduleCoordinatedRendering(e){return this._coordinatedRenderings.push(e),this._scheduleRender(e.window),{dispose:()=>{const t=this._coordinatedRenderings.indexOf(e);if(-1!==t&&(this._coordinatedRenderings.splice(t,1),0===this._coordinatedRenderings.length)){for(const[e,t]of this._animationFrameRunners)t.dispose();this._animationFrameRunners.clear()}}}}_scheduleRender(e){if(!this._animationFrameRunners.has(e)){const t=()=>{this._animationFrameRunners.delete(e),this._onRenderScheduled()};this._animationFrameRunners.set(e,wa(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const t of e)XU((()=>t.prepareRenderText()));const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];t[i]=XU((()=>n.renderText()))}for(let i=0,n=e.length;i<n;i++){const n=e[i],o=t[i];if(!o)continue;const[s,r]=o;XU((()=>n.prepareRender(s,r)))}for(let i=0,n=e.length;i<n;i++){const n=e[i],o=t[i];if(!o)continue;const[s,r]=o;XU((()=>n.render(s,r)))}}}class eK extends At{constructor(e,t){super(),this._onChange=this._register(new Zt),this.onChange=this._onChange.event,this._hadFocus=void 0,this._hasDomElementFocus=!1,this._domFocusTracker=this._register(tl(e)),this._overflowWidgetsDomNodeHasFocus=!1,this._register(this._domFocusTracker.onDidFocus((()=>{this._hasDomElementFocus=!0,this._update()}))),this._register(this._domFocusTracker.onDidBlur((()=>{this._hasDomElementFocus=!1,this._update()}))),t&&(this._overflowWidgetsDomNode=this._register(tl(t)),this._register(this._overflowWidgetsDomNode.onDidFocus((()=>{this._overflowWidgetsDomNodeHasFocus=!0,this._update()}))),this._register(this._overflowWidgetsDomNode.onDidBlur((()=>{this._overflowWidgetsDomNodeHasFocus=!1,this._update()}))))}_update(){const e=this._hasDomElementFocus||this._overflowWidgetsDomNodeHasFocus;this._hadFocus!==e&&(this._hadFocus=e,this._onChange.fire(void 0))}hasFocus(){return this._hadFocus??!1}}class tK{constructor(e,t,i,n,o){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=n,this.wrappedTextIndentLength=o}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let i=this.breakOffsets[e]-t;return e>0&&(i+=this.wrappedTextIndentLength),i}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let i=0===e?t:this.breakOffsets[e-1]+t;if(null!==this.injectionOffsets)for(let e=0;e<this.injectionOffsets.length&&i>this.injectionOffsets[e];e++)i<this.injectionOffsets[e]+this.injectionOptions[e].content.length?i=this.injectionOffsets[e]:i-=this.injectionOptions[e].content.length;return i}translateToOutputPosition(e,t=2){let i=e;if(null!==this.injectionOffsets)for(let n=0;n<this.injectionOffsets.length&&!(e<this.injectionOffsets[n])&&(1===t||e!==this.injectionOffsets[n]);n++)i+=this.injectionOptions[n].content.length;return this.offsetInInputWithInjectionsToOutputPosition(i,t)}offsetInInputWithInjectionsToOutputPosition(e,t=2){let i=0,n=this.breakOffsets.length-1,o=0,s=0;for(;i<=n;){o=i+(n-i)/2|0;const r=this.breakOffsets[o];if(s=o>0?this.breakOffsets[o-1]:0,0===t)if(e<=s)n=o-1;else{if(!(e>r))break;i=o+1}else if(e<s)n=o-1;else{if(!(e>=r))break;i=o+1}}let r=e-s;return o>0&&(r+=this.wrappedTextIndentLength),new oK(o,r)}normalizeOutputPosition(e,t,i){if(null!==this.injectionOffsets){const n=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(n,i);if(o!==n)return this.offsetInInputWithInjectionsToOutputPosition(o,i)}if(0===i){if(e>0&&t===this.getMinOutputOffset(e))return new oK(e-1,this.getMaxOutputOffset(e-1))}else if(1===i&&e<this.getOutputLineCount()-1&&t===this.getMaxOutputOffset(e))return new oK(e+1,this.getMinOutputOffset(e+1));return new oK(e,t)}outputPositionToOffsetInInputWithInjections(e,t){return e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(2===t){if(e===i.offsetInInputWithInjections+i.length&&iK(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let e=i.offsetInInputWithInjections;if(nK(this.injectionOptions[i.injectedTextIndex].cursorStops))return e;let t=i.injectedTextIndex-1;for(;t>=0&&this.injectionOffsets[t]===this.injectionOffsets[i.injectedTextIndex]&&!iK(this.injectionOptions[t].cursorStops)&&(e-=this.injectionOptions[t].content.length,!nK(this.injectionOptions[t].cursorStops));)t--;return e}}if(1===t||4===t){let e=i.offsetInInputWithInjections+i.length,t=i.injectedTextIndex;for(;t+1<this.injectionOffsets.length&&this.injectionOffsets[t+1]===this.injectionOffsets[t];)e+=this.injectionOptions[t+1].content.length,t++;return e}if(0===t||3===t){let e=i.offsetInInputWithInjections,t=i.injectedTextIndex;for(;t-1>=0&&this.injectionOffsets[t-1]===this.injectionOffsets[t];)e-=this.injectionOptions[t-1].content.length,t--;return e}nt()}getInjectedText(e,t){const i=this.outputPositionToOffsetInInputWithInjections(e,t),n=this.getInjectedTextAtOffset(i);return n?{options:this.injectionOptions[n.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(null!==t){let n=0;for(let o=0;o<t.length;o++){const s=i[o].content.length,r=t[o]+n,a=t[o]+n+s;if(r>e)break;if(e<=a)return{injectedTextIndex:o,offsetInInputWithInjections:r,length:s};n+=s}}}}function iK(e){return null==e||e===mg.Right||e===mg.Both}function nK(e){return null==e||e===mg.Left||e===mg.Both}class oK{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new rc(e+this.outputLineIndex,this.outputOffset+1)}}const sK=GI("domLineBreaksComputer",{createHTML:e=>e});class rK{static create(e){return new rK(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,i,n,o,s){const r=[],a=[];return{addRequest:(e,t,i)=>{r.push(e),a.push(t)},finalize:()=>function(e,t,i,n,o,s,r,a){function l(e){const i=a[e];if(i){const n=Fx.applyInjectedText(t[e],i),o=i.map((e=>e.options)),s=i.map((e=>e.column-1));return new tK(s,o,[n.length],[],0)}return null}if(-1===o){const e=[];for(let i=0,n=t.length;i<n;i++)e[i]=l(i);return e}const d=Math.round(o*i.typicalHalfwidthCharacterWidth),h=3===s?2:2===s?1:0,c=Math.round(n*h),u=Math.ceil(i.spaceWidth*c),g=document.createElement("div");iT(g,i);const p=new Xg(1e4),m=[],f=[],_=[],v=[],b=[];for(let e=0;e<t.length;e++){const o=Fx.applyInjectedText(t[e],a[e]);let r=0,l=0,h=d;if(0!==s)if(r=$i(o),-1===r)r=0;else{for(let e=0;e<r;e++)l+=9===o.charCodeAt(e)?n-l%n:1;const e=Math.ceil(i.spaceWidth*l);e+i.typicalFullwidthCharacterWidth>d?(r=0,l=0):h=d-e}const c=o.substr(r),g=aK(c,l,n,h,p,u);m[e]=r,f[e]=l,_[e]=c,v[e]=g[0],b[e]=g[1]}const w=p.build(),C=sK?.createHTML(w)??w;g.innerHTML=C,g.style.position="absolute",g.style.top="10000","keepAll"===r?(g.style.wordBreak="keep-all",g.style.overflowWrap="anywhere"):(g.style.wordBreak="inherit",g.style.overflowWrap="break-word"),e.document.body.appendChild(g);const y=document.createRange(),S=Array.prototype.slice.call(g.children,0),x=[];for(let e=0;e<t.length;e++){const t=lK(y,S[e],_[e],v[e]);if(null===t){x[e]=l(e);continue}const i=m[e],n=f[e]+c,o=b[e],s=[];for(let e=0,i=t.length;e<i;e++)s[e]=o[t[e]];if(0!==i)for(let e=0,n=t.length;e<n;e++)t[e]+=i;let r,d;const h=a[e];h?(r=h.map((e=>e.options)),d=h.map((e=>e.column-1))):(r=null,d=null),x[e]=new tK(d,r,t,s,n)}return g.remove(),x}(vt(this.targetWindow.deref()),r,e,t,i,n,o,a)}}}function aK(e,t,i,n,o,s){if(0!==s){const e=String(s);o.appendString('<div style="text-indent: -'),o.appendString(e),o.appendString("px; padding-left: "),o.appendString(e),o.appendString("px; box-sizing: border-box; width:")}else o.appendString('<div style="width:');o.appendString(String(n)),o.appendString('px;">');const r=e.length;let a=t,l=0;const d=[],h=[];let c=0<r?e.charCodeAt(0):0;o.appendString("<span>");for(let t=0;t<r;t++){0!==t&&t%16384==0&&o.appendString("</span><span>"),d[t]=l,h[t]=a;const n=c;c=t+1<r?e.charCodeAt(t+1):0;let s=1,u=1;switch(n){case 9:s=i-a%i,u=s;for(let e=1;e<=s;e++)e<s?o.appendCharCode(160):o.appendASCIICharCode(32);break;case 32:32===c?o.appendCharCode(160):o.appendASCIICharCode(32);break;case 60:o.appendString("<");break;case 62:o.appendString(">");break;case 38:o.appendString("&");break;case 0:o.appendString("�");break;case 65279:case 8232:case 8233:case 133:o.appendCharCode(65533);break;default:yn(n)&&u++,n<32?o.appendCharCode(9216+n):o.appendCharCode(n)}l+=s,a+=u}return o.appendString("</span>"),d[e.length]=l,h[e.length]=a,o.appendString("</div>"),[d,h]}function lK(e,t,i,n){if(i.length<=1)return null;const o=Array.prototype.slice.call(t.children,0),s=[];try{dK(e,o,n,0,null,i.length-1,null,s)}catch(e){return console.log(e),null}return 0===s.length?null:(s.push(i.length),s)}function dK(e,t,i,n,o,s,r,a){if(n===s)return;if(o=o||hK(e,t,i[n],i[n+1]),r=r||hK(e,t,i[s],i[s+1]),Math.abs(o[0].top-r[0].top)<=.1)return;if(n+1===s)return void a.push(s);const l=n+(s-n)/2|0,d=hK(e,t,i[l],i[l+1]);dK(e,t,i,n,o,l,d,a),dK(e,t,i,l,d,s,r,a)}function hK(e,t,i,n){return e.setStart(t[i/16384|0].firstChild,i%16384),e.setEnd(t[n/16384|0].firstChild,n%16384),e.getClientRects()}class cK extends At{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new Ft),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const e of t)this._pending.has(e.id)?Ie(new Error(`Cannot have two contributions with the same id ${e.id}`)):this._pending.set(e.id,e);this._instantiateSome(0),this._register(va(ta(this._editor.getDomNode()),(()=>{this._instantiateSome(1)}))),this._register(va(ta(this._editor.getDomNode()),(()=>{this._instantiateSome(2)}))),this._register(va(ta(this._editor.getDomNode()),(()=>{this._instantiateSome(3)}),5e3))}saveViewState(){const e={};for(const[t,i]of this._instances)"function"==typeof i.saveViewState&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(const[t,i]of this._instances)"function"==typeof i.restoreViewState&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){return va(ta(this._editor?.getDomNode()),(()=>{this._instantiateSome(1)}),50)}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const e of t)this._instantiateById(e.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const e=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,e),"function"==typeof e.restoreViewState&&0!==t.instantiation&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(e){Ie(e)}}}}class uK{constructor(e,t,i,n,o,s,r){this.id=e,this.label=t,this.alias=i,this.metadata=n,this._precondition=o,this._run=s,this._contextKeyService=r}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}const gK={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"};class pK{static create(e){return new pK(e.get(151),e.get(150))}constructor(e,t){this.classifier=new mK(e,t)}createLineBreaksComputer(e,t,i,n,o,s){const r=[],a=[],l=[];return{addRequest:(e,t,i)=>{r.push(e),a.push(t),l.push(i)},finalize:()=>{const d=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,h=[];for(let e=0,c=r.length;e<c;e++){const c=a[e],u=l[e];!u||u.injectionOptions||c||s?h[e]=bK(this.classifier,r[e],c,t,i,d,n,o,s):h[e]=vK(this.classifier,u,r[e],t,i,d,n,o)}return fK.length=0,_K.length=0,h}}}}class mK extends zy{constructor(e,t){super(0);for(let t=0;t<e.length;t++)this.set(e.charCodeAt(t),1);for(let e=0;e<t.length;e++)this.set(t.charCodeAt(e),2)}get(e){return e>=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let fK=[],_K=[];function vK(e,t,i,n,o,s,r,a){if(-1===o)return null;const l=i.length;if(l<=1)return null;const d="keepAll"===a,h=t.breakOffsets,c=t.breakOffsetsVisibleColumn,u=xK(i,n,o,s,r),g=o-u,p=fK,m=_K;let f=0,_=0,v=0,b=o;const w=h.length;let C=0;if(C>=0){let e=Math.abs(c[C]-b);for(;C+1<w;){const t=Math.abs(c[C+1]-b);if(t>=e)break;e=t,C++}}for(;C<w;){let t=C<0?0:h[C],o=C<0?0:c[C];_>t&&(t=_,o=v);let r=0,a=0,u=0,y=0;if(o<=b){let v=o,w=0===t?0:i.charCodeAt(t-1),C=0===t?0:e.get(w),S=!0;for(let o=t;o<l;o++){const t=o,l=i.charCodeAt(o);let h,c;if(ln(l)?(o++,h=0,c=2):(h=e.get(l),c=wK(l,v,n,s)),t>_&&SK(0,C,l,h,d)&&(r=t,a=v),v+=c,v>b){t>_?(u=t,y=v-c):(u=o+1,y=v),v-a>g&&(r=0),S=!1;break}w=l,C=h}if(S){f>0&&(p[f]=h[h.length-1],m[f]=c[h.length-1],f++);break}}if(0===r){let l=o,h=i.charCodeAt(t),c=e.get(h),p=!1;for(let n=t-1;n>=_;n--){const t=n+1,o=i.charCodeAt(n);if(9===o){p=!0;break}let m,f;if(dn(o)?(n--,m=0,f=2):(m=e.get(o),f=yn(o)?s:1),l<=b){if(0===u&&(u=t,y=l),l<=b-g)break;if(SK(0,m,h,c,d)){r=t,a=l;break}}l-=f,h=o,c=m}if(0!==r){const e=g-(y-a);if(e<=n){const t=i.charCodeAt(u);let o;o=ln(t)?2:wK(t,y,n,s),e-o<0&&(r=0)}}if(p){C--;continue}}if(0===r&&(r=u,a=y),r<=_){const e=i.charCodeAt(_);ln(e)?(r=_+2,a=v+2):(r=_+1,a=v+wK(e,v,n,s))}for(_=r,p[f]=r,v=a,m[f]=a,f++,b=a+g;C<0||C<w&&c[C]<a;)C++;let S=Math.abs(c[C]-b);for(;C+1<w;){const e=Math.abs(c[C+1]-b);if(e>=S)break;S=e,C++}}return 0===f?null:(p.length=f,m.length=f,fK=t.breakOffsets,_K=t.breakOffsetsVisibleColumn,t.breakOffsets=p,t.breakOffsetsVisibleColumn=m,t.wrappedTextIndentLength=u,t)}function bK(e,t,i,n,o,s,r,a,l){const d=Fx.applyInjectedText(t,i);let h,c;if(i&&i.length>0?(h=i.map((e=>e.options)),c=i.map((e=>e.column-1))):(h=null,c=null),-1===o)return h?new tK(c,h,[d.length],[],0):null;const u=d.length;if(u<=1)return h?new tK(c,h,[d.length],[],0):null;const g="keepAll"===a,p=xK(d,n,o,s,r),m=o-p,f=[],_=[];let v=0,b=0,w=0,C=o,y=d.charCodeAt(0),S=e.get(y),x=wK(y,0,n,s),k=1;ln(y)&&(x+=1,y=d.charCodeAt(1),S=e.get(y),k++);for(let t=k;t<u;t++){const i=t,o=d.charCodeAt(t);let r,a;ln(o)?(t++,r=0,a=2):(r=e.get(o),a=wK(o,x,n,s)),SK(0,S,o,r,g)&&(b=i,w=x),x+=a,l&&yK(d,t)&&(x+=C),x>C&&((0===b||x-w>m)&&(b=i,w=x-a),f[v]=b,_[v]=w,v++,C=w+m,b=0),y=o,S=r}return 0!==v||i&&0!==i.length?(f[v]=u,_[v]=x,new tK(c,h,f,_,p)):null}function wK(e,t,i,n){return 9===e?i-t%i:yn(e)||e<32?n:1}function CK(e,t){return t-e%t}function yK(e,t){return t>=2&&(t<3||"\\"!==e.charAt(t-3))&&"\\"===e.charAt(t-2)&&"n"===e.charAt(t-1)&&e.includes('"')}function SK(e,t,i,n,o){return 32!==i&&(2===t&&2!==n||1!==t&&1===n||!o&&3===t&&2!==n||!o&&3===n&&1!==t)}function xK(e,t,i,n,o){let s=0;if(0!==o){const r=$i(e);if(-1!==r){for(let i=0;i<r;i++)s+=9===e.charCodeAt(i)?CK(s,t):1;const a=3===o?2:2===o?1:0;for(let e=0;e<a;e++)s+=CK(s,t);s+n>i&&(s=0)}}return s}class kK{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new Fk(new Yu(1,1,1,1),0,0,new rc(1,1),0),new Fk(new Yu(1,1,1,1),0,0,new rc(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new Rk(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?Qu.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):Qu.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,n){return t.equals(i)?n:e.normalizePosition(t,2)}static _validateViewState(e,t){const i=t.position,n=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),s=e.normalizePosition(i,2),r=this._validatePositionWithCache(e,n,i,s),a=this._validatePositionWithCache(e,o,n,r);return i.equals(s)&&n.equals(r)&&o.equals(a)?t:new Fk(Yu.fromPositions(r,a),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+n.column-r.column,s,t.leftoverVisibleColumns+i.column-s.column)}_setState(e,t,i){if(i&&(i=kK._validateViewState(e.viewModel,i)),t){const i=e.model.validateRange(t.selectionStart),n=t.selectionStart.equalsRange(i)?t.selectionStartLeftoverVisibleColumns:0,o=e.model.validatePosition(t.position),s=t.position.equals(o)?t.leftoverVisibleColumns:0;t=new Fk(i,t.selectionStartKind,n,o,s)}else{if(!i)return;const n=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new Fk(n,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){const n=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new Fk(n,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const n=e.coordinatesConverter.convertModelPositionToViewPosition(new rc(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new rc(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),s=new Yu(n.lineNumber,n.column,o.lineNumber,o.column),r=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new Fk(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,r,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class LK{constructor(e){this.context=e,this.cursors=[new kK(e)],this.lastAddedCursorIndex=0}dispose(){for(const e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(const e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(const e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(const e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map((e=>e.readSelectionFromMarkers(this.context)))}getAll(){return this.cursors.map((e=>e.asCursorState()))}getViewPositions(){return this.cursors.map((e=>e.viewState.position))}getTopMostViewPosition(){return wm(this.cursors,Cs((e=>e.viewState.position),rc.compare)).viewState.position}getBottomMostViewPosition(){return bm(this.cursors,Cs((e=>e.viewState.position),rc.compare)).viewState.position}getSelections(){return this.cursors.map((e=>e.modelState.selection))}getViewSelections(){return this.cursors.map((e=>e.viewState.selection))}setSelections(e){this.setStates(Rk.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){null!==e&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.cursors.length-1,i=e.length;if(t<i){const e=i-t;for(let t=0;t<e;t++)this._addSecondaryCursor()}else if(t>i){const e=t-i;for(let t=0;t<e;t++)this._removeSecondaryCursor(this.cursors.length-2)}for(let t=0;t<i;t++)this.cursors[t+1].setState(this.context,e[t].modelState,e[t].viewState)}killSecondaryCursors(){this._setSecondaryStates([])}_addSecondaryCursor(){this.cursors.push(new kK(this.context)),this.lastAddedCursorIndex=this.cursors.length-1}getLastAddedCursorIndex(){return 1===this.cursors.length||0===this.lastAddedCursorIndex?0:this.lastAddedCursorIndex}_removeSecondaryCursor(e){this.lastAddedCursorIndex>=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(1===this.cursors.length)return;const e=this.cursors.slice(0),t=[];for(let i=0,n=e.length;i<n;i++)t.push({index:i,selection:e[i].modelState.selection});t.sort(Cs((e=>e.selection),Yu.compareRangesUsingStarts));for(let i=0;i<t.length-1;i++){const n=t[i],o=t[i+1],s=n.selection,r=o.selection;if(!this.context.cursorConfig.multiCursorMergeOverlapping)continue;let a;if(a=r.isEmpty()||s.isEmpty()?r.getStartPosition().isBeforeOrEqual(s.getEndPosition()):r.getStartPosition().isBefore(s.getEndPosition()),a){const s=n.index<o.index?i:i+1,r=n.index<o.index?i+1:i,a=t[r].index,l=t[s].index,d=t[r].selection,h=t[s].selection;if(!d.equalsSelection(h)){const i=d.plusRange(h),n=d.selectionStartLineNumber===d.startLineNumber&&d.selectionStartColumn===d.startColumn,o=h.selectionStartLineNumber===h.startLineNumber&&h.selectionStartColumn===h.startColumn;let r,c;a===this.lastAddedCursorIndex?(r=n,this.lastAddedCursorIndex=l):r=o,c=r?new Qu(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn):new Qu(i.endLineNumber,i.endColumn,i.startLineNumber,i.startColumn),t[s].selection=c;const u=Rk.fromModelSelection(c);e[l].setState(this.context,u.modelState,u.viewState)}for(const e of t)e.index>a&&e.index--;e.splice(a,1),t.splice(r,1),this._removeSecondaryCursor(a-1),i--}}}}class DK{constructor(e,t,i,n){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=n}}class EK{constructor(){this.type=0}}class NK{constructor(){this.type=1}}class IK{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class TK{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}}class MK{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin,this.affectsLineNumber=e.affectsLineNumber):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0,this.affectsLineNumber=!0)}}class AK{constructor(){this.type=5}}class RK{constructor(e){this.type=6,this.isFocused=e}}class OK{constructor(){this.type=7}}class PK{constructor(){this.type=8}}class FK{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class BK{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class WK{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class VK{constructor(e,t,i,n,o,s,r){this.source=e,this.minimalReveal=t,this.range=i,this.selections=n,this.verticalType=o,this.revealHorizontal=s,this.scrollType=r,this.type=12}}class HK{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class zK{constructor(e){this.theme=e,this.type=14}}class UK{constructor(e){this.type=15,this.ranges=e}}class KK{constructor(){this.type=16}}class jK{constructor(){this.type=17}}class qK extends At{constructor(){super(),this._onEvent=this._register(new Zt),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t<i;t++){const i=this._outgoingEvents[t].kind===e.kind?this._outgoingEvents[t].attemptToMerge(e):null;if(i)return void(this._outgoingEvents[t]=i)}this._outgoingEvents.push(e)}_emitOutgoingEvents(){for(;this._outgoingEvents.length>0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t<i;t++)this._eventHandlers[t]===e&&console.warn("Detected duplicate listener in ViewEventDispatcher",e);this._eventHandlers.push(e)}removeViewEventHandler(e){for(let t=0;t<this._eventHandlers.length;t++)if(this._eventHandlers[t]===e){this._eventHandlers.splice(t,1);break}}beginEmitViewEvents(){return this._collectorCnt++,1===this._collectorCnt&&(this._collector=new $K),this._collector}endEmitViewEvents(){if(this._collectorCnt--,0===this._collectorCnt){const e=this._collector.outgoingEvents,t=this._collector.viewEvents;this._collector=null;for(const t of e)this._addOutgoingEvent(t);t.length>0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class $K{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class GK{constructor(e,t,i,n){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=n,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new GK(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class ZK{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new ZK(this.oldHasFocus,e.hasFocus)}}class YK{constructor(e,t){this.kind=2,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new ZK(this.oldHasFocus,e.hasFocus)}}class QK{constructor(e,t,i,n,o,s,r,a){this.kind=3,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,this.scrollWidth=o,this.scrollLeft=s,this.scrollHeight=r,this.scrollTop=a,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!(this.scrollWidthChanged||this.scrollLeftChanged||this.scrollHeightChanged||this.scrollTopChanged)}attemptToMerge(e){return e.kind!==this.kind?null:new QK(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class XK{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class JK{constructor(){this.kind=5}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class ej{constructor(e,t,i,n,o,s,r){this.kind=7,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,this.source=o,this.reason=s,this.reachedMaxCursorCount=r}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(!e[n].equalsSelection(t[n]))return!1;return!0}isNoOp(){return ej._selectionsAreEqual(this.oldSelections,this.selections)&&this.oldModelVersionId===this.modelVersionId}attemptToMerge(e){return e.kind!==this.kind?null:new ej(this.oldSelections,e.selections,this.oldModelVersionId,e.modelVersionId,e.source,e.reason,this.reachedMaxCursorCount||e.reachedMaxCursorCount)}}class tj{constructor(){this.kind=6}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class ij{constructor(e){this.event=e,this.kind=8}isNoOp(){return!1}attemptToMerge(e){return null}}class nj{constructor(e){this.event=e,this.kind=9}isNoOp(){return!1}attemptToMerge(e){return null}}class oj{constructor(e){this.event=e,this.kind=10}isNoOp(){return!1}attemptToMerge(e){return null}}class sj{constructor(e){this.event=e,this.kind=11}isNoOp(){return!1}attemptToMerge(e){return null}}class rj{constructor(e){this.event=e,this.kind=12}isNoOp(){return!1}attemptToMerge(e){return null}}class aj{constructor(e){this.event=e,this.kind=13}isNoOp(){return!1}attemptToMerge(e){return null}}class lj{constructor(e){this.event=e,this.kind=14}isNoOp(){return!1}attemptToMerge(e){return null}}class dj{constructor(e){this.event=e,this.kind=15}isNoOp(){return!1}attemptToMerge(e){return null}}class hj extends At{constructor(e,t,i,n){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=i,this.context=new DK(this._model,this._viewModel,this._coordinatesConverter,n),this._cursors=new LK(this.context),this._hasFocus=!1,this._isHandling=!1,this._compositionState=null,this._columnSelectData=null,this._autoClosedActions=[],this._prevEditOperationType=0}dispose(){this._cursors.dispose(),this._autoClosedActions=Et(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new DK(this._model,this._viewModel,this._coordinatesConverter,e),this._cursors.updateContext(this.context)}onLineMappingChanged(e){this._knownModelVersionId===this._model.getVersionId()&&this.setStates(e,"viewModel",0,this.getCursorStates())}setHasFocus(e){this._hasFocus=e}_validateAutoClosedActions(){if(this._autoClosedActions.length>0){const e=this._cursors.getSelections();for(let t=0;t<this._autoClosedActions.length;t++){const i=this._autoClosedActions[t];i.isValid(e)||(i.dispose(),this._autoClosedActions.splice(t,1),t--)}}}getPrimaryCursorState(){return this._cursors.getPrimaryCursor()}getLastAddedCursorIndex(){return this._cursors.getLastAddedCursorIndex()}getCursorStates(){return this._cursors.getAll()}setStates(e,t,i,n){let o=!1;const s=this.context.cursorConfig.multiCursorLimit;null!==n&&n.length>s&&(n=n.slice(0,s),o=!0);const r=cj.from(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,r,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealAll(e,t,i,n,o,s){const r=this._cursors.getViewPositions();let a=null,l=null;r.length>1?l=this._cursors.getViewSelections():a=Yu.fromPositions(r[0],r[0]),e.emitViewEvent(new VK(t,i,a,l,n,o,s))}revealPrimary(e,t,i,n,o,s){const r=[this._cursors.getPrimaryCursor().viewState.selection];e.emitViewEvent(new VK(t,i,null,r,n,o,s))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,n=t.length;i<n;i++){const n=t[i];e.push({inSelectionMode:!n.isEmpty(),selectionStart:{lineNumber:n.selectionStartLineNumber,column:n.selectionStartColumn},position:{lineNumber:n.positionLineNumber,column:n.positionColumn}})}return e}restoreState(e,t){const i=[];for(let e=0,n=t.length;e<n;e++){const n=t[e];let o=1,s=1;n.position&&n.position.lineNumber&&(o=n.position.lineNumber),n.position&&n.position.column&&(s=n.position.column);let r=o,a=s;n.selectionStart&&n.selectionStart.lineNumber&&(r=n.selectionStart.lineNumber),n.selectionStart&&n.selectionStart.column&&(a=n.selectionStart.column),i.push({selectionStartLineNumber:r,selectionStartColumn:a,positionLineNumber:o,positionColumn:s})}this.setStates(e,"restoreState",0,Rk.fromModelSelections(i)),this.revealAll(e,"restoreState",!1,0,!0,1)}onModelContentChanged(e,t){if(t instanceof jx){if(this._isHandling)return;this._isHandling=!0;try{this.setStates(e,"modelChange",0,this.getCursorStates())}finally{this._isHandling=!1}}else{const i=t.rawContentChangedEvent;if(this._knownModelVersionId=i.versionId,this._isHandling)return;const n=i.containsEvent(1);if(this._prevEditOperationType=0,n)this._cursors.dispose(),this._cursors=new LK(this.context),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,"model",1,null,!1);else if(this._hasFocus&&i.resultingSelection&&i.resultingSelection.length>0){const t=Rk.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?5:i.isRedoing?6:2,t)&&this.revealAll(e,"modelChange",!1,0,!0,0)}else{const t=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,Rk.fromModelSelections(t))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,n){this.setStates(e,t,n,Rk.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],n=[];for(let o=0,s=e.length;o<s;o++)i.push({range:e[o],options:{description:"auto-closed-character",inlineClassName:"auto-closed-character",stickiness:1}}),n.push({range:t[o],options:{description:"auto-closed-enclosing",stickiness:1}});const o=this._model.deltaDecorations([],i),s=this._model.deltaDecorations([],n);this._autoClosedActions.push(new uj(this._model,o,s))}_executeEditOperation(e,t){if(!e)return;e.shouldPushStackElementBefore&&this._model.pushStackElement();const i=gj.executeCommands(this._model,this._cursors.getSelections(),e.commands,t);if(i){this._interpretCommandResult(i);const t=[],n=[];for(let i=0;i<e.commands.length;i++){const o=e.commands[i];o instanceof TL&&o.enclosingRange&&o.closeCharacterRange&&(t.push(o.closeCharacterRange),n.push(o.enclosingRange))}t.length>0&&this._pushAutoClosedAction(t,n),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){e&&0!==e.length||(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,n,o){const s=cj.from(this._model,this);if(s.equals(n))return!1;const r=this._cursors.getSelections(),a=this._cursors.getViewSelections();if(e.emitViewEvent(new TK(a,r,i)),!n||n.cursorState.length!==s.cursorState.length||s.cursorState.some(((e,t)=>!e.modelState.equals(n.cursorState[t].modelState)))){const a=n?n.cursorState.map((e=>e.modelState.selection)):null,l=n?n.modelVersionId:0;e.emitOutgoingEvent(new ej(a,r,l,s.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];if(!n.text||n.text.indexOf("\n")>=0)return null;const o=n.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!o)return null;const s=o[1],r=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(s);if(!r||1!==r.length)return null;const a=r[0].open,l=n.text.length-o[2].length-1,d=n.text.lastIndexOf(a,l-1);if(-1===d)return null;t.push([d,l])}return t}executeEdits(e,t,i,n,o){let s=null;"snippet"===t&&(s=this._findAutoClosingPairs(i)),s&&(i[0]._isTracked=!0);const r=[],a=[],l=this._model.pushEditOperations(this.getSelections(),i,(e=>{if(s)for(let t=0,i=s.length;t<i;t++){const[i,n]=s[t],o=e[t],l=o.range.startLineNumber,d=o.range.startColumn-1+i,h=o.range.startColumn-1+n;r.push(new Yu(l,h+1,l,h+2)),a.push(new Yu(l,d+1,l,h+2))}const t=n(e);return t&&(this._isHandling=!0),t}),void 0,o);l&&(this._isHandling=!1,this.setSelections(e,t,l,0)),r.length>0&&this._pushAutoClosedAction(r,a)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const o=cj.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(e){Ie(e)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,o,!1)&&this.revealAll(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return uj.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new mj(this._model,this.getSelections())}endComposition(e,t){const i=LC({kind:"compositionEnd",detailedSource:t}),n=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit((()=>{"keyboard"===t&&this._executeEditOperation(UL.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,n,this.getSelections(),this.getAutoClosedCharacters()),i)}),e,t)}type(e,t,i){const n=LC({kind:"type",detailedSource:i});this._executeEdit((()=>{if("keyboard"===i){const e=t.length;let i=0;for(;i<e;){const e=pn(t,i),o=t.substr(i,e);this._executeEditOperation(UL.typeWithInterceptors(!!this._compositionState,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),o),n),i+=e}}else this._executeEditOperation(UL.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t),n)}),e,i)}compositionType(e,t,i,n,o,s){const r=LC({kind:"compositionType",detailedSource:s});if(0!==t.length||0!==i||0!==n)this._executeEdit((()=>{this._executeEditOperation(UL.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,o),r)}),e,s);else if(0!==o){const t=this.getSelections().map((e=>{const t=e.getPosition();return new Qu(t.lineNumber,t.column+o,t.lineNumber,t.column+o)}));this.setSelections(e,s,t,0)}}paste(e,t,i,n,o){const s=LC({kind:"paste",detailedSource:o});this._executeEdit((()=>{this._executeEditOperation(UL.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]),s)}),e,o,4)}cut(e,t){const i=LC({kind:"cut",detailedSource:t});this._executeEdit((()=>{this._executeEditOperation(Xk.cut(this.context.cursorConfig,this._model,this.getSelections()),i)}),e,t)}executeCommand(e,t,i){const n=LC({kind:"executeCommand",detailedSource:i});this._executeEdit((()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Bk(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}),n)}),e,i)}executeCommands(e,t,i){const n=LC({kind:"executeCommands",detailedSource:i});this._executeEdit((()=>{this._executeEditOperation(new Bk(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}),n)}),e,i)}}class cj{static from(e,t){return new cj(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e)return!1;if(this.modelVersionId!==e.modelVersionId)return!1;if(this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t<i;t++)if(!this.cursorState[t].equals(e.cursorState[t]))return!1;return!0}}class uj{static getAllAutoClosedCharacters(e){let t=[];for(const i of e)t=t.concat(i.getAutoClosedCharactersRanges());return t}constructor(e,t,i){this._model=e,this._autoClosedCharactersDecorations=t,this._autoClosedEnclosingDecorations=i}dispose(){this._autoClosedCharactersDecorations=this._model.deltaDecorations(this._autoClosedCharactersDecorations,[]),this._autoClosedEnclosingDecorations=this._model.deltaDecorations(this._autoClosedEnclosingDecorations,[])}getAutoClosedCharactersRanges(){const e=[];for(let t=0;t<this._autoClosedCharactersDecorations.length;t++){const i=this._model.getDecorationRange(this._autoClosedCharactersDecorations[t]);i&&e.push(i)}return e}isValid(e){const t=[];for(let e=0;e<this._autoClosedEnclosingDecorations.length;e++){const i=this._model.getDecorationRange(this._autoClosedEnclosingDecorations[e]);if(i&&(t.push(i),i.startLineNumber!==i.endLineNumber))return!1}t.sort(Yu.compareRangesUsingStarts),e.sort(Yu.compareRangesUsingStarts);for(let i=0;i<e.length;i++){if(i>=t.length)return!1;if(!t[i].strictContainsRange(e[i]))return!1}return!0}}class gj{static executeCommands(e,t,i,n=yC({name:"executeCommands"})){const o={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},s=this._innerExecuteCommands(o,i,n);for(let e=0,t=o.trackedRanges.length;e<t;e++)o.model._setTrackedRange(o.trackedRanges[e],null,0);return s}static _innerExecuteCommands(e,t,i){if(this._arrayIsEmpty(t))return null;const n=this._getEditOperations(e,t);if(0===n.operations.length)return null;const o=n.operations,s=this._getLoserCursorMap(o);if(s.hasOwnProperty("0"))return console.warn("Ignoring commands"),null;const r=[];for(let e=0,t=o.length;e<t;e++)s.hasOwnProperty(o[e].identifier.major.toString())||r.push(o[e]);n.hadTrackedEditOperation&&r.length>0&&(r[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,r,(i=>{const n=[];for(let t=0;t<e.selectionsBefore.length;t++)n[t]=[];for(const e of i)e.identifier&&n[e.identifier.major].push(e);const o=(e,t)=>e.identifier.minor-t.identifier.minor,s=[];for(let i=0;i<e.selectionsBefore.length;i++)n[i].length>0?(n[i].sort(o),s[i]=t[i].computeCursorState(e.model,{getInverseEditOperations:()=>n[i],getTrackedSelection:t=>{const i=parseInt(t,10),n=e.model._getTrackedRange(e.trackedRanges[i]);return 0===e.trackedRangesDirection[i]?new Qu(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn):new Qu(n.endLineNumber,n.endColumn,n.startLineNumber,n.startColumn)}})):s[i]=e.selectionsBefore[i];return s}),void 0,i);a||(a=e.selectionsBefore);const l=[];for(const e in s)s.hasOwnProperty(e)&&l.push(parseInt(e,10));l.sort(((e,t)=>t-e));for(const e of l)a.splice(e,1);return a}static _arrayIsEmpty(e){for(let t=0,i=e.length;t<i;t++)if(e[t])return!1;return!0}static _getEditOperations(e,t){let i=[],n=!1;for(let o=0,s=t.length;o<s;o++){const s=t[o];if(s){const t=this._getEditOperationsFromCommand(e,o,s);i=i.concat(t.operations),n=n||t.hadTrackedEditOperation}}return{operations:i,hadTrackedEditOperation:n}}static _getEditOperationsFromCommand(e,t,i){const n=[];let o=0;const s=(e,s,r=!1)=>{Yu.isEmpty(e)&&""===s||n.push({identifier:{major:t,minor:o++},range:e,text:s,forceMoveMarkers:r,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let r=!1;const a={addEditOperation:s,addTrackedEditOperation:(e,t,i)=>{r=!0,s(e,t,i)},trackSelection:(t,i)=>{const n=Qu.liftSelection(t);let o;if(n.isEmpty())if("boolean"==typeof i)o=i?2:3;else{const t=e.model.getLineMaxColumn(n.startLineNumber);o=n.startColumn===t?2:3}else o=1;const s=e.trackedRanges.length,r=e.model._setTrackedRange(null,n,o);return e.trackedRanges[s]=r,e.trackedRangesDirection[s]=n.getDirection(),s.toString()}};try{i.getEditOperations(e.model,a)}catch(e){return Ie(e),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:r}}static _getLoserCursorMap(e){(e=e.slice(0)).sort(((e,t)=>-Yu.compareRangesUsingEnds(e.range,t.range)));const t={};for(let i=1;i<e.length;i++){const n=e[i-1],o=e[i];if(Yu.getStartPosition(n.range).isBefore(Yu.getEndPosition(o.range))){let s;s=n.identifier.major>o.identifier.major?n.identifier.major:o.identifier.major,t[s.toString()]=!0;for(let t=0;t<e.length;t++)e[t].identifier.major===s&&(e.splice(t,1),t<i&&i--,t--);i>0&&i--}}return t}}class pj{constructor(e,t,i,n){this.text=e,this.lineNumber=t,this.startSelectionOffset=i,this.endSelectionOffset=n}}class mj{static _capture(e,t){const i=[];for(const n of t){if(n.startLineNumber!==n.endLineNumber)return null;const t=n.startLineNumber;i.push(new pj(e.getLineContent(t),t,n.startColumn-1,n.endColumn-1))}return i}constructor(e,t){this._original=mj._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=mj._capture(e,t);if(!i)return null;if(this._original.length!==i.length)return null;const n=[];for(let e=0,t=this._original.length;e<t;e++)n.push(mj._deduceOutcome(this._original[e],i[e]));return n}static _deduceOutcome(e,t){const i=Math.min(e.startSelectionOffset,t.startSelectionOffset,rn(e.text,t.text)),n=Math.min(e.text.length-e.endSelectionOffset,t.text.length-t.endSelectionOffset,an(e.text,t.text)),o=e.text.substring(i,e.text.length-n),s=i,r=t.text.length-n,a=t.text.substring(s,r),l=new Yu(t.lineNumber,s+1,t.lineNumber,r+1);return new KL(o,e.startSelectionOffset-i,e.endSelectionOffset-i,a,t.startSelectionOffset-i,t.endSelectionOffset-i,l)}}class fj{constructor(e,t,i,n,o){this.decorationId=e,this.index=t,this.lineNumber=i,this.specialHeight=n,this.prefixSum=o,this.maximumSpecialHeight=n,this.deleted=!1}}class _j{constructor(e,t){if(this._decorationIDToCustomLine=new vj,this._orderedCustomLines=[],this._pendingSpecialLinesToInsert=[],this._invalidIndex=0,this._hasPending=!1,this._defaultLineHeight=e,t.length>0){for(const e of t)this.insertOrChangeCustomLineHeight(e.decorationId,e.startLineNumber,e.endLineNumber,e.lineHeight);this.commit()}}set defaultLineHeight(e){this._defaultLineHeight=e}get defaultLineHeight(){return this._defaultLineHeight}removeCustomLineHeight(e){const t=this._decorationIDToCustomLine.get(e);if(t){this._decorationIDToCustomLine.delete(e);for(const e of t)e.deleted=!0,this._invalidIndex=Math.min(this._invalidIndex,e.index);this._hasPending=!0}}insertOrChangeCustomLineHeight(e,t,i,n){this.removeCustomLineHeight(e);for(let o=t;o<=i;o++){const t=new fj(e,-1,o,n,0);this._pendingSpecialLinesToInsert.push(t)}this._hasPending=!0}heightForLineNumber(e){const t=this._binarySearchOverOrderedCustomLinesArray(e);return t>=0?this._orderedCustomLines[t].maximumSpecialHeight:this._defaultLineHeight}getAccumulatedLineHeightsIncludingLineNumber(e){const t=this._binarySearchOverOrderedCustomLinesArray(e);if(t>=0)return this._orderedCustomLines[t].prefixSum+this._orderedCustomLines[t].maximumSpecialHeight;if(-1===t)return this._defaultLineHeight*e;const i=-(t+1),n=this._orderedCustomLines[i-1];return n.prefixSum+n.maximumSpecialHeight+this._defaultLineHeight*(e-n.lineNumber)}onLinesDeleted(e,t){const i=t-e+1,n=this._orderedCustomLines.length,o=this._binarySearchOverOrderedCustomLinesArray(e);let s;if(o>=0){s=o;for(let t=o-1;t>=0&&this._orderedCustomLines[t].lineNumber===e;t--)s--}else s=o===-(n+1)&&-1!==o?n-1:-(o+1);const r=this._binarySearchOverOrderedCustomLinesArray(t);let a;if(r>=0){a=r;for(let e=r+1;e<n&&this._orderedCustomLines[e].lineNumber===t;e++)a++}else a=r===-(n+1)&&-1!==r?n-1:-(r+1);const l=a>s,d=a===s&&this._orderedCustomLines[s]&&this._orderedCustomLines[s].lineNumber>=e&&this._orderedCustomLines[s].lineNumber<=t;if(l||d){let n=0;for(let e=s;e<=a;e++)n=Math.max(n,this._orderedCustomLines[e].maximumSpecialHeight);let o=0;if(s>0){const t=this._orderedCustomLines[s-1];o=t.prefixSum+t.maximumSpecialHeight+this._defaultLineHeight*(e-t.lineNumber-1)}else o=e>0?(e-1)*this._defaultLineHeight:0;const r=this._orderedCustomLines[s],l=this._orderedCustomLines[a],d=this._orderedCustomLines[a+1],h=d&&d.lineNumber===t+1?d.maximumSpecialHeight:this._defaultLineHeight,c=l.prefixSum+l.maximumSpecialHeight-r.prefixSum+this._defaultLineHeight*(t-l.lineNumber)+this._defaultLineHeight*(r.lineNumber-e)+h-n,u=new Set,g=[],p=new vj;let m=0;for(let t=0;t<this._orderedCustomLines.length;t++){const r=this._orderedCustomLines[t];if(t<s)g.push(r),p.add(r.decorationId,r);else if(t>=s&&t<=a){const t=r.decorationId;u.has(t)?m++:(r.index-=m,r.lineNumber=e,r.prefixSum=o,r.maximumSpecialHeight=n,g.push(r),p.add(r.decorationId,r))}else t>a&&(r.index-=m,r.lineNumber-=i,r.prefixSum-=c,g.push(r),p.add(r.decorationId,r));u.add(r.decorationId)}this._orderedCustomLines=g,this._decorationIDToCustomLine=p}else{const e=i*this._defaultLineHeight;for(let n=a;n<this._orderedCustomLines.length;n++){const o=this._orderedCustomLines[n];o.lineNumber>t&&(o.lineNumber-=i,o.prefixSum-=e)}}}onLinesInserted(e,t){const i=t-e+1,n=this._binarySearchOverOrderedCustomLinesArray(e);let o;if(n>=0){o=n;for(let t=n-1;t>=0&&this._orderedCustomLines[t].lineNumber===e;t--)o--}else o=-(n+1);const s=[],r=new Set;for(let t=o;t<this._orderedCustomLines.length;t++)this._orderedCustomLines[t].lineNumber===e&&r.add(this._orderedCustomLines[t].decorationId);const a=new Set;for(let t=o-1;t>=0;t--)this._orderedCustomLines[t].lineNumber===e-1&&a.add(this._orderedCustomLines[t].decorationId);const l=ek(a,r);for(let e=o;e<this._orderedCustomLines.length;e++)this._orderedCustomLines[e].lineNumber+=i,this._orderedCustomLines[e].prefixSum+=this._defaultLineHeight*i;if(l.size>0){for(const t of l){const i=this._decorationIDToCustomLine.get(t);if(i){const n=i.reduce(((e,t)=>Math.min(e,t.lineNumber)),e),o=i.reduce(((e,t)=>Math.max(e,t.lineNumber)),e),r=i.reduce(((e,t)=>Math.max(e,t.specialHeight)),0);s.push({decorationId:t,startLineNumber:n,endLineNumber:o,lineHeight:r})}}for(const e of s)this.insertOrChangeCustomLineHeight(e.decorationId,e.startLineNumber,e.endLineNumber,e.lineHeight);this.commit()}}commit(){if(!this._hasPending)return;for(const e of this._pendingSpecialLinesToInsert){const t=this._binarySearchOverOrderedCustomLinesArray(e.lineNumber),i=t>=0?t:-(t+1);this._orderedCustomLines.splice(i,0,e),this._invalidIndex=Math.min(this._invalidIndex,i)}this._pendingSpecialLinesToInsert=[];const e=new vj,t=[];for(let i=0;i<this._invalidIndex;i++){const n=this._orderedCustomLines[i];t.push(n),e.add(n.decorationId,n)}let i=0,n=this._invalidIndex>0?t[this._invalidIndex-1]:void 0;for(let o=this._invalidIndex;o<this._orderedCustomLines.length;o++){const s=this._orderedCustomLines[o];if(s.deleted)i++;else{if(s.index=o-i,n&&n.lineNumber===s.lineNumber)s.maximumSpecialHeight=n.maximumSpecialHeight,s.prefixSum=n.prefixSum;else{let e,t=s.specialHeight;for(let e=o;e<this._orderedCustomLines.length;e++){const i=this._orderedCustomLines[e];if(!i.deleted){if(i.lineNumber!==s.lineNumber)break;t=Math.max(t,i.specialHeight)}}s.maximumSpecialHeight=t,e=n?n.prefixSum+n.maximumSpecialHeight+this._defaultLineHeight*(s.lineNumber-n.lineNumber-1):this._defaultLineHeight*(s.lineNumber-1),s.prefixSum=e}n=s,t.push(s),e.add(s.decorationId,s)}}this._orderedCustomLines=t,this._decorationIDToCustomLine=e,this._invalidIndex=1/0,this._hasPending=!1}_binarySearchOverOrderedCustomLinesArray(e){return is(this._orderedCustomLines.length,(t=>{const i=this._orderedCustomLines[t];return i.lineNumber===e?0:i.lineNumber<e?-1:1}))}}class vj{constructor(){this._map=new Map}add(e,t){const i=this._map.get(e);i?i.push(t):this._map.set(e,[t])}get(e){return this._map.get(e)}delete(e){this._map.delete(e)}}class bj{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}commit(e){if(!this._hasPending)return;const t=this._inserts,i=this._changes,n=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,n)}}class wj{constructor(e,t,i,n,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=n,this.minWidth=o,this.prefixSum=0}}class Cj{static{this.INSTANCE_COUNT=0}constructor(e,t,i,n,o){this._instanceId=Ln(++Cj.INSTANCE_COUNT),this._pendingChanges=new bj,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._paddingTop=i,this._paddingBottom=n,this._lineHeightsManager=new _j(t,o)}static findInsertionIndex(e,t,i){let n=0,o=e.length;for(;n<o;){const s=n+o>>>1;t===e[s].afterLineNumber?i<e[s].ordinal?o=s:n=s+1:t<e[s].afterLineNumber?o=s:n=s+1}return n}setDefaultLineHeight(e){this._lineHeightsManager.defaultLineHeight=e}setPadding(e,t){this._paddingTop=e,this._paddingBottom=t}onFlushed(e,t){this._lineCount=e,this._lineHeightsManager=new _j(this._lineHeightsManager.defaultLineHeight,t)}changeLineHeights(e){let t=!1;try{e({insertOrChangeCustomLineHeight:(e,i,n,o)=>{t=!0,this._lineHeightsManager.insertOrChangeCustomLineHeight(e,i,n,o)},removeCustomLineHeight:e=>{t=!0,this._lineHeightsManager.removeCustomLineHeight(e)}})}finally{this._lineHeightsManager.commit()}return t}changeWhitespace(e){let t=!1;try{const i={insertWhitespace:(e,i,n,o)=>{t=!0,e|=0,i|=0,n|=0,o|=0;const s=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new wj(s,e,i,n,o)),s},changeOneWhitespace:(e,i,n)=>{t=!0,i|=0,n|=0,this._pendingChanges.change({id:e,newAfterLineNumber:i,newHeight:n})},removeWhitespace:e=>{t=!0,this._pendingChanges.remove({id:e})}};e(i)}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const t of e)this._insertWhitespace(t);for(const e of t)this._changeOneWhitespace(e.id,e.newAfterLineNumber,e.newHeight);for(const e of i){const t=this._findWhitespaceIndex(e.id);-1!==t&&this._removeWhitespace(t)}return}const n=new Set;for(const e of i)n.add(e.id);const o=new Map;for(const e of t)o.set(e.id,e);const s=e=>{const t=[];for(const i of e)if(!n.has(i.id)){if(o.has(i.id)){const e=o.get(i.id);i.afterLineNumber=e.newAfterLineNumber,i.height=e.newHeight}t.push(i)}return t},r=s(this._arr).concat(s(e));r.sort(((e,t)=>e.afterLineNumber===t.afterLineNumber?e.ordinal-t.ordinal:e.afterLineNumber-t.afterLineNumber)),this._arr=r,this._prefixSumValidIndex=-1}_insertWhitespace(e){const t=Cj.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let i=0,n=t.length;i<n;i++)if(t[i].id===e)return i;return-1}_changeOneWhitespace(e,t,i){const n=this._findWhitespaceIndex(e);if(-1!==n&&(this._arr[n].height!==i&&(this._arr[n].height=i,this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,n-1)),this._arr[n].afterLineNumber!==t)){const e=this._arr[n];this._removeWhitespace(n),e.afterLineNumber=t,this._insertWhitespace(e)}}_removeWhitespace(e){this._arr.splice(e,1),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,e-1)}onLinesDeleted(e,t){e|=0,t|=0,this._lineCount-=t-e+1;for(let i=0,n=this._arr.length;i<n;i++){const n=this._arr[i].afterLineNumber;e<=n&&n<=t?this._arr[i].afterLineNumber=e-1:n>t&&(this._arr[i].afterLineNumber-=t-e+1)}this._lineHeightsManager.onLinesDeleted(e,t)}onLinesInserted(e,t){e|=0,t|=0,this._lineCount+=t-e+1;for(let i=0,n=this._arr.length;i<n;i++)e<=this._arr[i].afterLineNumber&&(this._arr[i].afterLineNumber+=t-e+1);this._lineHeightsManager.onLinesInserted(e,t)}getWhitespacesTotalHeight(){return 0===this._arr.length?0:this.getWhitespacesAccumulatedHeight(this._arr.length-1)}getWhitespacesAccumulatedHeight(e){e|=0;let t=Math.max(0,this._prefixSumValidIndex+1);0===t&&(this._arr[0].prefixSum=this._arr[0].height,t++);for(let i=t;i<=e;i++)this._arr[i].prefixSum=this._arr[i-1].prefixSum+this._arr[i].height;return this._prefixSumValidIndex=Math.max(this._prefixSumValidIndex,e),this._arr[e].prefixSum}getLinesTotalHeight(){return this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(this._lineCount)+this.getWhitespacesTotalHeight()+this._paddingTop+this._paddingBottom}getWhitespaceAccumulatedHeightBeforeLineNumber(e){e|=0;const t=this._findLastWhitespaceBeforeLineNumber(e);return-1===t?0:this.getWhitespacesAccumulatedHeight(t)}_findLastWhitespaceBeforeLineNumber(e){e|=0;const t=this._arr;let i=0,n=t.length-1;for(;i<=n;){const o=i+((n-i|0)/2|0)|0;if(t[o].afterLineNumber<e){if(o+1>=t.length||t[o+1].afterLineNumber>=e)return o;i=o+1|0}else n=o-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e|=0;const t=this._findLastWhitespaceBeforeLineNumber(e)+1;return t<this._arr.length?t:-1}getFirstWhitespaceIndexAfterLineNumber(e){return e|=0,this._findFirstWhitespaceAfterLineNumber(e)}getVerticalOffsetForLineNumber(e,t=!1){let i;return i=(e|=0)>1?this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(e-1):0,i+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0))+this._paddingTop}getLineHeightForLineNumber(e){return this._lineHeightsManager.heightForLineNumber(e)}getVerticalOffsetAfterLineNumber(e,t=!1){return e|=0,this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(e)+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0))+this._paddingTop}getWhitespaceMinWidth(){if(-1===this._minWidth){let e=0;for(let t=0,i=this._arr.length;t<i;t++)e=Math.max(e,this._arr[t].minWidth);this._minWidth=e}return this._minWidth}isAfterLines(e){return e>this.getLinesTotalHeight()}isInTopPadding(e){return 0!==this._paddingTop&&e<this._paddingTop}isInBottomPadding(e){return 0!==this._paddingBottom&&e>=this.getLinesTotalHeight()-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if((e|=0)<0)return 1;const t=0|this._lineCount;let i=1,n=t;for(;i<n;){const t=(i+n)/2|0,o=this.getLineHeightForLineNumber(t),s=0|this.getVerticalOffsetForLineNumber(t);if(e>=s+o)i=t+1;else{if(e>=s)return t;n=t}}return i>t?t:i}getLinesViewportData(e,t){e|=0,t|=0;const i=0|this.getLineNumberAtOrAfterVerticalOffset(e),n=0|this.getVerticalOffsetForLineNumber(i);let o=0|this._lineCount,s=0|this.getFirstWhitespaceIndexAfterLineNumber(i);const r=0|this.getWhitespacesCount();let a,l;-1===s?(s=r,l=o+1,a=0):(l=0|this.getAfterLineNumberForWhitespaceIndex(s),a=0|this.getHeightForWhitespaceIndex(s));let d=n,h=d;const c=5e5;let u=0;n>=c&&(u=Math.floor(n/c)*c,u=Math.floor(u/this._lineHeightsManager.defaultLineHeight)*this._lineHeightsManager.defaultLineHeight,h-=u);const g=[],p=e+(t-e)/2;let m=-1;for(let e=i;e<=o;e++){const n=this.getLineHeightForLineNumber(e);for(-1===m&&(d<=p&&p<d+n||d>p)&&(m=e),d+=n,g[e-i]=h,h+=n;l===e;)h+=a,d+=a,s++,s>=r?l=o+1:(l=0|this.getAfterLineNumberForWhitespaceIndex(s),a=0|this.getHeightForWhitespaceIndex(s));if(d>=t){o=e;break}}-1===m&&(m=o);const f=0|this.getVerticalOffsetForLineNumber(o);let _=i,v=o;return _<v&&n<e&&_++,_<v&&f+this.getLineHeightForLineNumber(o)>t&&v--,{bigNumbersDelta:u,startLineNumber:i,endLineNumber:o,relativeVerticalOffset:g,centeredLineNumber:m,completelyVisibleStartLineNumber:_,completelyVisibleEndLineNumber:v,lineHeight:this._lineHeightsManager.defaultLineHeight}}getVerticalOffsetForWhitespaceIndex(e){e|=0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i,n;return i=t>=1?this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(t):0,n=e>0?this.getWhitespacesAccumulatedHeight(e-1):0,i+n+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){e|=0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;if(e>=this.getVerticalOffsetForWhitespaceIndex(i)+this.getHeightForWhitespaceIndex(i))return-1;for(;t<i;){const n=Math.floor((t+i)/2),o=this.getVerticalOffsetForWhitespaceIndex(n);if(e>=o+this.getHeightForWhitespaceIndex(n))t=n+1;else{if(e>=o)return n;i=n}}return t}getWhitespaceAtVerticalOffset(e){e|=0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0)return null;if(t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const n=this.getHeightForWhitespaceIndex(t);return{id:this.getIdForWhitespaceIndex(t),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(t),verticalOffset:i,height:n}}getWhitespaceViewportData(e,t){e|=0,t|=0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),n=this.getWhitespacesCount()-1;if(i<0)return[];const o=[];for(let e=i;e<=n;e++){const i=this.getVerticalOffsetForWhitespaceIndex(e),n=this.getHeightForWhitespaceIndex(e);if(i>=t)break;o.push({id:this.getIdForWhitespaceIndex(e),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(e),verticalOffset:i,height:n})}return o}getWhitespaces(){return this._arr.slice(0)}getWhitespacesCount(){return this._arr.length}getIdForWhitespaceIndex(e){return e|=0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return e|=0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return e|=0,this._arr[e].height}}class yj{constructor(e,t,i,n){(e|=0)<0&&(e=0),(t|=0)<0&&(t=0),(i|=0)<0&&(i=0),(n|=0)<0&&(n=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=n,this.scrollHeight=Math.max(i,n)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class Sj extends At{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new Zt),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new yj(0,0,0,0),this._scrollable=this._register(new QM({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const i=t.contentWidth!==e.contentWidth,n=t.contentHeight!==e.contentHeight;(i||n)&&this._onDidContentSizeChange.fire(new GK(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}}class xj extends At{constructor(e,t,i,n){super(),this._configuration=e;const o=this._configuration.options,s=o.get(165),r=o.get(96);this._linesLayout=new Cj(t,o.get(75),r.top,r.bottom,i),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new Sj(0,n)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new yj(s.contentWidth,0,s.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(130)?125:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(75)&&this._linesLayout.setDefaultLineHeight(t.get(75)),e.hasChanged(96)){const e=t.get(96);this._linesLayout.setPadding(e.top,e.bottom)}if(e.hasChanged(165)){const e=t.get(165),i=e.contentWidth,n=e.height,o=this._scrollable.getScrollDimensions(),s=o.contentWidth;this._scrollable.setScrollDimensions(new yj(i,o.contentWidth,n,this._getContentHeight(i,n,s)))}else this._updateHeight();e.hasChanged(130)&&this._configureSmoothScrollDuration()}onFlushed(e,t){this._linesLayout.onFlushed(e,t)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const i=this._configuration.options.get(117);return 2===i.horizontal||e>=t?0:i.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return n.get(119)?o+=Math.max(0,t-n.get(75)-n.get(96).bottom):n.get(117).ignoreHorizontalScrollbarInContentHeight||(o+=this._getHorizontalScrollbarHeight(e,i)),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,n=e.contentWidth;this._scrollable.setScrollDimensions(new yj(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new xH(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new xH(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(166),n=e.get(59),o=e.get(165);if(i.isViewportWrapping){const i=e.get(81);return t>o.contentWidth+n.typicalHalfwidthCharacterWidth&&i.enabled&&"right"===i.side?t+o.verticalScrollbarWidth:t}{const i=e.get(118)*n.typicalHalfwidthCharacterWidth,s=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+i+o.verticalScrollbarWidth,s,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){const e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new yj(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t);return{scrollTop:t,scrollTopWithoutViewZones:t-this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i),scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}changeSpecialLineHeights(e){const t=this._linesLayout.changeLineHeights(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}getLineHeightForLineNumber(e){return this._linesLayout.getLineHeightForLineNumber(e)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){1===t?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class kj{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class Lj{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=n}toInlineDecoration(e){return new kj(new Yu(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class Dj{constructor(e,t,i,n,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=n,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let i=this._decorationsCache[t];if(!i){const n=e.range,o=e.options;let s;if(o.isWholeLine){const e=this._coordinatesConverter.convertModelPositionToViewPosition(new rc(n.startLineNumber,1),0,!1,!0),t=this._coordinatesConverter.convertModelPositionToViewPosition(new rc(n.endLineNumber,this.model.getLineMaxColumn(n.endLineNumber)),1);s=new Yu(e.lineNumber,e.column,t.lineNumber,t.column)}else s=this._coordinatesConverter.convertModelRangeToViewRange(n,1);i=new aH(s,o),this._decorationsCache[t]=i}return i}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=null!==this._cachedModelDecorationsResolver;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getDecorationsOnLine(e,t=!1,i=!1){const n=new Yu(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(n,t,i)}_getDecorationsInRange(e,t,i){const n=this._linesCollection.getDecorationsInRange(e,this.editorId,oP(this.configuration.options),sP(this.configuration.options),t,i),o=e.startLineNumber,s=e.endLineNumber,r=[];let a=0;const l=[];for(let e=o;e<=s;e++)l[e-o]=[];let d=!1;for(let e=0,t=n.length;e<t;e++){const t=n[e],i=t.options;if(!lH(this.model,t))continue;const h=this._getOrCreateViewModelDecoration(t),c=h.range;if(r[a++]=h,i.inlineClassName){const e=new kj(c,i.inlineClassName,i.inlineClassNameAffectsLetterSpacing?3:0),t=Math.max(o,c.startLineNumber),n=Math.min(s,c.endLineNumber);for(let i=t;i<=n;i++)l[i-o].push(e)}if(i.beforeContentClassName&&o<=c.startLineNumber&&c.startLineNumber<=s){const e=new kj(new Yu(c.startLineNumber,c.startColumn,c.startLineNumber,c.startColumn),i.beforeContentClassName,1);l[c.startLineNumber-o].push(e)}if(i.afterContentClassName&&o<=c.endLineNumber&&c.endLineNumber<=s){const e=new kj(new Yu(c.endLineNumber,c.endColumn,c.endLineNumber,c.endColumn),i.afterContentClassName,2);l[c.endLineNumber-o].push(e)}i.affectsFont&&(d=!0)}return{decorations:r,inlineDecorations:l,hasVariableFonts:d}}}function Ej(e,t){return null===e?t?Ij.INSTANCE:Tj.INSTANCE:new Nj(e,t)}class Nj{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,i){this._assertVisible();const n=i>0?this._projectionData.breakOffsets[i-1]:0,o=this._projectionData.breakOffsets[i];let s;if(null!==this._projectionData.injectionOffsets){const i=this._projectionData.injectionOffsets.map(((e,t)=>new Fx(0,0,e+1,this._projectionData.injectionOptions[t],0)));s=Fx.applyInjectedText(e.getLineContent(t),i).substring(n,o)}else s=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:o+1});return i>0&&(s=Aj(this._projectionData.wrappedTextIndentLength)+s),s}getViewLineLength(e,t,i){return this._assertVisible(),this._projectionData.getLineLength(i)}getViewLineMinColumn(e,t,i){return this._assertVisible(),this._projectionData.getMinOutputOffset(i)+1}getViewLineMaxColumn(e,t,i){return this._assertVisible(),this._projectionData.getMaxOutputOffset(i)+1}getViewLineData(e,t,i){const n=new Array;return this.getViewLinesData(e,t,i,1,0,[!0],n),n[0]}getViewLinesData(e,t,i,n,o,s,r){this._assertVisible();const a=this._projectionData,l=a.injectionOffsets,d=a.injectionOptions;let h,c=null;if(l){c=[];let e=0,t=0;for(let i=0;i<a.getOutputLineCount();i++){const n=new Array;c[i]=n;const o=i>0?a.breakOffsets[i-1]:0,s=a.breakOffsets[i];for(;t<l.length;){const r=d[t].content.length,h=l[t]+e,c=h+r;if(h>s)break;if(o<c){const e=d[t];if(e.inlineClassName){const t=i>0?a.wrappedTextIndentLength:0,r=t+Math.max(h-o,0),l=t+Math.min(c-o,s-o);r!==l&&n.push(new Lj(r,l,e.inlineClassName,e.inlineClassNameAffectsLetterSpacing))}}if(!(c<=s))break;e+=r,t++}}}if(l){const i=[];for(let e=0;e<l.length;e++){const t=l[e],n=d[e].tokens;n?n.forEach(((n,o)=>{i.push({offset:t,text:n.substring(d[e].content),tokenMetadata:o.metadata})})):i.push({offset:t,text:d[e].content,tokenMetadata:uS.defaultTokenMetadata})}h=e.tokenization.getLineTokens(t).withInserted(i)}else h=e.tokenization.getLineTokens(t);for(let e=i;e<i+n;e++){const t=o+e-i;s[t]?r[t]=this._getViewLineData(h,c?c[e]:null,e):r[t]=null}}_getViewLineData(e,t,i){this._assertVisible();const n=this._projectionData,o=i>0?n.wrappedTextIndentLength:0,s=i>0?n.breakOffsets[i-1]:0,r=n.breakOffsets[i],a=e.sliceAndInflate(s,r,o);let l=a.getLineContent();i>0&&(l=Aj(n.wrappedTextIndentLength)+l);const d=this._projectionData.getMinOutputOffset(i)+1,h=l.length+1,c=i+1<this.getViewLineCount(),u=0===i?0:n.breakOffsetsVisibleColumn[i-1];return new LH(l,c,d,h,u,a,t)}getModelColumnOfViewPosition(e,t){return this._assertVisible(),this._projectionData.translateToInputOffset(e,t-1)+1}getViewPositionOfModelPosition(e,t,i=2){return this._assertVisible(),this._projectionData.translateToOutputPosition(t-1,i).toPosition(e)}getViewLineNumberOfModelPosition(e,t){return this._assertVisible(),e+this._projectionData.translateToOutputPosition(t-1).outputLineIndex}normalizePosition(e,t,i){const n=t.lineNumber-e;return this._projectionData.normalizeOutputPosition(e,t.column-1,i).toPosition(n)}getInjectedTextAt(e,t){return this._projectionData.getInjectedText(e,t-1)}_assertVisible(){if(!this._isVisible)throw new Error("Not supported")}}class Ij{static{this.INSTANCE=new Ij}constructor(){}isVisible(){return!0}setVisible(e){return e?this:Tj.INSTANCE}getProjectionData(){return null}getViewLineCount(){return 1}getViewLineContent(e,t,i){return e.getLineContent(t)}getViewLineLength(e,t,i){return e.getLineLength(t)}getViewLineMinColumn(e,t,i){return e.getLineMinColumn(t)}getViewLineMaxColumn(e,t,i){return e.getLineMaxColumn(t)}getViewLineData(e,t,i){const n=e.tokenization.getLineTokens(t),o=n.getLineContent();return new LH(o,!1,1,o.length+1,0,n.inflate(),null)}getViewLinesData(e,t,i,n,o,s,r){s[o]?r[o]=this.getViewLineData(e,t,0):r[o]=null}getModelColumnOfViewPosition(e,t){return t}getViewPositionOfModelPosition(e,t){return new rc(e,t)}getViewLineNumberOfModelPosition(e,t){return e}normalizePosition(e,t,i){return t}getInjectedTextAt(e,t){return null}}class Tj{static{this.INSTANCE=new Tj}constructor(){}isVisible(){return!1}setVisible(e){return e?Ij.INSTANCE:this}getProjectionData(){return null}getViewLineCount(){return 0}getViewLineContent(e,t,i){throw new Error("Not supported")}getViewLineLength(e,t,i){throw new Error("Not supported")}getViewLineMinColumn(e,t,i){throw new Error("Not supported")}getViewLineMaxColumn(e,t,i){throw new Error("Not supported")}getViewLineData(e,t,i){throw new Error("Not supported")}getViewLinesData(e,t,i,n,o,s,r){throw new Error("Not supported")}getModelColumnOfViewPosition(e,t){throw new Error("Not supported")}getViewPositionOfModelPosition(e,t){throw new Error("Not supported")}getViewLineNumberOfModelPosition(e,t){throw new Error("Not supported")}normalizePosition(e,t,i){throw new Error("Not supported")}getInjectedTextAt(e,t){throw new Error("Not supported")}}const Mj=[""];function Aj(e){if(e>=Mj.length)for(let t=1;t<=e;t++)Mj[t]=Rj(t);return Mj[e]}function Rj(e){return new Array(e+1).join(" ")}class Oj{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=Hy(e);const i=this.values,n=this.prefixSum,o=t.length;return 0!==o&&(this.values=new Uint32Array(i.length+o),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+o),this.values.set(t,e),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSum=new Uint32Array(this.values.length),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=Hy(e),t=Hy(t),this.values[e]!==t&&(this.values[e]=t,e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),!0)}removeValues(e,t){e=Hy(e),t=Hy(t);const i=this.values,n=this.prefixSum;if(e>=i.length)return!1;const o=i.length-e;return t>=o&&(t=o),0!==t&&(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return 0===this.values.length?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=Hy(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;0===t&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,n=0,o=0,s=0;for(;t<=i;)if(n=t+(i-t)/2|0,o=this.prefixSum[n],s=o-this.values[n],e<s)i=n-1;else{if(!(e>=o))break;t=n+1}return new Fj(n,e-s)}}class Pj{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),0===e?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new Fj(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=gs(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e<t;e++){const t=this._values[e],i=e>0?this._prefixSum[e-1]:0;this._prefixSum[e]=i+t;for(let n=0;n<t;n++)this._indexBySum[i+n]=e}this._prefixSum.length=this._values.length,this._indexBySum.length=this._prefixSum[this._prefixSum.length-1],this._isValid=!0,this._validEndIndex=this._values.length-1}}setValue(e,t){this._values[e]!==t&&(this._values[e]=t,this._invalidate(e))}}class Fj{constructor(e,t){this.index=e,this.remainder=t,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=t}}class Bj{constructor(e){this._model=e}_validPosition(e){return this._model.validatePosition(e)}_validRange(e){return this._model.validateRange(e)}convertViewPositionToModelPosition(e){return this._validPosition(e)}convertViewRangeToModelRange(e){return this._validRange(e)}validateViewPosition(e,t){return this._validPosition(t)}validateViewRange(e,t){return this._validRange(t)}convertModelPositionToViewPosition(e){return this._validPosition(e)}convertModelRangeToViewRange(e){return this._validRange(e)}modelPositionIsVisible(e){const t=this._model.getLineCount();return!(e.lineNumber<1||e.lineNumber>t)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}class Wj{constructor(e,t,i,n,o,s,r,a,l,d,h){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=n,this.fontInfo=o,this.tabSize=s,this.wrappingStrategy=r,this.wrappingColumn=a,this.wrappingIndent=l,this.wordBreak=d,this.wrapOnEscapedLineFeeds=h,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new zj(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const i=this.model.getLinesContent(),n=this.model.getInjectedTextDecorations(this._editorId),o=i.length,s=this.createLineBreaksComputer(),r=new ks(Fx.fromDecorations(n));for(let e=0;e<o;e++){const n=r.takeWhile((t=>t.lineNumber===e+1));s.addRequest(i[e],n,t?t[e]:null)}const a=s.finalize(),l=[],d=this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e))).sort(Yu.compareRangesUsingStarts);let h=1,c=0,u=-1,g=u+1<d.length?c+1:o+2;for(let e=0;e<o;e++){const t=e+1;t===g&&(u++,h=d[u].startLineNumber,c=d[u].endLineNumber,g=u+1<d.length?c+1:o+2);const i=t>=h&&t<=c,n=Ej(a[e],!i);l[e]=n.getViewLineCount(),this.modelLineProjections[e]=n}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new Pj(l)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e)))}setHiddenAreas(e){const t=e.map((e=>this.model.validateRange(e))),i=function(e){if(0===e.length)return[];const t=e.slice();t.sort(Yu.compareRangesUsingStarts);const i=[];let n=t[0].startLineNumber,o=t[0].endLineNumber;for(let e=1,s=t.length;e<s;e++){const s=t[e];s.startLineNumber>o+1?(i.push(new Yu(n,1,o,1)),n=s.startLineNumber,o=s.endLineNumber):s.endLineNumber>o&&(o=s.endLineNumber)}return i.push(new Yu(n,1,o,1)),i}(t),n=this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e))).sort(Yu.compareRangesUsingStarts);if(i.length===n.length){let e=!1;for(let t=0;t<i.length;t++)if(!i[t].equalsRange(n[t])){e=!0;break}if(!e)return!1}const o=i.map((e=>({range:e,options:bk.EMPTY})));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,o);const s=i;let r=1,a=0,l=-1,d=l+1<s.length?a+1:this.modelLineProjections.length+2,h=!1;for(let e=0;e<this.modelLineProjections.length;e++){const t=e+1;t===d&&(l++,r=s[l].startLineNumber,a=s[l].endLineNumber,d=l+1<s.length?a+1:this.modelLineProjections.length+2);let i=!1;if(t>=r&&t<=a?this.modelLineProjections[e].isVisible()&&(this.modelLineProjections[e]=this.modelLineProjections[e].setVisible(!1),i=!0):(h=!0,this.modelLineProjections[e].isVisible()||(this.modelLineProjections[e]=this.modelLineProjections[e].setVisible(!0),i=!0)),i){const t=this.modelLineProjections[e].getViewLineCount();this.projectedModelLineLineCounts.setValue(e,t)}}return h||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return!(e<1||e>this.modelLineProjections.length)&&this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize!==e&&(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,n,o){const s=this.fontInfo.equals(e),r=this.wrappingStrategy===t,a=this.wrappingColumn===i,l=this.wrappingIndent===n,d=this.wordBreak===o;if(s&&r&&a&&l&&d)return!1;const h=s&&r&&!a&&l&&d;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=n,this.wordBreak=o;let c=null;if(h){c=[];for(let e=0,t=this.modelLineProjections.length;e<t;e++)c[e]=this.modelLineProjections[e].getProjectionData()}return this._constructLines(!1,c),!0}createLineBreaksComputer(){return("advanced"===this.wrappingStrategy?this._domLineBreaksComputerFactory:this._monospaceLineBreaksComputerFactory).createLineBreaksComputer(this.fontInfo,this.tabSize,this.wrappingColumn,this.wrappingIndent,this.wordBreak,this.wrapOnEscapedLineFeeds)}onModelFlushed(){this._constructLines(!0,null)}onModelLinesDeleted(e,t,i){if(!e||e<=this._validModelVersionId)return null;const n=1===t?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,o=this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections.splice(t-1,i-t+1),this.projectedModelLineLineCounts.removeValues(t-1,i-t+1),new BK(n,o)}onModelLinesInserted(e,t,i,n){if(!e||e<=this._validModelVersionId)return null;const o=t>2&&!this.modelLineProjections[t-2].isVisible(),s=1===t?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let r=0;const a=[],l=[];for(let e=0,t=n.length;e<t;e++){const t=Ej(n[e],!o);a.push(t);const i=t.getViewLineCount();r+=i,l[e]=i}return this.modelLineProjections=this.modelLineProjections.slice(0,t-1).concat(a).concat(this.modelLineProjections.slice(t-1)),this.projectedModelLineLineCounts.insertValues(t-1,l),new WK(s,s+r-1)}onModelLineChanged(e,t,i){if(null!==e&&e<=this._validModelVersionId)return[!1,null,null,null];const n=t-1,o=this.modelLineProjections[n].getViewLineCount(),s=Ej(i,this.modelLineProjections[n].isVisible());this.modelLineProjections[n]=s;const r=this.modelLineProjections[n].getViewLineCount();let a=!1,l=0,d=-1,h=0,c=-1,u=0,g=-1;return o>r?(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=l+r-1,u=d+1,g=u+(o-r)-1,a=!0):o<r?(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=l+o-1,h=d+1,c=h+(r-o)-1,a=!0):(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=l+r-1),this.projectedModelLineLineCounts.setValue(n,r),[a,l<=d?new FK(l,d-l+1):null,h<=c?new WK(h,c):null,u<=g?new BK(u,g):null]}acceptVersionId(e){this._validModelVersionId=e,1!==this.modelLineProjections.length||this.modelLineProjections[0].isVisible()||this.setHiddenAreas([])}getViewLineCount(){return this.projectedModelLineLineCounts.getTotalSum()}_toValidViewLineNumber(e){if(e<1)return 1;const t=this.getViewLineCount();return e>t?t:0|e}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),s=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),r=this.model.guides.getActiveIndentGuide(n.lineNumber,o.lineNumber,s.lineNumber),a=this.convertModelPositionToViewPosition(r.startLineNumber,1),l=this.convertModelPositionToViewPosition(r.endLineNumber,this.model.getLineMaxColumn(r.endLineNumber));return{startLineNumber:a.lineNumber,endLineNumber:l.lineNumber,indent:r.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,n=t.remainder;return new Vj(i+1,n)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new rc(e.modelLineNumber,n)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new rc(e.modelLineNumber,n)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),n=this.getViewLineInfo(t),o=new Array;let s=this.getModelStartPositionOfViewLine(i),r=new Array;for(let e=i.modelLineNumber;e<=n.modelLineNumber;e++){const t=this.modelLineProjections[e-1];if(t.isVisible()){const o=e===i.modelLineNumber?i.modelLineWrappedLineIdx:0,s=e===n.modelLineNumber?n.modelLineWrappedLineIdx+1:t.getViewLineCount();for(let t=o;t<s;t++)r.push(new Vj(e,t))}if(!t.isVisible()&&s){const t=new rc(e-1,this.model.getLineMaxColumn(e-1)+1),i=Yu.fromPositions(s,t);o.push(new Hj(i,r)),r=[],s=null}else t.isVisible()&&!s&&(s=new rc(e,1))}if(s){const e=Yu.fromPositions(s,this.getModelEndPositionOfViewLine(n));o.push(new Hj(e,r))}return o}getViewLinesBracketGuides(e,t,i,n){const o=i?this.convertViewPositionToModelPosition(i.lineNumber,i.column):null,s=[];for(const i of this.getViewLineInfosGroupedByModelRanges(e,t)){const e=i.modelRange.startLineNumber,t=this.model.guides.getLinesBracketGuides(e,i.modelRange.endLineNumber,o,n);for(const n of i.viewLines){const i=t[n.modelLineNumber-e].map((e=>{if(-1!==e.forWrappedLinesAfterColumn&&this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.forWrappedLinesAfterColumn).lineNumber>=n.modelLineWrappedLineIdx)return;if(-1!==e.forWrappedLinesBeforeOrAtColumn&&this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.forWrappedLinesBeforeOrAtColumn).lineNumber<n.modelLineWrappedLineIdx)return;if(!e.horizontalLine)return e;let t=-1;if(-1!==e.column){const i=this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.column);if(i.lineNumber===n.modelLineWrappedLineIdx)t=i.column;else if(i.lineNumber<n.modelLineWrappedLineIdx)t=this.getMinColumnOfViewLine(n);else if(i.lineNumber>n.modelLineWrappedLineIdx)return}const i=this.convertModelPositionToViewPosition(n.modelLineNumber,e.horizontalLine.endColumn),o=this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.horizontalLine.endColumn);return o.lineNumber===n.modelLineWrappedLineIdx?new qC(e.visibleColumn,t,e.className,new $C(e.horizontalLine.top,i.column),-1,-1):o.lineNumber<n.modelLineWrappedLineIdx||-1!==e.visibleColumn?void 0:new qC(e.visibleColumn,t,e.className,new $C(e.horizontalLine.top,this.getMaxColumnOfViewLine(n)),-1,-1)}));s.push(i.filter((e=>!!e)))}}return s}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),n=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[];const s=[],r=[],a=i.lineNumber-1,l=n.lineNumber-1;let d=null;for(let e=a;e<=l;e++){const t=this.modelLineProjections[e];if(t.isVisible()){const n=t.getViewLineNumberOfModelPosition(0,e===a?i.column:1),o=t.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(e+1)),l=o-n+1;let h=0;l>1&&1===t.getViewLineMinColumn(this.model,e+1,o)&&(h=0===n?1:2),s.push(l),r.push(h),null===d&&(d=new rc(e+1,0))}else null!==d&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,e)),d=null)}null!==d&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,n.lineNumber)),d=null);const h=t-e+1,c=new Array(h);let u=0;for(let e=0,t=o.length;e<t;e++){let t=o[e];const i=Math.min(h-u,s[e]),n=r[e];let a;a=2===n?0:1===n?1:i;for(let e=0;e<i;e++)e===a&&(t=0),c[u++]=t}return c}getViewLineContent(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineContent(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineLength(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineLength(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineMinColumn(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineMinColumn(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineMaxColumn(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineMaxColumn(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineData(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineData(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLinesData(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const n=this.projectedModelLineLineCounts.getIndexOf(e-1);let o=e;const s=n.index,r=n.remainder,a=[];for(let n=s,l=this.model.getLineCount();n<l;n++){const l=this.modelLineProjections[n];if(!l.isVisible())continue;const d=n===s?r:0;let h=l.getViewLineCount()-d,c=!1;if(o+h>t&&(c=!0,h=t-o+1),l.getViewLinesData(this.model,n+1,d,h,o-e,i,a),o+=h,c)break}return a}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const n=this.projectedModelLineLineCounts.getIndexOf(e-1),o=n.index,s=n.remainder,r=this.modelLineProjections[o],a=r.getViewLineMinColumn(this.model,o+1,s),l=r.getViewLineMaxColumn(this.model,o+1,s);t<a&&(t=a),t>l&&(t=l);const d=r.getModelColumnOfViewPosition(s,t);return this.model.validatePosition(new rc(o+1,d)).equals(i)?new rc(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),n=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new Yu(i.lineNumber,i.column,n.lineNumber,n.column)}convertViewPositionToModelPosition(e,t){const i=this.getViewLineInfo(e),n=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new rc(i.modelLineNumber,n))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new Yu(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2,n=!1,o=!1){const s=this.model.validatePosition(new rc(e,t)),r=s.lineNumber,a=s.column;let l=r-1,d=!1;if(o)for(;l<this.modelLineProjections.length&&!this.modelLineProjections[l].isVisible();)l++,d=!0;else for(;l>0&&!this.modelLineProjections[l].isVisible();)l--,d=!0;if(0===l&&!this.modelLineProjections[l].isVisible())return new rc(n?0:1,1);const h=1+this.projectedModelLineLineCounts.getPrefixSum(l);let c;return c=d?o?this.modelLineProjections[l].getViewPositionOfModelPosition(h,1,i):this.modelLineProjections[l].getViewPositionOfModelPosition(h,this.model.getLineMaxColumn(l+1),i):this.modelLineProjections[r-1].getViewPositionOfModelPosition(h,a,i),c}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return Yu.fromPositions(i)}{const t=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),i=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new Yu(t.lineNumber,t.column,i.lineNumber,i.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const e=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(e,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(0===i&&!this.modelLineProjections[i].isVisible())return 1;const n=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(n,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,n,o,s){const r=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-r.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new Yu(r.lineNumber,1,a.lineNumber,a.column),t,i,n,o,s);let l=[];const d=r.lineNumber-1,h=a.lineNumber-1;let c=null;for(let e=d;e<=h;e++)if(this.modelLineProjections[e].isVisible())null===c&&(c=new rc(e+1,e===d?r.column:1));else if(null!==c){const s=this.model.getLineMaxColumn(e);l=l.concat(this.model.getDecorationsInRange(new Yu(c.lineNumber,c.column,e,s),t,i,n,o)),c=null}null!==c&&(l=l.concat(this.model.getDecorationsInRange(new Yu(c.lineNumber,c.column,a.lineNumber,a.column),t,i,n,o)),c=null),l.sort(((e,t)=>{const i=Yu.compareRangesUsingStarts(e.range,t.range);return 0===i?e.id<t.id?-1:e.id>t.id?1:0:i}));const u=[];let g=0,p=null;for(const e of l){const t=e.id;p!==t&&(p=t,u[g++]=e)}return u}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const i=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[i.modelLineNumber-1].normalizePosition(i.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return 0===t.modelLineWrappedLineIdx?this.model.getLineIndentColumn(t.modelLineNumber):0}}class Vj{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class Hj{constructor(e,t){this.modelRange=e,this.viewLines=t}}class zj{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t,i,n){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,i,n)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}class Uj{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new Bj(this.model)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,n){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,i,n)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new BK(t,i)}onModelLinesInserted(e,t,i,n){return new WK(t,i)}onModelLineChanged(e,t,i){return[!1,new FK(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const i=t-e+1,n=new Array(i);for(let e=0;e<i;e++)n[e]=0;return n}getViewLineContent(e){return this.model.getLineContent(e)}getViewLineLength(e){return this.model.getLineLength(e)}getViewLineMinColumn(e){return this.model.getLineMinColumn(e)}getViewLineMaxColumn(e){return this.model.getLineMaxColumn(e)}getViewLineData(e){const t=this.model.tokenization.getLineTokens(e),i=t.getLineContent();return new LH(i,!1,1,i.length+1,0,t.inflate(),null)}getViewLinesData(e,t,i){const n=this.model.getLineCount();e=Math.min(Math.max(1,e),n),t=Math.min(Math.max(1,t),n);const o=[];for(let n=e;n<=t;n++){const t=n-e;o[t]=i[t]?this.getViewLineData(n):null}return o}getDecorationsInRange(e,t,i,n,o,s){return this.model.getDecorationsInRange(e,t,i,n,o,s)}normalizePosition(e,t){return this.model.normalizePosition(e,t)}getLineIndentColumn(e){return this.model.getLineIndentColumn(e)}getInjectedTextAt(e){return null}}const Kj=gg.Right;class jj{constructor(e){this.persist=0,this._requiredLanes=1,this.lanes=new Uint8Array(Math.ceil((e+1)*Kj/8))}reset(e){const t=Math.ceil((e+1)*Kj/8);this.lanes.length<t?this.lanes=new Uint8Array(t):this.lanes.fill(0),this._requiredLanes=1}get requiredLanes(){return this._requiredLanes}push(e,t,i){i&&(this.persist|=1<<e-1);for(let i=t.startLineNumber;i<=t.endLineNumber;i++){const t=Kj*i+(e-1);this.lanes[t>>>3]|=1<<t%8,this._requiredLanes=Math.max(this._requiredLanes,this.countAtLine(i))}}getLanesAtLine(e){const t=[];let i=Kj*e;for(let e=0;e<Kj;e++)(this.persist&1<<e||this.lanes[i>>>3]&1<<i%8)&&t.push(e+1),i++;return t.length?t:[gg.Center]}countAtLine(e){let t=Kj*e,i=0;for(let e=0;e<Kj;e++)(this.persist&1<<e||this.lanes[t>>>3]&1<<t%8)&&i++,t++;return i}}class qj extends At{constructor(e,t,i,n,o,s,r,a,l,d){if(super(),this.languageConfigurationService=r,this._themeService=a,this._attachedView=l,this._transactionalTarget=d,this.hiddenAreasModel=new Zj,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new qK,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new Ak(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new Ci((()=>this._updateConfigurationViewLineCountNow()),0)),this._hasFocus=!1,this._viewportStart=$j.create(this.model),this.glyphLanes=new jj(0),this.model.isTooLargeForTokenization())this._lines=new Uj(this.model);else{const e=this._configuration.options,t=e.get(59),i=e.get(156),s=e.get(166),r=e.get(155),a=e.get(146),l=e.get(160);this._lines=new Wj(this._editorId,this.model,n,o,t,this.model.getOptions().tabSize,i,s.wrappingColumn,r,a,l)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new hj(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new xj(this._configuration,this.getLineCount(),this._getCustomLineHeights(),s)),this._register(this.viewLayout.onDidScroll((e=>{e.scrollTopChanged&&this._handleVisibleLinesChanged(),e.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new HK(e)),this._eventDispatcher.emitOutgoingEvent(new QK(e.oldScrollWidth,e.oldScrollLeft,e.oldScrollHeight,e.oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop))}))),this._register(this.viewLayout.onDidContentSizeChange((e=>{this._eventDispatcher.emitOutgoingEvent(e)}))),this._decorations=new Dj(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast((e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}}))),this._register(JV.getInstance().onDidChange((()=>{this._eventDispatcher.emitSingleViewEvent(new KK)}))),this._register(this._themeService.onDidColorThemeChange((e=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new zK(e))}))),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_getCustomLineHeights(){return this._configuration.options.get(5)?this.model.getCustomLineHeightsDecorations(this._editorId).map((e=>{const t=e.range.startLineNumber,i=this.coordinatesConverter.convertModelRangeToViewRange(new Yu(t,1,t,this.model.getLineMaxColumn(t)));return{decorationId:e.id,startLineNumber:i.startLineNumber,endLineNumber:i.endLineNumber,lineHeight:e.options.lineHeight||0}})):[]}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),t=new Yu(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new RK(e)),this._eventDispatcher.emitOutgoingEvent(new ZK(!e,e))}setHasWidgetFocus(e){this._eventDispatcher.emitOutgoingEvent(new YK(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new EK)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new NK)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new rc(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new Qj(t,this._viewportStart.startLineDelta)}return new Qj(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),n=this._configuration.options,o=n.get(59),s=n.get(156),r=n.get(166),a=n.get(155),l=n.get(146);this._lines.setWrappingSettings(o,s,r.wrappingColumn,a,l)&&(e.emitViewEvent(new AK),e.emitViewEvent(new PK),e.emitViewEvent(new MK(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(104)&&(this._decorations.reset(),e.emitViewEvent(new MK(null))),t.hasChanged(112)&&(this._decorations.reset(),e.emitViewEvent(new MK(null))),e.emitViewEvent(new IK(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),Ak.shouldRecreate(t)&&(this.cursorConfig=new Ak(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText((e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();let i=!1,n=!1;const o=e instanceof Gx?e.rawContentChangedEvent.changes:e.changes,s=e instanceof Gx?e.rawContentChangedEvent.versionId:null,r=this._lines.createLineBreaksComputer();for(const e of o)switch(e.changeType){case 4:for(let t=0;t<e.detail.length;t++){const i=e.detail[t];let n=e.injectedTexts[t];n&&(n=n.filter((e=>!e.ownerId||e.ownerId===this._editorId))),r.addRequest(i,n,null)}break;case 2:{let t=null;e.injectedText&&(t=e.injectedText.filter((e=>!e.ownerId||e.ownerId===this._editorId))),r.addRequest(e.detail,t,null);break}}const a=r.finalize(),l=new ks(a);for(const e of o)switch(e.changeType){case 1:this._lines.onModelFlushed(),t.emitViewEvent(new AK),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights()),i=!0;break;case 3:{const n=this._lines.onModelLinesDeleted(s,e.fromLineNumber,e.toLineNumber);null!==n&&(t.emitViewEvent(n),this.viewLayout.onLinesDeleted(n.fromLineNumber,n.toLineNumber)),i=!0;break}case 4:{const n=l.takeCount(e.detail.length),o=this._lines.onModelLinesInserted(s,e.fromLineNumber,e.toLineNumber,n);null!==o&&(t.emitViewEvent(o),this.viewLayout.onLinesInserted(o.fromLineNumber,o.toLineNumber)),i=!0;break}case 2:{const i=l.dequeue(),[o,r,a,d]=this._lines.onModelLineChanged(s,e.lineNumber,i);n=o,r&&t.emitViewEvent(r),a&&(t.emitViewEvent(a),this.viewLayout.onLinesInserted(a.fromLineNumber,a.toLineNumber)),d&&(t.emitViewEvent(d),this.viewLayout.onLinesDeleted(d.fromLineNumber,d.toLineNumber));break}}null!==s&&this._lines.acceptVersionId(s),this.viewLayout.onHeightMaybeChanged(),!i&&n&&(t.emitViewEvent(new PK),t.emitViewEvent(new MK(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){const e=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(e){const t=this.coordinatesConverter.convertModelPositionToViewPosition(e.getStartPosition()),i=this.viewLayout.getVerticalOffsetForLineNumber(t.lineNumber);this.viewLayout.setScrollPosition({scrollTop:i+this._viewportStart.startLineDelta},1)}}try{const t=this._eventDispatcher.beginEmitViewEvents();e instanceof Gx&&t.emitOutgoingEvent(new sj(e.contentChangedEvent)),this._cursor.onModelContentChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()}))),this._configuration.options.get(5)&&this._register(this.model.onDidChangeLineHeight((e=>{const t=e.changes.filter((e=>e.ownerId===this._editorId||0===e.ownerId));if(this.viewLayout.changeSpecialLineHeights((e=>{for(const i of t){const{decorationId:t,lineNumber:n,lineHeight:o}=i,s=this.coordinatesConverter.convertModelRangeToViewRange(new Yu(n,1,n,this.model.getLineMaxColumn(n)));null!==o?e.insertOrChangeCustomLineHeight(t,s.startLineNumber,s.endLineNumber,o):e.removeCustomLineHeight(t)}})),t.length>0){const e=new qx(t);this._eventDispatcher.emitOutgoingEvent(new lj(e))}}))),this._configuration.options.get(172)&&this._register(this.model.onDidChangeFont((e=>{const t=e.changes.filter((e=>e.ownerId===this._editorId||0===e.ownerId));if(t.length>0){const e=new $x(t);this._eventDispatcher.emitOutgoingEvent(new dj(e))}}))),this._register(this.model.onDidChangeTokens((e=>{const t=[];for(let i=0,n=e.ranges.length;i<n;i++){const n=e.ranges[i],o=this.coordinatesConverter.convertModelPositionToViewPosition(new rc(n.fromLineNumber,1)).lineNumber,s=this.coordinatesConverter.convertModelPositionToViewPosition(new rc(n.toLineNumber,this.model.getLineMaxColumn(n.toLineNumber))).lineNumber;t[i]={fromLineNumber:o,toLineNumber:s}}this._eventDispatcher.emitSingleViewEvent(new UK(t)),this._eventDispatcher.emitOutgoingEvent(new aj(e))}))),this._register(this.model.onDidChangeLanguageConfiguration((e=>{this._eventDispatcher.emitSingleViewEvent(new OK),this.cursorConfig=new Ak(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new oj(e))}))),this._register(this.model.onDidChangeLanguage((e=>{this.cursorConfig=new Ak(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new nj(e))}))),this._register(this.model.onDidChangeOptions((e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const e=this._eventDispatcher.beginEmitViewEvents();e.emitViewEvent(new AK),e.emitViewEvent(new PK),e.emitViewEvent(new MK(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new Ak(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new rj(e))}))),this._register(this.model.onDidChangeDecorations((e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new MK(e)),this._eventDispatcher.emitOutgoingEvent(new ij(e))})))}getFontSizeAtPosition(e){if(!this._configuration.options.get(172))return null;const t=this.model.getFontDecorationsInRange(Yu.fromPositions(e),this._editorId);let i=this._configuration.options.get(59).fontSize+"px";for(const e of t)if(e.options.fontSize){i=e.options.fontSize;break}return i}setHiddenAreas(e,t,i){this.hiddenAreasModel.setHiddenAreas(t,e);const n=this.hiddenAreasModel.getMergedRanges();if(n===this.previousHiddenAreas&&!i)return;this.previousHiddenAreas=n;const o=this._captureStableViewport();let s=!1;try{const e=this._eventDispatcher.beginEmitViewEvents();s=this._lines.setHiddenAreas(n),s&&(e.emitViewEvent(new AK),e.emitViewEvent(new PK),e.emitViewEvent(new MK(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights()),this.viewLayout.onHeightMaybeChanged());const t=o.viewportStartModelPosition?.lineNumber,i=t&&n.some((e=>e.startLineNumber<=t&&t<=e.endLineNumber));i||o.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),s&&this._eventDispatcher.emitOutgoingEvent(new JK)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(165),t=this._configuration.options.get(75),i=Math.max(20,Math.round(e.height/t)),n=this.viewLayout.getLinesViewportData(),o=Math.max(1,n.completelyVisibleStartLineNumber-i),s=Math.min(this.getLineCount(),n.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new Yu(o,this.getLineMinColumn(o),s,this.getLineMaxColumn(s)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(0===i.length)return[t];const n=[];let o=0,s=t.startLineNumber,r=t.startColumn;const a=t.endLineNumber,l=t.endColumn;for(let e=0,t=i.length;e<t;e++){const t=i[e].startLineNumber,l=i[e].endLineNumber;l<s||t>a||(s<t&&(n[o++]=new Yu(s,r,t-1,this.model.getLineMaxColumn(t-1))),s=l+1,r=1)}return(s<a||s===a&&r<l)&&(n[o++]=new Yu(s,r,a,l)),n}getCompletelyVisibleViewRange(){const e=this.viewLayout.getLinesViewportData(),t=e.completelyVisibleStartLineNumber,i=e.completelyVisibleEndLineNumber;return new Yu(t,this.getLineMinColumn(t),i,this.getLineMaxColumn(i))}getCompletelyVisibleViewRangeAtScrollTop(e){const t=this.viewLayout.getLinesViewportDataAtScrollTop(e),i=t.completelyVisibleStartLineNumber,n=t.completelyVisibleEndLineNumber;return new Yu(i,this.getLineMinColumn(i),n,this.getLineMaxColumn(n))}saveState(){const e=this.viewLayout.saveState(),t=e.scrollTop,i=this.viewLayout.getLineNumberAtVerticalOffset(t),n=this.coordinatesConverter.convertViewPositionToModelPosition(new rc(i,this.getLineMinColumn(i))),o=this.viewLayout.getVerticalOffsetForLineNumber(i)-t;return{scrollLeft:e.scrollLeft,firstPosition:n,firstPositionDeltaTop:o}}reduceRestoreState(e){if(void 0===e.firstPosition)return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),n=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:n}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,n){return this._lines.getViewLinesBracketGuides(e,t,i,n)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=$i(this.getLineContent(e));return-1===t?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Zi(this.getLineContent(e));return-1===t?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}_getTextDirection(e,t){let i=0;for(const n of t){const t=n.range;if(t.startLineNumber>e||t.endLineNumber<e)continue;const o=n.options.textDirection;o===pg.RTL?i++:o===pg.LTR&&i--}return i>0?pg.RTL:pg.LTR}getTextDirection(e){const t=this._decorations.getDecorationsOnLine(e);return this._getTextDirection(e,t.decorations)}getViewportViewLineRenderingData(e,t){const i=this._decorations.getDecorationsViewportData(e),n=i.inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,n,i.hasVariableFonts,i.decorations)}getViewLineRenderingData(e){const t=this._decorations.getDecorationsOnLine(e);return this._getViewLineRenderingData(e,t.inlineDecorations[0],t.hasVariableFonts,t.decorations)}_getViewLineRenderingData(e,t,i,n){const o=this.model.mightContainRTL(),s=this.model.mightContainNonBasicASCII(),r=this.getTabSize(),a=this._lines.getViewLineData(e);return a.inlineDecorations&&(t=[...t,...a.inlineDecorations.map((t=>t.toInlineDecoration(e)))]),new DH(a.minColumn,a.maxColumn,a.content,a.continuesWithWrappedLine,o,s,a.tokens,t,r,a.startVisibleColumn,this._getTextDirection(e,n),i)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const n=this._lines.getViewLinesData(e,t,i);return new kH(this.getTabSize(),n)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,oP(this._configuration.options),sP(this._configuration.options)),i=new Gj;for(const n of t){const t=n.options,o=t.overviewRuler;if(!o)continue;const s=o.position;if(0===s)continue;const r=o.getColor(e.value),a=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.startLineNumber,n.range.startColumn),l=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.endLineNumber,n.range.endColumn);i.accept(r,t.zIndex,a,l,s)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const e=t.options.overviewRuler;e?.invalidateCachedColor();const i=t.options.minimap;i?.invalidateCachedColor()}}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getValueLengthInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(i,t)}modifyPosition(e,t){const i=this.coordinatesConverter.convertViewPositionToModelPosition(e),n=this.model.modifyPosition(i,t);return this.coordinatesConverter.convertModelPositionToViewPosition(n)}deduceModelPositionRelativeToViewPosition(e,t,i){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e);2===this.model.getEOL().length&&(t<0?t-=i:t+=i);const o=this.model.getOffsetAt(n)+t;return this.model.getPositionAt(o)}getPlainTextToCopy(e,t,i){const n=i?"\r\n":this.model.getEOL();(e=e.slice(0)).sort(Yu.compareRangesUsingStarts);let o=!1,s=!1;for(const t of e)t.isEmpty()?o=!0:s=!0;if(!s){if(!t)return"";const i=e.map((e=>e.startLineNumber));let o="";for(let e=0;e<i.length;e++)e>0&&i[e-1]===i[e]||(o+=this.model.getLineContent(i[e])+n);return o}if(o&&t){const t=[];let n=0;for(const o of e){const e=o.startLineNumber;o.isEmpty()?e!==n&&t.push(this.model.getLineContent(e)):t.push(this.model.getValueInRange(o,i?2:0)),n=e}return 1===t.length?t[0]:t}const r=[];for(const t of e)t.isEmpty()||r.push(this.model.getValueInRange(t,i?2:0));return 1===r.length?r[0]:r}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===Up)return null;if(1!==e.length)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const e=n.startLineNumber;n=new Yu(e,this.model.getLineMinColumn(e),e,this.model.getLineMaxColumn(e))}const o=this._configuration.options.get(59),s=this._getColorMap();let r;return/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===fP.fontFamily?r=fP.fontFamily:(r=o.fontFamily,r=r.replace(/"/g,"'"),/[,']/.test(r)||/[+ ]/.test(r)&&(r=`'${r}'`),r=`${r}, ${fP.fontFamily}`),{mode:i,html:`<div style="color: ${s[1]};background-color: ${s[2]};font-family: ${r};font-weight: ${o.fontWeight};font-size: ${o.fontSize}px;line-height: ${o.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(n,s)+"</div>"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,s=e.endColumn,r=this.getTabSize();let a="";for(let e=i;e<=o;e++){const l=this.model.tokenization.getLineTokens(e),d=l.getLineContent(),h=e===i?n-1:0,c=e===o?s-1:d.length;a+=""===d?"<br>":QI(d,l.inflate(),t,h,c,r,q)}return a}_getColorMap(){const e=JS.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;i<n;i++)t[i]=Lg.Format.CSS.formatHex(e[i]);return t}getPrimaryCursorState(){return this._cursor.getPrimaryCursorState()}getLastAddedCursorIndex(){return this._cursor.getLastAddedCursorIndex()}getCursorStates(){return this._cursor.getCursorStates()}setCursorStates(e,t,i){return this._withViewEventsCollector((n=>this._cursor.setStates(n,e,t,i)))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=0){this._withViewEventsCollector((n=>this._cursor.setSelections(n,e,t,i)))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector((t=>this._cursor.restoreState(t,e)))}_executeCursorEdit(e){this._cursor.context.cursorConfig.readOnly?this._eventDispatcher.emitOutgoingEvent(new tj):this._withViewEventsCollector(e)}executeEdits(e,t,i,n){this._executeCursorEdit((o=>this._cursor.executeEdits(o,e,t,i,n)))}startComposition(){this._executeCursorEdit((e=>this._cursor.startComposition(e)))}endComposition(e){this._executeCursorEdit((t=>this._cursor.endComposition(t,e)))}type(e,t){this._executeCursorEdit((i=>this._cursor.type(i,e,t)))}compositionType(e,t,i,n,o){this._executeCursorEdit((s=>this._cursor.compositionType(s,e,t,i,n,o)))}paste(e,t,i,n){this._executeCursorEdit((o=>this._cursor.paste(o,e,t,i,n)))}cut(e){this._executeCursorEdit((t=>this._cursor.cut(t,e)))}executeCommand(e,t){this._executeCursorEdit((i=>this._cursor.executeCommand(i,e,t)))}executeCommands(e,t){this._executeCursorEdit((i=>this._cursor.executeCommands(i,e,t)))}revealAllCursors(e,t,i=!1){this._withViewEventsCollector((n=>this._cursor.revealAll(n,e,i,0,t,0)))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector((n=>this._cursor.revealPrimary(n,e,i,0,t,0)))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new Yu(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector((t=>t.emitViewEvent(new VK(e,!1,i,null,0,!0,0))))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new Yu(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector((t=>t.emitViewEvent(new VK(e,!1,i,null,0,!0,0))))}revealRange(e,t,i,n,o){this._withViewEventsCollector((s=>s.emitViewEvent(new VK(e,!1,i,null,n,t,o))))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new jK),this._eventDispatcher.emitOutgoingEvent(new XK))}_withViewEventsCollector(e){return this._transactionalTarget.batchChanges((()=>{try{const t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}))}batchEvents(e){this._withViewEventsCollector((()=>{e()}))}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}}class $j{static create(e){const t=e._setTrackedRange(null,new Yu(1,1,1,1),1);return new $j(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,i,n,o){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=n,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new rc(t,e.getLineMinColumn(t))),n=e.model._setTrackedRange(this._modelTrackedRange,new Yu(i.lineNumber,i.column,i.lineNumber,i.column),1),o=e.viewLayout.getVerticalOffsetForLineNumber(t),s=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=n,this._startLineDelta=s-o}invalidate(){this._isValid=!1}}class Gj{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,n,o){const s=this._asMap[e];if(s){const e=s.data,t=e[e.length-3],r=e[e.length-1];if(t===o&&r+1>=i)return void(n>r&&(e[e.length-1]=n));e.push(o,i,n)}else{const s=new EH(e,t,[o,i,n]);this._asMap[e]=s,this.asArray.push(s)}}}class Zj{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&Yj(i,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;const e=Array.from(this.hiddenAreas.values()).reduce(((e,t)=>function(e,t){const i=[];let n=0,o=0;for(;n<e.length&&o<t.length;){const s=e[n],r=t[o];if(s.endLineNumber<r.startLineNumber-1)i.push(e[n++]);else if(r.endLineNumber<s.startLineNumber-1)i.push(t[o++]);else{const e=Math.min(s.startLineNumber,r.startLineNumber),t=Math.max(s.endLineNumber,r.endLineNumber);i.push(new Yu(e,1,t,1)),n++,o++}}for(;n<e.length;)i.push(e[n++]);for(;o<t.length;)i.push(t[o++]);return i}(e,t)),[]);return Yj(this.ranges,e)||(this.ranges=e),this.ranges}}function Yj(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].equalsRange(t[i]))return!1;return!0}class Qj{constructor(e,t){this.viewportStartModelPosition=e,this.startLineDelta=t}recoverViewportStart(e,t){if(!this.viewportStartModelPosition)return;const i=e.convertModelPositionToViewPosition(this.viewportStartModelPosition),n=t.getVerticalOffsetForLineNumber(i.lineNumber);t.setScrollPosition({scrollTop:n+this.startLineDelta},1)}}class Xj{constructor(...e){this._entries=new Map;for(const[t,i]of e)this.set(t,i)}set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}get(e){return this._entries.get(e)}}var Jj,eq=function(e,t){return function(i,n){t(i,n,e)}};let tq=class extends At{static{Jj=this}static{this.dropIntoEditorDecorationOptions=bk.register({description:"workbench-dnd-target",className:"dnd-target"})}get isSimpleWidget(){return this._configuration.isSimpleWidget}get contextMenuId(){return this._configuration.contextMenuId}get contextKeyService(){return this._contextKeyService}constructor(e,t,i,n,o,s,r,a,l,d,h,c){super(),this.languageConfigurationService=h,this._deliveryQueue=new Yt,this._contributions=this._register(new cK),this._onDidDispose=this._register(new Zt),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new Zt({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new Zt({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new Zt({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new Zt({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new Zt({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeLineHeight=this._register(new Zt({deliveryQueue:this._deliveryQueue})),this.onDidChangeLineHeight=this._onDidChangeLineHeight.event,this._onDidChangeFont=this._register(new Zt({deliveryQueue:this._deliveryQueue})),this.onDidChangeFont=this._onDidChangeFont.event,this._onDidChangeModelTokens=this._register(new Zt({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new Zt({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onWillChangeModel=this._register(new Zt({deliveryQueue:this._deliveryQueue})),this.onWillChangeModel=this._onWillChangeModel.event,this._onDidChangeModel=this._register(new Zt({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new Zt({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new Zt({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new sq(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new Zt({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new oq({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new oq({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new sq(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new sq(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new sq(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new sq(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new sq(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new sq(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new sq(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new sq(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new sq(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new sq(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new sq(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new sq(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new sq(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new sq(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new sq(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new sq(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new sq(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new Zt({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new Zt({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new Zt({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new Zt({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._updateCounter=0,this._onWillTriggerEditorOperationEvent=this._register(new Zt),this._onBeginUpdate=this._register(new Zt),this.onBeginUpdate=this._onBeginUpdate.event,this._onEndUpdate=this._register(new Zt),this.onEndUpdate=this._onEndUpdate.event,this._onBeforeExecuteEdit=this._register(new Zt),this.onBeforeExecuteEdit=this._onBeforeExecuteEdit.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),this.inComposition=!1,o.willCreateCodeEditor();const u={...t};if(this._domElement=e,this._overflowWidgetsDomNode=u.overflowWidgetsDomNode,delete u.overflowWidgetsDomNode,this._id=++iq,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,i.contextMenuId??(i.isSimpleWidget?gu.SimpleEditorContext:gu.EditorContext),u,d)),this._register(this._configuration.onDidChange((e=>{this._onDidChangeConfiguration.fire(e);const t=this._configuration.options;if(e.hasChanged(165)){const e=t.get(165);this._onDidLayoutChange.fire(e)}}))),this._contextKeyService=this._register(r.createScoped(this._domElement)),i.contextKeyValues)for(const[e,t]of Object.entries(i.contextKeyValues))this._contextKeyService.createKey(e,t);let g;this._notificationService=l,this._codeEditorService=o,this._commandService=s,this._themeService=a,this._register(new rq(this,this._contextKeyService)),this._register(new aq(this,this._contextKeyService,c)),this._instantiationService=this._register(n.createChild(new Xj([eu,this._contextKeyService]))),this._modelData=null,this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={},g=Array.isArray(i.contributions)?i.contributions:Ku.getEditorContributions(),this._contributions.initialize(this,g,this._instantiationService);for(const e of Ku.getEditorActions()){if(this._actions.has(e.id)){Ie(new Error(`Cannot have two actions with the same id ${e.id}`));continue}const t=new uK(e.id,e.label,e.alias,e.metadata,e.precondition??void 0,(t=>this._instantiationService.invokeFunction((i=>Promise.resolve(e.runEditorCommand(i,this,t))))),this._contextKeyService);this._actions.set(t.id,t)}const p=()=>!this._configuration.options.get(104)&&this._configuration.options.get(43).enabled;this._register(new pl(this._domElement,{onDragOver:e=>{if(!p())return;const t=this.getTargetAtClientPoint(e.clientX,e.clientY);t?.position&&this.showDropIndicatorAt(t.position)},onDrop:async e=>{if(!p())return;if(this.removeDropIndicator(),!e.dataTransfer)return;const t=this.getTargetAtClientPoint(e.clientX,e.clientY);t?.position&&this._onDropIntoEditor.fire({position:t.position,event:e})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){this._modelData?.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i,n){return new lB(e,t,i,this._domElement,n)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return gK.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?Jk.getWordAtPosition(this._modelData.model,this._configuration.options.get(148),this._configuration.options.get(147),e):null}getValue(e=null){if(!this._modelData)return"";const t=!(!e||!e.preserveBOM);let i=0;return e&&e.lineEnding&&"\n"===e.lineEnding?i=1:e&&e.lineEnding&&"\r\n"===e.lineEnding&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){try{if(this._beginUpdate(),!this._modelData)return;this._modelData.model.setValue(e)}finally{this._endUpdate()}}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){try{this._beginUpdate();const t=e;if(null===this._modelData&&null===t)return;if(this._modelData&&this._modelData.model===t)return;const i={oldModelUrl:this._modelData?.model.uri||null,newModelUrl:t?.uri||null};this._onWillChangeModel.fire(i);const n=this.hasTextFocus(),o=this._detachModel();this._attachModel(t),this.hasModel()?n&&this.focus():(this._editorTextFocus.setValue(!1),this._editorWidgetFocus.setValue(!1)),this._removeDecorationTypes(),this._onDidChangeModel.fire(i),this._postDetachModelCleanup(o),this._contributionsDisposable=this._contributions.onAfterModelAttached()}finally{this._endUpdate()}}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,n){const o=e.model.validatePosition({lineNumber:t,column:i}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(s.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?Jj._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?Jj._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const o=e.model.validatePosition({lineNumber:t,column:i}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber,n)}getBottomForLineNumber(e,t=!1){if(!this._modelData)return-1;const i=this._modelData.model.getLineMaxColumn(e);return Jj._getVerticalOffsetAfterPosition(this._modelData,e,i,t)}getLineHeightForPosition(e){if(!this._modelData)return-1;const t=this._modelData.viewModel,i=t.coordinatesConverter,n=rc.lift(e);if(i.modelPositionIsVisible(n)){const e=i.convertModelPositionToViewPosition(n);return t.viewLayout.getLineHeightForLineNumber(e.lineNumber)}return 0}setHiddenAreas(e,t,i){this._modelData?.viewModel.setHiddenAreas(e.map((e=>Yu.lift(e))),t,i)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return Eg.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!rc.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,n){if(!this._modelData)return;if(!Yu.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),s=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,s,t,n)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if("number"!=typeof e)throw new Error("Invalid arguments");this._sendRevealRange(new Yu(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,n){if(!rc.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new Yu(e.lineNumber,e.column,e.lineNumber,e.column),t,i,n)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=Qu.isISelection(e),n=Yu.isIRange(e);if(!i&&!n)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){const i={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(i,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new Qu(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,n){if("number"!=typeof e||"number"!=typeof t)throw new Error("Invalid arguments");this._sendRevealRange(new Yu(e,1,t,1),i,!1,n)}revealRange(e,t=0,i=!1,n=!0){this._revealRange(e,i?1:0,n,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,n){if(!Yu.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(Yu.lift(e),t,i,n)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||0===e.length)throw new Error("Invalid arguments");for(let t=0,i=e.length;t<i;t++)if(!Qu.isISelection(e[t]))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,e,i)}}getContentWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getContentWidth():-1}getScrollWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollWidth():-1}getScrollLeft(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollLeft():-1}getContentHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getContentHeight():-1}getScrollHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollHeight():-1}getScrollTop(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollTop():-1}setScrollLeft(e,t=1){if(this._modelData){if("number"!=typeof e)throw new Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollLeft:e},t)}}setScrollTop(e,t=1){if(this._modelData){if("number"!=typeof e)throw new Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollTop:e},t)}}setScrollPosition(e,t=1){this._modelData&&this._modelData.viewModel.viewLayout.setScrollPosition(e,t)}hasPendingScrollAnimation(){return!!this._modelData&&this._modelData.viewModel.viewLayout.hasPendingScrollAnimation()}saveViewState(){if(!this._modelData)return null;const e=this._contributions.saveViewState();return{cursorState:this._modelData.viewModel.saveCursorState(),viewState:this._modelData.viewModel.saveState(),contributionsState:e}}restoreViewState(e){if(!this._modelData||!this._modelData.hasRealView)return;const t=e;if(t&&t.cursorState&&t.viewState){const e=t.cursorState;Array.isArray(e)?e.length>0&&this._modelData.viewModel.restoreCursorState(e):this._modelData.viewModel.restoreCursorState([e]),this._contributions.restoreViewState(t.contributionsState||{});const i=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(i)}}handleInitialized(){this._getViewModel()?.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter((e=>e.isSupported())),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){i=i||{};try{switch(this._onWillTriggerEditorOperationEvent.fire({source:e,handlerId:t,payload:i}),this._beginUpdate(),t){case"compositionStart":return void this._startComposition();case"compositionEnd":return void this._endComposition(e);case"type":{const t=i;return void this._type(e,t.text||"")}case"replacePreviousChar":{const t=i;return void this._compositionType(e,t.text||"",t.replaceCharCnt||0,0,0)}case"compositionType":{const t=i;return void this._compositionType(e,t.text||"",t.replacePrevCharCnt||0,t.replaceNextCharCnt||0,t.positionDelta||0)}case"paste":{const t=i;return void this._paste(e,t.text||"",t.pasteOnNewLine||!1,t.multicursorText||null,t.mode||null,t.clipboardEvent)}case"cut":return void this._cut(e)}const n=this.getAction(t);if(n)return void Promise.resolve(n.run(i)).then(void 0,Ie);if(!this._modelData)return;if(this._triggerEditorCommand(e,t,i))return;this._triggerCommand(t,i)}finally{this._endUpdate()}}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this.inComposition=!0,this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this.inComposition=!1,this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){this._modelData&&0!==t.length&&("keyboard"===e&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),"keyboard"===e&&this._onDidType.fire(t))}_compositionType(e,t,i,n,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,n,o,e)}_paste(e,t,i,n,o,s){if(!this._modelData)return;const r=this._modelData.viewModel,a=r.getSelection().getStartPosition();r.paste(t,i,n,e);const l=r.getSelection().getStartPosition();"keyboard"===e&&this._onDidPaste.fire({clipboardEvent:s,range:new Yu(a.lineNumber,a.column,l.lineNumber,l.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const n=Ku.getEditorCommand(t);return!!n&&((i=i||{}).source=e,this._instantiationService.invokeFunction((e=>{Promise.resolve(n.runEditorCommand(e,this,i)).then(void 0,Ie)})),!0)}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!!this._modelData&&!this._configuration.options.get(104)&&(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!!this._modelData&&!this._configuration.options.get(104)&&(this._modelData.model.popStackElement(),!0)}edit(e,t){return this.executeEdits(t,e.replacements.map((e=>({range:e.range,text:e.text}))),void 0)}executeEdits(e,t,i){if(!this._modelData)return!1;if(this._configuration.options.get(104))return!1;let n,o,s;return n=i?Array.isArray(i)?()=>i:i:()=>null,e instanceof wC?(s=e,o=e.metadata.source):(s=yC({name:o}),o=e),this._onBeforeExecuteEdit.fire({source:o??void 0}),this._modelData.viewModel.executeEdits(o,t,n,s),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new lq(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){if(!this._modelData)return null;const t=this._configuration.options;return this._modelData.model.getLineDecorations(e,this._id,oP(t),sP(t))}getDecorationsInRange(e){if(!this._modelData)return null;const t=this._configuration.options;return this._modelData.model.getDecorationsInRange(e,this._id,oP(t),sP(t))}getFontSizeAtPosition(e){return this._modelData?this._modelData.viewModel.getFontSizeAtPosition(e):null}deltaDecorations(e,t){return this._modelData?0===e.length&&0===t.length?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){this._modelData&&0!==e.length&&this._modelData.model.changeDecorations((t=>{t.deltaDecorations(e,[])}))}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.changeDecorations((e=>e.deltaDecorations(t,[]))),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(165)}createOverviewRuler(e){return this._modelData&&this._modelData.hasRealView?this._modelData.view.createOverviewRuler(e):null}getContainerDomNode(){return this._domElement}getDomNode(){return this._modelData&&this._modelData.hasRealView?this._modelData.view.domNode.domNode:null}delegateVerticalScrollbarPointerDown(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e,t=!1){this._configuration.observeContainer(e),t||this.render()}focus(){this._modelData&&this._modelData.hasRealView&&this._modelData.view.focus()}hasTextFocus(){return!(!this._modelData||!this._modelData.hasRealView)&&this._modelData.view.isFocused()}hasWidgetFocus(){return!(!this._modelData||!this._modelData.hasRealView)&&this._modelData.view.isWidgetFocused()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id:"+e.getId()),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const e=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(e)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const e=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(e)}}addGlyphMarginWidget(e){const t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(i)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const e=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(e)}}changeViewZones(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getTargetAtClientPoint(e,t):null}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),i=this._configuration.options.get(165);return{top:Jj._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),left:this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+i.glyphMarginWidth+i.lineNumbersWidth+i.decorationsWidth-this.getScrollLeft(),height:this.getLineHeightForPosition(t)}}getOffsetForColumn(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getOffsetForColumn(e,t):-1}render(e=!1){this._modelData&&this._modelData.hasRealView&&this._modelData.viewModel.batchEvents((()=>{this._modelData.view.render(!0,e)}))}setAriaOptions(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.setAriaOptions(e)}applyFontInfo(e){iT(e,this._configuration.options.get(59))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._bannerDomNode.remove(),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e)return void(this._modelData=null);const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const i=e.onBeforeAttached(),n=new qj(this._id,this._configuration,e,rK.create(ta(this._domElement)),pK.create(this._configuration.options),(e=>Ca(ta(this._domElement),e)),this.languageConfigurationService,this._themeService,i,{batchChanges:e=>{try{return this._beginUpdate(),e()}finally{this._endUpdate()}}});t.push(e.onWillDispose((()=>this.setModel(null)))),t.push(n.onEvent((t=>{switch(t.kind){case 0:this._onDidContentSizeChange.fire(t);break;case 1:this._editorTextFocus.setValue(t.hasFocus);break;case 2:this._editorWidgetFocus.setValue(t.hasFocus);break;case 3:this._onDidScrollChange.fire(t);break;case 4:this._onDidChangeViewZones.fire();break;case 5:this._onDidChangeHiddenAreas.fire();break;case 6:this._onDidAttemptReadOnlyEdit.fire();break;case 7:{if(t.reachedMaxCursorCount){const e=y(80,"The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",this.getOption(89));this._notificationService.prompt(aO.Warning,e,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:y(81,"Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const e=[];for(let i=0,n=t.selections.length;i<n;i++)e[i]=t.selections[i].getPosition();const i={position:e[0],secondaryPositions:e.slice(1),reason:t.reason,source:t.source};this._onDidChangeCursorPosition.fire(i);const n={selection:t.selections[0],secondarySelections:t.selections.slice(1),modelVersionId:t.modelVersionId,oldSelections:t.oldSelections,oldModelVersionId:t.oldModelVersionId,source:t.source,reason:t.reason};this._onDidChangeCursorSelection.fire(n);break}case 8:this._onDidChangeModelDecorations.fire(t.event);break;case 9:this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._onDidChangeModelLanguage.fire(t.event);break;case 10:this._onDidChangeModelLanguageConfiguration.fire(t.event);break;case 11:this._onDidChangeModelContent.fire(t.event);break;case 12:this._onDidChangeModelOptions.fire(t.event);break;case 13:this._onDidChangeModelTokens.fire(t.event);break;case 14:this._onDidChangeLineHeight.fire(t.event);break;case 15:this._onDidChangeFont.fire(t.event)}})));const[o,s]=this._createView(n);if(s){this._domElement.appendChild(o.domNode.domNode);let t=Object.keys(this._contentWidgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];o.addContentWidget(this._contentWidgets[i])}t=Object.keys(this._overlayWidgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];o.addOverlayWidget(this._overlayWidgets[i])}t=Object.keys(this._glyphMarginWidgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];o.addGlyphMarginWidget(this._glyphMarginWidgets[i])}o.render(!1,!0),o.domNode.domNode.setAttribute("data-uri",e.uri.toString())}this._modelData=new nq(e,n,o,s,t,i)}_createView(e){let t;t=this.isSimpleWidget?{paste:(e,t,i,n)=>{this._paste("keyboard",e,t,i,n)},type:e=>{this._type("keyboard",e)},compositionType:(e,t,i,n)=>{this._compositionType("keyboard",e,t,i,n)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:{paste:(e,t,i,n)=>{const o={text:e,pasteOnNewLine:t,multicursorText:i,mode:n};this._commandService.executeCommand("paste",o)},type:e=>{const t={text:e};this._commandService.executeCommand("type",t)},compositionType:(e,t,i,n)=>{if(i||n){const o={text:e,replacePrevCharCnt:t,replaceNextCharCnt:i,positionDelta:n};this._commandService.executeCommand("compositionType",o)}else{const i={text:e,replaceCharCnt:t};this._commandService.executeCommand("replacePreviousChar",i)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new $W(e.coordinatesConverter);return i.onKeyDown=e=>this._onKeyDown.fire(e),i.onKeyUp=e=>this._onKeyUp.fire(e),i.onContextMenu=e=>this._onContextMenu.fire(e),i.onMouseMove=e=>this._onMouseMove.fire(e),i.onMouseLeave=e=>this._onMouseLeave.fire(e),i.onMouseDown=e=>this._onMouseDown.fire(e),i.onMouseUp=e=>this._onMouseUp.fire(e),i.onMouseDrag=e=>this._onMouseDrag.fire(e),i.onMouseDrop=e=>this._onMouseDrop.fire(e),i.onMouseDropCanceled=e=>this._onMouseDropCanceled.fire(e),i.onMouseWheel=e=>this._onMouseWheel.fire(e),[new QU(this._domElement,this.getId(),t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e?.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(this._contributionsDisposable?.dispose(),this._contributionsDisposable=void 0,!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&t.remove(),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._bannerDomNode.remove(),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return null!==this._modelData}showDropIndicatorAt(e){const t=[{range:new Yu(e.lineNumber,e.column,e.lineNumber,e.column),options:Jj.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}_beginUpdate(){this._updateCounter++,1===this._updateCounter&&this._onBeginUpdate.fire()}_endUpdate(){this._updateCounter--,0===this._updateCounter&&this._onEndUpdate.fire()}};tq=Jj=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([eq(3,nc),eq(4,sc),eq(5,mc),eq(6,eu),eq(7,sw),eq(8,lO),eq(9,rB),eq(10,Qp),eq(11,BD)],tq);let iq=0;class nq{constructor(e,t,i,n,o,s){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=o,this.attachedView=s}dispose(){Et(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}}class oq extends At{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new Zt(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new Zt(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,2===this._value?this._onDidChangeToTrue.fire():1===this._value&&this._onDidChangeToFalse.fire())}}class sq extends Zt{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class rq extends At{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=Xu.editorSimpleInput.bindTo(t),this._editorFocus=Xu.focus.bindTo(t),this._textInputFocus=Xu.textInputFocus.bindTo(t),this._editorTextFocus=Xu.editorTextFocus.bindTo(t),this._tabMovesFocus=Xu.tabMovesFocus.bindTo(t),this._editorReadonly=Xu.readOnly.bindTo(t),this._inDiffEditor=Xu.inDiffEditor.bindTo(t),this._editorColumnSelection=Xu.columnSelection.bindTo(t),this._hasMultipleSelections=Xu.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=Xu.hasNonEmptySelection.bindTo(t),this._canUndo=Xu.canUndo.bindTo(t),this._canRedo=Xu.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration((()=>this._updateFromConfig()))),this._register(this._editor.onDidChangeCursorSelection((()=>this._updateFromSelection()))),this._register(this._editor.onDidFocusEditorWidget((()=>this._updateFromFocus()))),this._register(this._editor.onDidBlurEditorWidget((()=>this._updateFromFocus()))),this._register(this._editor.onDidFocusEditorText((()=>this._updateFromFocus()))),this._register(this._editor.onDidBlurEditorText((()=>this._updateFromFocus()))),this._register(this._editor.onDidChangeModel((()=>this._updateFromModel()))),this._register(this._editor.onDidChangeConfiguration((()=>this._updateFromModel()))),this._register(sB.onDidChangeTabFocus((e=>this._tabMovesFocus.set(e)))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(e.get(164)||sB.getTabFocusMode()),this._editorReadonly.set(e.get(104)),this._inDiffEditor.set(e.get(70)),this._editorColumnSelection.set(e.get(28))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some((e=>!e.isEmpty())))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(Boolean(e&&e.canUndo())),this._canRedo.set(Boolean(e&&e.canRedo()))}}class aq extends At{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=Xu.languageId.bindTo(t),this._hasCompletionItemProvider=Xu.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=Xu.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=Xu.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=Xu.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=Xu.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=Xu.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=Xu.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=Xu.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=Xu.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=Xu.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=Xu.hasReferenceProvider.bindTo(t),this._hasRenameProvider=Xu.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=Xu.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=Xu.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=Xu.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=Xu.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=Xu.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=Xu.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInEmbeddedEditor=Xu.isInEmbeddedEditor.bindTo(t);const n=()=>this._update();this._register(e.onDidChangeModel(n)),this._register(e.onDidChangeModelLanguage(n)),this._register(i.completionProvider.onDidChange(n)),this._register(i.codeActionProvider.onDidChange(n)),this._register(i.codeLensProvider.onDidChange(n)),this._register(i.definitionProvider.onDidChange(n)),this._register(i.declarationProvider.onDidChange(n)),this._register(i.implementationProvider.onDidChange(n)),this._register(i.typeDefinitionProvider.onDidChange(n)),this._register(i.hoverProvider.onDidChange(n)),this._register(i.documentHighlightProvider.onDidChange(n)),this._register(i.documentSymbolProvider.onDidChange(n)),this._register(i.referenceProvider.onDidChange(n)),this._register(i.renameProvider.onDidChange(n)),this._register(i.documentFormattingEditProvider.onDidChange(n)),this._register(i.documentRangeFormattingEditProvider.onDidChange(n)),this._register(i.signatureHelpProvider.onDidChange(n)),this._register(i.inlayHintsProvider.onDidChange(n)),n()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents((()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInEmbeddedEditor.reset()}))}_update(){const e=this._editor.getModel();e?this._contextKeyService.bufferChangeEvents((()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInEmbeddedEditor.set(e.uri.scheme===So.walkThroughSnippet||e.uri.scheme===So.vscodeChatCodeBlock)})):this.reset()}}class lq{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations((i=>{this._isChangingDecorations||e.call(t,i)}),i)}getRange(e){return this._editor.hasModel()?e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e]):null}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const i of this._decorationIds){const n=e.getDecorationRange(i);n&&t.push(n)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){0!==this._decorationIds.length&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations((t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)}))}finally{this._isChangingDecorations=!1}return this._decorationIds}append(e){let t=[];try{this._isChangingDecorations=!0,this._editor.changeDecorations((i=>{t=i.deltaDecorations([],e),this._decorationIds=this._decorationIds.concat(t)}))}finally{this._isChangingDecorations=!1}return t}}const dq=encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 3' enable-background='new 0 0 6 3' height='3' width='6'><g fill='"),hq=encodeURIComponent("'><polygon points='5.5,0 2.5,3 1.1,3 4.1,0'/><polygon points='4,0 6,2 6,0.6 5.4,0'/><polygon points='0,2 1,3 2.4,3 0,0.6'/></g></svg>");function cq(e){return dq+encodeURIComponent(e.toString())+hq}const uq=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" height="3" width="12"><g fill="'),gq=encodeURIComponent('"><circle cx="1" cy="1" r="1"/><circle cx="5" cy="1" r="1"/><circle cx="9" cy="1" r="1"/></g></svg>');function pq(e){return uq+encodeURIComponent(e.toString())+gq}hw(((e,t)=>{const i=e.getColor(u_);i&&(t.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${cq(i)}") repeat-x bottom left; }`),t.addRule(`:root { --monaco-editor-error-decoration: url("data:image/svg+xml,${cq(i)}"); }`));const n=e.getColor(m_);n&&(t.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${cq(n)}") repeat-x bottom left; }`),t.addRule(`:root { --monaco-editor-warning-decoration: url("data:image/svg+xml,${cq(n)}"); }`));const o=e.getColor(__);o&&(t.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${cq(o)}") repeat-x bottom left; }`),t.addRule(`:root { --monaco-editor-info-decoration: url("data:image/svg+xml,${cq(o)}"); }`));const s=e.getColor(b_);s&&(t.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${pq(s)}") no-repeat bottom left; }`),t.addRule(`:root { --monaco-editor-hint-decoration: url("data:image/svg+xml,${pq(s)}"); }`));const r=e.getColor(Hw);r&&(t.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${r.rgba.a}; }`),t.addRule(`:root { --monaco-editor-unnecessary-decoration-opacity: ${r.rgba.a}; }`))}));class mq{static capture(e){if(0===e.getScrollTop()||e.hasPendingScrollAnimation())return new mq(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;const n=e.getVisibleRanges();if(n.length>0){t=n[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}return new mq(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,n,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=n,this._cursorPosition=o}restore(e){if((this._initialContentHeight!==e.getContentHeight()||this._initialScrollTop!==e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i,1)}}class fq{constructor(){this.lenses=[]}static{this.Empty=new fq}dispose(){this._store?.dispose()}get isDisposed(){return this._store?.isDisposed??!1}add(e,t){Dt(e)&&(this._store??=new Mt,this._store.add(e));for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}async function _q(e,t,i){const n=e.ordered(t),o=new Map,s=new fq,r=n.map((async(e,n)=>{o.set(e,n);try{const n=await Promise.resolve(e.provideCodeLenses(t,i));n&&s.add(n,e)}catch(e){Te(e)}}));return await Promise.all(r),i.isCancellationRequested?(s.dispose(),fq.Empty):(s.lenses=s.lenses.sort(((e,t)=>e.symbol.range.startLineNumber<t.symbol.range.startLineNumber?-1:e.symbol.range.startLineNumber>t.symbol.range.startLineNumber?1:o.get(e.provider)<o.get(t.provider)?-1:o.get(e.provider)>o.get(t.provider)?1:e.symbol.range.startColumn<t.symbol.range.startColumn?-1:e.symbol.range.startColumn>t.symbol.range.startColumn?1:0)),s)}var vq,bq;fc.registerCommand("_executeCodeLensProvider",(function(e,...t){let[i,n]=t;_t(uo.isUri(i)),_t("number"==typeof n||!n);const{codeLensProvider:o}=e.get(BD),s=e.get(ac).getModel(i);if(!s)throw Pe();const r=[],a=new Mt;return _q(o,s,oi.None).then((e=>{a.add(e);const t=[];for(const i of e.lenses)null==n||Boolean(i.symbol.command)?r.push(i.symbol):n-- >0&&i.provider.resolveCodeLens&&t.push(Promise.resolve(i.provider.resolveCodeLens(s,i.symbol,oi.None)).then((e=>r.push(e||i.symbol))));return Promise.all(t)})).then((()=>r)).finally((()=>{setTimeout((()=>a.dispose()),100)}))})),function(e){e[e.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",e[e.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"}(vq||(vq={})),function(e){e[e.None=0]="None",e[e.Initialized=1]="Initialized",e[e.Closed=2]="Closed"}(bq||(bq={}));class wq extends At{static{this.DEFAULT_FLUSH_DELAY=100}constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new Qt),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=bq.None,this.cache=new Map,this.flushDelayer=this._register(new pi(wq.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.pendingClose=void 0,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal((e=>this.onDidChangeItemsExternal(e))))}onDidChangeItemsExternal(e){this._onDidChangeStorage.pause();try{e.changed?.forEach(((e,t)=>this.acceptExternal(t,e))),e.deleted?.forEach((e=>this.acceptExternal(e,void 0)))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===bq.Closed)return;let i=!1;ft(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const i=this.cache.get(e);return ft(i)?t:i}getBoolean(e,t){const i=this.get(e);return ft(i)?t:"true"===i}getNumber(e,t){const i=this.get(e);return ft(i)?t:parseInt(i,10)}async set(e,t,i=!1){if(this.state===bq.Closed)return;if(ft(t))return this.delete(e,i);const n=dt(t)||Array.isArray(t)?(o=t,JSON.stringify(o,lN)):String(t);var o;return this.cache.get(e)!==n?(this.cache.set(e,n),this.pendingInserts.set(e,n),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()):void 0}async delete(e,t=!1){if(this.state!==bq.Closed)return this.cache.delete(e)?(this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()):void 0}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally((()=>{if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)this.whenFlushedCallbacks.pop()?.()}))}async flush(e){if(this.state!==bq.Closed&&!this.pendingClose)return this.doFlush(e)}async doFlush(e){return this.options.hint===vq.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger((()=>this.flushPending()),e)}async whenFlushed(){if(this.hasPending)return new Promise((e=>this.whenFlushedCallbacks.push(e)))}}class Cq{constructor(){this.onDidChangeItemsExternal=zt.None,this.items=new Map}async updateItems(e){e.insert?.forEach(((e,t)=>this.items.set(t,e))),e.delete?.forEach((e=>this.items.delete(e)))}}const yq="__$__targetStorageMarker",Sq=oc("storageService");var xq;!function(e){e[e.NONE=0]="NONE",e[e.SHUTDOWN=1]="SHUTDOWN"}(xq||(xq={}));class kq extends At{static{this.DEFAULT_FLUSH_INTERVAL=6e4}constructor(e={flushInterval:kq.DEFAULT_FLUSH_INTERVAL}){super(),this._onDidChangeValue=this._register(new Qt),this._onDidChangeTarget=this._register(new Qt),this._onWillSaveState=this._register(new Zt),this.onWillSaveState=this._onWillSaveState.event,this.runFlushWhenIdle=this._register(new Rt),this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0,this.flushWhenIdleScheduler=this._register(new Ci((()=>this.doFlushWhenIdle()),e.flushInterval))}onDidChangeValue(e,t,i){return zt.filter(this._onDidChangeValue.event,(i=>i.scope===e&&(void 0===t||i.key===t)),i)}doFlushWhenIdle(){this.runFlushWhenIdle.value=yi((()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()}))}shouldFlushWhenIdle(){return!0}emitDidChangeValue(e,t){const{key:i,external:n}=t;if(i===yq){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:n})}get(e,t,i){return this.getStorage(t)?.get(e,i)}getBoolean(e,t,i){return this.getStorage(t)?.getBoolean(e,i)}getNumber(e,t,i){return this.getStorage(t)?.getNumber(e,i)}store(e,t,i,n,o=!1){ft(t)?this.remove(e,i,o):this.withPausedEmitters((()=>{this.updateKeyTarget(e,i,n),this.getStorage(i)?.set(e,t,o)}))}remove(e,t,i=!1){this.withPausedEmitters((()=>{this.updateKeyTarget(e,t,void 0),this.getStorage(t)?.delete(e,i)}))}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i,n=!1){const o=this.getKeyTargets(t);"number"==typeof i?o[e]!==i&&(o[e]=i,this.getStorage(t)?.set(yq,JSON.stringify(o),n)):"number"==typeof o[e]&&(delete o[e],this.getStorage(t)?.set(yq,JSON.stringify(o),n))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?function(e){const t=e.get(yq);if(t)try{return JSON.parse(t)}catch(e){}return Object.create(null)}(t):Object.create(null)}async flush(e=xq.NONE){this._onWillSaveState.fire({reason:e});const t=this.getStorage(-1),i=this.getStorage(0),n=this.getStorage(1);switch(e){case xq.NONE:await Di.settled([t?.whenFlushed()??Promise.resolve(),i?.whenFlushed()??Promise.resolve(),n?.whenFlushed()??Promise.resolve()]);break;case xq.SHUTDOWN:await Di.settled([t?.flush(0)??Promise.resolve(),i?.flush(0)??Promise.resolve(),n?.flush(0)??Promise.resolve()])}}}const Lq=oc("ICodeLensCache");class Dq{constructor(e,t){this.lineCount=e,this.data=t}}let Eq=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new ad(20,.75),va(r,(()=>e.remove("codelens/cache",1)));const t="codelens/cache2",i=e.get(t,1,"{}");this._deserialize(i);const n=zt.filter(e.onWillSaveState,(e=>e.reason===xq.SHUTDOWN));zt.once(n)((i=>{e.store(t,this._serialize(),1,1)}))}put(e,t){const i=t.lenses.map((e=>({range:e.symbol.range,command:e.symbol.command&&{id:"",title:e.symbol.command?.title}}))),n=new fq;n.add({lenses:i},this._fakeProvider);const o=new Dq(e.getLineCount(),n);this._cache.set(e.uri.toString(),o)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const n=new Set;for(const e of i.data.lenses)n.add(e.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...n.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const e in t){const i=t[e],n=[];for(const e of i.lines)n.push({range:new Yu(e,1,e,11)});const o=new fq;o.add({lenses:n},this._fakeProvider),this._cache.set(e,new Dq(i.lineCount,o))}}catch{}}};Eq=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,Sq)],Eq),wp(Lq,Eq,1);var Nq=i(1727),Iq={};Iq.styleTagTransform=zl(),Iq.setAttributes=Bl(),Iq.insert=Pl().bind(null,"head"),Iq.domAPI=Rl(),Iq.insertStyleElement=Vl(),Ml()(Nq.A,Iq),Nq.A&&Nq.A.locals&&Nq.A.locals;class Tq{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){void 0===this._lastHeight?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return 0!==this._lastHeight&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class Mq{static{this._idPool=0}constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id="codelens.widget-"+Mq._idPool++,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let n=!1;for(let t=0;t<e.length;t++){const o=e[t];if(o&&(n=!0,o.command)){const n=bI(o.command.title.trim());if(o.command.id){const e="c"+Mq._idPool++;i.push(ll("a",{id:e,title:o.command.tooltip,role:"button"},...n)),this._commands.set(e,o.command)}else i.push(ll("span",{title:o.command.tooltip},...n));t+1<e.length&&i.push(ll("span",void 0," | "))}}n?(ol(this._domNode,...i),this._isEmpty&&t&&this._domNode.classList.add("fadein"),this._isEmpty=!1):ol(this._domNode,ll("span",void 0,"no commands"))}getCommand(e){return e.parentElement===this._domNode?this._commands.get(e.id):void 0}getId(){return this._id}getDomNode(){return this._domNode}updatePosition(e){const t=this._editor.getModel().getLineFirstNonWhitespaceColumn(e);this._widgetPosition={position:{lineNumber:e,column:t},preference:[1]}}getPosition(){return this._widgetPosition||null}}class Aq{constructor(){this._removeDecorations=[],this._addDecorations=[],this._addDecorationsCallbacks=[]}addDecoration(e,t){this._addDecorations.push(e),this._addDecorationsCallbacks.push(t)}removeDecoration(e){this._removeDecorations.push(e)}commit(e){const t=e.deltaDecorations(this._removeDecorations,this._addDecorations);for(let e=0,i=t.length;e<i;e++)this._addDecorationsCallbacks[e](t[e])}}const Rq=bk.register({collapseOnReplaceEdit:!0,description:"codelens"});class Oq{constructor(e,t,i,n,o,s){let r;this._isDisposed=!1,this._editor=t,this._data=e,this._decorationIds=[];const a=[];this._data.forEach(((e,t)=>{e.symbol.command&&a.push(e.symbol),i.addDecoration({range:e.symbol.range,options:Rq},(e=>this._decorationIds[t]=e)),r=r?Yu.plusRange(r,e.symbol.range):Yu.lift(e.symbol.range)})),this._viewZone=new Tq(r.startLineNumber-1,o,s),this._viewZoneId=n.addZone(this._viewZone),a.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(a,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new Mq(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t?.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some(((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),n=this._data[t].symbol;return!(!i||Yu.isEmpty(n.range)!==i.isEmpty())}))}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach(((e,i)=>{t.addDecoration({range:e.symbol.range,options:Rq},(e=>this._decorationIds[i]=e))}))}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t<this._decorationIds.length;t++){const i=e.getDecorationRange(this._decorationIds[t]);i&&(this._data[t].symbol.range=i)}return this._data}updateCommands(e){this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(e,!0);for(let t=0;t<this._data.length;t++){const i=e[t];if(i){const{symbol:e}=this._data[t];e.command=i.command||e.command}}}getCommand(e){return this._contentWidget?.getCommand(e)}getLineNumber(){const e=this._editor.getModel().getDecorationRange(this._decorationIds[0]);return e?e.startLineNumber:-1}update(e){if(this.isValid()){const t=this._editor.getModel().getDecorationRange(this._decorationIds[0]);t&&(this._viewZone.afterLineNumber=t.startLineNumber-1,e.layoutZone(this._viewZoneId),this._contentWidget&&(this._contentWidget.updatePosition(t.startLineNumber),this._editor.layoutContentWidget(this._contentWidget)))}}}const Pq=oc("environmentService");var Fq=function(e,t){return function(i,n){t(i,n,e)}};const Bq=oc("ILanguageFeatureDebounceService");var Wq;!function(e){const t=new WeakMap;let i=0;e.of=function(e){let n=t.get(e);return void 0===n&&(n=++i,t.set(e,n)),n}}(Wq||(Wq={}));class Vq{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class Hq{constructor(e,t,i,n,o,s){this._logService=e,this._name=t,this._registry=i,this._default=n,this._min=o,this._max=s,this._cache=new ad(50,.7)}_key(e){return e.id+this._registry.all(e).reduce(((e,t)=>Ho(Wq.of(t),e)),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?FM(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let n=this._cache.get(i);n||(n=new WM(6),this._cache.set(i,n));const o=FM(n.update(t),this._min,this._max);return xo(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new BM;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){return FM(0|this._overall()||this._default,this._min,this._max)}}let zq=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){const n=i?.min??50,o=i?.max??n**2,s=i?.key??void 0,r=`${Wq.of(e)},${n}${s?","+s:""}`;let a=this._data.get(r);return a||(this._isDev?(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),a=new Vq(1.5*n)):a=new Hq(this._logService,t,e,0|this._overallAverage()||1.5*n,n,o),this._data.set(r,a)),a}_overallAverage(){const e=new BM;for(const t of this._data.values())e.update(t.default());return e.value}};zq=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Fq(0,yu),Fq(1,Pq)],zq),wp(Bq,zq,1);var Uq=function(e,t){return function(i,n){t(i,n,e)}};let Kq=class{static{this.ID="css.editor.codeLens"}constructor(e,t,i,n,o,s){this._editor=e,this._languageFeaturesService=t,this._commandService=n,this._notificationService=o,this._codeLensCache=s,this._disposables=new Mt,this._localToDispose=new Mt,this._lenses=[],this._oldCodeLensModels=new Mt,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new Ci((()=>this._resolveCodeLensesInViewport()),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel((()=>this._onModelChange()))),this._disposables.add(this._editor.onDidChangeModelLanguage((()=>this._onModelChange()))),this._disposables.add(this._editor.onDidChangeConfiguration((e=>{(e.hasChanged(59)||e.hasChanged(25)||e.hasChanged(24))&&this._updateLensStyle(),e.hasChanged(23)&&this._onModelChange()}))),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){this._localDispose(),this._localToDispose.dispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),this._currentCodeLensModel?.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(75)/this._editor.getOption(61));let t=this._editor.getOption(25);return(!t||t<5)&&(t=.9*this._editor.getOption(61)|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(24),n=this._editor.getOption(59),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),o.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",n.fontFeatureSettings),i&&(o.setProperty("--vscode-editorCodeLens-fontFamily",i),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",fP.fontFamily)),this._editor.changeViewZones((t=>{for(const i of this._lenses)i.updateHeight(e,t)}))}_localDispose(){this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=void 0,this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),this._currentCodeLensModel?.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e)return;if(!this._editor.getOption(23)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e))return void(t&&fi((()=>{const i=this._codeLensCache.get(e);t===i&&(this._codeLensCache.delete(e),this._onModelChange())}),3e4,this._localToDispose));for(const t of this._languageFeaturesService.codeLensProvider.all(e))if("function"==typeof t.onDidChange){const e=t.onDidChange((()=>i.schedule()));this._localToDispose.add(e)}const i=new Ci((()=>{const t=Date.now();this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=hi((t=>_q(this._languageFeaturesService.codeLensProvider,e,t))),this._getCodeLensModelPromise.then((n=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=n,this._codeLensCache.put(e,n);const o=this._provideCodeLensDebounce.update(e,Date.now()-t);i.delay=o,this._renderCodeLensSymbols(n),this._resolveCodeLensesInViewportSoon()}),Ie)}),this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(Tt((()=>this._resolveCodeLensesScheduler.cancel()))),this._localToDispose.add(this._editor.onDidChangeModelContent((()=>{this._editor.changeDecorations((e=>{this._editor.changeViewZones((t=>{const i=[];let n=-1;this._lenses.forEach((e=>{e.isValid()&&n!==e.getLineNumber()?(e.update(t),n=e.getLineNumber()):i.push(e)}));const o=new Aq;i.forEach((e=>{e.dispose(o,t),this._lenses.splice(this._lenses.indexOf(e),1)})),o.commit(e)}))})),i.schedule(),this._resolveCodeLensesScheduler.cancel(),this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0}))),this._localToDispose.add(this._editor.onDidFocusEditorText((()=>{i.schedule()}))),this._localToDispose.add(this._editor.onDidBlurEditorText((()=>{i.cancel()}))),this._localToDispose.add(this._editor.onDidScrollChange((e=>{e.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()}))),this._localToDispose.add(this._editor.onDidLayoutChange((()=>{this._resolveCodeLensesInViewportSoon()}))),this._localToDispose.add(Tt((()=>{if(this._editor.getModel()){const e=mq.capture(this._editor);this._editor.changeDecorations((e=>{this._editor.changeViewZones((t=>{this._disposeAllLenses(e,t)}))})),e.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)}))),this._localToDispose.add(this._editor.onMouseDown((e=>{if(9!==e.target.type)return;let t=e.target.element;if("SPAN"===t?.tagName&&(t=t.parentElement),"A"===t?.tagName)for(const e of this._lenses){const i=e.getCommand(t);if(i){this._commandService.executeCommand(i.id,...i.arguments||[]).catch((e=>this._notificationService.error(e)));break}}}))),i.schedule()}_disposeAllLenses(e,t){const i=new Aq;for(const e of this._lenses)e.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let n;for(const o of e.lenses){const e=o.symbol.range.startLineNumber;e<1||e>t||(n&&n[n.length-1].symbol.range.startLineNumber===e?n.push(o):(n=[o],i.push(n)))}if(!i.length&&!this._lenses.length)return;const o=mq.capture(this._editor),s=this._getLayoutInfo();this._editor.changeDecorations((e=>{this._editor.changeViewZones((t=>{const n=new Aq;let o=0,r=0;for(;r<i.length&&o<this._lenses.length;){const e=i[r][0].symbol.range.startLineNumber,a=this._lenses[o].getLineNumber();a<e?(this._lenses[o].dispose(n,t),this._lenses.splice(o,1)):a===e?(this._lenses[o].updateCodeLensSymbols(i[r],n),r++,o++):(this._lenses.splice(o,0,new Oq(i[r],this._editor,n,t,s.codeLensHeight,(()=>this._resolveCodeLensesInViewportSoon()))),o++,r++)}for(;o<this._lenses.length;)this._lenses[o].dispose(n,t),this._lenses.splice(o,1);for(;r<i.length;)this._lenses.push(new Oq(i[r],this._editor,n,t,s.codeLensHeight,(()=>this._resolveCodeLensesInViewportSoon()))),r++;n.commit(e)}))})),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0;const e=this._editor.getModel();if(!e)return;const t=[],i=[];if(this._lenses.forEach((n=>{const o=n.computeIfNecessary(e);o&&(t.push(o),i.push(n))})),0===t.length)return void this._oldCodeLensModels.clear();const n=Date.now(),o=hi((n=>{const o=t.map(((t,o)=>{const s=new Array(t.length),r=t.map(((t,i)=>t.symbol.command||"function"!=typeof t.provider.resolveCodeLens?(s[i]=t.symbol,Promise.resolve(void 0)):Promise.resolve(t.provider.resolveCodeLens(e,t.symbol,n)).then((e=>{s[i]=e}),Te)));return Promise.all(r).then((()=>{n.isCancellationRequested||i[o].isDisposed()||i[o].updateCommands(s)}))}));return Promise.all(o)}));this._resolveCodeLensesPromise=o,this._resolveCodeLensesPromise.then((()=>{const t=this._resolveCodeLensesDebounce.update(e,Date.now()-n);this._resolveCodeLensesScheduler.delay=t,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)}),(e=>{Ie(e),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)}))}async getModel(){return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,this._currentCodeLensModel?.isDisposed?void 0:this._currentCodeLensModel}};Kq=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Uq(1,BD),Uq(2,Bq),Uq(3,mc),Uq(4,lO),Uq(5,Lq)],Kq),Uu(Kq.ID,Kq,1),Hu(class extends Pu{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:Xu.hasCodeLensProvider,label:x(880,"Show CodeLens Commands for Current Line")})}async run(e,t){if(!t.hasModel())return;const i=e.get(LD),n=e.get(mc),o=e.get(lO),s=t.getSelection().positionLineNumber,r=t.getContribution(Kq.ID);if(!r)return;const a=await r.getModel();if(!a)return;const l=[];for(const e of a.lenses)e.symbol.command&&e.symbol.range.startLineNumber===s&&l.push({label:e.symbol.command.title,command:e.symbol.command});if(0===l.length)return;const d=await i.pick(l,{canPickMany:!1,placeHolder:y(879,"Select a command")});if(!d)return;let h=d.command;if(a.isDisposed){const e=await r.getModel(),t=e?.lenses.find((e=>e.symbol.range.startLineNumber===s&&e.symbol.command?.title===h.title));if(!t||!t.symbol.command)return;h=t.symbol.command}try{await n.executeCommand(h.id,...h.arguments||[])}catch(e){o.error(e)}}});const jq=[];function qq(e){jq.push(e)}function $q(){return jq.slice(0)}class Gq{constructor(e,t,i,n){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=n,this.type=1}equals(e){return 1===e.type&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return 1===e.type&&t.lineNumber===this.range.startLineNumber}}class Zq{constructor(e,t,i,n,o,s){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=n,this.initialMousePosY=o,this.supportsMarkerHover=s,this.type=2}equals(e){return 2===e.type&&this.owner===e.owner}canAdoptVisibleHover(e,t){return 2===e.type&&this.owner===e.owner}}class Yq{constructor(e,t){this.renderedHoverParts=e,this.disposables=t}dispose(){for(const e of this.renderedHoverParts)e.dispose();this.disposables?.dispose()}}const Qq=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}},Xq=oc("editorWorkerService");var Jq=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},e$=function(e,t){return function(i,n){t(i,n,e)}};let t$=class{constructor(e){this._editorWorkerService=e}async provideDocumentColors(e,t){return this._editorWorkerService.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){const n=t.range,o=t.color,s=o.alpha,r=new Lg(new Sg(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),s)),a=s?Lg.Format.CSS.formatRGBA(r):Lg.Format.CSS.formatRGB(r),l=s?Lg.Format.CSS.formatHSLA(r):Lg.Format.CSS.formatHSL(r),d=s?Lg.Format.CSS.formatHexA(r):Lg.Format.CSS.formatHex(r),h=[];return h.push({label:a,textEdit:{range:n,text:a}}),h.push({label:l,textEdit:{range:n,text:l}}),h.push({label:d,textEdit:{range:n,text:d}}),h}};t$=Jq([e$(0,Xq)],t$);let i$=class extends At{constructor(e,t){super(),this._register(e.colorProvider.register("*",new t$(t)))}};async function n$(e,t,i,n="auto"){return l$(new s$,e,t,i,n)}function o$(e,t,i,n){return Promise.resolve(i.provideColorPresentations(e,t,n))}i$=Jq([e$(0,BD),e$(1,Xq)],i$);class s${constructor(){}async compute(e,t,i,n){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const t of o)n.push({colorInfo:t,provider:e});return Array.isArray(o)}}class r${constructor(){}async compute(e,t,i,n){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const e of o)n.push({range:e.range,color:[e.color.red,e.color.green,e.color.blue,e.color.alpha]});return Array.isArray(o)}}class a${constructor(e){this.colorInfo=e}async compute(e,t,i,n){const o=await e.provideColorPresentations(t,this.colorInfo,oi.None);return Array.isArray(o)&&n.push(...o),Array.isArray(o)}}async function l$(e,t,i,n,o){let s,r=!1;const a=[],l=t.ordered(i);for(let t=l.length-1;t>=0;t--){const d=l[t];if("always"!==o&&d instanceof t$)s=d;else try{await e.compute(d,i,n,a)&&(r=!0)}catch(e){Te(e)}}return r?a:s&&"never"!==o?(await e.compute(s,i,n,a),a):[]}function d$(e,t){const{colorProvider:i}=e.get(BD),n=e.get(ac).getModel(t);if(!n)throw Pe();return{model:n,colorProviderRegistry:i,defaultColorDecoratorsEnablement:e.get(up).getValue("editor.defaultColorDecorators",{resource:t})}}var h$,c$=function(e,t){return function(i,n){t(i,n,e)}};const u$=Object.create({});let g$=class extends At{static{h$=this}static{this.ID="editor.contrib.colorDetector"}static{this.RECOMPUTE_TIME=1e3}constructor(e,t,i,n){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new Mt),this._decorationsIds=[],this._colorDatas=new Map,this._decoratorLimitReporter=this._register(new p$),this._colorDecorationClassRefs=this._register(new Mt),this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=this._register(new kB(this._editor)),this._debounceInformation=n.for(i.colorProvider,"Document Colors",{min:h$.RECOMPUTE_TIME}),this._register(e.onDidChangeModel((()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()}))),this._register(e.onDidChangeModelLanguage((()=>this.updateColors()))),this._register(i.colorProvider.onDidChange((()=>this.updateColors()))),this._register(e.onDidChangeConfiguration((e=>{const t=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(167);const i=t!==this._isColorDecoratorsEnabled||e.hasChanged(27),n=e.hasChanged(167);(i||n)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())}))),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(167),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&"object"==typeof i){const e=i.colorDecorators;if(e&&void 0!==e.enable&&!e.enable)return e.enable}return this._editor.getOption(26)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();e&&this._languageFeaturesService.colorProvider.has(e)&&(this._localToDispose.add(this._editor.onDidChangeModelContent((()=>{this._timeoutTimer||(this._timeoutTimer=new bi,this._timeoutTimer.cancelAndSet((()=>{this._timeoutTimer=null,this.beginCompute()}),this._debounceInformation.get(e)))}))),this.beginCompute())}async beginCompute(){this._computePromise=hi((async e=>{const t=this._editor.getModel();if(!t)return[];const i=new Ht(!1),n=await n$(this._languageFeaturesService.colorProvider,t,e,this._defaultColorDecoratorsEnablement);return this._debounceInformation.update(t,i.elapsed()),n}));try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){Ie(e)}}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map((e=>({range:{startLineNumber:e.colorInfo.range.startLineNumber,startColumn:e.colorInfo.range.startColumn,endLineNumber:e.colorInfo.range.endLineNumber,endColumn:e.colorInfo.range.endColumn},options:bk.EMPTY})));this._editor.changeDecorations((i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach(((t,i)=>this._colorDatas.set(t,e[i])))}))}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(27);for(let n=0;n<e.length&&t.length<i;n++){const{red:i,green:o,blue:s,alpha:r}=e[n].colorInfo.color,a=new Sg(Math.round(255*i),Math.round(255*o),Math.round(255*s),r),l=`rgba(${a.r}, ${a.g}, ${a.b}, ${a.a})`,d=this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({backgroundColor:l}));t.push({range:{startLineNumber:e[n].colorInfo.range.startLineNumber,startColumn:e[n].colorInfo.range.startColumn,endLineNumber:e[n].colorInfo.range.endLineNumber,endColumn:e[n].colorInfo.range.endColumn},options:{description:"colorDetector",before:{content:" ",inlineClassName:`${d.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:u$}}})}const n=i<e.length&&i;this._decoratorLimitReporter.update(e.length,n),this._colorDecoratorIds.set(t)}removeAllDecorations(){this._editor.removeDecorations(this._decorationsIds),this._decorationsIds=[],this._colorDecoratorIds.clear(),this._colorDecorationClassRefs.clear()}getColorData(e){const t=this._editor.getModel();if(!t)return null;const i=t.getDecorationsInRange(Yu.fromPositions(e,e)).filter((e=>this._colorDatas.has(e.id)));return 0===i.length?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};g$=h$=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([c$(1,up),c$(2,BD),c$(3,Bq)],g$);class p$ extends At{constructor(){super(...arguments),this._onDidChange=this._register(new Zt),this._computed=0,this._limited=!1}update(e,t){e===this._computed&&t===this._limited||(this._computed=e,this._limited=t,this._onDidChange.fire())}}const m$="editor.action.showHover",f$="editor.action.increaseHoverVerbosityLevel",_$=y(1097,"Increase Hover Verbosity Level"),v$="editor.action.decreaseHoverVerbosityLevel",b$=y(1098,"Decrease Hover Verbosity Level");function w$(e,t){return e}function C$(e){return Or(e)}new Map;var y$=i(9862),S$={};S$.styleTagTransform=zl(),S$.setAttributes=Bl(),S$.insert=Pl().bind(null,"head"),S$.domAPI=Rl(),S$.insertStyleElement=Vl(),Ml()(y$.A,S$),y$.A&&y$.A.locals&&y$.A.locals;class x$ extends hc{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new Zt),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=il(e,ll(".monaco-dropdown")),this._label=il(this._element,ll(".dropdown-label"));let i=t.labelRenderer;i||(i=e=>(e.textContent=t.label||"",null));for(const e of[Qa.CLICK,Qa.MOUSE_DOWN,XT.Tap])this._register(ga(this.element,e,(e=>Ja(e,!0))));for(const e of[Qa.MOUSE_DOWN,XT.Tap])this._register(ga(this._label,e,(e=>{Za(e)&&0!==e.button||(this.visible?this.hide():this.show())})));this._register(ga(this._label,Qa.KEY_DOWN,(e=>{const t=new Ze(e);(t.equals(3)||t.equals(10))&&(Ja(e,!0),this.visible?this.hide():this.show())})));const n=i(this._label);n&&this._register(n),this._register(JT.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class k$ extends x${constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class L$ extends dR{get onDidChangeVisibility(){return this._onDidChangeVisibility.event}constructor(e,t,i,n=Object.create(null)){super(null,e,n),this.actionItem=null,this._onDidChangeVisibility=this._register(new Zt),this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=n,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=Array.isArray(this.menuActionsOrProvider),i={contextMenuProvider:this.contextMenuProvider,labelRenderer:e=>(this.element=il(e,ll("a.action-label")),this.renderLabel(this.element)),menuAsChild:this.options.menuAsChild,actions:t?this.menuActionsOrProvider:void 0,actionProvider:t?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new k$(e,i)),this._register(this.dropdownMenu.onDidChangeVisibility((e=>{this.element?.setAttribute("aria-expanded",`${e}`),this._onDidChangeVisibility.fire(e)}))),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const e=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return e.options.anchorAlignmentProvider()}}}this.updateTooltip(),this.updateEnabled()}renderLabel(e){let t=[];return"string"==typeof this.options.classNames?t=this.options.classNames.split(/\s+/g).filter((e=>!!e)):this.options.classNames&&(t=this.options.classNames),t.find((e=>"icon"===e))||t.push("codicon"),e.classList.add(...t),this._action.label&&this._register(lM().setupManagedHover(this.options.hoverDelegate??nM("mouse"),e,this._action.label)),null}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){this.dropdownMenu?.show()}updateEnabled(){const e=!this.action.enabled;this.actionItem?.classList.toggle("disabled",e),this.element?.classList.toggle("disabled",e)}}function D$(e,t){if(Y)return!1;const i=function(e,t){return t||(t=E$(e)),"native"===t}(e,t),n=e.getValue("window");return"native"===n?.menuStyle?!(!$&&!i):"custom"!==n?.menuStyle&&i}function E$(e){if(Y)return"custom";const t=e.getValue("window");if(t){if($&&!0===t.nativeTabs)return"native";if($&&!1===t.nativeFullScreen)return"native";const e=t.titleBarStyle;if("native"===e||"custom"===e)return e}return"custom"}var N$=i(9055),I$={};I$.styleTagTransform=zl(),I$.setAttributes=Bl(),I$.insert=Pl().bind(null,"head"),I$.domAPI=Rl(),I$.insertStyleElement=Vl(),Ml()(N$.A,I$),N$.A&&N$.A.locals&&N$.A.locals;var T$=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},M$=function(e,t){return function(i,n){t(i,n,e)}};function A$(e,t,i,n){const o={primary:[],secondary:[]};return R$(e,o,t,i,n),o}function R$(e,t,i,n,o){O$(e,t,!1,"string"==typeof i?e=>e===i:i,n,o)}function O$(e,t,i,n=e=>"navigation"===e,o=()=>!1,s=!1){let r,a;Array.isArray(t)?(r=t,a=t):(r=t.primary,a=t.secondary);const l=new Set;for(const[t,o]of e){let e;n(t)?(e=r,e.length>0&&s&&e.push(new cc)):(e=a,e.length>0&&e.push(new cc));for(let n of o){i&&(n=n instanceof vu&&n.alt?n.alt:n);const o=e.push(n);n instanceof uc&&l.add({group:t,action:n,index:o-1})}}for(const{group:e,action:t,index:i}of l){const s=n(e)?r:a,l=t.actions;o(t,e,s.length)&&s.splice(i,1,...l)}}let P$=class extends hR{constructor(e,t,i,n,o,s,r,a){super(void 0,e,{icon:!(!e.class&&!e.item.icon),label:!e.class&&!e.item.icon,draggable:t?.draggable,keybinding:t?.keybinding,hoverDelegate:t?.hoverDelegate,keybindingNotRenderedWithLabel:t?.keybindingNotRenderedWithLabel}),this._options=t,this._keybindingService=i,this._notificationService=n,this._contextKeyService=o,this._themeService=s,this._contextMenuService=r,this._accessibilityService=a,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Rt),this._altKey=gl.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}async onClick(e){e.preventDefault(),e.stopPropagation();try{await this.actionRunner.run(this._commandAction,this._context)}catch(e){this._notificationService.error(e)}}render(e){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1;const i=()=>{const e=!!this._menuItemAction.alt?.enabled&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);e!==this._wantsAltCommand&&(this._wantsAltCommand=e,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(ga(e,"mouseleave",(e=>{t=!1,i()}))),this._register(ga(e,"mouseenter",(e=>{t=!0,i()}))),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){const e=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),t=e&&e.getLabel(),i=this._commandAction.tooltip||this._commandAction.label;let n=t?y(1629,"{0} ({1})",i,t):i;if(!this._wantsAltCommand&&this._menuItemAction.alt?.enabled){const e=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,t=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),i=t&&t.getLabel(),o=i?y(1630,"{0} ({1})",e,i):e;n=y(1631,"{0}\n[{1}] {2}",n,fR.modifierLabels[se].altKey,o)}return n}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const n=this._commandAction.checked&&(o=e.toggled)&&void 0!==o.condition&&e.toggled.icon?e.toggled.icon:e.icon;var o;if(n)if(vh.isThemeIcon(n)){const e=vh.asClassNameArray(n);i.classList.add(...e),this._itemClassDispose.value=Tt((()=>{i.classList.remove(...e)}))}else i.style.backgroundImage=ow(this._themeService.getColorTheme().type)?CM(n.dark):CM(n.light),i.classList.add("icon"),this._itemClassDispose.value=Nt(Tt((()=>{i.style.backgroundImage="",i.classList.remove("icon")})),this._themeService.onDidColorThemeChange((()=>{this.updateClass()})))}};P$=T$([M$(2,ER),M$(3,lO),M$(4,eu),M$(5,sw),M$(6,DR),M$(7,rB)],P$);class F$ extends P${render(e){this.options.label=!0,this.options.icon=!1,super.render(e),e.classList.add("text-only"),e.classList.toggle("use-comma",this._options?.useComma??!1)}updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=F$._symbolPrintEnter(e);this._options?.conversational?this.label.textContent=y(1632,"{1} to {0}",this._action.label,t):this.label.textContent=y(1633,"{0} ({1})",this._action.label,t)}}static _symbolPrintEnter(e){return e.getLabel()?.replace(/\benter\b/gi,"⏎").replace(/\bEscape\b/gi,"Esc")}}let B$=class extends L${constructor(e,t,i,n,o){const s={...t,menuAsChild:t?.menuAsChild??!1,classNames:t?.classNames??(vh.isThemeIcon(e.item.icon)?vh.asClassName(e.item.icon):void 0),keybindingProvider:t?.keybindingProvider??(e=>i.lookupKeybinding(e.id))};super(e,{getActions:()=>e.actions},n,s),this._keybindingService=i,this._contextMenuService=n,this._themeService=o}render(e){super.render(e),_t(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!vh.isThemeIcon(i)){this.element.classList.add("icon");const e=()=>{this.element&&(this.element.style.backgroundImage=ow(this._themeService.getColorTheme().type)?CM(i.dark):CM(i.light))};e(),this._register(this._themeService.onDidColorThemeChange((()=>{e()})))}}};B$=T$([M$(2,ER),M$(3,DR),M$(4,sw)],B$);let W$=class extends dR{constructor(e,t,i,n,o,s,r,a){let l;super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=o,this._menuService=s,this._instaService=r,this._storageService=a,this._defaultActionDisposables=this._register(new Mt),this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;const d=t?.persistLastActionId?a.get(this._storageKey,1):void 0;d&&(l=e.actions.find((e=>d===e.id))),l||(l=e.actions[0]),this._defaultAction=this._defaultActionDisposables.add(this._instaService.createInstance(P$,l,{keybinding:this._getDefaultActionKeybindingLabel(l)}));const h={keybindingProvider:e=>this._keybindingService.lookupKeybinding(e.id),...t,menuAsChild:t?.menuAsChild??!0,classNames:t?.classNames??["codicon","codicon-chevron-down"],actionRunner:t?.actionRunner??this._register(new hc)};this._dropdown=this._register(new L$(e,e.actions,this._contextMenuService,h)),this._register(this._dropdown.actionRunner.onDidRun((e=>{e.action instanceof vu&&this.update(e.action)})))}update(e){this._options?.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultActionDisposables.clear(),this._defaultAction=this._defaultActionDisposables.add(this._instaService.createInstance(P$,e,{keybinding:this._getDefaultActionKeybindingLabel(e)})),this._defaultAction.actionRunner=this._defaultActionDisposables.add(new class extends hc{async runAction(e,t){await e.run(void 0)}}),this._container&&this._defaultAction.render(nl(this._container,ll(".action-container")))}_getDefaultActionKeybindingLabel(e){let t;if(this._options?.renderKeybindingWithDefaultActionLabel){const i=this._keybindingService.lookupKeybinding(e.id);i&&(t=`(${i.getLabel()})`)}return t}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=ll(".action-container");this._defaultAction.render(il(this._container,t)),this._register(ga(t,Qa.KEY_DOWN,(e=>{const t=new Ze(e);t.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),t.stopPropagation())})));const i=ll(".dropdown-action-container");this._dropdown.render(il(this._container,i)),this._register(ga(i,Qa.KEY_DOWN,(e=>{const t=new Ze(e);t.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),this._defaultAction.element?.focus(),t.stopPropagation())})))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}};W$=T$([M$(2,ER),M$(3,lO),M$(4,DR),M$(5,pu),M$(6,nc),M$(7,Sq)],W$);let V$=class extends cR{constructor(e,t,i){super(null,e,e.actions.map((e=>({text:e.id===cc.ID?"─────────":e.label,isDisabled:!e.enabled}))),0,t,WR,{ariaLabel:e.tooltip,optionsAsChildren:!0,useCustomDrawn:!D$(i)}),this.select(Math.max(0,e.actions.findIndex((e=>e.checked))))}render(e){super.render(e),e.style.borderColor=Af(Wv)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};function H$(e,t,i){return t instanceof vu?e.createInstance(P$,t,i):t instanceof _u?t.item.isSelection?e.createInstance(V$,t):t.item.rememberDefaultAction?e.createInstance(W$,t,{...i,persistLastActionId:!0}):e.createInstance(B$,t,i):void 0}V$=T$([M$(1,LR),M$(2,up)],V$);var z$=i(7982),U$={};U$.styleTagTransform=zl(),U$.setAttributes=Bl(),U$.insert=Pl().bind(null,"head"),U$.domAPI=Rl(),U$.insertStyleElement=Vl(),Ml()(z$.A,U$),z$.A&&z$.A.locals&&z$.A.locals;class K$ extends At{get onDidChangeDropdownVisibility(){return this._onDidChangeDropdownVisibility.event}constructor(e,t,i={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new ei),this.disposables=this._register(new Mt),i.hoverDelegate=i.hoverDelegate??this._register(oM()),this.options=i,this.toggleMenuAction=this._register(new j$((()=>this.toggleMenuActionViewItem?.show()),i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new uR(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(e,n)=>{if(e.id===j$.ID)return this.toggleMenuActionViewItem=new L$(e,e.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:vh.asClassNameArray(i.moreIcon??fh.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0,hoverDelegate:this.options.hoverDelegate}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const t=i.actionViewItemProvider(e,n);if(t)return t}if(e instanceof uc){const i=new L$(e,e.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:e.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return i.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(i),this.disposables.add(this._onDidChangeDropdownVisibility.add(i.onDidChangeVisibility)),i}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}set context(e){this.actionBar.context=e,this.toggleMenuActionViewItem?.setActionContext(e);for(const t of this.submenuActionViewItems)t.setActionContext(e)}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();const i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach((e=>{this.actionBar.push(e,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(e)})}))}getKeybindingLabel(e){const t=this.options.getKeyBinding?.(e);return t?.getLabel()??void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class j$ extends dc{static{this.ID="toolbar.toggle.more"}constructor(e,t){t=t||y(17,"More Actions..."),super(j$.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}var q$,$$,G$=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Z$=function(e,t){return function(i,n){t(i,n,e)}};let Y$=class{constructor(e,t,i){this._commandService=e,this._keybindingService=t,this._hiddenStates=new Q$(i)}createMenu(e,t,i){return new eG(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t)}getMenuActions(e,t,i){const n=new eG(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t),o=n.getActions(i);return n.dispose(),o}resetHiddenStates(e){this._hiddenStates.reset(e)}};Y$=G$([Z$(0,mc),Z$(1,ER),Z$(2,Sq)],Y$);let Q$=class{static{q$=this}static{this._key="menu.hiddenCommands"}constructor(e){this._storageService=e,this._disposables=new Mt,this._onDidChange=new Zt,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(q$._key,0,"{}");this._data=JSON.parse(t)}catch(e){this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,q$._key,this._disposables)((()=>{if(!this._ignoreChangeEvent)try{const t=e.get(q$._key,0,"{}");this._data=JSON.parse(t)}catch(e){console.log("FAILED to read storage after UPDATE",e)}this._onDidChange.fire()})))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){return this._hiddenByDefaultCache.get(`${e.id}/${t}`)??!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){const i=this._isHiddenByDefault(e,t),n=this._data[e.id]?.includes(t)??!1;return i?!n:n}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const n=this._data[e.id];if(i)n?n.indexOf(t)<0&&n.push(t):this._data[e.id]=[t];else if(n){const i=n.indexOf(t);i>=0&&function(e,t){const i=e.length-1;t<i&&(e[t]=e[i]),e.pop()}(n,i),0===n.length&&delete this._data[e.id]}this._persist()}reset(e){if(void 0===e)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(q$._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};Q$=q$=G$([Z$(0,Sq)],Q$);class X${constructor(e,t){this._id=e,this._collectContextKeysForSubmenus=t,this._menuGroups=[],this._allMenuIds=new Set,this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get allMenuIds(){return this._allMenuIds}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._allMenuIds.clear(),this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=this._sort(fu.getMenuItems(this._id));let t;for(const i of e){const e=i.group||"";t&&t[0]===e||(t=[e,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeysAndSubmenuIds(i)}this._allMenuIds.add(this._id)}_sort(e){return e}_collectContextKeysAndSubmenuIds(e){if(X$._fillInKbExprKeys(e.when,this._structureContextKeys),uu(e)){if(e.command.precondition&&X$._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;X$._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&(fu.getMenuItems(e.submenu).forEach(this._collectContextKeysAndSubmenuIds,this),this._allMenuIds.add(e.submenu))}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}}let J$=$$=class extends X${constructor(e,t,i,n,o,s){super(e,i),this._hiddenStates=t,this._commandService=n,this._keybindingService=o,this._contextKeyService=s,this.refresh()}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[n,o]=i;let s;for(const t of o)if(this._contextKeyService.contextMatchesRules(t.when)){const i=uu(t);i&&this._hiddenStates.setDefaultState(this._id,t.command.id,!!t.isHiddenByDefault);const n=tG(this._id,i?t.command:t,this._hiddenStates);if(i){const i=iG(this._commandService,this._keybindingService,t.command.id,t.when);(s??=[]).push(new vu(t.command,t.alt,e,n,i,this._contextKeyService,this._commandService))}else{const i=new $$(t.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._keybindingService,this._contextKeyService).createActionGroups(e),o=cc.join(...i.map((e=>e[1])));o.length>0&&(s??=[]).push(new _u(t,n,o))}}s&&s.length>0&&t.push([n,s])}return t}_sort(e){return e.sort($$._compareMenuItems)}static _compareMenuItems(e,t){const i=e.group,n=t.group;if(i!==n){if(!i)return 1;if(!n)return-1;if("navigation"===i)return-1;if("navigation"===n)return 1;const e=i.localeCompare(n);if(0!==e)return e}const o=e.order||0,s=t.order||0;return o<s?-1:o>s?1:$$._compareTitles(uu(e)?e.command.title:e.title,uu(t)?t.command.title:t.title)}static _compareTitles(e,t){const i="string"==typeof e?e:e.original,n="string"==typeof t?t:t.original;return i.localeCompare(n)}};J$=$$=G$([Z$(3,mc),Z$(4,ER),Z$(5,eu)],J$);let eG=class{constructor(e,t,i,n,o,s){this._disposables=new Mt,this._menuInfo=new J$(e,t,i.emitEventsForSubmenuChanges,n,o,s);const r=new Ci((()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})}),i.eventDebounceDelay);this._disposables.add(r),this._disposables.add(fu.onDidChangeMenu((e=>{for(const t of this._menuInfo.allMenuIds)if(e.has(t)){r.schedule();break}})));const a=this._disposables.add(new Mt);this._onDidChange=new Xt({onWillAddFirstListener:()=>{a.add(s.onDidChangeContext((e=>{const t=e.affectsSome(this._menuInfo.structureContextKeys),i=e.affectsSome(this._menuInfo.preconditionContextKeys),n=e.affectsSome(this._menuInfo.toggledContextKeys);(t||i||n)&&this._onDidChange.fire({menu:this,isStructuralChange:t,isEnablementChange:i,isToggleChange:n})}))),a.add(t.onDidChange((e=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})})))},onDidRemoveLastListener:a.clear.bind(a),delay:i.eventDebounceDelay,merge:e=>{let t=!1,i=!1,n=!1;for(const o of e)if(t=t||o.isStructuralChange,i=i||o.isEnablementChange,n=n||o.isToggleChange,t&&i&&n)break;return{menu:this,isStructuralChange:t,isEnablementChange:i,isToggleChange:n}}}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};function tG(e,t,i){const n=void 0!==t.submenu?t.submenu.id:t.id,o="string"==typeof t.title?t.title:t.title.value,s=pc({id:`hide/${e.id}/${n}`,label:y(1636,"Hide '{0}'",o),run(){i.updateHidden(e,n,!0)}}),r=pc({id:`toggle/${e.id}/${n}`,label:o,get checked(){return!i.isHidden(e,n)},run(){i.updateHidden(e,n,!!this.checked)}});return{hide:s,toggle:r,get isHidden(){return!r.checked}}}function iG(e,t,i,n=void 0,o=!0){return pc({id:`configureKeybinding/${i}`,label:y(1637,"Configure Keybinding"),enabled:o,run(){const o=!t.lookupKeybinding(i)&&n?n.serialize():void 0;e.executeCommand("workbench.action.openGlobalKeybindings",`@command:${i}`+(o?` +when:${o}`:""))}})}eG=G$([Z$(3,mc),Z$(4,ER),Z$(5,eu)],eG);const nG=oc("IActionViewItemService");wp(nG,class{constructor(){this._providers=new Map,this._onDidChange=new Zt,this.onDidChange=this._onDidChange.event}dispose(){this._onDidChange.dispose()}lookUp(e,t){return this._providers.get(this._makeKey(e,t))}_makeKey(e,t){return`${e.id}/${t instanceof gu?t.id:t}`}},1);var oG=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},sG=function(e,t){return function(i,n){t(i,n,e)}};let rG=class extends K${constructor(e,t,i,n,o,s,r,a){super(e,o,{getKeyBinding:e=>s.lookupKeybinding(e.id)??void 0,...t,allowContextMenu:!0,skipTelemetry:"string"==typeof t?.telemetrySource}),this._options=t,this._menuService=i,this._contextKeyService=n,this._contextMenuService=o,this._keybindingService=s,this._commandService=r,this._sessionDisposables=this._store.add(new Mt);const l=t?.telemetrySource;l&&this._store.add(this.actionBar.onDidRun((e=>a.publicLog2("workbenchActionExecuted",{id:e.action.id,from:l}))))}setActions(e,t=[],i){this._sessionDisposables.clear();const n=e.slice(),o=t.slice(),s=[];let r=0;const a=[];let l=!1;if(-1!==this._options?.hiddenItemStrategy)for(let e=0;e<n.length;e++){const t=n[e];(t instanceof vu||t instanceof _u)&&t.hideActions&&(s.push(t.hideActions.toggle),t.hideActions.toggle.checked&&r++,t.hideActions.isHidden&&(l=!0,n[e]=void 0,0!==this._options?.hiddenItemStrategy&&(a[e]=t)))}if(void 0!==this._options?.overflowBehavior){const e=ek(new Set(this._options.overflowBehavior.exempted),Ct.map(n,(e=>e?.id))),t=this._options.overflowBehavior.maxItems-e.size;let i=0;for(let o=0;o<n.length;o++){const s=n[o];s&&(i++,e.has(s.id)||i>=t&&(n[o]=void 0,a[o]=s))}}ls(n),ls(a),super.setActions(n,cc.join(a,o)),(s.length>0||n.length>0)&&this._sessionDisposables.add(ga(this.getElement(),"contextmenu",(e=>{const t=new Je(ta(this.getElement()),e),n=this.getItemAction(t.target);if(!n)return;t.preventDefault(),t.stopPropagation();const o=[];if(n instanceof vu&&n.menuKeybinding)o.push(n.menuKeybinding);else if(!(n instanceof _u||n instanceof j$)){const e=!!this._keybindingService.lookupKeybinding(n.id);o.push(iG(this._commandService,this._keybindingService,n.id,void 0,e))}if(s.length>0){let e=!1;if(1===r&&0===this._options?.hiddenItemStrategy){e=!0;for(let e=0;e<s.length;e++)if(s[e].checked){s[e]=pc({id:n.id,label:n.label,checked:!0,enabled:!1,run(){}});break}}if(!e&&(n instanceof vu||n instanceof _u)){if(!n.hideActions)return;o.push(n.hideActions.hide)}else o.push(pc({id:"label",label:y(1634,"Hide"),enabled:!1,run(){}}))}const a=cc.join(o,s);this._options?.resetMenu&&!i&&(i=[this._options.resetMenu]),l&&i&&(a.push(new cc),a.push(pc({id:"resetThisMenu",label:y(1635,"Reset Menu"),run:()=>this._menuService.resetHiddenStates(i)}))),0!==a.length&&this._contextMenuService.showContextMenu({getAnchor:()=>t,getActions:()=>a,menuId:this._options?.contextMenu,menuActionOptions:{renderShortTitle:!0,...this._options?.menuOptions},skipTelemetry:"string"==typeof this._options?.telemetrySource,contextKeyService:this._contextKeyService})})))}};rG=oG([sG(2,pu),sG(3,eu),sG(4,DR),sG(5,ER),sG(6,mc),sG(7,Cu)],rG);let aG=class extends rG{get onDidChangeMenuItems(){return this._onDidChangeMenuItems.event}constructor(e,t,i,n,o,s,r,a,l,d,h){super(e,{resetMenu:t,...i,actionViewItemProvider:(n,o)=>{let s=d.lookUp(t,n instanceof _u?n.item.submenu.id:n.id);s||(s=i?.actionViewItemProvider);const r=s?.(n,o,h,ta(e).vscodeWindowId);return r||H$(h,n,o)}},n,o,s,r,a,l),this._onDidChangeMenuItems=this._store.add(new Zt);const c=this._store.add(n.createMenu(t,o,{emitEventsForSubmenuChanges:!0,eventDebounceDelay:i?.eventDebounceDelay})),u=()=>{const{primary:t,secondary:n}=A$(c.getActions(i?.menuOptions),i?.toolbarOptions?.primaryGroup,i?.toolbarOptions?.shouldInlineSubmenu,i?.toolbarOptions?.useSeparatorsInPrimaryActions);e.classList.toggle("has-no-actions",0===t.length&&0===n.length),super.setActions(t,n)};this._store.add(c.onDidChange((()=>{u(),this._onDidChangeMenuItems.fire(this)}))),this._store.add(d.onDidChange((e=>{e===t&&u()}))),u()}setActions(){throw new Ve("This toolbar is populated from a menu.")}};aG=oG([sG(3,pu),sG(4,eu),sG(5,DR),sG(6,ER),sG(7,mc),sG(8,Cu),sG(9,nG),sG(10,nc)],aG);const lG="editor.action.inlineSuggest.commit",dG="editor.action.inlineSuggest.showPrevious",hG="editor.action.inlineSuggest.showNext",cG="editor.action.inlineSuggest.hide",uG="editor.action.inlineSuggest.toggleShowCollapsed";var gG=i(8494),pG={};pG.styleTagTransform=zl(),pG.setAttributes=Bl(),pG.insert=Pl().bind(null,"head"),pG.domAPI=Rl(),pG.insertStyleElement=Vl(),Ml()(gG.A,pG),gG.A&&gG.A.locals&&gG.A.locals;var mG,fG=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},_G=function(e,t){return function(i,n){t(i,n,e)}};let vG=class extends At{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Sr(this,this.editor.onDidChangeConfiguration,(()=>"always"===this.editor.getOption(71).showToolbar)),this.sessionPosition=void 0,this.position=pr(this,(e=>{const t=this.model.read(e)?.primaryGhostText.read(e);if(!this.alwaysShowToolbar.read(e)||!t||0===t.parts.length)return this.sessionPosition=void 0,null;const i=t.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==t.lineNumber&&(this.sessionPosition=void 0);const n=new rc(t.lineNumber,Math.min(i,this.sessionPosition?.column??Number.MAX_SAFE_INTEGER));return this.sessionPosition=n,n})),this._register(hr(((t,i)=>{const n=this.model.read(t);if(!n||!this.alwaysShowToolbar.read(t))return;const o=pr((t=>{const i=t.store.add(this.instantiationService.createInstance(CG.hot.read(t),this.editor,!0,this.position,n.selectedInlineCompletionIndex,n.inlineCompletionsCount,n.activeCommands,n.warning,(()=>{})));return e.addContentWidget(i),t.store.add(Tt((()=>e.removeContentWidget(i)))),t.store.add(ar((e=>{this.position.read(e)&&n.lastTriggerKind.read(e)!==FS.Explicit&&n.triggerExplicitly()}))),i})),s=Tr(this,((e,t)=>!!this.position.read(e)||!!t));i.add(ar((e=>{s.read(e)&&o.read(e)})))})))}};vG=fG([_G(2,nc)],vG);const bG=bF("inline-suggestion-hints-next",fh.chevronRight,y(1198,"Icon for show next parameter hint.")),wG=bF("inline-suggestion-hints-previous",fh.chevronLeft,y(1199,"Icon for show previous parameter hint."));let CG=class extends At{static{mG=this}static{this.hot=C$(mG)}static{this._dropDownVisible=!1}static get dropDownVisible(){return this._dropDownVisible}static{this.id=0}createCommandAction(e,t,i){const n=new dc(e,t,i,!0,(()=>this._commandService.executeCommand(e))),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let s=t;return o&&(s=y(1200,"{0} ({1})",t,o.getLabel())),n.tooltip=s,n}constructor(e,t,i,n,o,s,r,a,l,d,h,c,u){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=n,this._suggestionCount=o,this._extraCommands=s,this._warning=r,this._relayout=a,this._commandService=l,this.keybindingService=h,this._contextKeyService=c,this._menuService=u,this.id="InlineSuggestionHintsContentWidget"+mG.id++,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._warningMessageContentNode=pr((e=>{const t=this._warning.read(e);if(t)return"string"==typeof t.message?t.message:e.store.add(yI(t.message)).element})),this._warningMessageNode=bl.div({class:"warningMessage",style:{maxWidth:400,margin:4,marginBottom:4,display:pr((e=>this._warning.read(e)?"block":"none"))}},[this._warningMessageContentNode]).keepUpdated(this._store),this.nodes=fl("div.inlineSuggestionsHints",{className:this.withBorder?"monaco-hover monaco-hover-content":""},[this._warningMessageNode.element,fl("div@toolBar")]),this.previousAction=this._register(this.createCommandAction(dG,y(1201,"Previous"),vh.asClassName(wG))),this.availableSuggestionCountAction=this._register(new dc("inlineSuggestionHints.availableSuggestionCount","",void 0,!1)),this.nextAction=this._register(this.createCommandAction(hG,y(1202,"Next"),vh.asClassName(bG))),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(gu.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Ci((()=>{this.availableSuggestionCountAction.label=""}),100)),this.disableButtonsDebounced=this._register(new Ci((()=>{this.previousAction.enabled=this.nextAction.enabled=!1}),100)),this._register(ar((e=>{this._warningMessageContentNode.read(e),this._warningMessageNode.readEffect(e),this._relayout()}))),this.toolBar=this._register(d.createInstance(xG,this.nodes.toolBar,gu.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:e=>e.startsWith("primary")},actionViewItemProvider:(e,t)=>{if(e instanceof vu)return d.createInstance(SG,e,void 0);if(e===this.availableSuggestionCountAction){const t=new yG(void 0,e,{label:!0,icon:!1});return t.setClass("availableSuggestionCount"),t}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility((e=>{mG._dropDownVisible=e}))),this._register(ar((e=>{this._position.read(e),this.editor.layoutContentWidget(this)}))),this._register(ar((e=>{const t=this._suggestionCount.read(e),i=this._currentSuggestionIdx.read(e);void 0!==t?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${i+1}/${t}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),void 0!==t&&t>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()}))),this._register(ar((e=>{const t=this._extraCommands.read(e).map((e=>({class:void 0,id:e.command.id,enabled:!0,tooltip:e.command.tooltip||"",label:e.command.title,run:t=>this._commandService.executeCommand(e.command.id)})));for(const[e,i]of this.inlineCompletionsActionsMenus.getActions())for(const e of i)e instanceof vu&&t.push(e);t.length>0&&t.unshift(new cc),this.toolBar.setAdditionalSecondaryActions(t)})))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};CG=mG=fG([_G(8,mc),_G(9,nc),_G(10,ER),_G(11,eu),_G(12,pu)],CG);class yG extends hR{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}updateTooltip(){}}class SG extends P${updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService,!0);if(!e)return super.updateLabel();if(this.label){const t=fl("div.keybinding").root;this._register(new kR(t,se,{disableTitle:!0,...xR})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}}let xG=class extends rG{constructor(e,t,i,n,o,s,r,a,l){super(e,{resetMenu:t,...i},n,o,s,r,a,l),this.menuId=t,this.options2=i,this.menuService=n,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this.additionalPrimaryActions=[],this._store.add(this.menu.onDidChange((()=>this.updateToolbar()))),this.updateToolbar()}updateToolbar(){const{primary:e,secondary:t}=A$(this.menu.getActions(this.options2?.menuOptions),this.options2?.toolbarOptions?.primaryGroup,this.options2?.toolbarOptions?.shouldInlineSubmenu,this.options2?.toolbarOptions?.useSeparatorsInPrimaryActions);t.push(...this.additionalActions),e.unshift(...this.prependedPrimaryActions),e.push(...this.additionalPrimaryActions),this.setActions(e,t)}setPrependedPrimaryActions(e){es(this.prependedPrimaryActions,e,((e,t)=>e===t))||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){es(this.additionalActions,e,((e,t)=>e===t))||(this.additionalActions=e,this.updateToolbar())}};function kG(e,t,i){const n=Na(e);return!(t<n.left||t>n.left+n.width||i<n.top||i>n.top+n.height)}xG=fG([_G(3,pu),_G(4,eu),_G(5,DR),_G(6,ER),_G(7,mc),_G(8,Cu)],xG);class LG{constructor(e,t,i,n){this.value=e,this.isComplete=t,this.hasLoadingMessage=i,this.options=n}}class DG extends At{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new Zt),this.onResult=this._onResult.event,this._asyncComputationScheduler=this._register(new EG((e=>this._triggerAsyncComputation(e)),0)),this._syncComputationScheduler=this._register(new EG((e=>this._triggerSyncComputation(e)),0)),this._loadingMessageScheduler=this._register(new EG((e=>this._triggerLoadingMessage(e)),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._options=void 0,super.dispose()}get _hoverTime(){return this._editor.getOption(69).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t){this._options=t,this._state=e,this._fireResult(t)}_triggerAsyncComputation(e){this._setState(2,e),this._syncComputationScheduler.schedule(e,this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=function(e){const t=new ri,i=e(t.token);return new Ti(t,(async e=>{const n=t.token.onCancellationRequested((()=>{n.dispose(),t.dispose(),e.reject(new Oe)}));try{for await(const n of i){if(t.token.isCancellationRequested)return;e.emitOne(n)}n.dispose(),t.dispose()}catch(i){n.dispose(),t.dispose(),e.reject(i)}}))}((t=>this._computer.computeAsync(e,t))),(async()=>{try{for await(const t of this._asyncIterable)t&&(this._result.push(t),this._fireResult(e));this._asyncIterableDone=!0,3!==this._state&&4!==this._state||this._setState(0,e)}catch(e){Ie(e)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(e){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync(e))),this._setState(this._asyncIterableDone?0:3,e)}_triggerLoadingMessage(e){3===this._state&&this._setState(4,e)}_fireResult(e){if(1===this._state||2===this._state)return;const t=0===this._state,i=4===this._state;this._onResult.fire(new LG(this._result.slice(0),t,i,e))}start(e,t){if(0===e)0===this._state&&(this._setState(1,t),this._asyncComputationScheduler.schedule(t,this._firstWaitTime),this._loadingMessageScheduler.schedule(t,this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(t),this._syncComputationScheduler.cancel(),this._triggerSyncComputation(t);break;case 2:this._syncComputationScheduler.cancel(),this._triggerSyncComputation(t)}}cancel(){this._asyncComputationScheduler.cancel(),this._syncComputationScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._options=void 0,this._state=0}get options(){return this._options}}class EG extends At{constructor(e,t){super(),this._scheduler=this._register(new Ci((()=>e(this._options)),t))}schedule(e,t){this._options=e,this._scheduler.schedule(t)}cancel(){this._scheduler.cancel()}}var NG=i(4166),IG={};IG.styleTagTransform=zl(),IG.setAttributes=Bl(),IG.insert=Pl().bind(null,"head"),IG.domAPI=Rl(),IG.insertStyleElement=Vl(),Ml()(NG.A,IG),NG.A&&NG.A.locals&&NG.A.locals;var TG,MG=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};!function(e){e.North="north",e.South="south",e.East="east",e.West="west"}(TG||(TG={}));const AG=new Zt,RG=new Zt;class OG{constructor(e){this.el=e,this.disposables=new Mt}get onPointerMove(){return this.disposables.add(new OM(ta(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new OM(ta(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}MG([QT],OG.prototype,"onPointerMove",null),MG([QT],OG.prototype,"onPointerUp",null);class PG{get onPointerMove(){return this.disposables.add(new OM(this.el,XT.Change)).event}get onPointerUp(){return this.disposables.add(new OM(this.el,XT.End)).event}constructor(e){this.el=e,this.disposables=new Mt}dispose(){this.disposables.dispose()}}MG([QT],PG.prototype,"onPointerMove",null),MG([QT],PG.prototype,"onPointerUp",null);class FG{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}MG([QT],FG.prototype,"onPointerMove",null),MG([QT],FG.prototype,"onPointerUp",null);const BG="pointer-events-disabled";class WG extends At{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",0===e),this.el.classList.toggle("minimum",1===e),this.el.classList.toggle("maximum",2===e),this._state=e,this.onDidEnablementChange.fire(e))}get onDidStart(){return this._onDidStart.event}get onDidChange(){return this._onDidChange.event}get onDidReset(){return this._onDidReset.event}get onDidEnd(){return this._onDidEnd.event}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=t=>{this.orthogonalStartDragHandleDisposables.clear(),0!==t&&(this._orthogonalStartDragHandle=il(this.el,ll(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Tt((()=>this._orthogonalStartDragHandle.remove()))),this.orthogonalStartDragHandleDisposables.add(ga(this._orthogonalStartDragHandle,"mouseenter",(()=>WG.onMouseEnter(e)))),this.orthogonalStartDragHandleDisposables.add(ga(this._orthogonalStartDragHandle,"mouseleave",(()=>WG.onMouseLeave(e)))))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}}set orthogonalEndSash(e){if(this._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=t=>{this.orthogonalEndDragHandleDisposables.clear(),0!==t&&(this._orthogonalEndDragHandle=il(this.el,ll(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Tt((()=>this._orthogonalEndDragHandle.remove()))),this.orthogonalEndDragHandleDisposables.add(ga(this._orthogonalEndDragHandle,"mouseenter",(()=>WG.onMouseEnter(e)))),this.orthogonalEndDragHandleDisposables.add(ga(this._orthogonalEndDragHandle,"mouseleave",(()=>WG.onMouseLeave(e)))))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,i){let n;super(),this.hoverDelay=300,this.hoverDelayer=this._register(new gi(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new Zt),this._onDidStart=this._register(new Zt),this._onDidChange=this._register(new Zt),this._onDidReset=this._register(new Zt),this._onDidEnd=this._register(new Zt),this.orthogonalStartSashDisposables=this._register(new Mt),this.orthogonalStartDragHandleDisposables=this._register(new Mt),this.orthogonalEndSashDisposables=this._register(new Mt),this.orthogonalEndDragHandleDisposables=this._register(new Mt),this.linkedSash=void 0,this.el=il(e,ll(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),$&&this.el.classList.add("mac"),this._register(ga(this.el,"mousedown",(t=>this.onPointerStart(t,new OG(e))))),this._register(ga(this.el,"dblclick",(e=>this.onPointerDoublePress(e)))),this._register(ga(this.el,"mouseenter",(()=>WG.onMouseEnter(this)))),this._register(ga(this.el,"mouseleave",(()=>WG.onMouseLeave(this)))),this._register(JT.addTarget(this.el)),this._register(ga(this.el,XT.Start,(e=>this.onPointerStart(e,new PG(this.el))))),this._register(ga(this.el,XT.Tap,(e=>{if(n)return clearTimeout(n),n=void 0,void this.onPointerDoublePress(e);clearTimeout(n),n=setTimeout((()=>n=void 0),250)}))),"number"==typeof i.size?(this.size=i.size,0===i.orientation?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=4,this._register(AG.event((e=>{this.size=e,this.layout()})))),this._register(RG.event((e=>this.hoverDelay=e))),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,1===this.orientation?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",!1),this.layout()}onPointerStart(e,t){Ja(e);let i=!1;if(!e.__orthogonalSashEvent){const n=this.getOrthogonalSash(e);n&&(i=!0,e.__orthogonalSashEvent=!0,n.onPointerStart(e,new FG(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new FG(t))),!this.state)return;const n=this.el.ownerDocument.getElementsByTagName("iframe");for(const e of n)e.classList.add(BG);const o=e.pageX,s=e.pageY,r=e.altKey,a={startX:o,currentX:o,startY:s,currentY:s,altKey:r};this.el.classList.add("active"),this._onDidStart.fire(a);const l=DM(this.el),d=()=>{let e="";e=i?"all-scroll":1===this.orientation?1===this.state?"s-resize":2===this.state?"n-resize":$?"row-resize":"ns-resize":1===this.state?"e-resize":2===this.state?"w-resize":$?"col-resize":"ew-resize",l.textContent=`* { cursor: ${e} !important; }`},h=new Mt;d(),i||this.onDidEnablementChange.event(d,null,h),t.onPointerMove((e=>{Ja(e,!1);const t={startX:o,currentX:e.pageX,startY:s,currentY:e.pageY,altKey:r};this._onDidChange.fire(t)}),null,h),t.onPointerUp((e=>{Ja(e,!1),l.remove(),this.el.classList.remove("active"),this._onDidEnd.fire(),h.dispose();for(const e of n)e.classList.remove(BG)}),null,h),h.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger((()=>e.el.classList.add("hover")),e.hoverDelay).then(void 0,(()=>{})),!t&&e.linkedSash&&WG.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&WG.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){WG.onMouseLeave(this)}layout(){if(0===this.orientation){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){const t=e.initialTarget??e.target;if(t&&qa(t))return t.classList.contains("orthogonal-drag-handle")?t.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash:void 0}dispose(){super.dispose(),this.el.remove()}}class VG{get onDidWillResize(){return this._onDidWillResize.event}get onDidResize(){return this._onDidResize.event}constructor(){let e;this._onDidWillResize=new Zt,this._onDidResize=new Zt,this._sashListener=new Mt,this._size=new Da(0,0),this._minSize=new Da(0,0),this._maxSize=new Da(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new WG(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new WG(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new WG(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:TG.North}),this._southSash=new WG(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:TG.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let t=0,i=0;this._sashListener.add(zt.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)((()=>{void 0===e&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)}))),this._sashListener.add(zt.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)((()=>{void 0!==e&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))}))),this._sashListener.add(this._eastSash.onDidChange((n=>{e&&(i=n.currentX-n.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))}))),this._sashListener.add(this._westSash.onDidChange((n=>{e&&(i=-(n.currentX-n.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))}))),this._sashListener.add(this._northSash.onDidChange((n=>{e&&(t=-(n.currentY-n.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))}))),this._sashListener.add(this._southSash.onDidChange((n=>{e&&(t=n.currentY-n.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))}))),this._sashListener.add(zt.any(this._eastSash.onDidReset,this._westSash.onDidReset)((e=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))),this._sashListener.add(zt.any(this._northSash.onDidReset,this._southSash.onDidReset)((e=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))})))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,n){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=n?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:n}=this._minSize,{height:o,width:s}=this._maxSize;e=Math.max(i,Math.min(o,e)),t=Math.max(n,Math.min(s,t));const r=new Da(t,e);Da.equals(r,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=r,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}class HG extends At{constructor(e,t=new Da(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new VG),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Da.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize((e=>{this._resize(new Da(e.dimension.width,e.dimension.height)),e.done&&(this._isResizing=!1)}))),this._register(this._resizableNode.onDidWillResize((()=>{this._isResizing=!0})))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){return this._contentPosition?.position?rc.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(t&&i)return Na(t).top+i.top-30}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const n=Na(t),o=ka(t.ownerDocument.body),s=n.top+i.top+i.height;return o.height-s-24}_findPositionPreference(e,t){const i=Math.min(this._availableVerticalSpaceBelow(t)??1/0,e),n=Math.min(this._availableVerticalSpaceAbove(t)??1/0,e),o=Math.min(Math.max(n,i),e),s=Math.min(e,o);let r;return r=this._editor.getOption(69).above?s<=n?1:2:s<=i?2:1,1===r?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),r}_resize(e){this._resizableNode.layout(e.height,e.width)}}var zG=i(8694),UG={};UG.styleTagTransform=zl(),UG.setAttributes=Bl(),UG.insert=Pl().bind(null,"head"),UG.domAPI=Rl(),UG.insertStyleElement=Vl(),Ml()(zG.A,UG),zG.A&&zG.A.locals&&zG.A.locals;const KG=ll;class jG extends At{constructor(e){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.classList.toggle("fade-in",!!e),this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this.scrollbar=this._register(new dA(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class qG extends At{static render(e,t,i){return new qG(e,t,i)}constructor(e,t,i){super(),this.actionLabel=t.label,this.actionKeybindingLabel=i,this.actionContainer=il(e,KG("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=il(this.actionContainer,KG("a.action")),this.action.setAttribute("role","button"),t.iconClass&&il(this.action,KG("span.icon")).classList.add(...t.iconClass.split(" ")),this.actionRenderedLabel=i?`${t.label} (${i})`:t.label,il(this.action,KG("span")).textContent=this.actionRenderedLabel,this._store.add(new GG(this.actionContainer,t.run)),this._store.add(new ZG(this.actionContainer,t.run,[3,10])),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function $G(e,t){return e&&t?y(7,"Inspect this in the accessible view with {0}.",t):e?y(8,"Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}class GG extends At{constructor(e,t){super(),this._register(ga(e,Qa.CLICK,(i=>{i.stopPropagation(),i.preventDefault(),t(e)})))}}class ZG extends At{constructor(e,t,i){super(),this._register(ga(e,Qa.KEY_DOWN,(n=>{const o=new Ze(n);i.some((e=>o.equals(e)))&&(n.stopPropagation(),n.preventDefault(),t(e))})))}}var YG,QG=function(e,t){return function(i,n){t(i,n,e)}};let XG=class extends HG{static{YG=this}static{this.ID="editor.contrib.resizableContentHoverWidget"}static{this._lastDimensions=new Da(0,0)}get isVisibleFromKeyboard(){return 2===this._renderedHover?.source}get isVisible(){return this._hoverVisibleKey.get()??!1}get isFocused(){return this._hoverFocusedKey.get()??!1}constructor(e,t,i,n,o){const s=e.getOption(75)+8,r=new Da(150,s);super(e,r),this._configurationService=i,this._accessibilityService=n,this._keybindingService=o,this._hover=this._register(new jG(!0)),this._onDidResize=this._register(new Zt),this.onDidResize=this._onDidResize.event,this._onDidScroll=this._register(new Zt),this.onDidScroll=this._onDidScroll.event,this._onContentsChanged=this._register(new Zt),this.onContentsChanged=this._onContentsChanged.event,this._minimumSize=r,this._hoverVisibleKey=Xu.hoverVisible.bindTo(t),this._hoverFocusedKey=Xu.hoverFocused.bindTo(t),il(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._resizableNode.domNode.className="monaco-resizable-hover",this._register(this._editor.onDidLayoutChange((()=>{this.isVisible&&this._updateMaxDimensions()}))),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(59)&&this._updateFont()})));const a=this._register(tl(this._resizableNode.domNode));this._register(a.onDidFocus((()=>{this._hoverFocusedKey.set(!0)}))),this._register(a.onDidBlur((()=>{this._hoverFocusedKey.set(!1)}))),this._register(this._hover.scrollbar.onScroll((e=>{this._onDidScroll.fire(e)}))),this._setRenderedHover(void 0),this._editor.addContentWidget(this)}dispose(){super.dispose(),this._renderedHover?.dispose(),this._editor.removeContentWidget(this)}getId(){return YG.ID}static _applyDimensions(e,t,i){const n="number"==typeof t?`${t}px`:t,o="number"==typeof i?`${i}px`:i;e.style.width=n,e.style.height=o}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return YG._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return YG._applyDimensions(i,e,t)}_setScrollableElementDimensions(e,t){const i=this._hover.scrollbar.getDomNode();return YG._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContainerDomNodeDimensions(e,t),this._setScrollableElementDimensions(e,t),this._setContentsDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const n="number"==typeof t?`${t}px`:t,o="number"==typeof i?`${i}px`:i;e.style.maxWidth=n,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){YG._applyMaxDimensions(this._hover.contentsDomNode,e,t),YG._applyMaxDimensions(this._hover.scrollbar.getDomNode(),e,t),YG._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth","number"==typeof e?`${e}px`:e),this._layoutContentWidget()}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none"),this._setHoverWidgetDimensions(e.width,e.height)}_updateResizableNodeMaxDimensions(){const e=this._findMaximumRenderingWidth()??1/0,t=this._findMaximumRenderingHeight()??1/0;this._resizableNode.maxSize=new Da(e,t),this._setHoverWidgetMaxDimensions(e,t)}_resize(e){YG._lastDimensions=new Da(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),this._onDidResize.fire()}_findAvailableSpaceVertically(){const e=this._renderedHover?.showAtPosition;if(e)return 1===this._positionPreference?this._availableVerticalSpaceAbove(e):this._availableVerticalSpaceBelow(e)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=this._hover.contentsDomNode.children.length-1;return Array.from(this._hover.contentsDomNode.children).forEach((e=>{t+=e.clientHeight})),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some((e=>e.scrollWidth>e.clientWidth));return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=void 0===this._contentWidth?0:this._contentWidth;return e||this._hover.containerDomNode.clientWidth<t?ka(this._hover.containerDomNode.ownerDocument.body).width-14:this._hover.containerDomNode.clientWidth}isMouseGettingCloser(e,t){if(!this._renderedHover)return!1;if(void 0===this._renderedHover.initialMousePosX||void 0===this._renderedHover.initialMousePosY)return this._renderedHover.initialMousePosX=e,this._renderedHover.initialMousePosY=t,!1;const i=Na(this.getDomNode());void 0===this._renderedHover.closestMouseDistance&&(this._renderedHover.closestMouseDistance=JG(this._renderedHover.initialMousePosX,this._renderedHover.initialMousePosY,i.left,i.top,i.width,i.height));const n=JG(e,t,i.left,i.top,i.width,i.height);return!(n>this._renderedHover.closestMouseDistance+4||(this._renderedHover.closestMouseDistance=Math.min(this._renderedHover.closestMouseDistance,n),0))}_setRenderedHover(e){this._renderedHover?.dispose(),this._renderedHover=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){const{fontSize:e,lineHeight:t}=this._editor.getOption(59),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=""+t/e,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach((e=>this._editor.applyFontInfo(e)))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,YG._lastDimensions.height),t=Math.max(.66*this._editor.getLayoutInfo().width,750,YG._lastDimensions.width);this._resizableNode.maxSize=new Da(t,e),this._setHoverWidgetMaxDimensions(t,e)}_render(e){this._setRenderedHover(e),this._updateFont(),this._updateContent(e.domNode),this.handleContentsChanged(),this._editor.render()}getPosition(){return this._renderedHover?{position:this._renderedHover.showAtPosition,secondaryPosition:this._renderedHover.showAtSecondaryPosition,positionAffinity:this._renderedHover.shouldAppearBeforeContent?3:void 0,preference:[this._positionPreference??1]}:null}show(e){if(!this._editor||!this._editor.hasModel())return;this._render(e);const t=Ra(this._hover.containerDomNode),i=e.showAtPosition;this._positionPreference=this._findPositionPreference(t,i)??1,this.handleContentsChanged(),e.shouldFocus&&this._hover.containerDomNode.focus(),this._onDidResize.fire();const n=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&$G(!0===this._configurationService.getValue("accessibility.verbosity.hover")&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel()??"");n&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+n)}hide(){if(!this._renderedHover)return;const e=this._renderedHover.shouldFocus||this._hoverFocusedKey.get();this._setRenderedHover(void 0),this._resizableNode.maxSize=new Da(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto"),this._updateMaxDimensions()}setMinimumDimensions(e){this._minimumSize=new Da(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=void 0===this._contentWidth?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new Da(e,this._minimumSize.height)}handleContentsChanged(){this._removeConstraintsRenderNormally();const e=this._hover.contentsDomNode;let t=Ra(e),i=Ta(e)+2;if(this._resizableNode.layout(t,i),this._setHoverWidgetDimensions(i,t),t=Ra(e),i=Ta(e),this._contentWidth=i,this._updateMinimumWidth(),this._resizableNode.layout(t,i),this._renderedHover?.showAtPosition){const e=Ra(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(e,this._renderedHover.showAtPosition)}this._layoutContentWidget(),this._onContentsChanged.fire()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-30})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+30})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}};function JG(e,t,i,n,o,s){const r=i+o/2,a=n+s/2,l=Math.max(Math.abs(e-r)-o/2,0),d=Math.max(Math.abs(t-a)-s/2,0);return Math.sqrt(l*l+d*d)}XG=YG=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([QG(1,eu),QG(2,up),QG(3,rB),QG(4,ER)],XG);class eZ{constructor(e,t){this._editor=e,this._participants=t}static _getLineDecorations(e,t){if(1!==t.type&&!t.supportsMarkerHover)return[];const i=e.getModel(),n=t.range.startLineNumber;if(n>i.getLineCount())return[];const o=i.getLineMaxColumn(n);return e.getLineDecorations(n).filter((e=>{if(e.options.isWholeLine)return!0;const i=e.range.startLineNumber===n?e.range.startColumn:1,s=e.range.endLineNumber===n?e.range.endColumn:o;if(e.options.showIfCollapsed){if(i>t.range.startColumn+1||t.range.endColumn-1>s)return!1}else if(i>t.range.startColumn||t.range.endColumn>s)return!1;return!0}))}computeAsync(e,t){const i=e.anchor;if(!this._editor.hasModel()||!i)return Ii.EMPTY;const n=eZ._getLineDecorations(this._editor,i);return Ii.merge(this._participants.map((o=>o.computeAsync?o.computeAsync(i,n,e.source,t):Ii.EMPTY)))}computeSync(e){if(!this._editor.hasModel())return[];const t=e.anchor,i=eZ._getLineDecorations(this._editor,t);let n=[];for(const o of this._participants)n=n.concat(o.computeSync(t,i,e.source));return as(n)}}class tZ{constructor(e,t,i){this.hoverParts=e,this.isComplete=t,this.options=i}filter(e){const t=this.hoverParts.filter((t=>t.isValidForHoverAnchor(e)));return t.length===this.hoverParts.length?this:new iZ(this,t,this.isComplete,this.options)}}class iZ extends tZ{constructor(e,t,i,n){super(t,i,n),this.original=e}filter(e){return this.original.filter(e)}}var nZ=function(e,t){return function(i,n){t(i,n,e)}};const oZ=oc("hoverService");let sZ=class extends At{get delay(){return this.isInstantlyHovering()?0:this.hoverOptions?.dynamicDelay?e=>this.hoverOptions?.dynamicDelay?.(e)??this._delay:this._delay}constructor(e,t,i={},n,o){super(),this.placement=e,this.hoverOptions=t,this.overrideOptions=i,this.configurationService=n,this.hoverService=o,this.lastHoverHideTime=0,this.timeLimit=200,this.hoverDisposables=this._register(new Mt),this._delay=this.configurationService.getValue("workbench.hover.delay"),this._register(this.configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration("workbench.hover.delay")&&(this._delay=this.configurationService.getValue("workbench.hover.delay"))})))}showHover(e,t){const i="function"==typeof this.overrideOptions?this.overrideOptions(e,t):this.overrideOptions;this.hoverDisposables.clear();const n=qa(e.target)?[e.target]:e.target.targetElements;for(const e of n)this.hoverDisposables.add(ma(e,"keydown",(e=>{e.equals(9)&&this.hoverService.hideHover()})));const o=qa(e.content)?void 0:"string"==typeof e.content?e.content.toString():e.content.value;return this.hoverService.showInstantHover({...e,...i,persistence:{hideOnKeyDown:!0,...i.persistence},id:o,appearance:{...e.appearance,compact:!0,skipFadeInAnimation:this.isInstantlyHovering(),...i.appearance}},t)}isInstantlyHovering(){return!!this.hoverOptions?.instantHover&&Date.now()-this.lastHoverHideTime<this.timeLimit}onDidHideHover(){this.hoverDisposables.clear(),this.hoverOptions?.instantHover&&(this.lastHoverHideTime=Date.now())}};sZ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([nZ(3,up),nZ(4,oZ)],sZ);const rZ={showHover:function(){throw new Error("Native hover function not implemented.")},delay:0,showNativeHover:!0};var aZ=function(e,t){return function(i,n){t(i,n,e)}};const lZ=ll;let dZ=class extends At{get hasContent(){return this._hasContent}constructor(e,t){super(),this._keybindingService=e,this._hoverService=t,this.actions=[],this._hasContent=!1,this.hoverElement=lZ("div.hover-row.status-bar"),this.hoverElement.tabIndex=0,this.actionsElement=il(this.hoverElement,lZ("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;this._hasContent=!0;const n=this._register(qG.render(this.actionsElement,e,i));return this._register(this._hoverService.setupManagedHover(nM("element"),n.actionContainer,n.actionRenderedLabel)),this.actions.push(n),n}append(e){const t=il(this.actionsElement,e);return this._hasContent=!0,t}};dZ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([aZ(0,ER),aZ(1,oZ)],dZ);class hZ{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}function cZ(e,t,i,n,o=!1){const s=e.ordered(t,o).map(((e,o)=>async function(e,t,i,n,o){const s=await Promise.resolve(e.provideHover(i,n,o)).catch(Te);if(s&&function(e){const t=void 0!==e.range,i=void 0!==e.contents&&e.contents&&e.contents.length>0;return t&&i}(s))return new hZ(e,s,t)}(e,o,t,i,n)));return Ii.fromPromisesResolveOrder(s).coalesce()}async function uZ(e,t,i,n,o=!1){const s=[];for await(const r of cZ(e,t,i,n,o))s.push(r.hover);return s}Wu("_executeHoverProvider",((e,t,i)=>uZ(e.get(BD).hoverProvider,t,i,oi.None))),Wu("_executeHoverProvider_recursive",((e,t,i)=>uZ(e.get(BD).hoverProvider,t,i,oi.None,!0)));var gZ=function(e,t){return function(i,n){t(i,n,e)}};const pZ=ll,mZ=bF("hover-increase-verbosity",fh.add,y(1123,"Icon for increaseing hover verbosity.")),fZ=bF("hover-decrease-verbosity",fh.remove,y(1124,"Icon for decreasing hover verbosity."));class _Z{constructor(e,t,i,n,o,s=void 0){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=n,this.ordinal=o,this.source=s}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}class vZ{constructor(e,t,i){this.hover=e,this.hoverProvider=t,this.hoverPosition=i}supportsVerbosityAction(e){switch(e){case OS.Increase:return this.hover.canIncreaseVerbosity??!1;case OS.Decrease:return this.hover.canDecreaseVerbosity??!1}}}let bZ=class{constructor(e,t,i,n,o,s,r,a){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=n,this._languageFeaturesService=o,this._keybindingService=s,this._hoverService=r,this._commandService=a,this.hoverOrdinal=3}createLoadingMessage(e){return new _Z(this,e.range,[(new Gh).appendText(y(1125,"Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||1!==e.type)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,o=i.getLineMaxColumn(n),s=[];let r=1e3;const a=i.getLineLength(n),l=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),d=this._editor.getOption(133),h=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:l});let c=!1;d>=0&&a>d&&e.range.startColumn>=d&&(c=!0,s.push(new _Z(this,e.range,[{value:y(1126,"Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,r++))),!c&&"number"==typeof h&&a>=h&&s.push(new _Z(this,e.range,[{value:y(1127,"Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,r++));let u=!1;for(const i of t){const t=i.range.startLineNumber===n?i.range.startColumn:1,a=i.range.endLineNumber===n?i.range.endColumn:o,l=i.options.hoverMessage;if(!l||Zh(l))continue;i.options.beforeContentClassName&&(u=!0);const d=new Yu(e.range.startLineNumber,t,e.range.startLineNumber,a);s.push(new _Z(this,d,_s(l),u,r++))}return s}computeAsync(e,t,i,n){if(!this._editor.hasModel()||1!==e.type)return Ii.EMPTY;const o=this._editor.getModel(),s=this._languageFeaturesService.hoverProvider;return s.has(o)?this._getMarkdownHovers(s,o,e,n):Ii.EMPTY}async*_getMarkdownHovers(e,t,i,n){const o=i.range.getStartPosition(),s=cZ(e,t,o,n);for await(const e of s)if(!Zh(e.hover.contents)){const t=e.hover.range?Yu.lift(e.hover.range):i.range,n=new vZ(e.hover,e.provider,o);yield new _Z(this,t,e.hover.contents,!1,e.ordinal,n)}}renderHoverParts(e,t){return this._renderedHoverParts=new CZ(t,e.fragment,this,this._editor,this._languageService,this._openerService,this._commandService,this._keybindingService,this._hoverService,this._configurationService,e.onContentsChanged),this._renderedHoverParts}handleScroll(e){this._renderedHoverParts?.handleScroll(e)}updateMarkdownHoverVerbosityLevel(e,t){return Promise.resolve(this._renderedHoverParts?.updateMarkdownHoverPartVerbosityLevel(e,t))}};bZ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([gZ(1,Tg),gZ(2,ZI),gZ(3,up),gZ(4,BD),gZ(5,ER),gZ(6,oZ),gZ(7,mc)],bZ);class wZ{constructor(e,t,i,n){this.hoverPart=e,this.hoverElement=t,this.disposables=i,this.actionsContainer=n}dispose(){this.disposables.dispose()}}class CZ{constructor(e,t,i,n,o,s,r,a,l,d,h){this._hoverParticipant=i,this._editor=n,this._languageService=o,this._openerService=s,this._commandService=r,this._keybindingService=a,this._hoverService=l,this._configurationService=d,this._onFinishedRendering=h,this._ongoingHoverOperations=new Map,this._disposables=new Mt,this.renderedHoverParts=this._renderHoverParts(e,t,this._onFinishedRendering),this._disposables.add(Tt((()=>{this.renderedHoverParts.forEach((e=>{e.dispose()})),this._ongoingHoverOperations.forEach((e=>{e.tokenSource.dispose(!0)}))})))}_renderHoverParts(e,t,i){return e.sort(Cs((e=>e.ordinal),ys)),e.map((e=>{const n=this._renderHoverPart(e,i);return t.appendChild(n.hoverElement),n}))}_renderHoverPart(e,t){const i=this._renderMarkdownHover(e,t),n=i.hoverElement,o=e.source,s=new Mt;if(s.add(i),!o)return new wZ(e,n,s);const r=o.supportsVerbosityAction(OS.Increase),a=o.supportsVerbosityAction(OS.Decrease);if(!r&&!a)return new wZ(e,n,s);const l=pZ("div.verbosity-actions");n.prepend(l);const d=pZ("div.verbosity-actions-inner");return l.append(d),s.add(this._renderHoverExpansionAction(d,OS.Increase,r)),s.add(this._renderHoverExpansionAction(d,OS.Decrease,a)),new wZ(e,n,s,d)}_renderMarkdownHover(e,t){return yZ(this._editor,e,this._languageService,this._openerService,t)}_renderHoverExpansionAction(e,t,i){const n=new Mt,o=t===OS.Increase,s=il(e,pZ(vh.asCSSSelector(o?mZ:fZ)));s.tabIndex=0;const r=new sZ("mouse",void 0,{target:e,position:{hoverPosition:0}},this._configurationService,this._hoverService);if(n.add(this._hoverService.setupManagedHover(r,s,function(e,t){switch(t){case OS.Increase:{const t=e.lookupKeybinding(f$);return t?y(1128,"Increase Hover Verbosity ({0})",t.getLabel()):y(1129,"Increase Hover Verbosity")}case OS.Decrease:{const t=e.lookupKeybinding(v$);return t?y(1130,"Decrease Hover Verbosity ({0})",t.getLabel()):y(1131,"Decrease Hover Verbosity")}}}(this._keybindingService,t))),!i)return s.classList.add("disabled"),n;s.classList.add("enabled");const a=()=>this._commandService.executeCommand(t===OS.Increase?f$:v$,{focus:!0});return n.add(new GG(s,a)),n.add(new ZG(s,a,[3,10])),n}handleScroll(e){this.renderedHoverParts.forEach((t=>{const i=t.actionsContainer;if(!i)return;const n=t.hoverElement,o=e.scrollTop+e.height,s=n.offsetTop,r=n.clientHeight;let a;a=s+r<=o||s>=o?r-22:o-s-22,i.style.top=`${a}px`}))}async updateMarkdownHoverPartVerbosityLevel(e,t){const i=this._editor.getModel();if(!i)return;const n=this._getRenderedHoverPartAtIndex(t),o=n?.hoverPart.source;if(!n||!o?.supportsVerbosityAction(e))return;const s=await this._fetchHover(o,i,e);if(!s)return;const r=new vZ(s,o.hoverProvider,o.hoverPosition),a=n.hoverPart,l=new _Z(this._hoverParticipant,a.range,s.contents,a.isBeforeContent,a.ordinal,r),d=this._updateRenderedHoverPart(t,l);return d?{hoverPart:l,hoverElement:d.hoverElement}:void 0}async _fetchHover(e,t,i){let n=i===OS.Increase?1:-1;const o=e.hoverProvider,s=this._ongoingHoverOperations.get(o);s&&(s.tokenSource.cancel(),n+=s.verbosityDelta);const r=new ri;this._ongoingHoverOperations.set(o,{verbosityDelta:n,tokenSource:r});const a={verbosityRequest:{verbosityDelta:n,previousHover:e.hover}};let l;try{l=await Promise.resolve(o.provideHover(t,e.hoverPosition,r.token,a))}catch(e){Te(e)}return r.dispose(),this._ongoingHoverOperations.delete(o),l}_updateRenderedHoverPart(e,t){if(e>=this.renderedHoverParts.length||e<0)return;const i=this._renderHoverPart(t,this._onFinishedRendering),n=this.renderedHoverParts[e],o=n.hoverElement,s=i.hoverElement,r=Array.from(s.children);o.replaceChildren(...r);const a=new wZ(t,o,i.disposables,i.actionsContainer);return n.dispose(),this.renderedHoverParts[e]=a,a}_getRenderedHoverPartAtIndex(e){return this.renderedHoverParts[e]}dispose(){this._disposables.dispose()}}function yZ(e,t,i,n,o){const s=new Mt,r=pZ("div.hover-row"),a=pZ("div.hover-row-contents");r.appendChild(a);const l=t.contents;for(const t of l){if(Zh(t))continue;const r=pZ("div.markdown-hover"),l=il(r,pZ("div.hover-contents")),d=new aT({editor:e},i,n),h=s.add(d.render(t,{asyncRenderCallback:()=>{l.className="hover-contents code-hover-contents",o()}}));l.appendChild(h.element),a.appendChild(r)}return{hoverPart:t,hoverElement:r,dispose(){s.dispose()}}}var SZ=i(3345),xZ={};xZ.styleTagTransform=zl(),xZ.setAttributes=Bl(),xZ.insert=Pl().bind(null,"head"),xZ.domAPI=Rl(),xZ.insertStyleElement=Vl(),Ml()(SZ.A,xZ),SZ.A&&SZ.A.locals&&SZ.A.locals;const kZ=ll;class LZ extends At{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new Zt,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new Zt,this.onColorFlushed=this._onColorFlushed.event,this._domNode=kZ(".saturation-wrap"),il(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",il(this._domNode,this._canvas),this.selection=kZ(".saturation-selection"),il(this._domNode,this.selection),this.layout(),this._register(ga(this._domNode,Qa.POINTER_DOWN,(e=>this.onPointerDown(e)))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!(e.target&&e.target instanceof Element))return;this.monitor=this._register(new UM);const t=Na(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,(e=>this.onDidChangePosition(e.pageX-t.left,e.pageY-t.top)),(()=>null));const i=ga(e.target.ownerDocument,Qa.POINTER_UP,(()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)}),!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),n=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,n),this._onDidChange.fire({s:i,v:n})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new Lg(new kg(e.h,1,1,1)),i=this._canvas.getContext("2d"),n=i.createLinearGradient(0,0,this._canvas.width,0);n.addColorStop(0,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),n.addColorStop(1,"rgba(255, 255, 255, 0)");const o=i.createLinearGradient(0,0,0,this._canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=Lg.Format.CSS.format(t),i.fill(),i.fillStyle=n,i.fill(),i.fillStyle=o,i.fill()}paintSelection(e,t){this.selection.style.left=e*this.width+"px",this.selection.style.top=this.height-t*this.height+"px"}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class DZ extends At{constructor(e){super(),this._onClicked=this._register(new Zt),this.onClicked=this._onClicked.event,this._button=il(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._register(ga(this._button,Qa.CLICK,(()=>{this._onClicked.fire()})))}get button(){return this._button}}const EZ=ll;class NZ extends At{constructor(e,t,i){super(),this.model=t,this._onDidChange=new Zt,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new Zt,this.onColorFlushed=this._onColorFlushed.event,"standalone"===i?(this.domNode=il(e,EZ(".standalone-strip")),this.overlay=il(this.domNode,EZ(".standalone-overlay"))):(this.domNode=il(e,EZ(".strip")),this.overlay=il(this.domNode,EZ(".overlay"))),this.slider=il(this.domNode,EZ(".slider")),this.slider.style.top="0px",this._register(ga(this.domNode,Qa.POINTER_DOWN,(e=>this.onPointerDown(e)))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!(e.target&&e.target instanceof Element))return;const t=this._register(new UM),i=Na(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,(e=>this.onDidChangeTop(e.pageY-i.top)),(()=>null));const n=ga(e.target.ownerDocument,Qa.POINTER_UP,(()=>{this._onColorFlushed.fire(),n.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")}),!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=(1-e)*this.height+"px"}}class IZ extends NZ{constructor(e,t,i){super(e,t,i),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:i,b:n}=e.rgba,o=new Lg(new Sg(t,i,n,1)),s=new Lg(new Sg(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${s} 100%)`}getValue(e){return e.hsva.a}}class TZ extends NZ{constructor(e,t,i){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}const MZ=ll;class AZ extends At{constructor(e,t,i,n){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=MZ(".colorpicker-body"),il(e,this._domNode),this._saturationBox=new LZ(this._domNode,this.model,this.pixelRatio),this._register(this._saturationBox),this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this._saturationBox.onColorFlushed(this.flushColor,this)),this._opacityStrip=new IZ(this._domNode,this.model,n),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new TZ(this._domNode,this.model,n),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),"standalone"===n&&(this._insertButton=this._register(new DZ(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new Lg(new kg(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new Lg(new kg(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=360*(1-e);this.model.color=new Lg(new kg(360===i?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}const RZ=ll;class OZ extends At{constructor(e){super(),this._onClicked=this._register(new Zt),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),il(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),il(this._button,t),il(t,RZ(".button"+vh.asCSSSelector(bF("color-picker-close",fh.close,y(881,"Icon to close the color picker"))))).classList.add("close-icon"),this._register(ga(this._button,Qa.CLICK,(()=>{this._onClicked.fire()})))}}const PZ=ll;class FZ extends At{constructor(e,t,i,n){super(),this.model=t,this.type=n,this._closeButton=null,this._domNode=PZ(".colorpicker-header"),il(e,this._domNode),this._pickedColorNode=il(this._domNode,PZ(".picked-color")),il(this._pickedColorNode,PZ("span.codicon.codicon-color-mode")),this._pickedColorPresentation=il(this._pickedColorNode,document.createElement("span")),this._pickedColorPresentation.classList.add("picked-color-presentation");const o=y(882,"Click to toggle color options (rgb/hsl/hex)");this._pickedColorNode.setAttribute("title",o),this._originalColorNode=il(this._domNode,PZ(".original-color")),this._originalColorNode.style.backgroundColor=Lg.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor(I_)||Lg.white,this._register(i.onDidColorThemeChange((e=>{this.backgroundColor=e.getColor(I_)||Lg.white}))),this._register(ga(this._pickedColorNode,Qa.CLICK,(()=>this.model.selectNextColorPresentation()))),this._register(ga(this._originalColorNode,Qa.CLICK,(()=>{this.model.color=this.model.originalColor,this.model.flushColor()}))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this._pickedColorNode.style.backgroundColor=Lg.Format.CSS.format(t.color)||"",this._pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter()),this.onDidChangeColor(this.model.color),"standalone"===this.type&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new OZ(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=Lg.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}}const BZ=ll;class WZ extends mM{constructor(e,t,i,n,o){super(),this.model=t,this.pixelRatio=i,this._register(qF.getInstance(ta(e)).onDidChange((()=>this.layout()))),this._domNode=BZ(".colorpicker-widget"),e.appendChild(this._domNode),this.header=this._register(new FZ(this._domNode,this.model,n,o)),this.body=this._register(new AZ(this._domNode,this.model,this.pixelRatio,o))}layout(){this.body.layout()}get domNode(){return this._domNode}}class VZ{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new Zt,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new Zt,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new Zt,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let e=0;e<this.colorPresentations.length;e++)if(t.toLowerCase()===this.colorPresentations[e].label){i=e;break}if(-1===i){const e=t.split("(")[0].toLowerCase();for(let t=0;t<this.colorPresentations.length;t++)if(this.colorPresentations[t].label.toLowerCase().startsWith(e)){i=t;break}}-1!==i&&i!==this.presentationIndex&&(this.presentationIndex=i,this._onDidChangePresentation.fire(this.presentation))}flushColor(){this._onColorFlushed.fire(this._color)}}async function HZ(e,t,i){const n=e.getValueInRange(t.range),{red:o,green:s,blue:r,alpha:a}=t.color,l=new Sg(Math.round(255*o),Math.round(255*s),Math.round(255*r),a),d=new Lg(l),h=await o$(e,t,i,oi.None),c=new VZ(d,[],0);return c.colorPresentations=h||[],c.guessColorPresentation(d,n),{range:Yu.lift(t.range),model:c,provider:i}}function zZ(e,t,i){const n=[],o=i.presentation.textEdit??{range:t,text:i.presentation.label,forceMoveMarkers:!1};n.push(o),i.presentation.additionalTextEdits&&n.push(...i.presentation.additionalTextEdits);const s=Yu.lift(o.range),r=e.getModel()._setTrackedRange(null,s,3);return e.executeEdits("colorpicker",n),e.pushUndoStop(),e.getModel()._getTrackedRange(r)??s}async function UZ(e,t,i,n,o){const s=await o$(e,{range:n,color:{red:i.rgba.r/255,green:i.rgba.g/255,blue:i.rgba.b/255,alpha:i.rgba.a}},o.provider,oi.None);t.colorPresentations=s||[]}class KZ{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}static fromBaseColor(e,t){return new KZ(e,t.range,t.model,t.provider)}}let jZ=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t,i){return[]}computeAsync(e,t,i,n){return Ii.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];if(!this._isValidRequest(i))return[];const n=g$.get(this._editor);if(!n)return[];for(const e of t){if(!n.isColorDecoration(e))continue;const t=n.getColorData(e.range.getStartPosition());if(t)return[KZ.fromBaseColor(this,await HZ(this._editor.getModel(),t.colorInfo,t.provider))]}return[]}_isValidRequest(e){const t=this._editor.getOption(168);switch(e){case 0:return"hover"===t||"clickAndHover"===t;case 1:return"click"===t||"clickAndHover"===t;case 2:return!0}}renderHoverParts(e,t){const i=this._editor;if(0===t.length||!i.hasModel())return new Yq([]);const n=i.getOption(75)+8;e.setMinimumDimensions(new Da(302,n));const o=new Mt,s=t[0],r=i.getModel(),a=s.model;this._colorPicker=o.add(new WZ(e.fragment,a,i.getOption(163),this._themeService,"hover"));let l=!1,d=new Yu(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn);o.add(a.onColorFlushed((async e=>{await UZ(r,a,e,d,s),l=!0,d=zZ(i,d,a)}))),o.add(a.onDidChangeColor((e=>{UZ(r,a,e,d,s)}))),o.add(i.onDidChangeModelContent((t=>{l?l=!1:(e.hide(),i.focus())})));const h={hoverPart:KZ.fromBaseColor(this,s),hoverElement:this._colorPicker.domNode,dispose(){o.dispose()}};return new Yq([h])}handleResize(){this._colorPicker?.layout()}handleContentsChanged(){this._colorPicker?.layout()}handleHide(){this._colorPicker?.dispose(),this._colorPicker=void 0}isColorPickerVisible(){return!!this._colorPicker}};jZ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,sw)],jZ);class qZ{static insert(e,t){return{range:new Yu(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}function $Z(e,t){return!!e[t]}class GZ{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.mouseMiddleClickAction=t.mouseMiddleClickAction,this.hasTriggerModifier=$Z(e.event,t.triggerModifier),this.isMiddleClick&&"ctrlLeftClick"===t.mouseMiddleClickAction&&(this.isMiddleClick=!1,this.isLeftClick=!0,this.hasTriggerModifier=!0),this.hasSideBySideModifier=$Z(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class ZZ{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=$Z(e,t.triggerModifier)}}class YZ{constructor(e,t,i,n,o){this.mouseMiddleClickAction=o,this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=n}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier&&this.mouseMiddleClickAction===e.mouseMiddleClickAction}}function QZ(e,t){return"altKey"===e?$?new YZ(57,"metaKey",6,"altKey",t):new YZ(5,"ctrlKey",6,"altKey",t):$?new YZ(6,"altKey",57,"metaKey",t):new YZ(6,"altKey",5,"ctrlKey",t)}class XZ extends At{constructor(e,t){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new Zt),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new Zt),this.onExecute=this._onExecute.event,this._onCancel=this._register(new Zt),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=t?.extractLineNumberFromMouseEvent??(e=>e.target.position?e.target.position.lineNumber:0),this._opts=QZ(this._editor.getOption(86),this._editor.getOption(87)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration((e=>{if(e.hasChanged(86)||e.hasChanged(87)){const e=QZ(this._editor.getOption(86),this._editor.getOption(87));if(this._opts.equals(e))return;this._opts=e,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}}))),this._register(this._editor.onMouseMove((e=>this._onEditorMouseMove(new GZ(e,this._opts))))),this._register(this._editor.onMouseDown((e=>this._onEditorMouseDown(new GZ(e,this._opts))))),this._register(this._editor.onMouseUp((e=>this._onEditorMouseUp(new GZ(e,this._opts))))),this._register(this._editor.onKeyDown((e=>this._onEditorKeyDown(new ZZ(e,this._opts))))),this._register(this._editor.onKeyUp((e=>this._onEditorKeyUp(new ZZ(e,this._opts))))),this._register(this._editor.onMouseDrag((()=>this._resetHandler()))),this._register(this._editor.onDidChangeCursorSelection((e=>this._onDidChangeCursorSelection(e)))),this._register(this._editor.onDidChangeModel((e=>this._resetHandler()))),this._register(this._editor.onDidChangeModelContent((()=>this._resetHandler()))),this._register(this._editor.onDidScrollChange((e=>{(e.scrollTopChanged||e.scrollLeftChanged)&&this._resetHandler()})))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&(this._hasTriggerKeyOnMouseDown||e.isMiddleClick&&"openLink"===e.mouseMiddleClickAction)&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}class JZ{constructor(e,t){this.range=e,this.direction=t}}class eY{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(e){const t=new eY(this.hint,e.anchor,this.provider);return t._isResolved=this._isResolved,t._currentResolve=this._currentResolve,t}async resolve(e){if("function"==typeof this.provider.resolveInlayHint){if(this._currentResolve){if(await this._currentResolve,e.isCancellationRequested)return;return this.resolve(e)}this._isResolved||(this._currentResolve=this._doResolve(e).finally((()=>this._currentResolve=void 0))),await this._currentResolve}}async _doResolve(e){try{const t=await Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=t?.tooltip??this.hint.tooltip,this.hint.label=t?.label??this.hint.label,this.hint.textEdits=t?.textEdits??this.hint.textEdits,this._isResolved=!0}catch(e){Te(e),this._isResolved=!1}}}class tY{static{this._emptyInlayHintList=Object.freeze({dispose(){},hints:[]})}static async create(e,t,i,n){const o=[],s=e.ordered(t).reverse().map((e=>i.map((async i=>{try{const s=await e.provideInlayHints(t,i,n);(s?.hints.length||e.onDidChangeInlayHints)&&o.push([s??tY._emptyInlayHintList,e])}catch(e){Te(e)}}))));if(await Promise.all(s.flat()),n.isCancellationRequested||t.isDisposed())throw new Oe;return new tY(i,o,t)}constructor(e,t,i){this._disposables=new Mt,this.ranges=e,this.provider=new Set;const n=[];for(const[e,o]of t){this._disposables.add(e),this.provider.add(o);for(const t of e.hints){const e=i.validatePosition(t.position);let s="before";const r=tY._getRangeAtPosition(i,e);let a;r.getStartPosition().isBefore(e)?(a=Yu.fromPositions(r.getStartPosition(),e),s="after"):(a=Yu.fromPositions(e,r.getEndPosition()),s="before"),n.push(new eY(t,new JZ(a,s),o))}}this.items=n.sort(((e,t)=>rc.compare(e.hint.position,t.hint.position)))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const i=t.lineNumber,n=e.getWordAtPosition(t);if(n)return new Yu(i,n.startColumn,i,n.endColumn);e.tokenization.tokenizeIfCheap(i);const o=e.tokenization.getLineTokens(i),s=t.column-1,r=o.findTokenIndexAtOffset(s);let a=o.getStartOffset(r),l=o.getEndOffset(r);return l-a==1&&(a===s&&r>1?(a=o.getStartOffset(r-1),l=o.getEndOffset(r-1)):l===s&&r<o.getCount()-1&&(a=o.getStartOffset(r+1),l=o.getEndOffset(r+1))),new Yu(i,a+1,i,l+1)}}function iY(e){return!(!e||"function"!=typeof e.getEditorType)&&e.getEditorType()===gK.ICodeEditor}function nY(e){return!(!e||"function"!=typeof e.getEditorType)&&e.getEditorType()===gK.IDiffEditor}function oY(e){return iY(e)?e:nY(e)?e.getModifiedEditor():function(e){return!!e&&"object"==typeof e&&"function"==typeof e.onDidChangeActiveEditor}(e)&&iY(e.activeCodeEditor)?e.activeCodeEditor:null}var sY=function(e,t){return function(i,n){t(i,n,e)}};let rY=class extends tq{constructor(e,t,i,n,o,s,r,a,l,d,h,c,u){super(e,{...n.getRawOptions(),overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()},i,o,s,r,a,l,d,h,c,u),this._parentEditor=n,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(n.onDidChangeConfiguration((e=>this._onParentConfigurationChanged(e))))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){hg(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};function aY(e){const t=e.get(sc).getFocusedCodeEditor();return t instanceof rY?t.getParentEditor():t}rY=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([sY(4,nc),sY(5,sc),sY(6,mc),sY(7,eu),sY(8,sw),sY(9,lO),sY(10,rB),sY(11,Qp),sY(12,BD)],rY);var lY=i(9734),dY={};dY.styleTagTransform=zl(),dY.setAttributes=Bl(),dY.insert=Pl().bind(null,"head"),dY.domAPI=Rl(),dY.insertStyleElement=Vl(),Ml()(lY.A,dY),lY.A&&lY.A.locals&&lY.A.locals;var hY=i(2889),cY={};cY.styleTagTransform=zl(),cY.setAttributes=Bl(),cY.insert=Pl().bind(null,"head"),cY.domAPI=Rl(),cY.insertStyleElement=Vl(),Ml()(hY.A,cY),hY.A&&hY.A.locals&&hY.A.locals;const uY=new Lg(new Sg(0,122,204)),gY={showArrow:!0,showFrame:!0,className:"",frameColor:uY,arrowColor:uY,keepEditorSelection:!1};class pY{constructor(e,t,i,n,o,s,r,a){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=n,this.showInHiddenAreas=r,this.ordinal=a,this._onDomNodeTop=o,this._onComputedHeight=s}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class mY{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class fY{static{this._IdGenerator=new YD(".arrow-decoration-")}constructor(e){this._editor=e,this._ruleName=fY._IdGenerator.nextId(),this._color=null,this._height=-1,this._decorations=this._editor.createDecorationsCollection()}dispose(){this.hide(),AM(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){AM(this._ruleName),MM(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px !important; margin-left: -${this._height}px; `)}show(e){1===e.column&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:Yu.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}class _Y{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._isSashResizeHeight=!1,this._viewZone=null,this._disposables=new Mt,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=rg(t),hg(this.options,gY,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange((e=>{const t=this._getWidth(e);this.domNode.style.width=t+"px",this.domNode.style.left=this._getLeft(e)+"px",this._onWidth(t)})))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones((e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null})),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new fY(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&0===e.minimap.minimapLeft?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){if(this.domNode.style.height=`${e}px`,this.container){const t=e-this._decoratingElementsHeight();this.container.style.height=`${t}px`;const i=this.editor.getLayoutInfo();this._doLayout(t,this._getWidth(i))}this._resizeSash?.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const i=Yu.isIRange(e)?Yu.lift(e):Yu.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:bk.EMPTY}])}hide(){this._viewZone&&(this.editor.changeViewZones((e=>{this._viewZone&&e.removeZone(this._viewZone.id)})),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._arrow?.hide(),this._positionMarkerId.clear(),this._isSashResizeHeight=!1}_decoratingElementsHeight(){const e=this.editor.getOption(75);let t=0;return this.options.showArrow&&(t+=2*Math.round(e/3)),this.options.showFrame&&(t+=2*(this.options.frameWidth??Math.round(e/9))),t}_getMaximumHeightInLines(){return Math.max(12,this.editor.getLayoutInfo().height/this.editor.getOption(75)*.8)}_showImpl(e,t){const i=e.getStartPosition(),n=this.editor.getLayoutInfo(),o=this._getWidth(n);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(n)+"px";const s=document.createElement("div");s.style.overflow="hidden";const r=this.editor.getOption(75),a=this._getMaximumHeightInLines();void 0!==a&&(t=Math.min(t,a));let l=0,d=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(r/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(d=Math.round(r/9)),this.editor.changeViewZones((e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new pY(s,i.lineNumber,i.column,t,(e=>this._onViewZoneTop(e)),(e=>this._onViewZoneHeight(e)),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=e.addZone(this._viewZone),this._overlayWidget=new mY("vs.editor.contrib.zoneWidget"+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)})),this._updateSashEnablement(),this.container&&this.options.showFrame){const e=this.options.frameWidth?this.options.frameWidth:d;this.container.style.borderTopWidth=e+"px",this.container.style.borderBottomWidth=e+"px"}const h=t*r-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=h+"px",this.container.style.overflow="hidden"),this._doLayout(h,o),this.options.keepEditorSelection||this.editor.setSelection(e);const c=this.editor.getModel();if(c){const t=c.validateRange(new Yu(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(t,t.startLineNumber===c.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e,t){const i=this._getMaximumHeightInLines(),n=t&&void 0!==i?Math.min(i,e):e;this._viewZone&&this._viewZone.heightInLines!==n&&(this.editor.changeViewZones((e=>{this._viewZone&&(this._viewZone.heightInLines=n,e.layoutZone(this._viewZone.id))})),this._updateSashEnablement())}_initSash(){if(this._resizeSash)return;let e;this._resizeSash=this._disposables.add(new WG(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0),this._disposables.add(this._resizeSash.onDidStart((t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines,...this._getResizeBounds()})}))),this._disposables.add(this._resizeSash.onDidEnd((()=>{e=void 0}))),this._disposables.add(this._resizeSash.onDidChange((t=>{if(e){const i=(t.currentY-e.startY)/this.editor.getOption(75),n=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+n;o>e.minLines&&o<e.maxLines&&(this._isSashResizeHeight=!0,this._relayout(o))}})))}_updateSashEnablement(){if(this._resizeSash){const{minLines:e,maxLines:t}=this._getResizeBounds();this._resizeSash.state=e===t?0:3}}_getResizeBounds(){return{minLines:5,maxLines:35}}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(null===this.domNode.style.height?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}class vY{static equals(e,t){return e.x===t.x&&e.y===t.y}constructor(e,t){this.x=e,this.y=t}add(e){return new vY(this.x+e.x,this.y+e.y)}deltaX(e){return new vY(this.x+e,this.y)}deltaY(e){return new vY(this.x,this.y+e)}toString(){return`(${this.x},${this.y})`}subtract(e){return new vY(this.x-e.x,this.y-e.y)}scale(e){return new vY(this.x*e,this.y*e)}mapComponents(e){return new vY(e(this.x),e(this.y))}isZero(){return 0===this.x&&0===this.y}withThreshold(e){return this.mapComponents((t=>t>e?t-e:t<-e?t+e:0))}}function bY(e){return wY.get(e)}class wY extends At{static{this._map=new Map}static get(e){let t=wY._map.get(e);if(!t){t=new wY(e),wY._map.set(e,t);const i=e.onDidDispose((()=>{const t=wY._map.get(e);t&&(wY._map.delete(e),t.dispose(),i.dispose())}))}return t}_beginUpdate(){this._updateCounter++,1===this._updateCounter&&(this._currentTransaction=new Us((()=>{})))}_endUpdate(){if(this._updateCounter--,0===this._updateCounter){const e=this._currentTransaction;this._currentTransaction=void 0,e.finish()}}constructor(e){super(),this.editor=e,this._updateCounter=0,this._currentTransaction=void 0,this._model=Js(this,this.editor.getModel()),this.model=this._model,this.isReadonly=Sr(this,this.editor.onDidChangeConfiguration,(()=>this.editor.getOption(104))),this._versionId=or({owner:this,lazy:!0},this.editor.getModel()?.getVersionId()??null),this.versionId=this._versionId,this._selections=or({owner:this,equalsFn:Ts(Is(Qu.selectionsEqual)),lazy:!0},this.editor.getSelections()??null),this.selections=this._selections,this.positions=fr({owner:this,equalsFn:Ts(Is(rc.equals))},(e=>this.selections.read(e)?.map((e=>e.getStartPosition()))??null)),this.isFocused=Sr(this,(e=>{const t=this.editor.onDidFocusEditorWidget(e),i=this.editor.onDidBlurEditorWidget(e);return{dispose(){t.dispose(),i.dispose()}}}),(()=>this.editor.hasWidgetFocus())),this.isTextFocused=Sr(this,(e=>{const t=this.editor.onDidFocusEditorText(e),i=this.editor.onDidBlurEditorText(e);return{dispose(){t.dispose(),i.dispose()}}}),(()=>this.editor.hasTextFocus())),this.inComposition=Sr(this,(e=>{const t=this.editor.onDidCompositionStart((()=>{e(void 0)})),i=this.editor.onDidCompositionEnd((()=>{e(void 0)}));return{dispose(){t.dispose(),i.dispose()}}}),(()=>this.editor.inComposition)),this.value=mr(this,(e=>(this.versionId.read(e),this.model.read(e)?.getValue()??"")),((e,t)=>{const i=this.model.get();null!==i&&e!==i.getValue()&&i.setValue(e)})),this.valueIsEmpty=pr(this,(e=>(this.versionId.read(e),0===this.editor.getModel()?.getValueLength()))),this.cursorSelection=fr({owner:this,equalsFn:Ts(Qu.selectionsEqual)},(e=>this.selections.read(e)?.[0]??null)),this.cursorPosition=fr({owner:this,equalsFn:rc.equals},(e=>this.selections.read(e)?.[0]?.getPosition()??null)),this.cursorLineNumber=pr(this,(e=>this.cursorPosition.read(e)?.lineNumber??null)),this.onDidType=Lr(this),this.onDidPaste=Lr(this),this.scrollTop=Sr(this.editor.onDidScrollChange,(()=>this.editor.getScrollTop())),this.scrollLeft=Sr(this.editor.onDidScrollChange,(()=>this.editor.getScrollLeft())),this.layoutInfo=Sr(this.editor.onDidLayoutChange,(()=>this.editor.getLayoutInfo())),this.layoutInfoContentLeft=this.layoutInfo.map((e=>e.contentLeft)),this.layoutInfoDecorationsLeft=this.layoutInfo.map((e=>e.decorationsLeft)),this.layoutInfoWidth=this.layoutInfo.map((e=>e.width)),this.layoutInfoHeight=this.layoutInfo.map((e=>e.height)),this.layoutInfoMinimap=this.layoutInfo.map((e=>e.minimap)),this.layoutInfoVerticalScrollbarWidth=this.layoutInfo.map((e=>e.verticalScrollbarWidth)),this.contentWidth=Sr(this.editor.onDidContentSizeChange,(()=>this.editor.getContentWidth())),this.contentHeight=Sr(this.editor.onDidContentSizeChange,(()=>this.editor.getContentHeight())),this._widgetCounter=0,this.openedPeekWidgets=Js(this,0),this._register(this.editor.onBeginUpdate((()=>this._beginUpdate()))),this._register(this.editor.onEndUpdate((()=>this._endUpdate()))),this._register(this.editor.onDidChangeModel((()=>{this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._forceUpdate()}finally{this._endUpdate()}}))),this._register(this.editor.onDidType((e=>{this._beginUpdate();try{this._forceUpdate(),this.onDidType.trigger(this._currentTransaction,e)}finally{this._endUpdate()}}))),this._register(this.editor.onDidPaste((e=>{this._beginUpdate();try{this._forceUpdate(),this.onDidPaste.trigger(this._currentTransaction,e)}finally{this._endUpdate()}}))),this._register(this.editor.onDidChangeModelContent((e=>{this._beginUpdate();try{this._versionId.set(this.editor.getModel()?.getVersionId()??null,this._currentTransaction,e),this._forceUpdate()}finally{this._endUpdate()}}))),this._register(this.editor.onDidChangeCursorSelection((e=>{this._beginUpdate();try{this._selections.set(this.editor.getSelections(),this._currentTransaction,e),this._forceUpdate()}finally{this._endUpdate()}}))),this.domNode=pr((e=>(this.model.read(e),this.editor.getDomNode())))}forceUpdate(e){this._beginUpdate();try{if(this._forceUpdate(),!e)return;return e(this._currentTransaction)}finally{this._endUpdate()}}_forceUpdate(){this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._versionId.set(this.editor.getModel()?.getVersionId()??null,this._currentTransaction,void 0),this._selections.set(this.editor.getSelections(),this._currentTransaction,void 0)}finally{this._endUpdate()}}getOption(e,t=Ks.ofCaller()){return Sr(this,(t=>this.editor.onDidChangeConfiguration((i=>{i.hasChanged(e)&&t(void 0)}))),(()=>this.editor.getOption(e)),t)}setDecorations(e){const t=new Mt,i=this.editor.createDecorationsCollection();return t.add(lr({owner:this,debugName:()=>`Apply decorations from ${e.debugName}`},(t=>{const n=e.read(t);i.set(n)}))),t.add({dispose:()=>{i.clear()}}),t}createOverlayWidget(e){const t="observableOverlayWidget"+this._widgetCounter++,i={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow,getMinContentWidthInPx:()=>e.minContentWidthInPx.get()};this.editor.addOverlayWidget(i);const n=ar((t=>{e.position.read(t),e.minContentWidthInPx.read(t),this.editor.layoutOverlayWidget(i)}));return Tt((()=>{n.dispose(),this.editor.removeOverlayWidget(i)}))}createContentWidget(e){const t="observableContentWidget"+this._widgetCounter++,i={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow};this.editor.addContentWidget(i);const n=ar((t=>{e.position.read(t),this.editor.layoutContentWidget(i)}));return Tt((()=>{n.dispose(),this.editor.removeContentWidget(i)}))}observeLineOffsetRange(e,t){const i=this.observePosition(e.map((e=>new rc(e.startLineNumber,1))),t),n=this.observePosition(e.map((e=>new rc(e.endLineNumberExclusive+1,1))),t);return pr((t=>{i.read(t),n.read(t);const o=e.read(t),s=this.model.read(t)?.getLineCount(),r=(void 0!==s&&o.startLineNumber>s?this.editor.getBottomForLineNumber(s):this.editor.getTopForLineNumber(o.startLineNumber))-this.scrollTop.read(t),a=o.isEmpty?r:this.editor.getBottomForLineNumber(o.endLineNumberExclusive-1)-this.scrollTop.read(t);return new cm(r,a)}))}observePosition(e,t){let i=e.get();const n=or({owner:this,debugName:()=>`topLeftOfPosition${i?.toString()}`,equalsFn:Ts(vY.equals)},new vY(0,0)),o="observablePositionWidget"+this._widgetCounter++,s=document.createElement("div"),r={getDomNode:()=>s,getPosition:()=>i?{preference:[0],position:e.get()}:null,getId:()=>o,allowEditorOverflow:!1,afterRender:(e,t)=>{const o=this._model.get();o&&i&&i.lineNumber>o.getLineCount()?n.set(new vY(0,this.editor.getBottomForLineNumber(o.getLineCount())-this.scrollTop.get()),void 0):n.set(t?new vY(t.left,t.top):null,void 0)}};return this.editor.addContentWidget(r),t.add(ar((t=>{i=e.read(t),this.editor.layoutContentWidget(r)}))),t.add(Tt((()=>{this.editor.removeContentWidget(r)}))),n}isTargetHovered(e,t){const i=Js("isInjectedTextHovered",!1);return t.add(this.editor.onMouseMove((t=>{const n=e(t);i.set(n,void 0)}))),t.add(this.editor.onMouseLeave((e=>{i.set(!1,void 0)}))),i}observeLineHeightForPosition(e){return pr((t=>{const i=e instanceof rc?e:e.read(t);return null===i?null:(this.getOption(75).read(t),this.editor.getLineHeightForPosition(i))}))}observeLineHeightForLine(e){return"number"==typeof e?this.observeLineHeightForPosition(new rc(e,1)):pr((t=>{const i=e.read(t);return null===i?null:this.observeLineHeightForPosition(new rc(i,1)).read(t)}))}observeLineHeightsForLineRange(e){return pr((t=>{const i=e instanceof ym?e:e.read(t),n=[];for(let e=i.startLineNumber;e<i.endLineNumberExclusive;e++)n.push(this.observeLineHeightForLine(e).read(t));return n}))}}var CY=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},yY=function(e,t){return function(i,n){t(i,n,e)}};const SY=oc("IPeekViewService");var xY;wp(SY,class{constructor(){this._widgets=new Map}addExclusiveWidget(e,t){const i=this._widgets.get(e);i&&(i.listener.dispose(),i.widget.dispose()),this._widgets.set(e,{widget:t,listener:t.onDidClose((()=>{const i=this._widgets.get(e);i&&i.widget===t&&(i.listener.dispose(),this._widgets.delete(e))}))})}},1),function(e){e.inPeekEditor=new Jc("inReferenceSearchEditor",!0,y(1306,"Whether the current code editor is embedded inside peek")),e.notInPeekEditor=e.inPeekEditor.toNegated()}(xY||(xY={}));let kY=class{static{this.ID="editor.contrib.referenceController"}constructor(e,t){e instanceof rY&&xY.inPeekEditor.bindTo(t)}dispose(){}};kY=CY([yY(1,eu)],kY),Uu(kY.ID,kY,0);const LY={headerBackgroundColor:Lg.white,primaryHeadingColor:Lg.fromHex("#333333"),secondaryHeadingColor:Lg.fromHex("#6c6c6cb3")};let DY=class extends _Y{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new Zt,this.onDidClose=this._onDidClose.event,hg(this.options,LY,!1);const n=bY(this.editor);n.openedPeekWidgets.set(n.openedPeekWidgets.get()+1,void 0)}dispose(){if(!this.disposed){this.disposed=!0,super.dispose(),this._onDidClose.fire(this);const e=bY(this.editor);e.openedPeekWidgets.set(e.openedPeekWidgets.get()-1,void 0)}}style(e){const t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();const e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=ll(".head"),this._bodyElement=ll(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=ll(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),ma(this._titleElement,"click",(e=>this._onTitleClick(e)))),il(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=ll("span.filename"),this._secondaryHeading=ll("span.dirname"),this._metaHeading=ll("span.meta"),il(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=ll(".peekview-actions");il(this._headElement,i);const n=this._getActionBarOptions();this._actionbarWidget=new uR(i,n),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(this._disposables.add(new dc("peekview.close",y(1307,"Close"),vh.asClassName(fh.close),!0,(()=>(this.dispose(),Promise.resolve())))),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:H$.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:ca(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,dl(this._metaHeading)):hl(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0)return void this.dispose();const i=Math.ceil(1.2*this.editor.getOption(75)),n=Math.round(e-(i+1));this._doLayoutHead(i,t),this._doLayoutBody(n,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};DY=CY([yY(2,nc)],DY);const EY=Ff("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:Lg.black,hcLight:Lg.white},y(1308,"Background color of the peek view title area.")),NY=Ff("peekViewTitleLabel.foreground",{dark:Lg.white,light:Lg.black,hcDark:Lg.white,hcLight:l_},y(1309,"Color of the peek view title.")),IY=Ff("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},y(1310,"Color of the peek view title info.")),TY=Ff("peekView.border",{dark:__,light:__,hcDark:Qf,hcLight:Qf},y(1311,"Color of the peek view borders and arrow.")),MY=Ff("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:Lg.black,hcLight:Lg.white},y(1312,"Background color of the peek view result list.")),AY=(Ff("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:Lg.white,hcLight:l_},y(1313,"Foreground color for line nodes in the peek view result list.")),Ff("peekViewResult.fileForeground",{dark:Lg.white,light:"#1E1E1E",hcDark:Lg.white,hcLight:l_},y(1314,"Foreground color for file nodes in the peek view result list.")),Ff("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},y(1315,"Background color of the selected entry in the peek view result list.")),Ff("peekViewResult.selectionForeground",{dark:Lg.white,light:"#6C6C6C",hcDark:Lg.white,hcLight:l_},y(1316,"Foreground color of the selected entry in the peek view result list.")),Ff("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:Lg.black,hcLight:Lg.white},y(1317,"Background color of the peek view editor.")));Ff("peekViewEditorGutter.background",AY,y(1318,"Background color of the gutter in the peek view editor.")),Ff("peekViewEditorStickyScroll.background",AY,y(1319,"Background color of sticky scroll in the peek view editor.")),Ff("peekViewEditorStickyScrollGutter.background",AY,y(1320,"Background color of the gutter part of sticky scroll in the peek view editor.")),Ff("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},y(1321,"Match highlight color in the peek view result list.")),Ff("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},y(1322,"Match highlight color in the peek view editor.")),Ff("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Xf,hcLight:Xf},y(1323,"Match highlight border in the peek view editor."));class RY{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:At.None}}renderElement(e,t,i,n){if(i.disposable?.dispose(),!i.data)return;const o=this.modelProvider();if(o.isResolved(e))return this.renderer.renderElement(o.get(e),e,i.data,n);const s=new ri,r=o.resolve(e,s.token);i.disposable={dispose:()=>s.cancel()},this.renderer.renderPlaceholder(e,i.data),r.then((t=>this.renderer.renderElement(t,e,i.data,n)))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class OY{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}class PY{constructor(e,t,i,n,o={}){const s=()=>this.model,r=n.map((e=>new RY(e,s)));this.list=new XA(e,t,i,r,function(e,t){return{...t,accessibilityProvider:t.accessibilityProvider&&new OY(e,t.accessibilityProvider)}}(s,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return zt.map(this.list.onMouseDblClick,(({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:i})))}get onPointer(){return zt.map(this.list.onPointer,(({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:i})))}get onDidChangeSelection(){return zt.map(this.list.onDidChangeSelection,(({elements:e,indexes:t,browserEvent:i})=>({elements:e.map((e=>this._model.get(e))),indexes:t,browserEvent:i})))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,us(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map((e=>this.model.get(e)))}style(e){this.list.style(e)}dispose(){this.list.dispose()}}var FY=i(3474),BY={};BY.styleTagTransform=zl(),BY.setAttributes=Bl(),BY.insert=Pl().bind(null,"head"),BY.domAPI=Rl(),BY.insertStyleElement=Vl(),Ml()(FY.A,BY),FY.A&&FY.A.locals&&FY.A.locals;const WY={separatorBorder:Lg.transparent};class VY{set size(e){this._size=e}get size(){return this._size}get visible(){return void 0===this._cachedVisibleSize}setVisible(e,t){if(e!==this.visible){e?(this.size=FM(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize="number"==typeof t?t:this.size,this.size=0),this.container.classList.toggle("visible",e);try{this.view.setVisible?.(e)}catch(e){console.error("Splitview: Failed to set visible view"),console.error(e)}}}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){return this.view.proportionalLayout??!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,n){this.container=e,this.view=t,this.disposable=n,this._cachedVisibleSize=void 0,"number"==typeof i?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e);try{this.view.layout(this.size,e,t)}catch(e){console.error("Splitview: Failed to layout view"),console.error(e)}}dispose(){this.disposable.dispose()}}class HY extends VY{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class zY extends VY{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var UY,KY;!function(e){e[e.Idle=0]="Idle",e[e.Busy=1]="Busy"}(UY||(UY={})),function(e){e.Distribute={type:"distribute"},e.Split=function(e){return{type:"split",index:e}},e.Auto=function(e){return{type:"auto",index:e}},e.Invisible=function(e){return{type:"invisible",cachedVisibleSize:e}}}(KY||(KY={}));class jY extends At{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=UY.Idle,this._onDidSashChange=this._register(new Zt),this._onDidSashReset=this._register(new Zt),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=t.orientation??0,this.inverseAltBehavior=t.inverseAltBehavior??!1,this.proportionalLayout=t.proportionalLayout??!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(0===this.orientation?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=il(this.el,ll(".sash-container")),this.viewContainer=ll(".split-view-container"),this.scrollable=this._register(new QM({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:e=>Ca(ta(this.el),e)})),this.scrollableElement=this._register(new lA(this.viewContainer,{vertical:0===this.orientation?t.scrollbarVisibility??1:2,horizontal:1===this.orientation?t.scrollbarVisibility??1:2},this.scrollable));const i=this._register(new OM(this.viewContainer,"scroll")).event;this._register(i((e=>{const t=this.scrollableElement.getScrollPosition(),i=Math.abs(this.viewContainer.scrollLeft-t.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,n=Math.abs(this.viewContainer.scrollTop-t.scrollTop)<=1?void 0:this.viewContainer.scrollTop;void 0===i&&void 0===n||this.scrollableElement.setScrollPosition({scrollLeft:i,scrollTop:n})}))),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll((e=>{e.scrollTopChanged&&(this.viewContainer.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this.viewContainer.scrollLeft=e.scrollLeft)}))),il(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||WY),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach(((e,t)=>{const i=pt(e.visible)||e.visible?e.size:{type:"invisible",cachedVisibleSize:e.size},n=e.view;this.doAddView(n,i,t,!0)})),this._contentSize=this.viewItems.reduce(((e,t)=>e+t.size),0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,n){this.doAddView(e,t,i,n)}layout(e,t){const i=Math.max(this.size,this._contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let t=0;for(let i=0;i<this.viewItems.length;i++){const n=this.viewItems[i],o=this.proportions[i];"number"==typeof o?t+=o:e-=n.size}for(let i=0;i<this.viewItems.length;i++){const n=this.viewItems[i],o=this.proportions[i];"number"==typeof o&&t>0&&(n.size=FM(Math.round(o*e/t),n.minimumSize,n.maximumSize))}}else{const t=us(this.viewItems.length),n=t.filter((e=>1===this.viewItems[e].priority)),o=t.filter((e=>2===this.viewItems[e].priority));this.resize(this.viewItems.length-1,e-i,void 0,n,o)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this.proportions=this.viewItems.map((e=>e.proportionalLayout&&e.visible?e.size/this._contentSize:void 0)))}onSashStart({sash:e,start:t,alt:i}){for(const e of this.viewItems)e.enabled=!1;const n=this.sashItems.findIndex((t=>t.sash===e)),o=Nt(ga(this.el.ownerDocument.body,"keydown",(e=>s(this.sashDragState.current,e.altKey))),ga(this.el.ownerDocument.body,"keyup",(()=>s(this.sashDragState.current,!1)))),s=(e,t)=>{const i=this.viewItems.map((e=>e.size));let s,r,a=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(t=!t),t)if(n===this.sashItems.length-1){const e=this.viewItems[n];a=(e.minimumSize-e.size)/2,l=(e.maximumSize-e.size)/2}else{const e=this.viewItems[n+1];a=(e.size-e.maximumSize)/2,l=(e.size-e.minimumSize)/2}if(!t){const e=us(n,-1),t=us(n+1,this.viewItems.length),o=e.reduce(((e,t)=>e+(this.viewItems[t].minimumSize-i[t])),0),a=e.reduce(((e,t)=>e+(this.viewItems[t].viewMaximumSize-i[t])),0),l=0===t.length?Number.POSITIVE_INFINITY:t.reduce(((e,t)=>e+(i[t]-this.viewItems[t].minimumSize)),0),d=0===t.length?Number.NEGATIVE_INFINITY:t.reduce(((e,t)=>e+(i[t]-this.viewItems[t].viewMaximumSize)),0),h=Math.max(o,d),c=Math.min(l,a),u=this.findFirstSnapIndex(e),g=this.findFirstSnapIndex(t);if("number"==typeof u){const e=this.viewItems[u],t=Math.floor(e.viewMinimumSize/2);s={index:u,limitDelta:e.visible?h-t:h+t,size:e.size}}if("number"==typeof g){const e=this.viewItems[g],t=Math.floor(e.viewMinimumSize/2);r={index:g,limitDelta:e.visible?c+t:c-t,size:e.size}}}this.sashDragState={start:e,current:e,index:n,sizes:i,minDelta:a,maxDelta:l,alt:t,snapBefore:s,snapAfter:r,disposable:o}};s(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:n,alt:o,minDelta:s,maxDelta:r,snapBefore:a,snapAfter:l}=this.sashDragState;this.sashDragState.current=e;const d=e-i,h=this.resize(t,d,n,void 0,void 0,s,r,a,l);if(o){const e=t===this.sashItems.length-1,i=this.viewItems.map((e=>e.size)),n=e?t:t+1,o=this.viewItems[n],s=o.size-o.maximumSize,r=o.size-o.minimumSize,a=e?t-1:t+1;this.resize(a,-h,i,void 0,void 0,s,r)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const e of this.viewItems)e.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=FM(t="number"==typeof t?t:e.size,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(!(e<0||e>=this.viewItems.length)){if(this.state!==UY.Idle)throw new Error("Cant modify splitview");this.state=UY.Busy;try{const i=us(this.viewItems.length).filter((t=>t!==e)),n=[...i.filter((e=>1===this.viewItems[e].priority)),e],o=i.filter((e=>2===this.viewItems[e].priority)),s=this.viewItems[e];t=FM(t=Math.round(t),s.minimumSize,Math.min(s.maximumSize,this.size)),s.size=t,this.relayout(n,o)}finally{this.state=UY.Idle}}}distributeViewSizes(){const e=[];let t=0;for(const i of this.viewItems)i.maximumSize-i.minimumSize>0&&(e.push(i),t+=i.size);const i=Math.floor(t/e.length);for(const t of e)t.size=FM(i,t.minimumSize,t.maximumSize);const n=us(this.viewItems.length),o=n.filter((e=>1===this.viewItems[e].priority)),s=n.filter((e=>2===this.viewItems[e].priority));this.relayout(o,s)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,n){if(this.state!==UY.Idle)throw new Error("Cant modify splitview");this.state=UY.Busy;try{const o=ll(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));const s=e.onDidChange((e=>this.onViewChange(l,e))),r=Nt(s,Tt((()=>o.remove())));let a;"number"==typeof t?a=t:("auto"===t.type&&(t=this.areViewsDistributed()?{type:"distribute"}:{type:"split",index:t.index}),a="split"===t.type?this.getViewSize(t.index)/2:"invisible"===t.type?{cachedVisibleSize:t.cachedVisibleSize}:e.minimumSize);const l=0===this.orientation?new HY(o,e,a,r):new zY(o,e,a,r);if(this.viewItems.splice(i,0,l),this.viewItems.length>1){const e={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},t=0===this.orientation?new WG(this.sashContainer,{getHorizontalSashTop:e=>this.getSashPosition(e),getHorizontalSashWidth:this.getSashOrthogonalSize},{...e,orientation:1}):new WG(this.sashContainer,{getVerticalSashLeft:e=>this.getSashPosition(e),getVerticalSashHeight:this.getSashOrthogonalSize},{...e,orientation:0}),n=0===this.orientation?e=>({sash:t,start:e.startY,current:e.currentY,alt:e.altKey}):e=>({sash:t,start:e.startX,current:e.currentX,alt:e.altKey}),o=zt.map(t.onDidStart,n)(this.onSashStart,this),s=zt.map(t.onDidChange,n)(this.onSashChange,this),r=zt.map(t.onDidEnd,(()=>this.sashItems.findIndex((e=>e.sash===t)))),a=r(this.onSashEnd,this),l=t.onDidReset((()=>{const e=this.sashItems.findIndex((e=>e.sash===t)),i=us(e,-1),n=us(e+1,this.viewItems.length),o=this.findFirstSnapIndex(i),s=this.findFirstSnapIndex(n);("number"!=typeof o||this.viewItems[o].visible)&&("number"!=typeof s||this.viewItems[s].visible)&&this._onDidSashReset.fire(e)})),d=Nt(o,s,a,l,t),h={sash:t,disposable:d};this.sashItems.splice(i-1,0,h)}let d;o.appendChild(e.element),"number"!=typeof t&&"split"===t.type&&(d=[t.index]),n||this.relayout([i],d),n||"number"==typeof t||"distribute"!==t.type||this.distributeViewSizes()}finally{this.state=UY.Idle}}relayout(e,t){const i=this.viewItems.reduce(((e,t)=>e+t.size),0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map((e=>e.size)),n,o,s=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,a,l){if(e<0||e>=this.viewItems.length)return 0;const d=us(e,-1),h=us(e+1,this.viewItems.length);if(o)for(const e of o)ps(d,e),ps(h,e);if(n)for(const e of n)ms(d,e),ms(h,e);const c=d.map((e=>this.viewItems[e])),u=d.map((e=>i[e])),g=h.map((e=>this.viewItems[e])),p=h.map((e=>i[e])),m=d.reduce(((e,t)=>e+(this.viewItems[t].minimumSize-i[t])),0),f=d.reduce(((e,t)=>e+(this.viewItems[t].maximumSize-i[t])),0),_=0===h.length?Number.POSITIVE_INFINITY:h.reduce(((e,t)=>e+(i[t]-this.viewItems[t].minimumSize)),0),v=0===h.length?Number.NEGATIVE_INFINITY:h.reduce(((e,t)=>e+(i[t]-this.viewItems[t].maximumSize)),0),b=Math.max(m,v,s),w=Math.min(_,f,r);let C=!1;if(a){const e=this.viewItems[a.index],i=t>=a.limitDelta;C=i!==e.visible,e.setVisible(i,a.size)}if(!C&&l){const e=this.viewItems[l.index],i=t<l.limitDelta;C=i!==e.visible,e.setVisible(i,l.size)}if(C)return this.resize(e,t,i,n,o,s,r);for(let e=0,i=t=FM(t,b,w);e<c.length;e++){const t=c[e],n=FM(u[e]+i,t.minimumSize,t.maximumSize);i-=n-u[e],t.size=n}for(let e=0,i=t;e<g.length;e++){const t=g[e],n=FM(p[e]-i,t.minimumSize,t.maximumSize);i+=n-p[e],t.size=n}return t}distributeEmptySpace(e){const t=this.viewItems.reduce(((e,t)=>e+t.size),0);let i=this.size-t;const n=us(this.viewItems.length-1,-1),o=n.filter((e=>1===this.viewItems[e].priority)),s=n.filter((e=>2===this.viewItems[e].priority));for(const e of s)ps(n,e);for(const e of o)ms(n,e);"number"==typeof e&&ms(n,e);for(let e=0;0!==i&&e<n.length;e++){const t=this.viewItems[n[e]],o=FM(t.size+i,t.minimumSize,t.maximumSize);i-=o-t.size,t.size=o}}layoutViews(){this._contentSize=this.viewItems.reduce(((e,t)=>e+t.size),0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach((e=>e.sash.layout())),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){0===this.orientation?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this._contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this._contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map((t=>e=t.size-t.minimumSize>0||e));e=!1;const i=this.viewItems.map((t=>e=t.maximumSize-t.size>0||e)),n=[...this.viewItems].reverse();e=!1;const o=n.map((t=>e=t.size-t.minimumSize>0||e)).reverse();e=!1;const s=n.map((t=>e=t.maximumSize-t.size>0||e)).reverse();let r=0;for(let e=0;e<this.sashItems.length;e++){const{sash:n}=this.sashItems[e];r+=this.viewItems[e].size;const a=!(t[e]&&s[e+1]),l=!(i[e]&&o[e+1]);if(a&&l){const i=us(e,-1),s=us(e+1,this.viewItems.length),a=this.findFirstSnapIndex(i),l=this.findFirstSnapIndex(s),d="number"==typeof a&&!this.viewItems[a].visible,h="number"==typeof l&&!this.viewItems[l].visible;d&&o[e]&&(r>0||this.startSnappingEnabled)?n.state=1:h&&t[e]&&(r<this._contentSize||this.endSnappingEnabled)?n.state=2:n.state=0}else n.state=a&&!l?1:!a&&l?2:3}}getSashPosition(e){let t=0;for(let i=0;i<this.sashItems.length;i++)if(t+=this.viewItems[i].size,this.sashItems[i].sash===e)return t;return 0}findFirstSnapIndex(e){for(const t of e){const e=this.viewItems[t];if(e.visible&&e.snap)return t}for(const t of e){const e=this.viewItems[t];if(e.visible&&e.maximumSize-e.minimumSize>0)return;if(!e.visible&&e.snap)return t}}areViewsDistributed(){let e,t;for(const i of this.viewItems)if(e=void 0===e?i.size:Math.min(e,i.size),t=void 0===t?i.size:Math.max(t,i.size),t-e>2)return!1;return!0}dispose(){this.sashDragState?.disposable.dispose(),Et(this.viewItems),this.viewItems=[],this.sashItems.forEach((e=>e.disposable.dispose())),this.sashItems=[],super.dispose()}}var qY=i(4234),$Y={};$Y.styleTagTransform=zl(),$Y.setAttributes=Bl(),$Y.insert=Pl().bind(null,"head"),$Y.domAPI=Rl(),$Y.insertStyleElement=Vl(),Ml()(qY.A,$Y),qY.A&&qY.A.locals&&qY.A.locals;class GY{static{this.TemplateId="row"}constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=GY.TemplateId,this.renderedTemplates=new Set;const n=new Map(t.map((e=>[e.templateId,e])));this.renderers=[];for(const t of e){const e=n.get(t.templateId);if(!e)throw new Error(`Table cell renderer for template id ${t.templateId} not found.`);this.renderers.push(e)}}renderTemplate(e){const t=il(e,ll(".monaco-table-tr")),i=[],n=[];for(let e=0;e<this.columns.length;e++){const o=this.renderers[e],s=il(t,ll(".monaco-table-td",{"data-col-index":e}));s.style.width=`${this.getColumnSize(e)}px`,i.push(s),n.push(o.renderTemplate(s))}const o={container:e,cellContainers:i,cellTemplateData:n};return this.renderedTemplates.add(o),o}renderElement(e,t,i,n){for(let o=0;o<this.columns.length;o++){const s=this.columns[o].project(e);this.renderers[o].renderElement(s,t,i.cellTemplateData[o],n)}}disposeElement(e,t,i,n){for(let o=0;o<this.columns.length;o++){const s=this.renderers[o];if(s.disposeElement){const r=this.columns[o].project(e);s.disposeElement(r,t,i.cellTemplateData[o],n)}}}disposeTemplate(e){for(let t=0;t<this.columns.length;t++)this.renderers[t].disposeTemplate(e.cellTemplateData[t]);ca(e.container),this.renderedTemplates.delete(e)}layoutColumn(e,t){for(const{cellContainers:i}of this.renderedTemplates)i[e].style.width=`${t}px`}}class ZY extends At{get minimumSize(){return this.column.minimumWidth??120}get maximumSize(){return this.column.maximumWidth??Number.POSITIVE_INFINITY}get onDidChange(){return this.column.onDidChangeWidthConstraints??zt.None}constructor(e,t){super(),this.column=e,this.index=t,this._onDidLayout=new Zt,this.onDidLayout=this._onDidLayout.event,this.element=ll(".monaco-table-th",{"data-col-index":t},e.label),e.tooltip&&this._register(lM().setupManagedHover(nM("mouse"),this.element,e.tooltip))}layout(e){this._onDidLayout.fire([this.index,e])}}class YY{static{this.InstanceCount=0}get onDidChangeFocus(){return this.list.onDidChangeFocus}get onDidChangeSelection(){return this.list.onDidChangeSelection}get onDidScroll(){return this.list.onDidScroll}get onMouseDblClick(){return this.list.onMouseDblClick}get onPointer(){return this.list.onPointer}get onDidFocus(){return this.list.onDidFocus}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get scrollHeight(){return this.list.scrollHeight}get renderHeight(){return this.list.renderHeight}get onDidDispose(){return this.list.onDidDispose}constructor(e,t,i,n,o,s){this.virtualDelegate=i,this.columns=n,this.domId="table_id_"+ ++YY.InstanceCount,this.disposables=new Mt,this.cachedWidth=0,this.cachedHeight=0,this.domNode=il(t,ll(`.monaco-table.${this.domId}`));const r=n.map(((e,t)=>this.disposables.add(new ZY(e,t)))),a={size:r.reduce(((e,t)=>e+t.column.weight),0),views:r.map((e=>({size:e.column.weight,view:e})))};this.splitview=this.disposables.add(new jY(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:a})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const l=new GY(n,o,(e=>this.splitview.getViewSize(e)));var d;this.list=this.disposables.add(new XA(e,this.domNode,(d=i,{getHeight:e=>d.getHeight(e),getTemplateId:()=>GY.TemplateId}),[l],s)),zt.any(...r.map((e=>e.onDidLayout)))((([e,t])=>l.layoutColumn(e,t)),null,this.disposables),this.splitview.onDidSashReset((e=>{const t=n.reduce(((e,t)=>e+t.weight),0),i=n[e].weight/t*this.cachedWidth;this.splitview.resizeView(e,i)}),null,this.disposables),this.styleElement=DM(this.domNode),this.style(jA)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\ttop: ${this.virtualDelegate.headerRowHeight+1}px;\n\t\t\theight: calc(100% - ${this.virtualDelegate.headerRowHeight}px);\n\t\t}`),this.styleElement.textContent=t.join("\n"),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}var QY=i(2516),XY={};XY.styleTagTransform=zl(),XY.setAttributes=Bl(),XY.insert=Pl().bind(null,"head"),XY.domAPI=Rl(),XY.insertStyleElement=Vl(),Ml()(QY.A,XY),QY.A&&QY.A.locals&&QY.A.locals;const JY={inputActiveOptionBorder:"#007ACC00",inputActiveOptionForeground:"#FFFFFF",inputActiveOptionBackground:"#0E639C50"};class eQ extends mM{get onChange(){return this._onChange.event}get onKeyDown(){return this._onKeyDown.event}constructor(e){super(),this._onChange=this._register(new Zt),this._onKeyDown=this._register(new Zt),this._opts=e,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...vh.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this._hover=this._register(lM().setupManagedHover(e.hoverDelegate??nM("mouse"),this.domNode,this._opts.title)),this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,(e=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),e.preventDefault())})),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,(e=>{if(this.enabled)return 10===e.keyCode||3===e.keyCode?(this.checked=!this._checked,this._onChange.fire(!0),e.preventDefault(),void e.stopPropagation()):void this._onKeyDown.fire(e)}))}get enabled(){return"true"!==this.domNode.getAttribute("aria-disabled")}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}setIcon(e){this._icon&&this.domNode.classList.remove(...vh.asClassNameArray(this._icon)),this._icon=e,this._icon&&this.domNode.classList.add(...vh.asClassNameArray(this._icon))}width(){return 22}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1)),this.domNode.classList.remove("disabled")}disable(){this.domNode.setAttribute("aria-disabled",String(!0)),this.domNode.classList.add("disabled")}setTitle(e){this._hover.update(e),this.domNode.setAttribute("aria-label",e)}}class tQ extends mM{static{this.CLASS_NAME="monaco-checkbox"}constructor(e,t,i){super(),this.checkbox=e,this.domNode=t,this.styles=i,this._onChange=this._register(new Zt),this.onChange=this._onChange.event,this.applyStyles()}get enabled(){return this.checkbox.enabled}enable(){this.checkbox.enable(),this.applyStyles(!0)}disable(){this.checkbox.disable(),this.applyStyles(!1)}setTitle(e){this.checkbox.setTitle(e)}applyStyles(e=this.enabled){this.domNode.style.color=(e?this.styles.checkboxForeground:this.styles.checkboxDisabledForeground)||"",this.domNode.style.backgroundColor=(e?this.styles.checkboxBackground:this.styles.checkboxDisabledBackground)||"",this.domNode.style.borderColor=(e?this.styles.checkboxBorder:this.styles.checkboxDisabledBackground)||"";const t=this.styles.size||18;this.domNode.style.width=this.domNode.style.height=this.domNode.style.fontSize=`${t}px`,this.domNode.style.fontSize=t-2+"px"}}class iQ extends tQ{constructor(e,t,i){const n=new eQ({title:e,isChecked:t,icon:fh.check,actionClassName:tQ.CLASS_NAME,hoverDelegate:i.hoverDelegate,...JY});super(n,n.domNode,i),this._register(n),this._register(this.checkbox.onChange((e=>{this.applyStyles(),this._onChange.fire(e)})))}get checked(){return this.checkbox.checked}set checked(e){this.checkbox.checked=e,this.applyStyles()}applyStyles(e){this.checkbox.checked?this.checkbox.setIcon(fh.check):this.checkbox.setIcon(void 0),super.applyStyles(e)}}class nQ extends tQ{constructor(e,t,i){let n;switch(t){case!0:n=fh.check;break;case"partial":n=fh.dash;break;case!1:n=void 0}const o=new eQ({title:e,isChecked:!0===t,icon:n,actionClassName:iQ.CLASS_NAME,hoverDelegate:i.hoverDelegate,...JY});super(o,o.domNode,i),this._state=t,this._register(o),this._register(this.checkbox.onChange((e=>{this._state=this.checkbox.checked,this.applyStyles(),this._onChange.fire(e)})))}get checked(){return this._state}set checked(e){this._state!==e&&(this._state=e,this.checkbox.checked=!0===e,this.applyStyles())}applyStyles(e){switch(this._state){case!0:this.checkbox.setIcon(fh.check);break;case"partial":this.checkbox.setIcon(fh.dash);break;case!1:this.checkbox.setIcon(void 0)}super.applyStyles(e)}}const oQ=y(2,"Match Case"),sQ=y(3,"Match Whole Word"),rQ=y(4,"Use Regular Expression");class aQ extends eQ{constructor(e){super({icon:fh.caseSensitive,title:oQ+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??nM("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class lQ extends eQ{constructor(e){super({icon:fh.wholeWord,title:sQ+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??nM("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class dQ extends eQ{constructor(e){super({icon:fh.regex,title:rQ+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??nM("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}function hQ(e,t,i){const n=i??document.createElement("div");return n.textContent="",uQ(n,function(e,t){const i={type:1,children:[]};let n=0,o=i;const s=[],r=new cQ(e);for(;!r.eos();){let e=r.next();const i="\\"===e&&0!==gQ(r.peek(),t);if(i&&(e=r.next()),i||0===gQ(e,t)||e!==r.peek())if("\n"===e)2===o.type&&(o=s.pop()),o.children.push({type:8});else if(2!==o.type){const t={type:2,content:e};o.children.push(t),s.push(o),o=t}else o.content+=e;else{r.advance(),2===o.type&&(o=s.pop());const i=gQ(e,t);if(o.type===i||5===o.type&&6===i)o=s.pop();else{const e={type:i,children:[]};5===i&&(e.index=n,n++),o.children.push(e),s.push(o),o=e}}}return 2===o.type&&(o=s.pop()),s.length,i}(e,!!t?.renderCodeSegments),t?.actionHandler,t?.renderCodeSegments),n}class cQ{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function uQ(e,t,i,n){let o;if(2===t.type)o=document.createTextNode(t.content||"");else if(3===t.type)o=document.createElement("b");else if(4===t.type)o=document.createElement("i");else if(7===t.type&&n)o=document.createElement("code");else if(5===t.type&&i){const e=document.createElement("a");i.disposables.add(ma(e,"click",(e=>{i.callback(String(t.index),e)}))),o=e}else 8===t.type?o=document.createElement("br"):1===t.type&&(o=e);o&&e!==o&&e.appendChild(o),o&&Array.isArray(t.children)&&t.children.forEach((e=>{uQ(o,e,i,n)}))}function gQ(e,t){switch(e){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return t?7:0;default:return 0}}class pQ{constructor(e,t=0,i=e.length,n=t-1){this.items=e,this.start=t,this.end=i,this.index=n}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class mQ{constructor(e=new Set,t=10){this._history=e,this._limit=t,this._onChange(),this._history.onDidChange&&(this._disposable=this._history.onDidChange((()=>this._onChange())))}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return 0!==this._currentPosition()?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return null===this._navigator.current()}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new pQ(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;if(e.length>this._limit){const t=e.slice(e.length-this._limit);this._history.replace?this._history.replace(t):this._history=new Set(t)}}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}get _elements(){const e=[];return this._history.forEach((t=>e.push(t))),e}dispose(){this._disposable&&(this._disposable.dispose(),this._disposable=void 0)}}var fQ=i(1366),_Q={};_Q.styleTagTransform=zl(),_Q.setAttributes=Bl(),_Q.insert=Pl().bind(null,"head"),_Q.domAPI=Rl(),_Q.insertStyleElement=Vl(),Ml()(fQ.A,_Q),fQ.A&&fQ.A.locals&&fQ.A.locals;const vQ=ll;class bQ extends mM{get onDidChange(){return this._onDidChange.event}get onDidHeightChange(){return this._onDidHeightChange.event}constructor(e,t,i){super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this.hover=this._register(new Rt),this._onDidChange=this._register(new Zt),this._onDidHeightChange=this._register(new Zt),this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=this.options.tooltip??(this.placeholder||""),this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=il(e,vQ(".monaco-inputbox.idle"));const n=this.options.flexibleHeight?"textarea":"input",o=il(this.element,vQ(".ibwrapper"));if(this.input=il(o,vQ(n+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,(()=>this.element.classList.add("synthetic-focus"))),this.onblur(this.input,(()=>this.element.classList.remove("synthetic-focus"))),this.options.flexibleHeight){this.maxHeight="number"==typeof this.options.flexibleMaxHeight?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=il(o,vQ("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new aA(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),il(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll((e=>this.input.scrollTop=e.scrollTop)));const t=this._register(new OM(e.ownerDocument,"selectionchange")),i=zt.filter(t.event,(()=>{const t=e.ownerDocument.getSelection();return t?.anchorNode===o}));this._register(i(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,(()=>this.onValueChange())),this.onblur(this.input,(()=>this.onBlur())),this.onfocus(this.input,(()=>this.onFocus())),this._register(this.ignoreGesture(this.input)),setTimeout((()=>this.updateMirror()),0),this.options.actions&&(this.actionbar=this._register(new uR(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.hover.value||(this.hover.value=this._register(lM().setupDelayedHoverAtMouse(this.input,(()=>({content:this.tooltip,appearance:{compact:!0}})))))}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return"number"==typeof this.cachedHeight?this.cachedHeight:Ra(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return Ha(this.input)}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}getSelection(){const e=this.input.selectionStart;return null===e?null:{start:e,end:this.input.selectionEnd??e}}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if("number"!=typeof this.cachedContentHeight||"number"!=typeof this.cachedHeight||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){if("open"===this.state&&cg(this.message,e))return;this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${vM(i.border,"transparent")}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e?.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=Ta(this.element)+"px";let i;this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:i=>{if(!this.message)return null;e=il(i,vQ(".monaco-inputbox-container")),t();const n=vQ("span.monaco-inputbox-message");var o;this.message.formatContent?hQ(this.message.content,void 0,n):(o=this.message.content,(n??document.createElement("div")).textContent=o),n.classList.add(this.classForType(this.message.type));const s=this.stylesForType(this.message.type);return n.style.backgroundColor=s.background??"",n.style.color=s.foreground??"",n.style.border=s.border?`1px solid ${s.border}`:"",il(e,n),null},onHide:()=>{this.state="closed"},layout:t}),i=3===this.message.type?y(9,"Error: {0}",this.message.content):2===this.message.type?y(10,"Warning: {0}",this.message.content):y(11,"Info: {0}",this.message.content),Yl(i),this.state="open"}_hideMessage(){this.contextViewProvider&&("open"===this.state&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),"open"===this.state&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,t=10===e.charCodeAt(e.length-1)?" ":"";(e+t).replace(/\u000c/g,"")?this.mirror.textContent=e+t:this.mirror.innerText=" ",this.layout()}applyStyles(){const e=this.options.inputBoxStyles,t=e.inputBackground??"",i=e.inputForeground??"",n=e.inputBorder??"";this.element.style.backgroundColor=t,this.element.style.color=i,this.input.style.backgroundColor="inherit",this.input.style.color=i,this.element.style.border=`1px solid ${vM(n,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=Ra(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,n=t.selectionEnd,o=t.value;null!==i&&null!==n&&(this.value=o.substr(0,i)+e+o.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){this._hideMessage(),this.message=null,this.actionbar?.dispose(),super.dispose()}}class wQ extends bQ{constructor(e,t,i){const n=y(12," or {0} for history","⇅"),o=y(13," ({0} for history)","⇅");super(e,t,i),this._onDidFocus=this._register(new Zt),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new Zt),this.onDidBlur=this._onDidBlur.event,this.history=this._register(new mQ(i.history,100));const s=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(n)&&!this.placeholder.endsWith(o)&&this.history.getHistory().length){const e=this.placeholder.endsWith(")")?n:o,t=this.placeholder+e;i.showPlaceholderOnFocus&&!Ha(this.input)?this.placeholder=t:this.setPlaceHolder(t)}};this.observer=new MutationObserver(((e,t)=>{e.forEach((e=>{e.target.textContent||s()}))})),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,(()=>s())),this.onblur(this.input,(()=>{const e=e=>{if(this.placeholder.endsWith(e)){const t=this.placeholder.slice(0,this.placeholder.length-e.length);return i.showPlaceholderOnFocus?this.placeholder=t:this.setPlaceHolder(t),!0}return!1};e(o)||e(n)}))}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=e??"",Ql(this.value?this.value:y(14,"Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,Ql(this.value))}setPlaceHolder(e){super.setPlaceHolder(e),this.setTooltip(e)}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}}var CQ=i(8474),yQ={};yQ.styleTagTransform=zl(),yQ.setAttributes=Bl(),yQ.insert=Pl().bind(null,"head"),yQ.domAPI=Rl(),yQ.insertStyleElement=Vl(),Ml()(CQ.A,yQ),CQ.A&&CQ.A.locals&&CQ.A.locals;const SQ=y(1,"input");class xQ extends mM{get onDidOptionChange(){return this._onDidOptionChange.event}get onKeyDown(){return this._onKeyDown.event}get onMouseDown(){return this._onMouseDown.event}get onCaseSensitiveKeyDown(){return this._onCaseSensitiveKeyDown.event}get onRegexKeyDown(){return this._onRegexKeyDown.event}constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Rt),this.additionalToggles=[],this._onDidOptionChange=this._register(new Zt),this._onKeyDown=this._register(new Zt),this._onMouseDown=this._register(new Zt),this._onInput=this._register(new Zt),this._onKeyUp=this._register(new Zt),this._onCaseSensitiveKeyDown=this._register(new Zt),this._onRegexKeyDown=this._register(new Zt),this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||SQ,this.showCommonFindToggles=!!i.showCommonFindToggles;const n=i.appendCaseSensitiveLabel||"",o=i.appendWholeWordsLabel||"",s=i.appendRegexLabel||"",r=!!i.flexibleHeight,a=!!i.flexibleWidth,l=i.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new wQ(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},showHistoryHint:i.showHistoryHint,flexibleHeight:r,flexibleWidth:a,flexibleMaxHeight:l,inputBoxStyles:i.inputBoxStyles,history:i.history}));const d=this._register(oM());if(this.showCommonFindToggles){this.regex=this._register(new dQ({appendTitle:s,isChecked:!1,hoverDelegate:d,...i.toggleStyles})),this._register(this.regex.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this._register(this.regex.onKeyDown((e=>{this._onRegexKeyDown.fire(e)}))),this.wholeWords=this._register(new lQ({appendTitle:o,isChecked:!1,hoverDelegate:d,...i.toggleStyles})),this._register(this.wholeWords.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this.caseSensitive=this._register(new aQ({appendTitle:n,isChecked:!1,hoverDelegate:d,...i.toggleStyles})),this._register(this.caseSensitive.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this._register(this.caseSensitive.onKeyDown((e=>{this._onCaseSensitiveKeyDown.fire(e)})));const e=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,(t=>{if(t.equals(15)||t.equals(17)||t.equals(9)){const i=e.indexOf(this.domNode.ownerDocument.activeElement);if(i>=0){let n=-1;t.equals(17)?n=(i+1)%e.length:t.equals(15)&&(n=0===i?e.length-1:i-1),t.equals(9)?(e[i].blur(),this.inputBox.focus()):n>=0&&e[n].focus(),Ja(t,!0)}}}))}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(i?.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e?.appendChild(this.domNode),this._register(ga(this.inputBox.inputElement,"compositionstart",(e=>{this.imeSessionInProgress=!0}))),this._register(ga(this.inputBox.inputElement,"compositionend",(e=>{this.imeSessionInProgress=!1,this._onInput.fire()}))),this.onkeydown(this.inputBox.inputElement,(e=>this._onKeyDown.fire(e))),this.onkeyup(this.inputBox.inputElement,(e=>this._onKeyUp.fire(e))),this.oninput(this.inputBox.inputElement,(e=>this._onInput.fire())),this.onmousedown(this.inputBox.inputElement,(e=>this._onMouseDown.fire(e)))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.regex?.enable(),this.wholeWords?.enable(),this.caseSensitive?.enable();for(const e of this.additionalToggles)e.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.regex?.disable(),this.wholeWords?.disable(),this.caseSensitive?.disable();for(const e of this.additionalToggles)e.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(const e of this.additionalToggles)e.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new Mt;for(const t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()}))),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){this.inputBox.paddingRight=e?0:(this.caseSensitive?.width()??0)+(this.wholeWords?.width()??0)+(this.regex?.width()??0)+this.additionalToggles.reduce(((e,t)=>e+t.width()),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){return this.caseSensitive?.checked??!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){return this.wholeWords?.checked??!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){return this.regex?.checked??!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){this.caseSensitive?.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}}var kQ,LQ;!function(e){e[e.Expanded=0]="Expanded",e[e.Collapsed=1]="Collapsed",e[e.PreserveOrExpanded=2]="PreserveOrExpanded",e[e.PreserveOrCollapsed=3]="PreserveOrCollapsed"}(kQ||(kQ={})),function(e){e[e.Unknown=0]="Unknown",e[e.Twistie=1]="Twistie",e[e.Element=2]="Element",e[e.Filter=3]="Filter"}(LQ||(LQ={}));class DQ extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class EQ{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}}class NQ{constructor(e,t,i,n){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=n}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class IQ{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,n=e.length;i<n;i++)t[i]=e.charCodeAt(i);return t}}function TQ(e,t,i){return new OQ(new IQ(e),new IQ(t)).ComputeDiff(i).changes}class MQ{static Assert(e,t){if(!e)throw new Error(t)}}class AQ{static Copy(e,t,i,n,o){for(let s=0;s<o;s++)i[n+s]=e[t+s]}static Copy2(e,t,i,n,o){for(let s=0;s<o;s++)i[n+s]=e[t+s]}}class RQ{constructor(){this.m_changes=[],this.m_originalStart=1073741824,this.m_modifiedStart=1073741824,this.m_originalCount=0,this.m_modifiedCount=0}MarkNextChange(){(this.m_originalCount>0||this.m_modifiedCount>0)&&this.m_changes.push(new NQ(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class OQ{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[n,o,s]=OQ._getElements(e),[r,a,l]=OQ._getElements(t);this._hasStrings=s&&l,this._originalStringElements=n,this._originalElementsOrHash=o,this._modifiedStringElements=r,this._modifiedElementsOrHash=a,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&"string"==typeof e[0]}static _getElements(e){const t=e.getElements();if(OQ._isStringArray(t)){const e=new Int32Array(t.length);for(let i=0,n=t.length;i<n;i++)e[i]=Uo(t[i],0);return[t,e,!0]}return t instanceof Int32Array?[[],t,!1]:[[],new Int32Array(t),!1]}ElementsAreEqual(e,t){return this._originalElementsOrHash[e]===this._modifiedElementsOrHash[t]&&(!this._hasStrings||this._originalStringElements[e]===this._modifiedStringElements[t])}ElementsAreStrictEqual(e,t){return!!this.ElementsAreEqual(e,t)&&OQ._getStrictElement(this._originalSequence,e)===OQ._getStrictElement(this._modifiedSequence,t)}static _getStrictElement(e,t){return"function"==typeof e.getStrictElement?e.getStrictElement(t):null}OriginalElementsAreEqual(e,t){return this._originalElementsOrHash[e]===this._originalElementsOrHash[t]&&(!this._hasStrings||this._originalStringElements[e]===this._originalStringElements[t])}ModifiedElementsAreEqual(e,t){return this._modifiedElementsOrHash[e]===this._modifiedElementsOrHash[t]&&(!this._hasStrings||this._modifiedStringElements[e]===this._modifiedStringElements[t])}ComputeDiff(e){return this._ComputeDiff(0,this._originalElementsOrHash.length-1,0,this._modifiedElementsOrHash.length-1,e)}_ComputeDiff(e,t,i,n,o){const s=[!1];let r=this.ComputeDiffRecursive(e,t,i,n,s);return o&&(r=this.PrettifyChanges(r)),{quitEarly:s[0],changes:r}}ComputeDiffRecursive(e,t,i,n,o){for(o[0]=!1;e<=t&&i<=n&&this.ElementsAreEqual(e,i);)e++,i++;for(;t>=e&&n>=i&&this.ElementsAreEqual(t,n);)t--,n--;if(e>t||i>n){let o;return i<=n?(MQ.Assert(e===t+1,"originalStart should only be one more than originalEnd"),o=[new NQ(e,0,i,n-i+1)]):e<=t?(MQ.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),o=[new NQ(e,t-e+1,i,0)]):(MQ.Assert(e===t+1,"originalStart should only be one more than originalEnd"),MQ.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),o=[]),o}const s=[0],r=[0],a=this.ComputeRecursionPoint(e,t,i,n,s,r,o),l=s[0],d=r[0];if(null!==a)return a;if(!o[0]){const s=this.ComputeDiffRecursive(e,l,i,d,o);let r=[];return r=o[0]?[new NQ(l+1,t-(l+1)+1,d+1,n-(d+1)+1)]:this.ComputeDiffRecursive(l+1,t,d+1,n,o),this.ConcatenateChanges(s,r)}return[new NQ(e,t-e+1,i,n-i+1)]}WALKTRACE(e,t,i,n,o,s,r,a,l,d,h,c,u,g,p,m,f,_){let v=null,b=null,w=new RQ,C=t,y=i,S=u[0]-m[0]-n,x=-1073741824,k=this.m_forwardHistory.length-1;do{const t=S+e;t===C||t<y&&l[t-1]<l[t+1]?(g=(h=l[t+1])-S-n,h<x&&w.MarkNextChange(),x=h,w.AddModifiedElement(h+1,g),S=t+1-e):(g=(h=l[t-1]+1)-S-n,h<x&&w.MarkNextChange(),x=h-1,w.AddOriginalElement(h,g+1),S=t-1-e),k>=0&&(e=(l=this.m_forwardHistory[k])[0],C=1,y=l.length-1)}while(--k>=-1);if(v=w.getReverseChanges(),_[0]){let e=u[0]+1,t=m[0]+1;if(null!==v&&v.length>0){const i=v[v.length-1];e=Math.max(e,i.getOriginalEnd()),t=Math.max(t,i.getModifiedEnd())}b=[new NQ(e,c-e+1,t,p-t+1)]}else{w=new RQ,C=s,y=r,S=u[0]-m[0]-a,x=1073741824,k=f?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const e=S+o;e===C||e<y&&d[e-1]>=d[e+1]?(g=(h=d[e+1]-1)-S-a,h>x&&w.MarkNextChange(),x=h+1,w.AddOriginalElement(h+1,g+1),S=e+1-o):(g=(h=d[e-1])-S-a,h>x&&w.MarkNextChange(),x=h,w.AddModifiedElement(h+1,g+1),S=e-1-o),k>=0&&(o=(d=this.m_reverseHistory[k])[0],C=1,y=d.length-1)}while(--k>=-1);b=w.getChanges()}return this.ConcatenateChanges(v,b)}ComputeRecursionPoint(e,t,i,n,o,s,r){let a=0,l=0,d=0,h=0,c=0,u=0;e--,i--,o[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(n-i),p=g+1,m=new Int32Array(p),f=new Int32Array(p),_=n-i,v=t-e,b=e-i,w=t-n,C=(v-_)%2==0;m[_]=e,f[v]=t,r[0]=!1;for(let y=1;y<=g/2+1;y++){let g=0,S=0;d=this.ClipDiagonalBound(_-y,y,_,p),h=this.ClipDiagonalBound(_+y,y,_,p);for(let e=d;e<=h;e+=2){a=e===d||e<h&&m[e-1]<m[e+1]?m[e+1]:m[e-1]+1,l=a-(e-_)-b;const i=a;for(;a<t&&l<n&&this.ElementsAreEqual(a+1,l+1);)a++,l++;if(m[e]=a,a+l>g+S&&(g=a,S=l),!C&&Math.abs(e-v)<=y-1&&a>=f[e])return o[0]=a,s[0]=l,i<=f[e]&&y<=1448?this.WALKTRACE(_,d,h,b,v,c,u,w,m,f,a,t,o,l,n,s,C,r):null}const x=(g-e+(S-i)-y)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(g,x))return r[0]=!0,o[0]=g,s[0]=S,x>0&&y<=1448?this.WALKTRACE(_,d,h,b,v,c,u,w,m,f,a,t,o,l,n,s,C,r):(e++,i++,[new NQ(e,t-e+1,i,n-i+1)]);c=this.ClipDiagonalBound(v-y,y,v,p),u=this.ClipDiagonalBound(v+y,y,v,p);for(let g=c;g<=u;g+=2){a=g===c||g<u&&f[g-1]>=f[g+1]?f[g+1]-1:f[g-1],l=a-(g-v)-w;const p=a;for(;a>e&&l>i&&this.ElementsAreEqual(a,l);)a--,l--;if(f[g]=a,C&&Math.abs(g-_)<=y&&a<=m[g])return o[0]=a,s[0]=l,p>=m[g]&&y<=1448?this.WALKTRACE(_,d,h,b,v,c,u,w,m,f,a,t,o,l,n,s,C,r):null}if(y<=1447){let e=new Int32Array(h-d+2);e[0]=_-d+1,AQ.Copy2(m,d,e,1,h-d+1),this.m_forwardHistory.push(e),e=new Int32Array(u-c+2),e[0]=v-c+1,AQ.Copy2(f,c,e,1,u-c+1),this.m_reverseHistory.push(e)}}return this.WALKTRACE(_,d,h,b,v,c,u,w,m,f,a,t,o,l,n,s,C,r)}PrettifyChanges(e){for(let t=0;t<e.length;t++){const i=e[t],n=t<e.length-1?e[t+1].originalStart:this._originalElementsOrHash.length,o=t<e.length-1?e[t+1].modifiedStart:this._modifiedElementsOrHash.length,s=i.originalLength>0,r=i.modifiedLength>0;for(;i.originalStart+i.originalLength<n&&i.modifiedStart+i.modifiedLength<o&&(!s||this.OriginalElementsAreEqual(i.originalStart,i.originalStart+i.originalLength))&&(!r||this.ModifiedElementsAreEqual(i.modifiedStart,i.modifiedStart+i.modifiedLength));){const e=this.ElementsAreStrictEqual(i.originalStart,i.modifiedStart);if(this.ElementsAreStrictEqual(i.originalStart+i.originalLength,i.modifiedStart+i.modifiedLength)&&!e)break;i.originalStart++,i.modifiedStart++}const a=[null];t<e.length-1&&this.ChangesOverlap(e[t],e[t+1],a)&&(e[t]=a[0],e.splice(t+1,1),t--)}for(let t=e.length-1;t>=0;t--){const i=e[t];let n=0,o=0;if(t>0){const i=e[t-1];n=i.originalStart+i.originalLength,o=i.modifiedStart+i.modifiedLength}const s=i.originalLength>0,r=i.modifiedLength>0;let a=0,l=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let e=1;;e++){const t=i.originalStart-e,d=i.modifiedStart-e;if(t<n||d<o)break;if(s&&!this.OriginalElementsAreEqual(t,t+i.originalLength))break;if(r&&!this.ModifiedElementsAreEqual(d,d+i.modifiedLength))break;const h=(t===n&&d===o?5:0)+this._boundaryScore(t,i.originalLength,d,i.modifiedLength);h>l&&(l=h,a=e)}i.originalStart-=a,i.modifiedStart-=a;const d=[null];t>0&&this.ChangesOverlap(e[t-1],e[t],d)&&(e[t-1]=d[0],e.splice(t,1),t++)}if(this._hasStrings)for(let t=1,i=e.length;t<i;t++){const i=e[t-1],n=e[t],o=n.originalStart-i.originalStart-i.originalLength,s=i.originalStart,r=n.originalStart+n.originalLength,a=r-s,l=i.modifiedStart,d=n.modifiedStart+n.modifiedLength,h=d-l;if(o<5&&a<20&&h<20){const e=this._findBetterContiguousSequence(s,a,l,h,o);if(e){const[t,s]=e;t===i.originalStart+i.originalLength&&s===i.modifiedStart+i.modifiedLength||(i.originalLength=t-i.originalStart,i.modifiedLength=s-i.modifiedStart,n.originalStart=t+o,n.modifiedStart=s+o,n.originalLength=r-n.originalStart,n.modifiedLength=d-n.modifiedStart)}}}return e}_findBetterContiguousSequence(e,t,i,n,o){if(t<o||n<o)return null;const s=e+t-o+1,r=i+n-o+1;let a=0,l=0,d=0;for(let t=e;t<s;t++)for(let e=i;e<r;e++){const i=this._contiguousSequenceScore(t,e,o);i>0&&i>a&&(a=i,l=t,d=e)}return a>0?[l,d]:null}_contiguousSequenceScore(e,t,i){let n=0;for(let o=0;o<i;o++){if(!this.ElementsAreEqual(e+o,t+o))return 0;n+=this._originalStringElements[e+o].length}return n}_OriginalIsBoundary(e){return e<=0||e>=this._originalElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,n){return(this._OriginalRegionIsBoundary(e,t)?1:0)+(this._ModifiedRegionIsBoundary(i,n)?1:0)}ConcatenateChanges(e,t){const i=[];if(0===e.length||0===t.length)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const n=new Array(e.length+t.length-1);return AQ.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],AQ.Copy(t,1,n,e.length,t.length-1),n}{const i=new Array(e.length+t.length);return AQ.Copy(e,0,i,0,e.length),AQ.Copy(t,0,i,e.length,t.length),i}}ChangesOverlap(e,t,i){if(MQ.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),MQ.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const n=e.originalStart;let o=e.originalLength;const s=e.modifiedStart;let r=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(r=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new NQ(n,o,s,r),!0}return i[0]=null,!1}ClipDiagonalBound(e,t,i,n){if(e>=0&&e<n)return e;const o=t%2==0;return e<0?o===(i%2==0)?0:1:o===((n-i-1)%2==0)?n-1:n-2}}function PQ(e){return!!e&&void 0!==e.visibility}function FQ(e){switch(e){case!0:return 1;case!1:return 0;default:return e}}function BQ(e){return"boolean"==typeof e.collapsible}new Uint32Array(65536);class WQ{constructor(e,t,i={}){this.user=e,this.rootRef=[],this.eventBufferer=new ti,this._onDidSpliceModel=new Zt,this.onDidSpliceModel=this._onDidSpliceModel.event,this._onDidSpliceRenderedNodes=new Zt,this.onDidSpliceRenderedNodes=this._onDidSpliceRenderedNodes.event,this._onDidChangeCollapseState=new Zt,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new Zt,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this.refilterDelayer=new gi(li),this.collapseByDefault=void 0!==i.collapseByDefault&&i.collapseByDefault,this.allowNonCollapsibleParents=i.allowNonCollapsibleParents??!1,this.filter=i.filter,this.autoExpandSingleChildren=void 0!==i.autoExpandSingleChildren&&i.autoExpandSingleChildren,this.root={parent:void 0,element:t,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=Ct.empty(),n={}){if(0===e.length)throw new DQ(this.user,"Invalid tree location");n.diffIdentityProvider?this.spliceSmart(n.diffIdentityProvider,e,t,i,n):this.spliceSimple(e,t,i,n)}spliceSmart(e,t,i,n=Ct.empty(),o,s=o.diffDepth??0){const{parentNode:r}=this.getParentNodeWithListIndex(t);if(!r.lastDiffIds)return this.spliceSimple(t,i,n,o);const a=[...n],l=t[t.length-1],d=new OQ({getElements:()=>r.lastDiffIds},{getElements:()=>[...r.children.slice(0,l),...a,...r.children.slice(l+i)].map((t=>e.getId(t.element).toString()))}).ComputeDiff(!1);if(d.quitEarly)return r.lastDiffIds=void 0,this.spliceSimple(t,i,a,o);const h=t.slice(0,-1),c=(t,i,n)=>{if(s>0)for(let r=0;r<n;r++)t--,i--,this.spliceSmart(e,[...h,t,0],Number.MAX_SAFE_INTEGER,a[i].children,o,s-1)};let u=Math.min(r.children.length,l+i),g=a.length;for(const e of d.changes.sort(((e,t)=>t.originalStart-e.originalStart)))c(u,g,u-(e.originalStart+e.originalLength)),u=e.originalStart,g=e.modifiedStart-l,this.spliceSimple([...h,u],e.originalLength,Ct.slice(a,g,g+e.modifiedLength),o);c(u,g,u)}spliceSimple(e,t,i=Ct.empty(),{onDidCreateNode:n,onDidDeleteNode:o,diffIdentityProvider:s}){const{parentNode:r,listIndex:a,revealed:l,visible:d}=this.getParentNodeWithListIndex(e),h=[],c=Ct.map(i,(e=>this.createTreeNode(e,r,r.visible?1:0,l,h,n))),u=e[e.length-1];let g=0;for(let e=u;e>=0&&e<r.children.length;e--){const t=r.children[e];if(t.visible){g=t.visibleChildIndex;break}}const p=[];let m=0,f=0;for(const e of c)p.push(e),f+=e.renderNodeCount,e.visible&&(e.visibleChildIndex=g+m++);const _=vs(r.children,u,t,p);s?r.lastDiffIds?vs(r.lastDiffIds,u,t,p.map((e=>s.getId(e.element).toString()))):r.lastDiffIds=r.children.map((e=>s.getId(e.element).toString())):r.lastDiffIds=void 0;let v=0;for(const e of _)e.visible&&v++;if(0!==v)for(let e=u+p.length;e<r.children.length;e++){const t=r.children[e];t.visible&&(t.visibleChildIndex-=v)}if(r.visibleChildrenCount+=m-v,_.length>0&&o){const e=t=>{o(t),t.children.forEach(e)};_.forEach(e)}if(l&&d){const e=_.reduce(((e,t)=>e+(t.visible?t.renderNodeCount:0)),0);this._updateAncestorsRenderNodeCount(r,f-e),this._onDidSpliceRenderedNodes.fire({start:a,deleteCount:e,elements:h})}this._onDidSpliceModel.fire({insertedNodes:p,deletedNodes:_});let b=r;for(;b;){if(2===b.visibility){this.refilterDelayer.trigger((()=>this.refilter()));break}b=b.parent}}rerender(e){if(0===e.length)throw new DQ(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:n}=this.getTreeNodeWithListIndex(e);t.visible&&n&&this._onDidSpliceRenderedNodes.fire({start:i,deleteCount:1,elements:[t]})}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:n}=this.getTreeNodeWithListIndex(e);return i&&n?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);void 0===t&&(t=!i.collapsible);const n={collapsible:t};return this.eventBufferer.bufferEvents((()=>this._setCollapseState(e,n)))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const n=this.getTreeNode(e);void 0===t&&(t=!n.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents((()=>this._setCollapseState(e,o)))}_setCollapseState(e,t){const{node:i,listIndex:n,revealed:o}=this.getTreeNodeWithListIndex(e),s=this._setListNodeCollapseState(i,n,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&s&&!BQ(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let n=-1;for(let e=0;e<i.children.length;e++)if(i.children[e].visible){if(n>-1){n=-1;break}n=e}n>-1&&this._setCollapseState([...e,n],t)}return s}_setListNodeCollapseState(e,t,i,n){const o=this._setNodeCollapseState(e,n,!1);if(!i||!e.visible||!o)return o;const s=e.renderNodeCount,r=this.updateNodeAfterCollapseChange(e),a=s-(-1===t?0:1);return this._onDidSpliceRenderedNodes.fire({start:t+1,deleteCount:a,elements:r.slice(1)}),o}_setNodeCollapseState(e,t,i){let n;if(e===this.root?n=!1:(BQ(t)?(n=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(n=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):n=!1,n&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!BQ(t)&&t.recursive)for(const i of e.children)n=this._setNodeCollapseState(i,t,!0)||n;return n}expandTo(e){this.eventBufferer.bufferEvents((()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})}))}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this._onDidSpliceRenderedNodes.fire({start:0,deleteCount:e,elements:t}),this.refilterDelayer.cancel()}createTreeNode(e,t,i,n,o,s){const r={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:"boolean"==typeof e.collapsible?e.collapsible:void 0!==e.collapsed,collapsed:void 0===e.collapsed?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},a=this._filterNode(r,i);r.visibility=a,n&&o.push(r);const l=e.children||Ct.empty(),d=n&&0!==a&&!r.collapsed;let h=0,c=1;for(const e of l){const t=this.createTreeNode(e,r,a,d,o,s);r.children.push(t),c+=t.renderNodeCount,t.visible&&(t.visibleChildIndex=h++)}return this.allowNonCollapsibleParents||(r.collapsible=r.collapsible||r.children.length>0),r.visibleChildrenCount=h,r.visible=2===a?h>0:1===a,r.visible?r.collapsed||(r.renderNodeCount=c):(r.renderNodeCount=0,n&&o.pop()),s?.(r),r}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(!1===e.visible)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,n=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),0===o)return e.visible=!1,e.renderNodeCount=0,!1;n&&i.push(e)}const s=i.length;e.renderNodeCount=e===this.root?0:1;let r=!1;if(e.collapsed&&0===o)e.visibleChildrenCount=0;else{let t=0;for(const s of e.children)r=this._updateNodeAfterFilterChange(s,o,i,n&&!e.collapsed)||r,s.visible&&(s.visibleChildIndex=t++);e.visibleChildrenCount=t}return e!==this.root&&(e.visible=2===o?r:1===o,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-s):(e.renderNodeCount=0,n&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(0!==t)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):1;return"boolean"==typeof i?(e.filterData=void 0,i?1:0):PQ(i)?(e.filterData=i.data,FQ(i.visibility)):(e.filterData=void 0,FQ(i))}hasTreeNode(e,t=this.root){if(!e||0===e.length)return!0;const[i,...n]=e;return!(i<0||i>t.children.length)&&this.hasTreeNode(n,t.children[i])}getTreeNode(e,t=this.root){if(!e||0===e.length)return t;const[i,...n]=e;if(i<0||i>t.children.length)throw new DQ(this.user,"Invalid tree location");return this.getTreeNode(n,t.children[i])}getTreeNodeWithListIndex(e){if(0===e.length)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:n,visible:o}=this.getParentNodeWithListIndex(e),s=e[e.length-1];if(s<0||s>t.children.length)throw new DQ(this.user,"Invalid tree location");const r=t.children[s];return{node:r,listIndex:i,revealed:n,visible:o&&r.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,n=!0,o=!0){const[s,...r]=e;if(s<0||s>t.children.length)throw new DQ(this.user,"Invalid tree location");for(let e=0;e<s;e++)i+=t.children[e].renderNodeCount;return n=n&&!t.collapsed,o=o&&t.visible,0===r.length?{parentNode:t,listIndex:i,revealed:n,visible:o}:this.getParentNodeWithListIndex(r,t.children[s],i+1,n,o)}getNode(e=[]){return this.getTreeNode(e)}getNodeLocation(e){const t=[];let i=e;for(;i.parent;)t.push(i.parent.children.indexOf(i)),i=i.parent;return t.reverse()}getParentNodeLocation(e){return 0===e.length?void 0:1===e.length?[]:function(e){if(0===e.length)throw new Error("Invalid tail call");return[e.slice(0,e.length-1),e[e.length-1]]}(e)[0]}getFirstElementChild(e){const t=this.getTreeNode(e);if(0!==t.children.length)return t.children[0].element}}var VQ,HQ,zQ,UQ,KQ=i(1963),jQ={};jQ.styleTagTransform=zl(),jQ.setAttributes=Bl(),jQ.insert=Pl().bind(null,"head"),jQ.domAPI=Rl(),jQ.insertStyleElement=Vl(),Ml()(KQ.A,jQ),KQ.A&&KQ.A.locals&&KQ.A.locals;class qQ extends bA{constructor(e){super(e.elements.map((e=>e.element))),this.data=e}}function $Q(e){return e instanceof bA?new qQ(e):e}class GQ{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=At.None,this.disposables=new Mt}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map((e=>e.element)),t)}onDragStart(e,t){this.dnd.onDragStart?.($Q(e),t)}onDragOver(e,t,i,n,o,s=!0){const r=this.dnd.onDragOver($Q(e),t&&t.element,i,n,o),a=this.autoExpandNode!==t;if(a&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),void 0===t)return r;if(a&&"boolean"!=typeof r&&r.autoExpand&&(this.autoExpandDisposable=fi((()=>{const e=this.modelProvider(),i=e.getNodeLocation(t);e.isCollapsed(i)&&e.setCollapsed(i,!1),this.autoExpandNode=void 0}),500,this.disposables)),"boolean"==typeof r||!r.accept||void 0===r.bubble||r.feedback)return s?r:{accept:"boolean"==typeof r?r:r.accept,effect:"boolean"==typeof r?void 0:r.effect,feedback:[i]};if(1===r.bubble){const i=this.modelProvider(),s=i.getNodeLocation(t),r=i.getParentNodeLocation(s),a=i.getNode(r),l=r&&i.getListIndex(r);return this.onDragOver(e,a,l,n,o,!1)}const l=this.modelProvider(),d=l.getNodeLocation(t),h=l.getListIndex(d),c=l.getListRenderCount(d);return{...r,feedback:us(h,h+c)}}drop(e,t,i,n,o){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop($Q(e),t&&t.element,i,n,o)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function ZQ(e,t,i){return i&&{...i,identityProvider:i.identityProvider&&{getId:e=>i.identityProvider.getId(e.element)},dnd:i.dnd&&t.add(new GQ(e,i.dnd)),multipleSelectionController:i.multipleSelectionController&&{isSelectionSingleChangeEvent:e=>i.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element}),isSelectionRangeChangeEvent:e=>i.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})},accessibilityProvider:i.accessibilityProvider&&{...i.accessibilityProvider,getSetSize(t){const i=e(),n=i.getNodeLocation(t),o=i.getParentNodeLocation(n);return i.getNode(o).visibleChildrenCount},getPosInSet:e=>e.visibleChildIndex+1,isChecked:i.accessibilityProvider&&i.accessibilityProvider.isChecked?e=>i.accessibilityProvider.isChecked(e.element):void 0,getRole:i.accessibilityProvider&&i.accessibilityProvider.getRole?e=>i.accessibilityProvider.getRole(e.element):()=>"treeitem",getAriaLabel:e=>i.accessibilityProvider.getAriaLabel(e.element),getWidgetAriaLabel:()=>i.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:i.accessibilityProvider&&i.accessibilityProvider.getWidgetRole?()=>i.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:i.accessibilityProvider&&i.accessibilityProvider.getAriaLevel?e=>i.accessibilityProvider.getAriaLevel(e.element):e=>e.depth,getActiveDescendantId:i.accessibilityProvider.getActiveDescendantId&&(e=>i.accessibilityProvider.getActiveDescendantId(e.element))},keyboardNavigationLabelProvider:i.keyboardNavigationLabelProvider&&{...i.keyboardNavigationLabelProvider,getKeyboardNavigationLabel:e=>i.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}}}class YQ{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){this.delegate.setDynamicHeight?.(e.element,t)}}!function(e){e.None="none",e.OnHover="onHover",e.Always="always"}(VQ||(VQ={}));class QQ{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new Mt,this.onDidChange=zt.forEach(e,(e=>this._elements=e),this.disposables)}dispose(){this.disposables.dispose()}}class XQ{static{this.DefaultIndent=8}constructor(e,t,i,n,o,s={}){this.renderer=e,this.model=t,this.activeNodes=n,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=XQ.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=At.None,this.disposables=new Mt,this.templateId=e.templateId,this.updateOptions(s),zt.map(i,(e=>e.node))(this.onDidChangeNodeTwistieState,this,this.disposables),e.onDidChangeTwistieState?.(this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(void 0!==e.indent){const t=FM(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[e,t]of this.renderedNodes)t.indentSize=XQ.DefaultIndent+(e.depth-1)*this.indent,this.renderTreeElement(e,t)}}if(void 0!==e.renderIndentGuides){const t=e.renderIndentGuides!==VQ.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[e,t]of this.renderedNodes)this._renderIndentGuides(e,t);if(this.indentGuidesDisposable.dispose(),t){const e=new Mt;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,e),this.indentGuidesDisposable=e,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}void 0!==e.hideTwistiesOfChildlessElements&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=il(e,ll(".monaco-tl-row")),i=il(t,ll(".monaco-tl-indent")),n=il(t,ll(".monaco-tl-twistie")),o=il(t,ll(".monaco-tl-contents")),s=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:n,indentGuidesDisposable:At.None,indentSize:0,templateData:s}}renderElement(e,t,i,n){i.indentSize=XQ.DefaultIndent+(e.depth-1)*this.indent,this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,{...n,indent:i.indentSize})}disposeElement(e,t,i,n){i.indentGuidesDisposable.dispose(),this.renderer.disposeElement?.(e,t,i.templateData,{...n,indent:i.indentSize}),"number"==typeof n?.height&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){t.twistie.style.paddingLeft=`${t.indentSize}px`,t.indent.style.width=t.indentSize+this.indent-16+"px",e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...vh.asClassNameArray(fh.treeItemExpanded));let i=!1;this.renderer.renderTwistie&&(i=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(i||t.twistie.classList.add(...vh.asClassNameArray(fh.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(ca(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new Mt;for(;;){const n=this.model.getNodeLocation(e),o=this.model.getParentNodeLocation(n);if(!o)break;const s=this.model.getNode(o),r=ll(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(s)&&r.classList.add("active"),0===t.indent.childElementCount?t.indent.appendChild(r):t.indent.insertBefore(r,t.indent.firstElementChild),this.renderedIndentGuides.add(s,r),i.add(Tt((()=>this.renderedIndentGuides.delete(s,r)))),e=s}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set;e.forEach((e=>{const i=this.model.getNodeLocation(e);try{const n=this.model.getParentNodeLocation(i);e.collapsible&&e.children.length>0&&!e.collapsed?t.add(e):n&&t.add(this.model.getNode(n))}catch{}})),this.activeIndentNodes.forEach((e=>{t.has(e)||this.renderedIndentGuides.forEach(e,(e=>e.classList.remove("active")))})),t.forEach((e=>{this.activeIndentNodes.has(e)||this.renderedIndentGuides.forEach(e,(e=>e.classList.add("active")))})),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),Et(this.disposables)}}function JQ(e,t){const i=t.toLowerCase().indexOf(e);let n;if(i>-1){n=[Number.MAX_SAFE_INTEGER,0];for(let t=e.length;t>0;t--)n.push(i+t-1)}return n}class eX{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}set findMatchType(e){this._findMatchType=e}get findMatchType(){return this._findMatchType}set findMode(e){this._findMode=e}get findMode(){return this._findMode}constructor(e,t,i){this._keyboardNavigationLabelProvider=e,this._filter=t,this._defaultFindVisibility=i,this._totalCount=0,this._matchCount=0,this._findMatchType=zQ.Fuzzy,this._findMode=HQ.Highlight,this._pattern="",this._lowercasePattern="",this.disposables=new Mt}filter(e,t){let i=1;if(this._filter){const n=this._filter.filter(e,t);if(i="boolean"==typeof n?n?1:0:PQ(n)?FQ(n.visibility):n,0===i)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:ah.Default,visibility:i};const n=this._keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(n)?n:[n];for(const e of o){const t=e&&e.toString();if(void 0===t)return{data:ah.Default,visibility:i};let n;if(n=this._findMatchType===zQ.Contiguous?JQ(this._lowercasePattern,t.toLowerCase()):dh(this._pattern,this._lowercasePattern,0,t,t.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0}),n)return this._matchCount++,1===o.length?{data:n,visibility:i}:{data:{label:t,score:n},visibility:i}}return this._findMode===HQ.Filter?"number"==typeof this._defaultFindVisibility?this._defaultFindVisibility:this._defaultFindVisibility?this._defaultFindVisibility(e):2:{data:ah.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){Et(this.disposables)}}class tX{constructor(e){this.stateMap=new Map(e.map((e=>[e.id,{...e}])))}get(e){const t=this.stateMap.get(e);if(void 0===t)throw new Error(`No state found for toggle id ${e}`);return t.isChecked}set(e,t){const i=this.stateMap.get(e);if(void 0===i)throw new Error(`No state found for toggle id ${e}`);return i.isChecked!==t&&(i.isChecked=t,!0)}}!function(e){e[e.Highlight=0]="Highlight",e[e.Filter=1]="Filter"}(HQ||(HQ={})),function(e){e[e.Fuzzy=0]="Fuzzy",e[e.Contiguous=1]="Contiguous"}(zQ||(zQ={})),function(e){e.Mode="mode",e.MatchType="matchType"}(UQ||(UQ={}));class iX{get pattern(){return this._pattern}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.widget?.setPlaceHolder(e)}constructor(e,t,i,n={}){this.tree=e,this.filter=t,this.contextViewProvider=i,this.options=n,this._pattern="",this._onDidChangePattern=new Zt,this._onDidChangeOpenState=new Zt,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new Mt,this.disposables=new Mt,this.toggles=new tX(n.toggles??[]),this._placeholder=n.placeholder??y(20,"Type to search")}isOpened(){return!!this.widget}updateToggleState(e,t){this.toggles.set(e,t),this.widget?.setToggleState(e,t)}renderMessage(e,t){e?this.tree.options.showNotFoundMessage??1?this.widget?.showMessage({type:2,content:t??y(21,"No results found.")}):this.widget?.showMessage({type:2}):this.widget?.clearMessage()}alertResults(e){Yl(e?y(23,"{0} results",e):y(22,"No results"))}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class nX extends iX{get mode(){return this.toggles.get(UQ.Mode)?HQ.Filter:HQ.Highlight}set mode(e){if(e===this.mode)return;const t=e===HQ.Filter;this.updateToggleState(UQ.Mode,t),this.placeholder=t?y(24,"Type to filter"):y(25,"Type to search"),this.filter.findMode=e,this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e)}get matchType(){return this.toggles.get(UQ.MatchType)?zQ.Fuzzy:zQ.Contiguous}set matchType(e){e!==this.matchType&&(this.updateToggleState(UQ.MatchType,e===zQ.Fuzzy),this.filter.findMatchType=e,this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,n={}){const o=n.defaultFindMode??HQ.Highlight,s=n.defaultFindMatchType??zQ.Fuzzy,r=[{id:UQ.Mode,icon:fh.listFilter,title:y(26,"Filter"),isChecked:o===HQ.Filter},{id:UQ.MatchType,icon:fh.searchFuzzy,title:y(27,"Fuzzy Match"),isChecked:s===zQ.Fuzzy}];t.findMatchType=s,t.findMode=o,super(e,t,i,{...n,toggles:r}),this.filter=t,this._onDidChangeMode=new Zt,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new Zt,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this.disposables.add(this.tree.onDidChangeModel((()=>{this.isOpened()&&(0!==this.pattern.length&&this.tree.refilter(),this.render())}))),this.disposables.add(this.tree.onWillRefilter((()=>this.filter.reset())))}updateOptions(e={}){void 0!==e.defaultFindMode&&(this.mode=e.defaultFindMode),void 0!==e.defaultFindMatchType&&(this.matchType=e.defaultFindMatchType)}shouldAllowFocus(e){return!this.isOpened()||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1||!ah.isDefault(e.filterData)}render(){const e=0===this.filter.matchCount&&this.filter.totalCount>0&&this.pattern.length>0;this.renderMessage(e),this.pattern.length&&this.alertResults(this.filter.matchCount)}}function oX(e,t){return e.position===t.position&&sX(e,t)}function sX(e,t){return e.node.element===t.node.element&&e.startIndex===t.startIndex&&e.height===t.height&&e.endIndex===t.endIndex}class rX{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return es(this.stickyNodes,e.stickyNodes,oX)}contains(e){return this.stickyNodes.some((t=>t.node.element===e.element))}lastNodePartiallyVisible(){if(0===this.count)return!1;const e=this.stickyNodes[this.count-1];if(1===this.count)return 0!==e.position;const t=this.stickyNodes[this.count-2];return t.position+t.height!==e.position}animationStateChanged(e){if(!es(this.stickyNodes,e.stickyNodes,sX))return!1;if(0===this.count)return!1;const t=this.stickyNodes[this.count-1],i=e.stickyNodes[e.count-1];return t.position!==i.position}}class aX{constrainStickyScrollNodes(e,t,i){for(let n=0;n<e.length;n++){const o=e[n];if(o.position+o.height>i||n>=t)return e.slice(0,n)}return e}}class lX extends At{constructor(e,t,i,n,o,s={}){super(),this.tree=e,this.model=t,this.view=i,this.treeDelegate=o,this.maxWidgetViewRatio=.4;const r=this.validateStickySettings(s);this.stickyScrollMaxItemCount=r.stickyScrollMaxItemCount,this.stickyScrollDelegate=s.stickyScrollDelegate??new aX,this.paddingTop=s.paddingTop??0,this._widget=this._register(new dX(i.getScrollableElement(),i,e,n,o,s.accessibilityProvider)),this.onDidChangeHasFocus=this._widget.onDidChangeHasFocus,this.onContextMenu=this._widget.onContextMenu,this._register(i.onDidScroll((()=>this.update()))),this._register(i.onDidChangeContentHeight((()=>this.update()))),this._register(e.onDidChangeCollapseState((()=>this.update()))),this._register(t.onDidSpliceRenderedNodes((e=>{const t=this._widget.state;t&&(e.deleteCount>0&&t.stickyNodes.some((e=>!this.model.has(this.model.getNodeLocation(e.node))))?this.update():t.stickyNodes.some((i=>{const n=this.model.getListIndex(this.model.getNodeLocation(i.node));return n>=e.start&&n<e.start+e.deleteCount&&t.contains(i.node)}))&&this._widget.rerender())}))),this.update()}get height(){return this._widget.height}getNodeAtHeight(e){let t;if(t=0===e?this.view.firstVisibleIndex:this.view.indexAt(e+this.view.scrollTop),!(t<0||t>=this.view.length))return this.view.element(t)}update(){const e=this.getNodeAtHeight(this.paddingTop);if(!e||this.tree.scrollTop<=this.paddingTop)return void this._widget.setState(void 0);const t=this.findStickyState(e);this._widget.setState(t)}findStickyState(e){const t=[];let i=e,n=0,o=this.getNextStickyNode(i,void 0,n);for(;o&&(t.push(o),n+=o.height,!(t.length<=this.stickyScrollMaxItemCount)||(i=this.getNextVisibleNode(o),i));)o=this.getNextStickyNode(i,o.node,n);const s=this.constrainStickyNodes(t);return s.length?new rX(s):void 0}getNextVisibleNode(e){return this.getNodeAtHeight(e.position+e.height)}getNextStickyNode(e,t,i){const n=this.getAncestorUnderPrevious(e,t);if(n){if(n===e){if(!this.nodeIsUncollapsedParent(e))return;if(this.nodeTopAlignsWithStickyNodesBottom(e,i))return}return this.createStickyScrollNode(n,i)}}nodeTopAlignsWithStickyNodesBottom(e,t){const i=this.getNodeIndex(e),n=this.view.getElementTop(i),o=t;return this.view.scrollTop===n-o}createStickyScrollNode(e,t){const i=this.treeDelegate.getHeight(e),{startIndex:n,endIndex:o}=this.getNodeRange(e);return{node:e,position:this.calculateStickyNodePosition(o,t,i),height:i,startIndex:n,endIndex:o}}getAncestorUnderPrevious(e,t=void 0){let i=e,n=this.getParentNode(i);for(;n;){if(n===t)return i;i=n,n=this.getParentNode(i)}if(void 0===t)return i}calculateStickyNodePosition(e,t,i){let n=this.view.getRelativeTop(e);if(null===n&&this.view.firstVisibleIndex===e&&e+1<this.view.length){const t=this.treeDelegate.getHeight(this.view.element(e)),i=this.view.getRelativeTop(e+1);n=i?i-t/this.view.renderHeight:null}if(null===n)return t;const o=this.view.element(e),s=this.treeDelegate.getHeight(o),r=n*this.view.renderHeight+s;return t+i>r&&t<=r?r-i:t}constrainStickyNodes(e){if(0===e.length)return[];const t=this.view.renderHeight*this.maxWidgetViewRatio,i=e[e.length-1];if(e.length<=this.stickyScrollMaxItemCount&&i.position+i.height<=t)return e;const n=this.stickyScrollDelegate.constrainStickyScrollNodes(e,this.stickyScrollMaxItemCount,t);if(!n.length)return[];const o=n[n.length-1];if(n.length>this.stickyScrollMaxItemCount||o.position+o.height>t)throw new Error("stickyScrollDelegate violates constraints");return n}getParentNode(e){const t=this.model.getNodeLocation(e),i=this.model.getParentNodeLocation(t);return i?this.model.getNode(i):void 0}nodeIsUncollapsedParent(e){const t=this.model.getNodeLocation(e);return this.model.getListRenderCount(t)>1}getNodeIndex(e){const t=this.model.getNodeLocation(e);return this.model.getListIndex(t)}getNodeRange(e){const t=this.model.getNodeLocation(e),i=this.model.getListIndex(t);if(i<0)throw new Error("Node not found in tree");return{startIndex:i,endIndex:i+this.model.getListRenderCount(t)-1}}nodePositionTopBelowWidget(e){const t=[];let i=this.getParentNode(e);for(;i;)t.push(i),i=this.getParentNode(i);let n=0;for(let e=0;e<t.length&&e<this.stickyScrollMaxItemCount;e++)n+=this.treeDelegate.getHeight(t[e]);return n}domFocus(){this._widget.domFocus()}focusedLast(){return this._widget.focusedLast()}updateOptions(e={}){if(void 0!==e.paddingTop&&(this.paddingTop=e.paddingTop),void 0!==e.stickyScrollMaxItemCount){const t=this.validateStickySettings(e);this.stickyScrollMaxItemCount!==t.stickyScrollMaxItemCount&&(this.stickyScrollMaxItemCount=t.stickyScrollMaxItemCount,this.update())}}validateStickySettings(e){let t=7;return"number"==typeof e.stickyScrollMaxItemCount&&(t=Math.max(e.stickyScrollMaxItemCount,1)),{stickyScrollMaxItemCount:t}}}class dX{get state(){return this._previousState}constructor(e,t,i,n,o,s){this.view=t,this.tree=i,this.treeRenderers=n,this.treeDelegate=o,this.accessibilityProvider=s,this._previousElements=[],this._previousStateDisposables=new Mt,this._rootDomNode=ll(".monaco-tree-sticky-container.empty"),e.appendChild(this._rootDomNode);const r=ll(".monaco-tree-sticky-container-shadow");this._rootDomNode.appendChild(r),this.stickyScrollFocus=new hX(this._rootDomNode,t),this.onDidChangeHasFocus=this.stickyScrollFocus.onDidChangeHasFocus,this.onContextMenu=this.stickyScrollFocus.onContextMenu}get height(){if(!this._previousState)return 0;const e=this._previousState.stickyNodes[this._previousState.count-1];return e.position+e.height}setState(e){const t=!!this._previousState&&this._previousState.count>0,i=!!e&&e.count>0;if(!t&&!i||t&&i&&this._previousState.equal(e))return;if(t!==i&&this.setVisible(i),!i)return this._previousState=void 0,this._previousElements=[],void this._previousStateDisposables.clear();const n=e.stickyNodes[e.count-1];this._previousState&&e.animationStateChanged(this._previousState)?this._previousElements[this._previousState.count-1].style.top=`${n.position}px`:this.renderState(e),this._previousState=e,this._rootDomNode.style.height=`${n.position+n.height}px`}renderState(e){this._previousStateDisposables.clear();const t=Array(e.count);for(let i=e.count-1;i>=0;i--){const n=e.stickyNodes[i],{element:o,disposable:s}=this.createElement(n,i,e.count);t[i]=o,this._rootDomNode.appendChild(o),this._previousStateDisposables.add(s)}this.stickyScrollFocus.updateElements(t,e),this._previousElements=t}rerender(){this._previousState&&this.renderState(this._previousState)}createElement(e,t,i){const n=e.startIndex,o=document.createElement("div");o.style.top=`${e.position}px`,!1!==this.tree.options.setRowHeight&&(o.style.height=`${e.height}px`),!1!==this.tree.options.setRowLineHeight&&(o.style.lineHeight=`${e.height}px`),o.classList.add("monaco-tree-sticky-row"),o.classList.add("monaco-list-row"),o.setAttribute("data-index",`${n}`),o.setAttribute("data-parity",n%2==0?"even":"odd"),o.setAttribute("id",this.view.getElementID(n));const s=this.setAccessibilityAttributes(o,e.node.element,t,i),r=this.treeDelegate.getTemplateId(e.node),a=this.treeRenderers.find((e=>e.templateId===r));if(!a)throw new Error(`No renderer found for template id ${r}`);let l=e.node;l===this.tree.getNode(this.tree.getNodeLocation(e.node))&&(l=new Proxy(e.node,{}));const d=a.renderTemplate(o);a.renderElement(l,e.startIndex,d,{height:e.height});const h=Tt((()=>{s.dispose(),a.disposeElement(l,e.startIndex,d,{height:e.height}),a.disposeTemplate(d),o.remove()}));return{element:o,disposable:h}}setAccessibilityAttributes(e,t,i,n){if(!this.accessibilityProvider)return At.None;this.accessibilityProvider.getSetSize&&e.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(t,i,n))),this.accessibilityProvider.getPosInSet&&e.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(t,i))),this.accessibilityProvider.getRole&&e.setAttribute("role",this.accessibilityProvider.getRole(t)??"treeitem");const o=this.accessibilityProvider.getAriaLabel(t),s=o&&"string"!=typeof o?o:Or(o),r=ar((t=>{const i=t.readObservable(s);i?e.setAttribute("aria-label",i):e.removeAttribute("aria-label")}));"string"==typeof o||o&&e.setAttribute("aria-label",o.get());const a=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(t);return"number"==typeof a&&e.setAttribute("aria-level",`${a}`),e.setAttribute("aria-selected",String(!1)),r}setVisible(e){this._rootDomNode.classList.toggle("empty",!e),e||this.stickyScrollFocus.updateElements([],void 0)}domFocus(){this.stickyScrollFocus.domFocus()}focusedLast(){return this.stickyScrollFocus.focusedLast()}dispose(){this.stickyScrollFocus.dispose(),this._previousStateDisposables.dispose(),this._rootDomNode.remove()}}class hX extends At{get domHasFocus(){return this._domHasFocus}set domHasFocus(e){e!==this._domHasFocus&&(this._onDidChangeHasFocus.fire(e),this._domHasFocus=e)}constructor(e,t){super(),this.container=e,this.view=t,this.focusedIndex=-1,this.elements=[],this._onDidChangeHasFocus=new Zt,this.onDidChangeHasFocus=this._onDidChangeHasFocus.event,this._onContextMenu=new Zt,this.onContextMenu=this._onContextMenu.event,this._domHasFocus=!1,this._register(ga(this.container,"focus",(()=>this.onFocus()))),this._register(ga(this.container,"blur",(()=>this.onBlur()))),this._register(this.view.onDidFocus((()=>this.toggleStickyScrollFocused(!1)))),this._register(this.view.onKeyDown((e=>this.onKeyDown(e)))),this._register(this.view.onMouseDown((e=>this.onMouseDown(e)))),this._register(this.view.onContextMenu((e=>this.handleContextMenu(e))))}handleContextMenu(e){const t=e.browserEvent.target;if(!RA(t)&&!AA(t))return void(this.focusedLast()&&this.view.domFocus());if(!Ya(e.browserEvent)){if(!this.state)throw new Error("Context menu should not be triggered when state is undefined");const t=this.state.stickyNodes.findIndex((t=>t.node.element===e.element?.element));if(-1===t)throw new Error("Context menu should not be triggered when element is not in sticky scroll widget");return this.container.focus(),void this.setFocus(t)}if(!this.state||this.focusedIndex<0)throw new Error("Context menu key should not be triggered when focus is not in sticky scroll widget");const i=this.state.stickyNodes[this.focusedIndex].node.element,n=this.elements[this.focusedIndex];this._onContextMenu.fire({element:i,anchor:n,browserEvent:e.browserEvent,isStickyScroll:!0})}onKeyDown(e){if(this.domHasFocus&&this.state)if("ArrowUp"===e.key)this.setFocusedElement(Math.max(0,this.focusedIndex-1)),e.preventDefault(),e.stopPropagation();else if("ArrowDown"===e.key||"ArrowRight"===e.key){if(this.focusedIndex>=this.state.count-1){const e=this.state.stickyNodes[this.state.count-1].startIndex+1;this.view.domFocus(),this.view.setFocus([e]),this.scrollNodeUnderWidget(e,this.state)}else this.setFocusedElement(this.focusedIndex+1);e.preventDefault(),e.stopPropagation()}}onMouseDown(e){const t=e.browserEvent.target;(RA(t)||AA(t))&&(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation())}updateElements(e,t){if(t&&0===t.count)throw new Error("Sticky scroll state must be undefined when there are no sticky nodes");if(t&&t.count!==e.length)throw new Error("Sticky scroll focus received illigel state");const i=this.focusedIndex;if(this.removeFocus(),this.elements=e,this.state=t,t){const e=FM(i,0,t.count-1);this.setFocus(e)}else this.domHasFocus&&this.view.domFocus();this.container.tabIndex=t?0:-1}setFocusedElement(e){const t=this.state;if(!t)throw new Error("Cannot set focus when state is undefined");if(this.setFocus(e),!(e<t.count-1)&&t.lastNodePartiallyVisible()){const i=t.stickyNodes[e];this.scrollNodeUnderWidget(i.endIndex+1,t)}}scrollNodeUnderWidget(e,t){const i=t.stickyNodes[t.count-1],n=t.count>1?t.stickyNodes[t.count-2]:void 0,o=this.view.getElementTop(e),s=n?n.position+n.height+i.height:i.height;this.view.scrollTop=o-s}domFocus(){if(!this.state)throw new Error("Cannot focus when state is undefined");this.container.focus()}focusedLast(){return!!this.state&&this.view.getHTMLElement().classList.contains("sticky-scroll-focused")}removeFocus(){-1!==this.focusedIndex&&(this.toggleElementFocus(this.elements[this.focusedIndex],!1),this.focusedIndex=-1)}setFocus(e){if(0>e)throw new Error("addFocus() can not remove focus");if(!this.state&&e>=0)throw new Error("Cannot set focus index when state is undefined");if(this.state&&e>=this.state.count)throw new Error("Cannot set focus index to an index that does not exist");const t=this.focusedIndex;t>=0&&this.toggleElementFocus(this.elements[t],!1),e>=0&&this.toggleElementFocus(this.elements[e],!0),this.focusedIndex=e}toggleElementFocus(e,t){this.toggleElementActiveFocus(e,t&&this.domHasFocus),this.toggleElementPassiveFocus(e,t)}toggleCurrentElementActiveFocus(e){-1!==this.focusedIndex&&this.toggleElementActiveFocus(this.elements[this.focusedIndex],e)}toggleElementActiveFocus(e,t){e.classList.toggle("focused",t)}toggleElementPassiveFocus(e,t){e.classList.toggle("passive-focused",t)}toggleStickyScrollFocused(e){this.view.getHTMLElement().classList.toggle("sticky-scroll-focused",e)}onFocus(){if(!this.state||0===this.elements.length)throw new Error("Cannot focus when state is undefined or elements are empty");this.domHasFocus=!0,this.toggleStickyScrollFocused(!0),this.toggleCurrentElementActiveFocus(!0),-1===this.focusedIndex&&this.setFocus(0)}onBlur(){this.domHasFocus=!1,this.toggleCurrentElementActiveFocus(!1)}dispose(){this.toggleStickyScrollFocused(!1),this._onDidChangeHasFocus.fire(!1),super.dispose()}}function cX(e){let t=LQ.Unknown;return Pa(e.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?t=LQ.Twistie:Pa(e.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?t=LQ.Element:Pa(e.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(t=LQ.Filter),{browserEvent:e.browserEvent,element:e.element?e.element.element:null,target:t}}function uX(e){const t=RA(e.browserEvent.target);return{element:e.element?e.element.element:null,browserEvent:e.browserEvent,anchor:e.anchor,isStickyScroll:t}}function gX(e,t){t(e),e.children.forEach((e=>gX(e,t)))}class pX{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new Zt,this.onDidChange=this._onDidChange.event}set(e,t){!t?.__forceEvent&&es(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const e=this;this._onDidChange.fire({get elements(){return e.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map((e=>e.element))),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const e=this.createNodeSet(),i=t=>e.delete(t);return t.forEach((e=>gX(e,i))),void this.set([...e.values()])}const i=new Set,n=e=>i.add(this.identityProvider.getId(e.element).toString());t.forEach((e=>gX(e,n)));const o=new Map,s=e=>o.set(this.identityProvider.getId(e.element).toString(),e);e.forEach((e=>gX(e,s)));const r=[];for(const e of this.nodes){const t=this.identityProvider.getId(e.element).toString();if(i.has(t)){const e=o.get(t);e&&e.visible&&r.push(e)}else r.push(e)}if(this.nodes.length>0&&0===r.length){const e=this.getFirstViewElementWithTrait();e&&r.push(e)}this._set(r,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class mX extends UA{constructor(e,t,i){super(e),this.tree=t,this.stickyScrollProvider=i}onViewPointer(e){if(OA(e.browserEvent.target)||vl(e.browserEvent.target)||MA(e.browserEvent.target))return;if(e.browserEvent.isHandledByList)return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,n=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16,o=AA(e.browserEvent.target);let s=!1;if(s=!!o||("function"==typeof this.tree.expandOnlyOnTwistieClick?this.tree.expandOnlyOnTwistieClick(t.element):!!this.tree.expandOnlyOnTwistieClick),o)this.handleStickyScrollMouseEvent(e,t);else{if(s&&!n&&2!==e.browserEvent.detail)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&2===e.browserEvent.detail)return super.onViewPointer(e)}if(t.collapsible&&(!o||n)){const i=this.tree.getNodeLocation(t),o=e.browserEvent.altKey;if(this.tree.setFocus([i]),this.tree.toggleCollapsed(i,o),n)return void(e.browserEvent.isHandledByList=!0)}o||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(function(e){return TA(e,"monaco-custom-toggle")}(e.browserEvent.target)||function(e){return TA(e,"action-item")}(e.browserEvent.target))return;const i=this.stickyScrollProvider();if(!i)throw new Error("Sticky scroll controller not found");const n=this.list.indexOf(t),o=this.list.getElementTop(n),s=i.nodePositionTopBelowWidget(t);this.tree.scrollTop=o-s,this.list.domFocus(),this.list.setFocus([n]),this.list.setSelection([n])}onDoubleClick(e){!e.browserEvent.target.classList.contains("monaco-tl-twistie")&&this.tree.expandOnDoubleClick&&(e.browserEvent.isHandledByList||super.onDoubleClick(e))}onMouseDown(e){const t=e.browserEvent.target;RA(t)||AA(t)||super.onMouseDown(e)}onContextMenu(e){const t=e.browserEvent.target;RA(t)||AA(t)||super.onContextMenu(e)}}class fX extends XA{constructor(e,t,i,n,o,s,r,a){super(e,t,i,n,a),this.focusTrait=o,this.selectionTrait=s,this.anchorTrait=r}createMouseController(e){return new mX(this,e.tree,e.stickyScrollProvider)}splice(e,t,i=[]){if(super.splice(e,t,i),0===i.length)return;const n=[],o=[];let s;i.forEach(((t,i)=>{this.focusTrait.has(t)&&n.push(e+i),this.selectionTrait.has(t)&&o.push(e+i),this.anchorTrait.has(t)&&(s=e+i)})),n.length>0&&super.setFocus(cs([...super.getFocus(),...n])),o.length>0&&super.setSelection(cs([...super.getSelection(),...o])),"number"==typeof s&&super.setAnchor(s)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map((e=>this.element(e))),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map((e=>this.element(e))),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(void 0===e?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class _X{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return zt.filter(zt.map(this.view.onMouseDblClick,cX),(e=>e.target!==LQ.Filter))}get onMouseOver(){return zt.map(this.view.onMouseOver,cX)}get onMouseOut(){return zt.map(this.view.onMouseOut,cX)}get onContextMenu(){return zt.any(zt.filter(zt.map(this.view.onContextMenu,uX),(e=>!e.isStickyScroll)),this.stickyScrollController?.onContextMenu??zt.None)}get onPointer(){return zt.map(this.view.onPointer,cX)}get onKeyDown(){return this.view.onKeyDown}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return zt.any(this.onDidChangeModelRelay.event,this.onDidSwapModel.event)}get onDidChangeCollapseState(){return this.onDidChangeCollapseStateRelay.event}get expandOnDoubleClick(){return void 0===this._options.expandOnDoubleClick||this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return void 0===this._options.expandOnlyOnTwistieClick||this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,n,o={}){this._user=e,this._options=o,this.eventBufferer=new ti,this.onDidChangeFindOpenState=zt.None,this.onDidChangeStickyScrollFocused=zt.None,this.disposables=new Mt,this.onDidSwapModel=this.disposables.add(new Zt),this.onDidChangeModelRelay=this.disposables.add(new ii),this.onDidSpliceModelRelay=this.disposables.add(new ii),this.onDidChangeCollapseStateRelay=this.disposables.add(new ii),this.onDidChangeRenderNodeCountRelay=this.disposables.add(new ii),this.onDidChangeActiveNodesRelay=this.disposables.add(new ii),this._onWillRefilter=new Zt,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new Zt,this.modelDisposables=new Mt,o.keyboardNavigationLabelProvider&&(o.findWidgetEnabled??1)&&(this.findFilter=new eX(o.keyboardNavigationLabelProvider,o.filter,o.defaultFindVisibility),o={...o,filter:this.findFilter},this.disposables.add(this.findFilter)),this.model=this.createModel(e,o),this.treeDelegate=new YQ(i);const s=this.disposables.add(new QQ(this.onDidChangeActiveNodesRelay.event)),r=new dd;this.renderers=n.map((e=>new XQ(e,this.model,this.onDidChangeCollapseStateRelay.event,s,r,o)));for(const e of this.renderers)this.disposables.add(e);if(this.focus=new pX((()=>this.view.getFocusedElements()[0]),o.identityProvider),this.selection=new pX((()=>this.view.getSelectedElements()[0]),o.identityProvider),this.anchor=new pX((()=>this.view.getAnchorElement()),o.identityProvider),this.view=new fX(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...ZQ((()=>this.model),this.disposables,o),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.setupModel(this.model),!1!==o.keyboardSupport){const e=zt.chain(this.view.onKeyDown,(e=>e.filter((e=>!vl(e.target))).map((e=>new Ze(e)))));zt.chain(e,(e=>e.filter((e=>15===e.keyCode))))(this.onLeftArrow,this,this.disposables),zt.chain(e,(e=>e.filter((e=>17===e.keyCode))))(this.onRightArrow,this,this.disposables),zt.chain(e,(e=>e.filter((e=>10===e.keyCode))))(this.onSpace,this,this.disposables)}if((o.findWidgetEnabled??1)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const e={styles:o.findWidgetStyles,defaultFindMode:o.defaultFindMode,defaultFindMatchType:o.defaultFindMatchType,showNotFoundMessage:o.showNotFoundMessage};this.findController=this.disposables.add(new nX(this,this.findFilter,o.contextViewProvider,e)),this.focusNavigationFilter=e=>this.findController.shouldAllowFocus(e),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=zt.None,this.onDidChangeFindMatchType=zt.None;o.enableStickyScroll&&(this.stickyScrollController=new lX(this,this.model,this.view,this.renderers,this.treeDelegate,o),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=DM(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===VQ.Always)}updateOptions(e={}){this._options={...this._options,...e};for(const t of this.renderers)t.updateOptions(e);this.view.updateOptions(this._options),this.findController?.updateOptions(e),this.updateStickyScroll(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===VQ.Always)}get options(){return this._options}updateStickyScroll(e){!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new lX(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=zt.None,this.stickyScrollController.dispose(),this.stickyScrollController=void 0),this.stickyScrollController?.updateOptions(e)}getHTMLElement(){return this.view.getHTMLElement()}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get ariaLabel(){return this.view.ariaLabel}set ariaLabel(e){this.view.ariaLabel=e}domFocus(){this.stickyScrollController?.focusedLast()?this.stickyScrollController.domFocus():this.view.domFocus()}layout(e,t){this.view.layout(e,t)}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { opacity: 1; border-color: ${e.treeInactiveIndentGuidesStroke}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { opacity: 1; border-color: ${e.treeIndentGuidesStroke}; }`));const n=e.treeStickyScrollBackground??e.listBackground;n&&(i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${n}; }`),i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${n}; }`)),e.treeStickyScrollBorder&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { border-bottom: 1px solid ${e.treeStickyScrollBorder}; }`),e.treeStickyScrollShadow&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow { box-shadow: ${e.treeStickyScrollShadow} 0 6px 6px -6px inset; height: 3px; }`),e.listFocusForeground&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));const o=vM(e.listFocusAndSelectionOutline,vM(e.listSelectionOutline,e.listFocusOutline??""));o&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${o}; outline-offset: -1px;}`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)),e.listFocusOutline&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`),i.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.passive-focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`),i.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)),this.styleElement.textContent=i.join("\n"),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){this.eventBufferer.bufferEvents((()=>{const i=e.map((e=>this.model.getNode(e)));this.selection.set(i,t);const n=e.map((e=>this.model.getListIndex(e))).filter((e=>e>-1));this.view.setSelection(n,t,!0)}))}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents((()=>{const i=e.map((e=>this.model.getNode(e)));this.focus.set(i,t);const n=e.map((e=>this.model.getListIndex(e))).filter((e=>e>-1));this.view.setFocus(n,t,!0)}))}focusNext(e=1,t=!1,i,n=(Ya(i)&&i.altKey?void 0:this.focusNavigationFilter)){this.view.focusNext(e,t,i,n)}focusPrevious(e=1,t=!1,i,n=(Ya(i)&&i.altKey?void 0:this.focusNavigationFilter)){this.view.focusPrevious(e,t,i,n)}focusNextPage(e,t=(Ya(e)&&e.altKey?void 0:this.focusNavigationFilter)){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=(Ya(e)&&e.altKey?void 0:this.focusNavigationFilter)){return this.view.focusPreviousPage(e,t,(()=>this.stickyScrollController?.height??0))}focusLast(e,t=(Ya(e)&&e.altKey?void 0:this.focusNavigationFilter)){this.view.focusLast(e,t)}focusFirst(e,t=(Ya(e)&&e.altKey?void 0:this.focusNavigationFilter)){this.view.focusFirst(e,t)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);if(-1!==i)if(this.stickyScrollController){const n=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(i,t,n)}else this.view.reveal(i,t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const e=this.model.getParentNodeLocation(n);if(!e)return;const t=this.model.getListIndex(e);this.view.reveal(t),this.view.setFocus([t])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some((e=>e.visible)))return;const[e]=this.view.getFocus(),t=e+1;this.view.reveal(t),this.view.setFocus([t])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,o)}setupModel(e){this.modelDisposables.clear(),this.modelDisposables.add(e.onDidSpliceRenderedNodes((({start:e,deleteCount:t,elements:i})=>this.view.splice(e,t,i))));const t=zt.forEach(e.onDidSpliceModel,(e=>{this.eventBufferer.bufferEvents((()=>{this.focus.onDidModelSplice(e),this.selection.onDidModelSplice(e)}))}),this.modelDisposables);t((()=>null),null,this.modelDisposables);const i=this.modelDisposables.add(new Zt),n=this.modelDisposables.add(new gi(0));this.modelDisposables.add(zt.any(t,this.focus.onDidChange,this.selection.onDidChange)((()=>{n.trigger((()=>{const e=new Set;for(const t of this.focus.getNodes())e.add(t);for(const t of this.selection.getNodes())e.add(t);i.fire([...e.values()])}))}))),this.onDidChangeActiveNodesRelay.input=i.event,this.onDidChangeModelRelay.input=zt.signal(e.onDidSpliceModel),this.onDidChangeCollapseStateRelay.input=e.onDidChangeCollapseState,this.onDidChangeRenderNodeCountRelay.input=e.onDidChangeRenderNodeCount,this.onDidSpliceModelRelay.input=e.onDidSpliceModel}dispose(){Et(this.disposables),this.stickyScrollController?.dispose(),this.view.dispose(),this.modelDisposables.dispose()}}class vX{constructor(e,t={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new WQ(e,null,t),this.onDidSpliceModel=this.model.onDidSpliceModel,this.onDidSpliceRenderedNodes=this.model.onDidSpliceRenderedNodes,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,t.sorter&&(this.sorter={compare:(e,i)=>t.sorter.compare(e.element,i.element)}),this.identityProvider=t.identityProvider}setChildren(e,t=Ct.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=Ct.empty(),i){const n=new Set,o=new Set;this.model.splice([...e,0],Number.MAX_VALUE,t,{...i,onDidCreateNode:e=>{if(null===e.element)return;const t=e;if(n.add(t.element),this.nodes.set(t.element,t),this.identityProvider){const e=this.identityProvider.getId(t.element).toString();o.add(e),this.nodesByIdentity.set(e,t)}i.onDidCreateNode?.(t)},onDidDeleteNode:e=>{if(null===e.element)return;const t=e;if(n.has(t.element)||this.nodes.delete(t.element),this.identityProvider){const e=this.identityProvider.getId(t.element).toString();o.has(e)||this.nodesByIdentity.delete(e)}i.onDidDeleteNode?.(t)}})}preserveCollapseState(e=Ct.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),Ct.map(e,(e=>{let t=this.nodes.get(e.element);if(!t&&this.identityProvider){const i=this.identityProvider.getId(e.element).toString();t=this.nodesByIdentity.get(i)}if(!t){let t;return t=void 0===e.collapsed?void 0:e.collapsed===kQ.Collapsed||e.collapsed===kQ.PreserveOrCollapsed||e.collapsed!==kQ.Expanded&&e.collapsed!==kQ.PreserveOrExpanded&&Boolean(e.collapsed),{...e,children:this.preserveCollapseState(e.children),collapsed:t}}const i="boolean"==typeof e.collapsible?e.collapsible:t.collapsible;let n;return n=void 0===e.collapsed||e.collapsed===kQ.PreserveOrCollapsed||e.collapsed===kQ.PreserveOrExpanded?t.collapsed:e.collapsed===kQ.Collapsed||e.collapsed!==kQ.Expanded&&Boolean(e.collapsed),{...e,collapsible:i,collapsed:n,children:this.preserveCollapseState(e.children)}}))}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const n=this.getElementLocation(e);return this.model.setCollapsed(n,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(null===e)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new DQ(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(null===e)throw new DQ(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new DQ(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),n=this.model.getParentNodeLocation(i);return this.model.getNode(n).element}getElementLocation(e){if(null===e)return[];const t=this.nodes.get(e);if(!t)throw new DQ(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function bX(e){return{element:{elements:[e.element],incompressible:e.incompressible||!1},children:Ct.map(Ct.from(e.children),bX),collapsible:e.collapsible,collapsed:e.collapsed}}function wX(e){const t=[e.element],i=e.incompressible||!1;let n,o;for(;[o,n]=Ct.consume(Ct.from(e.children),2),1===o.length&&!o[0].incompressible;)e=o[0],t.push(e.element);return{element:{elements:t,incompressible:i},children:Ct.map(Ct.concat(o,n),wX),collapsible:e.collapsible,collapsed:e.collapsed}}function CX(e,t=0){let i;return i=t<e.element.elements.length-1?[CX(e,t+1)]:Ct.map(Ct.from(e.children),(e=>CX(e,0))),0===t&&e.element.incompressible?{element:e.element.elements[t],children:i,incompressible:!0,collapsible:e.collapsible,collapsed:e.collapsed}:{element:e.element.elements[t],children:i,collapsible:e.collapsible,collapsed:e.collapsed}}function yX(e){return CX(e,0)}function SX(e,t,i){return e.element===t?{...e,children:i}:{...e,children:Ct.map(Ct.from(e.children),(e=>SX(e,t,i)))}}class xX{get onDidSpliceRenderedNodes(){return this.model.onDidSpliceRenderedNodes}get onDidSpliceModel(){return this.model.onDidSpliceModel}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new vX(e,t),this.enabled=void 0===t.compressionEnabled||t.compressionEnabled,this.identityProvider=t.identityProvider}setChildren(e,t=Ct.empty(),i){const n=i.diffIdentityProvider&&(o=i.diffIdentityProvider,{getId:e=>e.elements.map((e=>o.getId(e).toString())).join("\0")});var o;if(null===e){const e=Ct.map(t,this.enabled?wX:bX);return void this._setChildren(null,e,{diffIdentityProvider:n,diffDepth:1/0})}const s=this.nodes.get(e);if(!s)throw new DQ(this.user,"Unknown compressed tree node");const r=this.model.getNode(s),a=this.model.getParentNodeLocation(s),l=this.model.getNode(a),d=SX(yX(r),e,t),h=(this.enabled?wX:bX)(d),c=i.diffIdentityProvider?(e,t)=>i.diffIdentityProvider.getId(e)===i.diffIdentityProvider.getId(t):void 0;if(es(h.element.elements,r.element.elements,c))return void this._setChildren(s,h.children||Ct.empty(),{diffIdentityProvider:n,diffDepth:1});const u=l.children.map((e=>e===r?h:e));this._setChildren(l.element,u,{diffIdentityProvider:n,diffDepth:r.depth-l.depth})}isCompressionEnabled(){return this.enabled}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const t=this.model.getNode().children,i=Ct.map(t,yX),n=Ct.map(i,e?wX:bX);this._setChildren(null,n,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const n=new Set;this.model.setChildren(e,t,{...i,onDidCreateNode:e=>{for(const t of e.element.elements)n.add(t),this.nodes.set(t,e.element)},onDidDeleteNode:e=>{for(const t of e.element.elements)n.has(t)||this.nodes.delete(t)}})}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(void 0===e)return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return null===t?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return null===i?null:i.elements[i.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const n=this.getCompressedNode(e);return this.model.setCollapsed(n,t,i)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(null===e)return null;const t=this.nodes.get(e);if(!t)throw new DQ(this.user,`Tree element not found: ${e}`);return t}}const kX=e=>e[e.length-1];class LX{get element(){return null===this.node.element?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map((e=>new LX(this.unwrapper,e)))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}}class DX{get onDidSpliceModel(){return zt.map(this.model.onDidSpliceModel,(({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map((e=>this.nodeMapper.map(e))),deletedNodes:t.map((e=>this.nodeMapper.map(e)))})))}get onDidSpliceRenderedNodes(){return zt.map(this.model.onDidSpliceRenderedNodes,(({start:e,deleteCount:t,elements:i})=>({start:e,deleteCount:t,elements:i.map((e=>this.nodeMapper.map(e)))})))}get onDidChangeCollapseState(){return zt.map(this.model.onDidChangeCollapseState,(({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t})))}get onDidChangeRenderNodeCount(){return zt.map(this.model.onDidChangeRenderNodeCount,(e=>this.nodeMapper.map(e)))}constructor(e,t={}){this.rootRef=null,this.elementMapper=t.elementMapper||kX;const i=e=>this.elementMapper(e.elements);this.nodeMapper=new EQ((e=>new LX(i,e))),this.model=new xX(e,function(e,t){return{...t,identityProvider:t.identityProvider&&{getId:i=>t.identityProvider.getId(e(i))},sorter:t.sorter&&{compare:(e,i)=>t.sorter.compare(e.elements[0],i.elements[0])},filter:t.filter&&{filter(e,i){const n=e.elements;for(let e=0;e<n.length-1;e++){const o=t.filter.filter(n[e],i);i=FQ(PQ(o)?o.visibility:o)}return t.filter.filter(n[n.length-1],i)}}}}(i,t))}setChildren(e,t=Ct.empty(),i={}){this.model.setChildren(e,t,i)}isCompressionEnabled(){return this.model.isCompressionEnabled()}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return null==t?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}class EX extends _X{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,n,o={}){super(e,t,i,n,o),this.user=e}setChildren(e,t=Ct.empty(),i){this.model.setChildren(e,t,i)}rerender(e){void 0!==e?this.model.rerender(e):this.view.rerender()}hasElement(e){return this.model.has(e)}createModel(e,t){return new vX(e,t)}}class NX{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t,i){this._compressedTreeNodeProvider=e,this.stickyScrollDelegate=t,this.renderer=i,this.templateId=i.templateId,i.onDidChangeTwistieState&&(this.onDidChangeTwistieState=i.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){let o=this.stickyScrollDelegate.getCompressedNode(e);o||(o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element)),1===o.element.elements.length?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,n)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,n))}disposeElement(e,t,i,n){i.compressedTreeNode?this.renderer.disposeCompressedElements?.(i.compressedTreeNode,t,i.data,n):this.renderer.disposeElement?.(e,t,i.data,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?.(e,t)??!1}}!function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);s>3&&r&&Object.defineProperty(t,i,r)}([QT],NX.prototype,"compressedTreeNodeProvider",null);class IX{constructor(e){this.modelProvider=e,this.compressedStickyNodes=new Map}getCompressedNode(e){return this.compressedStickyNodes.get(e)}constrainStickyScrollNodes(e,t,i){if(this.compressedStickyNodes.clear(),0===e.length)return[];for(let n=0;n<e.length;n++){const o=e[n],s=o.position+o.height;if(n+1<e.length&&s+e[n+1].height>i||n>=t-1&&t<e.length){const t=e.slice(0,n),i=e.slice(n);return[...t,this.compressStickyNodes(i)]}}return e}compressStickyNodes(e){if(0===e.length)throw new Error("Can't compress empty sticky nodes");const t=this.modelProvider();if(!t.isCompressionEnabled())return e[0];const i=[];for(let n=0;n<e.length;n++){const o=e[n],s=t.getCompressedTreeNode(o.node.element);if(s.element){if(0!==n&&s.element.incompressible)break;i.push(...s.element.elements)}}if(i.length<2)return e[0];const n=e[e.length-1],o={elements:i,incompressible:!1},s={...n.node,children:[],element:o},r=new Proxy(e[0].node,{}),a={node:r,startIndex:e[0].startIndex,endIndex:n.endIndex,position:e[0].position,height:e[0].height};return this.compressedStickyNodes.set(r,s),a}}function TX(e,t){return t&&{...t,keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(i){let n;try{n=e().getCompressedTreeNode(i)}catch{return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i)}return 1===n.element.elements.length?t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i):t.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(n.element.elements)}}}}class MX extends EX{constructor(e,t,i,n,o={}){const s=()=>this,r=new IX((()=>this.model)),a=n.map((e=>new NX(s,r,e)));super(e,t,i,a,{...TX(s,o),stickyScrollDelegate:r})}setChildren(e,t=Ct.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t){return new DX(e,t)}updateOptions(e={}){super.updateOptions(e),void 0!==e.compressionEnabled&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}function AX(e){return{...e,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function RX(e,t){return!!t.parent&&(t.parent===e||RX(e,t.parent))}class OX{get element(){return this.node.element.element}get children(){return this.node.children.map((e=>new OX(e)))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class PX{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...vh.asClassNameArray(fh.treeItemLoading)),!0):(t.classList.remove(...vh.asClassNameArray(fh.treeItemLoading)),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement?.(this.nodeMapper.map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function FX(e){return{browserEvent:e.browserEvent,elements:e.elements.map((e=>e.element))}}function BX(e){return{browserEvent:e.browserEvent,element:e.element&&e.element.element,target:e.target}}class WX extends bA{constructor(e){super(e.elements.map((e=>e.element))),this.data=e}}function VX(e){return e instanceof bA?new WX(e):e}class HX{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map((e=>e.element)),t)}onDragStart(e,t){this.dnd.onDragStart?.(VX(e),t)}onDragOver(e,t,i,n,o,s=!0){return this.dnd.onDragOver(VX(e),t&&t.element,i,n,o)}drop(e,t,i,n,o){this.dnd.drop(VX(e),t&&t.element,i,n,o)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.dnd.dispose()}}class zX extends eX{constructor(e,t,i){super(t,i),this.findProvider=e,this.isFindSessionActive=!1}filter(e,t){const i=super.filter(e,t);return this.isFindSessionActive&&this.findMode!==HQ.Highlight&&this.findProvider.isVisible?0===FQ(PQ(i)?i.visibility:i)?0:this.findProvider.isVisible(e)?i:0:i}}class UX extends nX{constructor(e,t,i,n,o){super(e,i,n,o),this.findProvider=t,this.filter=i,this.activeSession=!1,this.asyncWorkInProgress=!1,this.disposables.add(Tt((async()=>{this.activeSession&&await(this.findProvider.endSession?.())})))}render(){if(this.asyncWorkInProgress||!this.activeFindMetadata)return;const e=0===this.activeFindMetadata.matchCount&&this.pattern.length>0;this.renderMessage(e),this.pattern.length&&this.alertResults(this.activeFindMetadata.matchCount)}shouldAllowFocus(e){return this.shouldFocusWhenNavigating(e)}shouldFocusWhenNavigating(e){if(!this.activeSession||!this.activeFindMetadata)return!0;const t=e.element?.element;return!(!t||!this.activeFindMetadata.isMatch(t))||!ah.isDefault(e.filterData)}}function KX(e){return e&&{...e,collapseByDefault:!0,identityProvider:e.identityProvider&&{getId:t=>e.identityProvider.getId(t.element)},dnd:e.dnd&&new HX(e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent:t=>e.multipleSelectionController.isSelectionSingleChangeEvent({...t,element:t.element}),isSelectionRangeChangeEvent:t=>e.multipleSelectionController.isSelectionRangeChangeEvent({...t,element:t.element})},accessibilityProvider:e.accessibilityProvider&&{...e.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",isChecked:e.accessibilityProvider.isChecked?t=>!!e.accessibilityProvider?.isChecked(t.element):void 0,getAriaLabel:t=>e.accessibilityProvider.getAriaLabel(t.element),getWidgetAriaLabel:()=>e.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider.getAriaLevel&&(t=>e.accessibilityProvider.getAriaLevel(t.element)),getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))},filter:e.filter&&{filter:(t,i)=>e.filter.filter(t.element,i)},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)},sorter:void 0,expandOnlyOnTwistieClick:void 0===e.expandOnlyOnTwistieClick?void 0:"function"!=typeof e.expandOnlyOnTwistieClick?e.expandOnlyOnTwistieClick:t=>e.expandOnlyOnTwistieClick(t.element),defaultFindVisibility:t=>t.hasChildren&&t.stale?1:"number"==typeof e.defaultFindVisibility?e.defaultFindVisibility:void 0===e.defaultFindVisibility?2:e.defaultFindVisibility(t.element)}}function jX(e,t){t(e),e.children.forEach((e=>jX(e,t)))}class qX{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return zt.map(this.tree.onDidChangeFocus,FX)}get onDidChangeSelection(){return zt.map(this.tree.onDidChangeSelection,FX)}get onMouseDblClick(){return zt.map(this.tree.onMouseDblClick,BX)}get onPointer(){return zt.map(this.tree.onPointer,BX)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeStickyScrollFocused(){return this.tree.onDidChangeStickyScrollFocused}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,n,o,s={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new Zt,this._onDidChangeNodeSlowState=new Zt,this.nodeMapper=new EQ((e=>new OX(e))),this.disposables=new Mt,this.identityProvider=s.identityProvider,this.autoExpandSingleChildren=void 0!==s.autoExpandSingleChildren&&s.autoExpandSingleChildren,this.sorter=s.sorter,this.getDefaultCollapseState=e=>s.collapseByDefault?s.collapseByDefault(e)?kQ.PreserveOrCollapsed:kQ.PreserveOrExpanded:void 0;let r,a=!1;if(s.findProvider&&(s.findWidgetEnabled??1)&&s.keyboardNavigationLabelProvider&&s.contextViewProvider&&(a=!0,r=new zX(s.findProvider,s.keyboardNavigationLabelProvider,s.filter)),this.tree=this.createTree(e,t,i,n,{...s,findWidgetEnabled:!a,filter:r??s.filter}),this.root=AX({element:void 0,parent:null,hasChildren:!0,defaultCollapseState:void 0}),this.identityProvider&&(this.root={...this.root,id:null}),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables),a){const e={styles:s.findWidgetStyles,showNotFoundMessage:s.showNotFoundMessage,defaultFindMatchType:s.defaultFindMatchType,defaultFindMode:s.defaultFindMode};this.findController=this.disposables.add(new UX(this.tree,s.findProvider,r,this.tree.options.contextViewProvider,e)),this.focusNavigationFilter=e=>this.findController.shouldFocusWhenNavigating(e),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindOpenState=this.tree.onDidChangeFindOpenState,this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType}createTree(e,t,i,n,o){const s=new YQ(i),r=n.map((e=>new PX(e,this.nodeMapper,this._onDidChangeNodeSlowState.event))),a=KX(o)||{};return new EX(e,t,s,r,a)}updateOptions(e={}){this.findController&&(void 0!==e.defaultFindMode&&(this.findController.mode=e.defaultFindMode),void 0!==e.defaultFindMatchType&&(this.findController.matchType=e.defaultFindMatchType)),this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}async setInput(e,t){this.cancelAllRefreshPromises(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};await this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&"number"==typeof t.scrollTop&&(this.scrollTop=t.scrollTop)}cancelAllRefreshPromises(e=!1){this.refreshPromises.forEach((e=>e.cancel())),this.refreshPromises.clear(),e&&(this.subTreeRefreshPromises.forEach((e=>e.cancel())),this.subTreeRefreshPromises.clear())}async _updateChildren(e=this.root.element,t=!0,i=!1,n,o){if(void 0===this.root.element)throw new DQ(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await zt.toPromise(this._onDidRender.event));const s=this.getDataNode(e);if(await this.refreshAndRenderNode(s,t,n,o),i)try{this.tree.rerender(s)}catch{}}rerender(e){if(void 0===e||e===this.root.element)return void this.tree.rerender();const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(i)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}async expand(e,t=!1){if(void 0===this.root.element)throw new DQ(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await zt.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i))return!1;if(i.refreshPromise&&(await i.refreshPromise,await zt.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i))return!1;const n=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(await i.refreshPromise,await zt.toPromise(this._onDidRender.event)),n}setSelection(e,t){const i=e.map((e=>this.getDataNode(e)));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map((e=>e.element))}setFocus(e,t){const i=e.map((e=>this.getDataNode(e)));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map((e=>e.element))}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getFirstElementChild(t===this.root?null:t);return i&&i.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t){const t=this.identityProvider?.getId(e).toString();throw new DQ(this.user,"Data tree node not found"+(t?`: ${t}`:""))}return t}async refreshAndRenderNode(e,t,i,n){this.disposables.isDisposed||(await this.refreshNode(e,t,i),this.disposables.isDisposed||this.render(e,i,n))}async refreshNode(e,t,i){let n;return this.subTreeRefreshPromises.forEach(((o,s)=>{!n&&function(e,t){return e===t||RX(e,t)||RX(t,e)}(s,e)&&(n=o.then((()=>this.refreshNode(e,t,i))))})),n||(e!==this.root&&this.tree.getNode(e).collapsed?(e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0,void this.setChildren(e,[],t,i)):this.doRefreshSubTree(e,t,i))}async doRefreshSubTree(e,t,i){const n=hi((async()=>{const n=await this.doRefreshNode(e,t,i);e.stale=!1,await Di.settled(n.map((e=>this.doRefreshSubTree(e,t,i))))}));return e.refreshPromise=n,this.subTreeRefreshPromises.set(e,n),n.finally((()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)})),n}async doRefreshNode(e,t,i){let n;if(e.hasChildren=!!this.dataSource.hasChildren(e.element),e.hasChildren){const t=this.doGetChildren(e);if(ut(t))n=Promise.resolve(t);else{const i=mi(800);i.then((()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)}),(e=>null)),n=t.finally((()=>i.cancel()))}}else n=Promise.resolve(Ct.empty());try{const o=await n;return this.setChildren(e,o,t,i)}catch(t){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),Re(t))return[];throw t}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const i=this.dataSource.getChildren(e.element);return ut(i)?this.processChildren(i):(t=hi((async()=>this.processChildren(await i))),this.refreshPromises.set(e,t),t.finally((()=>{this.refreshPromises.delete(e)})))}_onDidChangeCollapseState({node:e,deep:t}){null!==e.element&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(Ie))}setChildren(e,t,i,n){const o=[...t];if(0===e.children.length&&0===o.length)return[];const s=new Map,r=new Map;for(const t of e.children)s.set(t.element,t),this.identityProvider&&r.set(t.id,{node:t,collapsed:this.tree.hasElement(t)&&this.tree.isCollapsed(t)});const a=[],l=o.map((t=>{const o=!!this.dataSource.hasChildren(t);if(!this.identityProvider){const i=AX({element:t,parent:e,hasChildren:o,defaultCollapseState:this.getDefaultCollapseState(t)});return o&&i.defaultCollapseState===kQ.PreserveOrExpanded&&a.push(i),i}const l=this.identityProvider.getId(t).toString(),d=r.get(l);if(d){const e=d.node;return s.delete(e.element),this.nodes.delete(e.element),this.nodes.set(t,e),e.element=t,e.hasChildren=o,i?d.collapsed?(e.children.forEach((e=>jX(e,(e=>this.nodes.delete(e.element))))),e.children.splice(0,e.children.length),e.stale=!0):a.push(e):o&&!d.collapsed&&a.push(e),e}const h=AX({element:t,parent:e,id:l,hasChildren:o,defaultCollapseState:this.getDefaultCollapseState(t)});return n&&n.viewState.focus&&n.viewState.focus.indexOf(l)>-1&&n.focus.push(h),n&&n.viewState.selection&&n.viewState.selection.indexOf(l)>-1&&n.selection.push(h),(n&&n.viewState.expanded&&n.viewState.expanded.indexOf(l)>-1||o&&h.defaultCollapseState===kQ.PreserveOrExpanded)&&a.push(h),h}));for(const e of s.values())jX(e,(e=>this.nodes.delete(e.element)));for(const e of l)this.nodes.set(e.element,e);return vs(e.children,0,e.children.length,l),e!==this.root&&this.autoExpandSingleChildren&&1===l.length&&0===a.length&&(l[0].forceExpanded=!0,a.push(l[0])),a}render(e,t,i){const n=e.children.map((e=>this.asTreeElement(e,t))),o=i&&{...i,diffIdentityProvider:i.diffIdentityProvider&&{getId:e=>i.diffIdentityProvider.getId(e.element)}};this.tree.setChildren(e===this.root?null:e,n,o),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?i=!1:e.forceExpanded?(i=!1,e.forceExpanded=!1):i=e.defaultCollapseState,{element:e,children:e.hasChildren?Ct.map(e.children,(e=>this.asTreeElement(e,t))):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class $X{get element(){return{elements:this.node.element.elements.map((e=>e.element)),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map((e=>new $X(e)))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class GX{constructor(e,t,i,n){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderCompressedElements(e,t,i,n){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...vh.asClassNameArray(fh.treeItemLoading)),!0):(t.classList.remove(...vh.asClassNameArray(fh.treeItemLoading)),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement?.(this.nodeMapper.map(e),t,i.templateData,n)}disposeCompressedElements(e,t,i,n){this.renderer.disposeCompressedElements?.(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=Et(this.disposables)}}class ZX extends qX{constructor(e,t,i,n,o,s,r={}){super(e,t,i,o,s,r),this.compressionDelegate=n,this.compressibleNodeMapper=new EQ((e=>new $X(e))),this.filter=r.filter}createTree(e,t,i,n,o){const s=new YQ(i),r=n.map((e=>new GX(e,this.nodeMapper,(()=>this.compressibleNodeMapper),this._onDidChangeNodeSlowState.event))),a=function(e){const t=e&&KX(e);return t&&{...t,keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{...t.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map((e=>e.element)))}}}(o)||{};return new MX(e,t,s,r,a)}asTreeElement(e,t){return{incompressible:this.compressionDelegate.isIncompressible(e.element),...super.asTreeElement(e,t)}}render(e,t,i){if(!this.identityProvider)return super.render(e,t);const n=e=>this.identityProvider.getId(e).toString(),o=e=>{const t=new Set;for(const i of e){const e=this.tree.getCompressedTreeNode(i===this.root?null:i);if(e.element)for(const i of e.element.elements)t.add(n(i.element))}return t},s=o(this.tree.getSelection()),r=o(this.tree.getFocus());super.render(e,t,i);const a=this.getSelection();let l=!1;const d=this.getFocus();let h=!1;const c=e=>{const t=e.element;if(t)for(let e=0;e<t.elements.length;e++){const i=n(t.elements[e].element),o=t.elements[t.elements.length-1].element;s.has(i)&&-1===a.indexOf(o)&&(a.push(o),l=!0),r.has(i)&&-1===d.indexOf(o)&&(d.push(o),h=!0)}e.children.forEach(c)};c(this.tree.getCompressedTreeNode(e===this.root?null:e)),l&&this.setSelection(a),h&&this.setFocus(d)}processChildren(e){return this.filter&&(e=Ct.filter(e,(e=>{const t="boolean"==typeof(i=this.filter.filter(e,1))?i?1:0:PQ(i)?FQ(i.visibility):FQ(i);var i;if(2===t)throw new Error("Recursive tree visibility not supported in async data compressed trees");return 1===t}))),super.processChildren(e)}}class YX extends _X{constructor(e,t,i,n,o,s={}){super(e,t,i,n,s),this.user=e,this.dataSource=o,this.identityProvider=s.identityProvider}createModel(e,t){return new vX(e,t)}}new Jc("isMac",$,y(1669,"Whether the operating system is macOS")),new Jc("isLinux",G,y(1670,"Whether the operating system is Linux"));const QX=new Jc("isWindows",q,y(1671,"Whether the operating system is Windows")),XX=new Jc("isWeb",Y,y(1672,"Whether the platform is a web browser")),JX=(new Jc("isMacNative",$&&!Y,y(1673,"Whether the operating system is macOS on a non-browser platform")),new Jc("isIOS",X,y(1674,"Whether the operating system is iOS")),new Jc("isMobile",J,y(1675,"Whether the platform is a mobile web browser")),new Jc("isDevelopment",!1,!0),new Jc("productQualityType","",y(1676,"Quality type of VS Code")),"inputFocus"),eJ=new Jc(JX,!1,y(1677,"Whether keyboard focus is inside an input box"));var tJ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},iJ=function(e,t){return function(i,n){t(i,n,e)}};const nJ=oc("listService"),oJ=new Jc("listScrollAtBoundary","none"),sJ=(Ac.or(oJ.isEqualTo("top"),oJ.isEqualTo("both")),Ac.or(oJ.isEqualTo("bottom"),oJ.isEqualTo("both")),new Jc("listFocus",!0)),rJ=new Jc("treestickyScrollFocused",!1),aJ=new Jc("listSupportsMultiselect",!0),lJ=Ac.and(sJ,Ac.not(JX),rJ.negate()),dJ=new Jc("listHasSelectionOrFocus",!1),hJ=new Jc("listDoubleSelection",!1),cJ=new Jc("listMultiSelection",!1),uJ=new Jc("listSelectionNavigation",!1),gJ=new Jc("listSupportsFind",!0),pJ=new Jc("treeElementCanCollapse",!1),mJ=new Jc("treeElementHasParent",!1),fJ=new Jc("treeElementCanExpand",!1),_J=new Jc("treeElementHasChild",!1),vJ=new Jc("treeFindOpen",!1),bJ="listTypeNavigationMode",wJ="listAutomaticKeyboardNavigation";function CJ(e,t){const i=e.createScoped(t.getHTMLElement());return sJ.bindTo(i),i}function yJ(e,t){const i=oJ.bindTo(e),n=()=>{const e=0===t.scrollTop,n=t.scrollHeight-t.renderHeight-t.scrollTop<1;e&&n?i.set("both"):e?i.set("top"):n?i.set("bottom"):i.set("none")};return n(),t.onDidScroll(n)}const SJ="workbench.list.multiSelectModifier",xJ="workbench.list.openMode",kJ="workbench.list.horizontalScrolling",LJ="workbench.list.defaultFindMode",DJ="workbench.list.typeNavigationMode",EJ="workbench.list.keyboardNavigation",NJ="workbench.list.scrollByPage",IJ="workbench.list.defaultFindMatchType",TJ="workbench.tree.indent",MJ="workbench.tree.renderIndentGuides",AJ="workbench.list.smoothScrolling",RJ="workbench.list.mouseWheelScrollSensitivity",OJ="workbench.list.fastScrollSensitivity",PJ="workbench.tree.expandMode",FJ="workbench.tree.enableStickyScroll",BJ="workbench.tree.stickyScrollMaxItemCount";function WJ(e){return"alt"===e.getValue(SJ)}class VJ extends At{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=WJ(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration(SJ)&&(this.useAltAsMultipleSelectionModifier=WJ(this.configurationService))})))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:VA(e)}isSelectionRangeChangeEvent(e){return HA(e)}}function HJ(e,t){const i=e.get(up),n=e.get(ER),o=new Mt;return[{...t,keyboardNavigationDelegate:{mightProducePrintableCharacter:e=>n.mightProducePrintableCharacter(e)},smoothScrolling:Boolean(i.getValue(AJ)),mouseWheelScrollSensitivity:i.getValue(RJ),fastScrollSensitivity:i.getValue(OJ),multipleSelectionController:t.multipleSelectionController??o.add(new VJ(i)),keyboardNavigationEventFilter:ZJ(n),scrollByPage:Boolean(i.getValue(NJ))},o]}let zJ=class extends XA{constructor(e,t,i,n,o,s,r,a,l){const d=void 0!==o.horizontalScrolling?o.horizontalScrolling:Boolean(a.getValue(kJ)),[h,c]=l.invokeFunction(HJ,o);super(e,t,i,n,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables.add(c),this.contextKeyService=CJ(s,this),this.disposables.add(yJ(this.contextKeyService,this)),this.listSupportsMultiSelect=aJ.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==o.multipleSelectionSupport),uJ.bindTo(this.contextKeyService).set(Boolean(o.selectionNavigation)),this.listHasSelectionOrFocus=dJ.bindTo(this.contextKeyService),this.listDoubleSelection=hJ.bindTo(this.contextKeyService),this.listMultiSelection=cJ.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=WJ(a),this.disposables.add(this.contextKeyService),this.disposables.add(r.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection((()=>{const e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)}))}))),this.disposables.add(this.onDidChangeFocus((()=>{const e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)}))),this.disposables.add(a.onDidChangeConfiguration((e=>{e.affectsConfiguration(SJ)&&(this._useAltAsMultipleSelectionModifier=WJ(a));let t={};if(e.affectsConfiguration(kJ)&&void 0===this.horizontalScrolling){const e=Boolean(a.getValue(kJ));t={...t,horizontalScrolling:e}}if(e.affectsConfiguration(NJ)){const e=Boolean(a.getValue(NJ));t={...t,scrollByPage:e}}if(e.affectsConfiguration(AJ)){const e=Boolean(a.getValue(AJ));t={...t,smoothScrolling:e}}if(e.affectsConfiguration(RJ)){const e=a.getValue(RJ);t={...t,mouseWheelScrollSensitivity:e}}if(e.affectsConfiguration(OJ)){const e=a.getValue(OJ);t={...t,fastScrollSensitivity:e}}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new qJ(this,{configurationService:a,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?BR(e):FR)}};zJ=tJ([iJ(5,eu),iJ(6,nJ),iJ(7,up),iJ(8,nc)],zJ);let UJ=class extends PY{constructor(e,t,i,n,o,s,r,a,l){const d=void 0!==o.horizontalScrolling?o.horizontalScrolling:Boolean(a.getValue(kJ)),[h,c]=l.invokeFunction(HJ,o);super(e,t,i,n,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables=new Mt,this.disposables.add(c),this.contextKeyService=CJ(s,this),this.disposables.add(yJ(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=aJ.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==o.multipleSelectionSupport),uJ.bindTo(this.contextKeyService).set(Boolean(o.selectionNavigation)),this._useAltAsMultipleSelectionModifier=WJ(a),this.disposables.add(this.contextKeyService),this.disposables.add(r.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(a.onDidChangeConfiguration((e=>{e.affectsConfiguration(SJ)&&(this._useAltAsMultipleSelectionModifier=WJ(a));let t={};if(e.affectsConfiguration(kJ)&&void 0===this.horizontalScrolling){const e=Boolean(a.getValue(kJ));t={...t,horizontalScrolling:e}}if(e.affectsConfiguration(NJ)){const e=Boolean(a.getValue(NJ));t={...t,scrollByPage:e}}if(e.affectsConfiguration(AJ)){const e=Boolean(a.getValue(AJ));t={...t,smoothScrolling:e}}if(e.affectsConfiguration(RJ)){const e=a.getValue(RJ);t={...t,mouseWheelScrollSensitivity:e}}if(e.affectsConfiguration(OJ)){const e=a.getValue(OJ);t={...t,fastScrollSensitivity:e}}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new qJ(this,{configurationService:a,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?BR(e):FR)}dispose(){this.disposables.dispose(),super.dispose()}};UJ=tJ([iJ(5,eu),iJ(6,nJ),iJ(7,up),iJ(8,nc)],UJ);let KJ=class extends YY{constructor(e,t,i,n,o,s,r,a,l,d){const h=void 0!==s.horizontalScrolling?s.horizontalScrolling:Boolean(l.getValue(kJ)),[c,u]=d.invokeFunction(HJ,s);super(e,t,i,n,o,{keyboardSupport:!1,...c,horizontalScrolling:h}),this.disposables.add(u),this.contextKeyService=CJ(r,this),this.disposables.add(yJ(this.contextKeyService,this)),this.listSupportsMultiSelect=aJ.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==s.multipleSelectionSupport),uJ.bindTo(this.contextKeyService).set(Boolean(s.selectionNavigation)),this.listHasSelectionOrFocus=dJ.bindTo(this.contextKeyService),this.listDoubleSelection=hJ.bindTo(this.contextKeyService),this.listMultiSelection=cJ.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=WJ(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection((()=>{const e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)}))}))),this.disposables.add(this.onDidChangeFocus((()=>{const e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)}))),this.disposables.add(l.onDidChangeConfiguration((e=>{e.affectsConfiguration(SJ)&&(this._useAltAsMultipleSelectionModifier=WJ(l));let t={};if(e.affectsConfiguration(kJ)&&void 0===this.horizontalScrolling){const e=Boolean(l.getValue(kJ));t={...t,horizontalScrolling:e}}if(e.affectsConfiguration(NJ)){const e=Boolean(l.getValue(NJ));t={...t,scrollByPage:e}}if(e.affectsConfiguration(AJ)){const e=Boolean(l.getValue(AJ));t={...t,smoothScrolling:e}}if(e.affectsConfiguration(RJ)){const e=l.getValue(RJ);t={...t,mouseWheelScrollSensitivity:e}}if(e.affectsConfiguration(OJ)){const e=l.getValue(OJ);t={...t,fastScrollSensitivity:e}}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new $J(this,{configurationService:l,...s}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?BR(e):FR)}dispose(){this.disposables.dispose(),super.dispose()}};KJ=tJ([iJ(6,eu),iJ(7,nJ),iJ(8,up),iJ(9,nc)],KJ);class jJ extends At{constructor(e,t){super(),this.widget=e,this._onDidOpen=this._register(new Zt),this.onDidOpen=this._onDidOpen.event,this._register(zt.filter(this.widget.onDidChangeSelection,(e=>Ya(e.browserEvent)))((e=>this.onSelectionFromKeyboard(e)))),this._register(this.widget.onPointer((e=>this.onPointer(e.element,e.browserEvent)))),this._register(this.widget.onMouseDblClick((e=>this.onMouseDblClick(e.element,e.browserEvent)))),"boolean"!=typeof t?.openOnSingleClick&&t?.configurationService?(this.openOnSingleClick="doubleClick"!==t?.configurationService.getValue(xJ),this._register(t?.configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration(xJ)&&(this.openOnSingleClick="doubleClick"!==t?.configurationService.getValue(xJ))})))):this.openOnSingleClick=t?.openOnSingleClick??!0}onSelectionFromKeyboard(e){if(1!==e.elements.length)return;const t=e.browserEvent,i="boolean"!=typeof t.preserveFocus||t.preserveFocus,n="boolean"==typeof t.pinned?t.pinned:!i;this._open(this.getSelectedElement(),i,n,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick)return;if(2===t.detail)return;const i=1===t.button,n=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!0,i,n,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const n=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!1,!0,n,t)}_open(e,t,i,n,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:n,element:e,browserEvent:o})}}class qJ extends jJ{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class $J extends jJ{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class GJ extends jJ{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelection()[0]??void 0}}function ZJ(e){let t=!1;return i=>{if(i.toKeyCodeChord().isModifierKey())return!1;if(t)return t=!1,!1;const n=e.softDispatch(i,i.target);return 1===n.kind?(t=!0,!1):(t=!1,0===n.kind)}}let YJ=class extends EX{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,s,r,a,l){const{options:d,getTypeNavigationMode:h,disposable:c}=s.invokeFunction(n0,o);super(e,t,i,n,d),this.disposables.add(c),this.internals=new o0(this,o,h,o.overrideStyles,r,a,l),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};YJ=tJ([iJ(5,nc),iJ(6,eu),iJ(7,nJ),iJ(8,up)],YJ);let QJ=class extends MX{constructor(e,t,i,n,o,s,r,a,l){const{options:d,getTypeNavigationMode:h,disposable:c}=s.invokeFunction(n0,o);super(e,t,i,n,d),this.disposables.add(c),this.internals=new o0(this,o,h,o.overrideStyles,r,a,l),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};QJ=tJ([iJ(5,nc),iJ(6,eu),iJ(7,nJ),iJ(8,up)],QJ);let XJ=class extends YX{constructor(e,t,i,n,o,s,r,a,l,d){const{options:h,getTypeNavigationMode:c,disposable:u}=r.invokeFunction(n0,s);super(e,t,i,n,o,h),this.disposables.add(u),this.internals=new o0(this,s,c,s.overrideStyles,a,l,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),void 0!==e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};XJ=tJ([iJ(6,nc),iJ(7,eu),iJ(8,nJ),iJ(9,up)],XJ);let JJ=class extends qX{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,s,r,a,l,d){const{options:h,getTypeNavigationMode:c,disposable:u}=r.invokeFunction(n0,s);super(e,t,i,n,o,h),this.disposables.add(u),this.internals=new o0(this,s,c,s.overrideStyles,a,l,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};JJ=tJ([iJ(6,nc),iJ(7,eu),iJ(8,nJ),iJ(9,up)],JJ);let e0=class extends ZX{constructor(e,t,i,n,o,s,r,a,l,d,h){const{options:c,getTypeNavigationMode:u,disposable:g}=a.invokeFunction(n0,r);super(e,t,i,n,o,s,c),this.disposables.add(g),this.internals=new o0(this,r,u,r.overrideStyles,l,d,h),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};function t0(e){const t=e.getValue(LJ);if("highlight"===t)return HQ.Highlight;if("filter"===t)return HQ.Filter;const i=e.getValue(EJ);return"simple"===i||"highlight"===i?HQ.Highlight:"filter"===i?HQ.Filter:void 0}function i0(e){const t=e.getValue(IJ);return"fuzzy"===t?zQ.Fuzzy:"contiguous"===t?zQ.Contiguous:void 0}function n0(e,t){const i=e.get(up),n=e.get(LR),o=e.get(eu),s=e.get(nc),r=void 0!==t.horizontalScrolling?t.horizontalScrolling:Boolean(i.getValue(kJ)),[a,l]=s.invokeFunction(HJ,t),d=t.paddingBottom,h=void 0!==t.renderIndentGuides?t.renderIndentGuides:i.getValue(MJ);return{getTypeNavigationMode:()=>{const e=o.getContextKeyValue(bJ);if("automatic"===e)return xA.Automatic;if("trigger"===e)return xA.Trigger;if(!1===o.getContextKeyValue(wJ))return xA.Trigger;const t=i.getValue(DJ);return"automatic"===t?xA.Automatic:"trigger"===t?xA.Trigger:void 0},disposable:l,options:{keyboardSupport:!1,...a,indent:"number"==typeof i.getValue(TJ)?i.getValue(TJ):void 0,renderIndentGuides:h,smoothScrolling:Boolean(i.getValue(AJ)),defaultFindMode:t0(i),defaultFindMatchType:i0(i),horizontalScrolling:r,scrollByPage:Boolean(i.getValue(NJ)),paddingBottom:d,hideTwistiesOfChildlessElements:t.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:t.expandOnlyOnTwistieClick??"doubleClick"===i.getValue(PJ),contextViewProvider:n,findWidgetStyles:OR,enableStickyScroll:Boolean(i.getValue(FJ)),stickyScrollMaxItemCount:Number(i.getValue(BJ))}}}e0=tJ([iJ(7,nc),iJ(8,eu),iJ(9,nJ),iJ(10,up)],e0);let o0=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,o,s,r){this.tree=e,this.disposables=[],this.contextKeyService=CJ(o,e),this.disposables.push(yJ(this.contextKeyService,e)),this.listSupportsMultiSelect=aJ.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==t.multipleSelectionSupport),uJ.bindTo(this.contextKeyService).set(Boolean(t.selectionNavigation)),this.listSupportFindWidget=gJ.bindTo(this.contextKeyService),this.listSupportFindWidget.set(t.findWidgetEnabled??!0),this.hasSelectionOrFocus=dJ.bindTo(this.contextKeyService),this.hasDoubleSelection=hJ.bindTo(this.contextKeyService),this.hasMultiSelection=cJ.bindTo(this.contextKeyService),this.treeElementCanCollapse=pJ.bindTo(this.contextKeyService),this.treeElementHasParent=mJ.bindTo(this.contextKeyService),this.treeElementCanExpand=fJ.bindTo(this.contextKeyService),this.treeElementHasChild=_J.bindTo(this.contextKeyService),this.treeFindOpen=vJ.bindTo(this.contextKeyService),this.treeStickyScrollFocused=rJ.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=WJ(r),this.updateStyleOverrides(n);const a=()=>{const t=e.getFocus()[0];if(!t)return;const i=e.getNode(t);this.treeElementCanCollapse.set(i.collapsible&&!i.collapsed),this.treeElementHasParent.set(!!e.getParentElement(t)),this.treeElementCanExpand.set(i.collapsible&&i.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(t))},l=new Set;l.add(bJ),l.add(wJ),this.disposables.push(this.contextKeyService,s.register(e),e.onDidChangeSelection((()=>{const t=e.getSelection(),i=e.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.hasSelectionOrFocus.set(t.length>0||i.length>0),this.hasMultiSelection.set(t.length>1),this.hasDoubleSelection.set(2===t.length)}))})),e.onDidChangeFocus((()=>{const t=e.getSelection(),i=e.getFocus();this.hasSelectionOrFocus.set(t.length>0||i.length>0),a()})),e.onDidChangeCollapseState(a),e.onDidChangeModel(a),e.onDidChangeFindOpenState((e=>this.treeFindOpen.set(e))),e.onDidChangeStickyScrollFocused((e=>this.treeStickyScrollFocused.set(e))),r.onDidChangeConfiguration((n=>{let o={};if(n.affectsConfiguration(SJ)&&(this._useAltAsMultipleSelectionModifier=WJ(r)),n.affectsConfiguration(TJ)){const e=r.getValue(TJ);o={...o,indent:e}}if(n.affectsConfiguration(MJ)&&void 0===t.renderIndentGuides){const e=r.getValue(MJ);o={...o,renderIndentGuides:e}}if(n.affectsConfiguration(AJ)){const e=Boolean(r.getValue(AJ));o={...o,smoothScrolling:e}}if(n.affectsConfiguration(LJ)||n.affectsConfiguration(EJ)){const e=t0(r);o={...o,defaultFindMode:e}}if(n.affectsConfiguration(DJ)||n.affectsConfiguration(EJ)){const e=i();o={...o,typeNavigationMode:e}}if(n.affectsConfiguration(IJ)){const e=i0(r);o={...o,defaultFindMatchType:e}}if(n.affectsConfiguration(kJ)&&void 0===t.horizontalScrolling){const e=Boolean(r.getValue(kJ));o={...o,horizontalScrolling:e}}if(n.affectsConfiguration(NJ)){const e=Boolean(r.getValue(NJ));o={...o,scrollByPage:e}}if(n.affectsConfiguration(PJ)&&void 0===t.expandOnlyOnTwistieClick&&(o={...o,expandOnlyOnTwistieClick:"doubleClick"===r.getValue(PJ)}),n.affectsConfiguration(FJ)){const e=r.getValue(FJ);o={...o,enableStickyScroll:e}}if(n.affectsConfiguration(BJ)){const e=Math.max(1,r.getValue(BJ));o={...o,stickyScrollMaxItemCount:e}}if(n.affectsConfiguration(RJ)){const e=r.getValue(RJ);o={...o,mouseWheelScrollSensitivity:e}}if(n.affectsConfiguration(OJ)){const e=r.getValue(OJ);o={...o,fastScrollSensitivity:e}}Object.keys(o).length>0&&e.updateOptions(o)})),this.contextKeyService.onDidChangeContext((t=>{t.affectsSome(l)&&e.updateOptions({typeNavigationMode:i()})}))),this.navigator=new GJ(e,{configurationService:r,...t}),this.disposables.push(this.navigator)}updateOptions(e){void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?BR(e):FR)}dispose(){this.disposables=Et(this.disposables)}};o0=tJ([iJ(4,eu),iJ(5,nJ),iJ(6,up)],o0),ru.as(kp).registerConfiguration({id:"workbench",order:7,title:y(1688,"Workbench"),type:"object",properties:{[SJ]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[y(1689,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),y(1690,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:y(1691,"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[xJ]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:y(1692,"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[kJ]:{type:"boolean",default:!1,description:y(1693,"Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[NJ]:{type:"boolean",default:!1,description:y(1694,"Controls whether clicks in the scrollbar scroll page by page.")},[TJ]:{type:"number",default:8,minimum:4,maximum:40,description:y(1695,"Controls tree indentation in pixels.")},[MJ]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:y(1696,"Controls whether the tree should render indent guides.")},[AJ]:{type:"boolean",default:!1,description:y(1697,"Controls whether lists and trees have smooth scrolling.")},[RJ]:{type:"number",default:1,markdownDescription:y(1698,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[OJ]:{type:"number",default:5,markdownDescription:y(1699,"Scrolling speed multiplier when pressing `Alt`.")},[LJ]:{type:"string",enum:["highlight","filter"],enumDescriptions:[y(1700,"Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),y(1701,"Filter elements when searching.")],default:"highlight",description:y(1702,"Controls the default find mode for lists and trees in the workbench.")},[EJ]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[y(1703,"Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),y(1704,"Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),y(1705,"Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:y(1706,"Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:y(1707,"Please use 'workbench.list.defaultFindMode' and\t'workbench.list.typeNavigationMode' instead.")},[IJ]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[y(1708,"Use fuzzy matching when searching."),y(1709,"Use contiguous matching when searching.")],default:"fuzzy",description:y(1710,"Controls the type of matching used when searching lists and trees in the workbench.")},[PJ]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:y(1711,"Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[FJ]:{type:"boolean",default:!0,description:y(1712,"Controls whether sticky scrolling is enabled in trees.")},[BJ]:{type:"number",minimum:1,default:7,markdownDescription:y(1713,"Controls the number of sticky elements displayed in the tree when {0} is enabled.","`#workbench.tree.enableStickyScroll#`")},[DJ]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:y(1714,"Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});class s0{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=QD.nextId()}get uri(){return this.link.uri}get range(){return this._range??this.link.targetSelectionRange??this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){const e=this.parent.getPreview(this)?.preview(this.range);return e?y(1083,"{0} in {1} on line {2} at column {3}",e.value,Bh(this.uri),this.range.startLineNumber,this.range.startColumn):y(1082,"in {0} on line {1} at column {2}",Bh(this.uri),this.range.startLineNumber,this.range.startColumn)}}class r0{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:n,startColumn:o,endLineNumber:s,endColumn:r}=e,a=i.getWordUntilPosition({lineNumber:n,column:o-t}),l=new Yu(n,a.startColumn,n,o),d=new Yu(s,r,s,1073741824),h=i.getValueInRange(l).replace(/^\s+/,""),c=i.getValueInRange(e);return{value:h+c+i.getValueInRange(d).replace(/\s+$/,""),highlight:{start:h.length,end:h.length+c.length}}}}class a0{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new nd}dispose(){Et(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return 1===e?y(1084,"1 symbol in {0}, full path {1}",Bh(this.uri),this.uri.fsPath):y(1085,"{0} symbols in {1}, full path {2}",e,Bh(this.uri),this.uri.fsPath)}async resolve(e){if(0!==this._previews.size)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const i=await e.createModelReference(t.uri);this._previews.set(t.uri,new r0(i))}catch(e){Ie(e)}return this}}class l0{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new Zt,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;let n;e.sort(l0._compareReferences);for(const t of e)if(n&&Oh.isEqual(n.uri,t.uri,!0)||(n=new a0(this,t.uri),this.groups.push(n)),0===n.children.length||0!==l0._compareReferences(t,n.children[n.children.length-1])){const e=new s0(i===t,n,t,(e=>this._onDidChangeReferenceRange.fire(e)));this.references.push(e),n.children.push(e)}}dispose(){Et(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new l0(this._links,this._title)}get title(){return this._title}get isEmpty(){return 0===this.groups.length}get ariaMessage(){return this.isEmpty?y(1086,"No results found"):1===this.references.length?y(1087,"Found 1 symbol in {0}",this.references[0].uri.fsPath):1===this.groups.length?y(1088,"Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):y(1089,"Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let n=i.children.indexOf(e);const o=i.children.length,s=i.parent.groups.length;return 1===s||t&&n+1<o||!t&&n>0?(n=t?(n+1)%o:(n+o-1)%o,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%s,i.parent.groups[n].children[0]):(n=(n+s-1)%s,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map(((i,n)=>({idx:n,prefixLen:rn(i.uri.toString(),e.toString()),offsetDist:100*Math.abs(i.range.startLineNumber-t.lineNumber)+Math.abs(i.range.startColumn-t.column)}))).sort(((e,t)=>e.prefixLen>t.prefixLen?-1:e.prefixLen<t.prefixLen?1:e.offsetDist<t.offsetDist?-1:e.offsetDist>t.offsetDist?1:0))[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&Yu.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Oh.compare(e.uri,t.uri)||Yu.compareRangesUsingStarts(e.range,t.range)}}var d0=i(6378),h0={};h0.styleTagTransform=zl(),h0.setAttributes=Bl(),h0.insert=Pl().bind(null,"head"),h0.domAPI=Rl(),h0.insertStyleElement=Vl(),Ml()(d0.A,h0),d0.A&&d0.A.locals&&d0.A.locals;var c0=i(1684),u0={};u0.styleTagTransform=zl(),u0.setAttributes=Bl(),u0.insert=Pl().bind(null,"head"),u0.domAPI=Rl(),u0.insertStyleElement=Vl(),Ml()(c0.A,u0),c0.A&&c0.A.locals&&c0.A.locals;class g0 extends At{constructor(e,t,i){super(),this.options=t,this.styles=i,this.count=0,this.hover=this._register(new Rt),this.element=il(e,ll(".monaco-count-badge")),this._register(Tt((()=>e.removeChild(this.element)))),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0),this.updateHover()}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.updateHover(),this.render()}updateHover(){""===this.titleFormat||this.hover.value?""===this.titleFormat&&this.hover.value&&(this.hover.value=void 0):this.hover.value=lM().setupDelayedHoverAtMouse(this.element,(()=>({content:Bi(this.titleFormat,this.count),appearance:{compact:!0}})))}render(){this.element.textContent=Bi(this.countFormat,this.count),this.element.style.backgroundColor=this.styles.badgeBackground??"",this.element.style.color=this.styles.badgeForeground??"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}class p0 extends At{constructor(e,t){super(),this.options=t,this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=t?.supportIcons??!1,this.domNode=il(e,ll("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",n){e||(e=""),n&&(e=p0.escapeNewLines(e,t)),this.didEverRender&&this.text===e&&this.title===i&&cg(this.highlights,t)||(this.text=e,this.title=i,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const i of this.highlights){if(i.end===i.start)continue;if(t<i.start){const n=this.text.substring(t,i.start);this.supportIcons?e.push(...bI(n)):e.push(n),t=i.start}const n=this.text.substring(t,i.end),o=ll("span.highlight",void 0,...this.supportIcons?bI(n):[n]);i.extraClasses&&o.classList.add(...i.extraClasses),e.push(o),t=i.end}if(t<this.text.length){const i=this.text.substring(t);this.supportIcons?e.push(...bI(i)):e.push(i)}if(ol(this.domNode,...e),this.customHover||""===this.title)this.customHover&&this.customHover.update(this.title);else{const e=this.options?.hoverDelegate??nM("mouse");this.customHover=this._register(lM().setupManagedHover(e,this.domNode,this.title))}this.didEverRender=!0}static escapeNewLines(e,t){let i=0,n=0;return e.replace(/\r\n|\r|\n/g,((e,o)=>{n="\r\n"===e?-1:0,o+=i;for(const e of t)e.end<=o||(e.start>=o&&(e.start+=n),e.end>=o&&(e.end+=n));return i+=n,"⏎"}))}}var m0=i(8134),f0={};f0.styleTagTransform=zl(),f0.setAttributes=Bl(),f0.insert=Pl().bind(null,"head"),f0.domAPI=Rl(),f0.insertStyleElement=Vl(),Ml()(m0.A,f0),m0.A&&m0.A.locals&&m0.A.locals;class _0{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set classNames(e){this.disposed||cg(e,this._classNames)||(this._classNames=e,this._element.classList.value="",this._element.classList.add(...e))}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class v0 extends At{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new _0(il(e,ll(".monaco-icon-label")))),this.labelContainer=il(this.domNode.element,ll(".monaco-icon-label-container")),this.nameContainer=il(this.labelContainer,ll("span.monaco-icon-name-container")),this.nameNode=t?.supportHighlights||t?.supportIcons?this._register(new w0(this.nameContainer,!!t.supportIcons)):new b0(this.nameContainer),this.hoverDelegate=t?.hoverDelegate??nM("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){const n=["monaco-icon-label"],o=["monaco-icon-label-container"];let s="";i&&(i.extraClasses&&n.push(...i.extraClasses),i.italic&&n.push("italic"),i.strikethrough&&n.push("strikethrough"),i.disabledCommand&&o.push("disabled"),i.title&&("string"==typeof i.title?s+=i.title:s+=e));const r=this.domNode.element.querySelector(".monaco-icon-label-iconpath");if(i?.iconPath){let e;r&&qa(r)?e=r:(e=ll(".monaco-icon-label-iconpath"),this.domNode.element.prepend(e)),e.style.backgroundImage=CM(i?.iconPath),e.style.backgroundRepeat="no-repeat",e.style.backgroundPosition="center",e.style.backgroundSize="contain"}else r&&r.remove();if(this.domNode.classNames=n,this.domNode.element.setAttribute("aria-label",s),this.labelContainer.classList.value="",this.labelContainer.classList.add(...o),this.setupHover(i?.descriptionTitle?this.labelContainer:this.element,i?.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const e=this.getOrCreateDescriptionNode();e instanceof p0?(e.set(t||"",i?i.descriptionMatches:void 0,void 0,i?.labelEscapeNewLines),this.setupHover(e.element,i?.descriptionTitle)):(e.textContent=t&&i?.labelEscapeNewLines?p0.escapeNewLines(t,[]):t||"",this.setupHover(e.element,i?.descriptionTitle||""),e.empty=!t)}(i?.suffix||this.suffixNode)&&(this.getOrCreateSuffixNode().textContent=i?.suffix??"")}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t)return void e.removeAttribute("title");let n=e;if(this.creationOptions?.hoverTargetOverride){if(!Oa(e,this.creationOptions.hoverTargetOverride))throw new Error("hoverTargetOverrride must be an ancestor of the htmlElement");n=this.creationOptions.hoverTargetOverride}const o=lM().setupManagedHover(this.hoverDelegate,n,t);o&&this.customHovers.set(e,o)}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const i=this._register(new _0((e=this.nameContainer,t=ll("span.monaco-icon-suffix-container"),e.after(t),t)));this.suffixNode=this._register(new _0(il(i.element,ll("span.label-suffix"))))}var e,t;return this.suffixNode}getOrCreateDescriptionNode(){if(!this.descriptionNode){const e=this._register(new _0(il(this.labelContainer,ll("span.monaco-icon-description-container"))));this.creationOptions?.supportDescriptionHighlights?this.descriptionNode=this._register(new p0(il(e.element,ll("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons})):this.descriptionNode=this._register(new _0(il(e.element,ll("span.label-description"))))}return this.descriptionNode}}class b0{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!cg(this.options,t))if(this.label=e,this.options=t,"string"==typeof e)this.singleLabel||(this.container.textContent="",this.container.classList.remove("multiple"),this.singleLabel=il(this.container,ll("a.label-name",{id:t?.domId}))),this.singleLabel.textContent=e;else{this.container.textContent="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i<e.length;i++){const n=e[i],o=t?.domId&&`${t?.domId}_${i}`;il(this.container,ll("a.label-name",{id:o,"data-icon-label-count":e.length,"data-icon-label-index":i,role:"treeitem"},n)),i<e.length-1&&il(this.container,ll("span.label-separator",void 0,t?.separator||"/"))}}}}class w0 extends At{constructor(e,t){super(),this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!cg(this.options,t))if(this.label=e,this.options=t,"string"==typeof e)this.singleLabel||(this.container.textContent="",this.container.classList.remove("multiple"),this.singleLabel=this._register(new p0(il(this.container,ll("a.label-name",{id:t?.domId})),{supportIcons:this.supportIcons}))),this.singleLabel.set(e,t?.matches,void 0,t?.labelEscapeNewLines);else{this.container.textContent="",this.container.classList.add("multiple"),this.singleLabel=void 0;const i=t?.separator||"/",n=function(e,t,i){if(!i)return;let n=0;return e.map((e=>{const o={start:n,end:n+e.length},s=i.map((e=>tA.intersect(o,e))).filter((e=>!tA.isEmpty(e))).map((({start:e,end:t})=>({start:e-n,end:t-n})));return n=o.end+t.length,s}))}(e,i,t?.matches);for(let o=0;o<e.length;o++){const s=e[o],r=n?n[o]:void 0,a=ll("a.label-name",{id:t?.domId&&`${t?.domId}_${o}`,"data-icon-label-count":e.length,"data-icon-label-index":o,role:"treeitem"});this._register(new p0(il(this.container,a),{supportIcons:this.supportIcons})).set(s,r,void 0,t?.labelEscapeNewLines),o<e.length-1&&il(a,ll("span.label-separator",void 0,i))}}}}const C0=oc("labelService");var y0,S0=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},x0=function(e,t){return function(i,n){t(i,n,e)}};let k0=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof l0||e instanceof a0}getChildren(e){if(e instanceof l0)return e.groups;if(e instanceof a0)return e.resolve(this._resolverService).then((e=>e.children));throw new Error("bad tree")}};k0=S0([x0(0,lc)],k0);class L0{getHeight(){return 23}getTemplateId(e){return e instanceof a0?I0.id:M0.id}}let D0=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){if(e instanceof s0){const t=e.parent.getPreview(e)?.preview(e.range);if(t)return t.value}return Bh(e.uri)}};D0=S0([x0(0,ER)],D0);class E0{getId(e){return e instanceof s0?e.id:e.uri}}let N0=class extends At{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new v0(i,{supportHighlights:!0})),this.badge=this._register(new g0(il(i,ll(".count")),{},PR)),e.appendChild(i)}set(e,t){const i=Vh(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const n=e.children.length;this.badge.setCount(n),n>1?this.badge.setTitleFormat(y(1076,"{0} references",n)):this.badge.setTitleFormat(y(1077,"{0} reference",n))}};N0=S0([x0(1,C0)],N0);let I0=class{static{y0=this}static{this.id="FileReferencesRenderer"}constructor(e){this._instantiationService=e,this.templateId=y0.id}renderTemplate(e){return this._instantiationService.createInstance(N0,e)}renderElement(e,t,i){i.set(e.element,$d(e.filterData))}disposeTemplate(e){e.dispose()}};I0=y0=S0([x0(0,nc)],I0);class T0 extends At{constructor(e){super(),this.label=this._register(new p0(e))}set(e,t){const i=e.parent.getPreview(e)?.preview(e.range);if(i&&i.value){const{value:e,highlight:n}=i;t&&!ah.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(e,$d(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(e,[n]))}else this.label.set(`${Bh(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`)}}class M0{constructor(){this.templateId=M0.id}static{this.id="OneReferenceRenderer"}renderTemplate(e){return new T0(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(e){e.dispose()}}class A0{getWidgetAriaLabel(){return y(1078,"References")}getAriaLabel(e){return e.ariaMessage}}var R0=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},O0=function(e,t){return function(i,n){t(i,n,e)}};class P0{static{this.DecorationOptions=bk.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"})}constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new Mt,this._callOnModelChange=new Mt,this._callOnDispose.add(this._editor.onDidChangeModel((()=>this._onModelChanged()))),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e)for(const t of this._model.references)if(t.uri.toString()===e.uri.toString())return void this._addDecorations(t.parent)}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations((()=>this._onDecorationChanged())));const t=[],i=[];for(let n=0,o=e.children.length;n<o;n++){const o=e.children[n];this._decorationIgnoreSet.has(o.id)||o.uri.toString()===this._editor.getModel().uri.toString()&&(t.push({range:o.range,options:P0.DecorationOptions}),i.push(n))}this._editor.changeDecorations((n=>{const o=n.deltaDecorations([],t);for(let t=0;t<o.length;t++)this._decorations.set(o[t],e.children[i[t]])}))}_onDecorationChanged(){const e=[],t=this._editor.getModel();if(t){for(const[i,n]of this._decorations){const o=t.getDecorationRange(i);if(!o)continue;let s=!1;Yu.equalsRange(o,n.range)||((Yu.spansMultipleLines(o)||n.range.endColumn-n.range.startColumn!=o.endColumn-o.startColumn)&&(s=!0),s?(this._decorationIgnoreSet.add(n.id),e.push(i)):n.range=o)}for(let t=0,i=e.length;t<i;t++)this._decorations.delete(e[t]);this._editor.removeDecorations(e)}}removeDecorations(){this._editor.removeDecorations([...this._decorations.keys()]),this._decorations.clear()}}class F0{constructor(){this.ratio=.7,this.heightInLines=18}static fromJSON(e){let t,i;try{const n=JSON.parse(e);t=n.ratio,i=n.heightInLines}catch{}return{ratio:t||.7,heightInLines:i||18}}}class B0 extends JJ{}let W0=class{constructor(e){this.labelService=e,this.disposables=new Mt}getDragURI(e){return e instanceof a0?e.uri.toString():e instanceof s0?(t=e.uri,i=e.range,t.with({fragment:`${i.startLineNumber},${i.startColumn}${i.endLineNumber?`-${i.endLineNumber}${i.endColumn?`,${i.endColumn}`:""}`:""}`})).toString():null;var t,i}getDragLabel(e){if(0!==e.length)return e.map((e=>this.labelService.getUriBasenameLabel(e.uri))).join(", ")}onDragStart(e,t){if(!t.dataTransfer)return;const i=e.elements.map((e=>this.getDragURI(e))).filter(Boolean);i.length&&(t.dataTransfer.setData(DD.RESOURCES,JSON.stringify(i)),t.dataTransfer.setData(DD.TEXT,i.join("\n")))}onDragOver(){return!1}drop(){}dispose(){this.disposables.dispose()}};W0=R0([O0(0,C0)],W0);let V0=class extends DY{constructor(e,t,i,n,o,s,r,a,l){super(e,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},s),this._defaultTreeKeyboardSupport=t,this.layoutData=i,this._textModelResolverService=o,this._instantiationService=s,this._peekViewService=r,this._uriLabel=a,this._keybindingService=l,this._disposeOnNewModel=new Mt,this._callOnDispose=new Mt,this._onDidSelectReference=new Zt,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new Da(0,0),this._isClosing=!1,this._applyTheme(n.getColorTheme()),this._callOnDispose.add(n.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(e,this),this.create()}get isClosing(){return this._isClosing}dispose(){this._isClosing=!0,this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),Et(this._preview),Et(this._previewNotAvailableMessage),Et(this._tree),Et(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){const t=e.getColor(TY)||Lg.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(EY)||Lg.transparent,primaryHeadingColor:e.getColor(NY),secondaryHeadingColor:e.getColor(IY)})}show(e){super.show(e,this.layoutData.heightInLines||18)}focusOnReferenceTree(){this._tree.domFocus()}focusOnPreviewEditor(){this._preview.focus()}isPreviewEditorFocused(){return this._preview.hasTextFocus()}_onTitleClick(e){this._preview&&this._preview.getModel()&&this._onDidSelectReference.fire({element:this._getFocusedReference(),kind:e.ctrlKey||e.metaKey||e.altKey?"side":"open",source:"title"})}_fillBody(e){this.setCssClass("reference-zone-widget"),this._messageContainer=il(e,ll("div.messages")),hl(this._messageContainer),this._splitView=new jY(e,{orientation:1}),this._previewContainer=il(e,ll("div.preview.inline")),this._preview=this._instantiationService.createInstance(rY,this._previewContainer,{scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!0},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1}},{},this.editor),hl(this._previewContainer),this._previewNotAvailableMessage=this._instantiationService.createInstance(lk,y(1079,"no preview available"),Up,lk.DEFAULT_CREATION_OPTIONS,null),this._treeContainer=il(e,ll("div.ref-tree.inline"));const t={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new A0,keyboardNavigationLabelProvider:this._instantiationService.createInstance(D0),identityProvider:new E0,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:MY},dnd:this._instantiationService.createInstance(W0)};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(ma(this._treeContainer,"keydown",(e=>{e.equals(9)&&(this._keybindingService.dispatchEvent(e,e.target),e.stopPropagation())}),!0)),this._tree=this._instantiationService.createInstance(B0,"ReferencesWidget",this._treeContainer,new L0,[this._instantiationService.createInstance(I0),this._instantiationService.createInstance(M0)],this._instantiationService.createInstance(k0),t),this._splitView.addView({onDidChange:zt.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:e=>{this._preview.layout({height:this._dim.height,width:e})}},KY.Distribute),this._splitView.addView({onDidChange:zt.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:e=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${e}px`,this._tree.layout(this._dim.height,e)}},KY.Distribute),this._disposables.add(this._splitView.onDidSashChange((()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)}),void 0));const i=(e,t)=>{e instanceof s0&&("show"===t&&this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:t,source:"tree"}))};this._disposables.add(this._tree.onDidOpen((e=>{e.sideBySide?i(e.element,"side"):e.editorOptions.pinned?i(e.element,"goto"):i(e.element,"show")}))),hl(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Da(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then((()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))}))}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=y(1080,"No results"),dl(this._messageContainer),Promise.resolve(void 0)):(hl(this._messageContainer),this._decorationsManager=new P0(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange((e=>this._tree.rerender(e)))),this._disposeOnNewModel.add(this._preview.onMouseDown((e=>{const{event:t,target:i}=e;if(2!==t.detail)return;const n=this._getFocusedReference();n&&this._onDidSelectReference.fire({element:{uri:n.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})}))),this.container.classList.add("results-loaded"),dl(this._treeContainer),dl(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(1===this._model.groups.length?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();return e instanceof s0?e:e instanceof a0&&e.children.length>0?e.children[0]:void 0}async revealReference(e){await this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}async _revealReference(e,t){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==So.inMemory?this.setTitle(Fh(e.uri),this._uriLabel.getUriLabel(Vh(e.uri))):this.setTitle(y(1081,"References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent||(t&&this._tree.reveal(e.parent),await this._tree.expand(e.parent)),this._tree.reveal(e);const n=await i;if(!this._model)return void n.dispose();Et(this._previewModelReference);const o=n.object;if(o){const t=this._preview.getModel()===o.textEditorModel?0:1,i=Yu.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(o.textEditorModel),this._preview.setSelection(i),this._preview.revealRangeInCenter(i,t)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()}};V0=R0([O0(3,sw),O0(4,lc),O0(5,nc),O0(6,SY),O0(7,C0),O0(8,ER)],V0);var H0,z0=function(e,t){return function(i,n){t(i,n,e)}};const U0=new Jc("referenceSearchVisible",!1,y(1073,"Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let K0=class{static{H0=this}static{this.ID="editor.contrib.referencesController"}static get(e){return e.getContribution(H0.ID)}constructor(e,t,i,n,o,s,r,a){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=n,this._notificationService=o,this._instantiationService=s,this._storageService=r,this._configurationService=a,this._disposables=new Mt,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=U0.bindTo(i)}dispose(){this._referenceSearchVisible.reset(),this._disposables.dispose(),this._widget?.dispose(),this._model?.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let n;if(this._widget&&(n=this._widget.position),this.closeWidget(),n&&e.containsPosition(n))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage((()=>{this.closeWidget()}))),this._disposables.add(this._editor.onDidChangeModel((()=>{this._ignoreModelChangeEvent||this.closeWidget()})));const o="peekViewLayout",s=F0.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(V0,this._editor,this._defaultTreeKeyboardSupport,s),this._widget.setTitle(y(1074,"Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose((()=>{t.cancel(),this._widget?(this._storageService.store(o,JSON.stringify(this._widget.layoutData),0,1),this._widget.isClosing||this.closeWidget(),this._widget=void 0):this.closeWidget()}))),this._disposables.add(this._widget.onDidSelectReference((e=>{const{element:t,kind:n}=e;if(t)switch(n){case"open":"editor"===e.source&&this._configurationService.getValue("editor.stablePeek")||this.openReference(t,!1,!1);break;case"side":this.openReference(t,!0,!1);break;case"goto":i?this._gotoReference(t,!0):this.openReference(t,!1,!0)}})));const r=++this._requestIdPool;t.then((t=>{if(r===this._requestIdPool&&this._widget)return this._model?.dispose(),this._model=t,this._widget.setModel(this._model).then((()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(y(1075,"{0} ({1})",this._model.title,this._model.references.length));const t=this._editor.getModel().uri,i=new rc(e.startLineNumber,e.startColumn),n=this._model.nearestReference(t,i);if(n)return this._widget.setSelection(n).then((()=>{this._widget&&"editor"===this._editor.getOption(99)&&this._widget.focusOnPreviewEditor()}))}}));t.dispose()}),(e=>{this._notificationService.error(e)}))}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(e){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const n=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),s=this._widget.isPreviewEditorFocused();await this._widget.setSelection(n),await this._gotoReference(n,!1),o?this._editor.focus():this._widget&&s&&this._widget.focusOnPreviewEditor()}async revealReference(e){this._editor.hasModel()&&this._model&&this._widget&&await this._widget.revealReference(e)}closeWidget(e=!0){this._widget?.dispose(),this._model?.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){this._widget?.hide(),this._ignoreModelChangeEvent=!0;const i=Yu.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:i,selectionSource:"code.jump",pinned:t}},this._editor).then((e=>{if(this._ignoreModelChangeEvent=!1,e&&this._widget)if(this._editor===e)this._widget.show(i),this._widget.focusOnReferenceTree();else{const t=H0.get(e),n=this._model.clone();this.closeWidget(),e.focus(),t?.toggleWidget(i,hi((e=>Promise.resolve(n))),this._peekMode??!1)}else this.closeWidget()}),(e=>{this._ignoreModelChangeEvent=!1,Ie(e)}))}openReference(e,t,i){t||this.closeWidget();const{uri:n,range:o}=e;this._editorService.openCodeEditor({resource:n,options:{selection:o,selectionSource:"code.jump",pinned:i}},this._editor,t)}};function j0(e,t){const i=aY(e);if(!i)return;const n=K0.get(i);n&&t(n)}K0=H0=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([z0(2,eu),z0(3,sc),z0(4,lO),z0(5,nc),z0(6,Sq),z0(7,up)],K0),lu.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:De(2089,60),when:Ac.or(U0,xY.inPeekEditor),handler(e){j0(e,(e=>{e.changeFocusBetweenPreviewAndReferences()}))}}),lu.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:Ac.or(U0,xY.inPeekEditor),handler(e){j0(e,(e=>{e.goToNextOrPreviousReference(!0)}))}}),lu.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:Ac.or(U0,xY.inPeekEditor),handler(e){j0(e,(e=>{e.goToNextOrPreviousReference(!1)}))}}),fc.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference"),fc.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference"),fc.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch"),fc.registerCommand("closeReferenceSearch",(e=>j0(e,(e=>e.closeWidget())))),lu.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:Ac.and(xY.inPeekEditor,Ac.not("config.editor.stablePeek"))}),lu.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:Ac.and(U0,Ac.not("config.editor.stablePeek"),Ac.or(Xu.editorTextFocus,eJ.negate()))}),lu.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:Ac.and(U0,lJ,pJ.negate(),fJ.negate()),handler(e){const t=e.get(nJ),i=t.lastFocusedList?.getFocus();Array.isArray(i)&&i[0]instanceof s0&&j0(e,(e=>e.revealReference(i[0])))}}),lu.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:Ac.and(U0,lJ,pJ.negate(),fJ.negate()),handler(e){const t=e.get(nJ),i=t.lastFocusedList?.getFocus();Array.isArray(i)&&i[0]instanceof s0&&j0(e,(e=>e.openReference(i[0],!0,!0)))}}),fc.registerCommand("openReference",(e=>{const t=e.get(nJ),i=t.lastFocusedList?.getFocus();Array.isArray(i)&&i[0]instanceof s0&&j0(e,(e=>e.openReference(i[0],!1,!0)))}));var q0=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},$0=function(e,t){return function(i,n){t(i,n,e)}};const G0=new Jc("hasSymbols",!1,y(1090,"Whether there are symbol locations that can be navigated via keyboard-only.")),Z0=oc("ISymbolNavigationService");let Y0=class{constructor(e,t,i,n){this._editorService=t,this._notificationService=i,this._keybindingService=n,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=G0.bindTo(e)}reset(){this._ctxHasSymbols.reset(),this._currentState?.dispose(),this._currentMessage?.close(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1)return void this.reset();this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new Q0(this._editorService),n=i.onDidChange((e=>{if(this._ignoreEditorChange)return;const i=this._editorService.getActiveCodeEditor();if(!i)return;const n=i.getModel(),o=i.getPosition();if(!n||!o)return;let s=!1,r=!1;for(const e of t.references)if(Ph(e.uri,n.uri))s=!0,r=r||Yu.containsPosition(e.range,o);else if(s)break;s&&r||this.reset()}));this._currentState=Nt(i,n)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:Yu.collapseToStart(t.range),selectionRevealType:3}},e).finally((()=>{this._ignoreEditorChange=!1}))}_showMessage(){this._currentMessage?.close();const e=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),t=e?y(1091,"Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,e.getLabel()):y(1092,"Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(t)}};Y0=q0([$0(0,eu),$0(1,sc),$0(2,lO),$0(3,ER)],Y0),wp(Z0,Y0,1),Vu(new class extends Ou{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:G0,kbOpts:{weight:100,primary:70}})}runEditorCommand(e,t){return e.get(Z0).revealNext(t)}}),lu.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:G0,primary:9,handler(e){e.get(Z0).reset()}});let Q0=class{constructor(e){this._listener=new Map,this._disposables=new Mt,this._onDidChange=new Zt,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),Et(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Nt(e.onDidChangeCursorPosition((t=>this._onDidChange.fire({editor:e}))),e.onDidChangeModelContent((t=>this._onDidChange.fire({editor:e})))))}_onDidRemoveEditor(e){this._listener.get(e)?.dispose(),this._listener.delete(e)}};function X0(e,t){return t.uri.scheme===e.uri.scheme||!ko(t.uri,So.walkThroughSnippet,So.vscodeChatCodeBlock,So.vscodeChatCodeCompareBlock)}async function J0(e,t,i,n,o){const s=i.ordered(e,n).map((i=>Promise.resolve(o(i,e,t)).then(void 0,(e=>{Te(e)}))));return as((await Promise.all(s)).flat()).filter((t=>X0(e,t)))}function e1(e,t,i,n,o){return J0(t,i,e,n,((e,t,i)=>e.provideDefinition(t,i,o)))}function t1(e,t,i,n,o){return J0(t,i,e,n,((e,t,i)=>e.provideDeclaration(t,i,o)))}function i1(e,t,i,n,o){return J0(t,i,e,n,((e,t,i)=>e.provideImplementation(t,i,o)))}function n1(e,t,i,n,o){return J0(t,i,e,n,((e,t,i)=>e.provideTypeDefinition(t,i,o)))}function o1(e,t,i,n,o,s){return J0(t,i,e,o,(async(e,t,i)=>{const o=(await e.provideReferences(t,i,{includeDeclaration:!0},s))?.filter((e=>X0(t,e)));if(!n||!o||2!==o.length)return o;const r=(await e.provideReferences(t,i,{includeDeclaration:!1},s))?.filter((e=>X0(t,e)));return r&&1===r.length?r:o}))}async function s1(e){const t=await e(),i=new l0(t,""),n=i.references.map((e=>e.link));return i.dispose(),n}Q0=q0([$0(0,sc)],Q0),Wu("_executeDefinitionProvider",((e,t,i)=>{const n=e1(e.get(BD).definitionProvider,t,i,!1,oi.None);return s1((()=>n))})),Wu("_executeDefinitionProvider_recursive",((e,t,i)=>{const n=e1(e.get(BD).definitionProvider,t,i,!0,oi.None);return s1((()=>n))})),Wu("_executeTypeDefinitionProvider",((e,t,i)=>{const n=n1(e.get(BD).typeDefinitionProvider,t,i,!1,oi.None);return s1((()=>n))})),Wu("_executeTypeDefinitionProvider_recursive",((e,t,i)=>{const n=n1(e.get(BD).typeDefinitionProvider,t,i,!0,oi.None);return s1((()=>n))})),Wu("_executeDeclarationProvider",((e,t,i)=>{const n=t1(e.get(BD).declarationProvider,t,i,!1,oi.None);return s1((()=>n))})),Wu("_executeDeclarationProvider_recursive",((e,t,i)=>{const n=t1(e.get(BD).declarationProvider,t,i,!0,oi.None);return s1((()=>n))})),Wu("_executeReferenceProvider",((e,t,i)=>{const n=o1(e.get(BD).referenceProvider,t,i,!1,!1,oi.None);return s1((()=>n))})),Wu("_executeReferenceProvider_recursive",((e,t,i)=>{const n=o1(e.get(BD).referenceProvider,t,i,!1,!0,oi.None);return s1((()=>n))})),Wu("_executeImplementationProvider",((e,t,i)=>{const n=i1(e.get(BD).implementationProvider,t,i,!1,oi.None);return s1((()=>n))})),Wu("_executeImplementationProvider_recursive",((e,t,i)=>{const n=i1(e.get(BD).implementationProvider,t,i,!0,oi.None);return s1((()=>n))})),fu.appendMenuItem(gu.EditorContext,{submenu:gu.EditorContextPeek,title:y(1033,"Peek"),group:"navigation",order:100});class r1{static is(e){return!(!e||"object"!=typeof e)&&(e instanceof r1||!(!rc.isIPosition(e.position)||!e.model))}constructor(e,t){this.model=e,this.position=t}}class a1 extends Bu{static{this._allSymbolNavigationCommands=new Map}static{this._activeAlternativeCommands=new Set}static all(){return a1._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of Ct.wrap(t.menu))i.id!==gu.EditorContext&&i.id!==gu.EditorContextPeek||(i.when=Ac.and(e.precondition,i.when));return t}constructor(e,t){super(a1._patchConfig(t)),this.configuration=e,a1._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,n){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(lO),s=e.get(sc),r=e.get(wD),a=e.get(Z0),l=e.get(BD),d=e.get(nc),h=t.getModel(),c=t.getPosition(),u=r1.is(i)?i:new r1(h,c),g=new UD(t,5),p=ci(this._getLocationModel(l,u.model,u.position,g.token),g.token).then((async e=>{if(!e||g.token.isCancellationRequested)return;let o;if(Yl(e.ariaMessage),e.referenceAt(h.uri,c)){const e=this._getAlternativeCommand(t);void 0!==e&&!a1._activeAlternativeCommands.has(e)&&a1._allSymbolNavigationCommands.has(e)&&(o=a1._allSymbolNavigationCommands.get(e))}const r=e.references.length;if(0===r){if(!this.configuration.muteMessage){const e=h.getWordAtPosition(c);uT.get(t)?.showMessage(this._getNoResultFoundMessage(e),c)}}else{if(1!==r||!o)return this._onResult(s,a,t,e,n);a1._activeAlternativeCommands.add(this.desc.id),d.invokeFunction((e=>o.runEditorCommand(e,t,i,n).finally((()=>{a1._activeAlternativeCommands.delete(this.desc.id)}))))}}),(e=>{o.error(e)})).finally((()=>{g.dispose()}));return r.showWhile(p,250),p}async _onResult(e,t,i,n,o){const s=this._getGoToPreference(i);if(i instanceof rY||!(this.configuration.openInPeek||"peek"===s&&n.references.length>1)){const r=n.firstReference(),a=n.references.length>1&&"gotoAndPeek"===s,l=await this._openReference(i,e,r,this.configuration.openToSide,!a);a&&l?this._openInPeek(l,n,o):n.dispose(),"goto"===s&&t.put(r)}else this._openInPeek(i,n,o)}async _openReference(e,t,i,n,o){let s;var r;if((r=i)&&uo.isUri(r.uri)&&Yu.isIRange(r.range)&&(Yu.isIRange(r.originSelectionRange)||Yu.isIRange(r.targetSelectionRange))&&(s=i.targetSelectionRange),s||(s=i.range),!s)return;const a=await t.openCodeEditor({resource:i.uri,options:{selection:Yu.collapseToStart(s),selectionRevealType:3,selectionSource:"code.jump"}},e,n);if(a){if(o){const e=a.getModel(),t=a.createDecorationsCollection([{range:s,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout((()=>{a.getModel()===e&&t.clear()}),350)}return a}}_openInPeek(e,t,i){const n=K0.get(e);n&&e.hasModel()?n.toggleWidget(i??e.getSelection(),hi((e=>Promise.resolve(t))),this.configuration.openInPeek):t.dispose()}}class l1 extends a1{async _getLocationModel(e,t,i,n){return new l0(await e1(e.definitionProvider,t,i,!1,n),y(1034,"Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?y(1035,"No definition found for '{0}'",e.word):y(1036,"No definition found")}_getAlternativeCommand(e){return e.getOption(67).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(67).multipleDefinitions}}wu(class e extends l1{static{this.id="editor.action.revealDefinition"}constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:e.id,title:{...x(1060,"Go to Definition"),mnemonicTitle:y(1037,"Go to &&Definition")},precondition:Xu.hasDefinitionProvider,keybinding:[{when:Xu.editorTextFocus,primary:70,weight:100},{when:Ac.and(Xu.editorTextFocus,XX),primary:2118,weight:100}],menu:[{id:gu.EditorContext,group:"navigation",order:1.1},{id:gu.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),fc.registerCommandAlias("editor.action.goToDeclaration",e.id)}}),wu(class e extends l1{static{this.id="editor.action.revealDefinitionAside"}constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:e.id,title:x(1061,"Open Definition to the Side"),precondition:Ac.and(Xu.hasDefinitionProvider,Xu.isInEmbeddedEditor.toNegated()),keybinding:[{when:Xu.editorTextFocus,primary:De(2089,70),weight:100},{when:Ac.and(Xu.editorTextFocus,XX),primary:De(2089,2118),weight:100}]}),fc.registerCommandAlias("editor.action.openDeclarationToTheSide",e.id)}}),wu(class e extends l1{static{this.id="editor.action.peekDefinition"}constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:e.id,title:x(1062,"Peek Definition"),precondition:Ac.and(Xu.hasDefinitionProvider,xY.notInPeekEditor,Xu.isInEmbeddedEditor.toNegated()),keybinding:{when:Xu.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:gu.EditorContextPeek,group:"peek",order:2}}),fc.registerCommandAlias("editor.action.previewDeclaration",e.id)}});class d1 extends a1{async _getLocationModel(e,t,i,n){return new l0(await t1(e.declarationProvider,t,i,!1,n),y(1038,"Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?y(1039,"No declaration found for '{0}'",e.word):y(1040,"No declaration found")}_getAlternativeCommand(e){return e.getOption(67).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(67).multipleDeclarations}}wu(class e extends d1{static{this.id="editor.action.revealDeclaration"}constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:e.id,title:{...x(1063,"Go to Declaration"),mnemonicTitle:y(1041,"Go to &&Declaration")},precondition:Ac.and(Xu.hasDeclarationProvider,Xu.isInEmbeddedEditor.toNegated()),menu:[{id:gu.EditorContext,group:"navigation",order:1.3},{id:gu.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?y(1042,"No declaration found for '{0}'",e.word):y(1043,"No declaration found")}}),wu(class extends d1{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:x(1064,"Peek Declaration"),precondition:Ac.and(Xu.hasDeclarationProvider,xY.notInPeekEditor,Xu.isInEmbeddedEditor.toNegated()),menu:{id:gu.EditorContextPeek,group:"peek",order:3}})}});class h1 extends a1{async _getLocationModel(e,t,i,n){return new l0(await n1(e.typeDefinitionProvider,t,i,!1,n),y(1044,"Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?y(1045,"No type definition found for '{0}'",e.word):y(1046,"No type definition found")}_getAlternativeCommand(e){return e.getOption(67).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(67).multipleTypeDefinitions}}wu(class e extends h1{static{this.ID="editor.action.goToTypeDefinition"}constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:e.ID,title:{...x(1065,"Go to Type Definition"),mnemonicTitle:y(1047,"Go to &&Type Definition")},precondition:Xu.hasTypeDefinitionProvider,keybinding:{when:Xu.editorTextFocus,primary:0,weight:100},menu:[{id:gu.EditorContext,group:"navigation",order:1.4},{id:gu.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}}),wu(class e extends h1{static{this.ID="editor.action.peekTypeDefinition"}constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:e.ID,title:x(1066,"Peek Type Definition"),precondition:Ac.and(Xu.hasTypeDefinitionProvider,xY.notInPeekEditor,Xu.isInEmbeddedEditor.toNegated()),menu:{id:gu.EditorContextPeek,group:"peek",order:4}})}});class c1 extends a1{async _getLocationModel(e,t,i,n){return new l0(await i1(e.implementationProvider,t,i,!1,n),y(1048,"Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?y(1049,"No implementation found for '{0}'",e.word):y(1050,"No implementation found")}_getAlternativeCommand(e){return e.getOption(67).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(67).multipleImplementations}}wu(class e extends c1{static{this.ID="editor.action.goToImplementation"}constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:e.ID,title:{...x(1067,"Go to Implementations"),mnemonicTitle:y(1051,"Go to &&Implementations")},precondition:Xu.hasImplementationProvider,keybinding:{when:Xu.editorTextFocus,primary:2118,weight:100},menu:[{id:gu.EditorContext,group:"navigation",order:1.45},{id:gu.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}}),wu(class e extends c1{static{this.ID="editor.action.peekImplementation"}constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:e.ID,title:x(1068,"Peek Implementations"),precondition:Ac.and(Xu.hasImplementationProvider,xY.notInPeekEditor,Xu.isInEmbeddedEditor.toNegated()),keybinding:{when:Xu.editorTextFocus,primary:3142,weight:100},menu:{id:gu.EditorContextPeek,group:"peek",order:5}})}});class u1 extends a1{_getNoResultFoundMessage(e){return e?y(1052,"No references found for '{0}'",e.word):y(1053,"No references found")}_getAlternativeCommand(e){return e.getOption(67).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(67).multipleReferences}}wu(class extends u1{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{...x(1069,"Go to References"),mnemonicTitle:y(1054,"Go to &&References")},precondition:Ac.and(Xu.hasReferenceProvider,xY.notInPeekEditor,Xu.isInEmbeddedEditor.toNegated()),keybinding:{when:Xu.editorTextFocus,primary:1094,weight:100},menu:[{id:gu.EditorContext,group:"navigation",order:1.45},{id:gu.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,i,n){return new l0(await o1(e.referenceProvider,t,i,!0,!1,n),y(1055,"References"))}}),wu(class extends u1{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:x(1070,"Peek References"),precondition:Ac.and(Xu.hasReferenceProvider,xY.notInPeekEditor,Xu.isInEmbeddedEditor.toNegated()),menu:{id:gu.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,n){return new l0(await o1(e.referenceProvider,t,i,!1,!1,n),y(1056,"References"))}});class g1 extends a1{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:x(1071,"Go to Any Symbol"),precondition:Ac.and(xY.notInPeekEditor,Xu.isInEmbeddedEditor.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,n){return new l0(this._references,y(1057,"Locations"))}_getNoResultFoundMessage(e){return e&&y(1058,"No results for '{0}'",e.word)||""}_getGoToPreference(e){return this._gotoMultipleBehaviour??e.getOption(67).multipleReferences}_getAlternativeCommand(){}}async function p1(e,t,i,n){const o=e.get(lc),s=e.get(DR),r=e.get(mc),a=e.get(nc),l=e.get(lO);if(await n.item.resolve(oi.None),!n.part.location)return;const d=n.part.location,h=[],c=new Set(fu.getMenuItems(gu.EditorContext).map((e=>uu(e)?e.command.id:_C())));for(const e of a1.all())c.has(e.desc.id)&&h.push(new dc(e.desc.id,vu.label(e.desc,{renderShortTitle:!0}),void 0,!0,(async()=>{const i=await o.createModelReference(d.uri);try{const o=new r1(i.object.textEditorModel,Yu.getStartPosition(d.range)),s=n.item.anchor.range;await a.invokeFunction(e.runEditorCommand.bind(e),t,o,s)}finally{i.dispose()}})));if(n.part.command){const{command:e}=n.part;h.push(new cc),h.push(new dc(e.id,e.title,void 0,!0,(async()=>{try{await r.executeCommand(e.id,...e.arguments??[])}catch(e){l.notify({severity:aO.Error,source:n.item.provider.displayName,message:e})}})))}const u=t.getOption(144);s.showContextMenu({domForShadowRoot:u?t.getDomNode()??void 0:void 0,getAnchor:()=>{const e=Na(i);return{x:e.left,y:e.top+e.height+8}},getActions:()=>h,onHide:()=>{t.focus()},autoSelectFirstItem:!0})}async function m1(e,t,i,n){const o=e.get(lc),s=await o.createModelReference(n.uri);await i.invokeWithinContext((async e=>{const o=t.hasSideBySideModifier,r=e.get(eu),a=xY.inPeekEditor.getValue(r),l=!o&&i.getOption(101)&&!a;return new l1({openToSide:o,openInPeek:l,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(e,new r1(s.object.textEditorModel,Yu.getStartPosition(n.range)),Yu.lift(n.range))})),s.dispose()}fc.registerCommand({id:"editor.action.goToLocations",metadata:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:uo},{name:"position",description:"The position at which to start",constraint:rc.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:async(e,t,i,n,o,s,r)=>{_t(uo.isUri(t)),_t(rc.isIPosition(i)),_t(Array.isArray(n)),_t(void 0===o||"string"==typeof o),_t(void 0===r||"boolean"==typeof r);const a=e.get(sc),l=await a.openCodeEditor({resource:t},a.getFocusedCodeEditor());if(iY(l))return l.setPosition(i),l.revealPositionInCenterIfOutsideViewport(i,0),l.invokeWithinContext((e=>{const t=new class extends g1{_getNoResultFoundMessage(e){return s||super._getNoResultFoundMessage(e)}}({muteMessage:!Boolean(s),openInPeek:Boolean(r),openToSide:!1},n,o);e.get(nc).invokeFunction(t.run.bind(t),l)}))}}),fc.registerCommand({id:"editor.action.peekLocations",metadata:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:uo},{name:"position",description:"The position at which to start",constraint:rc.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"}]},handler:async(e,t,i,n,o)=>{e.get(mc).executeCommand("editor.action.goToLocations",t,i,n,o,void 0,!0)}}),fc.registerCommand({id:"editor.action.findReferences",handler:(e,t,i)=>{_t(uo.isUri(t)),_t(rc.isIPosition(i));const n=e.get(BD),o=e.get(sc);return o.openCodeEditor({resource:t},o.getFocusedCodeEditor()).then((e=>{if(!iY(e)||!e.hasModel())return;const t=K0.get(e);if(!t)return;const o=hi((t=>o1(n.referenceProvider,e.getModel(),rc.lift(i),!1,!1,t).then((e=>new l0(e,y(1059,"References")))))),s=new Yu(i.lineNumber,i.column,i.lineNumber,i.column);return Promise.resolve(t.toggleWidget(s,o,!1))}))}}),fc.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var f1,_1=function(e,t){return function(i,n){t(i,n,e)}};class v1{constructor(){this._entries=new ad(50)}get(e){const t=v1._key(e);return this._entries.get(t)}set(e,t){const i=v1._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const b1=oc("IInlayHintsCache");wp(b1,v1,1);class w1{constructor(e,t){this.item=e,this.index=t}get part(){const e=this.item.hint.label;return"string"==typeof e?{label:e}:e[this.index]}}class C1{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}let y1=class{static{f1=this}static{this.ID="editor.contrib.InlayHints"}static{this._MAX_DECORATORS=1500}static{this._whitespaceData={}}static get(e){return e.getContribution(f1.ID)??void 0}constructor(e,t,i,n,o,s,r){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=n,this._commandService=o,this._notificationService=s,this._instaService=r,this._disposables=new Mt,this._sessionDisposables=new Mt,this._decorationsMetadata=new Map,this._activeRenderMode=0,this._ruleFactory=this._disposables.add(new kB(this._editor)),this._debounceInfo=i.for(t.inlayHintsProvider,"InlayHint",{min:25}),this._disposables.add(t.inlayHintsProvider.onDidChange((()=>this._update()))),this._disposables.add(e.onDidChangeModel((()=>this._update()))),this._disposables.add(e.onDidChangeModelLanguage((()=>this._update()))),this._disposables.add(e.onDidChangeConfiguration((e=>{e.hasChanged(159)&&this._update()}))),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(159);if("off"===e.enabled)return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;if("on"===e.enabled)this._activeRenderMode=0;else{let t,i;"onUnlessPressed"===e.enabled?(t=0,i=1):(t=1,i=0),this._activeRenderMode=t,this._sessionDisposables.add(gl.getInstance().event((e=>{if(!this._editor.hasModel())return;const n=e.altKey&&e.ctrlKey&&!e.shiftKey&&!e.metaKey?i:t;if(n!==this._activeRenderMode){this._activeRenderMode=n;const e=this._editor.getModel(),t=this._copyInlayHintsWithCurrentAnchor(e);this._updateHintsDecorators([e.getFullModelRange()],t),s.schedule(0)}})))}const i=this._inlayHintsCache.get(t);let n;i&&this._updateHintsDecorators([t.getFullModelRange()],i),this._sessionDisposables.add(Tt((()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)})));const o=new Set,s=new Ci((async()=>{const e=Date.now();n?.dispose(!0),n=new ri;const i=t.onWillDispose((()=>n?.cancel()));try{const i=n.token,r=await tY.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),i);if(s.delay=this._debounceInfo.update(t,Date.now()-e),i.isCancellationRequested)return void r.dispose();for(const e of r.provider)"function"!=typeof e.onDidChangeInlayHints||o.has(e)||(o.add(e),this._sessionDisposables.add(e.onDidChangeInlayHints((()=>{s.isScheduled()||s.schedule()}))));this._sessionDisposables.add(r),this._updateHintsDecorators(r.ranges,r.items),this._cacheHintsForFastRestore(t)}catch(e){Ie(e)}finally{n.dispose(),i.dispose()}}),this._debounceInfo.get(t));this._sessionDisposables.add(s),this._sessionDisposables.add(Tt((()=>n?.dispose(!0)))),s.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange((e=>{!e.scrollTopChanged&&s.isScheduled()||s.schedule()})));const r=this._sessionDisposables.add(new Rt);this._sessionDisposables.add(this._editor.onDidChangeModelContent((e=>{n?.cancel();const t=Math.max(s.delay,800);this._cursorInfo={position:this._editor.getPosition(),notEarlierThan:Date.now()+t},r.value=fi((()=>s.schedule(0)),t),s.schedule()}))),this._sessionDisposables.add(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(159)&&s.schedule()}))),this._sessionDisposables.add(this._installDblClickGesture((()=>s.schedule(0)))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new Mt,t=e.add(new XZ(this._editor)),i=new Mt;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown((e=>{const[t]=e,n=this._getInlayHintLabelPart(t),o=this._editor.getModel();if(!n||!o)return void i.clear();const s=new ri;i.add(Tt((()=>s.dispose(!0)))),n.item.resolve(s.token),this._activeInlayHintPart=n.part.command||n.part.location?new C1(n,t.hasTriggerModifier):void 0;const r=o.validatePosition(n.item.hint.position).lineNumber,a=new Yu(r,1,r,o.getLineMaxColumn(r)),l=this._getInlineHintsForRange(a);this._updateHintsDecorators([a],l),i.add(Tt((()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([a],l)})))}))),e.add(t.onCancel((()=>i.clear()))),e.add(t.onExecute((async e=>{const t=this._getInlayHintLabelPart(e);if(t){const i=t.part;i.location?this._instaService.invokeFunction(m1,e,this._editor,i.location):ZS.is(i.command)&&await this._invokeCommand(i.command,t.item)}}))),e}_getInlineHintsForRange(e){const t=new Set;for(const i of this._decorationsMetadata.values())e.containsRange(i.item.anchor.range)&&t.add(i.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp((async t=>{if(2!==t.event.detail)return;const i=this._getInlayHintLabelPart(t);if(i&&(t.event.preventDefault(),await i.item.resolve(oi.None),hs(i.item.hint.textEdits))){const t=i.item.hint.textEdits.map((e=>qZ.replace(Yu.lift(e.range),e.text)));this._editor.executeEdits("inlayHint.default",t),e()}}))}_installContextMenu(){return this._editor.onContextMenu((async e=>{if(!qa(e.event.target))return;const t=this._getInlayHintLabelPart(e);t&&await this._instaService.invokeFunction(p1,this._editor,e.event.target,t)}))}_getInlayHintLabelPart(e){if(6!==e.target.type)return;const t=e.target.detail.injectedText?.options;return t instanceof vk&&t?.attachedData instanceof w1?t.attachedData:void 0}async _invokeCommand(e,t){try{await this._commandService.executeCommand(e.id,...e.arguments??[])}catch(e){this._notificationService.notify({severity:aO.Error,source:t.provider.displayName,message:e})}}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[i,n]of this._decorationsMetadata){if(t.has(n.item))continue;const o=e.getDecorationRange(i);if(o){const e=new JZ(o,n.item.anchor.direction),i=n.item.with({anchor:e});t.set(n.item,i)}}return Array.from(t.values())}_getHintsRanges(){const e=this._editor.getModel(),t=this._editor.getVisibleRangesPlusViewportAboveBelow(),i=[];for(const n of t.sort(Yu.compareRangesUsingStarts)){const t=e.validateRange(new Yu(n.startLineNumber-30,n.startColumn,n.endLineNumber+30,n.endColumn));0!==i.length&&Yu.areIntersectingOrTouching(i[i.length-1],t)?i[i.length-1]=Yu.plusRange(i[i.length-1],t):i.push(t)}return i}_updateHintsDecorators(e,t){const i=new Map;if(this._cursorInfo&&this._cursorInfo.notEarlierThan>Date.now()&&e.some((e=>e.containsPosition(this._cursorInfo.position)))){const{position:e}=this._cursorInfo;this._cursorInfo=void 0;const n=new Map;for(const t of this._editor.getLineDecorations(e.lineNumber)??[]){const i=this._decorationsMetadata.get(t.id);if(t.range.startColumn>e.column)continue;const o=i?.decoration.options[i.item.anchor.direction];if(o&&o.attachedData!==f1._whitespaceData){const e=n.get(i.item)??0;n.set(i.item,e+o.content.length)}}const o=t.filter((t=>t.anchor.range.startLineNumber===e.lineNumber&&t.anchor.range.endColumn<=e.column)),s=Array.from(n.values());let r;for(;;){const e=o.shift(),t=s.shift();if(!t&&!e)break;if(e)i.set(e,t??0),r=e;else if(r&&t){let e=i.get(r);e+=t,e+=s.reduce(((e,t)=>e+t),0),s.length=0;break}}}const n=[],o=(e,t,i,o,s)=>{const r={content:i,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:t.className,cursorStops:o,attachedData:s};n.push({item:e,classNameRef:t,decoration:{range:e.anchor.range,options:{description:"InlayHint",showIfCollapsed:e.anchor.range.isEmpty(),collapseOnReplaceEdit:!e.anchor.range.isEmpty(),stickiness:0,[e.anchor.direction]:0===this._activeRenderMode?r:void 0}}})},s=(e,t)=>{const i=this._ruleFactory.createClassNameRef({width:(r/3|0)+"px",display:"inline-block"});o(e,i," ",t?mg.Right:mg.None,f1._whitespaceData)},{fontSize:r,fontFamily:a,padding:l,isUniform:d}=this._getLayoutInfo(),h=this._editor.getOption(159).maximumLength,c="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(c,a);let u={line:0,totalLen:0};for(let e=0;e<t.length;e++){const a=t[e];if(u.line!==a.anchor.range.startLineNumber&&(u={line:a.anchor.range.startLineNumber,totalLen:0}),h&&u.totalLen>h)continue;a.hint.paddingLeft&&s(a,!1);const g="string"==typeof a.hint.label?[{label:a.hint.label}]:a.hint.label,p=i.get(a);let m=0;for(let e=0;e<g.length;e++){const t=g[e],i=0===e,n=e===g.length-1,s={fontSize:`${r}px`,fontFamily:`var(${c}), ${fP.fontFamily}`,verticalAlign:d?"baseline":"middle",unicodeBidi:"isolate"};hs(a.hint.textEdits)&&(s.cursor="default"),this._fillInColors(s,a.hint),(t.command||t.location)&&this._activeInlayHintPart?.part.item===a&&this._activeInlayHintPart.part.index===e&&(s.textDecoration="underline",this._activeInlayHintPart.hasTriggerModifier&&(s.color=rw(w_),s.cursor="pointer"));let f=t.label;u.totalLen+=f.length;let _=!1;const v=0!==h?u.totalLen-h:0;if(v>0&&(f=f.slice(0,-v)+"…",_=!0),m+=f.length,void 0!==p){const e=m-p;e>=0&&(m-=e,f=f.slice(0,-(1+e))+"…",_=!0)}if(l&&(i&&(n||_)?(s.padding=`1px ${0|Math.max(1,r/4)}px`,s.borderRadius=(r/4|0)+"px"):i?(s.padding=`1px 0 1px ${0|Math.max(1,r/4)}px`,s.borderRadius=`${r/4|0}px 0 0 ${r/4|0}px`):n||_?(s.padding=`1px ${0|Math.max(1,r/4)}px 1px 0`,s.borderRadius=`0 ${r/4|0}px ${r/4|0}px 0`):s.padding="1px 0 1px 0"),o(a,this._ruleFactory.createClassNameRef(s),f.replace(/[ \t]/g," "),n&&!a.hint.paddingRight?mg.Right:mg.None,new w1(a,e)),_)break}if(void 0!==p&&m<p){const e=p-m;o(a,this._ruleFactory.createClassNameRef({})," ".repeat(e),mg.None)}if(a.hint.paddingRight&&s(a,!0),n.length>f1._MAX_DECORATORS)break}const g=[];for(const[t,i]of this._decorationsMetadata){const n=this._editor.getModel()?.getDecorationRange(t);n&&e.some((e=>e.containsRange(n)))&&(g.push(t),i.classNameRef.dispose(),this._decorationsMetadata.delete(t))}const p=mq.capture(this._editor);this._editor.changeDecorations((e=>{const t=e.deltaDecorations(g,n.map((e=>e.decoration)));for(let e=0;e<t.length;e++){const i=n[e];this._decorationsMetadata.set(t[e],i)}})),p.restore(this._editor)}_fillInColors(e,t){t.kind===YS.Parameter?(e.backgroundColor=rw(B_),e.color=rw(F_)):t.kind===YS.Type?(e.backgroundColor=rw(P_),e.color=rw(O_)):(e.backgroundColor=rw(R_),e.color=rw(A_))}_getLayoutInfo(){const e=this._editor.getOption(159),t=e.padding,i=this._editor.getOption(61),n=this._editor.getOption(58);let o=e.fontSize;(!o||o<5||o>i)&&(o=i);const s=e.fontFamily||n;return{fontSize:o,fontFamily:s,padding:t,isUniform:!t&&s===n&&o===i}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}};y1=f1=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([_1(1,BD),_1(2,Bq),_1(3,b1),_1(4,mc),_1(5,lO),_1(6,nc)],y1),fc.registerCommand("_executeInlayHintProvider",(async(e,...t)=>{const[i,n]=t;_t(uo.isUri(i)),_t(Yu.isIRange(n));const{inlayHintsProvider:o}=e.get(BD),s=await e.get(lc).createModelReference(i);try{const e=await tY.create(o,s.object.textEditorModel,[Yu.lift(n)],oi.None),t=e.items.map((e=>e.hint));return setTimeout((()=>e.dispose()),0),t}finally{s.dispose()}}));var S1=function(e,t){return function(i,n){t(i,n,e)}};class x1 extends Zq{constructor(e,t,i,n){super(10,t,e.item.anchor.range,i,n,!0),this.part=e}}let k1=class extends bZ{constructor(e,t,i,n,o,s,r,a,l){super(e,t,i,s,a,n,o,l),this._resolverService=r,this.hoverOrdinal=6}suggestHoverAnchor(e){if(!y1.get(this._editor))return null;if(6!==e.target.type)return null;const t=e.target.detail.injectedText?.options;return t instanceof vk&&t.attachedData instanceof w1?new x1(t.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i,n){return e instanceof x1?new Ii((async t=>{const{part:i}=e;if(await i.item.resolve(n),n.isCancellationRequested)return;let o,s;if("string"==typeof i.item.hint.tooltip?o=(new Gh).appendText(i.item.hint.tooltip):i.item.hint.tooltip&&(o=i.item.hint.tooltip),o&&t.emitOne(new _Z(this,e.range,[o],!1,0)),hs(i.item.hint.textEdits)&&t.emitOne(new _Z(this,e.range,[(new Gh).appendText(y(1157,"Double-click to insert"))],!1,10001)),"string"==typeof i.part.tooltip?s=(new Gh).appendText(i.part.tooltip):i.part.tooltip&&(s=i.part.tooltip),s&&t.emitOne(new _Z(this,e.range,[s],!1,1)),i.part.location||i.part.command){let n;const o="altKey"===this._editor.getOption(86)?$?y(1158,"cmd + click"):y(1159,"ctrl + click"):$?y(1160,"option + click"):y(1161,"alt + click");i.part.location&&i.part.command?n=(new Gh).appendText(y(1162,"Go to Definition ({0}), right click for more",o)):i.part.location?n=(new Gh).appendText(y(1163,"Go to Definition ({0})",o)):i.part.command&&(n=new Gh(`[${y(1164,"Execute Command")}](${r=i.part.command,Jh(r.id,...r.arguments??[]).toString()} "${i.part.command.title}") (${o})`,{isTrusted:!0})),n&&t.emitOne(new _Z(this,e.range,[n],!1,1e4))}var r;const a=this._resolveInlayHintLabelPartHover(i,n);for await(const e of a)t.emitOne(e)})):Ii.EMPTY}async*_resolveInlayHintLabelPartHover(e,t){if(!e.part.location)return;const{uri:i,range:n}=e.part.location,o=await this._resolverService.createModelReference(i);try{const i=o.object.textEditorModel;if(!this._languageFeaturesService.hoverProvider.has(i))return;for await(const o of cZ(this._languageFeaturesService.hoverProvider,i,new rc(n.startLineNumber,n.startColumn),t))Zh(o.hover.contents)||(yield new _Z(this,e.item.anchor.range,o.hover.contents,!1,2+o.ordinal))}finally{o.dispose()}}};k1=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([S1(1,Tg),S1(2,ZI),S1(3,ER),S1(4,oZ),S1(5,up),S1(6,lc),S1(7,BD),S1(8,mc)],k1);var L1,D1,E1=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},N1=function(e,t){return function(i,n){t(i,n,e)}};let I1=L1=class extends At{constructor(e,t,i,n,o,s){super();const r=t.hoverParts;this._renderedHoverParts=this._register(new M1(e,i,r,n,o,s));const a=t.options,l=a.anchor,{showAtPosition:d,showAtSecondaryPosition:h}=L1.computeHoverPositions(e,l.range,r);this.shouldAppearBeforeContent=r.some((e=>e.isBeforeContent)),this.showAtPosition=d,this.showAtSecondaryPosition=h,this.initialMousePosX=l.initialMousePosX,this.initialMousePosY=l.initialMousePosY,this.shouldFocus=a.shouldFocus,this.source=a.source}get domNode(){return this._renderedHoverParts.domNode}get domNodeHasChildren(){return this._renderedHoverParts.domNodeHasChildren}get focusedHoverPartIndex(){return this._renderedHoverParts.focusedHoverPartIndex}get hoverPartsCount(){return this._renderedHoverParts.hoverPartsCount}focusHoverPartWithIndex(e){this._renderedHoverParts.focusHoverPartWithIndex(e)}async updateHoverVerbosityLevel(e,t,i){this._renderedHoverParts.updateHoverVerbosityLevel(e,t,i)}isColorPickerVisible(){return this._renderedHoverParts.isColorPickerVisible()}static computeHoverPositions(e,t,i){let n=1;if(e.hasModel()){const i=e._getViewModel(),o=i.coordinatesConverter,s=o.convertModelRangeToViewRange(t),r=i.getLineMinColumn(s.startLineNumber),a=new rc(s.startLineNumber,r);n=o.convertViewPositionToModelPosition(a).column}const o=t.startLineNumber;let s,r,a,l=t.startColumn;for(const e of i){const t=e.range,i=t.startLineNumber===o,r=t.endLineNumber===o;if(i&&r){const e=t.startColumn,i=Math.min(l,e);l=Math.max(i,n)}e.forceShowAtRange&&(s=t)}if(s){const e=s.getStartPosition();r=e,a=e}else r=t.getStartPosition(),a=new rc(o,l);return{showAtPosition:r,showAtSecondaryPosition:a}}};I1=L1=E1([N1(4,ER),N1(5,oZ)],I1);class T1{constructor(e,t){this._statusBar=t,e.appendChild(this._statusBar.hoverElement)}get hoverElement(){return this._statusBar.hoverElement}get actions(){return this._statusBar.actions}dispose(){this._statusBar.dispose()}}let M1=class extends At{static{D1=this}static{this._DECORATION_OPTIONS=bk.register({description:"content-hover-highlight",className:"hoverHighlight"})}constructor(e,t,i,n,o,s){super(),this._renderedParts=[],this._focusedHoverPartIndex=-1,this._context=n,this._fragment=document.createDocumentFragment(),this._register(this._renderParts(t,i,n,o,s)),this._register(this._registerListenersOnRenderedParts()),this._register(this._createEditorDecorations(e,i)),this._updateMarkdownAndColorParticipantInfo(t)}_createEditorDecorations(e,t){if(0===t.length)return At.None;let i=t[0].range;for(const e of t){const t=e.range;i=Yu.plusRange(i,t)}const n=e.createDecorationsCollection();return n.set([{range:i,options:D1._DECORATION_OPTIONS}]),Tt((()=>{n.clear()}))}_renderParts(e,t,i,n,o){const s=new dZ(n,o),r={fragment:this._fragment,statusBar:s,...i},a=new Mt;a.add(s);for(const i of e){const e=this._renderHoverPartsForParticipant(t,i,r);a.add(e);for(const t of e.renderedHoverParts)this._renderedParts.push({type:"hoverPart",participant:i,hoverPart:t.hoverPart,hoverElement:t.hoverElement})}const l=this._renderStatusBar(this._fragment,s);return l&&(a.add(l),this._renderedParts.push({type:"statusBar",hoverElement:l.hoverElement,actions:l.actions})),a}_renderHoverPartsForParticipant(e,t,i){const n=e.filter((e=>e.owner===t));return n.length>0?t.renderHoverParts(i,n):new Yq([])}_renderStatusBar(e,t){if(t.hasContent)return new T1(e,t)}_registerListenersOnRenderedParts(){const e=new Mt;return this._renderedParts.forEach(((t,i)=>{const n=t.hoverElement;n.tabIndex=0,e.add(ga(n,Qa.FOCUS_IN,(e=>{e.stopPropagation(),this._focusedHoverPartIndex=i}))),e.add(ga(n,Qa.FOCUS_OUT,(e=>{e.stopPropagation(),this._focusedHoverPartIndex=-1})))})),e}_updateMarkdownAndColorParticipantInfo(e){const t=e.find((e=>e instanceof bZ&&!(e instanceof k1)));t&&(this._markdownHoverParticipant=t),this._colorHoverParticipant=e.find((e=>e instanceof jZ))}focusHoverPartWithIndex(e){e<0||e>=this._renderedParts.length||this._renderedParts[e].hoverElement.focus()}async updateHoverVerbosityLevel(e,t,i){if(!this._markdownHoverParticipant)return;let n;n=t>=0?{start:t,endExclusive:t+1}:this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);for(let t=n.start;t<n.endExclusive;t++){const i=this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant,t);if(void 0===i)continue;const n=await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(e,i);n&&(this._renderedParts[t]={type:"hoverPart",participant:this._markdownHoverParticipant,hoverPart:n.hoverPart,hoverElement:n.hoverElement})}i&&(t>=0?this.focusHoverPartWithIndex(t):this._context.focus()),this._context.onContentsChanged()}isColorPickerVisible(){return this._colorHoverParticipant?.isColorPickerVisible()??!1}_normalizedIndexToMarkdownHoverIndexRange(e,t){const i=this._renderedParts[t];if(!i||"hoverPart"!==i.type)return;if(i.participant!==e)return;const n=this._renderedParts.findIndex((t=>"hoverPart"===t.type&&t.participant===e));if(-1===n)throw new Ve;return t-n}_findRangeOfMarkdownHoverParts(e){const t=this._renderedParts.slice(),i=t.findIndex((t=>"hoverPart"===t.type&&t.participant===e)),n=t.reverse().findIndex((t=>"hoverPart"===t.type&&t.participant===e));return{start:i,endExclusive:(n>=0?t.length-n:n)+1}}get domNode(){return this._fragment}get domNodeHasChildren(){return this._fragment.hasChildNodes()}get focusedHoverPartIndex(){return this._focusedHoverPartIndex}get hoverPartsCount(){return this._renderedParts.length}};M1=D1=E1([N1(4,ER),N1(5,oZ)],M1);var A1=function(e,t){return function(i,n){t(i,n,e)}};let R1=class extends At{constructor(e,t,i,n){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._hoverService=n,this._currentResult=null,this._renderedContentHover=this._register(new Rt),this._onContentsChanged=this._register(new Zt),this.onContentsChanged=this._onContentsChanged.event,this._contentHoverWidget=this._register(this._instantiationService.createInstance(XG,this._editor)),this._participants=this._initializeHoverParticipants(),this._hoverOperation=this._register(new DG(this._editor,new eZ(this._editor,this._participants))),this._registerListeners()}_initializeHoverParticipants(){const e=[];for(const t of Qq.getAll()){const i=this._instantiationService.createInstance(t,this._editor);e.push(i)}return e.sort(((e,t)=>e.hoverOrdinal-t.hoverOrdinal)),this._register(this._contentHoverWidget.onDidResize((()=>{this._participants.forEach((e=>e.handleResize?.()))}))),this._register(this._contentHoverWidget.onDidScroll((e=>{this._participants.forEach((t=>t.handleScroll?.(e)))}))),this._register(this._contentHoverWidget.onContentsChanged((()=>{this._participants.forEach((e=>e.handleContentsChanged?.()))}))),e}_registerListeners(){this._register(this._hoverOperation.onResult((e=>{const t=e.hasLoadingMessage?this._addLoadingMessage(e):e.value;this._withResult(new tZ(t,e.isComplete,e.options))})));const e=this._contentHoverWidget.getDomNode();this._register(ma(e,"keydown",(e=>{e.equals(9)&&this.hide()}))),this._register(ma(e,"mouseleave",(e=>{this._onMouseLeave(e)}))),this._register(JS.onDidChange((()=>{this._contentHoverWidget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))),this._register(this._contentHoverWidget.onContentsChanged((()=>{this._onContentsChanged.fire()})))}_startShowingOrUpdateHover(e,t,i,n,o){if(!this._contentHoverWidget.position||!this._currentResult)return!!e&&(this._startHoverOperationIfNecessary(e,t,i,n,!1),!0);const s=this._editor.getOption(69).sticky,r=o&&this._contentHoverWidget.isMouseGettingCloser(o.event.posx,o.event.posy);return s&&r?(e&&this._startHoverOperationIfNecessary(e,t,i,n,!0),!0):e?!(!this._currentResult||!this._currentResult.options.anchor.equals(e))||(this._currentResult&&e.canAdoptVisibleHover(this._currentResult.options.anchor,this._contentHoverWidget.position)?(this._currentResult&&this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0)):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,n,o){if(this._hoverOperation.options&&this._hoverOperation.options.anchor.equals(e))return;this._hoverOperation.cancel();const s={anchor:e,source:i,shouldFocus:n,insistOnKeepingHoverVisible:o};this._hoverOperation.start(t,s)}_setCurrentResult(e){let t=e;this._currentResult!==t&&(t&&0===t.hoverParts.length&&(t=null),this._currentResult=t,this._currentResult?this._showHover(this._currentResult):this._hideHover())}_addLoadingMessage(e){for(const t of this._participants){if(!t.createLoadingMessage)continue;const i=t.createLoadingMessage(e.options.anchor);if(i)return e.value.slice(0).concat([i])}return e.value}_withResult(e){if(this._contentHoverWidget.position&&this._currentResult&&this._currentResult.isComplete||this._setCurrentResult(e),!e.isComplete)return;const t=0===e.hoverParts.length,i=e.options.insistOnKeepingHoverVisible;t&&i||this._setCurrentResult(e)}_showHover(e){const t=this._getHoverContext();this._renderedContentHover.value=new I1(this._editor,e,this._participants,t,this._keybindingService,this._hoverService),this._renderedContentHover.value.domNodeHasChildren?this._contentHoverWidget.show(this._renderedContentHover.value):this._renderedContentHover.clear()}_hideHover(){this._contentHoverWidget.hide(),this._participants.forEach((e=>e.handleHide?.()))}_getHoverContext(){return{hide:()=>{this.hide()},onContentsChanged:()=>{this._contentHoverWidget.handleContentsChanged()},setMinimumDimensions:e=>{this._contentHoverWidget.setMinimumDimensions(e)},focus:()=>this.focus()}}showsOrWillShow(e){if(this._contentHoverWidget.isResizing)return!0;const t=this._findHoverAnchorCandidates(e);if(!(t.length>0))return this._startShowingOrUpdateHover(null,0,0,!1,e);const i=t[0];return this._startShowingOrUpdateHover(i,0,0,!1,e)}_findHoverAnchorCandidates(e){const t=[];for(const i of this._participants){if(!i.suggestHoverAnchor)continue;const n=i.suggestHoverAnchor(e);n&&t.push(n)}const i=e.target;switch(i.type){case 6:t.push(new Gq(0,i.range,e.event.posx,e.event.posy));break;case 7:{const n=this._editor.getOption(59).typicalHalfwidthCharacterWidth/2;if(i.detail.isAfterLines||"number"!=typeof i.detail.horizontalDistanceToText||!(i.detail.horizontalDistanceToText<n))break;t.push(new Gq(0,i.range,e.event.posx,e.event.posy));break}}return t.sort(((e,t)=>t.priority-e.priority)),t}_onMouseLeave(e){const t=this._editor.getDomNode();(!t||!kG(t,e.x,e.y))&&this.hide()}startShowingAtRange(e,t,i,n){this._startShowingOrUpdateHover(new Gq(0,e,void 0,void 0),t,i,n,null)}async updateHoverVerbosityLevel(e,t,i){this._renderedContentHover.value?.updateHoverVerbosityLevel(e,t,i)}focusedHoverPartIndex(){return this._renderedContentHover.value?.focusedHoverPartIndex??-1}containsNode(e){return!!e&&this._contentHoverWidget.getDomNode().contains(e)}focus(){const e=this._renderedContentHover.value?.hoverPartsCount;1!==e?this._contentHoverWidget.focus():this.focusHoverPartWithIndex(0)}focusHoverPartWithIndex(e){this._renderedContentHover.value?.focusHoverPartWithIndex(e)}scrollUp(){this._contentHoverWidget.scrollUp()}scrollDown(){this._contentHoverWidget.scrollDown()}scrollLeft(){this._contentHoverWidget.scrollLeft()}scrollRight(){this._contentHoverWidget.scrollRight()}pageUp(){this._contentHoverWidget.pageUp()}pageDown(){this._contentHoverWidget.pageDown()}goToTop(){this._contentHoverWidget.goToTop()}goToBottom(){this._contentHoverWidget.goToBottom()}hide(){this._hoverOperation.cancel(),this._setCurrentResult(null)}getDomNode(){return this._contentHoverWidget.getDomNode()}get isColorPickerVisible(){return this._renderedContentHover.value?.isColorPickerVisible()??!1}get isVisibleFromKeyboard(){return this._contentHoverWidget.isVisibleFromKeyboard}get isVisible(){return this._contentHoverWidget.isVisible}get isFocused(){return this._contentHoverWidget.isFocused}get isResizing(){return this._contentHoverWidget.isResizing}get widget(){return this._contentHoverWidget}};R1=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([A1(1,nc),A1(2,ER),A1(3,oZ)],R1);var O1=i(245),P1={};function F1(e){const t=e.target;return!!t&&6===t.type&&t.detail.injectedText?.options.attachedData===u$}P1.styleTagTransform=zl(),P1.setAttributes=Bl(),P1.insert=Pl().bind(null,"head"),P1.domAPI=Rl(),P1.insertStyleElement=Vl(),Ml()(O1.A,P1),O1.A&&O1.A.locals&&O1.A.locals;var B1,W1=function(e,t){return function(i,n){t(i,n,e)}};let V1=class extends At{static{B1=this}static{this.ID="editor.contrib.contentHover"}constructor(e,t,i,n){super(),this._editor=e,this._instantiationService=i,this._keybindingService=n,this._onHoverContentsChanged=this._register(new Zt),this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new Mt,this._isMouseDown=!1,this._ignoreMouseEvents=!1,this._reactToEditorMouseMoveRunner=this._register(new Ci((()=>{this._mouseMoveEvent&&this._reactToEditorMouseMove(this._mouseMoveEvent)}),0)),this._register(t.onDidShowContextMenu((()=>{this.hideContentHover(),this._ignoreMouseEvents=!0}))),this._register(t.onDidHideContextMenu((()=>{this._ignoreMouseEvents=!1}))),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(69)&&(this._unhookListeners(),this._hookListeners())})))}static get(e){return e.getContribution(B1.ID)}_hookListeners(){const e=this._editor.getOption(69);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.hidingDelay},e.enabled||this._cancelSchedulerAndHide(),this._listenersStore.add(this._editor.onMouseDown((e=>this._onEditorMouseDown(e)))),this._listenersStore.add(this._editor.onMouseUp((()=>this._onEditorMouseUp()))),this._listenersStore.add(this._editor.onMouseMove((e=>this._onEditorMouseMove(e)))),this._listenersStore.add(this._editor.onKeyDown((e=>this._onKeyDown(e)))),this._listenersStore.add(this._editor.onMouseLeave((e=>this._onEditorMouseLeave(e)))),this._listenersStore.add(this._editor.onDidChangeModel((()=>this._cancelSchedulerAndHide()))),this._listenersStore.add(this._editor.onDidChangeModelContent((()=>this._cancelScheduler()))),this._listenersStore.add(this._editor.onDidScrollChange((e=>this._onEditorScrollChanged(e))))}_unhookListeners(){this._listenersStore.clear()}_cancelSchedulerAndHide(){this._cancelScheduler(),this.hideContentHover()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(e){this._ignoreMouseEvents||(e.scrollTopChanged||e.scrollLeftChanged)&&this.hideContentHover()}_onEditorMouseDown(e){this._ignoreMouseEvents||(this._isMouseDown=!0,this._shouldKeepHoverWidgetVisible(e)||this.hideContentHover())}_shouldKeepHoverWidgetVisible(e){return this._isMouseOnContentHoverWidget(e)||this._isContentWidgetResizing()||F1(e)}_isMouseOnContentHoverWidget(e){return!!this._contentWidget&&kG(this._contentWidget.getDomNode(),e.event.posx,e.event.posy)}_onEditorMouseUp(){this._ignoreMouseEvents||(this._isMouseDown=!1)}_onEditorMouseLeave(e){this._ignoreMouseEvents||this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._shouldKeepHoverWidgetVisible(e)||this.hideContentHover())}_shouldKeepCurrentHover(e){const t=this._contentWidget;if(!t)return!1;const i=this._hoverSettings.sticky,n=t.isFocused,o=t.isResizing,s=this._hoverSettings.sticky&&t.isVisibleFromKeyboard;return this.shouldKeepOpenOnEditorMouseMoveOrLeave||n||o||s||((e,t)=>{const i=this._isMouseOnContentHoverWidget(e);return t&&i})(e,i)||(e=>{const i=t.isColorPickerVisible,n=this._isMouseOnContentHoverWidget(e),o=i&&n,s=i&&this._isMouseDown;return o||s})(e)||((e,i)=>{const n=e.event.browserEvent.view;return!!n&&i&&t.containsNode(n.document.activeElement)&&!n.getSelection()?.isCollapsed})(e,i)}_onEditorMouseMove(e){this._ignoreMouseEvents||(this._mouseMoveEvent=e,this._shouldKeepCurrentHover(e)?this._reactToEditorMouseMoveRunner.cancel():this._shouldRescheduleHoverComputation()?this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hoverSettings.hidingDelay):this._reactToEditorMouseMove(e))}_shouldRescheduleHoverComputation(){const e=this._hoverSettings.hidingDelay;return(this._contentWidget?.isVisible??!1)&&this._hoverSettings.sticky&&e>0}_reactToEditorMouseMove(e){this._hoverSettings.enabled&&this._getOrCreateContentWidget().showsOrWillShow(e)||this.hideContentHover()}_onKeyDown(e){if(this._ignoreMouseEvents)return;if(!this._contentWidget)return;const t=this._isPotentialKeyboardShortcut(e),i=this._isModifierKeyPressed(e);t||i||this._contentWidget.isFocused&&2===e.keyCode||this.hideContentHover()}_isPotentialKeyboardShortcut(e){if(!this._editor.hasModel()||!this._contentWidget)return!1;const t=this._keybindingService.softDispatch(e,this._editor.getDomNode()),i=1===t.kind,n=2===t.kind&&(t.commandId===m$||t.commandId===f$||t.commandId===v$)&&this._contentWidget.isVisible;return i||n}_isModifierKeyPressed(e){return 5===e.keyCode||6===e.keyCode||57===e.keyCode||4===e.keyCode}hideContentHover(){CG.dropDownVisible||this._contentWidget?.hide()}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(R1,this._editor),this._listenersStore.add(this._contentWidget.onContentsChanged((()=>this._onHoverContentsChanged.fire())))),this._contentWidget}showContentHover(e,t,i,n){this._getOrCreateContentWidget().startShowingAtRange(e,t,i,n)}_isContentWidgetResizing(){return this._contentWidget?.widget.isResizing||!1}focusedHoverPartIndex(){return this._getOrCreateContentWidget().focusedHoverPartIndex()}updateHoverVerbosityLevel(e,t,i){this._getOrCreateContentWidget().updateHoverVerbosityLevel(e,t,i)}focus(){this._contentWidget?.focus()}scrollUp(){this._contentWidget?.scrollUp()}scrollDown(){this._contentWidget?.scrollDown()}scrollLeft(){this._contentWidget?.scrollLeft()}scrollRight(){this._contentWidget?.scrollRight()}pageUp(){this._contentWidget?.pageUp()}pageDown(){this._contentWidget?.pageDown()}goToTop(){this._contentWidget?.goToTop()}goToBottom(){this._contentWidget?.goToBottom()}get isColorPickerVisible(){return this._contentWidget?.isColorPickerVisible}get isHoverVisible(){return this._contentWidget?.isVisible}dispose(){super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),this._contentWidget?.dispose()}};V1=B1=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([W1(1,DR),W1(2,nc),W1(3,ER)],V1);class H1 extends At{static{this.ID="editor.contrib.colorContribution"}constructor(e){super(),this._editor=e,this._register(e.onMouseDown((e=>this.onMouseDown(e))))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(168);if("click"!==t&&"clickAndHover"!==t)return;if(!F1(e))return;const i=this._editor.getContribution(V1.ID);if(!i)return;if(i.isColorPickerVisible)return;const n=e.target.range;if(!n)return;const o=new Yu(n.startLineNumber,n.startColumn+1,n.endLineNumber,n.endColumn+1);i.showContentHover(o,1,1,!1)}}class z1{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n}static fromBaseColor(e,t){return new z1(e,t.range,t.model,t.provider)}}class U1 extends At{constructor(e,t,i,n){super();const o=e.getModel(),s=i.model;this.color=i.model.color,this.colorPicker=this._register(new WZ(t.fragment,s,e.getOption(163),n,"standalone")),this._register(s.onColorFlushed((e=>{this.color=e}))),this._register(s.onDidChangeColor((e=>{UZ(o,s,e,i.range,i)})));let r=!1;this._register(e.onDidChangeModelContent((i=>{r?r=!1:(t.hide(),e.focus())}))),UZ(o,s,this.color,i.range,i)}}let K1=class{constructor(e,t){this._editor=e,this._themeService=t}async createColorHover(e,t,i){if(!this._editor.hasModel())return null;if(!g$.get(this._editor))return null;const n=await n$(i,this._editor.getModel(),oi.None);let o=null,s=null;for(const t of n){const i=t.colorInfo;Yu.containsRange(i.range,e.range)&&(o=i,s=t.provider)}const r=o??e,a=s??t,l=!!o;return{colorHover:z1.fromBaseColor(this,await HZ(this._editor.getModel(),r,a)),foundInEditor:l}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let i=new Yu(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await UZ(this._editor.getModel(),t,this._color,i,e),i=zZ(this._editor,i,t))}renderHoverParts(e,t){if(0!==t.length&&this._editor.hasModel())return this._setMinimumDimensions(e),this._renderedParts=new U1(this._editor,e,t[0],this._themeService),this._renderedParts}_setMinimumDimensions(e){const t=this._editor.getOption(75)+8;e.setMinimumDimensions(new Da(302,t))}get _color(){return this._renderedParts?.color}};K1=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,sw)],K1);var j1,q1=function(e,t){return function(i,n){t(i,n,e)}};class $1{constructor(e,t){this.value=e,this.foundInEditor=t}}let G1=class extends At{static{j1=this}static{this.ID="editor.contrib.standaloneColorPickerWidget"}constructor(e,t,i,n,o,s,r,a){super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._keybindingService=o,this._languageFeaturesService=s,this._editorWorkerService=r,this._hoverService=a,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new Zt),this.onResult=this._onResult.event,this._renderedHoverParts=this._register(new Rt),this._renderedStatusBar=this._register(new Rt),this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=n.createInstance(K1,this._editor),this._position=this._editor._getViewModel()?.getPrimaryCursorState().modelState.position;const l=this._editor.getSelection(),d=l?{startLineNumber:l.startLineNumber,startColumn:l.startColumn,endLineNumber:l.endLineNumber,endColumn:l.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(tl(this._body));this._register(h.onDidBlur((e=>{this.hide()}))),this._register(h.onDidFocus((e=>{this.focus()}))),this._register(this._editor.onDidChangeCursorPosition((()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()}))),this._register(this._editor.onMouseMove((e=>{const t=e.target.element?.classList;t&&t.contains("colorpicker-color-decoration")&&this.hide()}))),this._register(this.onResult((e=>{this._render(e.value,e.foundInEditor)}))),this._start(d),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return j1.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(69).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}async _start(e){const t=await this._computeAsync(e);t&&this._onResult.fire(new $1(t.result,t.foundInEditor))}async _computeAsync(e){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=await this._standaloneColorPickerParticipant.createColorHover(t,new t$(this._editorWorkerService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}_render(e,t){const i=document.createDocumentFragment();this._renderedStatusBar.value=this._register(new dZ(this._keybindingService,this._hoverService));const n={fragment:i,statusBar:this._renderedStatusBar.value,onContentsChanged:()=>{},setMinimumDimensions:()=>{},hide:()=>this.hide(),focus:()=>this.focus()};if(this._colorHover=e,this._renderedHoverParts.value=this._standaloneColorPickerParticipant.renderHoverParts(n,[e]),!this._renderedHoverParts.value)return this._renderedStatusBar.clear(),void this._renderedHoverParts.clear();const o=this._renderedHoverParts.value.colorPicker;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(.66*this._editor.getLayoutInfo().width,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),o.layout();const s=o.body,r=s.saturationBox.domNode.clientWidth,a=s.domNode.clientWidth-r-22-8,l=o.body.enterButton;l?.onClicked((()=>{this.updateEditor(),this.hide()}));const d=o.header;d.pickedColorNode.style.width=r+8+"px",d.originalColorNode.style.width=a+"px";const h=o.header.closeButton;h?.onClicked((()=>{this.hide()})),t&&(l&&(l.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};G1=j1=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([q1(3,nc),q1(4,ER),q1(5,BD),q1(6,Xq),q1(7,oZ)],G1);var Z1,Y1=function(e,t){return function(i,n){t(i,n,e)}};let Q1=class extends At{static{Z1=this}static{this.ID="editor.contrib.standaloneColorPickerController"}constructor(e,t,i){super(),this._editor=e,this._instantiationService=i,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=Xu.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=Xu.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||this._standaloneColorPickerWidget?.focus():this._standaloneColorPickerWidget=this._instantiationService.createInstance(G1,this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused))}hide(){this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerWidget?.hide(),this._editor.focus()}insertColor(){this._standaloneColorPickerWidget?.updateEditor(),this.hide()}static get(e){return e.getContribution(Z1.ID)}};Q1=Z1=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Y1(1,eu),Y1(2,nc)],Q1),Hu(class extends Pu{constructor(){super({id:"editor.action.hideColorPicker",label:x(886,"Hide the Color Picker"),precondition:Xu.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100},metadata:{description:x(887,"Hide the standalone color picker.")}})}run(e,t){Q1.get(t)?.hide()}}),Hu(class extends Pu{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:x(888,"Insert Color with Standalone Color Picker"),precondition:Xu.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100},metadata:{description:x(889,"Insert hex/rgb/hsl colors with the focused standalone color picker.")}})}run(e,t){Q1.get(t)?.insertColor()}}),wu(class extends Bu{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{...x(884,"Show or Focus Standalone Color Picker"),mnemonicTitle:y(883,"&&Show or Focus Standalone Color Picker")},precondition:void 0,menu:[{id:gu.CommandPalette}],metadata:{description:x(885,"Show or focus a standalone color picker which uses the default color provider. It displays hex/rgb/hsl colors.")}})}runEditorCommand(e,t){Q1.get(t)?.showOrFocus()}}),Uu(H1.ID,H1,2),Uu(Q1.ID,Q1,1),Uu(g$.ID,g$,1),qq(i$),Qq.register(jZ),fc.registerCommand("_executeDocumentColorProvider",(function(e,...t){const[i]=t;if(!(i instanceof uo))throw Pe();const{model:n,colorProviderRegistry:o,defaultColorDecoratorsEnablement:s}=d$(e,i);return l$(new r$,o,n,oi.None,s)})),fc.registerCommand("_executeColorPresentationProvider",(function(e,...t){const[i,n]=t,{uri:o,range:s}=n;if(!(o instanceof uo&&Array.isArray(i)&&4===i.length&&Yu.isIRange(s)))throw Pe();const{model:r,colorProviderRegistry:a,defaultColorDecoratorsEnablement:l}=d$(e,o),[d,h,c,u]=i;return l$(new a$({range:s,color:{red:d,green:h,blue:c,alpha:u}}),a,r,oi.None,l)}));class X1{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const n=t.length;if(i+n>e.length)return!1;for(let o=0;o<n;o++){const n=e.charCodeAt(i+o),s=t.charCodeAt(o);if(n!==s&&!(n>=65&&n<=90&&n+32===s||s>=65&&s<=90&&s+32===n))return!1}return!0}_createOperationsForBlockComment(e,t,i,n,o,s){const r=e.startLineNumber,a=e.startColumn,l=e.endLineNumber,d=e.endColumn,h=o.getLineContent(r),c=o.getLineContent(l);let u,g=h.lastIndexOf(t,a-1+t.length),p=c.indexOf(i,d-1-i.length);if(-1!==g&&-1!==p)if(r===l)h.substring(g+t.length,p).indexOf(i)>=0&&(g=-1,p=-1);else{const e=h.substring(g+t.length),n=c.substring(0,p);(e.indexOf(i)>=0||n.indexOf(i)>=0)&&(g=-1,p=-1)}-1!==g&&-1!==p?(n&&g+t.length<h.length&&32===h.charCodeAt(g+t.length)&&(t+=" "),n&&p>0&&32===c.charCodeAt(p-1)&&(i=" "+i,p-=1),u=X1._createRemoveBlockCommentOperations(new Yu(r,g+t.length+1,l,p+1),t,i)):(u=X1._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=1===u.length?i:null);for(const e of u)s.addTrackedEditOperation(e.range,e.text)}static _createRemoveBlockCommentOperations(e,t,i){const n=[];return Yu.isEmpty(e)?n.push(qZ.delete(new Yu(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(qZ.delete(new Yu(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(qZ.delete(new Yu(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),n}static _createAddBlockCommentOperations(e,t,i,n){const o=[];return Yu.isEmpty(e)?o.push(qZ.replace(new Yu(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(o.push(qZ.insert(new rc(e.startLineNumber,e.startColumn),t+(n?" ":""))),o.push(qZ.insert(new rc(e.endLineNumber,e.endColumn),(n?" ":"")+i))),o}getEditOperations(e,t){const i=this._selection.startLineNumber,n=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const o=e.getLanguageIdAtPosition(i,n),s=this.languageConfigurationService.getLanguageConfiguration(o).comments;s&&s.blockCommentStartToken&&s.blockCommentEndToken&&this._createOperationsForBlockComment(this._selection,s.blockCommentStartToken,s.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(2===i.length){const e=i[0],t=i[1];return new Qu(e.range.endLineNumber,e.range.endColumn,t.range.startLineNumber,t.range.startColumn)}{const e=i[0].range,t=this._usedEndToken?-this._usedEndToken.length-1:0;return new Qu(e.endLineNumber,e.endColumn+t,e.endLineNumber,e.endColumn+t)}}}class J1{constructor(e,t,i,n,o,s,r){this.languageConfigurationService=e,this._selection=t,this._indentSize=i,this._type=n,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=s,this._ignoreFirstLine=r||!1}static _gatherPreflightCommentStrings(e,t,i,n){e.tokenization.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),s=n.getLanguageConfiguration(o).comments,r=s?s.lineCommentToken:null;if(!r)return null;const a=[];for(let e=0,n=i-t+1;e<n;e++)a[e]={ignore:!1,commentStr:r,commentStrOffset:0,commentStrLength:r.length};return a}static _analyzeLines(e,t,i,n,o,s,r,a,l){let d=!0;const h=a.getLanguageConfiguration(l).comments,c=h?.lineCommentNoIndent??!1;let u;u=0===e||1!==e;for(let a=0,l=n.length;a<l;a++){const l=n[a],h=o+a;if(h===o&&r){l.ignore=!0;continue}const g=i.getLineContent(h),p=$i(g);if(-1===p){l.ignore=s,l.commentStrOffset=c?0:g.length;continue}d=!1;const m=c?0:p;if(l.ignore=!1,l.commentStrOffset=m,u&&!X1._haystackHasNeedleAtOffset(g,l.commentStr,m)&&(0===e?u=!1:1===e||(l.ignore=!0)),u&&t){const e=p+l.commentStrLength;e<g.length&&32===g.charCodeAt(e)&&(l.commentStrLength+=1)}}if(0===e&&d){u=!1;for(let e=0,t=n.length;e<t;e++)n[e].ignore=!1}return{supported:!0,shouldRemoveComments:u,lines:n}}static _gatherPreflightData(e,t,i,n,o,s,r,a){const l=J1._gatherPreflightCommentStrings(i,n,o,a),d=i.getLanguageIdAtPosition(n,1);return null===l?{supported:!1}:J1._analyzeLines(e,t,i,l,n,s,r,a,d)}_executeLineComments(e,t,i,n){let o;i.shouldRemoveComments?o=J1._createRemoveLineCommentsOperations(i.lines,n.startLineNumber):(J1._normalizeInsertionPoint(e,i.lines,n.startLineNumber,this._indentSize),o=this._createAddLineCommentsOperations(i.lines,n.startLineNumber));const s=new rc(n.positionLineNumber,n.positionColumn);for(let i=0,n=o.length;i<n;i++)t.addEditOperation(o[i].range,o[i].text),Yu.isEmpty(o[i].range)&&Yu.getStartPosition(o[i].range).equals(s)&&e.getLineContent(s.lineNumber).length+1===s.column&&(this._deltaColumn=(o[i].text||"").length);this._selectionId=t.trackSelection(n)}_attemptRemoveBlockComment(e,t,i,n){let o=t.startLineNumber,s=t.endLineNumber;const r=n.length+Math.max(e.getLineFirstNonWhitespaceColumn(t.startLineNumber),t.startColumn);let a=e.getLineContent(o).lastIndexOf(i,r-1),l=e.getLineContent(s).indexOf(n,t.endColumn-1-i.length);return-1!==a&&-1===l&&(l=e.getLineContent(o).indexOf(n,a+i.length),s=o),-1===a&&-1!==l&&(a=e.getLineContent(s).lastIndexOf(i,l),o=s),!t.isEmpty()||-1!==a&&-1!==l||(a=e.getLineContent(o).indexOf(i),-1!==a&&(l=e.getLineContent(o).indexOf(n,a+i.length))),-1!==a&&32===e.getLineContent(o).charCodeAt(a+i.length)&&(i+=" "),-1!==l&&32===e.getLineContent(s).charCodeAt(l-1)&&(n=" "+n,l-=1),-1!==a&&-1!==l?X1._createRemoveBlockCommentOperations(new Yu(o,a+i.length+1,s,l+1),i,n):null}_executeBlockComment(e,t,i){e.tokenization.tokenizeIfCheap(i.startLineNumber);const n=e.getLanguageIdAtPosition(i.startLineNumber,1),o=this.languageConfigurationService.getLanguageConfiguration(n).comments;if(!o||!o.blockCommentStartToken||!o.blockCommentEndToken)return;const s=o.blockCommentStartToken,r=o.blockCommentEndToken;let a=this._attemptRemoveBlockComment(e,i,s,r);if(!a){if(i.isEmpty()){const t=e.getLineContent(i.startLineNumber);let n=$i(t);-1===n&&(n=t.length),a=X1._createAddBlockCommentOperations(new Yu(i.startLineNumber,n+1,i.startLineNumber,t.length+1),s,r,this._insertSpace)}else a=X1._createAddBlockCommentOperations(new Yu(i.startLineNumber,e.getLineFirstNonWhitespaceColumn(i.startLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),s,r,this._insertSpace);1===a.length&&(this._deltaColumn=s.length+1)}this._selectionId=t.trackSelection(i);for(const e of a)t.addEditOperation(e.range,e.text)}getEditOperations(e,t){let i=this._selection;if(this._moveEndPositionDown=!1,i.startLineNumber===i.endLineNumber&&this._ignoreFirstLine)return t.addEditOperation(new Yu(i.startLineNumber,e.getLineMaxColumn(i.startLineNumber),i.startLineNumber+1,1),i.startLineNumber===e.getLineCount()?"":"\n"),void(this._selectionId=t.trackSelection(i));i.startLineNumber<i.endLineNumber&&1===i.endColumn&&(this._moveEndPositionDown=!0,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));const n=J1._gatherPreflightData(this._type,this._insertSpace,e,i.startLineNumber,i.endLineNumber,this._ignoreEmptyLines,this._ignoreFirstLine,this.languageConfigurationService);return n.supported?this._executeLineComments(e,t,n,i):this._executeBlockComment(e,t,i)}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),new Qu(i.selectionStartLineNumber,i.selectionStartColumn+this._deltaColumn,i.positionLineNumber,i.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,t){const i=[];for(let n=0,o=e.length;n<o;n++){const o=e[n];o.ignore||i.push(qZ.delete(new Yu(t+n,o.commentStrOffset+1,t+n,o.commentStrOffset+o.commentStrLength+1)))}return i}_createAddLineCommentsOperations(e,t){const i=[],n=this._insertSpace?" ":"";for(let o=0,s=e.length;o<s;o++){const s=e[o];s.ignore||i.push(qZ.insert(new rc(t+o,s.commentStrOffset+1),s.commentStr+n))}return i}static nextVisibleColumn(e,t,i,n){return i?e+(t-e%t):e+n}static _normalizeInsertionPoint(e,t,i,n){let o,s,r=1073741824;for(let o=0,s=t.length;o<s;o++){if(t[o].ignore)continue;const s=e.getLineContent(i+o);let a=0;for(let e=0,i=t[o].commentStrOffset;a<r&&e<i;e++)a=J1.nextVisibleColumn(a,n,9===s.charCodeAt(e),1);a<r&&(r=a)}r=Math.floor(r/n)*n;for(let a=0,l=t.length;a<l;a++){if(t[a].ignore)continue;const l=e.getLineContent(i+a);let d=0;for(o=0,s=t[a].commentStrOffset;d<r&&o<s;o++)d=J1.nextVisibleColumn(d,n,9===l.charCodeAt(o),1);t[a].commentStrOffset=d>r?o-1:o}}}class e2 extends Pu{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(Qp);if(!t.hasModel())return;const n=[],o=t.getModel().getOptions(),s=t.getOption(29),r=t.getSelections().map(((e,t)=>({selection:e,index:t,ignoreFirstLine:!1})));r.sort(((e,t)=>Yu.compareRangesUsingStarts(e.selection,t.selection)));let a=r[0];for(let e=1;e<r.length;e++){const t=r[e];a.selection.endLineNumber===t.selection.startLineNumber&&(a.index<t.index?t.ignoreFirstLine=!0:(a.ignoreFirstLine=!0,a=t))}for(const e of r)n.push(new J1(i,e.selection,o.indentSize,this._type,s.insertSpace,s.ignoreEmptyLines,e.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}Hu(class extends e2{constructor(){super(0,{id:"editor.action.commentLine",label:x(892,"Toggle Line Comment"),precondition:Xu.writable,kbOpts:{kbExpr:Xu.editorTextFocus,primary:2138,weight:100},menuOpts:{menuId:gu.MenubarEditMenu,group:"5_insert",title:y(890,"&&Toggle Line Comment"),order:1}})}}),Hu(class extends e2{constructor(){super(1,{id:"editor.action.addCommentLine",label:x(893,"Add Line Comment"),precondition:Xu.writable,kbOpts:{kbExpr:Xu.editorTextFocus,primary:De(2089,2081),weight:100}})}}),Hu(class extends e2{constructor(){super(2,{id:"editor.action.removeCommentLine",label:x(894,"Remove Line Comment"),precondition:Xu.writable,kbOpts:{kbExpr:Xu.editorTextFocus,primary:De(2089,2099),weight:100}})}}),Hu(class extends Pu{constructor(){super({id:"editor.action.blockComment",label:x(895,"Toggle Block Comment"),precondition:Xu.writable,kbOpts:{kbExpr:Xu.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:gu.MenubarEditMenu,group:"5_insert",title:y(891,"Toggle &&Block Comment"),order:2}})}run(e,t){const i=e.get(Qp);if(!t.hasModel())return;const n=t.getOption(29),o=[],s=t.getSelections();for(const e of s)o.push(new X1(e,n.insertSpace,i));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}});var t2,i2=function(e,t){return function(i,n){t(i,n,e)}};let n2=class{static{t2=this}static{this.ID="editor.contrib.contextmenu"}static get(e){return e.getContribution(t2.ID)}constructor(e,t,i,n,o,s,r,a){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=n,this._keybindingService=o,this._menuService=s,this._configurationService=r,this._workspaceContextService=a,this._toDispose=new Mt,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu((e=>this._onContextMenu(e)))),this._toDispose.add(this._editor.onMouseWheel((e=>{if(this._contextMenuIsBeingShownCount>0){const t=this._contextViewService.getContextViewElement(),i=e.srcElement;i.shadowRoot&&Wa(t)===i.shadowRoot||this._contextViewService.hideContextView()}}))),this._toDispose.add(this._editor.onKeyDown((e=>{this._editor.getOption(30)&&58===e.keyCode&&(e.preventDefault(),e.stopPropagation(),this.showContextMenu())})))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(30))return this._editor.focus(),void(e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position));if(12===e.target.type)return;if(6===e.target.type&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),11===e.target.type)return this._showScrollbarContextMenu(e.event);if(6!==e.target.type&&7!==e.target.type&&1!==e.target.type)return;if(this._editor.focus(),e.target.position){let t=!1;for(const i of this._editor.getSelections())if(i.containsPosition(e.target.position)){t=!0;break}t||this._editor.setPosition(e.target.position)}let t=null;1!==e.target.type&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(30))return;if(!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.contextMenuId);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],n=this._menuService.getMenuActions(t,this._contextKeyService,{arg:e.uri});for(const t of n){const[,n]=t;let o=0;for(const t of n)if(t instanceof _u){const n=this._getMenuActions(e,t.item.submenu);n.length>0&&(i.push(new uc(t.id,t.label,n)),o++)}else i.push(t),o++;o&&i.push(new cc)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;let i=t;if(!i){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const e=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),t=Na(this._editor.getDomNode()),n=t.left+e.left,o=t.top+e.top+e.height;i={x:n,y:o}}const n=this._editor.getOption(144)&&!X;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:n?this._editor.getOverflowWidgetsDomNode()??this._editor.getDomNode():void 0,getAnchor:()=>i,getActions:()=>e,getActionViewItem:e=>{const t=this._keybindingFor(e);if(t)return new hR(e,e,{label:!0,keybinding:t.getLabel(),isMenu:!0});const i=e;return"function"==typeof i.getActionViewItem?i.getActionViewItem():new hR(e,e,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:e=>this._keybindingFor(e),onHide:e=>{this._contextMenuIsBeingShownCount--}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel())return;if(this._workspaceContextService.getWorkspace().id===kT)return;const t=this._editor.getOption(81);let i=0;const n=e=>({id:"menu-action-"+ ++i,label:e.label,tooltip:"",class:void 0,enabled:void 0===e.enabled||e.enabled,checked:e.checked,run:e.run}),o=(e,t,o,s,r)=>{if(!t)return n({label:e,enabled:t,run:()=>{}});const a=e=>()=>{this._configurationService.updateValue(o,e)},l=[];for(const e of r)l.push(n({label:e.label,checked:s===e.value,run:a(e.value)}));return((e,t)=>new uc("menu-action-"+ ++i,e,t,void 0))(e,l)},s=[];s.push(n({label:y(896,"Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),s.push(new cc),s.push(n({label:y(897,"Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),s.push(o(y(898,"Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:y(899,"Proportional"),value:"proportional"},{label:y(900,"Fill"),value:"fill"},{label:y(901,"Fit"),value:"fit"}])),s.push(o(y(902,"Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:y(903,"Mouse Over"),value:"mouseover"},{label:y(904,"Always"),value:"always"}]));const r=this._editor.getOption(144)&&!X;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:r?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>s,onHide:e=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};n2=t2=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([i2(1,DR),i2(2,LR),i2(3,eu),i2(4,ER),i2(5,pu),i2(6,up),i2(7,CT)],n2),Uu(n2.ID,n2,2),Hu(class extends Pu{constructor(){super({id:"editor.action.showContextMenu",label:x(905,"Show Editor Context Menu"),precondition:void 0,kbOpts:{kbExpr:Xu.textInputFocus,primary:1092,weight:100}})}run(e,t){n2.get(t)?.showContextMenu()}});class o2{constructor(e){this.selections=e}equals(e){const t=this.selections.length;if(t!==e.selections.length)return!1;for(let i=0;i<t;i++)if(!this.selections[i].equalsSelection(e.selections[i]))return!1;return!0}}class s2{constructor(e,t,i){this.cursorState=e,this.scrollTop=t,this.scrollLeft=i}}class r2 extends At{static{this.ID="editor.contrib.cursorUndoRedoController"}static get(e){return e.getContribution(r2.ID)}constructor(e){super(),this._editor=e,this._isCursorUndoRedo=!1,this._undoStack=[],this._redoStack=[],this._register(e.onDidChangeModel((e=>{this._undoStack=[],this._redoStack=[]}))),this._register(e.onDidChangeModelContent((e=>{this._undoStack=[],this._redoStack=[]}))),this._register(e.onDidChangeCursorSelection((t=>{if(this._isCursorUndoRedo)return;if(!t.oldSelections)return;if(t.oldModelVersionId!==t.modelVersionId)return;const i=new o2(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new s2(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())})))}cursorUndo(){this._editor.hasModel()&&0!==this._undoStack.length&&(this._redoStack.push(new s2(new o2(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){this._editor.hasModel()&&0!==this._redoStack.length&&(this._undoStack.push(new s2(new o2(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}}function a2(e,t,i,n=Ks.ofCaller()){return xr({debugName:()=>`Configuration Key "${e}"`},(t=>i.onDidChangeConfiguration((i=>{i.affectsConfiguration(e)&&t(i)}))),(()=>i.getValue(e)??t),n)}function l2(e,t,i,n=Ks.ofCaller()){const o=e.bindTo(t),s=new Mt;return fr({debugName:()=>`Set Context Key "${e.key}"`},(e=>{const t=i(e);return o.set(t),t}),n).recomputeInitiallyAndOnChange(s),s}function d2(e,t){const i=new Mt,n=e.createDecorationsCollection();return i.add(lr({debugName:()=>`Apply decorations from ${t.debugName}`},(e=>{const i=t.read(e);n.set(i)}))),i.add({dispose:()=>{n.clear()}}),i}function h2(e,t){return e.appendChild(t),Tt((()=>{t.remove()}))}Uu(r2.ID,r2,0),Hu(class extends Pu{constructor(){super({id:"cursorUndo",label:x(906,"Cursor Undo"),precondition:void 0,kbOpts:{kbExpr:Xu.textInputFocus,primary:2099,weight:100}})}run(e,t,i){r2.get(t)?.cursorUndo()}}),Hu(class extends Pu{constructor(){super({id:"cursorRedo",label:x(907,"Cursor Redo"),precondition:void 0})}run(e,t,i){r2.get(t)?.cursorRedo()}});class c2 extends At{get width(){return this._width}get height(){return this._height}get automaticLayout(){return this._automaticLayout}constructor(e,t){super(),this._automaticLayout=!1,this.elementSizeObserver=this._register(new UF(e,t)),this._width=Js(this,this.elementSizeObserver.getWidth()),this._height=Js(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange((e=>Vs((e=>{this._width.set(this.elementSizeObserver.getWidth(),e),this._height.set(this.elementSizeObserver.getHeight(),e)})))))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){this._automaticLayout=e,e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function u2(e,t,i){let n=t.get(),o=n,s=n;const r=Js("animatedValue",n);let a,l=-1;function d(){const t=Date.now()-l;s=Math.floor(function(e,t,i){return 300===e?t+i:i*(1-Math.pow(2,-10*e/300))+t}(t,o,n-o)),t<300?a=e.requestAnimationFrame(d):s=n,r.set(s,void 0)}return i.add(dr({changeTracker:{createChangeSummary:()=>({animate:!1}),handleChange:(e,i)=>(e.didChange(t)&&(i.animate=i.animate||e.change),!0)}},((i,r)=>{void 0!==a&&(e.cancelAnimationFrame(a),a=void 0),o=s,n=t.read(i),l=Date.now()-(r.animate?0:300),d()}))),r}class g2 extends At{constructor(e,t,i){super(),this._register(new m2(e,i)),this._register(f2(i,{height:t.actualHeight,top:t.actualTop}))}}class p2{get afterLineNumber(){return this._afterLineNumber.get()}constructor(e,t){this._afterLineNumber=e,this.heightInPx=t,this.domNode=document.createElement("div"),this._actualTop=Js(this,void 0),this._actualHeight=Js(this,void 0),this.actualTop=this._actualTop,this.actualHeight=this._actualHeight,this.showInHiddenAreas=!0,this.onChange=this._afterLineNumber,this.onDomNodeTop=e=>{this._actualTop.set(e,void 0)},this.onComputedHeight=e=>{this._actualHeight.set(e,void 0)}}}class m2{static{this._counter=0}constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId="managedOverlayWidget-"+m2._counter++,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}function f2(e,t){return ar((i=>{for(let[n,o]of Object.entries(t))o&&"object"==typeof o&&"read"in o&&(o=o.read(i)),"number"==typeof o&&(o=`${o}px`),n=n.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase())),e.style[n]=o}))}function _2(e,t,i,n){const o=new Mt,s=[];return o.add(hr(((o,r)=>{const a=t.read(o),l=new Map,d=new Map;i&&i(!0),e.changeViewZones((e=>{for(const t of s)e.removeZone(t),n?.delete(t);s.length=0;for(const t of a){const i=e.addZone(t);t.setZoneId&&t.setZoneId(i),s.push(i),n?.add(i),l.set(t,i)}})),i&&i(!1),r.add(dr({changeTracker:{createChangeSummary:()=>({zoneIds:[]}),handleChange(e,t){const i=d.get(e.changedObservable);return void 0!==i&&t.zoneIds.push(i),!0}}},((t,n)=>{for(const e of a)e.onChange&&(d.set(e.onChange,l.get(e)),e.onChange.read(t));i&&i(!0),e.changeViewZones((e=>{for(const t of n.zoneIds)e.layoutZone(t)})),i&&i(!1)})))}))),o.add({dispose(){i&&i(!0),e.changeViewZones((e=>{for(const t of s)e.removeZone(t)})),n?.clear(),i&&i(!1)}}),o}class v2 extends ri{dispose(){super.dispose(!0)}}function b2(e,t){const i=gm(t,(t=>t.original.startLineNumber<=e.lineNumber));if(!i)return Yu.fromPositions(e);if(i.original.endLineNumberExclusive<=e.lineNumber){const t=e.lineNumber-i.original.endLineNumberExclusive+i.modified.endLineNumberExclusive;return Yu.fromPositions(new rc(t,e.column))}if(!i.innerChanges)return Yu.fromPositions(new rc(i.modified.startLineNumber,1));const n=gm(i.innerChanges,(t=>t.originalRange.getStartPosition().isBeforeOrEqual(e)));if(!n){const t=e.lineNumber-i.original.startLineNumber+i.modified.startLineNumber;return Yu.fromPositions(new rc(t,e.column))}if(n.originalRange.containsPosition(e))return n.modifiedRange;{const t=(o=n.originalRange.getEndPosition(),s=e,o.lineNumber===s.lineNumber?new xm(0,s.column-o.column):new xm(s.lineNumber-o.lineNumber,s.column-1));return Yu.fromPositions(t.addToPosition(n.modifiedRange.getEndPosition()))}var o,s}class w2{static create(e,t=void 0){return new C2(e,e,t)}static createWithDisposable(e,t,i=void 0){const n=new Mt;return n.add(t),n.add(e),new C2(e,n,i)}}class C2 extends w2{constructor(e,t,i){super(),this.object=e,this._disposable=t,this._debugOwner=i,this._refCount=1,this._isDisposed=!1,this._owners=[],i&&this._addOwner(i)}_addOwner(e){e&&this._owners.push(e)}createNewRef(e){return this._refCount++,e&&this._addOwner(e),new y2(this,e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._decreaseRefCount(this._debugOwner))}_decreaseRefCount(e){if(this._refCount--,0===this._refCount&&this._disposable.dispose(),e){const t=this._owners.indexOf(e);-1!==t&&this._owners.splice(t,1)}}}class y2 extends w2{constructor(e,t){super(),this._base=e,this._debugOwner=t,this._isDisposed=!1}get object(){return this._base.object}createNewRef(e){return this._base.createNewRef(e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._base._decreaseRefCount(this._debugOwner))}}class S2{static inverse(e,t,i){const n=[];let o=1,s=1;for(const t of e){const e=new S2(new ym(o,t.original.startLineNumber),new ym(s,t.modified.startLineNumber));e.modified.isEmpty||n.push(e),o=t.original.endLineNumberExclusive,s=t.modified.endLineNumberExclusive}const r=new S2(new ym(o,t+1),new ym(s,i+1));return r.modified.isEmpty||n.push(r),n}static clip(e,t,i){const n=[];for(const o of e){const e=o.original.intersect(t),s=o.modified.intersect(i);e&&!e.isEmpty&&s&&!s.isEmpty&&n.push(new S2(e,s))}return n}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new S2(this.modified,this.original)}join(e){return new S2(this.original.join(e.original),this.modified.join(e.modified))}toRangeMapping(){const e=this.original.toInclusiveRange(),t=this.modified.toInclusiveRange();if(e&&t)return new D2(e,t);if(1===this.original.startLineNumber||1===this.modified.startLineNumber){if(1!==this.modified.startLineNumber||1!==this.original.startLineNumber)throw new Ve("not a valid diff");return new D2(new Yu(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Yu(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}return new D2(new Yu(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new Yu(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,t){if(k2(this.original.endLineNumberExclusive,e)&&k2(this.modified.endLineNumberExclusive,t))return new D2(new Yu(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Yu(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new D2(Yu.fromPositions(new rc(this.original.startLineNumber,1),x2(new rc(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Yu.fromPositions(new rc(this.modified.startLineNumber,1),x2(new rc(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new D2(Yu.fromPositions(x2(new rc(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),x2(new rc(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Yu.fromPositions(x2(new rc(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),t),x2(new rc(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));throw new Ve}}function x2(e,t){if(e.lineNumber<1)return new rc(1,1);if(e.lineNumber>t.length)return new rc(t.length,t[t.length-1].length+1);const i=t[e.lineNumber-1];return e.column>i.length+1?new rc(e.lineNumber,i.length+1):e}function k2(e,t){return e>=1&&e<=t.length}class L2 extends S2{static fromRangeMappings(e){const t=ym.join(e.map((e=>ym.fromRangeInclusive(e.originalRange)))),i=ym.join(e.map((e=>ym.fromRangeInclusive(e.modifiedRange))));return new L2(t,i,e)}constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){return new L2(this.modified,this.original,this.innerChanges?.map((e=>e.flip())))}withInnerChangesFromLineRanges(){return new L2(this.original,this.modified,[this.toRangeMapping()])}}class D2{static fromEdit(e){const t=e.getNewRanges();return e.replacements.map(((e,i)=>new D2(e.range,t[i])))}static assertSorted(e){for(let t=1;t<e.length;t++){const i=e[t-1],n=e[t];if(!i.originalRange.getEndPosition().isBeforeOrEqual(n.originalRange.getStartPosition())||!i.modifiedRange.getEndPosition().isBeforeOrEqual(n.modifiedRange.getStartPosition()))throw new Ve("Range mappings must be sorted")}}constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new D2(this.modifiedRange,this.originalRange)}toTextEdit(e){const t=e.getValueOfRange(this.modifiedRange);return new FU(this.originalRange,t)}}function E2(e,t,i,n=!1){const o=[];for(const n of ss(e.map((e=>function(e,t,i){let n=0,o=0;1===e.modifiedRange.endColumn&&1===e.originalRange.endColumn&&e.originalRange.startLineNumber+n<=e.originalRange.endLineNumber&&e.modifiedRange.startLineNumber+n<=e.modifiedRange.endLineNumber&&(o=-1),e.modifiedRange.startColumn-1>=i.getLineLength(e.modifiedRange.startLineNumber)&&e.originalRange.startColumn-1>=t.getLineLength(e.originalRange.startLineNumber)&&e.originalRange.startLineNumber<=e.originalRange.endLineNumber+o&&e.modifiedRange.startLineNumber<=e.modifiedRange.endLineNumber+o&&(n=1);const s=new ym(e.originalRange.startLineNumber+n,e.originalRange.endLineNumber+1+o),r=new ym(e.modifiedRange.startLineNumber+n,e.modifiedRange.endLineNumber+1+o);return new L2(s,r,[e])}(e,t,i))),((e,t)=>e.original.intersectsOrTouches(t.original)||e.modified.intersectsOrTouches(t.modified)))){const e=n[0],t=n[n.length-1];o.push(new L2(e.original.join(t.original),e.modified.join(t.modified),n.map((e=>e.innerChanges[0]))))}return rt((()=>{if(!n&&o.length>0){if(o[0].modified.startLineNumber!==o[0].original.startLineNumber)return!1;if(i.length.lineCount-o[o.length-1].modified.endLineNumberExclusive!=t.length.lineCount-o[o.length-1].original.endLineNumberExclusive)return!1}return at(o,((e,t)=>t.original.startLineNumber-e.original.endLineNumberExclusive==t.modified.startLineNumber-e.modified.endLineNumberExclusive&&e.original.endLineNumberExclusive<t.original.startLineNumber&&e.modified.endLineNumberExclusive<t.modified.startLineNumber))})),o}var N2=i(2180),I2={};I2.styleTagTransform=zl(),I2.setAttributes=Bl(),I2.insert=Pl().bind(null,"head"),I2.domAPI=Rl(),I2.insertStyleElement=Vl(),Ml()(N2.A,I2),N2.A&&N2.A.locals&&N2.A.locals;var T2=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},M2=function(e,t){return function(i,n){t(i,n,e)}};const A2=bF("diff-review-insert",fh.add,y(94,"Icon for 'Insert' in accessible diff viewer.")),R2=bF("diff-review-remove",fh.remove,y(95,"Icon for 'Remove' in accessible diff viewer.")),O2=bF("diff-review-close",fh.close,y(96,"Icon for 'Close' in accessible diff viewer."));let P2=class extends At{static{this._ttPolicy=GI("diffReview",{createHTML:e=>e})}constructor(e,t,i,n,o,s,r,a,l){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=n,this._width=o,this._height=s,this._diffs=r,this._models=a,this._instantiationService=l,this._state=pr(this,(e=>{const t=this._visible.read(e);if(this._parentNode.style.visibility=t?"visible":"hidden",!t)return null;const i=e.store.add(this._instantiationService.createInstance(F2,this._diffs,this._models,this._setVisible,this._canClose));return{model:i,view:e.store.add(this._instantiationService.createInstance(j2,this._parentNode,i,this._width,this._height,this._models))}})).recomputeInitiallyAndOnChange(this._store)}next(){Vs((e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)}))}prev(){Vs((e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)}))}close(){Vs((e=>{this._setVisible(!1,e)}))}};P2=T2([M2(8,nc)],P2);let F2=class extends At{constructor(e,t,i,n,o){super(),this._diffs=e,this._models=t,this._setVisible=i,this.canClose=n,this._accessibilitySignalService=o,this._groups=Js(this,[]),this._currentGroupIdx=Js(this,0),this._currentElementIdx=Js(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map(((e,t)=>this._groups.read(t)[e])),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map(((e,t)=>this.currentGroup.read(t)?.lines[e])),this._register(ar((e=>{const t=this._diffs.read(e);if(!t)return void this._groups.set([],void 0);const i=function(e,t,i){const n=[];for(const o of ss(e,((e,t)=>t.modified.startLineNumber-e.modified.endLineNumberExclusive<2*B2))){const e=[];e.push(new H2);const s=new ym(Math.max(1,o[0].original.startLineNumber-B2),Math.min(o[o.length-1].original.endLineNumberExclusive+B2,t+1)),r=new ym(Math.max(1,o[0].modified.startLineNumber-B2),Math.min(o[o.length-1].modified.endLineNumberExclusive+B2,i+1));rs(o,((t,i)=>{const n=new ym(t?t.original.endLineNumberExclusive:s.startLineNumber,i?i.original.startLineNumber:s.endLineNumberExclusive),o=new ym(t?t.modified.endLineNumberExclusive:r.startLineNumber,i?i.modified.startLineNumber:r.endLineNumberExclusive);n.forEach((t=>{e.push(new K2(t,o.startLineNumber+(t-n.startLineNumber)))})),i&&(i.original.forEach((t=>{e.push(new z2(i,t))})),i.modified.forEach((t=>{e.push(new U2(i,t))})))}));const a=o[0].modified.join(o[o.length-1].modified),l=o[0].original.join(o[o.length-1].original);n.push(new V2(new S2(a,l),e))}return n}(t,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());Vs((e=>{const t=this._models.getModifiedPosition();if(t){const n=i.findIndex((e=>t?.lineNumber<e.range.modified.endLineNumberExclusive));-1!==n&&this._currentGroupIdx.set(n,e)}this._groups.set(i,e)}))}))),this._register(ar((e=>{const t=this.currentElement.read(e);t?.type===W2.Deleted?this._accessibilitySignalService.playSignal(EP.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):t?.type===W2.Added&&this._accessibilitySignalService.playSignal(EP.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})}))),this._register(ar((e=>{const t=this.currentElement.read(e);if(t&&t.type!==W2.Header){const e=t.modifiedLineNumber??t.diff.modified.startLineNumber;this._models.modifiedSetSelection(Yu.fromPositions(new rc(e,1)))}})))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||zs(t,(t=>{this._currentGroupIdx.set(cm.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),t),this._currentElementIdx.set(0,t)}))}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||Vs((i=>{this._currentElementIdx.set(cm.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),i)}))}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const i=t.lines.indexOf(e);-1!==i&&Vs((e=>{this._currentElementIdx.set(i,e)}))}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===W2.Deleted?this._models.originalReveal(Yu.fromPositions(new rc(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==W2.Header?Yu.fromPositions(new rc(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};F2=T2([M2(4,kP)],F2);const B2=3;var W2;!function(e){e[e.Header=0]="Header",e[e.Unchanged=1]="Unchanged",e[e.Deleted=2]="Deleted",e[e.Added=3]="Added"}(W2||(W2={}));class V2{constructor(e,t){this.range=e,this.lines=t}}class H2{constructor(){this.type=W2.Header}}class z2{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=W2.Deleted,this.modifiedLineNumber=void 0}}class U2{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=W2.Added,this.originalLineNumber=void 0}}class K2{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=W2.Unchanged}}let j2=class extends At{constructor(e,t,i,n,o,s){super(),this._element=e,this._model=t,this._width=i,this._height=n,this._models=o,this._languageService=s,this.domNode=this._element,this.domNode.className="monaco-component diff-review monaco-editor-background";const r=document.createElement("div");r.className="diff-review-actions",this._actionBar=this._register(new uR(r)),this._register(ar((e=>{this._actionBar.clear(),this._model.canClose.read(e)&&this._actionBar.push(pc({id:"diffreview.close",label:y(97,"Close"),class:"close-diff-review "+vh.asClassName(O2),enabled:!0,run:async()=>t.close()}),{label:!1,icon:!0})}))),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new dA(this._content,{})),ol(this.domNode,this._scrollbar.getDomNode(),r),this._register(ar((e=>{this._height.read(e),this._width.read(e),this._scrollbar.scanDomNode()}))),this._register(Tt((()=>{ol(this.domNode)}))),this._register(f2(this.domNode,{width:this._width,height:this._height})),this._register(f2(this._content,{width:this._width,height:this._height})),this._register(hr(((e,t)=>{this._model.currentGroup.read(e),this._render(t)}))),this._register(ma(this.domNode,"keydown",(e=>{(e.equals(18)||e.equals(2066)||e.equals(530))&&(e.preventDefault(),this._model.goToNextLine()),(e.equals(16)||e.equals(2064)||e.equals(528))&&(e.preventDefault(),this._model.goToPreviousLine()),(e.equals(9)||e.equals(2057)||e.equals(521)||e.equals(1033))&&(e.preventDefault(),this._model.close()),(e.equals(10)||e.equals(3))&&(e.preventDefault(),this._model.revealCurrentElementInEditor())})))}_render(e){const t=this._models.getOriginalOptions(),i=this._models.getModifiedOptions(),n=document.createElement("div");n.className="diff-review-table",n.setAttribute("role","list"),n.setAttribute("aria-label",y(98,"Accessible Diff Viewer. Use arrow up and down to navigate.")),iT(n,i.get(59)),ol(this._content,n);const o=this._models.getOriginalModel(),s=this._models.getModifiedModel();if(!o||!s)return;const r=o.getOptions(),a=s.getOptions(),l=i.get(75),d=this._model.currentGroup.get();for(const h of d?.lines||[]){if(!d)break;let c;if(h.type===W2.Header){const e=document.createElement("div");e.className="diff-review-row",e.setAttribute("role","listitem");const t=d.range,i=this._model.currentGroupIndex.get(),n=this._model.groups.get().length,o=e=>0===e?y(99,"no lines changed"):1===e?y(100,"1 line changed"):y(101,"{0} lines changed",e),s=o(t.original.length),r=o(t.modified.length);e.setAttribute("aria-label",y(102,"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",i+1,n,t.original.startLineNumber,s,t.modified.startLineNumber,r));const a=document.createElement("div");a.className="diff-review-cell diff-review-summary",a.appendChild(document.createTextNode(`${i+1}/${n}: @@ -${t.original.startLineNumber},${t.original.length} +${t.modified.startLineNumber},${t.modified.length} @@`)),e.appendChild(a),c=e}else c=this._createRow(h,l,this._width.get(),t,o,r,i,s,a);n.appendChild(c);const u=pr((e=>this._model.currentElement.read(e)===h));e.add(ar((e=>{const t=u.read(e);c.tabIndex=t?0:-1,t&&c.focus()}))),e.add(ga(c,"focus",(()=>{this._model.goToLine(h)})))}this._scrollbar.scanDomNode()}_createRow(e,t,i,n,o,s,r,a,l){const d=n.get(165),h=d.glyphMarginWidth+d.lineNumbersWidth,c=r.get(165),u=10+c.glyphMarginWidth+c.lineNumbersWidth;let g="diff-review-row",p="",m=null;switch(e.type){case W2.Added:g="diff-review-row line-insert",p=" char-insert",m=A2;break;case W2.Deleted:g="diff-review-row line-delete",p=" char-delete",m=R2}const f=document.createElement("div");f.style.minWidth=i+"px",f.className=g,f.setAttribute("role","listitem"),f.ariaLevel="";const _=document.createElement("div");_.className="diff-review-cell",_.style.height=`${t}px`,f.appendChild(_);const v=document.createElement("span");v.style.width=h+"px",v.style.minWidth=h+"px",v.className="diff-review-line-number"+p,void 0!==e.originalLineNumber?v.appendChild(document.createTextNode(String(e.originalLineNumber))):v.innerText=" ",_.appendChild(v);const b=document.createElement("span");b.style.width=u+"px",b.style.minWidth=u+"px",b.style.paddingRight="10px",b.className="diff-review-line-number"+p,void 0!==e.modifiedLineNumber?b.appendChild(document.createTextNode(String(e.modifiedLineNumber))):b.innerText=" ",_.appendChild(b);const w=document.createElement("span");if(w.className="diff-review-spacer",m){const e=document.createElement("span");e.className=vh.asClassName(m),e.innerText=" ",w.appendChild(e)}else w.innerText=" ";let C;if(_.appendChild(w),void 0!==e.modifiedLineNumber){let t=this._getLineHtml(a,r,l.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);P2._ttPolicy&&(t=P2._ttPolicy.createHTML(t)),_.insertAdjacentHTML("beforeend",t),C=a.getLineContent(e.modifiedLineNumber)}else{let t=this._getLineHtml(o,n,s.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);P2._ttPolicy&&(t=P2._ttPolicy.createHTML(t)),_.insertAdjacentHTML("beforeend",t),C=o.getLineContent(e.originalLineNumber)}0===C.length&&(C=y(103,"blank"));let S="";switch(e.type){case W2.Unchanged:S=e.originalLineNumber===e.modifiedLineNumber?y(104,"{0} unchanged line {1}",C,e.originalLineNumber):y(105,"{0} original line {1} modified line {2}",C,e.originalLineNumber,e.modifiedLineNumber);break;case W2.Added:S=y(106,"+ {0} modified line {1}",C,e.modifiedLineNumber);break;case W2.Deleted:S=y(107,"- {0} original line {1}",C,e.originalLineNumber)}return f.setAttribute("aria-label",S),f}_getLineHtml(e,t,i,n,o){const s=e.getLineContent(n),r=t.get(59),a=t.get(117).verticalScrollbarSize,l=uS.createEmpty(s,o),d=DH.isBasicASCII(s,e.mightContainNonBasicASCII()),h=DH.containsRTL(s,d,e.mightContainRTL());return YB(new KB(r.isMonospace&&!t.get(40),r.canUseHalfwidthRightwardsArrow,s,!1,d,h,0,l,[],i,0,r.spaceWidth,r.middotWidth,r.wsmiddotWidth,t.get(133),t.get(113),t.get(108),t.get(60)!==eP.OFF,null,null,a)).html}};j2=T2([M2(5,Tg)],j2);class q2{constructor(e){this.editors=e}getOriginalModel(){return this.editors.original.getModel()}getOriginalOptions(){return this.editors.original.getOptions()}originalReveal(e){this.editors.original.revealRange(e),this.editors.original.setSelection(e),this.editors.original.focus()}getModifiedModel(){return this.editors.modified.getModel()}getModifiedOptions(){return this.editors.modified.getOptions()}modifiedReveal(e){e&&(this.editors.modified.revealRange(e),this.editors.modified.setSelection(e)),this.editors.modified.focus()}modifiedSetSelection(e){this.editors.modified.setSelection(e)}modifiedFocus(){this.editors.modified.focus()}getModifiedPosition(){return this.editors.modified.getPosition()??void 0}}Ff("diffEditor.move.border","#8b8b8b9c",y(134,"The border color for text that got moved in the diff editor.")),Ff("diffEditor.moveActive.border","#FFA500",y(135,"The active border color for text that got moved in the diff editor.")),Ff("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},y(136,"The color of the shadow around unchanged region widgets."));const $2=bF("diff-insert",fh.add,y(137,"Line decoration for inserts in the diff editor.")),G2=bF("diff-remove",fh.remove,y(138,"Line decoration for removals in the diff editor.")),Z2=bk.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+vh.asClassName($2),marginClassName:"gutter-insert"}),Y2=bk.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+vh.asClassName(G2),marginClassName:"gutter-delete"}),Q2=bk.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),X2=bk.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),J2=bk.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),e4=bk.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),t4=bk.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),i4=bk.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),n4=bk.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),o4=bk.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});var s4,r4=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},a4=function(e,t){return function(i,n){t(i,n,e)}};const l4=oc("diffProviderFactoryService");let d4=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(h4,e)}};d4=r4([a4(0,nc)],d4),wp(l4,d4,1);let h4=class{static{s4=this}static{this.diffCache=new Map}constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new Zt,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){this.diffAlgorithmOnDidChangeSubscription?.dispose()}async computeDiff(e,t,i,n){if("string"!=typeof this.diffAlgorithm)return this.diffAlgorithm.computeDiff(e,t,i,n);if(e.isDisposed()||t.isDisposed())return{changes:[],identical:!0,quitEarly:!1,moves:[]};if(1===e.getLineCount()&&1===e.getLineMaxColumn(1))return 1===t.getLineCount()&&1===t.getLineMaxColumn(1)?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new L2(new ym(1,2),new ym(1,t.getLineCount()+1),[new D2(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const o=JSON.stringify([e.uri.toString(),t.uri.toString()]),s=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),r=s4.diffCache.get(o);if(r&&r.context===s)return r.result;const a=Ht.create(),l=await this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),d=a.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:d,timedOut:l?.quitEarly??!0,detectedMoves:i.computeMoves?l?.moves.length??0:-1}),n.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!l)throw new Error("no diff result available");return s4.diffCache.size>10&&s4.diffCache.delete(s4.diffCache.keys().next().value),s4.diffCache.set(o,{result:l,context:s}),l}setOptions(e){let t=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&(this.diffAlgorithmOnDidChangeSubscription?.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,"string"!=typeof e.diffAlgorithm&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange((()=>this.onDidChangeEventEmitter.fire()))),t=!0),t&&this.onDidChangeEventEmitter.fire()}};h4=s4=r4([a4(1,Xq),a4(2,Cu)],h4);class c4{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class u4{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class g4{static trivial(e,t){return new g4([new p4(cm.ofLength(e.length),cm.ofLength(t.length))],!1)}static trivialTimedOut(e,t){return new g4([new p4(cm.ofLength(e.length),cm.ofLength(t.length))],!0)}constructor(e,t){this.diffs=e,this.hitTimeout=t}}class p4{static invert(e,t){const i=[];return rs(e,((e,n)=>{i.push(p4.fromOffsetPairs(e?e.getEndExclusives():m4.zero,n?n.getStarts():new m4(t,(e?e.seq2Range.endExclusive-e.seq1Range.endExclusive:0)+t)))})),i}static fromOffsetPairs(e,t){return new p4(new cm(e.offset1,t.offset1),new cm(e.offset2,t.offset2))}static assertSorted(e){let t;for(const i of e){if(t&&!(t.seq1Range.endExclusive<=i.seq1Range.start&&t.seq2Range.endExclusive<=i.seq2Range.start))throw new Ve("Sequence diffs must be sorted");t=i}}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new p4(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new p4(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return 0===e?this:new p4(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return 0===e?this:new p4(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return 0===e?this:new p4(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),i=this.seq2Range.intersect(e.seq2Range);if(t&&i)return new p4(t,i)}getStarts(){return new m4(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new m4(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class m4{static{this.zero=new m4(0,0)}static{this.max=new m4(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER)}constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return 0===e?this:new m4(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}}class f4{static{this.instance=new f4}isValid(){return!0}}class _4{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new Ve("timeout must be positive")}isValid(){return!(Date.now()-this.startTime<this.timeout)&&this.valid&&(this.valid=!1),this.valid}}class v4{constructor(e,t){this.width=e,this.height=t,this.array=[],this.array=new Array(e*t)}get(e,t){return this.array[e+t*this.width]}set(e,t,i){this.array[e+t*this.width]=i}}function b4(e){return 32===e||9===e}class w4{static{this.chrKeys=new Map}static getKey(e){let t=this.chrKeys.get(e);return void 0===t&&(t=this.chrKeys.size,this.chrKeys.set(e,t)),t}constructor(e,t,i){this.range=e,this.lines=t,this.source=i,this.histogram=[];let n=0;for(let i=e.startLineNumber-1;i<e.endLineNumberExclusive-1;i++){const e=t[i];for(let t=0;t<e.length;t++){n++;const i=e[t],o=w4.getKey(i);this.histogram[o]=(this.histogram[o]||0)+1}n++;const o=w4.getKey("\n");this.histogram[o]=(this.histogram[o]||0)+1}this.totalCount=n}computeSimilarity(e){let t=0;const i=Math.max(this.histogram.length,e.histogram.length);for(let n=0;n<i;n++)t+=Math.abs((this.histogram[n]??0)-(e.histogram[n]??0));return 1-t/(this.totalCount+e.totalCount)}}class C4{compute(e,t,i=f4.instance,n){if(0===e.length||0===t.length)return g4.trivial(e,t);const o=new v4(e.length,t.length),s=new v4(e.length,t.length),r=new v4(e.length,t.length);for(let a=0;a<e.length;a++)for(let l=0;l<t.length;l++){if(!i.isValid())return g4.trivialTimedOut(e,t);const d=0===a?0:o.get(a-1,l),h=0===l?0:o.get(a,l-1);let c;e.getElement(a)===t.getElement(l)?(c=0===a||0===l?0:o.get(a-1,l-1),a>0&&l>0&&3===s.get(a-1,l-1)&&(c+=r.get(a-1,l-1)),c+=n?n(a,l):1):c=-1;const u=Math.max(d,h,c);if(u===c){const e=a>0&&l>0?r.get(a-1,l-1):0;r.set(a,l,e+1),s.set(a,l,3)}else u===d?(r.set(a,l,0),s.set(a,l,1)):u===h&&(r.set(a,l,0),s.set(a,l,2));o.set(a,l,u)}const a=[];let l=e.length,d=t.length;function h(e,t){e+1===l&&t+1===d||a.push(new p4(new cm(e+1,l),new cm(t+1,d))),l=e,d=t}let c=e.length-1,u=t.length-1;for(;c>=0&&u>=0;)3===s.get(c,u)?(h(c,u),c--,u--):1===s.get(c,u)?c--:u--;return h(-1,-1),a.reverse(),new g4(a,!1)}}class y4{compute(e,t,i=f4.instance){if(0===e.length||0===t.length)return g4.trivial(e,t);const n=e,o=t;function s(e,t){for(;e<n.length&&t<o.length&&n.getElement(e)===o.getElement(t);)e++,t++;return e}let r=0;const a=new x4;a.set(0,s(0,0));const l=new k4;l.set(0,0===a.get(0)?null:new S4(null,0,0,a.get(0)));let d=0;e:for(;;){if(r++,!i.isValid())return g4.trivialTimedOut(n,o);const e=-Math.min(r,o.length+r%2),t=Math.min(r,n.length+r%2);for(d=e;d<=t;d+=2){let i=0;const r=d===t?-1:a.get(d+1),h=d===e?-1:a.get(d-1)+1;i++;const c=Math.min(Math.max(r,h),n.length),u=c-d;if(i++,c>n.length||u>o.length)continue;const g=s(c,u);a.set(d,g);const p=c===r?l.get(d+1):l.get(d-1);if(l.set(d,g!==c?new S4(p,c,u,g-c):p),a.get(d)===n.length&&a.get(d)-d===o.length)break e}}let h=l.get(d);const c=[];let u=n.length,g=o.length;for(;;){const e=h?h.x+h.length:0,t=h?h.y+h.length:0;if(e===u&&t===g||c.push(new p4(new cm(e,u),new cm(t,g))),!h)break;u=h.x,g=h.y,h=h.prev}return c.reverse(),new g4(c,!1)}}class S4{constructor(e,t,i,n){this.prev=e,this.x=t,this.y=i,this.length=n}}class x4{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if((e=-e-1)>=this.negativeArr.length){const e=this.negativeArr;this.negativeArr=new Int32Array(2*e.length),this.negativeArr.set(e)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const e=this.positiveArr;this.positiveArr=new Int32Array(2*e.length),this.positiveArr.set(e)}this.positiveArr[e]=t}}}class k4{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}class L4{constructor(e,t,i){this.lines=e,this.range=t,this.considerWhitespaceChanges=i,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let t=this.range.startLineNumber;t<=this.range.endLineNumber;t++){let n=e[t-1],o=0;t===this.range.startLineNumber&&this.range.startColumn>1&&(o=this.range.startColumn-1,n=n.substring(o)),this.lineStartOffsets.push(o);let s=0;if(!i){const e=n.trimStart();s=n.length-e.length,n=e.trimEnd()}this.trimmedWsLengthsByLineIdx.push(s);const r=t===this.range.endLineNumber?Math.min(this.range.endColumn-1-o-s,n.length):n.length;for(let e=0;e<r;e++)this.elements.push(n.charCodeAt(e));t<this.range.endLineNumber&&(this.elements.push("\n".charCodeAt(0)),this.firstElementOffsetByLineIdx.push(this.elements.length))}}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new cm(0,this.length))}getText(e){return this.elements.slice(e.start,e.endExclusive).map((e=>String.fromCharCode(e))).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=T4(e>0?this.elements[e-1]:-1),i=T4(e<this.elements.length?this.elements[e]:-1);if(7===t&&8===i)return 0;if(8===t)return 150;let n=0;return t!==i&&(n+=10,0===t&&1===i&&(n+=1)),n+=I4(t),n+=I4(i),n}translateOffset(e,t="right"){const i=mm(this.firstElementOffsetByLineIdx,(t=>t<=e)),n=e-this.firstElementOffsetByLineIdx[i];return new rc(this.range.startLineNumber+i,1+this.lineStartOffsets[i]+n+(0===n&&"left"===t?0:this.trimmedWsLengthsByLineIdx[i]))}translateRange(e){const t=this.translateOffset(e.start,"right"),i=this.translateOffset(e.endExclusive,"left");return i.isBefore(t)?Yu.fromPositions(i,i):Yu.fromPositions(t,i)}findWordContaining(e){if(e<0||e>=this.elements.length)return;if(!D4(this.elements[e]))return;let t=e;for(;t>0&&D4(this.elements[t-1]);)t--;let i=e;for(;i<this.elements.length&&D4(this.elements[i]);)i++;return new cm(t,i)}findSubWordContaining(e){if(e<0||e>=this.elements.length)return;if(!D4(this.elements[e]))return;let t=e;for(;t>0&&D4(this.elements[t-1])&&!E4(this.elements[t]);)t--;let i=e;for(;i<this.elements.length&&D4(this.elements[i])&&!E4(this.elements[i]);)i++;return new cm(t,i)}countLinesIn(e){return this.translateOffset(e.endExclusive).lineNumber-this.translateOffset(e.start).lineNumber}isStronglyEqual(e,t){return this.elements[e]===this.elements[t]}extendToFullLines(e){const t=pm(this.firstElementOffsetByLineIdx,(t=>t<=e.start))??0,i=function(t){const i=fm(t,(t=>e.endExclusive<=t));return i===t.length?void 0:t[i]}(this.firstElementOffsetByLineIdx)??this.elements.length;return new cm(t,i)}}function D4(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57}function E4(e){return e>=65&&e<=90}const N4={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function I4(e){return N4[e]}function T4(e){return 10===e?8:13===e?7:b4(e)?6:e>=97&&e<=122?0:e>=65&&e<=90?1:e>=48&&e<=57?2:-1===e?3:44===e||59===e?5:4}function M4(e,t,i){if(e.trim()===t.trim())return!0;if(e.length>300&&t.length>300)return!1;const n=(new y4).compute(new L4([e],new Yu(1,1,1,e.length),!1),new L4([t],new Yu(1,1,1,t.length),!1),i);let o=0;const s=p4.invert(n.diffs,e.length);for(const t of s)t.seq1Range.forEach((t=>{b4(e.charCodeAt(t))||o++}));const r=function(t){let i=0;for(let n=0;n<e.length;n++)b4(t.charCodeAt(n))||i++;return i}(e.length>t.length?e:t);return o/r>.6&&r>10}function A4(e,t,i){let n=i;return n=R4(e,t,n),n=R4(e,t,n),n=function(e,t,i){if(!e.getBoundaryScore||!t.getBoundaryScore)return i;for(let n=0;n<i.length;n++){const o=n>0?i[n-1]:void 0,s=i[n],r=n+1<i.length?i[n+1]:void 0,a=new cm(o?o.seq1Range.endExclusive+1:0,r?r.seq1Range.start-1:e.length),l=new cm(o?o.seq2Range.endExclusive+1:0,r?r.seq2Range.start-1:t.length);s.seq1Range.isEmpty?i[n]=O4(s,e,t,a,l):s.seq2Range.isEmpty&&(i[n]=O4(s.swap(),t,e,l,a).swap())}return i}(e,t,n),n}function R4(e,t,i){if(0===i.length)return i;const n=[];n.push(i[0]);for(let o=1;o<i.length;o++){const s=n[n.length-1];let r=i[o];if(r.seq1Range.isEmpty||r.seq2Range.isEmpty){const i=r.seq1Range.start-s.seq1Range.endExclusive;let o;for(o=1;o<=i&&e.getElement(r.seq1Range.start-o)===e.getElement(r.seq1Range.endExclusive-o)&&t.getElement(r.seq2Range.start-o)===t.getElement(r.seq2Range.endExclusive-o);o++);if(o--,o===i){n[n.length-1]=new p4(new cm(s.seq1Range.start,r.seq1Range.endExclusive-i),new cm(s.seq2Range.start,r.seq2Range.endExclusive-i));continue}r=r.delta(-o)}n.push(r)}const o=[];for(let i=0;i<n.length-1;i++){const s=n[i+1];let r=n[i];if(r.seq1Range.isEmpty||r.seq2Range.isEmpty){const o=s.seq1Range.start-r.seq1Range.endExclusive;let a;for(a=0;a<o&&e.isStronglyEqual(r.seq1Range.start+a,r.seq1Range.endExclusive+a)&&t.isStronglyEqual(r.seq2Range.start+a,r.seq2Range.endExclusive+a);a++);if(a===o){n[i+1]=new p4(new cm(r.seq1Range.start+o,s.seq1Range.endExclusive),new cm(r.seq2Range.start+o,s.seq2Range.endExclusive));continue}a>0&&(r=r.delta(a))}o.push(r)}return n.length>0&&o.push(n[n.length-1]),o}function O4(e,t,i,n,o){let s=1;for(;e.seq1Range.start-s>=n.start&&e.seq2Range.start-s>=o.start&&i.isStronglyEqual(e.seq2Range.start-s,e.seq2Range.endExclusive-s)&&s<100;)s++;s--;let r=0;for(;e.seq1Range.start+r<n.endExclusive&&e.seq2Range.endExclusive+r<o.endExclusive&&i.isStronglyEqual(e.seq2Range.start+r,e.seq2Range.endExclusive+r)&&r<100;)r++;if(0===s&&0===r)return e;let a=0,l=-1;for(let n=-s;n<=r;n++){const o=e.seq2Range.start+n,s=e.seq2Range.endExclusive+n,r=e.seq1Range.start+n,d=t.getBoundaryScore(r)+i.getBoundaryScore(o)+i.getBoundaryScore(s);d>l&&(l=d,a=n)}return e.delta(a)}function P4(e,t,i,n,o=!1){const s=p4.invert(i,e.length),r=[];let a=new m4(0,0);function l(i,l){if(i.offset1<a.offset1||i.offset2<a.offset2)return;const d=n(e,i.offset1),h=n(t,i.offset2);if(!d||!h)return;let c=new p4(d,h);const u=c.intersect(l);let g=u.seq1Range.length,p=u.seq2Range.length;for(;s.length>0;){const i=s[0];if(!i.seq1Range.intersects(c.seq1Range)&&!i.seq2Range.intersects(c.seq2Range))break;const o=n(e,i.seq1Range.start),r=n(t,i.seq2Range.start),a=new p4(o,r),l=a.intersect(i);if(g+=l.seq1Range.length,p+=l.seq2Range.length,c=c.join(a),!(c.seq1Range.endExclusive>=i.seq1Range.endExclusive))break;s.shift()}(o&&g+p<c.seq1Range.length+c.seq2Range.length||g+p<2*(c.seq1Range.length+c.seq2Range.length)/3)&&r.push(c),a=c.getEndExclusives()}for(;s.length>0;){const e=s.shift();e.seq1Range.isEmpty||(l(e.getStarts(),e),l(e.getEndExclusives().delta(-1),e))}return function(e,t){const i=[];for(;e.length>0||t.length>0;){const n=e[0],o=t[0];let s;s=n&&(!o||n.seq1Range.start<o.seq1Range.start)?e.shift():t.shift(),i.length>0&&i[i.length-1].seq1Range.endExclusive>=s.seq1Range.start?i[i.length-1]=i[i.length-1].join(s):i.push(s)}return i}(i,r)}class F4{constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){return 1e3-((0===e?0:B4(this.lines[e-1]))+(e===this.lines.length?0:B4(this.lines[e])))}getText(e){return this.lines.slice(e.start,e.endExclusive).join("\n")}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function B4(e){let t=0;for(;t<e.length&&(32===e.charCodeAt(t)||9===e.charCodeAt(t));)t++;return t}class W4{constructor(){this.dynamicProgrammingDiffing=new C4,this.myersDiffingAlgorithm=new y4}computeDiff(e,t,i){if(e.length<=1&&es(e,t,((e,t)=>e===t)))return new c4([],[],!1);if(1===e.length&&0===e[0].length||1===t.length&&0===t[0].length)return new c4([new L2(new ym(1,e.length+1),new ym(1,t.length+1),[new D2(new Yu(1,1,e.length,e[e.length-1].length+1),new Yu(1,1,t.length,t[t.length-1].length+1))])],[],!1);const n=0===i.maxComputationTimeMs?f4.instance:new _4(i.maxComputationTimeMs),o=!i.ignoreTrimWhitespace,s=new Map;function r(e){let t=s.get(e);return void 0===t&&(t=s.size,s.set(e,t)),t}const a=e.map((e=>r(e.trim()))),l=t.map((e=>r(e.trim()))),d=new F4(a,e),h=new F4(l,t),c=(()=>d.length+h.length<1700?this.dynamicProgrammingDiffing.compute(d,h,n,((i,n)=>e[i]===t[n]?0===t[n].length?.1:1+Math.log(1+t[n].length):.99)):this.myersDiffingAlgorithm.compute(d,h,n))();let u=c.diffs,g=c.hitTimeout;u=A4(d,h,u),u=function(e,t,i){let n=i;if(0===n.length)return n;let o,s=0;do{o=!1;const r=[n[0]];for(let a=1;a<n.length;a++){const l=n[a],d=r[r.length-1];function h(t,i){const n=new cm(d.seq1Range.endExclusive,l.seq1Range.start);return e.getText(n).replace(/\s/g,"").length<=4&&(t.seq1Range.length+t.seq2Range.length>5||i.seq1Range.length+i.seq2Range.length>5)}h(d,l)?(o=!0,r[r.length-1]=r[r.length-1].join(l)):r.push(l)}n=r}while(s++<10&&o);return n}(d,0,u);const p=[],m=s=>{if(o)for(let r=0;r<s;r++){const s=f+r,a=_+r;if(e[s]!==t[a]){const r=this.refineDiff(e,t,new p4(new cm(s,s+1),new cm(a,a+1)),n,o,i);for(const e of r.mappings)p.push(e);r.hitTimeout&&(g=!0)}}};let f=0,_=0;for(const s of u){rt((()=>s.seq1Range.start-f==s.seq2Range.start-_)),m(s.seq1Range.start-f),f=s.seq1Range.endExclusive,_=s.seq2Range.endExclusive;const r=this.refineDiff(e,t,s,n,o,i);r.hitTimeout&&(g=!0);for(const e of r.mappings)p.push(e)}m(e.length-f);const v=new RU(e),b=new RU(t),w=E2(p,v,b);let C=[];return i.computeMoves&&(C=this.computeMoves(w,e,t,a,l,n,o,i)),rt((()=>{function i(e,t){if(e.lineNumber<1||e.lineNumber>t.length)return!1;const i=t[e.lineNumber-1];return!(e.column<1||e.column>i.length+1)}function n(e,t){return!(e.startLineNumber<1||e.startLineNumber>t.length+1||e.endLineNumberExclusive<1||e.endLineNumberExclusive>t.length+1)}for(const o of w){if(!o.innerChanges)return!1;for(const n of o.innerChanges)if(!(i(n.modifiedRange.getStartPosition(),t)&&i(n.modifiedRange.getEndPosition(),t)&&i(n.originalRange.getStartPosition(),e)&&i(n.originalRange.getEndPosition(),e)))return!1;if(!n(o.modified,t)||!n(o.original,e))return!1}return!0})),new c4(w,C,g)}computeMoves(e,t,i,n,o,s,r,a){const l=function(e,t,i,n,o,s){let{moves:r,excludedChanges:a}=function(e,t,i,n){const o=[],s=e.filter((e=>e.modified.isEmpty&&e.original.length>=3)).map((e=>new w4(e.original,t,e))),r=new Set(e.filter((e=>e.original.isEmpty&&e.modified.length>=3)).map((e=>new w4(e.modified,i,e)))),a=new Set;for(const e of s){let t,i=-1;for(const n of r){const o=e.computeSimilarity(n);o>i&&(i=o,t=n)}if(i>.9&&t&&(r.delete(t),o.push(new S2(e.range,t.range)),a.add(e.source),a.add(t.source)),!n.isValid())return{moves:o,excludedChanges:a}}return{moves:o,excludedChanges:a}}(e,t,i,s);if(!s.isValid())return[];const l=function(e,t,i,n,o,s){const r=[],a=new dd;for(const i of e)for(let e=i.original.startLineNumber;e<i.original.endLineNumberExclusive-2;e++){const i=`${t[e-1]}:${t[e+1-1]}:${t[e+2-1]}`;a.add(i,{range:new ym(e,e+3)})}const l=[];e.sort(Cs((e=>e.modified.startLineNumber),ys));for(const t of e){let e=[];for(let n=t.modified.startLineNumber;n<t.modified.endLineNumberExclusive-2;n++){const t=`${i[n-1]}:${i[n+1-1]}:${i[n+2-1]}`,o=new ym(n,n+3),s=[];a.forEach(t,(({range:t})=>{for(const i of e)if(i.originalLineRange.endLineNumberExclusive+1===t.endLineNumberExclusive&&i.modifiedLineRange.endLineNumberExclusive+1===o.endLineNumberExclusive)return i.originalLineRange=new ym(i.originalLineRange.startLineNumber,t.endLineNumberExclusive),i.modifiedLineRange=new ym(i.modifiedLineRange.startLineNumber,o.endLineNumberExclusive),void s.push(i);const i={modifiedLineRange:o,originalLineRange:t};l.push(i),s.push(i)})),e=s}if(!s.isValid())return[]}l.sort(xs(Cs((e=>e.modifiedLineRange.length),ys)));const d=new Sm,h=new Sm;for(const e of l){const t=e.modifiedLineRange.startLineNumber-e.originalLineRange.startLineNumber,i=d.subtractFrom(e.modifiedLineRange),n=h.subtractFrom(e.originalLineRange).getWithDelta(t),o=i.getIntersection(n);for(const e of o.ranges){if(e.length<3)continue;const i=e,n=e.delta(-t);r.push(new S2(n,i)),d.addRange(i),h.addRange(n)}}r.sort(Cs((e=>e.original.startLineNumber),ys));const c=new _m(e);for(let t=0;t<r.length;t++){const i=r[t],a=c.findLastMonotonous((e=>e.original.startLineNumber<=i.original.startLineNumber)),l=pm(e,(e=>e.modified.startLineNumber<=i.modified.startLineNumber)),u=Math.max(i.original.startLineNumber-a.original.startLineNumber,i.modified.startLineNumber-l.modified.startLineNumber),g=c.findLastMonotonous((e=>e.original.startLineNumber<i.original.endLineNumberExclusive)),p=pm(e,(e=>e.modified.startLineNumber<i.modified.endLineNumberExclusive)),m=Math.max(g.original.endLineNumberExclusive-i.original.endLineNumberExclusive,p.modified.endLineNumberExclusive-i.modified.endLineNumberExclusive);let f,_;for(f=0;f<u;f++){const e=i.original.startLineNumber-f-1,t=i.modified.startLineNumber-f-1;if(e>n.length||t>o.length)break;if(d.contains(t)||h.contains(e))break;if(!M4(n[e-1],o[t-1],s))break}for(f>0&&(h.addRange(new ym(i.original.startLineNumber-f,i.original.startLineNumber)),d.addRange(new ym(i.modified.startLineNumber-f,i.modified.startLineNumber))),_=0;_<m;_++){const e=i.original.endLineNumberExclusive+_,t=i.modified.endLineNumberExclusive+_;if(e>n.length||t>o.length)break;if(d.contains(t)||h.contains(e))break;if(!M4(n[e-1],o[t-1],s))break}_>0&&(h.addRange(new ym(i.original.endLineNumberExclusive,i.original.endLineNumberExclusive+_)),d.addRange(new ym(i.modified.endLineNumberExclusive,i.modified.endLineNumberExclusive+_))),(f>0||_>0)&&(r[t]=new S2(new ym(i.original.startLineNumber-f,i.original.endLineNumberExclusive+_),new ym(i.modified.startLineNumber-f,i.modified.endLineNumberExclusive+_)))}return r}(e.filter((e=>!a.has(e))),n,o,t,i,s);return fs(r,l),r=function(e){if(0===e.length)return e;e.sort(Cs((e=>e.original.startLineNumber),ys));const t=[e[0]];for(let i=1;i<e.length;i++){const n=t[t.length-1],o=e[i],s=o.original.startLineNumber-n.original.endLineNumberExclusive,r=o.modified.startLineNumber-n.modified.endLineNumberExclusive;s>=0&&r>=0&&s+r<=2?t[t.length-1]=n.join(o):t.push(o)}return t}(r),r=r.filter((e=>{const i=e.original.toOffsetRange().slice(t).map((e=>e.trim()));return i.join("\n").length>=15&&function(e){let t=0;for(const i of e)i.length>=2&&t++;return t}(i)>=2})),r=function(e,t){const i=new _m(e);return t=t.filter((t=>(i.findLastMonotonous((e=>e.original.startLineNumber<t.original.endLineNumberExclusive))||new S2(new ym(1,1),new ym(1,1)))!==pm(e,(e=>e.modified.startLineNumber<t.modified.endLineNumberExclusive)))),t}(e,r),r}(e,t,i,n,o,s).map((e=>{const n=E2(this.refineDiff(t,i,new p4(e.original.toOffsetRange(),e.modified.toOffsetRange()),s,r,a).mappings,new RU(t),new RU(i),!0);return new u4(e,n)}));return l}refineDiff(e,t,i,n,o,s){var r;const a=new S2(new ym((r=i).seq1Range.start+1,r.seq1Range.endExclusive+1),new ym(r.seq2Range.start+1,r.seq2Range.endExclusive+1)).toRangeMapping2(e,t),l=new L4(e,a.originalRange,o),d=new L4(t,a.modifiedRange,o),h=l.length+d.length<500?this.dynamicProgrammingDiffing.compute(l,d,n):this.myersDiffingAlgorithm.compute(l,d,n);let c=h.diffs;c=A4(l,d,c),c=P4(l,d,c,((e,t)=>e.findWordContaining(t))),s.extendToSubwords&&(c=P4(l,d,c,((e,t)=>e.findSubWordContaining(t)),!0)),c=function(e,t,i){const n=[];for(const e of i){const t=n[n.length-1];t&&(e.seq1Range.start-t.seq1Range.endExclusive<=2||e.seq2Range.start-t.seq2Range.endExclusive<=2)?n[n.length-1]=new p4(t.seq1Range.join(e.seq1Range),t.seq2Range.join(e.seq2Range)):n.push(e)}return n}(0,0,c),c=function(e,t,i){let n=i;if(0===n.length)return n;let o,s=0;do{o=!1;const a=[n[0]];for(let l=1;l<n.length;l++){const d=n[l],h=a[a.length-1];function c(i,n){const o=new cm(h.seq1Range.endExclusive,d.seq1Range.start);if(e.countLinesIn(o)>5||o.length>500)return!1;const s=e.getText(o).trim();if(s.length>20||s.split(/\r\n|\r|\n/).length>1)return!1;const r=e.countLinesIn(i.seq1Range),a=i.seq1Range.length,l=t.countLinesIn(i.seq2Range),c=i.seq2Range.length,u=e.countLinesIn(n.seq1Range),g=n.seq1Range.length,p=t.countLinesIn(n.seq2Range),m=n.seq2Range.length;function f(e){return Math.min(e,130)}return Math.pow(Math.pow(f(40*r+a),1.5)+Math.pow(f(40*l+c),1.5),1.5)+Math.pow(Math.pow(f(40*u+g),1.5)+Math.pow(f(40*p+m),1.5),1.5)>74184.96480721243}c(h,d)?(o=!0,a[a.length-1]=a[a.length-1].join(d)):a.push(d)}n=a}while(s++<10&&o);const r=[];return function(e,t){for(let i=0;i<e.length;i++)t(0===i?void 0:e[i-1],e[i],i+1===e.length?void 0:e[i+1])}(n,((t,i,n)=>{let o=i;function s(e){return e.length>0&&e.trim().length<=3&&i.seq1Range.length+i.seq2Range.length>100}const a=e.extendToFullLines(i.seq1Range),l=e.getText(new cm(a.start,i.seq1Range.start));s(l)&&(o=o.deltaStart(-l.length));const d=e.getText(new cm(i.seq1Range.endExclusive,a.endExclusive));s(d)&&(o=o.deltaEnd(d.length));const h=p4.fromOffsetPairs(t?t.getEndExclusives():m4.zero,n?n.getStarts():m4.max),c=o.intersect(h);r.length>0&&c.getStarts().equals(r[r.length-1].getEndExclusives())?r[r.length-1]=r[r.length-1].join(c):r.push(c)})),r}(l,d,c);return{mappings:c.map((e=>new D2(l.translateRange(e.seq1Range),d.translateRange(e.seq2Range)))),hitTimeout:h.hitTimeout}}}let V4=class extends At{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,i){super(),this.model=e,this._options=t,this._diffProviderFactoryService=i,this._isDiffUpToDate=Js(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Js(this,void 0),this.diff=this._diff,this._unchangedRegions=Js(this,void 0),this.unchangedRegions=pr(this,(e=>this._options.hideUnchangedRegions.read(e)?this._unchangedRegions.read(e)?.regions??[]:(Vs((e=>{for(const t of this._unchangedRegions.read(void 0)?.regions||[])t.collapseAll(e)})),[]))),this.movedTextToCompare=Js(this,void 0),this._activeMovedText=Js(this,void 0),this._hoveredMovedText=Js(this,void 0),this.activeMovedText=pr(this,(e=>this.movedTextToCompare.read(e)??this._hoveredMovedText.read(e)??this._activeMovedText.read(e))),this._cancellationTokenSource=new ri,this._diffProvider=pr(this,(e=>{const t=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(e)});return{diffProvider:t,onChangeSignal:Fr("onDidChange",t.onDidChange)}})),this._register(Tt((()=>this._cancellationTokenSource.cancel())));const n=Lr("contentChangedSignal"),o=this._register(new Ci((()=>n.trigger(void 0)),200));this._register(ar((t=>{const i=this._unchangedRegions.read(t);if(!i||i.regions.some((e=>e.isDragged.read(t))))return;const n=i.originalDecorationIds.map((t=>e.original.getDecorationRange(t))).map((e=>e?ym.fromRangeInclusive(e):void 0)),o=i.modifiedDecorationIds.map((t=>e.modified.getDecorationRange(t))).map((e=>e?ym.fromRangeInclusive(e):void 0)),s=i.regions.map(((e,i)=>n[i]&&o[i]?new U4(n[i].startLineNumber,o[i].startLineNumber,n[i].length,e.visibleLineCountTop.read(t),e.visibleLineCountBottom.read(t)):void 0)).filter(mt),r=[];let a=!1;for(const e of ss(s,((e,i)=>e.getHiddenModifiedRange(t).endLineNumberExclusive===i.getHiddenModifiedRange(t).startLineNumber)))if(e.length>1){a=!0;const t=e.reduce(((e,t)=>e+t.lineCount),0),i=new U4(e[0].originalLineNumber,e[0].modifiedLineNumber,t,e[0].visibleLineCountTop.read(void 0),e[e.length-1].visibleLineCountBottom.read(void 0));r.push(i)}else r.push(e[0]);if(a){const t=e.original.deltaDecorations(i.originalDecorationIds,r.map((e=>({range:e.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})))),n=e.modified.deltaDecorations(i.modifiedDecorationIds,r.map((e=>({range:e.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))));Vs((e=>{this._unchangedRegions.set({regions:r,originalDecorationIds:t,modifiedDecorationIds:n},e)}))}})));const s=(t,i,n)=>{const o=U4.fromDiffs(t.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(n),this._options.hideUnchangedRegionsContextLineCount.read(n));let s;const r=this._unchangedRegions.get();if(r){const t=r.originalDecorationIds.map((t=>e.original.getDecorationRange(t))).map((e=>e?ym.fromRangeInclusive(e):void 0)),i=r.modifiedDecorationIds.map((t=>e.modified.getDecorationRange(t))).map((e=>e?ym.fromRangeInclusive(e):void 0)),o=function(e){let t;return e.filter((e=>{const i=((e,t)=>!t||e.modifiedLineNumber>=t.modifiedLineNumber+t.lineCount&&e.originalLineNumber>=t.originalLineNumber+t.lineCount)(e,t);return t=e,i}))}(r.regions.map(((e,n)=>{if(!t[n]||!i[n])return;const o=t[n].length;return new U4(t[n].startLineNumber,i[n].startLineNumber,o,Math.min(e.visibleLineCountTop.get(),o),Math.min(e.visibleLineCountBottom.get(),o-e.visibleLineCountTop.get()))})).filter(mt));let a=o.map((e=>new S2(e.getHiddenOriginalRange(n),e.getHiddenModifiedRange(n))));a=S2.clip(a,ym.ofLength(1,e.original.getLineCount()),ym.ofLength(1,e.modified.getLineCount())),s=S2.inverse(a,e.original.getLineCount(),e.modified.getLineCount())}const a=[];if(s)for(const e of o){const t=s.filter((t=>t.original.intersectsStrict(e.originalUnchangedRange)&&t.modified.intersectsStrict(e.modifiedUnchangedRange)));a.push(...e.setVisibleRanges(t,i))}else a.push(...o);const l=e.original.deltaDecorations(r?.originalDecorationIds||[],a.map((e=>({range:e.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})))),d=e.modified.deltaDecorations(r?.modifiedDecorationIds||[],a.map((e=>({range:e.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))));this._unchangedRegions.set({regions:a,originalDecorationIds:l,modifiedDecorationIds:d},i)};this._register(e.modified.onDidChangeContent((t=>{if(this._diff.get()){Bm.fromModelContentChanges(t.changes);const i=(this._lastDiff,e.original,void e.modified);i&&(this._lastDiff=i,Vs((e=>{this._diff.set(H4.fromDiffResult(this._lastDiff),e),s(i,e);const t=this.movedTextToCompare.get();this.movedTextToCompare.set(t?this._lastDiff.moves.find((e=>e.lineRangeMapping.modified.intersect(t.lineRangeMapping.modified))):void 0,e)})))}this._isDiffUpToDate.set(!1,void 0),o.schedule()}))),this._register(e.original.onDidChangeContent((t=>{if(this._diff.get()){Bm.fromModelContentChanges(t.changes);const i=(this._lastDiff,e.original,void e.modified);i&&(this._lastDiff=i,Vs((e=>{this._diff.set(H4.fromDiffResult(this._lastDiff),e),s(i,e);const t=this.movedTextToCompare.get();this.movedTextToCompare.set(t?this._lastDiff.moves.find((e=>e.lineRangeMapping.modified.intersect(t.lineRangeMapping.modified))):void 0,e)})))}this._isDiffUpToDate.set(!1,void 0),o.schedule()}))),this._register(hr((async(t,i)=>{this._options.hideUnchangedRegionsMinimumLineCount.read(t),this._options.hideUnchangedRegionsContextLineCount.read(t),o.cancel(),n.read(t);const r=this._diffProvider.read(t);r.onChangeSignal.read(t),w$(W4),w$(A4),this._isDiffUpToDate.set(!1,void 0);let a=[];i.add(e.original.onDidChangeContent((e=>{const t=Bm.fromModelContentChanges(e.changes);a=bf(a,t)})));let l=[];i.add(e.modified.onDidChangeContent((e=>{const t=Bm.fromModelContentChanges(e.changes);l=bf(l,t)})));let d=await r.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(t),maxComputationTimeMs:this._options.maxComputationTimeMs.read(t),computeMoves:this._options.showMoves.read(t)},this._cancellationTokenSource.token);var h,c,u;this._cancellationTokenSource.token.isCancellationRequested||e.original.isDisposed()||e.modified.isDisposed()||(h=d,c=e.original,u=e.modified,d={changes:h.changes.map((e=>new L2(e.original,e.modified,e.innerChanges?e.innerChanges.map((e=>function(e,t,i){let n=e.originalRange,o=e.modifiedRange;return 1===n.startColumn&&1===o.startColumn&&(1!==n.endColumn||1!==o.endColumn)&&n.endColumn===t.getLineMaxColumn(n.endLineNumber)&&o.endColumn===i.getLineMaxColumn(o.endLineNumber)&&n.endLineNumber<t.getLineCount()&&o.endLineNumber<i.getLineCount()&&(n=n.setEndPosition(n.endLineNumber+1,1),o=o.setEndPosition(o.endLineNumber+1,1)),new D2(n,o)}(e,c,u))):void 0))),moves:h.moves,identical:h.identical,quitEarly:h.quitEarly},e.original,d=void e.modified??d,e.original,d=void e.modified??d,Vs((e=>{s(d,e),this._lastDiff=d;const t=H4.fromDiffResult(d);this._diff.set(t,e),this._isDiffUpToDate.set(!0,e);const i=this.movedTextToCompare.read(void 0);this.movedTextToCompare.set(i?this._lastDiff.moves.find((e=>e.lineRangeMapping.modified.intersect(i.lineRangeMapping.modified))):void 0,e)})))})))}ensureModifiedLineIsVisible(e,t,i){if(0===this.diff.get()?.mappings.length)return;const n=this._unchangedRegions.get()?.regions||[];for(const o of n)if(o.getHiddenModifiedRange(void 0).contains(e))return void o.showModifiedLine(e,t,i)}ensureOriginalLineIsVisible(e,t,i){if(0===this.diff.get()?.mappings.length)return;const n=this._unchangedRegions.get()?.regions||[];for(const o of n)if(o.getHiddenOriginalRange(void 0).contains(e))return void o.showOriginalLine(e,t,i)}async waitForDiff(){await yr(this.isDiffUpToDate,(e=>e))}serializeState(){const e=this._unchangedRegions.get();return{collapsedRegions:e?.regions.map((e=>({range:e.getHiddenModifiedRange(void 0).serialize()})))}}restoreSerializedState(e){const t=e.collapsedRegions?.map((e=>ym.deserialize(e.range))),i=this._unchangedRegions.get();i&&t&&Vs((e=>{for(const n of i.regions)for(const i of t)if(n.modifiedUnchangedRange.intersect(i)){n.setHiddenModifiedRange(i,e);break}}))}};V4=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(2,l4)],V4);class H4{static fromDiffResult(e){return new H4(e.changes.map((e=>new z4(e))),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,n){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=n}}class z4{constructor(e){this.lineRangeMapping=e}}class U4{static fromDiffs(e,t,i,n,o){const s=L2.inverse(e,t,i),r=[];for(const e of s){let s=e.original.startLineNumber,a=e.modified.startLineNumber,l=e.original.length;const d=1===s&&1===a,h=s+l===t+1&&a+l===i+1;(d||h)&&l>=o+n?(d&&!h&&(l-=o),h&&!d&&(s+=o,a+=o,l-=o),r.push(new U4(s,a,l,0,0))):l>=2*o+n&&(s+=o,a+=o,l-=2*o,r.push(new U4(s,a,l,0,0)))}return r}get originalUnchangedRange(){return ym.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return ym.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,n,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=Js(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Js(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=pr(this,(e=>this.visibleLineCountTop.read(e)+this.visibleLineCountBottom.read(e)===this.lineCount&&!this.isDragged.read(e))),this.isDragged=Js(this,void 0);const s=Math.max(Math.min(n,this.lineCount),0),r=Math.max(Math.min(o,this.lineCount-n),0);st(n===s),st(o===r),this._visibleLineCountTop.set(s,void 0),this._visibleLineCountBottom.set(r,void 0)}setVisibleRanges(e,t){const i=[],n=new Sm(e.map((e=>e.modified))).subtractFrom(this.modifiedUnchangedRange);let o=this.originalLineNumber,s=this.modifiedLineNumber;const r=this.modifiedLineNumber+this.lineCount;if(0===n.ranges.length)this.showAll(t),i.push(this);else{let e=0;for(const a of n.ranges){const l=e===n.ranges.length-1;e++;const d=(l?r:a.endLineNumberExclusive)-s,h=new U4(o,s,d,0,0);h.setHiddenModifiedRange(a,t),i.push(h),o=h.originalUnchangedRange.endLineNumberExclusive,s=h.modifiedUnchangedRange.endLineNumberExclusive}}return i}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return ym.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return ym.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const i=e.startLineNumber-this.modifiedLineNumber,n=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,n,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const i=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,i),t)}showMoreBelow(e=10,t){const i=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,i),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t,i){const n=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),o=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;0===t&&n<o||1===t?this._visibleLineCountTop.set(this._visibleLineCountTop.get()+n,i):this._visibleLineCountBottom.set(this._visibleLineCountBottom.get()+o,i)}showOriginalLine(e,t,i){const n=e-this.originalLineNumber,o=this.originalLineNumber+this.lineCount-e;0===t&&n<o||1===t?this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+o-n,this.getMaxVisibleLineCountTop()),i):this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+n-o,this.getMaxVisibleLineCountBottom()),i)}collapseAll(e){this._visibleLineCountTop.set(0,e),this._visibleLineCountBottom.set(0,e)}setState(e,t,i){e=Math.max(Math.min(e,this.lineCount),0),t=Math.max(Math.min(t,this.lineCount-e),0),this._visibleLineCountTop.set(e,i),this._visibleLineCountBottom.set(t,i)}}class K4 extends At{get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}constructor(e,t,i,n,o,s,r,a,l){super(),this._getViewZoneId=e,this._marginDomNode=t,this._modifiedEditor=i,this._diff=n,this._editor=o,this._viewLineCounts=s,this._originalTextModel=r,this._contextMenuService=a,this._clipboardService=l,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=vh.asClassName(fh.lightBulb)+" lightbulb-glyph",this._diffActions.style.position="absolute";const d=this._modifiedEditor.getOption(75);this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=`${d}px`,this._diffActions.style.lineHeight=`${d}px`,this._marginDomNode.appendChild(this._diffActions);let h=0;const c=i.getOption(144)&&!X,u=(e,t)=>{this._contextMenuService.showContextMenu({domForShadowRoot:c?i.getDomNode()??void 0:void 0,getAnchor:()=>({x:e,y:t}),getActions:()=>{const e=[],t=n.modified.isEmpty;return e.push(new dc("diff.clipboard.copyDeletedContent",t?n.original.length>1?y(109,"Copy deleted lines"):y(110,"Copy deleted line"):n.original.length>1?y(111,"Copy changed lines"):y(112,"Copy changed line"),void 0,!0,(async()=>{const e=this._originalTextModel.getValueInRange(n.original.toExclusiveRange());await this._clipboardService.writeText(e)}))),n.original.length>1&&e.push(new dc("diff.clipboard.copyDeletedLineContent",t?y(113,"Copy deleted line ({0})",n.original.startLineNumber+h):y(114,"Copy changed line ({0})",n.original.startLineNumber+h),void 0,!0,(async()=>{let e=this._originalTextModel.getLineContent(n.original.startLineNumber+h);""===e&&(e=0===this._originalTextModel.getEndOfLineSequence()?"\n":"\r\n"),await this._clipboardService.writeText(e)}))),i.getOption(104)||e.push(new dc("diff.inline.revertChange",y(115,"Revert this change"),void 0,!0,(async()=>{this._editor.revert(this._diff)}))),e},autoSelectFirstItem:!0})};this._register(ma(this._diffActions,"mousedown",(e=>{if(!e.leftButton)return;const{top:t,height:i}=Na(this._diffActions),n=Math.floor(d/3);e.preventDefault(),u(e.posx,t+i+n)}))),this._register(i.onMouseMove((e=>{8!==e.target.type&&5!==e.target.type||e.target.detail.viewZoneId!==this._getViewZoneId()?this.visibility=!1:(h=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,d),this.visibility=!0)}))),this._register(i.onMouseDown((e=>{!e.event.leftButton||8!==e.target.type&&5!==e.target.type||e.target.detail.viewZoneId===this._getViewZoneId()&&(e.event.preventDefault(),h=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,d),u(e.event.posx,e.event.posy+d))})))}_updateLightBulbPosition(e,t,i){const{top:n}=Na(e),o=t-n,s=Math.floor(o/i),r=s*i;if(this._diffActions.style.top=`${r}px`,this._viewLineCounts){let e=0;for(let t=0;t<this._viewLineCounts.length;t++)if(e+=this._viewLineCounts[t],s<e)return t}return s}}const j4=GI("diffEditorWidget",{createHTML:e=>e});function q4(e,t,i,n,o=!1){iT(n,t.fontInfo);const s=i.length>0,r=new Xg(1e4);let a=0,l=0;const d=[];for(let n=0;n<e.lineTokens.length;n++){const h=n+1,c=e.lineTokens[n],u=e.lineBreakData[n],g=WB.filter(i,h,1,Number.MAX_SAFE_INTEGER);if(u){let i=0;for(const n of u.breakOffsets){const d=c.sliceAndInflate(i,n,0);a=Math.max(a,Z4(l,d,WB.extractWrapped(g,i,n),s,e.mightContainNonBasicASCII,e.mightContainRTL,t,r,o)),l++,i=n}d.push(u.breakOffsets.length)}else d.push(1),a=Math.max(a,Z4(l,c,g,s,e.mightContainNonBasicASCII,e.mightContainRTL,t,r,o)),l++}a+=t.scrollBeyondLastColumn;const h=r.build(),c=j4?j4.createHTML(h):h;return n.innerHTML=c,{heightInLines:l,minWidthInPx:a*t.typicalHalfwidthCharacterWidth,viewLineCounts:d}}class $4{constructor(e,t=e.map((e=>null)),i=!0,n=!0){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=n}}class G4{static fromEditor(e){const t=e.getOptions(),i=t.get(59),n=t.get(165);return new G4(e.getModel()?.getOptions().tabSize||0,i,t.get(40),i.typicalHalfwidthCharacterWidth,t.get(118),t.get(75),n.decorationsWidth,t.get(133),t.get(113),t.get(108),t.get(60),t.get(117).verticalScrollbarSize)}constructor(e,t,i,n,o,s,r,a,l,d,h,c,u=!0){this.tabSize=e,this.fontInfo=t,this.disableMonospaceOptimizations=i,this.typicalHalfwidthCharacterWidth=n,this.scrollBeyondLastColumn=o,this.lineHeight=s,this.lineDecorationsWidth=r,this.stopRenderingLineAfter=a,this.renderWhitespace=l,this.renderControlCharacters=d,this.fontLigatures=h,this.verticalScrollbarSize=c,this.setWidth=u}withSetWidth(e){return new G4(this.tabSize,this.fontInfo,this.disableMonospaceOptimizations,this.typicalHalfwidthCharacterWidth,this.scrollBeyondLastColumn,this.lineHeight,this.lineDecorationsWidth,this.stopRenderingLineAfter,this.renderWhitespace,this.renderControlCharacters,this.fontLigatures,this.verticalScrollbarSize,e)}withScrollBeyondLastColumn(e){return new G4(this.tabSize,this.fontInfo,this.disableMonospaceOptimizations,this.typicalHalfwidthCharacterWidth,e,this.lineHeight,this.lineDecorationsWidth,this.stopRenderingLineAfter,this.renderWhitespace,this.renderControlCharacters,this.fontLigatures,this.verticalScrollbarSize,this.setWidth)}}function Z4(e,t,i,n,o,s,r,a,l){a.appendString('<div class="view-line'),l||n||a.appendString(" char-delete"),a.appendString('" style="top:'),a.appendString(String(e*r.lineHeight)),r.setWidth?a.appendString('px;width:1000000px;">'):a.appendString('px;">');const d=t.getLineContent(),h=DH.isBasicASCII(d,o),c=DH.containsRTL(d,h,s),u=GB(new KB(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,d,!1,h,c,0,t,i,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==eP.OFF,null,null,r.verticalScrollbarSize),a);return a.appendString("</div>"),u.characterMapping.getHorizontalOffset(u.characterMapping.length)}var Y4=function(e,t){return function(i,n){t(i,n,e)}};let Q4=class extends At{constructor(e,t,i,n,o,s,r,a,l,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=n,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=s,this._origViewZonesToIgnore=r,this._modViewZonesToIgnore=a,this._clipboardService=l,this._contextMenuService=d,this._originalTopPadding=Js(this,0),this._originalScrollOffset=Js(this,0),this._originalScrollOffsetAnimated=u2(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=Js(this,0),this._modifiedScrollOffset=Js(this,0),this._modifiedScrollOffsetAnimated=u2(this._targetWindow,this._modifiedScrollOffset,this._store);const h=Js("invalidateAlignmentsState",0),c=this._register(new Ci((()=>{h.set(h.get()+1,void 0)}),0));this._register(this._editors.original.onDidChangeViewZones((e=>{this._canIgnoreViewZoneUpdateEvent()||c.schedule()}))),this._register(this._editors.modified.onDidChangeViewZones((e=>{this._canIgnoreViewZoneUpdateEvent()||c.schedule()}))),this._register(this._editors.original.onDidChangeConfiguration((e=>{(e.hasChanged(166)||e.hasChanged(75))&&c.schedule()}))),this._register(this._editors.modified.onDidChangeConfiguration((e=>{(e.hasChanged(166)||e.hasChanged(75))&&c.schedule()})));const u=this._diffModel.map((e=>e?Sr(this,e.model.original.onDidChangeTokens,(()=>2===e.model.original.tokenization.backgroundTokenizationState)):void 0)).map(((e,t)=>e?.read(t))),g=pr((e=>{const t=this._diffModel.read(e),i=t?.diff.read(e);if(!t||!i)return null;h.read(e);const n=this._options.renderSideBySide.read(e);return X4(this._editors.original,this._editors.modified,i.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,n)})),p=pr((e=>{const t=this._diffModel.read(e)?.movedTextToCompare.read(e);if(!t)return null;h.read(e);const i=t.changes.map((e=>new z4(e)));return X4(this._editors.original,this._editors.modified,i,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)}));function m(){const e=document.createElement("div");return e.className="diagonal-fill",e}const f=this._register(new Mt);this.viewZones=pr(this,(e=>{f.clear();const t=g.read(e)||[],i=[],n=[],s=this._modifiedTopPadding.read(e);s>0&&n.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:s,showInHiddenAreas:!0,suppressMouseDown:!0});const r=this._originalTopPadding.read(e);r>0&&i.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:r,showInHiddenAreas:!0,suppressMouseDown:!0});const a=this._options.renderSideBySide.read(e),l=a?void 0:this._editors.modified._getViewModel()?.createLineBreaksComputer();if(l){const C=this._editors.original.getModel();for(const y of t)if(y.diff)for(let S=y.originalRange.startLineNumber;S<y.originalRange.endLineNumberExclusive;S++){if(S>C.getLineCount())return{orig:i,mod:n};l?.addRequest(C.getLineContent(S),null,null)}}const d=l?.finalize()??[];let h=0;const c=this._editors.modified.getOption(75),_=this._diffModel.read(e)?.movedTextToCompare.read(e),v=this._editors.original.getModel()?.mightContainNonBasicASCII()??!1,b=this._editors.original.getModel()?.mightContainRTL()??!1,w=G4.fromEditor(this._editors.modified);for(const x of t)if(!x.diff||a||this._options.useTrueInlineDiffRendering.read(e)&&e5(x.diff)){const k=x.modifiedHeightInPx-x.originalHeightInPx;if(k>0){if(_?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(x.originalRange.endLineNumberExclusive-1))continue;i.push({afterLineNumber:x.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:k,showInHiddenAreas:!0,suppressMouseDown:!0})}else{if(_?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(x.modifiedRange.endLineNumberExclusive-1))continue;function L(){const t=document.createElement("div");return t.className="arrow-revert-change "+vh.asClassName(fh.arrowRight),e.store.add(ga(t,"mousedown",(e=>e.stopPropagation()))),e.store.add(ga(t,"click",(e=>{e.stopPropagation(),o.revert(x.diff)}))),ll("div",{},t)}let D;x.diff&&x.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(e)&&(D=L()),n.push({afterLineNumber:x.modifiedRange.endLineNumberExclusive-1,domNode:m(),heightInPx:-k,marginDomNode:D,showInHiddenAreas:!0,suppressMouseDown:!0})}}else{if(!x.originalRange.isEmpty){u.read(e);const N=document.createElement("div");N.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const I=this._editors.original.getModel();if(x.originalRange.endLineNumberExclusive-1>I.getLineCount())return{orig:i,mod:n};const T=new $4(x.originalRange.mapToLineArray((e=>I.tokenization.getLineTokens(e))),x.originalRange.mapToLineArray((e=>d[h++])),v,b),M=[];for(const P of x.diff.innerChanges||[])M.push(new kj(P.originalRange.delta(-(x.diff.original.startLineNumber-1)),i4.className,0));const A=q4(T,w,M,N),R=document.createElement("div");if(R.className="inline-deleted-margin-view-zone",iT(R,w.fontInfo),this._options.renderIndicators.read(e))for(let F=0;F<A.heightInLines;F++){const B=document.createElement("div");B.className=`delete-sign ${vh.asClassName(G2)}`,B.setAttribute("style",`position:absolute;top:${F*c}px;width:${w.lineDecorationsWidth}px;height:${c}px;right:0;`),R.appendChild(B)}let O;f.add(new K4((()=>vt(O)),R,this._editors.modified,x.diff,this._diffEditorWidget,A.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let W=0;W<A.viewLineCounts.length;W++){const V=A.viewLineCounts[W];V>1&&i.push({afterLineNumber:x.originalRange.startLineNumber+W,domNode:m(),heightInPx:(V-1)*c,showInHiddenAreas:!0,suppressMouseDown:!0})}n.push({afterLineNumber:x.modifiedRange.startLineNumber-1,domNode:N,heightInPx:A.heightInLines*c,minWidthInPx:A.minWidthInPx,marginDomNode:R,setZoneId(e){O=e},showInHiddenAreas:!0,suppressMouseDown:!0})}const E=document.createElement("div");E.className="gutter-delete",i.push({afterLineNumber:x.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:x.modifiedHeightInPx,marginDomNode:E,showInHiddenAreas:!0,suppressMouseDown:!0})}for(const H of p.read(e)??[]){if(!_?.lineRangeMapping.original.intersect(H.originalRange)||!_?.lineRangeMapping.modified.intersect(H.modifiedRange))continue;const z=H.modifiedHeightInPx-H.originalHeightInPx;z>0?i.push({afterLineNumber:H.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:z,showInHiddenAreas:!0,suppressMouseDown:!0}):n.push({afterLineNumber:H.modifiedRange.endLineNumberExclusive-1,domNode:m(),heightInPx:-z,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:i,mod:n}}));let _=!1;this._register(this._editors.original.onDidScrollChange((e=>{e.scrollLeftChanged&&!_&&(_=!0,this._editors.modified.setScrollLeft(e.scrollLeft),_=!1)}))),this._register(this._editors.modified.onDidScrollChange((e=>{e.scrollLeftChanged&&!_&&(_=!0,this._editors.original.setScrollLeft(e.scrollLeft),_=!1)}))),this._originalScrollTop=Sr(this._editors.original.onDidScrollChange,(()=>this._editors.original.getScrollTop())),this._modifiedScrollTop=Sr(this._editors.modified.onDidScrollChange,(()=>this._editors.modified.getScrollTop())),this._register(ar((e=>{const t=this._originalScrollTop.read(e)-(this._originalScrollOffsetAnimated.read(void 0)-this._modifiedScrollOffsetAnimated.read(e))-(this._originalTopPadding.read(void 0)-this._modifiedTopPadding.read(e));t!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(t,1)}))),this._register(ar((e=>{const t=this._modifiedScrollTop.read(e)-(this._modifiedScrollOffsetAnimated.read(void 0)-this._originalScrollOffsetAnimated.read(e))-(this._modifiedTopPadding.read(void 0)-this._originalTopPadding.read(e));t!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(t,1)}))),this._register(ar((e=>{const t=this._diffModel.read(e)?.movedTextToCompare.read(e);let i=0;if(t){const e=this._editors.original.getTopForLineNumber(t.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.read(void 0);i=this._editors.modified.getTopForLineNumber(t.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.read(void 0)-e}i>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(i,void 0)):i<0?(this._modifiedTopPadding.set(-i,void 0),this._originalTopPadding.set(0,void 0)):setTimeout((()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)}),400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.read(void 0)-i,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.read(void 0)+i,void 0,!0)})))}};function X4(e,t,i,n,o,s){const r=new ks(J4(e,n)),a=new ks(J4(t,o)),l=e.getOption(75),d=t.getOption(75),h=[];let c=0,u=0;function g(e,t){for(;;){let i=r.peek(),n=a.peek();if(i&&i.lineNumber>=e&&(i=void 0),n&&n.lineNumber>=t&&(n=void 0),!i&&!n)break;const o=i?i.lineNumber-c:Number.MAX_VALUE,s=n?n.lineNumber-u:Number.MAX_VALUE;o<s?(r.dequeue(),n={lineNumber:i.lineNumber-c+u,heightInPx:0}):o>s?(a.dequeue(),i={lineNumber:n.lineNumber-u+c,heightInPx:0}):(r.dequeue(),a.dequeue()),h.push({originalRange:ym.ofLength(i.lineNumber,1),modifiedRange:ym.ofLength(n.lineNumber,1),originalHeightInPx:l+i.heightInPx,modifiedHeightInPx:d+n.heightInPx,diff:void 0})}}for(const p of i){const m=p.lineRangeMapping;g(m.original.startLineNumber,m.modified.startLineNumber);let f=!0,_=m.modified.startLineNumber,v=m.original.startLineNumber;function b(e,t,i=!1){if(e<v||t<_)return;if(f)f=!1;else if(!i&&(e===v||t===_))return;const n=new ym(v,e),o=new ym(_,t);if(n.isEmpty&&o.isEmpty)return;const s=r.takeWhile((t=>t.lineNumber<e))?.reduce(((e,t)=>e+t.heightInPx),0)??0,c=a.takeWhile((e=>e.lineNumber<t))?.reduce(((e,t)=>e+t.heightInPx),0)??0;h.push({originalRange:n,modifiedRange:o,originalHeightInPx:n.length*l+s,modifiedHeightInPx:o.length*d+c,diff:p.lineRangeMapping}),v=e,_=t}if(s)for(const w of m.innerChanges||[]){w.originalRange.startColumn>1&&w.modifiedRange.startColumn>1&&b(w.originalRange.startLineNumber,w.modifiedRange.startLineNumber);const C=e.getModel(),y=w.originalRange.endLineNumber<=C.getLineCount()?C.getLineMaxColumn(w.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;w.originalRange.endColumn<y&&b(w.originalRange.endLineNumber,w.modifiedRange.endLineNumber)}b(m.original.endLineNumberExclusive,m.modified.endLineNumberExclusive,!0),c=m.original.endLineNumberExclusive,u=m.modified.endLineNumberExclusive}return g(Number.MAX_VALUE,Number.MAX_VALUE),h}function J4(e,t){const i=[],n=[],o=-1!==e.getOption(166).wrappingColumn,s=e._getViewModel().coordinatesConverter,r=e.getOption(75);if(o)for(let t=1;t<=e.getModel().getLineCount();t++){const e=s.getModelLineViewLineCount(t);e>1&&n.push({lineNumber:t,heightInPx:r*(e-1)})}for(const n of e.getWhitespaces()){if(t.has(n.id))continue;const e=0===n.afterLineNumber?0:s.convertViewPositionToModelPosition(new rc(n.afterLineNumber,1)).lineNumber;i.push({lineNumber:e,heightInPx:n.height})}const a=function(e,t,i){if(0===e.length)return t;if(0===t.length)return e;const n=[];let o=0,s=0;for(;o<e.length&&s<t.length;){const l=e[o],d=t[s],h=i(l),c=i(d);h<c?(n.push(l),o++):h>c?(n.push(d),s++):(n.push((a=d,{lineNumber:(r=l).lineNumber,heightInPx:r.heightInPx+a.heightInPx})),o++,s++)}for(var r,a;o<e.length;)n.push(e[o]),o++;for(;s<t.length;)n.push(t[s]),s++;return n}(i,n,(e=>e.lineNumber));return a}function e5(e){return!!e.innerChanges&&e.innerChanges.every((e=>t5(e.modifiedRange)&&t5(e.originalRange)||e.originalRange.equalsRange(new Yu(1,1,1,1))))}function t5(e){return e.startLineNumber===e.endLineNumber}Q4=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Y4(8,oD),Y4(9,DR)],Q4);class i5 extends At{static{this.movedCodeBlockPadding=4}constructor(e,t,i,n,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=n,this._editors=o,this._originalScrollTop=Sr(this,this._editors.original.onDidScrollChange,(()=>this._editors.original.getScrollTop())),this._modifiedScrollTop=Sr(this,this._editors.modified.onDidScrollChange,(()=>this._editors.modified.getScrollTop())),this._viewZonesChanged=Fr("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Js(this,0),this._modifiedViewZonesChangedSignal=Fr("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=Fr("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=pr(this,(e=>{this._element.replaceChildren();const t=this._diffModel.read(e),i=t?.diff.read(e)?.movedTexts;if(!i||0===i.length)return void this.width.set(0,void 0);this._viewZonesChanged.read(e);const n=this._originalEditorLayoutInfo.read(e),o=this._modifiedEditorLayoutInfo.read(e);if(!n||!o)return void this.width.set(0,void 0);this._modifiedViewZonesChangedSignal.read(e),this._originalViewZonesChangedSignal.read(e);const s=i.map((t=>{function i(e,t){return(t.getTopForLineNumber(e.startLineNumber,!0)+t.getTopForLineNumber(e.endLineNumberExclusive,!0))/2}const n=i(t.lineRangeMapping.original,this._editors.original),o=this._originalScrollTop.read(e),s=i(t.lineRangeMapping.modified,this._editors.modified),r=n-o,a=s-this._modifiedScrollTop.read(e),l=Math.min(n,s),d=Math.max(n,s);return{range:new cm(l,d),from:r,to:a,fromWithoutScroll:n,toWithoutScroll:s,move:t}}));s.sort(function(...e){return(t,i)=>{for(const n of e){const e=n(t,i);if(!ws.isNeitherLessOrGreaterThan(e))return e}return ws.neitherLessOrGreaterThan}}(Cs((e=>e.fromWithoutScroll>e.toWithoutScroll),Ss),Cs((e=>e.fromWithoutScroll>e.toWithoutScroll?e.fromWithoutScroll:-e.toWithoutScroll),ys)));const r=n5.compute(s.map((e=>e.range))),a=n.verticalScrollbarWidth,l=10*(r.getTrackCount()-1)+20,d=a+l+(o.contentLeft-i5.movedCodeBlockPadding);let h=0;for(const i of s){const n=a+10+10*r.getTrack(h),s=15,l=15,c=d,u=o.glyphMarginWidth+o.lineNumbersWidth,g=18,p=document.createElementNS("http://www.w3.org/2000/svg","rect");p.classList.add("arrow-rectangle"),p.setAttribute("x",""+(c-u)),p.setAttribute("y",""+(i.to-g/2)),p.setAttribute("width",`${u}`),p.setAttribute("height",`${g}`),this._element.appendChild(p);const m=document.createElementNS("http://www.w3.org/2000/svg","g"),f=document.createElementNS("http://www.w3.org/2000/svg","path");f.setAttribute("d",`M 0 ${i.from} L ${n} ${i.from} L ${n} ${i.to} L ${c-l} ${i.to}`),f.setAttribute("fill","none"),m.appendChild(f);const _=document.createElementNS("http://www.w3.org/2000/svg","polygon");_.classList.add("arrow"),e.store.add(ar((e=>{f.classList.toggle("currentMove",i.move===t.activeMovedText.read(e)),_.classList.toggle("currentMove",i.move===t.activeMovedText.read(e))}))),_.setAttribute("points",`${c-l},${i.to-s/2} ${c},${i.to} ${c-l},${i.to+s/2}`),m.appendChild(_),this._element.appendChild(m),h++}this.width.set(l,void 0)})),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(Tt((()=>this._element.remove()))),this._register(ar((e=>{const t=this._originalEditorLayoutInfo.read(e),i=this._modifiedEditorLayoutInfo.read(e);t&&i&&(this._element.style.left=t.width-t.verticalScrollbarWidth+"px",this._element.style.height=`${t.height}px`,this._element.style.width=`${t.verticalScrollbarWidth+t.contentLeft-i5.movedCodeBlockPadding+this.width.read(e)}px`)}))),this._register(Nr(this._state));const s=pr((e=>{const t=this._diffModel.read(e),i=t?.diff.read(e);return i?i.movedTexts.map((e=>({move:e,original:new p2(Or(e.lineRangeMapping.original.startLineNumber-1),18),modified:new p2(Or(e.lineRangeMapping.modified.startLineNumber-1),18)}))):[]}));this._register(_2(this._editors.original,s.map((e=>e.map((e=>e.original)))))),this._register(_2(this._editors.modified,s.map((e=>e.map((e=>e.modified)))))),this._register(hr(((e,t)=>{const i=s.read(e);for(const e of i)t.add(new o5(this._editors.original,e.original,e.move,"original",this._diffModel.get())),t.add(new o5(this._editors.modified,e.modified,e.move,"modified",this._diffModel.get()))})));const r=Fr("original.onDidFocusEditorWidget",(e=>this._editors.original.onDidFocusEditorWidget((()=>setTimeout((()=>e(void 0)),0))))),a=Fr("modified.onDidFocusEditorWidget",(e=>this._editors.modified.onDidFocusEditorWidget((()=>setTimeout((()=>e(void 0)),0)))));let l="modified";this._register(dr({changeTracker:{createChangeSummary:()=>{},handleChange:(e,t)=>(e.didChange(r)&&(l="original"),e.didChange(a)&&(l="modified"),!0)}},(e=>{r.read(e),a.read(e);const t=this._diffModel.read(e);if(!t)return;const i=t.diff.read(e);let n;if(i&&"original"===l){const t=this._editors.originalCursor.read(e);t&&(n=i.movedTexts.find((e=>e.lineRangeMapping.original.contains(t.lineNumber))))}if(i&&"modified"===l){const t=this._editors.modifiedCursor.read(e);t&&(n=i.movedTexts.find((e=>e.lineRangeMapping.modified.contains(t.lineNumber))))}n!==t.movedTextToCompare.read(void 0)&&t.movedTextToCompare.set(void 0,void 0),t.setActiveMovedText(n)})))}}class n5{static compute(e){const t=[],i=[];for(const n of e){let e=t.findIndex((e=>!e.intersectsStrict(n)));if(-1===e){const i=6;t.length>=i?e=Cm(t,Cs((e=>e.intersectWithRangeLength(n)),ys)):(e=t.length,t.push(new um))}t[e].addRange(n),i.push(e)}return new n5(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class o5 extends g2{constructor(e,t,i,n,o){const s=fl("div.diff-hidden-lines-widget");super(e,t,s.root),this._editor=e,this._move=i,this._kind=n,this._diffModel=o,this._nodes=fl("div.diff-moved-code-block",{style:{marginRight:"4px"}},[fl("div.text-content@textContent"),fl("div.action-bar@actionBar")]),s.root.appendChild(this._nodes.root);const r=Sr(this._editor.onDidLayoutChange,(()=>this._editor.getLayoutInfo()));let a;this._register(f2(this._nodes.root,{paddingRight:r.map((e=>e.verticalScrollbarWidth))})),a=i.changes.length>0?"original"===this._kind?y(128,"Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):y(129,"Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):"original"===this._kind?y(130,"Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):y(131,"Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const l=this._register(new uR(this._nodes.actionBar,{highlightToggledItems:!0})),d=new dc("",a,"",!1);l.push(d,{icon:!1,label:!0});const h=new dc("","Compare",vh.asClassName(fh.compareChanges),!0,(()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)}));this._register(ar((e=>{const t=this._diffModel.movedTextToCompare.read(e)===i;h.checked=t}))),l.push(h,{icon:!1,label:!0})}}class s5 extends At{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=pr(this,(e=>{const t=this._diffModel.read(e),i=t?.diff.read(e);if(!i)return null;const n=this._diffModel.read(e).movedTextToCompare.read(e),o=this._options.renderIndicators.read(e),s=this._options.showEmptyDecorations.read(e),r=[],a=[];if(!n)for(const n of i.mappings)if(n.lineRangeMapping.original.isEmpty||r.push({range:n.lineRangeMapping.original.toInclusiveRange(),options:o?Y2:X2}),n.lineRangeMapping.modified.isEmpty||a.push({range:n.lineRangeMapping.modified.toInclusiveRange(),options:o?Z2:Q2}),n.lineRangeMapping.modified.isEmpty||n.lineRangeMapping.original.isEmpty)n.lineRangeMapping.original.isEmpty||r.push({range:n.lineRangeMapping.original.toInclusiveRange(),options:n4}),n.lineRangeMapping.modified.isEmpty||a.push({range:n.lineRangeMapping.modified.toInclusiveRange(),options:e4});else{const i=this._options.useTrueInlineDiffRendering.read(e)&&e5(n.lineRangeMapping);for(const e of n.lineRangeMapping.innerChanges||[])if(n.lineRangeMapping.original.contains(e.originalRange.startLineNumber)&&r.push({range:e.originalRange,options:e.originalRange.isEmpty()&&s?o4:i4}),n.lineRangeMapping.modified.contains(e.modifiedRange.startLineNumber)&&a.push({range:e.modifiedRange,options:e.modifiedRange.isEmpty()&&s&&!i?t4:J2}),i){const i=t.model.original.getValueInRange(e.originalRange);a.push({range:e.modifiedRange,options:{description:"deleted-text",before:{content:i,inlineClassName:"inline-deleted-text"},zIndex:1e5,showIfCollapsed:!0}})}}if(n)for(const e of n.changes){const t=e.original.toInclusiveRange();t&&r.push({range:t,options:o?Y2:X2});const i=e.modified.toInclusiveRange();i&&a.push({range:i,options:o?Z2:Q2});for(const t of e.innerChanges||[])r.push({range:t.originalRange,options:i4}),a.push({range:t.modifiedRange,options:J2})}const l=this._diffModel.read(e).activeMovedText.read(e);for(const e of i.movedTexts)r.push({range:e.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(e===l?" currentMove":""),blockPadding:[i5.movedCodeBlockPadding,0,i5.movedCodeBlockPadding,i5.movedCodeBlockPadding]}}),a.push({range:e.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(e===l?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:r,modifiedDecorations:a}})),this._register(d2(this._editors.original,this._decorations.map((e=>e?.originalDecorations||[])))),this._register(d2(this._editors.modified,this._decorations.map((e=>e?.modifiedDecorations||[]))))}}var r5;let a5=class extends At{static{r5=this}static{this.ONE_OVERVIEW_WIDTH=15}static{this.ENTIRE_DIFF_OVERVIEW_WIDTH=2*this.ONE_OVERVIEW_WIDTH}constructor(e,t,i,n,o,s,r){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=n,this._rootHeight=o,this._modifiedEditorLayoutInfo=s,this._themeService=r,this.width=r5.ENTIRE_DIFF_OVERVIEW_WIDTH;const a=Sr(this._themeService.onDidColorThemeChange,(()=>this._themeService.getColorTheme())),l=pr((e=>{const t=a.read(e);return{insertColor:t.getColor(j_)||(t.getColor(z_)||V_).transparent(2),removeColor:t.getColor(q_)||(t.getColor(U_)||H_).transparent(2)}})),d=tT(document.createElement("div"));d.setClassName("diffViewport"),d.setPosition("absolute");const h=fl("div.diffOverview",{style:{position:"absolute",top:"0px",width:r5.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(h2(h,d.domNode)),this._register(ma(h,Qa.POINTER_DOWN,(e=>{this._editors.modified.delegateVerticalScrollbarPointerDown(e)}))),this._register(ga(h,Qa.MOUSE_WHEEL,(e=>{this._editors.modified.delegateScrollFromMouseWheelEvent(e)}),{passive:!1})),this._register(h2(this._rootElement,h)),this._register(hr(((e,t)=>{const i=this._diffModel.read(e),n=this._editors.original.createOverviewRuler("original diffOverviewRuler");n&&(t.add(n),t.add(h2(h,n.getDomNode())));const o=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(o&&(t.add(o),t.add(h2(h,o.getDomNode()))),!n||!o)return;const s=Fr("viewZoneChanged",this._editors.original.onDidChangeViewZones),r=Fr("viewZoneChanged",this._editors.modified.onDidChangeViewZones),a=Fr("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),c=Fr("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);t.add(ar((e=>{s.read(e),r.read(e),a.read(e),c.read(e);const t=l.read(e),d=i?.diff.read(e)?.mappings;function h(e,t,i){const n=i._getViewModel();return n?e.filter((e=>e.length>0)).map((e=>{const i=n.coordinatesConverter.convertModelPositionToViewPosition(new rc(e.startLineNumber,1)),o=n.coordinatesConverter.convertModelPositionToViewPosition(new rc(e.endLineNumberExclusive,1)),s=o.lineNumber-i.lineNumber;return new MH(i.lineNumber,o.lineNumber,s,t.toString())})):[]}const u=h((d||[]).map((e=>e.lineRangeMapping.original)),t.removeColor,this._editors.original),g=h((d||[]).map((e=>e.lineRangeMapping.modified)),t.insertColor,this._editors.modified);n?.setZones(u),o?.setZones(g)}))),t.add(ar((e=>{const t=this._rootHeight.read(e),i=this._rootWidth.read(e),s=this._modifiedEditorLayoutInfo.read(e);if(s){const i=r5.ENTIRE_DIFF_OVERVIEW_WIDTH-2*r5.ONE_OVERVIEW_WIDTH;n.setLayout({top:0,height:t,right:i+r5.ONE_OVERVIEW_WIDTH,width:r5.ONE_OVERVIEW_WIDTH}),o.setLayout({top:0,height:t,right:0,width:r5.ONE_OVERVIEW_WIDTH});const r=this._editors.modifiedScrollTop.read(e),a=this._editors.modifiedScrollHeight.read(e),l=this._editors.modified.getOption(117),h=new $M(l.verticalHasArrows?l.arrowSize:0,l.verticalScrollbarSize,0,s.height,a,r);d.setTop(h.getSliderPosition()),d.setHeight(h.getSliderSize())}else d.setTop(0),d.setHeight(0);h.style.height=t+"px",h.style.left=i-r5.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",d.setWidth(r5.ENTIRE_DIFF_OVERVIEW_WIDTH)})))})))}};a5=r5=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(6,sw)],a5);var l5=function(e,t){return function(i,n){t(i,n,e)}};let d5=class extends At{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,n,o,s,r,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._argCodeEditorWidgetOptions=n,this._createInnerEditor=o,this._contextKeyService=s,this._instantiationService=r,this._keybindingService=a,this.original=this._register(this._createLeftHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.modifiedEditor||{})),this._onDidContentSizeChange=this._register(new Zt),this.modifiedScrollTop=Sr(this,this.modified.onDidScrollChange,(()=>this.modified.getScrollTop())),this.modifiedScrollHeight=Sr(this,this.modified.onDidScrollChange,(()=>this.modified.getScrollHeight())),this.modifiedObs=bY(this.modified),this.originalObs=bY(this.original),this.modifiedModel=this.modifiedObs.model,this.modifiedSelections=Sr(this,this.modified.onDidChangeCursorSelection,(()=>this.modified.getSelections()??[])),this.modifiedCursor=fr({owner:this,equalsFn:rc.equals},(e=>this.modifiedSelections.read(e)[0]?.getPosition()??new rc(1,1))),this.originalCursor=Sr(this,this.original.onDidChangeCursorPosition,(()=>this.original.getPosition()??new rc(1,1))),this.isOriginalFocused=bY(this.original).isFocused,this.isModifiedFocused=bY(this.modified).isFocused,this.isFocused=pr(this,(e=>this.isOriginalFocused.read(e)||this.isModifiedFocused.read(e))),this._argCodeEditorWidgetOptions=null,this._register(dr({changeTracker:{createChangeSummary:()=>({}),handleChange:(e,t)=>(e.didChange(i.editorOptions)&&Object.assign(t,e.change.changedOptions),!0)}},((e,t)=>{i.editorOptions.read(e),this._options.renderSideBySide.read(e),this.modified.updateOptions(this._adjustOptionsForRightHandSide(e,t)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(e,t))})))}_createLeftHandSideEditor(e,t){const i=this._adjustOptionsForLeftHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t),o=this._contextKeyService.createKey("isInDiffLeftEditor",n.hasWidgetFocus());return this._register(n.onDidFocusEditorWidget((()=>o.set(!0)))),this._register(n.onDidBlurEditorWidget((()=>o.set(!1)))),n}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t),o=this._contextKeyService.createKey("isInDiffRightEditor",n.hasWidgetFocus());return this._register(n.onDidFocusEditorWidget((()=>o.set(!0)))),this._register(n.onDidBlurEditorWidget((()=>o.set(!1)))),n}_constructInnerEditor(e,t,i,n){const o=this._createInnerEditor(e,t,i,n);return this._register(o.onDidContentSizeChange((e=>{const t=this.original.getContentWidth()+this.modified.getContentWidth()+a5.ENTIRE_DIFF_OVERVIEW_WIDTH,i=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:i,contentWidth:t,contentHeightChanged:e.contentHeightChanged,contentWidthChanged:e.contentWidthChanged})}))),o}_adjustOptionsForLeftHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),i.glyphMargin=this._options.renderSideBySide.get(),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=bP.revealHorizontalRightPadding.defaultValue+a5.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t={...e,dimension:{height:0,width:0}};return t.inDiffEditor=!0,t.automaticLayout=!1,t.allowVariableLineHeights=!1,t.allowVariableFonts=!1,t.allowVariableFontsInAccessibilityMode=!1,t.scrollbar={...t.scrollbar||{}},t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap={...t.minimap||{}},t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){e||(e="");const t=y(108," use {0} to open the accessibility help.",this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp")?.getAriaLabel());return this._options.accessibilityVerbose.get()?e+t:e?e.replaceAll(t,""):""}};d5=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([l5(5,eu),l5(6,nc),l5(7,ER)],d5);class h5{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(e,t){this._options=e,this.dimensions=t,this.sashLeft=mr(this,(e=>{const t=this._sashRatio.read(e)??this._options.splitViewDefaultRatio.read(e);return this._computeSashLeft(t,e)}),((e,t)=>{const i=this.dimensions.width.get();this._sashRatio.set(e/i,t)})),this._sashRatio=Js(this,void 0)}_computeSashLeft(e,t){const i=this.dimensions.width.read(t),n=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):n,s=100;return i<=200?n:o<s?s:o>i-s?i-s:o}}class c5 extends At{constructor(e,t,i,n,o,s){super(),this._domNode=e,this._dimensions=t,this._enabled=i,this._boundarySashes=n,this.sashLeft=o,this._resetSash=s,this._sash=this._register(new WG(this._domNode,{getVerticalSashTop:e=>0,getVerticalSashLeft:e=>this.sashLeft.get(),getVerticalSashHeight:e=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart((()=>{this._startSashPosition=this.sashLeft.get()}))),this._register(this._sash.onDidChange((e=>{this.sashLeft.set(this._startSashPosition+(e.currentX-e.startX),void 0)}))),this._register(this._sash.onDidEnd((()=>this._sash.layout()))),this._register(this._sash.onDidReset((()=>this._resetSash()))),this._register(ar((e=>{const t=this._boundarySashes.read(e);t&&(this._sash.orthogonalEndSash=t.bottom)}))),this._register(ar((e=>{const t=this._enabled.read(e);this._sash.state=t?3:0,this.sashLeft.read(e),this._dimensions.height.read(e),this._sash.layout()})))}}class u5 extends At{constructor(){super(...arguments),this._id=++u5.idCounter,this._onDidDispose=this._register(new Zt),this.onDidDispose=this._onDidDispose.event}static{this.idCounter=0}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=0){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,n=!0){this._targetEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}}let g5=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=Js(this,0),this._screenReaderMode=Sr(this,this._accessibilityService.onDidChangeScreenReaderOptimized,(()=>this._accessibilityService.isScreenReaderOptimized())),this.couldShowInlineViewBecauseOfSize=pr(this,(e=>this._options.read(e).renderSideBySide&&this._diffEditorWidth.read(e)<=this._options.read(e).renderSideBySideInlineBreakpoint)),this.renderOverviewRuler=pr(this,(e=>this._options.read(e).renderOverviewRuler)),this.renderSideBySide=pr(this,(e=>(!this.compactMode.read(e)||!this.shouldRenderInlineViewInSmartMode.read(e))&&this._options.read(e).renderSideBySide&&!(this._options.read(e).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(e)&&!this._screenReaderMode.read(e)))),this.readOnly=pr(this,(e=>this._options.read(e).readOnly)),this.shouldRenderOldRevertArrows=pr(this,(e=>!(!this._options.read(e).renderMarginRevertIcon||!this.renderSideBySide.read(e)||this.readOnly.read(e)||this.shouldRenderGutterMenu.read(e)))),this.shouldRenderGutterMenu=pr(this,(e=>this._options.read(e).renderGutterMenu)),this.renderIndicators=pr(this,(e=>this._options.read(e).renderIndicators)),this.enableSplitViewResizing=pr(this,(e=>this._options.read(e).enableSplitViewResizing)),this.splitViewDefaultRatio=pr(this,(e=>this._options.read(e).splitViewDefaultRatio)),this.ignoreTrimWhitespace=pr(this,(e=>this._options.read(e).ignoreTrimWhitespace)),this.maxComputationTimeMs=pr(this,(e=>this._options.read(e).maxComputationTime)),this.showMoves=pr(this,(e=>this._options.read(e).experimental.showMoves&&this.renderSideBySide.read(e))),this.isInEmbeddedEditor=pr(this,(e=>this._options.read(e).isInEmbeddedEditor)),this.diffWordWrap=pr(this,(e=>this._options.read(e).diffWordWrap)),this.originalEditable=pr(this,(e=>this._options.read(e).originalEditable)),this.diffCodeLens=pr(this,(e=>this._options.read(e).diffCodeLens)),this.accessibilityVerbose=pr(this,(e=>this._options.read(e).accessibilityVerbose)),this.diffAlgorithm=pr(this,(e=>this._options.read(e).diffAlgorithm)),this.showEmptyDecorations=pr(this,(e=>this._options.read(e).experimental.showEmptyDecorations)),this.onlyShowAccessibleDiffViewer=pr(this,(e=>this._options.read(e).onlyShowAccessibleDiffViewer)),this.compactMode=pr(this,(e=>this._options.read(e).compactMode)),this.trueInlineDiffRenderingEnabled=pr(this,(e=>this._options.read(e).experimental.useTrueInlineView)),this.useTrueInlineDiffRendering=pr(this,(e=>!this.renderSideBySide.read(e)&&this.trueInlineDiffRenderingEnabled.read(e))),this.hideUnchangedRegions=pr(this,(e=>this._options.read(e).hideUnchangedRegions.enabled)),this.hideUnchangedRegionsRevealLineCount=pr(this,(e=>this._options.read(e).hideUnchangedRegions.revealLineCount)),this.hideUnchangedRegionsContextLineCount=pr(this,(e=>this._options.read(e).hideUnchangedRegions.contextLineCount)),this.hideUnchangedRegionsMinimumLineCount=pr(this,(e=>this._options.read(e).hideUnchangedRegions.minimumLineCount)),this._model=Js(this,void 0),this.shouldRenderInlineViewInSmartMode=this._model.map(this,(e=>{return t=t=>{const i=e?.diff.read(t);return i?(n=i,o=this.trueInlineDiffRenderingEnabled.read(t),n.mappings.every((e=>0===e.lineRangeMapping.original.length||0===e.lineRangeMapping.modified.length||o&&e5(e.lineRangeMapping)))):void 0;var n,o},Tr(this,((e,i)=>i??t(e)));var t})).flatten().map(this,(e=>!!e)),this.inlineViewHideOriginalLineNumbers=this.compactMode;const i={...e,...p5(e,AO)};this._options=Js(this,i)}updateOptions(e){const t=p5(e,this._options.get()),i={...this._options.get(),...e,...t};this._options.set(i,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}setModel(e){this._model.set(e,void 0)}};function p5(e,t){return{enableSplitViewResizing:HO(e.enableSplitViewResizing,t.enableSplitViewResizing),splitViewDefaultRatio:jO(e.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:HO(e.renderSideBySide,t.renderSideBySide),renderMarginRevertIcon:HO(e.renderMarginRevertIcon,t.renderMarginRevertIcon),maxComputationTime:UO(e.maxComputationTime,t.maxComputationTime,0,1073741824),maxFileSize:UO(e.maxFileSize,t.maxFileSize,0,1073741824),ignoreTrimWhitespace:HO(e.ignoreTrimWhitespace,t.ignoreTrimWhitespace),renderIndicators:HO(e.renderIndicators,t.renderIndicators),originalEditable:HO(e.originalEditable,t.originalEditable),diffCodeLens:HO(e.diffCodeLens,t.diffCodeLens),renderOverviewRuler:HO(e.renderOverviewRuler,t.renderOverviewRuler),diffWordWrap:GO(e.diffWordWrap,t.diffWordWrap,["off","on","inherit"]),diffAlgorithm:GO(e.diffAlgorithm,t.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:HO(e.accessibilityVerbose,t.accessibilityVerbose),experimental:{showMoves:HO(e.experimental?.showMoves,t.experimental.showMoves),showEmptyDecorations:HO(e.experimental?.showEmptyDecorations,t.experimental.showEmptyDecorations),useTrueInlineView:HO(e.experimental?.useTrueInlineView,t.experimental.useTrueInlineView)},hideUnchangedRegions:{enabled:HO(e.hideUnchangedRegions?.enabled??e.experimental?.collapseUnchangedRegions,t.hideUnchangedRegions.enabled),contextLineCount:UO(e.hideUnchangedRegions?.contextLineCount,t.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:UO(e.hideUnchangedRegions?.minimumLineCount,t.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:UO(e.hideUnchangedRegions?.revealLineCount,t.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:HO(e.isInEmbeddedEditor,t.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:HO(e.onlyShowAccessibleDiffViewer,t.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:UO(e.renderSideBySideInlineBreakpoint,t.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:HO(e.useInlineViewWhenSpaceIsLimited,t.useInlineViewWhenSpaceIsLimited),renderGutterMenu:HO(e.renderGutterMenu,t.renderGutterMenu),compactMode:HO(e.compactMode,t.compactMode)}}g5=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,rB)],g5);class m5 extends MU{constructor(e){super(),this._textModel=e}getValueOfRange(e){return this._textModel.getValueInRange(e)}getLineLength(e){return this._textModel.getLineLength(e)}get length(){const e=this._textModel.getLineCount(),t=this._textModel.getLineLength(e);return new xm(e-1,t)}}class f5 extends hc{constructor(e){super(),this._getContext=e}runAction(e,t){const i=this._getContext();return super.runAction(e,i)}}class _5 extends At{constructor(e,t,i){super(),this._editor=e,this._domNode=t,this.itemProvider=i,this.scrollTop=Sr(this,this._editor.onDidScrollChange,(e=>this._editor.getScrollTop())),this.isScrollTopZero=this.scrollTop.map((e=>0===e)),this.modelAttached=Sr(this,this._editor.onDidChangeModel,(e=>this._editor.hasModel())),this.editorOnDidChangeViewZones=Fr("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=Fr("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=Lr("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const n=this._domNode.appendChild(fl("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),o=new ResizeObserver((()=>{Vs((e=>{this.domNodeSizeChanged.trigger(e)}))}));o.observe(this._domNode),this._register(Tt((()=>o.disconnect()))),this._register(ar((e=>{n.className=this.isScrollTopZero.read(e)?"":"scroll-decoration"}))),this._register(ar((e=>this.render(e))))}dispose(){super.dispose(),ol(this._domNode)}render(e){if(!this.modelAttached.read(e))return;this.domNodeSizeChanged.read(e),this.editorOnDidChangeViewZones.read(e),this.editorOnDidContentSizeChange.read(e);const t=this.scrollTop.read(e),i=this._editor.getVisibleRanges(),n=new Set(this.views.keys()),o=cm.ofStartAndLength(0,this._domNode.clientHeight);if(!o.isEmpty)for(const s of i){const i=new ym(s.startLineNumber,s.endLineNumber+1),r=this.itemProvider.getIntersectingGutterItems(i,e);Vs((e=>{for(const s of r){if(!s.range.intersect(i))continue;n.delete(s.id);let r=this.views.get(s.id);if(r)r.item.set(s,e);else{const e=document.createElement("div");this._domNode.appendChild(e);const t=Js("item",s),i=this.itemProvider.createView(t,e);r=new v5(t,i,e),this.views.set(s.id,r)}const a=s.range.startLineNumber<=this._editor.getModel().getLineCount()?this._editor.getTopForLineNumber(s.range.startLineNumber,!0)-t:s.range.startLineNumber>1?this._editor.getBottomForLineNumber(s.range.startLineNumber-1,!1)-t:0,l=(1===s.range.endLineNumberExclusive?Math.max(a,this._editor.getTopForLineNumber(s.range.startLineNumber,!1)-t):Math.max(a,this._editor.getBottomForLineNumber(s.range.endLineNumberExclusive-1,!0)-t))-a;r.domNode.style.top=`${a}px`,r.domNode.style.height=`${l}px`,r.gutterItemView.layout(cm.ofStartAndLength(a,l),o)}}))}for(const e of n){const t=this.views.get(e);t.gutterItemView.dispose(),t.domNode.remove(),this.views.delete(e)}}}class v5{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}}var b5=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},w5=function(e,t){return function(i,n){t(i,n,e)}};const C5=[];let y5=class extends At{constructor(e,t,i,n,o,s,r,a,l){var d,h;super(),this._diffModel=t,this._editors=i,this._options=n,this._sashLayout=o,this._boundarySashes=s,this._instantiationService=r,this._contextKeyService=a,this._menuService=l,this._menu=this._register(this._menuService.createMenu(gu.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=Sr(this,this._menu.onDidChange,(()=>this._menu.getActions())),this._hasActions=this._actions.map((e=>e.length>0)),this._showSash=pr(this,(e=>this._options.renderSideBySide.read(e)&&this._hasActions.read(e))),this.width=pr(this,(e=>this._hasActions.read(e)?35:0)),this.elements=fl("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:"35px"}},[]),this._currentDiff=pr(this,(e=>{const t=this._diffModel.read(e);if(!t)return;const i=t.diff.read(e)?.mappings,n=this._editors.modifiedCursor.read(e);return n?i?.find((e=>e.lineRangeMapping.modified.contains(n.lineNumber))):void 0})),this._selectedDiffs=pr(this,(e=>{const t=this._diffModel.read(e),i=t?.diff.read(e);if(!i)return C5;const n=this._editors.modifiedSelections.read(e);if(n.every((e=>e.isEmpty())))return C5;const o=new Sm(n.map((e=>ym.fromRangeInclusive(e)))),s=i.mappings.filter((e=>e.lineRangeMapping.innerChanges&&o.intersects(e.lineRangeMapping.modified))),r=s.map((e=>({mapping:e,rangeMappings:e.lineRangeMapping.innerChanges.filter((e=>n.some((t=>Yu.areIntersecting(e.modifiedRange,t)))))})));return 0===r.length||r.every((e=>0===e.rangeMappings.length))?C5:r})),this._register((d=e,h=this.elements.root,d.prepend(h),Tt((()=>{h.remove()})))),this._register(ga(this.elements.root,"click",(()=>{this._editors.modified.focus()}))),this._register(f2(this.elements.root,{display:this._hasActions.map((e=>e?"block":"none"))})),vr(this,(t=>this._showSash.read(t)?new c5(e,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,mr(this,(e=>this._sashLayout.sashLeft.read(e)-35),((e,t)=>this._sashLayout.sashLeft.set(e+35,t))),(()=>this._sashLayout.resetSash())):void 0)).recomputeInitiallyAndOnChange(this._store);const c=pr(this,(e=>{const t=this._diffModel.read(e);if(!t)return[];const i=t.diff.read(e);if(!i)return[];const n=this._selectedDiffs.read(e);if(n.length>0){const e=L2.fromRangeMappings(n.flatMap((e=>e.rangeMappings)));return[new S5(e,!0,gu.DiffEditorSelectionToolbar,void 0,t.model.original.uri,t.model.modified.uri)]}const o=this._currentDiff.read(e);return i.mappings.map((e=>new S5(e.lineRangeMapping.withInnerChangesFromLineRanges(),e.lineRangeMapping===o?.lineRangeMapping,gu.DiffEditorHunkToolbar,void 0,t.model.original.uri,t.model.modified.uri)))}));this._register(new _5(this._editors.modified,this.elements.root,{getIntersectingGutterItems:(e,t)=>c.read(t),createView:(e,t)=>this._instantiationService.createInstance(x5,e,t,this)})),this._register(ga(this.elements.gutter,Qa.MOUSE_WHEEL,(e=>{this._editors.modified.getOption(117).handleMouseWheel&&this._editors.modified.delegateScrollFromMouseWheelEvent(e)}),{passive:!1}))}computeStagedValue(e){const t=e.innerChanges??[],i=new m5(this._editors.modifiedModel.get()),n=new m5(this._editors.original.getModel()),o=new PU(t.map((e=>e.toTextEdit(i))));return o.apply(n)}layout(e){this.elements.gutter.style.left=e+"px"}};y5=b5([w5(6,nc),w5(7,eu),w5(8,pu)],y5);class S5{constructor(e,t,i,n,o,s){this.mapping=e,this.showAlways=t,this.menuId=i,this.rangeOverride=n,this.originalUri=o,this.modifiedUri=s}get id(){return this.mapping.modified.toString()}get range(){return this.rangeOverride??this.mapping.modified}}let x5=class extends At{constructor(e,t,i,n){super(),this._item=e,this._elements=fl("div.gutterItem",{style:{height:"20px",width:"34px"}},[fl("div.background@background",{},[]),fl("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,(e=>e.showAlways)),this._menuId=this._item.map(this,(e=>e.menuId)),this._isSmall=Js(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const o=this._register(n.createInstance(sZ,"element",{instantHover:!0},{position:{hoverPosition:1}}));this._register(h2(t,this._elements.root)),this._register(ar((e=>{const t=this._showAlways.read(e);this._elements.root.classList.toggle("noTransition",!0),this._elements.root.classList.toggle("showAlways",t),setTimeout((()=>{this._elements.root.classList.toggle("noTransition",!1)}),0)}))),this._register(hr(((e,t)=>{this._elements.buttons.replaceChildren();const s=t.add(n.createInstance(aG,this._elements.buttons,this._menuId.read(e),{orientation:1,hoverDelegate:o,toolbarOptions:{primaryGroup:e=>e.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(e)?1:3},hiddenItemStrategy:0,actionRunner:t.add(new f5((()=>{const e=this._item.read(void 0),t=e.mapping;return{mapping:t,originalWithModifiedChanges:i.computeStagedValue(t),originalUri:e.originalUri,modifiedUri:e.modifiedUri}}))),menuOptions:{shouldForwardArgs:!0}}));t.add(s.onDidChangeMenuItems((()=>{this._lastItemRange&&this.layout(this._lastItemRange,this._lastViewRange)})))})))}layout(e,t){this._lastItemRange=e,this._lastViewRange=t;let i=this._elements.buttons.clientHeight;this._isSmall.set(1===this._item.get().mapping.original.startLineNumber&&e.length<30,void 0),i=this._elements.buttons.clientHeight;const n=e.length/2-i/2,o=i;let s=e.start+n;const r=cm.tryCreate(o,t.endExclusive-o-i),a=cm.tryCreate(e.start+o,e.endExclusive-i-o);a&&r&&a.start<a.endExclusive&&(s=r.clip(s),s=a.clip(s)),this._elements.buttons.style.top=s-e.start+"px"}};x5=b5([w5(3,nc)],x5);var k5;let L5=class extends At{static{k5=this}static{this._breadcrumbsSourceFactory=Js(k5,(()=>({dispose(){},getBreadcrumbItems:(e,t)=>[]})))}static setBreadcrumbsSourceFactory(e){this._breadcrumbsSourceFactory.set(e,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._instantiationService=n,this._modifiedOutlineSource=vr(this,(e=>{const t=this._editors.modifiedModel.read(e),i=k5._breadcrumbsSourceFactory.read(e);return t&&i?i(t,this._instantiationService):void 0})),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition((e=>{if(1===e.reason)return;const t=this._diffModel.get();Vs((e=>{for(const i of this._editors.original.getSelections()||[])t?.ensureOriginalLineIsVisible(i.getStartPosition().lineNumber,0,e),t?.ensureOriginalLineIsVisible(i.getEndPosition().lineNumber,0,e)}))}))),this._register(this._editors.modified.onDidChangeCursorPosition((e=>{if(1===e.reason)return;const t=this._diffModel.get();Vs((e=>{for(const i of this._editors.modified.getSelections()||[])t?.ensureModifiedLineIsVisible(i.getStartPosition().lineNumber,0,e),t?.ensureModifiedLineIsVisible(i.getEndPosition().lineNumber,0,e)}))})));const o=this._diffModel.map(((e,t)=>{const i=e?.unchangedRegions.read(t)??[];return 1===i.length&&1===i[0].modifiedLineNumber&&i[0].lineCount===this._editors.modifiedModel.read(t)?.getLineCount()?[]:i}));this.viewZones=pr(this,(e=>{const t=this._modifiedOutlineSource.read(e);if(!t)return{origViewZones:[],modViewZones:[]};const i=[],n=[],s=this._options.renderSideBySide.read(e),r=this._options.compactMode.read(e),a=o.read(e);for(let o=0;o<a.length;o++){const l=a[o];if(!l.shouldHideControls(e)&&(!r||0!==o&&o!==a.length-1))if(r){{const t=pr(this,(e=>l.getHiddenOriginalRange(e).startLineNumber-1)),n=new p2(t,12);i.push(n),e.store.add(new D5(this._editors.original,n,l,!s))}{const t=pr(this,(e=>l.getHiddenModifiedRange(e).startLineNumber-1)),i=new p2(t,12);n.push(i),e.store.add(new D5(this._editors.modified,i,l))}}else{{const n=pr(this,(e=>l.getHiddenOriginalRange(e).startLineNumber-1)),o=new p2(n,24);i.push(o),e.store.add(new E5(this._editors.original,o,l,l.originalUnchangedRange,!s,t,(e=>this._diffModel.get().ensureModifiedLineIsVisible(e,2,void 0)),this._options))}{const i=pr(this,(e=>l.getHiddenModifiedRange(e).startLineNumber-1)),o=new p2(i,24);n.push(o),e.store.add(new E5(this._editors.modified,o,l,l.modifiedUnchangedRange,!1,t,(e=>this._diffModel.get().ensureModifiedLineIsVisible(e,2,void 0)),this._options))}}}return{origViewZones:i,modViewZones:n}}));const s={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},r={description:"Fold Unchanged",glyphMarginHoverMessage:new Gh(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(y(121,"Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+vh.asClassName(fh.fold),zIndex:10001};this._register(d2(this._editors.original,pr(this,(e=>{const t=o.read(e),i=t.map((e=>({range:e.originalUnchangedRange.toInclusiveRange(),options:s})));for(const n of t)n.shouldHideControls(e)&&i.push({range:Yu.fromPositions(new rc(n.originalLineNumber,1)),options:r});return i})))),this._register(d2(this._editors.modified,pr(this,(e=>{const t=o.read(e),i=t.map((e=>({range:e.modifiedUnchangedRange.toInclusiveRange(),options:s})));for(const n of t)n.shouldHideControls(e)&&i.push({range:ym.ofLength(n.modifiedLineNumber,1).toInclusiveRange(),options:r});return i})))),this._register(ar((e=>{const t=o.read(e);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(t.map((t=>t.getHiddenOriginalRange(e).toInclusiveRange())).filter(mt)),this._editors.modified.setHiddenAreas(t.map((t=>t.getHiddenModifiedRange(e).toInclusiveRange())).filter(mt))}finally{this._isUpdatingHiddenAreas=!1}}))),this._register(this._editors.modified.onMouseUp((e=>{if(!e.event.rightButton&&e.target.position&&e.target.element?.className.includes("fold-unchanged")){const t=e.target.position.lineNumber,i=this._diffModel.get();if(!i)return;const n=i.unchangedRegions.get().find((e=>e.modifiedUnchangedRange.contains(t)));if(!n)return;n.collapseAll(void 0),e.event.stopPropagation(),e.event.preventDefault()}}))),this._register(this._editors.original.onMouseUp((e=>{if(!e.event.rightButton&&e.target.position&&e.target.element?.className.includes("fold-unchanged")){const t=e.target.position.lineNumber,i=this._diffModel.get();if(!i)return;const n=i.unchangedRegions.get().find((e=>e.originalUnchangedRange.contains(t)));if(!n)return;n.collapseAll(void 0),e.event.stopPropagation(),e.event.preventDefault()}})))}};L5=k5=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(3,nc)],L5);class D5 extends g2{constructor(e,t,i,n=!1){const o=fl("div.diff-hidden-lines-widget");super(e,t,o.root),this._unchangedRegion=i,this._hide=n,this._nodes=fl("div.diff-hidden-lines-compact",[fl("div.line-left",[]),fl("div.text@text",[]),fl("div.line-right",[])]),o.root.appendChild(this._nodes.root),this._hide&&this._nodes.root.replaceChildren(),this._register(ar((e=>{if(!this._hide){const t=y(122,"{0} hidden lines",this._unchangedRegion.getHiddenModifiedRange(e).length);this._nodes.text.innerText=t}})))}}class E5 extends g2{constructor(e,t,i,n,o,s,r,a){const l=fl("div.diff-hidden-lines-widget");super(e,t,l.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=n,this._hide=o,this._modifiedOutlineSource=s,this._revealModifiedHiddenLine=r,this._options=a,this._nodes=fl("div.diff-hidden-lines",[fl("div.top@top",{title:y(123,"Click or drag to show more above")}),fl("div.center@content",{style:{display:"flex"}},[fl("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[ll("a",{title:y(124,"Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...bI("$(unfold)"))]),fl("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),fl("div.bottom@bottom",{title:y(125,"Click or drag to show more below"),role:"button"})]),l.root.appendChild(this._nodes.root),this._hide?ol(this._nodes.first):this._register(f2(this._nodes.first,{width:bY(this._editor).layoutInfoContentLeft})),this._register(ar((e=>{const t=this._unchangedRegion.visibleLineCountTop.read(e)+this._unchangedRegion.visibleLineCountBottom.read(e)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!t),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(e)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(e)>0),this._nodes.top.classList.toggle("canMoveBottom",!t);const i=this._unchangedRegion.isDragged.read(e),n=this._editor.getDomNode();n&&(n.classList.toggle("draggingUnchangedRegion",!!i),"top"===i?(n.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(e)>0),n.classList.toggle("canMoveBottom",!t)):"bottom"===i?(n.classList.toggle("canMoveTop",!t),n.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(e)>0)):(n.classList.toggle("canMoveTop",!1),n.classList.toggle("canMoveBottom",!1)))})));const d=this._editor;this._register(ga(this._nodes.top,"mousedown",(e=>{if(0!==e.button)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),e.preventDefault();const t=e.clientY;let i=!1;const n=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const o=ta(this._nodes.top),s=ga(o,"mousemove",(e=>{const o=e.clientY-t;i=i||Math.abs(o)>2;const s=Math.round(o/d.getOption(75)),r=Math.max(0,Math.min(n+s,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(r,void 0)})),r=ga(o,"mouseup",(e=>{i||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),s.dispose(),r.dispose()}))}))),this._register(ga(this._nodes.bottom,"mousedown",(e=>{if(0!==e.button)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),e.preventDefault();const t=e.clientY;let i=!1;const n=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const o=ta(this._nodes.bottom),s=ga(o,"mousemove",(e=>{const o=e.clientY-t;i=i||Math.abs(o)>2;const s=Math.round(o/d.getOption(75)),r=Math.max(0,Math.min(n-s,this._unchangedRegion.getMaxVisibleLineCountBottom())),a=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(r,void 0);const l=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(l-a))})),r=ga(o,"mouseup",(e=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!i){const e=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const t=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(t-e))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),s.dispose(),r.dispose()}))}))),this._register(ar((e=>{const t=[];if(!this._hide){const n=y(126,"{0} hidden lines",i.getHiddenModifiedRange(e).length),o=ll("span",{title:y(127,"Double click to unfold")},n);o.addEventListener("dblclick",(e=>{0===e.button&&(e.preventDefault(),this._unchangedRegion.showAll(void 0))})),t.push(o);const s=this._unchangedRegion.getHiddenModifiedRange(e),r=this._modifiedOutlineSource.getBreadcrumbItems(s,e);if(r.length>0){t.push(ll("span",void 0," | "));for(let e=0;e<r.length;e++){const i=r[e],n=fl("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[wI(qS.toIcon(i.kind))," ",i.name,...e===r.length-1?[]:[wI(fh.chevronRight)]]).root;t.push(n),n.onclick=()=>{this._revealModifiedHiddenLine(i.startLineNumber)}}}}ol(this._nodes.others,...t)})))}}const N5=[];class I5 extends At{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=n,this._selectedDiffs=pr(this,(e=>{const t=this._diffModel.read(e),i=t?.diff.read(e);if(!i)return N5;const n=this._editors.modifiedSelections.read(e);if(n.every((e=>e.isEmpty())))return N5;const o=new Sm(n.map((e=>ym.fromRangeInclusive(e)))),s=i.mappings.filter((e=>e.lineRangeMapping.innerChanges&&o.intersects(e.lineRangeMapping.modified))),r=s.map((e=>({mapping:e,rangeMappings:e.lineRangeMapping.innerChanges.filter((e=>n.some((t=>Yu.areIntersecting(e.modifiedRange,t)))))})));return 0===r.length||r.every((e=>0===e.rangeMappings.length))?N5:r})),this._register(hr(((e,t)=>{if(!this._options.shouldRenderOldRevertArrows.read(e))return;const i=this._diffModel.read(e),n=i?.diff.read(e);if(!i||!n)return;if(i.movedTextToCompare.read(e))return;const o=[],s=this._selectedDiffs.read(e),r=new Set(s.map((e=>e.mapping)));if(s.length>0){const i=this._editors.modifiedSelections.read(e),n=t.add(new T5(i[i.length-1].positionLineNumber,this._widget,s.flatMap((e=>e.rangeMappings)),!0));this._editors.modified.addGlyphMarginWidget(n),o.push(n)}for(const e of n.mappings)if(!r.has(e)&&!e.lineRangeMapping.modified.isEmpty&&e.lineRangeMapping.innerChanges){const i=t.add(new T5(e.lineRangeMapping.modified.startLineNumber,this._widget,e.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(i),o.push(i)}t.add(Tt((()=>{for(const e of o)this._editors.modified.removeGlyphMarginWidget(e)})))})))}}class T5 extends At{static{this.counter=0}getId(){return this._id}constructor(e,t,i,n){super(),this._lineNumber=e,this._widget=t,this._diffs=i,this._revertSelection=n,this._id="revertButton"+T5.counter++,this._domNode=fl("div.revertButton",{title:this._revertSelection?y(132,"Revert Selected Changes"):y(133,"Revert Change")},[wI(fh.arrowRight)]).root,this._register(ga(this._domNode,Qa.MOUSE_DOWN,(e=>{2!==e.button&&(e.stopPropagation(),e.preventDefault())}))),this._register(ga(this._domNode,Qa.MOUSE_UP,(e=>{e.stopPropagation(),e.preventDefault()}))),this._register(ga(this._domNode,Qa.CLICK,(e=>{this._diffs instanceof S2?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),e.stopPropagation(),e.preventDefault()})))}getDomNode(){return this._domNode}getPosition(){return{lane:gg.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}}var M5=i(1921),A5={};A5.styleTagTransform=zl(),A5.setAttributes=Bl(),A5.insert=Pl().bind(null,"head"),A5.domAPI=Rl(),A5.insertStyleElement=Vl(),Ml()(M5.A,A5),M5.A&&M5.A.locals&&M5.A.locals;var R5=function(e,t){return function(i,n){t(i,n,e)}};let O5=class extends u5{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}constructor(e,t,i,n,o,s,r,a){super(),this._domElement=e,this._parentContextKeyService=n,this._parentInstantiationService=o,this._accessibilitySignalService=r,this._editorProgressService=a,this.elements=fl("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[fl("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),fl("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),fl("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModelSrc=this._register(tr(this,void 0)),this._diffModel=pr(this,(e=>this._diffModelSrc.read(e)?.object)),this.onDidChangeModel=zt.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new Xj([eu,this._contextKeyService]))),this._boundarySashes=Js(this,void 0),this._accessibleDiffViewerShouldBeVisible=Js(this,!1),this._accessibleDiffViewerVisible=pr(this,(e=>!!this._options.onlyShowAccessibleDiffViewer.read(e)||this._accessibleDiffViewerShouldBeVisible.read(e))),this._movedBlocksLinesPart=Js(this,void 0),this._layoutInfo=pr(this,(e=>{const t=this._rootSizeObserver.width.read(e),i=this._rootSizeObserver.height.read(e);this._rootSizeObserver.automaticLayout?this.elements.root.style.height="100%":this.elements.root.style.height=i+"px";const n=this._sash.read(e),o=this._gutter.read(e),s=o?.width.read(e)??0,r=this._overviewRulerPart.read(e)?.width??0;let a,l,d,h,c;if(n){const i=n.sashLeft.read(e);a=0,l=i-s-(this._movedBlocksLinesPart.read(e)?.width.read(e)??0),c=i-s,d=i,h=t-d-r}else c=0,a=s,l=this._options.inlineViewHideOriginalLineNumbers.read(e)?0:Math.max(5,this._editors.originalObs.layoutInfoDecorationsLeft.read(e)),d=s+l,h=t-d-r;return this.elements.original.style.left=a+"px",this.elements.original.style.width=l+"px",this._editors.original.layout({width:l,height:i},!0),o?.layout(c),this.elements.modified.style.left=d+"px",this.elements.modified.style.width=h+"px",this._editors.modified.layout({width:h,height:i},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}})),this._diffValue=this._diffModel.map(((e,t)=>e?.diff.read(t))),this.onDidUpdateDiff=zt.fromObservableLight(this._diffValue),s.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(Tt((()=>this.elements.root.remove()))),this._rootSizeObserver=this._register(new c2(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(t.automaticLayout??!1),this._options=this._instantiationService.createInstance(g5,t),this._register(ar((e=>{this._options.setWidth(this._rootSizeObserver.width.read(e))}))),this._contextKeyService.createKey(Xu.isEmbeddedDiffEditor.key,!1),this._register(l2(Xu.isEmbeddedDiffEditor,this._contextKeyService,(e=>this._options.isInEmbeddedEditor.read(e)))),this._register(l2(Xu.comparingMovedCode,this._contextKeyService,(e=>!!this._diffModel.read(e)?.movedTextToCompare.read(e)))),this._register(l2(Xu.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,(e=>this._options.couldShowInlineViewBecauseOfSize.read(e)))),this._register(l2(Xu.diffEditorInlineMode,this._contextKeyService,(e=>!this._options.renderSideBySide.read(e)))),this._register(l2(Xu.hasChanges,this._contextKeyService,(e=>(this._diffModel.read(e)?.diff.read(e)?.mappings.length??0)>0))),this._editors=this._register(this._instantiationService.createInstance(d5,this.elements.original,this.elements.modified,this._options,i,((e,t,i,n)=>this._createInnerEditor(e,t,i,n)))),this._register(l2(Xu.diffEditorOriginalWritable,this._contextKeyService,(e=>this._options.originalEditable.read(e)))),this._register(l2(Xu.diffEditorModifiedWritable,this._contextKeyService,(e=>!this._options.readOnly.read(e)))),this._register(l2(Xu.diffEditorOriginalUri,this._contextKeyService,(e=>this._diffModel.read(e)?.model.original.uri.toString()??""))),this._register(l2(Xu.diffEditorModifiedUri,this._contextKeyService,(e=>this._diffModel.read(e)?.model.modified.uri.toString()??""))),this._overviewRulerPart=vr(this,(e=>this._options.renderOverviewRuler.read(e)?this._instantiationService.createInstance(w$(a5),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map((e=>e.modifiedEditor))):void 0)).recomputeInitiallyAndOnChange(this._store);const l={height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map(((e,t)=>e-(this._overviewRulerPart.read(t)?.width??0)))};this._sashLayout=new h5(this._options,l),this._sash=vr(this,(e=>{const t=this._options.renderSideBySide.read(e);return this.elements.root.classList.toggle("side-by-side",t),t?new c5(this.elements.root,l,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,(()=>this._sashLayout.resetSash())):void 0})).recomputeInitiallyAndOnChange(this._store);const d=vr(this,(e=>this._instantiationService.createInstance(w$(L5),this._editors,this._diffModel,this._options))).recomputeInitiallyAndOnChange(this._store);vr(this,(e=>this._instantiationService.createInstance(w$(s5),this._editors,this._diffModel,this._options,this))).recomputeInitiallyAndOnChange(this._store);const h=new Set,c=new Set;let u=!1;const g=vr(this,(e=>this._instantiationService.createInstance(w$(Q4),ta(this._domElement),this._editors,this._diffModel,this._options,this,(()=>u||d.read(void 0).isUpdatingHiddenAreas),h,c))).recomputeInitiallyAndOnChange(this._store),p=pr(this,(e=>{const t=g.read(e).viewZones.read(e).orig,i=d.read(e).viewZones.read(e).origViewZones;return t.concat(i)})),m=pr(this,(e=>{const t=g.read(e).viewZones.read(e).mod,i=d.read(e).viewZones.read(e).modViewZones;return t.concat(i)}));let f;this._register(_2(this._editors.original,p,(e=>{u=e}),h)),this._register(_2(this._editors.modified,m,(e=>{u=e,u?f=mq.capture(this._editors.modified):(f?.restore(this._editors.modified),f=void 0)}),c)),this._accessibleDiffViewer=vr(this,(e=>this._instantiationService.createInstance(w$(P2),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,((e,t)=>this._accessibleDiffViewerShouldBeVisible.set(e,t)),this._options.onlyShowAccessibleDiffViewer.map((e=>!e)),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map(((e,t)=>e?.diff.read(t)?.mappings.map((e=>e.lineRangeMapping)))),new q2(this._editors)))).recomputeInitiallyAndOnChange(this._store);const _=this._accessibleDiffViewerVisible.map((e=>e?"hidden":"visible"));this._register(f2(this.elements.modified,{visibility:_})),this._register(f2(this.elements.original,{visibility:_})),this._createDiffEditorContributions(),s.addDiffEditor(this),this._gutter=vr(this,(e=>this._options.shouldRenderGutterMenu.read(e)?this._instantiationService.createInstance(w$(y5),this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0)),this._register(Nr(this._layoutInfo)),vr(this,(e=>new(w$(i5))(this.elements.root,this._diffModel,this._layoutInfo.map((e=>e.originalEditor)),this._layoutInfo.map((e=>e.modifiedEditor)),this._editors))).recomputeInitiallyAndOnChange(this._store,(e=>{this._movedBlocksLinesPart.set(e,void 0)})),this._register(zt.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,(e=>this._handleCursorPositionChange(e,!0)))),this._register(zt.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,(e=>this._handleCursorPositionChange(e,!1))));const v=this._diffModel.map(this,((e,t)=>{if(e)return void 0===e.diff.read(t)&&!e.isDiffUpToDate.read(t)}));this._register(hr(((e,t)=>{if(!0===v.read(e)){const e=this._editorProgressService.show(!0,1e3);t.add(Tt((()=>e.done())))}}))),this._register(hr(((e,t)=>{t.add(new(w$(I5))(this._editors,this._diffModel,this._options,this))}))),this._register(hr(((e,t)=>{const i=this._diffModel.read(e);if(i)for(const e of[i.model.original,i.model.modified])t.add(e.onWillDispose((e=>{Ie(new Ve("TextModel got disposed before DiffEditorWidget model got reset")),this.setModel(null)})))}))),this._register(ar((e=>{this._options.setModel(this._diffModel.read(e))})))}_createInnerEditor(e,t,i,n){return e.createInstance(tq,t,i,n)}_createDiffEditorContributions(){const e=Ku.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(e){Ie(e)}}get _targetEditor(){return this._editors.modified}getEditorType(){return gK.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){return{original:this._editors.original.saveViewState(),modified:this._editors.modified.saveViewState(),modelState:this._diffModel.get()?.serializeState()}}restoreViewState(e){if(e&&e.original&&e.modified){const t=e;this._editors.original.restoreViewState(t.original),this._editors.modified.restoreViewState(t.modified),t.modelState&&this._diffModel.get()?.restoreSerializedState(t.modelState)}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance(V4,e,this._options)}getModel(){return this._diffModel.get()?.model??null}setModel(e){const t=e?"model"in e?w2.create(e).createNewRef(this):w2.create(this.createViewModel(e),this):null;this.setDiffModel(t)}setDiffModel(e,t){const i=this._diffModel.get();!e&&i&&this._accessibleDiffViewer.get().close(),this._diffModel.get()!==e?.object&&zs(t,(t=>{const i=e?.object;Sr.batchEventsGlobally(t,(()=>{this._editors.original.setModel(i?i.model.original:null),this._editors.modified.setModel(i?i.model.modified:null)}));const n=this._diffModelSrc.get()?.createNewRef(this);this._diffModelSrc.set(e?.createNewRef(this),t),setTimeout((()=>{n?.dispose()}),0)}))}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){const e=this._diffModel.get()?.diff.get();return e?function(e){return e.mappings.map((e=>{const t=e.lineRangeMapping;let i,n,o,s,r=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,n=0,r=void 0):(i=t.original.startLineNumber,n=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(o=t.modified.startLineNumber-1,s=0,r=void 0):(o=t.modified.startLineNumber,s=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:n,modifiedStartLineNumber:o,modifiedEndLineNumber:s,charChanges:r?.map((e=>({originalStartLineNumber:e.originalRange.startLineNumber,originalStartColumn:e.originalRange.startColumn,originalEndLineNumber:e.originalRange.endLineNumber,originalEndColumn:e.originalRange.endColumn,modifiedStartLineNumber:e.modifiedRange.startLineNumber,modifiedStartColumn:e.modifiedRange.startColumn,modifiedEndLineNumber:e.modifiedRange.endLineNumber,modifiedEndColumn:e.modifiedRange.endColumn})))}}))}(e):null}revert(e){const t=this._diffModel.get();t&&t.isDiffUpToDate.get()&&this._editors.modified.executeEdits("diffEditor",[{range:e.modified.toExclusiveRange(),text:t.model.original.getValueInRange(e.original.toExclusiveRange())}])}revertRangeMappings(e){const t=this._diffModel.get();if(!t||!t.isDiffUpToDate.get())return;const i=e.map((e=>({range:e.modifiedRange,text:t.model.original.getValueInRange(e.originalRange)})));this._editors.modified.executeEdits("diffEditor",i)}revertFocusedRangeMappings(){const e=this._diffModel.get();if(!e||!e.isDiffUpToDate.get())return;const t=this._diffModel.get()?.diff.get()?.mappings;if(!t||0===t.length)return;const i=this._editors.modified;if(!i.hasTextFocus())return;const n=i.getPosition().lineNumber,o=i.getSelection(),s=ym.fromRange(o||new Yu(n,0,n,0)),r=t.filter((e=>e.lineRangeMapping.modified.intersect(s)));i.executeEdits("diffEditor",r.map((t=>({range:t.lineRangeMapping.modified.toExclusiveRange(),text:e.model.original.getValueInRange(t.lineRangeMapping.original.toExclusiveRange())}))))}_goTo(e){this._editors.modified.setPosition(new rc(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){const t=this._diffModel.get()?.diff.get()?.mappings;if(!t||0===t.length)return;const i=this._editors.modified.getPosition().lineNumber;let n;n="next"===e?this._editors.modified.getModel().getLineCount()===i?t[0]:t.find((e=>e.lineRangeMapping.modified.startLineNumber>i))??t[0]:gm(t,(e=>e.lineRangeMapping.modified.startLineNumber<i))??t[t.length-1],this._goTo(n),n.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(EP.diffLineDeleted,{source:"diffEditor.goToDiff"}):n.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(EP.diffLineInserted,{source:"diffEditor.goToDiff"}):n&&this._accessibilitySignalService.playSignal(EP.diffLineModified,{source:"diffEditor.goToDiff"})}revealFirstDiff(){const e=this._diffModel.get();e&&this.waitForDiff().then((()=>{const t=e.diff.get()?.mappings;t&&0!==t.length&&this._goTo(t[0])}))}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){const e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){const e=this._editors.modified.hasWidgetFocus(),t=e?this._editors.modified:this._editors.original,i=e?this._editors.original:this._editors.modified;let n;const o=t.getSelection();if(o){const t=this._diffModel.get()?.diff.get()?.mappings.map((t=>e?t.lineRangeMapping.flip():t.lineRangeMapping));if(t){const e=b2(o.getStartPosition(),t),i=b2(o.getEndPosition(),t);n=Yu.plusRange(e,i)}}return{destination:i,destinationSelection:n}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&Vs((t=>{for(const i of e)i.collapseAll(t)}))}showAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&Vs((t=>{for(const i of e)i.showAll(t)}))}_handleCursorPositionChange(e,t){if(3===e?.reason){const i=this._diffModel.get()?.diff.get()?.mappings.find((i=>t?i.lineRangeMapping.modified.contains(e.position.lineNumber):i.lineRangeMapping.original.contains(e.position.lineNumber)));i?.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(EP.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):i?.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(EP.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):i&&this._accessibilitySignalService.playSignal(EP.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}};O5=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([R5(3,eu),R5(4,nc),R5(5,sc),R5(6,kP),R5(7,wD)],O5);class P5 extends bu{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:x(83,"Toggle Show Moved Code Blocks"),precondition:Ac.has("isInDiffEditor")})}run(e,...t){const i=e.get(up),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class F5 extends bu{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:x(84,"Toggle Use Inline View When Space Is Limited"),precondition:Ac.has("isInDiffEditor")})}run(e,...t){const i=e.get(up),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const B5=x(85,"Diff Editor");class W5 extends bu{constructor(){super({id:"diffEditor.revert",title:x(90,"Revert"),f1:!0,category:B5,precondition:Ac.has("isInDiffEditor")})}run(e,t){return t?this.runViaToolbarContext(e,t):this.runViaCursorOrSelection(e)}runViaCursorOrSelection(e){const t=U5(e);t instanceof O5&&t.revertFocusedRangeMappings()}runViaToolbarContext(e,t){const i=function(e,t,i){return e.get(sc).listDiffEditors().find((e=>{const n=e.getModifiedEditor(),o=e.getOriginalEditor();return n&&n.getModel()?.uri.toString()===i.toString()&&o&&o.getModel()?.uri.toString()===t.toString()}))||null}(e,t.originalUri,t.modifiedUri);i instanceof O5&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const V5=x(91,"Accessible Diff Viewer");class H5 extends bu{static{this.id="editor.action.accessibleDiffViewer.next"}constructor(){super({id:H5.id,title:x(92,"Go to Next Difference"),category:V5,precondition:Ac.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=U5(e);t?.accessibleDiffViewerNext()}}class z5 extends bu{static{this.id="editor.action.accessibleDiffViewer.prev"}constructor(){super({id:z5.id,title:x(93,"Go to Previous Difference"),category:V5,precondition:Ac.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=U5(e);t?.accessibleDiffViewerPrev()}}function U5(e){const t=e.get(sc).listDiffEditors(),i=Va();if(i)for(const e of t)if(e.getContainerDomNode().contains(i))return e;return null}wu(class extends bu{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:x(82,"Toggle Collapse Unchanged Regions"),icon:fh.map,toggled:Ac.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:Ac.has("isInDiffEditor"),menu:{when:Ac.has("isInDiffEditor"),id:gu.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(up),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}),wu(P5),wu(F5),fu.appendMenuItem(gu.EditorTitle,{command:{id:(new F5).desc.id,title:y(116,"Use Inline View When Space Is Limited"),toggled:Ac.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:Ac.has("isInDiffEditor")},order:11,group:"1_diff",when:Ac.and(Xu.diffEditorRenderSideBySideInlineBreakpointReached,Ac.has("isInDiffEditor"))}),fu.appendMenuItem(gu.EditorTitle,{command:{id:(new P5).desc.id,title:y(117,"Show Moved Code Blocks"),icon:fh.move,toggled:Bc.create("config.diffEditor.experimental.showMoves",!0),precondition:Ac.has("isInDiffEditor")},order:10,group:"1_diff",when:Ac.has("isInDiffEditor")}),wu(W5);for(const e of[{icon:fh.arrowRight,key:Xu.diffEditorInlineMode.toNegated()},{icon:fh.discard,key:Xu.diffEditorInlineMode}])fu.appendMenuItem(gu.DiffEditorHunkToolbar,{command:{id:(new W5).desc.id,title:y(118,"Revert Block"),icon:e.icon},when:Ac.and(Xu.diffEditorModifiedWritable,e.key),order:5,group:"primary"}),fu.appendMenuItem(gu.DiffEditorSelectionToolbar,{command:{id:(new W5).desc.id,title:y(119,"Revert Selection"),icon:e.icon},when:Ac.and(Xu.diffEditorModifiedWritable,e.key),order:5,group:"primary"});wu(class extends Bu{constructor(){super({id:"diffEditor.switchSide",title:x(86,"Switch Side"),icon:fh.arrowSwap,precondition:Ac.has("isInDiffEditor"),f1:!0,category:B5})}runEditorCommand(e,t,i){const n=U5(e);if(n instanceof O5){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}),wu(class extends Bu{constructor(){super({id:"diffEditor.exitCompareMove",title:x(87,"Exit Compare Move"),icon:fh.close,precondition:Xu.comparingMovedCode,f1:!1,category:B5,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=U5(e);n instanceof O5&&n.exitCompareMove()}}),wu(class extends Bu{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:x(88,"Collapse All Unchanged Regions"),icon:fh.fold,precondition:Ac.has("isInDiffEditor"),f1:!0,category:B5})}runEditorCommand(e,t,...i){const n=U5(e);n instanceof O5&&n.collapseAllUnchangedRegions()}}),wu(class extends Bu{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:x(89,"Show All Unchanged Regions"),icon:fh.unfold,precondition:Ac.has("isInDiffEditor"),f1:!0,category:B5})}runEditorCommand(e,t,...i){const n=U5(e);n instanceof O5&&n.showAllUnchangedRegions()}}),fu.appendMenuItem(gu.EditorTitle,{command:{id:H5.id,title:y(120,"Open Accessible Diff Viewer"),precondition:Ac.has("isInDiffEditor")},order:10,group:"2_diff",when:Ac.and(Xu.accessibleDiffViewerVisible.negate(),Ac.has("isInDiffEditor"))}),fc.registerCommandAlias("editor.action.diffReview.next",H5.id),wu(H5),fc.registerCommandAlias("editor.action.diffReview.prev",z5.id),wu(z5);var K5=function(e,t){return function(i,n){t(i,n,e)}};class j5{remove(){this.parent?.children.delete(this.id)}static findId(e,t){let i;"string"==typeof e?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,void 0!==t.children.get(i)&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let n=i;for(let e=0;void 0!==t.children.get(n);e++)n=`${i}_${e}`;return n}static empty(e){return 0===e.children.size}}class q5 extends j5{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class $5 extends j5{constructor(e,t,i,n){super(),this.id=e,this.parent=t,this.label=i,this.order=n,this.children=new Map}}class G5 extends j5{static create(e,t,i){const n=new ri(i),o=new G5(t.uri),s=e.ordered(t),r=s.map(((e,i)=>{const s=j5.findId(`provider_${i}`,o),r=new $5(s,o,e.displayName??"Unknown Outline Provider",i);return Promise.resolve(e.provideDocumentSymbols(t,n.token)).then((e=>{for(const t of e||[])G5._makeOutlineElement(t,r);return r}),(e=>(Te(e),r))).then((e=>{j5.empty(e)?e.remove():o._groups.set(s,e)}))})),a=e.onDidChange((()=>{es(e.ordered(t),s)||n.cancel()}));return Promise.all(r).then((()=>n.token.isCancellationRequested&&!i.isCancellationRequested?G5.create(e,t,i):o._compact())).finally((()=>{n.dispose(),a.dispose(),n.dispose()}))}static _makeOutlineElement(e,t){const i=j5.findId(e,t),n=new q5(i,t,e);if(e.children)for(const t of e.children)G5._makeOutlineElement(t,n);t.children.set(n.id,n)}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[t,i]of this._groups)0===i.children.size?this._groups.delete(t):e+=1;if(1!==e)this.children=this._groups;else{const e=Ct.first(this._groups.values());for(const[,t]of e.children)t.parent=this,this.children.set(t.id,t)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof q5?e.push(t.symbol):e.push(...Ct.map(t.children.values(),(e=>e.symbol)));return e.sort(((e,t)=>Yu.compareRangesUsingStarts(e.range,t.range)))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return G5._flattenDocumentSymbols(t,e,""),t.sort(((e,t)=>rc.compare(Yu.getStartPosition(e.range),Yu.getStartPosition(t.range))||rc.compare(Yu.getEndPosition(t.range),Yu.getEndPosition(e.range))))}static _flattenDocumentSymbols(e,t,i){for(const n of t)e.push({kind:n.kind,tags:n.tags,name:n.name,detail:n.detail,containerName:n.containerName||i,range:n.range,selectionRange:n.selectionRange,children:void 0}),n.children&&G5._flattenDocumentSymbols(e,n.children,n.name)}}const Z5=oc("IOutlineModelService");let Y5=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new Mt,this._cache=new ad(15,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(i.onModelRemoved((e=>{this._cache.delete(e.id)})))}dispose(){this._disposables.dispose()}async getOrCreate(e,t){const i=this._languageFeaturesService.documentSymbolProvider,n=i.ordered(e);let o=this._cache.get(e.id);if(!o||o.versionId!==e.getVersionId()||!es(o.provider,n)){const t=new ri;o={versionId:e.getVersionId(),provider:n,promiseCnt:0,source:t,promise:G5.create(i,e,t.token),model:void 0},this._cache.set(e.id,o);const s=Date.now();o.promise.then((t=>{o.model=t,this._debounceInformation.update(e,Date.now()-s)})).catch((t=>{this._cache.delete(e.id)}))}if(o.model)return o.model;o.promiseCnt+=1;const s=t.onCancellationRequested((()=>{0==--o.promiseCnt&&(o.source.cancel(),this._cache.delete(e.id))}));try{return await o.promise}finally{s.dispose()}}};Y5=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([K5(0,BD),K5(1,Bq),K5(2,ac)],Y5),wp(Z5,Y5,1);var Q5=function(e,t){return function(i,n){t(i,n,e)}};let X5=class extends At{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=Js(this,void 0);const n=Fr("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),o=Fr("_textModel.onDidChangeContent",zt.debounce((e=>this._textModel.onDidChangeContent(e)),(()=>{}),100));this._register(hr((async(e,t)=>{n.read(e),o.read(e);const i=t.add(new v2),s=await this._outlineModelService.getOrCreate(this._textModel,i.token);t.isDisposed||this._currentModel.set(s,void 0)})))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const n=i.asListOfDocumentSymbols().filter((t=>e.contains(t.range.startLineNumber)&&!e.contains(t.range.endLineNumber)));return n.sort(xs(Cs((e=>e.range.endLineNumber-e.range.startLineNumber),ys))),n.map((e=>({name:e.name,kind:e.kind,startLineNumber:e.range.startLineNumber})))}};X5=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Q5(1,BD),Q5(2,Z5)],X5),L5.setBreadcrumbsSourceFactory(((e,t)=>t.createInstance(X5,e)));var J5=i(8357),e3={};e3.styleTagTransform=zl(),e3.setAttributes=Bl(),e3.insert=Pl().bind(null,"head"),e3.domAPI=Rl(),e3.insertStyleElement=Vl(),Ml()(J5.A,e3),J5.A&&J5.A.locals&&J5.A.locals;class t3{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){const i=e.getValueInRange(this.selection);this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new Yu(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),i),!this.selection.containsPosition(this.targetPosition)||this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition))?this.copy?this.targetSelection=new Qu(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn):this.targetPosition.lineNumber>this.selection.endLineNumber?this.targetSelection=new Qu(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn):this.targetPosition.lineNumber<this.selection.endLineNumber?this.targetSelection=new Qu(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber+this.selection.endLineNumber-this.selection.startLineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn):this.selection.endColumn<=this.targetPosition.column?this.targetSelection=new Qu(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,(this.selection.startLineNumber,this.selection.endLineNumber,this.targetPosition.column-this.selection.endColumn+this.selection.startColumn),this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column:this.selection.endColumn):this.targetSelection=new Qu(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column+this.selection.endColumn-this.selection.startColumn):this.targetSelection=this.selection}computeCursorState(e,t){return this.targetSelection}}function i3(e){return $?e.altKey:e.ctrlKey}class n3 extends At{static{this.ID="editor.contrib.dragAndDrop"}static{this.TRIGGER_KEY_VALUE=$?6:5}constructor(e){super(),this._editor=e,this._dndDecorationIds=this._editor.createDecorationsCollection(),this._register(this._editor.onMouseDown((e=>this._onEditorMouseDown(e)))),this._register(this._editor.onMouseUp((e=>this._onEditorMouseUp(e)))),this._register(this._editor.onMouseDrag((e=>this._onEditorMouseDrag(e)))),this._register(this._editor.onMouseDrop((e=>this._onEditorMouseDrop(e)))),this._register(this._editor.onMouseDropCanceled((()=>this._onEditorMouseDropCanceled()))),this._register(this._editor.onKeyDown((e=>this.onEditorKeyDown(e)))),this._register(this._editor.onKeyUp((e=>this.onEditorKeyUp(e)))),this._register(this._editor.onDidBlurEditorWidget((()=>this.onEditorBlur()))),this._register(this._editor.onDidBlurEditorText((()=>this.onEditorBlur()))),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){this._editor.getOption(42)&&!this._editor.getOption(28)&&(i3(e)&&(this._modifierPressed=!0),this._mouseDown&&i3(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){this._editor.getOption(42)&&!this._editor.getOption(28)&&(i3(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===n3.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){const t=e.target;if(null===this._dragSelection){const e=(this._editor.getSelections()||[]).filter((e=>t.position&&e.containsPosition(t.position)));if(1!==e.length)return;this._dragSelection=e[0]}i3(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),t.position&&(this._dragSelection.containsPosition(t.position)?this._removeDecoration():this.showAt(t.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(e){if(e.target&&(this._hitContent(e.target)||this._hitMargin(e.target))&&e.target.position){const t=new rc(e.target.position.lineNumber,e.target.position.column);if(null===this._dragSelection){let i=null;if(e.event.shiftKey){const e=this._editor.getSelection();if(e){const{selectionStartLineNumber:n,selectionStartColumn:o}=e;i=[new Qu(n,o,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map((e=>e.containsPosition(t)?new Qu(t.lineNumber,t.column,t.lineNumber,t.column):e));this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(i3(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(n3.ID,new t3(this._dragSelection,t,i3(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}static{this._DECORATION_OPTIONS=bk.register({description:"dnd-target",className:"dnd-target"})}showAt(e){this._dndDecorationIds.set([{range:new Yu(e.lineNumber,e.column,e.lineNumber,e.column),options:n3._DECORATION_OPTIONS}]),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return 6===e.type||7===e.type}_hitMargin(e){return 2===e.type||3===e.type||4===e.type}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}}Uu(n3.ID,n3,2),fc.registerCommand("_executeDocumentSymbolProvider",(async function(e,...t){const[i]=t;_t(uo.isUri(i));const n=e.get(Z5),o=e.get(lc),s=await o.createModelReference(i);try{return(await n.getOrCreate(s.object.textEditorModel,oi.None)).getTopLevelSymbols()}finally{s.dispose()}})),Uu(yO.ID,yO,0),qq(PT),Vu(new class extends Ou{constructor(){super({id:bO,precondition:wO,kbOpts:{weight:100,primary:2137}})}runEditorCommand(e,t){return yO.get(t)?.changePasteType()}}),Vu(new class extends Ou{constructor(){super({id:"editor.hidePasteWidget",precondition:wO,kbOpts:{weight:100,primary:9}})}runEditorCommand(e,t){yO.get(t)?.clearWidgets()}}),Hu(class e extends Pu{static{this.argsSchema={oneOf:[{type:"object",required:["kind"],properties:{kind:{type:"string",description:y(908,"The kind of the paste edit to try pasting with.\nIf there are multiple edits for this kind, the editor will show a picker. If there are no edits of this kind, the editor will show an error message.")}}},{type:"object",required:["preferences"],properties:{preferences:{type:"array",description:y(909,"List of preferred paste edit kind to try applying.\nThe first edit matching the preferences will be applied."),items:{type:"string"}}}}]}}constructor(){super({id:"editor.action.pasteAs",label:x(910,"Paste As..."),precondition:Xu.writable,metadata:{description:"Paste as",args:[{name:"args",schema:e.argsSchema}]}})}run(e,t,i){let n;return i&&("kind"in i?n={only:new _D(i.kind)}:"preferences"in i&&(n={preferences:i.preferences.map((e=>new _D(e)))})),yO.get(t)?.pasteAs(n)}}),Hu(class extends Pu{constructor(){super({id:"editor.action.pasteAsText",label:x(911,"Paste as Text"),precondition:Xu.writable})}run(e,t){return yO.get(t)?.pasteAs({providerId:NT.id})}});class o3{constructor(e){this.identifier=e}}const s3=oc("treeViewsDndService");wp(s3,class{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}},1);var r3,a3=function(e,t){return function(i,n){t(i,n,e)}};const l3="editor.changeDropType",d3=new Jc("dropWidgetVisible",!1,y(929,"Whether the drop widget is showing"));let h3=class extends At{static{r3=this}static{this.ID="editor.contrib.dropIntoEditorController"}static get(e){return e.getContribution(r3.ID)}constructor(e,t,i,n,o){super(),this._configService=i,this._languageFeaturesService=n,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=ED.getInstance(),this._dropProgressManager=this._register(t.createInstance(ZD,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(fO,"dropIntoEditor",e,d3,{id:l3,label:y(930,"Show drop options...")},(()=>r3._configureDefaultAction?[r3._configureDefaultAction]:[]))),this._register(e.onDropIntoEditor((t=>this.onDropIntoEditor(e,t.position,t.event))))}clearWidgets(){this._postDropWidgetManager.clear()}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(e,t,i){if(!i.dataTransfer||!e.hasModel())return;r3._currentDropOperation?.cancel(),e.focus(),e.setPosition(t);const n=hi((async o=>{const s=new Mt,r=s.add(new UD(e,1,void 0,o));try{const n=await this.extractDataTransferData(i);if(0===n.size||r.token.isCancellationRequested)return;const a=e.getModel();if(!a)return;const l=this._languageFeaturesService.documentDropEditProvider.ordered(a).filter((e=>!e.dropMimeTypes||e.dropMimeTypes.some((e=>n.matches(e))))),d=s.add(await this.getDropEdits(l,a,t,n,r.token));if(r.token.isCancellationRequested)return;if(d.edits.length){const i=this.getInitialActiveEditIndex(a,d.edits),n="afterDrop"===e.getOption(43).showDropSelector;await this._postDropWidgetManager.applyEditAndShowIfNeeded([Yu.fromPositions(t)],{activeEditIndex:i,allEdits:d.edits},n,(async e=>e),o)}}finally{s.dispose(),r3._currentDropOperation===n&&(r3._currentDropOperation=void 0)}}));this._dropProgressManager.showWhile(t,y(931,"Running drop handlers. Click to cancel"),n,{cancel:()=>n.cancel()}),r3._currentDropOperation=n}async getDropEdits(e,t,i,n,o){const s=new Mt,r=await ci(Promise.all(e.map((async e=>{try{const r=await e.provideDocumentDropEdits(t,i,n,o);return r&&s.add(r),r?.edits.map((t=>({...t,providerId:e.id})))}catch(e){Re(e)||console.error(e),console.error(e)}}))),o);return{edits:YT(as(r??[]).flat()),dispose:()=>s.dispose()}}getInitialActiveEditIndex(e,t){const i=this._configService.getValue("editor.dropIntoEditor.preferences",{resource:e.uri});for(const e of Array.isArray(i)?i:[]){const i=new _D(e),n=t.findIndex((e=>e.kind&&i.contains(e.kind)));if(n>=0)return n}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new uD;const t=AD(e.dataTransfer);if(this.treeItemsTransfer.hasData(o3.prototype)){const e=this.treeItemsTransfer.getData(o3.prototype);if(Array.isArray(e))for(const i of e){const e=await this._treeViewsDragAndDropService.removeDragOperationTransfer(i.identifier);if(e)for(const[i,n]of e)t.replace(i,n)}}return t}};h3=r3=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([a3(1,nc),a3(2,up),a3(3,BD),a3(4,s3)],h3),Uu(h3.ID,h3,2),qq(OT),Vu(new class extends Ou{constructor(){super({id:l3,precondition:d3,kbOpts:{weight:100,primary:2137}})}runEditorCommand(e,t,i){h3.get(t)?.changeDropType()}}),Vu(new class extends Ou{constructor(){super({id:"editor.hideDropWidget",precondition:d3,kbOpts:{weight:100,primary:9}})}runEditorCommand(e,t,i){h3.get(t)?.clearWidgets()}});class c3{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map((e=>this._editor.getModel().getDecorationRange(e))).filter((e=>!!e));if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e<this._decorations.length?this._decorations[e]:null;return t?this._editor.getModel().getDecorationRange(t):null}getCurrentMatchesPosition(e){const t=this._editor.getModel().getDecorationsInRange(e);for(const e of t){const t=e.options;if(t===c3._FIND_MATCH_DECORATION||t===c3._CURRENT_FIND_MATCH_DECORATION)return this._getDecorationIndex(e.id)}return 0}setCurrentFindMatch(e){let t=null,i=0;if(e)for(let n=0,o=this._decorations.length;n<o;n++){const o=this._editor.getModel().getDecorationRange(this._decorations[n]);if(e.equalsRange(o)){t=this._decorations[n],i=n+1;break}}return null===this._highlightedDecorationId&&null===t||this._editor.changeDecorations((e=>{if(null!==this._highlightedDecorationId&&(e.changeDecorationOptions(this._highlightedDecorationId,c3._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),null!==t&&(this._highlightedDecorationId=t,e.changeDecorationOptions(this._highlightedDecorationId,c3._CURRENT_FIND_MATCH_DECORATION)),null!==this._rangeHighlightDecorationId&&(e.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),null!==t){let i=this._editor.getModel().getDecorationRange(t);if(i.startLineNumber!==i.endLineNumber&&1===i.endColumn){const e=i.endLineNumber-1,t=this._editor.getModel().getLineMaxColumn(e);i=new Yu(i.startLineNumber,i.startColumn,e,t)}this._rangeHighlightDecorationId=e.addDecoration(i,c3._RANGE_HIGHLIGHT_DECORATION)}})),i}set(e,t){this._editor.changeDecorations((i=>{let n=c3._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){n=c3._FIND_MATCH_NO_OVERVIEW_DECORATION;const t=this._editor.getModel().getLineCount(),i=this._editor.getLayoutInfo().height/t,s=Math.max(2,Math.ceil(3/i));let r=e[0].range.startLineNumber,a=e[0].range.endLineNumber;for(let t=1,i=e.length;t<i;t++){const i=e[t].range;a+s>=i.startLineNumber?i.endLineNumber>a&&(a=i.endLineNumber):(o.push({range:new Yu(r,1,a,1),options:c3._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),r=i.startLineNumber,a=i.endLineNumber)}o.push({range:new Yu(r,1,a,1),options:c3._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const s=new Array(e.length);for(let t=0,i=e.length;t<i;t++)s[t]={range:e[t].range,options:n};this._decorations=i.deltaDecorations(this._decorations,s),this._overviewRulerApproximateDecorations=i.deltaDecorations(this._overviewRulerApproximateDecorations,o),this._rangeHighlightDecorationId&&(i.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),this._findScopeDecorationIds.length&&(this._findScopeDecorationIds.forEach((e=>i.removeDecoration(e))),this._findScopeDecorationIds=[]),t?.length&&(this._findScopeDecorationIds=t.map((e=>i.addDecoration(e,c3._FIND_SCOPE_DECORATION))))}))}matchBeforePosition(e){if(0===this._decorations.length)return null;for(let t=this._decorations.length-1;t>=0;t--){const i=this._decorations[t],n=this._editor.getModel().getDecorationRange(i);if(n&&!(n.endLineNumber>e.lineNumber)){if(n.endLineNumber<e.lineNumber)return n;if(!(n.endColumn>e.column))return n}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(0===this._decorations.length)return null;for(let t=0,i=this._decorations.length;t<i;t++){const i=this._decorations[t],n=this._editor.getModel().getDecorationRange(i);if(n&&!(n.startLineNumber<e.lineNumber)){if(n.startLineNumber>e.lineNumber)return n;if(!(n.startColumn<e.column))return n}}return this._editor.getModel().getDecorationRange(this._decorations[0])}_allDecorations(){let e=[];return e=e.concat(this._decorations),e=e.concat(this._overviewRulerApproximateDecorations),this._findScopeDecorationIds.length&&e.push(...this._findScopeDecorationIds),this._rangeHighlightDecorationId&&e.push(this._rangeHighlightDecorationId),e}static{this._CURRENT_FIND_MATCH_DECORATION=bk.register({description:"current-find-match",stickiness:1,zIndex:13,className:"currentFindMatch",inlineClassName:"currentFindMatchInline",showIfCollapsed:!0,overviewRuler:{color:rw(av),position:ug.Center},minimap:{color:rw(uv),position:1}})}static{this._FIND_MATCH_DECORATION=bk.register({description:"find-match",stickiness:1,zIndex:10,className:"findMatch",inlineClassName:"findMatchInline",showIfCollapsed:!0,overviewRuler:{color:rw(av),position:ug.Center},minimap:{color:rw(uv),position:1}})}static{this._FIND_MATCH_NO_OVERVIEW_DECORATION=bk.register({description:"find-match-no-overview",stickiness:1,className:"findMatch",showIfCollapsed:!0})}static{this._FIND_MATCH_ONLY_OVERVIEW_DECORATION=bk.register({description:"find-match-only-overview",stickiness:1,overviewRuler:{color:rw(av),position:ug.Center}})}static{this._RANGE_HIGHLIGHT_DECORATION=bk.register({description:"find-range-highlight",stickiness:1,className:"rangeHighlight",isWholeLine:!0})}static{this._FIND_SCOPE_DECORATION=bk.register({description:"find-scope",className:"findScope",isWholeLine:!0})}}class u3{constructor(e,t,i){this._editorSelection=e,this._ranges=t,this._replaceStrings=i,this._trackedEditorSelectionId=null}getEditOperations(e,t){if(this._ranges.length>0){const e=[];for(let t=0;t<this._ranges.length;t++)e.push({range:this._ranges[t],text:this._replaceStrings[t]});e.sort(((e,t)=>Yu.compareRangesUsingStarts(e.range,t.range)));const i=[];let n=e[0];for(let t=1;t<e.length;t++)n.range.endLineNumber===e[t].range.startLineNumber&&n.range.endColumn===e[t].range.startColumn?(n.range=n.range.plusRange(e[t].range),n.text=n.text+e[t].text):(i.push(n),n=e[t]);i.push(n);for(const e of i)t.addEditOperation(e.range,e.text)}this._trackedEditorSelectionId=t.trackSelection(this._editorSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._trackedEditorSelectionId)}}function g3(e,t){if(e&&""!==e[0]){const i=p3(e,t,"-"),n=p3(e,t,"_");return i&&!n?m3(e,t,"-"):!i&&n?m3(e,t,"_"):e[0].toUpperCase()===e[0]?t.toUpperCase():e[0].toLowerCase()===e[0]?t.toLowerCase():function(e,t=!1){return!!e&&(t&&(e=e.replace(/\\./g,"")),e.toLowerCase()!==e)}(e[0][0])&&t.length>0?t[0].toUpperCase()+t.substr(1):e[0][0].toUpperCase()!==e[0][0]&&t.length>0?t[0].toLowerCase()+t.substr(1):t}return t}function p3(e,t,i){return-1!==e[0].indexOf(i)&&-1!==t.indexOf(i)&&e[0].split(i).length===t.split(i).length}function m3(e,t,i){const n=t.split(i),o=e[0].split(i);let s="";return n.forEach(((e,t)=>{s+=g3([o[t]],e)+i})),s.slice(0,-1)}class f3{constructor(e){this.staticValue=e,this.kind=0}}class _3{constructor(e){this.pieces=e,this.kind=1}}class v3{static fromStaticValue(e){return new v3([b3.staticValue(e)])}get hasReplacementPatterns(){return 1===this._state.kind}constructor(e){e&&0!==e.length?1===e.length&&null!==e[0].staticValue?this._state=new f3(e[0].staticValue):this._state=new _3(e):this._state=new f3("")}buildReplaceString(e,t){if(0===this._state.kind)return t?g3(e,this._state.staticValue):this._state.staticValue;let i="";for(let t=0,n=this._state.pieces.length;t<n;t++){const n=this._state.pieces[t];if(null!==n.staticValue){i+=n.staticValue;continue}let o=v3._substitute(n.matchIndex,e);if(null!==n.caseOps&&n.caseOps.length>0){const e=[],t=n.caseOps.length;let i=0;for(let s=0,r=o.length;s<r;s++){if(i>=t){e.push(o.slice(s));break}switch(n.caseOps[i]){case"U":e.push(o[s].toUpperCase());break;case"u":e.push(o[s].toUpperCase()),i++;break;case"L":e.push(o[s].toLowerCase());break;case"l":e.push(o[s].toLowerCase()),i++;break;default:e.push(o[s])}}o=e.join("")}i+=o}return i}static _substitute(e,t){if(null===t)return"";if(0===e)return t[0];let i="";for(;e>0;){if(e<t.length)return(t[e]||"")+i;i=String(e%10)+i,e=Math.floor(e/10)}return"$"+i}}class b3{static staticValue(e){return new b3(e,-1,null)}static caseOps(e,t){return new b3(null,e,t)}constructor(e,t,i){this.staticValue=e,this.matchIndex=t,i&&0!==i.length?this.caseOps=i.slice(0):this.caseOps=null}}class w3{constructor(e){this._source=e,this._lastCharIndex=0,this._result=[],this._resultLen=0,this._currentStaticPiece=""}emitUnchanged(e){this._emitStatic(this._source.substring(this._lastCharIndex,e)),this._lastCharIndex=e}emitStatic(e,t){this._emitStatic(e),this._lastCharIndex=t}_emitStatic(e){0!==e.length&&(this._currentStaticPiece+=e)}emitMatchIndex(e,t,i){0!==this._currentStaticPiece.length&&(this._result[this._resultLen++]=b3.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),this._result[this._resultLen++]=b3.caseOps(e,i),this._lastCharIndex=t}finalize(){return this.emitUnchanged(this._source.length),0!==this._currentStaticPiece.length&&(this._result[this._resultLen++]=b3.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),new v3(this._result)}}const C3=new Jc("findWidgetVisible",!1),y3=(C3.toNegated(),new Jc("findInputFocussed",!1)),S3=new Jc("replaceInputFocussed",!1),x3={primary:545,mac:{primary:2593}},k3={primary:565,mac:{primary:2613}},L3={primary:560,mac:{primary:2608}},D3={primary:554,mac:{primary:2602}},E3={primary:558,mac:{primary:2606}},N3="editor.action.nextMatchFindAction",I3="editor.action.previousMatchFindAction",T3="closeFindWidget",M3="toggleFindCaseSensitive",A3="toggleFindWholeWord",R3="toggleFindRegex",O3="toggleFindInSelection",P3="togglePreserveCase",F3="editor.action.replaceOne",B3="editor.action.replaceAll",W3=19999;class V3{constructor(e,t){this._toDispose=new Mt,this._editor=e,this._state=t,this._isDisposed=!1,this._startSearchingTimer=new bi,this._decorations=new c3(e),this._toDispose.add(this._decorations),this._updateDecorationsScheduler=new Ci((()=>{if(this._editor.hasModel())return this.research(!1)}),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition((e=>{3!==e.reason&&5!==e.reason&&6!==e.reason||this._decorations.setStartPosition(this._editor.getPosition())}))),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent((e=>{this._ignoreModelContentChanged||(e.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())}))),this._toDispose.add(this._state.onFindReplaceStateChange((e=>this._onStateChanged(e)))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,Et(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){!this._isDisposed&&this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet((()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)}),240)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let i=null;void 0!==t?null!==t&&(i=Array.isArray(t)?t:[t]):i=this._decorations.getFindScopes(),null!==i&&(i=i.map((e=>{if(e.startLineNumber!==e.endLineNumber){let t=e.endLineNumber;return 1===e.endColumn&&(t-=1),new Yu(e.startLineNumber,1,t,this._editor.getModel().getLineMaxColumn(t))}return e})));const n=this._findMatches(i,!1,W3);this._decorations.set(n,i);const o=this._editor.getSelection();let s=this._decorations.getCurrentMatchesPosition(o);if(0===s&&n.length>0){const e=fm(n.map((e=>e.range)),(e=>Yu.compareRangesUsingStarts(e,o)>=0));s=e>0?e-1+1:s}this._state.changeMatchInfo(s,this._decorations.getCount(),void 0),e&&this._editor.getOption(50).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){const t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:n}=e;const o=this._editor.getModel();return t||1===n?(1===i?i=o.getLineCount():i--,n=o.getLineMaxColumn(i)):n--,new rc(i,n)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const t=this._decorations.matchAfterPosition(e);return void(t&&this._setCurrentFindMatch(t))}if(this._decorations.getCount()<W3){let t=this._decorations.matchBeforePosition(e);return t&&t.isEmpty()&&t.getStartPosition().equals(e)&&(e=this._prevSearchPosition(e),t=this._decorations.matchBeforePosition(e)),void(t&&this._setCurrentFindMatch(t))}if(this._cannotFind())return;const i=this._decorations.getFindScope(),n=V3._getSearchRange(this._editor.getModel(),i);n.getEndPosition().isBefore(e)&&(e=n.getEndPosition()),e.isBefore(n.getStartPosition())&&(e=n.getEndPosition());const{lineNumber:o,column:s}=e,r=this._editor.getModel();let a=new rc(o,s),l=r.findPreviousMatch(this._state.searchString,a,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(148):null,!1);return l&&l.range.isEmpty()&&l.range.getStartPosition().equals(a)&&(a=this._prevSearchPosition(a),l=r.findPreviousMatch(this._state.searchString,a,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(148):null,!1)),l?t||n.containsRange(l.range)?void this._setCurrentFindMatch(l.range):this._moveToPrevMatch(l.range.getStartPosition(),!0):void 0}moveToPrevMatch(){this._moveToPrevMatch(this._editor.getSelection().getStartPosition())}_nextSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:n}=e;const o=this._editor.getModel();return t||n===o.getLineMaxColumn(i)?(i===o.getLineCount()?i=1:i++,n=1):n++,new rc(i,n)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const t=this._decorations.matchBeforePosition(e);return void(t&&this._setCurrentFindMatch(t))}if(this._decorations.getCount()<W3){let t=this._decorations.matchAfterPosition(e);return t&&t.isEmpty()&&t.getStartPosition().equals(e)&&(e=this._nextSearchPosition(e),t=this._decorations.matchAfterPosition(e)),void(t&&this._setCurrentFindMatch(t))}const t=this._getNextMatch(e,!1,!0);t&&this._setCurrentFindMatch(t.range)}_getNextMatch(e,t,i,n=!1){if(this._cannotFind())return null;const o=this._decorations.getFindScope(),s=V3._getSearchRange(this._editor.getModel(),o);s.getEndPosition().isBefore(e)&&(e=s.getStartPosition()),e.isBefore(s.getStartPosition())&&(e=s.getStartPosition());const{lineNumber:r,column:a}=e,l=this._editor.getModel();let d=new rc(r,a),h=l.findNextMatch(this._state.searchString,d,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(148):null,t);return i&&h&&h.range.isEmpty()&&h.range.getStartPosition().equals(d)&&(d=this._nextSearchPosition(d),h=l.findNextMatch(this._state.searchString,d,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(148):null,t)),h?n||s.containsRange(h.range)?h:this._getNextMatch(h.range.getEndPosition(),t,i,!0):null}moveToNextMatch(){this._moveToNextMatch(this._editor.getSelection().getEndPosition())}_moveToMatch(e){const t=this._decorations.getDecorationRangeAt(e);t&&this._setCurrentFindMatch(t)}moveToMatch(e){this._moveToMatch(e)}_getReplacePattern(){return this._state.isRegex?function(e){if(!e||0===e.length)return new v3(null);const t=[],i=new w3(e);for(let n=0,o=e.length;n<o;n++){const s=e.charCodeAt(n);if(92!==s){if(36===s){if(n++,n>=o)break;const s=e.charCodeAt(n);if(36===s){i.emitUnchanged(n-1),i.emitStatic("$",n+1);continue}if(48===s||38===s){i.emitUnchanged(n-1),i.emitMatchIndex(0,n+1,t),t.length=0;continue}if(49<=s&&s<=57){let r=s-48;if(n+1<o){const o=e.charCodeAt(n+1);if(48<=o&&o<=57){n++,r=10*r+(o-48),i.emitUnchanged(n-2),i.emitMatchIndex(r,n+1,t),t.length=0;continue}}i.emitUnchanged(n-1),i.emitMatchIndex(r,n+1,t),t.length=0;continue}}}else{if(n++,n>=o)break;const s=e.charCodeAt(n);switch(s){case 92:i.emitUnchanged(n-1),i.emitStatic("\\",n+1);break;case 110:i.emitUnchanged(n-1),i.emitStatic("\n",n+1);break;case 116:i.emitUnchanged(n-1),i.emitStatic("\t",n+1);break;case 117:case 85:case 108:case 76:i.emitUnchanged(n-1),i.emitStatic("",n+1),t.push(String.fromCharCode(s))}}}return i.finalize()}(this._state.replaceString):v3.fromStaticValue(this._state.replaceString)}replace(){if(!this._hasMatches())return;const e=this._getReplacePattern(),t=this._editor.getSelection(),i=this._getNextMatch(t.getStartPosition(),!0,!1);if(i)if(t.equalsRange(i.range)){const n=e.buildReplaceString(i.matches,this._state.preserveCase),o=new Hk(t,n);this._executeEditorCommand("replace",o),this._decorations.setStartPosition(new rc(t.startLineNumber,t.startColumn+n.length)),this.research(!0)}else this._decorations.setStartPosition(this._editor.getPosition()),this._setCurrentFindMatch(i.range)}_findMatches(e,t,i){const n=(e||[null]).map((e=>V3._getSearchRange(this._editor.getModel(),e)));return this._editor.getModel().findMatches(this._state.searchString,n,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(148):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();null===e&&this._state.matchesCount>=W3?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const e=new $y(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(148):null).parseSearchRequest();if(!e)return;let t=e.regex;if(!t.multiline){let e="mu";t.ignoreCase&&(e+="i"),t.global&&(e+="g"),t=new RegExp(t.source,e)}const i=this._editor.getModel(),n=i.getValue(1),o=i.getFullModelRange(),s=this._getReplacePattern();let r;const a=this._state.preserveCase;r=s.hasReplacementPatterns||a?n.replace(t,(function(){return s.buildReplaceString(arguments,a)})):n.replace(t,s.buildReplaceString(null,a));const l=new $k(o,r,this._editor.getSelection());this._executeEditorCommand("replaceAll",l)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),n=[];for(let e=0,o=i.length;e<o;e++)n[e]=t.buildReplaceString(i[e].matches,this._state.preserveCase);const o=new u3(this._editor.getSelection(),i.map((e=>e.range)),n);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let t=this._findMatches(e,!1,1073741824).map((e=>new Qu(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn)));const i=this._editor.getSelection();for(let e=0,n=t.length;e<n;e++)if(t[e].equalsRange(i)){t=[i].concat(t.slice(0,e)).concat(t.slice(e+1));break}this._editor.setSelections(t)}_executeEditorCommand(e,t){try{this._ignoreModelContentChanged=!0,this._editor.pushUndoStop(),this._editor.executeCommand(e,t),this._editor.pushUndoStop()}finally{this._ignoreModelContentChanged=!1}}}var H3=i(5669),z3={};z3.styleTagTransform=zl(),z3.setAttributes=Bl(),z3.insert=Pl().bind(null,"head"),z3.domAPI=Rl(),z3.insertStyleElement=Vl(),Ml()(H3.A,z3),H3.A&&H3.A.locals&&H3.A.locals;class U3 extends mM{static{this.ID="editor.contrib.findOptionsWidget"}constructor(e,t,i){super(),this._hideSoon=this._register(new Ci((()=>this._hide()),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=i,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const n={inputActiveOptionBorder:Af(Sv),inputActiveOptionForeground:Af(Lv),inputActiveOptionBackground:Af(kv)},o=this._register(oM());this.caseSensitive=this._register(new aQ({appendTitle:this._keybindingLabelFor(M3),isChecked:this._state.matchCase,hoverDelegate:o,...n})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange((()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)}))),this.wholeWords=this._register(new lQ({appendTitle:this._keybindingLabelFor(A3),isChecked:this._state.wholeWord,hoverDelegate:o,...n})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange((()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)}))),this.regex=this._register(new dQ({appendTitle:this._keybindingLabelFor(R3),isChecked:this._state.isRegex,hoverDelegate:o,...n})),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange((()=>{this._state.change({isRegex:this.regex.checked},!1)}))),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange((e=>{let t=!1;e.isRegex&&(this.regex.checked=this._state.isRegex,t=!0),e.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,t=!0),e.matchCase&&(this.caseSensitive.checked=this._state.matchCase,t=!0),!this._state.isRevealed&&t&&this._revealTemporarily()}))),this._register(ga(this._domNode,Qa.MOUSE_LEAVE,(e=>this._onMouseLeave()))),this._register(ga(this._domNode,"mouseover",(e=>this._onMouseOver())))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return U3.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseLeave(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}}function K3(e,t){return 1===e||2!==e&&t}class j3 extends At{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return K3(this._isRegexOverride,this._isRegex)}get wholeWord(){return K3(this._wholeWordOverride,this._wholeWord)}get matchCase(){return K3(this._matchCaseOverride,this._matchCase)}get preserveCase(){return K3(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}constructor(){super(),this._onFindReplaceStateChange=this._register(new Zt),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}changeMatchInfo(e,t,i){const n={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;0===t&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,n.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,n.matchesCount=!0,o=!0),void 0!==i&&(Yu.equalsRange(this._currentMatch,i)||(this._currentMatch=i,n.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(n)}change(e,t,i=!0){const n={moveCursor:t,updateHistory:i,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;const s=this.isRegex,r=this.wholeWord,a=this.matchCase,l=this.preserveCase;void 0!==e.searchString&&this._searchString!==e.searchString&&(this._searchString=e.searchString,n.searchString=!0,o=!0),void 0!==e.replaceString&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,n.replaceString=!0,o=!0),void 0!==e.isRevealed&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,n.isRevealed=!0,o=!0),void 0!==e.isReplaceRevealed&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,n.isReplaceRevealed=!0,o=!0),void 0!==e.isRegex&&(this._isRegex=e.isRegex),void 0!==e.wholeWord&&(this._wholeWord=e.wholeWord),void 0!==e.matchCase&&(this._matchCase=e.matchCase),void 0!==e.preserveCase&&(this._preserveCase=e.preserveCase),void 0!==e.searchScope&&(e.searchScope?.every((e=>this._searchScope?.some((t=>!Yu.equalsRange(t,e)))))||(this._searchScope=e.searchScope,n.searchScope=!0,o=!0)),void 0!==e.loop&&this._loop!==e.loop&&(this._loop=e.loop,n.loop=!0,o=!0),void 0!==e.isSearching&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,n.isSearching=!0,o=!0),void 0!==e.filters&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,n.filters=!0,o=!0),this._isRegexOverride=void 0!==e.isRegexOverride?e.isRegexOverride:0,this._wholeWordOverride=void 0!==e.wholeWordOverride?e.wholeWordOverride:0,this._matchCaseOverride=void 0!==e.matchCaseOverride?e.matchCaseOverride:0,this._preserveCaseOverride=void 0!==e.preserveCaseOverride?e.preserveCaseOverride:0,s!==this.isRegex&&(o=!0,n.isRegex=!0),r!==this.wholeWord&&(o=!0,n.wholeWord=!0),a!==this.matchCase&&(o=!0,n.matchCase=!0),l!==this.preserveCase&&(o=!0,n.preserveCase=!0),o&&this._onFindReplaceStateChange.fire(n)}canNavigateBack(){return this.canNavigateInLoop()||1!==this.matchesPosition}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition<this.matchesCount}canNavigateInLoop(){return this._loop||this.matchesCount>=W3}}var q3=i(5395),$3={};$3.styleTagTransform=zl(),$3.setAttributes=Bl(),$3.insert=Pl().bind(null,"head"),$3.domAPI=Rl(),$3.insertStyleElement=Vl(),Ml()(q3.A,$3),q3.A&&q3.A.locals&&q3.A.locals;const G3=y(5,"input"),Z3=y(6,"Preserve Case");class Y3 extends eQ{constructor(e){super({icon:fh.preserveCase,title:Z3+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??nM("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Q3 extends mM{get onDidOptionChange(){return this._onDidOptionChange.event}get onKeyDown(){return this._onKeyDown.event}get onPreserveCaseKeyDown(){return this._onPreserveCaseKeyDown.event}constructor(e,t,i,n){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new Zt),this._onKeyDown=this._register(new Zt),this._onMouseDown=this._register(new Zt),this._onInput=this._register(new Zt),this._onKeyUp=this._register(new Zt),this._onPreserveCaseKeyDown=this._register(new Zt),this.contextViewProvider=t,this.placeholder=n.placeholder||"",this.validation=n.validation,this.label=n.label||G3;const o=n.appendPreserveCaseLabel||"",s=n.history||new Set([]),r=!!n.flexibleHeight,a=!!n.flexibleWidth,l=n.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new wQ(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:s,showHistoryHint:n.showHistoryHint,flexibleHeight:r,flexibleWidth:a,flexibleMaxHeight:l,inputBoxStyles:n.inputBoxStyles})),this.preserveCase=this._register(new Y3({appendTitle:o,isChecked:!1,...n.toggleStyles})),this._register(this.preserveCase.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this._register(this.preserveCase.onKeyDown((e=>{this._onPreserveCaseKeyDown.fire(e)}))),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const d=[this.preserveCase.domNode];this.onkeydown(this.domNode,(e=>{if(e.equals(15)||e.equals(17)||e.equals(9)){const t=d.indexOf(this.domNode.ownerDocument.activeElement);if(t>=0){let i=-1;e.equals(17)?i=(t+1)%d.length:e.equals(15)&&(i=0===t?d.length-1:t-1),e.equals(9)?(d[t].blur(),this.inputBox.focus()):i>=0&&d[i].focus(),Ja(e,!0)}}}));const h=document.createElement("div");h.className="controls",h.style.display=this._showOptionButtons?"block":"none",h.appendChild(this.preserveCase.domNode),this.domNode.appendChild(h),e?.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,(e=>this._onKeyDown.fire(e))),this.onkeyup(this.inputBox.inputElement,(e=>this._onKeyUp.fire(e))),this.oninput(this.inputBox.inputElement,(e=>this._onInput.fire())),this.onmousedown(this.inputBox.inputElement,(e=>this._onMouseDown.fire(e)))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){this.inputBox?.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var X3=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},J3=function(e,t){return function(i,n){t(i,n,e)}};const e6=new Jc("suggestWidgetVisible",!1,y(1683,"Whether suggestion are visible")),t6="historyNavigationWidgetFocus",i6="historyNavigationForwardsEnabled",n6="historyNavigationBackwardsEnabled";let o6;const s6=[];function r6(e,t){if(s6.includes(t))throw new Error("Cannot register the same widget multiple times");s6.push(t);const i=new Mt,n=new Jc(t6,!1).bindTo(e),o=new Jc(i6,!0).bindTo(e),s=new Jc(n6,!0).bindTo(e),r=()=>{n.set(!0),o6=t},a=()=>{n.set(!1),o6===t&&(o6=void 0)};return Ha(t.element)&&r(),i.add(t.onDidFocus((()=>r()))),i.add(t.onDidBlur((()=>a()))),i.add(Tt((()=>{s6.splice(s6.indexOf(t),1),a()}))),{historyNavigationForwardsEnablement:o,historyNavigationBackwardsEnablement:s,dispose(){i.dispose()}}}let a6=class extends xQ{constructor(e,t,i,n){super(e,t,i);const o=this._register(n.createScoped(this.inputBox.element));this._register(r6(o,this.inputBox))}};a6=X3([J3(3,eu)],a6);let l6=class extends Q3{constructor(e,t,i,n,o=!1){super(e,t,o,i);const s=this._register(n.createScoped(this.inputBox.element));this._register(r6(s,this.inputBox))}};function d6(e){return"Up"===e.lookupKeybinding("history.showPrevious")?.getElectronAccelerator()&&"Down"===e.lookupKeybinding("history.showNext")?.getElectronAccelerator()}l6=X3([J3(3,eu)],l6),lu.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:Ac.and(Ac.has(t6),Ac.equals(n6,!0),Ac.not("isComposing"),e6.isEqualTo(!1)),primary:16,secondary:[528],handler:e=>{o6?.showPreviousValue()}}),lu.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:Ac.and(Ac.has(t6),Ac.equals(i6,!0),Ac.not("isComposing"),e6.isEqualTo(!1)),primary:18,secondary:[530],handler:e=>{o6?.showNextValue()}});const h6=bF("find-collapsed",fh.chevronRight,y(951,"Icon to indicate that the editor find widget is collapsed.")),c6=bF("find-expanded",fh.chevronDown,y(952,"Icon to indicate that the editor find widget is expanded.")),u6=bF("find-selection",fh.selection,y(953,"Icon for 'Find in Selection' in the editor find widget.")),g6=bF("find-replace",fh.replace,y(954,"Icon for 'Replace' in the editor find widget.")),p6=bF("find-replace-all",fh.replaceAll,y(955,"Icon for 'Replace All' in the editor find widget.")),m6=bF("find-previous-match",fh.arrowUp,y(956,"Icon for 'Find Previous' in the editor find widget.")),f6=bF("find-next-match",fh.arrowDown,y(957,"Icon for 'Find Next' in the editor find widget.")),_6=y(958,"Find / Replace"),v6=y(959,"Find"),b6=y(960,"Find"),w6=y(961,"Previous Match"),C6=y(962,"Next Match"),y6=y(963,"Find in Selection"),S6=y(964,"Close"),x6=y(965,"Replace"),k6=y(966,"Replace"),L6=y(967,"Replace"),D6=y(968,"Replace All"),E6=y(969,"Toggle Replace"),N6=y(970,"Only the first {0} results are highlighted, but all find operations work on the entire text.",W3),I6=y(971,"{0} of {1}"),T6=y(972,"No results"),M6=419;let A6=69;const R6=$?256:2048;class O6{constructor(e){this.afterLineNumber=e,this.heightInPx=33,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function P6(e,t,i){const n=!!t.match(/\n/);i&&n&&i.selectionStart>0&&e.stopPropagation()}function F6(e,t,i){const n=!!t.match(/\n/);i&&n&&i.selectionEnd<i.value.length&&e.stopPropagation()}class B6 extends mM{static{this.ID="editor.contrib.findWidget"}constructor(e,t,i,n,o,s,r,a,l){super(),this._hoverService=r,this._findWidgetSearchHistory=a,this._replaceWidgetHistory=l,this._cachedHeight=null,this._revealTimeouts=[],this._codeEditor=e,this._controller=t,this._state=i,this._contextViewProvider=n,this._keybindingService=o,this._contextKeyService=s,this._isVisible=!1,this._isReplaceVisible=!1,this._ignoreChangeEvent=!1,this._updateHistoryDelayer=new gi(500),this._register(Tt((()=>this._updateHistoryDelayer.cancel()))),this._register(this._state.onFindReplaceStateChange((e=>this._onStateChanged(e)))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration((e=>{if(e.hasChanged(104)&&(this._codeEditor.getOption(104)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),e.hasChanged(165)&&this._tryUpdateWidgetWidth(),e.hasChanged(2)&&this.updateAccessibilitySupport(),e.hasChanged(50)){const e=this._codeEditor.getOption(50).loop;this._state.change({loop:e},!1);const t=this._codeEditor.getOption(50).addExtraSpaceOnTop;t&&!this._viewZone&&(this._viewZone=new O6(0),this._showViewZone()),!t&&this._viewZone&&this._removeViewZone()}}))),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection((()=>{this._isVisible&&this._updateToggleSelectionFindButton()}))),this._register(this._codeEditor.onDidFocusEditorWidget((async()=>{if(this._isVisible){const e=await this._controller.getGlobalBufferTerm();e&&e!==this._state.searchString&&(this._state.change({searchString:e},!1),this._findInput.select())}}))),this._findInputFocused=y3.bindTo(s),this._findFocusTracker=this._register(tl(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus((()=>{this._findInputFocused.set(!0),this._updateSearchScope()}))),this._register(this._findFocusTracker.onDidBlur((()=>{this._findInputFocused.set(!1)}))),this._replaceInputFocused=S3.bindTo(s),this._replaceFocusTracker=this._register(tl(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus((()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()}))),this._register(this._replaceFocusTracker.onDidBlur((()=>{this._replaceInputFocused.set(!1)}))),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(50).addExtraSpaceOnTop&&(this._viewZone=new O6(0)),this._register(this._codeEditor.onDidChangeModel((()=>{this._isVisible&&(this._viewZoneId=void 0)}))),this._register(this._codeEditor.onDidScrollChange((e=>{e.scrollTopChanged?this._layoutViewZone():setTimeout((()=>{this._layoutViewZone()}),0)})))}getId(){return B6.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}:null}_onStateChanged(e){if(e.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?this._codeEditor.getOption(104)||this._isReplaceVisible||(this._isReplaceVisible=!0,this._replaceInput.width=Ta(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){const e=this._state.searchString.length>0&&0===this._state.matchesCount;this._domNode.classList.toggle("no-results",e),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,Ie)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){let e;if(this._matchesCount.style.minWidth=A6+"px",this._state.matchesCount>=W3?this._matchesCount.title=N6:this._matchesCount.title="",this._matchesCount.firstChild?.remove(),this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=W3&&(t+="+");let i=String(this._state.matchesPosition);"0"===i&&(i="?"),e=Bi(I6,i,t)}else e=T6;this._matchesCount.appendChild(document.createTextNode(e)),Yl(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),A6=Math.max(A6,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===T6)return""===i?y(973,"{0} found",e):y(974,"{0} found for '{1}'",e,i);if(t){const n=y(975,"{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),o=this._codeEditor.getModel();return o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1?`${o.getLineContent(t.startLineNumber)}, ${n}`:n}return y(976,"{0} found for '{1}'",e,i)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=!!e&&(e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn),i=this._toggleSelectionFind.checked;this._isVisible&&(i||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);const e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);const i=!this._codeEditor.getOption(104);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(this._revealTimeouts.forEach((e=>{clearTimeout(e)})),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(50).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const t=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=t;break}}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout((()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")}),0)),this._revealTimeouts.push(setTimeout((()=>{this._findInput.validate()}),200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(50).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const n=Na(i),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),s=n.left+(o?o.left:0),r=o?o.top:0;if(this._viewZone&&r<this._viewZone.heightInPx){e.endLineNumber>e.startLineNumber&&(t=!1);const i=Ea(this._domNode).left;s>i&&(t=!1);const o=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());n.left+(o?o.left:0)>i&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach((e=>{clearTimeout(e)})),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(50).addExtraSpaceOnTop)return void this._removeViewZone();if(!this._isVisible)return;const t=this._viewZone;void 0===this._viewZoneId&&t&&this._codeEditor.changeViewZones((i=>{t.heightInPx=this._getHeight(),this._viewZoneId=i.addZone(t),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+t.heightInPx)}))}_showViewZone(e=!0){if(!this._isVisible)return;if(!this._codeEditor.getOption(50).addExtraSpaceOnTop)return;void 0===this._viewZone&&(this._viewZone=new O6(0));const t=this._viewZone;this._codeEditor.changeViewZones((i=>{if(void 0!==this._viewZoneId){const n=this._getHeight();if(n===t.heightInPx)return;const o=n-t.heightInPx;return t.heightInPx=n,i.layoutZone(this._viewZoneId),void(e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o))}{let n=this._getHeight();if(n-=this._codeEditor.getOption(96).top,n<=0)return;t.heightInPx=n,this._viewZoneId=i.addZone(t),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+n)}}))}_removeViewZone(){this._codeEditor.changeViewZones((e=>{void 0!==this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))}))}_tryUpdateWidgetWidth(){if(!this._isVisible)return;if(!this._domNode.isConnected)return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0)return void this._domNode.classList.add("hiddenEditor");this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const t=e.width,i=e.minimap.minimapWidth;let n=!1,o=!1,s=!1;if(this._resized&&Ta(this._domNode)>M6)return this._domNode.style.maxWidth=t-28-i-15+"px",void(this._replaceInput.width=Ta(this._findInput.domNode));if(447+i>=t&&(o=!0),447+i-A6>=t&&(s=!0),447+i-A6>=t+50&&(n=!0),this._domNode.classList.toggle("collapsed-find-widget",n),this._domNode.classList.toggle("narrow-find-widget",s),this._domNode.classList.toggle("reduced-find-widget",o),s||n||(this._domNode.style.maxWidth=t-28-i-15+"px"),this._findInput.layout({collapsedFindWidget:n,narrowFindWidget:s,reducedFindWidget:o}),this._resized){const e=this._findInput.inputBox.element.clientWidth;e>0&&(this._replaceInput.width=e)}else this._isReplaceVisible&&(this._replaceInput.width=Ta(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return(null===this._cachedHeight||this._cachedHeight!==e)&&(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){const e=this._codeEditor.getSelections();e.map((e=>{1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(e.endLineNumber-1)));const t=this._state.currentMatch;return e.startLineNumber===e.endLineNumber||Yu.equalsRange(e,t)?null:e})).filter((e=>!!e)),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){return e.equals(3|R6)?(this._keybindingService.dispatchEvent(e,e.target)||this._findInput.inputBox.insertAtCursor("\n"),void e.preventDefault()):e.equals(2)?(this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),void e.preventDefault()):e.equals(2066)?(this._codeEditor.focus(),void e.preventDefault()):e.equals(16)?P6(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea")):e.equals(18)?F6(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea")):void 0}_onReplaceInputKeyDown(e){return e.equals(3|R6)?(this._keybindingService.dispatchEvent(e,e.target)||this._replaceInput.inputBox.insertAtCursor("\n"),void e.preventDefault()):e.equals(2)?(this._findInput.focusOnCaseSensitive(),void e.preventDefault()):e.equals(1026)?(this._findInput.focus(),void e.preventDefault()):e.equals(2066)?(this._codeEditor.focus(),void e.preventDefault()):e.equals(16)?P6(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea")):e.equals(18)?F6(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea")):void 0}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){const e=!0,t=!0,i=this._codeEditor.getOption(50).history,n=this._codeEditor.getOption(50).replaceHistory;this._findInput=this._register(new a6(null,this._contextViewProvider,{width:221,label:v6,placeholder:b6,appendCaseSensitiveLabel:this._keybindingLabelFor(M3),appendWholeWordsLabel:this._keybindingLabelFor(A3),appendRegexLabel:this._keybindingLabelFor(R3),validation:e=>{if(0===e.length||!this._findInput.getRegex())return null;try{return new RegExp(e,"gu"),null}catch(e){return{content:e.message}}},flexibleHeight:e,flexibleWidth:t,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>d6(this._keybindingService),inputBoxStyles:RR,toggleStyles:MR,history:"workspace"===i?this._findWidgetSearchHistory:new Set([])},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown((e=>{e.equals(3)&&!this._codeEditor.getOption(50).findOnType&&this._state.change({searchString:this._findInput.getValue()},!0),this._onFindInputKeyDown(e)}))),this._register(this._findInput.inputBox.onDidChange((()=>{!this._ignoreChangeEvent&&this._codeEditor.getOption(50).findOnType&&this._state.change({searchString:this._findInput.getValue()},!0)}))),this._register(this._findInput.onDidOptionChange((()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)}))),this._register(this._findInput.onCaseSensitiveKeyDown((e=>{e.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),e.preventDefault())}))),this._register(this._findInput.onRegexKeyDown((e=>{e.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),e.preventDefault())}))),this._register(this._findInput.inputBox.onDidHeightChange((e=>{this._tryUpdateHeight()&&this._showViewZone()}))),G&&this._register(this._findInput.onMouseDown((e=>this._onFindInputMouseDown(e)))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const o=this._register(oM());this._prevBtn=this._register(new W6({label:w6+this._keybindingLabelFor(I3),icon:m6,hoverDelegate:o,onTrigger:()=>{vt(this._codeEditor.getAction(I3)).run().then(void 0,Ie)}},this._hoverService)),this._nextBtn=this._register(new W6({label:C6+this._keybindingLabelFor(N3),icon:f6,hoverDelegate:o,onTrigger:()=>{vt(this._codeEditor.getAction(N3)).run().then(void 0,Ie)}},this._hoverService));const s=document.createElement("div");s.className="find-part",s.appendChild(this._findInput.domNode);const r=document.createElement("div");r.className="find-actions",s.appendChild(r),r.appendChild(this._matchesCount),r.appendChild(this._prevBtn.domNode),r.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new eQ({icon:u6,title:y6+this._keybindingLabelFor(O3),isChecked:!1,hoverDelegate:o,inputActiveOptionBackground:Af(kv),inputActiveOptionBorder:Af(Sv),inputActiveOptionForeground:Af(Lv)})),this._register(this._toggleSelectionFind.onChange((()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let e=this._codeEditor.getSelections();e=e.map((e=>(1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(e.endLineNumber-1))),e.isEmpty()?null:e))).filter((e=>!!e)),e.length&&this._state.change({searchScope:e},!0)}}else this._state.change({searchScope:null},!0)}))),r.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new W6({label:S6+this._keybindingLabelFor(T3),icon:xF,hoverDelegate:o,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:e=>{e.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),e.preventDefault())}},this._hoverService)),this._replaceInput=this._register(new l6(null,void 0,{label:x6,placeholder:k6,appendPreserveCaseLabel:this._keybindingLabelFor(P3),history:"workspace"===n?this._replaceWidgetHistory:new Set([]),flexibleHeight:e,flexibleWidth:t,flexibleMaxHeight:118,showHistoryHint:()=>d6(this._keybindingService),inputBoxStyles:RR,toggleStyles:MR},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown((e=>this._onReplaceInputKeyDown(e)))),this._register(this._replaceInput.inputBox.onDidChange((()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)}))),this._register(this._replaceInput.inputBox.onDidHeightChange((e=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()}))),this._register(this._replaceInput.onDidOptionChange((()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)}))),this._register(this._replaceInput.onPreserveCaseKeyDown((e=>{e.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),e.preventDefault())})));const a=this._register(oM());this._replaceBtn=this._register(new W6({label:L6+this._keybindingLabelFor(F3),icon:g6,hoverDelegate:a,onTrigger:()=>{this._controller.replace()},onKeyDown:e=>{e.equals(1026)&&(this._closeBtn.focus(),e.preventDefault())}},this._hoverService)),this._replaceAllBtn=this._register(new W6({label:D6+this._keybindingLabelFor(B3),icon:p6,hoverDelegate:a,onTrigger:()=>{this._controller.replaceAll()}},this._hoverService));const l=document.createElement("div");l.className="replace-part",l.appendChild(this._replaceInput.domNode);const d=document.createElement("div");d.className="replace-actions",l.appendChild(d),d.appendChild(this._replaceBtn.domNode),d.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new W6({label:E6,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=Ta(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}},this._hoverService)),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.ariaLabel=_6,this._domNode.role="dialog",this._domNode.style.width="419px",this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(s),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(l),this._resizeSash=this._register(new WG(this._domNode,this,{orientation:0,size:2})),this._resized=!1;let h=M6;this._register(this._resizeSash.onDidStart((()=>{h=Ta(this._domNode)}))),this._register(this._resizeSash.onDidChange((e=>{this._resized=!0;const t=h+e.startX-e.currentX;t<M6||t>(parseFloat(xa(this._domNode).maxWidth)||0)||(this._domNode.style.width=`${t}px`,this._isReplaceVisible&&(this._replaceInput.width=Ta(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())}))),this._register(this._resizeSash.onDidReset((()=>{const e=Ta(this._domNode);if(e<M6)return;let t=M6;if(!this._resized||e===M6){const e=this._codeEditor.getLayoutInfo();t=e.width-28-e.minimap.minimapWidth-15,this._resized=!0}this._domNode.style.width=`${t}px`,this._isReplaceVisible&&(this._replaceInput.width=Ta(this._findInput.domNode)),this._findInput.inputBox.layout()})))}updateAccessibilitySupport(){const e=this._codeEditor.getOption(2);this._findInput.setFocusInputOnOptionClick(2!==e)}getViewState(){let e=!1;return this._viewZone&&this._viewZoneId&&(e=this._viewZone.heightInPx>this._codeEditor.getScrollTop()),{widgetViewZoneVisible:e,scrollTop:this._codeEditor.getScrollTop()}}setViewState(e){e&&e.widgetViewZoneVisible&&this._layoutViewZone(e.scrollTop)}}class W6 extends mM{constructor(e,t){super(),this._opts=e;let i="button";this._opts.className&&(i=i+" "+this._opts.className),this._opts.icon&&(i=i+" "+vh.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.tabIndex=0,this._domNode.className=i,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this._register(t.setupManagedHover(e.hoverDelegate??nM("element"),this._domNode,this._opts.label)),this.onclick(this._domNode,(e=>{this._opts.onTrigger(),e.preventDefault()})),this.onkeydown(this._domNode,(e=>{if(e.equals(10)||e.equals(3))return this._opts.onTrigger(),void e.preventDefault();this._opts.onKeyDown?.(e)}))}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){this._domNode.classList.toggle("disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)),e?(this._domNode.classList.remove(...vh.asClassNameArray(h6)),this._domNode.classList.add(...vh.asClassNameArray(c6))):(this._domNode.classList.remove(...vh.asClassNameArray(c6)),this._domNode.classList.add(...vh.asClassNameArray(h6)))}}hw(((e,t)=>{const i=e.getColor(E_);i&&t.addRule(`.monaco-editor .findMatch { border: 1px ${nw(e.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`);const n=e.getColor(N_);n&&t.addRule(`.monaco-editor .findScope { border: 1px ${nw(e.type)?"dashed":"solid"} ${n}; }`);const o=e.getColor(Qf);o&&t.addRule(`.monaco-editor .find-widget { border: 1px solid ${o}; }`);const s=e.getColor(k_);s&&t.addRule(`.monaco-editor .findMatchInline { color: ${s}; }`);const r=e.getColor(D_);r&&t.addRule(`.monaco-editor .currentFindMatchInline { color: ${r}; }`)}));var V6;let H6=class{static{V6=this}static{this.FIND_HISTORY_KEY="workbench.find.history"}static{this._instance=null}static getOrCreate(e){return V6._instance||(V6._instance=new V6(e)),V6._instance}constructor(e){this.storageService=e,this.inMemoryValues=new Set,this._onDidChangeEmitter=new Zt,this.onDidChange=this._onDidChangeEmitter.event,this.load()}delete(e){const t=this.inMemoryValues.delete(e);return this.save(),t}add(e){return this.inMemoryValues.add(e),this.save(),this}has(e){return this.inMemoryValues.has(e)}forEach(e,t){return this.load(),this.inMemoryValues.forEach(e)}replace(e){this.inMemoryValues=new Set(e),this.save()}load(){let e;const t=this.storageService.get(V6.FIND_HISTORY_KEY,1);if(t)try{e=JSON.parse(t)}catch(e){}this.inMemoryValues=new Set(e||[])}save(){const e=[];return this.inMemoryValues.forEach((t=>e.push(t))),new Promise((t=>{this.storageService.store(V6.FIND_HISTORY_KEY,JSON.stringify(e),1,0),this._onDidChangeEmitter.fire(e),t()}))}};H6=V6=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,Sq)],H6);var z6;let U6=class{static{z6=this}static{this.FIND_HISTORY_KEY="workbench.replace.history"}static{this._instance=null}static getOrCreate(e){return z6._instance||(z6._instance=new z6(e)),z6._instance}constructor(e){this.storageService=e,this.inMemoryValues=new Set,this._onDidChangeEmitter=new Zt,this.onDidChange=this._onDidChangeEmitter.event,this.load()}delete(e){const t=this.inMemoryValues.delete(e);return this.save(),t}add(e){return this.inMemoryValues.add(e),this.save(),this}has(e){return this.inMemoryValues.has(e)}forEach(e,t){return this.load(),this.inMemoryValues.forEach(e)}replace(e){this.inMemoryValues=new Set(e),this.save()}load(){let e;const t=this.storageService.get(z6.FIND_HISTORY_KEY,1);if(t)try{e=JSON.parse(t)}catch(e){}this.inMemoryValues=new Set(e||[])}save(){const e=[];return this.inMemoryValues.forEach((t=>e.push(t))),new Promise((t=>{this.storageService.store(z6.FIND_HISTORY_KEY,JSON.stringify(e),1,0),this._onDidChangeEmitter.fire(e),t()}))}};U6=z6=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,Sq)],U6);var K6,j6=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},q6=function(e,t){return function(i,n){t(i,n,e)}};function $6(e,t="single",i=!1){if(!e.hasModel())return null;const n=e.getSelection();if("single"===t&&n.startLineNumber===n.endLineNumber||"multiple"===t)if(n.isEmpty()){const t=e.getConfiguredWordAtPosition(n.getStartPosition());if(t&&!1===i)return t.word}else if(e.getModel().getValueLengthInRange(n)<524288)return e.getModel().getValueInRange(n);return null}let G6=class extends At{static{K6=this}static{this.ID="editor.contrib.findController"}get editor(){return this._editor}static get(e){return e.getContribution(K6.ID)}constructor(e,t,i,n,o,s){super(),this._editor=e,this._findWidgetVisible=C3.bindTo(t),this._contextKeyService=t,this._storageService=i,this._clipboardService=n,this._notificationService=o,this._hoverService=s,this._updateHistoryDelayer=new gi(500),this._state=this._register(new j3),this.loadQueryState(),this._register(this._state.onFindReplaceStateChange((e=>this._onStateChanged(e)))),this._model=null,this._register(this._editor.onDidChangeModel((()=>{const e=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),e&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(50).loop})})))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!y3.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){let e=this._editor.getSelections();e=e.map((e=>(1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._editor.getModel().getLineMaxColumn(e.endLineNumber-1))),e.isEmpty()?null:e))).filter((e=>!!e)),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=Vi(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}async _start(e,t){if(this.disposeModel(),!this._editor.hasModel())return;const i={...t,isRevealed:!0};if("single"===e.seedSearchStringFromSelection){const t=$6(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);t&&(this._state.isRegex?i.searchString=Vi(t):i.searchString=t)}else if("multiple"===e.seedSearchStringFromSelection&&!e.updateSearchScope){const t=$6(this._editor,e.seedSearchStringFromSelection);t&&(i.searchString=t)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const e=await this.getGlobalBufferTerm();if(!this._editor.hasModel())return;e&&(i.searchString=e)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const e=this._editor.getSelections();e.some((e=>!e.isEmpty()))&&(i.searchScope=e)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new V3(this._editor,this._state))}start(e,t){return this._start(e,t)}moveToNextMatch(){return!!this._model&&(this._model.moveToNextMatch(),!0)}moveToPrevMatch(){return!!this._model&&(this._model.moveToPrevMatch(),!0)}goToMatch(e){return!!this._model&&(this._model.moveToMatch(e),!0)}replace(){return!!this._model&&(this._model.replace(),!0)}replaceAll(){return!!this._model&&(this._editor.getModel()?.isTooLargeForHeapOperation()?(this._notificationService.warn(y(935,"The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0))}selectAllMatches(){return!!this._model&&(this._model.selectAllMatches(),this._editor.focus(),!0)}async getGlobalBufferTerm(){return this._editor.getOption(50).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""}setGlobalBufferTerm(e){this._editor.getOption(50).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};G6=K6=j6([q6(1,eu),q6(2,Sq),q6(3,oD),q6(4,lO),q6(5,oZ)],G6);let Z6=class extends G6{constructor(e,t,i,n,o,s,r,a){super(e,i,s,r,o,a),this._contextViewService=t,this._keybindingService=n,this._widget=null,this._findOptionsWidget=null,this._findWidgetSearchHistory=H6.getOrCreate(s),this._replaceWidgetHistory=U6.getOrCreate(s)}async _start(e,t){this._widget||this._createFindWidget();const i=this._editor.getSelection();let n=!1;switch(this._editor.getOption(50).autoFindInSelection){case"always":n=!0;break;case"never":n=!1;break;case"multiline":n=!!i&&i.startLineNumber!==i.endLineNumber}e.updateSearchScope=e.updateSearchScope||n,await super._start(e,t),this._widget&&(2===e.shouldFocus?this._widget.focusReplaceInput():1===e.shouldFocus&&this._widget.focusFindInput())}highlightFindOptions(e=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!e?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new B6(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._hoverService,this._findWidgetSearchHistory,this._replaceWidgetHistory)),this._findOptionsWidget=this._register(new U3(this._editor,this._state,this._keybindingService))}saveViewState(){return this._widget?.getViewState()}restoreViewState(e){this._widget?.setViewState(e)}};Z6=j6([q6(1,LR),q6(2,eu),q6(3,ER),q6(4,lO),q6(5,Sq),q6(6,oD),q6(7,oZ)],Z6),zu(new Fu({id:"actions.find",label:x(942,"Find"),precondition:Ac.or(Xu.focus,Ac.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:gu.MenubarEditMenu,group:"3_find",title:y(936,"&&Find"),order:1}})).addImplementation(0,((e,t,i)=>{const n=G6.get(t);return!!n&&n.start({forceRevealReplace:!1,seedSearchStringFromSelection:"never"!==t.getOption(50).seedSearchStringFromSelection?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===t.getOption(50).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:t.getOption(50).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(50).loop})}));const Y6={description:"Open a new In-Editor Find Widget.",args:[{name:"Open a new In-Editor Find Widget args",schema:{properties:{searchString:{type:"string"},replaceString:{type:"string"},isRegex:{type:"boolean"},matchWholeWord:{type:"boolean"},isCaseSensitive:{type:"boolean"},preserveCase:{type:"boolean"},findInSelection:{type:"boolean"}}}}]};class Q6 extends Pu{async run(e,t){const i=G6.get(t);i&&!this._run(i)&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:0===i.getState().searchString.length&&"never"!==t.getOption(50).seedSearchStringFromSelection?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===t.getOption(50).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(50).loop}),this._run(i))}}class X6 extends Pu{async run(e,t){const i=G6.get(t);if(!i)return;const n=$6(t,"single",!1);n&&i.setSearchString(n),this._run(i)||(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(50).loop}),this._run(i))}}zu(new Fu({id:"editor.action.startFindReplaceAction",label:x(950,"Replace"),precondition:Ac.or(Xu.focus,Ac.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:gu.MenubarEditMenu,group:"3_find",title:y(941,"&&Replace"),order:2}})).addImplementation(0,((e,t,i)=>{if(!t.hasModel()||t.getOption(104))return!1;const n=G6.get(t);if(!n)return!1;const o=t.getSelection(),s=n.isFindInputFocused(),r=!o.isEmpty()&&o.startLineNumber===o.endLineNumber&&"never"!==t.getOption(50).seedSearchStringFromSelection&&!s,a=s||r?2:1;return n.start({forceRevealReplace:!0,seedSearchStringFromSelection:r?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===t.getOption(50).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:"never"!==t.getOption(50).seedSearchStringFromSelection,shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(50).loop})})),Uu(G6.ID,Z6,0),Hu(class extends Pu{constructor(){super({id:"editor.actions.findWithArgs",label:x(943,"Find with Arguments"),precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},metadata:Y6})}async run(e,t,i){const n=G6.get(t);if(n){const e=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:void 0!==i.replaceString,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};await n.start({forceRevealReplace:!1,seedSearchStringFromSelection:0===n.getState().searchString.length&&"never"!==t.getOption(50).seedSearchStringFromSelection?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===t.getOption(50).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:i?.findInSelection||!1,loop:t.getOption(50).loop},e),n.setGlobalBufferTerm(n.getState().searchString)}}}),Hu(class extends Pu{constructor(){super({id:"actions.findWithSelection",label:x(944,"Find with Selection"),precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}async run(e,t){const i=G6.get(t);i&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(50).loop}),i.setGlobalBufferTerm(i.getState().searchString))}}),Hu(class extends Q6{constructor(){super({id:N3,label:x(945,"Find Next"),precondition:void 0,kbOpts:[{kbExpr:Xu.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:Ac.and(Xu.focus,y3),primary:3,weight:100}]})}_run(e){return!!e.moveToNextMatch()&&(e.editor.pushUndoStop(),!0)}}),Hu(class extends Q6{constructor(){super({id:I3,label:x(946,"Find Previous"),precondition:void 0,kbOpts:[{kbExpr:Xu.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:Ac.and(Xu.focus,y3),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}),Hu(class extends Pu{constructor(){super({id:"editor.action.goToMatchFindAction",label:x(947,"Go to Match..."),precondition:C3}),this._highlightDecorations=[]}run(e,t,i){const n=G6.get(t);if(!n)return;const o=n.getState().matchesCount;if(o<1)return void e.get(lO).notify({severity:aO.Warning,message:y(937,"No matches. Try searching for something else.")});const s=e.get(LD),r=new Mt,a=r.add(s.createInputBox());a.placeholder=y(938,"Type a number to go to a specific match (between 1 and {0})",o);const l=e=>{const t=parseInt(e);if(isNaN(t))return;const i=n.getState().matchesCount;return t>0&&t<=i?t-1:t<0&&t>=-i?i+t:void 0},d=e=>{const i=l(e);if("number"==typeof i){a.validationMessage=void 0,n.goToMatch(i);const e=n.getState().currentMatch;e&&this.addDecorations(t,e)}else a.validationMessage=y(939,"Please type a number between 1 and {0}",n.getState().matchesCount),this.clearDecorations(t)};r.add(a.onDidChangeValue((e=>{d(e)}))),r.add(a.onDidAccept((()=>{const e=l(a.value);"number"==typeof e?(n.goToMatch(e),a.hide()):a.validationMessage=y(940,"Please type a number between 1 and {0}",n.getState().matchesCount)}))),r.add(a.onDidHide((()=>{this.clearDecorations(t),r.dispose()}))),a.show()}clearDecorations(e){e.changeDecorations((e=>{this._highlightDecorations=e.deltaDecorations(this._highlightDecorations,[])}))}addDecorations(e,t){e.changeDecorations((e=>{this._highlightDecorations=e.deltaDecorations(this._highlightDecorations,[{range:t,options:{description:"find-match-quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"find-match-quick-access-range-highlight-overview",overviewRuler:{color:rw(Uw),position:ug.Full}}}])}))}}),Hu(class extends X6{constructor(){super({id:"editor.action.nextSelectionMatchFindAction",label:x(948,"Find Next Selection"),precondition:void 0,kbOpts:{kbExpr:Xu.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}),Hu(class extends X6{constructor(){super({id:"editor.action.previousSelectionMatchFindAction",label:x(949,"Find Previous Selection"),precondition:void 0,kbOpts:{kbExpr:Xu.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}});const J6=Ou.bindToContribution(G6.get);Vu(new J6({id:T3,precondition:C3,handler:e=>e.closeFindWidget(),kbOpts:{weight:105,kbExpr:Ac.and(Xu.focus,Ac.not("isComposing")),primary:9,secondary:[1033]}})),Vu(new J6({id:M3,precondition:void 0,handler:e=>e.toggleCaseSensitive(),kbOpts:{weight:105,kbExpr:Xu.focus,primary:x3.primary,mac:x3.mac,win:x3.win,linux:x3.linux}})),Vu(new J6({id:A3,precondition:void 0,handler:e=>e.toggleWholeWords(),kbOpts:{weight:105,kbExpr:Xu.focus,primary:k3.primary,mac:k3.mac,win:k3.win,linux:k3.linux}})),Vu(new J6({id:R3,precondition:void 0,handler:e=>e.toggleRegex(),kbOpts:{weight:105,kbExpr:Xu.focus,primary:L3.primary,mac:L3.mac,win:L3.win,linux:L3.linux}})),Vu(new J6({id:O3,precondition:void 0,handler:e=>e.toggleSearchScope(),kbOpts:{weight:105,kbExpr:Xu.focus,primary:D3.primary,mac:D3.mac,win:D3.win,linux:D3.linux}})),Vu(new J6({id:P3,precondition:void 0,handler:e=>e.togglePreserveCase(),kbOpts:{weight:105,kbExpr:Xu.focus,primary:E3.primary,mac:E3.mac,win:E3.win,linux:E3.linux}})),Vu(new J6({id:F3,precondition:C3,handler:e=>e.replace(),kbOpts:{weight:105,kbExpr:Xu.focus,primary:3094}})),Vu(new J6({id:F3,precondition:C3,handler:e=>e.replace(),kbOpts:{weight:105,kbExpr:Ac.and(Xu.focus,S3),primary:3}})),Vu(new J6({id:B3,precondition:C3,handler:e=>e.replaceAll(),kbOpts:{weight:105,kbExpr:Xu.focus,primary:2563}})),Vu(new J6({id:B3,precondition:C3,handler:e=>e.replaceAll(),kbOpts:{weight:105,kbExpr:Ac.and(Xu.focus,S3),primary:void 0,mac:{primary:2051}}})),Vu(new J6({id:"editor.action.selectAllMatches",precondition:C3,handler:e=>e.selectAllMatches(),kbOpts:{weight:105,kbExpr:Xu.focus,primary:515}}));var e9=i(5071),t9={};t9.styleTagTransform=zl(),t9.setAttributes=Bl(),t9.insert=Pl().bind(null,"head"),t9.domAPI=Rl(),t9.insertStyleElement=Vl(),Ml()(e9.A,t9),e9.A&&e9.A.locals&&e9.A.locals;var i9=function(e,t){return function(i,n){t(i,n,e)}};let n9=class extends At{static{this.ID="editor.contrib.floatingToolbar"}constructor(e,t,i,n){super();const o=this._register(bY(e)),s=this._register(n.createMenu(gu.EditorContent,e.contextKeyService)),r=Sr(this,s.onDidChange,(()=>0===s.getActions().length));this._register(ar((e=>{if(r.read(e))return;const n=fl("div.floating-menu-overlay-widget");n.root.style.height="28px";const s=t.createInstance(aG,n.root,gu.EditorContent,{actionViewItemProvider:(e,n)=>{if(!(e instanceof vu))return;const o=i.lookupKeybinding(e.id);return o?t.createInstance(class extends P${updateLabel(){this.options.label&&this.label&&(this.label.textContent=`${this._commandAction.label} (${o.getLabel()})`)}},e,{...n,keybindingNotRenderedWithLabel:!0}):void 0},hiddenItemStrategy:0,menuOptions:{shouldForwardArgs:!0},telemetrySource:"editor.overlayToolbar",toolbarOptions:{primaryGroup:()=>!0,useSeparatorsInPrimaryActions:!0}});e.store.add(s),e.store.add(ar((e=>{const t=o.model.read(e);s.context=t?.uri}))),e.store.add(o.createOverlayWidget({allowEditorOverflow:!1,domNode:n.root,minContentWidthInPx:Or(0),position:Or({preference:1})}))})))}};n9=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([i9(1,nc),i9(2,ER),i9(3,pu)],n9),Uu(n9.ID,n9,1);var o9=i(5405),s9={};s9.styleTagTransform=zl(),s9.setAttributes=Bl(),s9.insert=Pl().bind(null,"head"),s9.domAPI=Rl(),s9.insertStyleElement=Vl(),Ml()(o9.A,s9),o9.A&&o9.A.locals&&o9.A.locals;const r9={0:" ",1:"u",2:"r"},a9=16777215,l9=4278190080;class d9{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return!!(this._states[t]&1<<i)}set(e,t){const i=e/32|0,n=e%32,o=this._states[i];this._states[i]=t?o|1<<n:o&~(1<<n)}}class h9{constructor(e,t,i){if(e.length!==t.length||e.length>65535)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new d9(e.length),this._userDefinedStates=new d9(e.length),this._recoveredStates=new d9(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(t,i)=>{const n=e[e.length-1];return this.getStartLineNumber(n)<=t&&this.getEndLineNumber(n)>=i};for(let i=0,n=this._startIndexes.length;i<n;i++){const n=this._startIndexes[i],o=this._endIndexes[i];if(n>a9||o>a9)throw new Error("startLineNumber or endLineNumber must not exceed "+a9);for(;e.length>0&&!t(n,o);)e.pop();const s=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=n+((255&s)<<24),this._endIndexes[i]=o+((65280&s)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&a9}getEndLineNumber(e){return this._endIndexes[e]&a9}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?1:this.isRecovered(e)?2:0}setSource(e,t){1===t?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):2===t?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let n=0;n<this._types.length;n++)this._types[n]===e&&(this.setCollapsed(n,t),i=!0);return i}toRegion(e){return new c9(this,e)}getParentIndex(e){this.ensureParentIndices();const t=((this._startIndexes[e]&l9)>>>24)+((this._endIndexes[e]&l9)>>>16);return 65535===t?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(0===i)return-1;for(;t<i;){const n=Math.floor((t+i)/2);e<this.getStartLineNumber(n)?i=n:t=n+1}return t-1}findRange(e){let t=this.findIndex(e);if(t>=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);-1!==t;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;t<this.length;t++)e[t]=`[${r9[this.getSource(t)]}${this.isCollapsed(t)?"+":"-"}] ${this.getStartLineNumber(t)}/${this.getEndLineNumber(t)}`;return e.join(", ")}toFoldRange(e){return{startLineNumber:this._startIndexes[e]&a9,endLineNumber:this._endIndexes[e]&a9,type:this._types?this._types[e]:void 0,isCollapsed:this.isCollapsed(e),source:this.getSource(e)}}static fromFoldRanges(e){const t=e.length,i=new Uint32Array(t),n=new Uint32Array(t);let o=[],s=!1;for(let r=0;r<t;r++){const t=e[r];i[r]=t.startLineNumber,n[r]=t.endLineNumber,o.push(t.type),t.type&&(s=!0)}s||(o=void 0);const r=new h9(i,n,o);for(let i=0;i<t;i++)e[i].isCollapsed&&r.setCollapsed(i,!0),r.setSource(i,e[i].source);return r}static sanitizeAndMerge(e,t,i,n){i=i??Number.MAX_VALUE;const o=(e,t)=>Array.isArray(e)?i=>i<t?e[i]:void 0:i=>i<t?e.toFoldRange(i):void 0,s=o(e,e.length),r=o(t,t.length);let a=0,l=0,d=s(0),h=r(0);const c=[];let u,g=0;const p=[];for(;d||h;){let e;if(h&&(!d||d.startLineNumber>=h.startLineNumber))d&&d.startLineNumber===h.startLineNumber?(1===h.source?e=h:(e=d,e.isCollapsed=h.isCollapsed&&(d.endLineNumber===h.endLineNumber||!n?.startsInside(d.startLineNumber+1,d.endLineNumber+1)),e.source=0),d=s(++a)):(e=h,h.isCollapsed&&0===h.source&&(e.source=2)),h=r(++l);else{let t=l,i=h;for(;;){if(!i||i.startLineNumber>d.endLineNumber){e=d;break}if(1===i.source&&i.endLineNumber>d.endLineNumber)break;i=r(++t)}d=s(++a)}if(e){for(;u&&u.endLineNumber<e.startLineNumber;)u=c.pop();e.endLineNumber>e.startLineNumber&&e.startLineNumber>g&&e.endLineNumber<=i&&(!u||u.endLineNumber>=e.endLineNumber)&&(p.push(e),g=e.startLineNumber,u&&c.push(u),u=e)}}return p}}class c9{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class u9{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new Zt,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new h9(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort(((e,t)=>e.regionIndex-t.regionIndex));const t={};this._decorationProvider.changeDecorations((i=>{let n=0,o=-1,s=-1;const r=e=>{for(;n<e;){const e=this._regions.getEndLineNumber(n),t=this._regions.isCollapsed(n);if(e<=o){const o=0!==this.regions.getSource(n);i.changeDecorationOptions(this._editorDecorationIds[n],this._decorationProvider.getDecorationOption(t,e<=s,o))}t&&e>s&&(s=e),n++}};for(const i of e){const e=i.regionIndex,n=this._editorDecorationIds[e];if(n&&!t[n]){t[n]=!0,r(e);const i=!this._regions.isCollapsed(e);this._regions.setCollapsed(e,i),o=Math.max(o,this._regions.getEndLineNumber(e))}}r(this._regions.length)})),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=t=>{for(const i of e)if(!(i.startLineNumber>t.endLineNumber||t.startLineNumber>i.endLineNumber))return!0;return!1};for(let e=0;e<this._regions.length;e++){const n=this._regions.toFoldRange(e);0!==n.source&&i(n)||t.push(n)}this.updatePost(h9.fromFoldRanges(t))}update(e,t){const i=this._currentFoldedOrManualRanges(t),n=h9.sanitizeAndMerge(e,i,this._textModel.getLineCount(),t);this.updatePost(h9.fromFoldRanges(n))}updatePost(e){const t=[];let i=-1;for(let n=0,o=e.length;n<o;n++){const o=e.getStartLineNumber(n),s=e.getEndLineNumber(n),r=e.isCollapsed(n),a=0!==e.getSource(n),l={startLineNumber:o,startColumn:this._textModel.getLineMaxColumn(o),endLineNumber:s,endColumn:this._textModel.getLineMaxColumn(s)+1};t.push({range:l,options:this._decorationProvider.getDecorationOption(r,s<=i,a)}),r&&s>i&&(i=s)}this._decorationProvider.changeDecorations((e=>this._editorDecorationIds=e.deltaDecorations(this._editorDecorationIds,t))),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e){const t=[];for(let i=0,n=this._regions.length;i<n;i++){let n=this.regions.isCollapsed(i);const o=this.regions.getSource(i);if(n||0!==o){const s=this._regions.toFoldRange(i),r=this._textModel.getDecorationRange(this._editorDecorationIds[i]);r&&(n&&e?.startsInside(r.startLineNumber+1,r.endLineNumber)&&(n=!1),t.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,type:s.type,isCollapsed:n,source:o}))}}return t}getMemento(){const e=this._currentFoldedOrManualRanges(),t=[],i=this._textModel.getLineCount();for(let n=0,o=e.length;n<o;n++){const o=e[n];if(o.startLineNumber>=o.endLineNumber||o.startLineNumber<1||o.endLineNumber>i)continue;const s=this._getLinesChecksum(o.startLineNumber+1,o.endLineNumber);t.push({startLineNumber:o.startLineNumber,endLineNumber:o.endLineNumber,isCollapsed:o.isCollapsed,source:o.source,checksum:s})}return t.length>0?t:void 0}applyMemento(e){if(!Array.isArray(e))return;const t=[],i=this._textModel.getLineCount();for(const n of e){if(n.startLineNumber>=n.endLineNumber||n.startLineNumber<1||n.endLineNumber>i)continue;const e=this._getLinesChecksum(n.startLineNumber+1,n.endLineNumber);n.checksum&&e!==n.checksum||t.push({startLineNumber:n.startLineNumber,endLineNumber:n.endLineNumber,type:void 0,isCollapsed:n.isCollapsed??!0,source:n.source??0})}const n=h9.sanitizeAndMerge(this._regions,t,i);this.updatePost(h9.fromFoldRanges(n))}_getLinesChecksum(e,t){return Vo(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let n=this._regions.findRange(e),o=1;for(;n>=0;){const e=this._regions.toRegion(n);t&&!t(e,o)||i.push(e),o++,n=e.parentIndex}}return i}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const i=[],n=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&2===t.length){const e=[];for(let s=n,r=this._regions.length;s<r;s++){const n=this._regions.toRegion(s);if(!(this._regions.getStartLineNumber(s)<o))break;for(;e.length>0&&!n.containedBy(e[e.length-1]);)e.pop();e.push(n),t(n,e.length)&&i.push(n)}}else for(let e=n,s=this._regions.length;e<s;e++){const n=this._regions.toRegion(e);if(!(this._regions.getStartLineNumber(e)<o))break;t&&!t(n)||i.push(n)}return i}}function g9(e,t,i){const n=[];for(const o of i){const i=e.getRegionAtLine(o);if(i){const o=!i.isCollapsed;if(n.push(i),t>1){const s=e.getRegionsInside(i,((e,i)=>e.isCollapsed!==o&&i<t));n.push(...s)}}}e.toggleCollapseState(n)}function p9(e,t,i=Number.MAX_VALUE,n){const o=[];if(n&&n.length>0)for(const s of n){const n=e.getRegionAtLine(s);if(n&&(n.isCollapsed!==t&&o.push(n),i>1)){const s=e.getRegionsInside(n,((e,n)=>e.isCollapsed!==t&&n<i));o.push(...s)}}else{const n=e.getRegionsInside(null,((e,n)=>e.isCollapsed!==t&&n<i));o.push(...n)}e.toggleCollapseState(o)}function m9(e,t,i,n){const o=[];for(const s of n){const n=e.getAllRegionsAtLine(s,((e,n)=>e.isCollapsed!==t&&n<=i));o.push(...n)}e.toggleCollapseState(o)}function f9(e,t,i){const n=[];for(const t of i){const i=e.getAllRegionsAtLine(t,void 0);i.length>0&&n.push(i[0])}const o=e.getRegionsInside(null,(e=>n.every((t=>!t.containedBy(e)&&!e.containedBy(t)))&&e.isCollapsed!==t));e.toggleCollapseState(o)}function _9(e,t,i){const n=e.textModel,o=e.regions,s=[];for(let e=o.length-1;e>=0;e--)if(i!==o.isCollapsed(e)){const i=o.getStartLineNumber(e);t.test(n.getLineContent(i))&&s.push(o.toRegion(e))}e.toggleCollapseState(s)}function v9(e,t,i){const n=e.regions,o=[];for(let e=n.length-1;e>=0;e--)i!==n.isCollapsed(e)&&t===n.getType(e)&&o.push(n.toRegion(e));e.toggleCollapseState(o)}class b9{get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}constructor(e){this._updateEventEmitter=new Zt,this._hasLineChanges=!1,this._foldingModel=e,this._foldingModelListener=e.onDidChange((e=>this.updateHiddenRanges())),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some((e=>e.range.endLineNumber!==e.range.startLineNumber||0!==Dg(e.text)[0])))}updateHiddenRanges(){let e=!1;const t=[];let i=0,n=0,o=Number.MAX_VALUE,s=-1;const r=this._foldingModel.regions;for(;i<r.length;i++){if(!r.isCollapsed(i))continue;const a=r.getStartLineNumber(i)+1,l=r.getEndLineNumber(i);o<=a&&l<=s||(!e&&n<this._hiddenRanges.length&&this._hiddenRanges[n].startLineNumber===a&&this._hiddenRanges[n].endLineNumber===l?(t.push(this._hiddenRanges[n]),n++):(e=!0,t.push(new Yu(a,1,l,1))),o=a,s=l)}(this._hasLineChanges||e||n<this._hiddenRanges.length)&&this.applyHiddenRanges(t)}applyHiddenRanges(e){this._hiddenRanges=e,this._hasLineChanges=!1,this._updateEventEmitter.fire(e)}hasRanges(){return this._hiddenRanges.length>0}isHidden(e){return null!==w9(this._hiddenRanges,e)}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let n=null;const o=e=>(n&&function(e,t){return e>=t.startLineNumber&&e<=t.endLineNumber}(e,n)||(n=w9(this._hiddenRanges,e)),n?n.startLineNumber-1:null);for(let n=0,s=e.length;n<s;n++){let s=e[n];const r=o(s.startLineNumber);r&&(s=s.setStartPosition(r,i.getLineMaxColumn(r)),t=!0);const a=o(s.endLineNumber);a&&(s=s.setEndPosition(a,i.getLineMaxColumn(a)),t=!0),e[n]=s}return t}dispose(){this.hiddenRanges.length>0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function w9(e,t){const i=fm(e,(e=>t<e.startLineNumber))-1;return i>=0&&e[i].endLineNumber>=t?e[i]:null}class C9{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id="indent"}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,n=t&&t.markers;return Promise.resolve(function(e,t,i,n=S9){const o=e.getOptions().tabSize,s=new y9(n);let r;i&&(r=new RegExp(`(${i.start.source})|(?:${i.end.source})`));const a=[],l=e.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let i=e.getLineCount();i>0;i--){const n=e.getLineContent(i),l=jC(n,o);let d,h=a[a.length-1];if(-1!==l){if(r&&(d=n.match(r))){if(!d[1]){a.push({indent:-2,endAbove:i,line:i});continue}{let e=a.length-1;for(;e>0&&-2!==a[e].indent;)e--;if(e>0){a.length=e+1,h=a[e],s.insertFirst(i,h.line,l),h.line=i,h.indent=l,h.endAbove=i;continue}}}if(h.indent>l){do{a.pop(),h=a[a.length-1]}while(h.indent>l);const e=h.endAbove-1;e-i>=1&&s.insertFirst(i,e,l)}h.indent===l?h.endAbove=i:a.push({indent:l,endAbove:i,line:i})}else t&&(h.endAbove=i)}return s.toIndentRanges(e)}(this.editorModel,i,n,this.foldingRangesLimit))}}class y9{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>a9||t>a9)return;const n=this._length;this._startIndexes[n]=e,this._endIndexes[n]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const e=new Uint32Array(this._length),t=new Uint32Array(this._length);for(let i=this._length-1,n=0;i>=0;i--,n++)e[n]=this._startIndexes[i],t[n]=this._endIndexes[i];return new h9(e,t)}{this._foldingRangesLimit.update(this._length,t);let i=0,n=this._indentOccurrences.length;for(let e=0;e<this._indentOccurrences.length;e++){const o=this._indentOccurrences[e];if(o){if(o+i>t){n=e;break}i+=o}}const o=e.getOptions().tabSize,s=new Uint32Array(t),r=new Uint32Array(t);for(let a=this._length-1,l=0;a>=0;a--){const d=this._startIndexes[a],h=jC(e.getLineContent(d),o);(h<n||h===n&&i++<t)&&(s[l]=d,r[l]=this._endIndexes[a],l++)}return new h9(s,r)}}}const S9={limit:5e3,update:()=>{}},x9=Ff("editor.foldBackground",{light:Vf(C_,.3),dark:Vf(C_,.3),hcDark:null,hcLight:null},y(997,"Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);Ff("editor.foldPlaceholderForeground",{light:"#808080",dark:"#808080",hcDark:null,hcLight:null},y(998,"Color of the collapsed text after the first line of a folded range.")),Ff("editorGutter.foldingControlForeground",Zf,y(999,"Color of the folding control in the editor gutter."));const k9=bF("folding-expanded",fh.chevronDown,y(1e3,"Icon for expanded ranges in the editor glyph margin.")),L9=bF("folding-collapsed",fh.chevronRight,y(1001,"Icon for collapsed ranges in the editor glyph margin.")),D9=bF("folding-manual-collapsed",L9,y(1002,"Icon for manually collapsed ranges in the editor glyph margin.")),E9=bF("folding-manual-expanded",k9,y(1003,"Icon for manually expanded ranges in the editor glyph margin.")),N9={color:rw(x9),position:1},I9=y(1004,"Click to expand the range."),T9=y(1005,"Click to collapse the range.");class M9{static{this.COLLAPSED_VISUAL_DECORATION=bk.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:I9,firstLineDecorationClassName:vh.asClassName(L9)})}static{this.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=bk.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:N9,isWholeLine:!0,linesDecorationsTooltip:I9,firstLineDecorationClassName:vh.asClassName(L9)})}static{this.MANUALLY_COLLAPSED_VISUAL_DECORATION=bk.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:I9,firstLineDecorationClassName:vh.asClassName(D9)})}static{this.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=bk.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:N9,isWholeLine:!0,linesDecorationsTooltip:I9,firstLineDecorationClassName:vh.asClassName(D9)})}static{this.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=bk.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:I9})}static{this.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=bk.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:N9,isWholeLine:!0,linesDecorationsTooltip:I9})}static{this.EXPANDED_VISUAL_DECORATION=bk.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+vh.asClassName(k9),linesDecorationsTooltip:T9})}static{this.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=bk.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:vh.asClassName(k9),linesDecorationsTooltip:T9})}static{this.MANUALLY_EXPANDED_VISUAL_DECORATION=bk.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+vh.asClassName(E9),linesDecorationsTooltip:T9})}static{this.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=bk.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:vh.asClassName(E9),linesDecorationsTooltip:T9})}static{this.NO_CONTROLS_EXPANDED_RANGE_DECORATION=bk.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0})}static{this.HIDDEN_RANGE_DECORATION=bk.register({description:"folding-hidden-range-decoration",stickiness:1})}constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?M9.HIDDEN_RANGE_DECORATION:"never"===this.showFoldingControls?e?this.showFoldingHighlights?M9.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:M9.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:M9.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?M9.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:M9.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?M9.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:M9.COLLAPSED_VISUAL_DECORATION:"mouseover"===this.showFoldingControls?i?M9.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:M9.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?M9.MANUALLY_EXPANDED_VISUAL_DECORATION:M9.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}const A9={};class R9{constructor(e,t,i,n,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=n,this.fallbackRangeProvider=o,this.id="syntax",this.disposables=new Mt,o&&this.disposables.add(o);for(const e of t)"function"==typeof e.onDidChange&&this.disposables.add(e.onDidChange(i))}compute(e){return function(e,t,i){let n=null;const o=e.map(((e,o)=>Promise.resolve(e.provideFoldingRanges(t,A9,i)).then((e=>{if(!i.isCancellationRequested&&Array.isArray(e)){Array.isArray(n)||(n=[]);const i=t.getLineCount();for(const t of e)t.start>0&&t.end>t.start&&t.end<=i&&n.push({start:t.start,end:t.end,rank:o,kind:t.kind})}}),Te)));return Promise.all(o).then((e=>n))}(this.providers,this.editorModel,e).then((t=>this.editorModel.isDisposed()?null:t?function(e,t){const i=e.sort(((e,t)=>{let i=e.start-t.start;return 0===i&&(i=e.rank-t.rank),i})),n=new O9(t);let o;const s=[];for(const e of i)if(o){if(e.start>o.start)if(e.end<=o.end)s.push(o),o=e,n.add(e.start,e.end,e.kind&&e.kind.value,s.length);else{if(e.start>o.end){do{o=s.pop()}while(o&&e.start>o.end);o&&s.push(o),o=e}n.add(e.start,e.end,e.kind&&e.kind.value,s.length)}}else o=e,n.add(e.start,e.end,e.kind&&e.kind.value,s.length);return n.toIndentRanges()}(t,this.foldingRangesLimit):this.fallbackRangeProvider?.compute(e)??null))}dispose(){this.disposables.dispose()}}class O9{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,n){if(e>a9||t>a9)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=n,this._types[o]=i,this._length++,n<30&&(this._nestingLevelCounts[n]=(this._nestingLevelCounts[n]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const e=new Uint32Array(this._length),t=new Uint32Array(this._length);for(let i=0;i<this._length;i++)e[i]=this._startIndexes[i],t[i]=this._endIndexes[i];return new h9(e,t,this._types)}{this._foldingRangesLimit.update(this._length,e);let t=0,i=this._nestingLevelCounts.length;for(let n=0;n<this._nestingLevelCounts.length;n++){const o=this._nestingLevelCounts[n];if(o){if(o+t>e){i=n;break}t+=o}}const n=new Uint32Array(e),o=new Uint32Array(e),s=[];for(let r=0,a=0;r<this._length;r++){const l=this._nestingLevels[r];(l<i||l===i&&t++<e)&&(n[a]=this._startIndexes[r],o[a]=this._endIndexes[r],s[a]=this._types[r],a++)}return new h9(n,o,s)}}}var P9,F9=function(e,t){return function(i,n){t(i,n,e)}};const B9=new Jc("foldingEnabled",!1);let W9=class extends At{static{P9=this}static{this.ID="editor.contrib.folding"}static get(e){return e.getContribution(P9.ID)}static getFoldingRangeProviders(e,t){const i=e.foldingRangeProvider.ordered(t);return P9._foldingRangeSelector?.(i,t)??i}constructor(e,t,i,n,o,s){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=s,this.localToDispose=this._register(new Mt),this.editor=e,this._foldingLimitReporter=this._register(new V9(e));const r=this.editor.getOptions();this._isEnabled=r.get(52),this._useFoldingProviders="indentation"!==r.get(53),this._unfoldOnClickAfterEndOfLine=r.get(57),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=r.get(55),this.updateDebounceInfo=o.for(s.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new M9(e),this.foldingDecorationProvider.showFoldingControls=r.get(126),this.foldingDecorationProvider.showFoldingHighlights=r.get(54),this.foldingEnabled=B9.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel((()=>this.onModelChanged()))),this._register(this.editor.onDidChangeConfiguration((e=>{if(e.hasChanged(52)&&(this._isEnabled=this.editor.getOptions().get(52),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),e.hasChanged(56)&&this.onModelChanged(),e.hasChanged(126)||e.hasChanged(54)){const e=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=e.get(126),this.foldingDecorationProvider.showFoldingHighlights=e.get(54),this.triggerFoldingModelChanged()}e.hasChanged(53)&&(this._useFoldingProviders="indentation"!==this.editor.getOptions().get(53),this.onFoldingStrategyChanged()),e.hasChanged(57)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(57)),e.hasChanged(55)&&(this._foldingImportsByDefault=this.editor.getOptions().get(55))}))),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(t&&this._isEnabled&&!t.isTooLargeForTokenization()&&this.hiddenRangeModel&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();this._isEnabled&&e&&!e.isTooLargeForTokenization()&&(this._currentModelHasFoldedImports=!1,this.foldingModel=new u9(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new b9(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange((e=>this.onHiddenRangesChanges(e)))),this.updateScheduler=new gi(this.updateDebounceInfo.get(e)),this.localToDispose.add(this.updateScheduler),this.cursorChangedScheduler=new Ci((()=>this.revealCursor()),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange((()=>this.onFoldingStrategyChanged()))),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration((()=>this.onFoldingStrategyChanged()))),this.localToDispose.add(this.editor.onDidChangeModelContent((e=>this.onDidChangeModelContent(e)))),this.localToDispose.add(this.editor.onDidChangeCursorPosition((()=>this.onCursorPositionChanged()))),this.localToDispose.add(this.editor.onMouseDown((e=>this.onEditorMouseDown(e)))),this.localToDispose.add(this.editor.onMouseUp((e=>this.onEditorMouseUp(e)))),this.localToDispose.add({dispose:()=>{this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.updateScheduler?.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,this.rangeProvider?.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){this.rangeProvider?.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new C9(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=P9.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new R9(e,i,(()=>this.triggerFoldingModelChanged()),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){this.hiddenRangeModel?.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger((()=>{const e=this.foldingModel;if(!e)return null;const t=new Ht,i=this.getRangeProvider(e.textModel),n=this.foldingRegionPromise=hi((e=>i.compute(e)));return n.then((i=>{if(i&&n===this.foldingRegionPromise){let n;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const e=i.setCollapsedAllOfType(QS.Imports.value,!0);e&&(n=mq.capture(this.editor),this._currentModelHasFoldedImports=e)}const o=this.editor.getSelections();e.update(i,function(e){return e&&0!==e.length?{startsInside(t,i){for(const n of e){const e=n.startLineNumber;if(e>=t&&e<=i)return!0}return!1}}:{startsInside:()=>!1}}(o)),n?.restore(this.editor);const s=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=s)}return e}))})).then(void 0,(e=>(Ie(e),null))))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const e=this.editor.getSelections();e&&this.hiddenRangeModel.adjustSelections(e)&&this.editor.setSelections(e)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then((e=>{if(e){const t=this.editor.getSelections();if(t&&t.length>0){const i=[];for(const n of t){const t=n.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(t)&&i.push(...e.getAllRegionsAtLine(t,(e=>e.isCollapsed&&t>e.startLineNumber)))}i.length&&(e.toggleCollapseState(i),this.reveal(t[0].getPosition()))}}})).then(void 0,Ie)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range)return;if(!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:{const t=e.target.detail,n=e.target.element.offsetLeft;if(t.offsetX-n<4)return;i=!0;break}case 7:if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return;case 6:if(this.hiddenRangeModel.hasRanges()){const e=this.editor.getModel();if(e&&t.startColumn===e.getLineMaxColumn(t.startLineNumber))break}return;default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,n=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==i)return;if(n){if(4!==e.target.type)return}else{const e=this.editor.getModel();if(!e||o.startColumn!==e.getLineMaxColumn(i))return}const s=t.getRegionAtLine(i);if(s&&s.startLineNumber===i){const o=s.isCollapsed;if(n||o){let n=[];if(e.event.altKey){const e=e=>!e.containedBy(s)&&!s.containedBy(e),i=t.getRegionsInside(null,e);for(const e of i)e.isCollapsed&&n.push(e);0===n.length&&(n=i)}else{const i=e.event.middleButton||e.event.shiftKey;if(i)for(const e of t.getRegionsInside(s))e.isCollapsed===o&&n.push(e);!o&&i&&0!==n.length||n.push(s)}t.toggleCollapseState(n),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};W9=P9=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([F9(1,eu),F9(2,Qp),F9(3,lO),F9(4,Bq),F9(5,BD)],W9);class V9 extends At{constructor(e){super(),this.editor=e,this._onDidChange=this._register(new Zt),this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(56)}update(e,t){e===this._computed&&t===this._limited||(this._computed=e,this._limited=t,this._onDidChange.fire())}}class H9 extends Pu{runEditorCommand(e,t,i){const n=e.get(Qp),o=W9.get(t);if(!o)return;const s=o.getFoldingModel();return s?(this.reportTelemetry(e,t),s.then((e=>{if(e){this.invoke(o,e,t,i,n);const s=t.getSelection();s&&o.reveal(s.getStartPosition())}}))):void 0}getSelectedLines(e){const t=e.getSelections();return t?t.map((e=>e.startLineNumber)):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map((e=>e+1)):this.getSelectedLines(t)}run(e,t){}}function z9(e){if(!pt(e)){if(!dt(e))return!1;const t=e;if(!pt(t.levels)&&!ct(t.levels))return!1;if(!pt(t.direction)&&!lt(t.direction))return!1;if(!(pt(t.selectionLines)||Array.isArray(t.selectionLines)&&t.selectionLines.every(ct)))return!1}return!0}class U9 extends H9{static{this.ID_PREFIX="editor.foldLevel"}static{this.ID=e=>U9.ID_PREFIX+e}getFoldingLevel(){return parseInt(this.id.substr(U9.ID_PREFIX.length))}invoke(e,t,i){!function(e,t,i,n){const o=e.getRegionsInside(null,((e,i)=>i===t&&true!==e.isCollapsed&&!n.some((t=>e.containsLine(t)))));e.toggleCollapseState(o)}(t,this.getFoldingLevel(),0,this.getSelectedLines(i))}}Uu(W9.ID,W9,0),Hu(class extends H9{constructor(){super({id:"editor.unfold",label:x(977,"Unfold"),precondition:B9,kbOpts:{kbExpr:Xu.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},metadata:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t\t* 'levels': Number of levels to unfold. If not set, defaults to 1.\n\t\t\t\t\t\t* 'direction': If 'up', unfold given number of levels up otherwise unfolds down.\n\t\t\t\t\t\t* 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used.\n\t\t\t\t\t\t",constraint:z9,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const o=n&&n.levels||1,s=this.getLineNumbers(n,i);n&&"up"===n.direction?m9(t,!1,o,s):p9(t,!1,o,s)}}),Hu(class extends H9{constructor(){super({id:"editor.unfoldRecursively",label:x(978,"Unfold Recursively"),precondition:B9,kbOpts:{kbExpr:Xu.editorTextFocus,primary:De(2089,2142),weight:100}})}invoke(e,t,i,n){p9(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}),Hu(class extends H9{constructor(){super({id:"editor.fold",label:x(979,"Fold"),precondition:B9,kbOpts:{kbExpr:Xu.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},metadata:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t\t\t* 'levels': Number of levels to fold.\n\t\t\t\t\t\t\t* 'direction': If 'up', folds given number of levels up otherwise folds down.\n\t\t\t\t\t\t\t* 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used.\n\t\t\t\t\t\t\tIf no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead.\n\t\t\t\t\t\t",constraint:z9,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const o=this.getLineNumbers(n,i),s=n&&n.levels,r=n&&n.direction;"number"!=typeof s&&"string"!=typeof r?function(e,t,i){const n=[];for(const t of i){const i=e.getAllRegionsAtLine(t,(e=>true!==e.isCollapsed));i.length>0&&n.push(i[0])}e.toggleCollapseState(n)}(t,0,o):"up"===r?m9(t,!0,s||1,o):p9(t,!0,s||1,o)}}),Hu(class extends H9{constructor(){super({id:"editor.foldRecursively",label:x(981,"Fold Recursively"),precondition:B9,kbOpts:{kbExpr:Xu.editorTextFocus,primary:De(2089,2140),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);p9(t,!0,Number.MAX_VALUE,n)}}),Hu(class extends H9{constructor(){super({id:"editor.toggleFoldRecursively",label:x(982,"Toggle Fold Recursively"),precondition:B9,kbOpts:{kbExpr:Xu.editorTextFocus,primary:De(2089,3114),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);g9(t,Number.MAX_VALUE,n)}}),Hu(class extends H9{constructor(){super({id:"editor.foldAll",label:x(988,"Fold All"),precondition:B9,kbOpts:{kbExpr:Xu.editorTextFocus,primary:De(2089,2069),weight:100}})}invoke(e,t,i){p9(t,!0)}}),Hu(class extends H9{constructor(){super({id:"editor.unfoldAll",label:x(989,"Unfold All"),precondition:B9,kbOpts:{kbExpr:Xu.editorTextFocus,primary:De(2089,2088),weight:100}})}invoke(e,t,i){p9(t,!1)}}),Hu(class extends H9{constructor(){super({id:"editor.foldAllBlockComments",label:x(983,"Fold All Block Comments"),precondition:B9,kbOpts:{kbExpr:Xu.editorTextFocus,primary:De(2089,2138),weight:100}})}invoke(e,t,i,n,o){if(t.regions.hasTypes())v9(t,QS.Comment.value,!0);else{const e=i.getModel();if(!e)return;const n=o.getLanguageConfiguration(e.getLanguageId()).comments;n&&n.blockCommentStartToken&&_9(t,new RegExp("^\\s*"+Vi(n.blockCommentStartToken)),!0)}}}),Hu(class extends H9{constructor(){super({id:"editor.foldAllMarkerRegions",label:x(984,"Fold All Regions"),precondition:B9,kbOpts:{kbExpr:Xu.editorTextFocus,primary:De(2089,2077),weight:100}})}invoke(e,t,i,n,o){if(t.regions.hasTypes())v9(t,QS.Region.value,!0);else{const e=i.getModel();if(!e)return;const n=o.getLanguageConfiguration(e.getLanguageId()).foldingRules;n&&n.markers&&n.markers.start&&_9(t,new RegExp(n.markers.start),!0)}}}),Hu(class extends H9{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:x(985,"Unfold All Regions"),precondition:B9,kbOpts:{kbExpr:Xu.editorTextFocus,primary:De(2089,2078),weight:100}})}invoke(e,t,i,n,o){if(t.regions.hasTypes())v9(t,QS.Region.value,!1);else{const e=i.getModel();if(!e)return;const n=o.getLanguageConfiguration(e.getLanguageId()).foldingRules;n&&n.markers&&n.markers.start&&_9(t,new RegExp(n.markers.start),!1)}}}),Hu(class extends H9{constructor(){super({id:"editor.foldAllExcept",label:x(986,"Fold All Except Selected"),precondition:B9,kbOpts:{kbExpr:Xu.editorTextFocus,primary:De(2089,2136),weight:100}})}invoke(e,t,i){f9(t,!0,this.getSelectedLines(i))}}),Hu(class extends H9{constructor(){super({id:"editor.unfoldAllExcept",label:x(987,"Unfold All Except Selected"),precondition:B9,kbOpts:{kbExpr:Xu.editorTextFocus,primary:De(2089,2134),weight:100}})}invoke(e,t,i){f9(t,!1,this.getSelectedLines(i))}}),Hu(class extends H9{constructor(){super({id:"editor.toggleFold",label:x(980,"Toggle Fold"),precondition:B9,kbOpts:{kbExpr:Xu.editorTextFocus,primary:De(2089,2090),weight:100}})}invoke(e,t,i){g9(t,1,this.getSelectedLines(i))}}),Hu(class extends H9{constructor(){super({id:"editor.gotoParentFold",label:x(990,"Go to Parent Fold"),precondition:B9,kbOpts:{kbExpr:Xu.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const e=function(e,t){let i=null;const n=t.getRegionAtLine(e);if(null!==n&&(i=n.startLineNumber,e===i)){const e=n.parentIndex;i=-1!==e?t.regions.getStartLineNumber(e):null}return i}(n[0],t);null!==e&&i.setSelection({startLineNumber:e,startColumn:1,endLineNumber:e,endColumn:1})}}}),Hu(class extends H9{constructor(){super({id:"editor.gotoPreviousFold",label:x(991,"Go to Previous Folding Range"),precondition:B9,kbOpts:{kbExpr:Xu.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const e=function(e,t){let i=t.getRegionAtLine(e);if(null!==i&&i.startLineNumber===e){if(e!==i.startLineNumber)return i.startLineNumber;{const e=i.parentIndex;let n=0;for(-1!==e&&(n=t.regions.getStartLineNumber(i.parentIndex));null!==i;){if(!(i.regionIndex>0))return null;if(i=t.regions.toRegion(i.regionIndex-1),i.startLineNumber<=n)return null;if(i.parentIndex===e)return i.startLineNumber}}}else if(t.regions.length>0)for(i=t.regions.toRegion(t.regions.length-1);null!==i;){if(i.startLineNumber<e)return i.startLineNumber;i=i.regionIndex>0?t.regions.toRegion(i.regionIndex-1):null}return null}(n[0],t);null!==e&&i.setSelection({startLineNumber:e,startColumn:1,endLineNumber:e,endColumn:1})}}}),Hu(class extends H9{constructor(){super({id:"editor.gotoNextFold",label:x(992,"Go to Next Folding Range"),precondition:B9,kbOpts:{kbExpr:Xu.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const e=function(e,t){let i=t.getRegionAtLine(e);if(null!==i&&i.startLineNumber===e){const e=i.parentIndex;let n=0;if(-1!==e)n=t.regions.getEndLineNumber(i.parentIndex);else{if(0===t.regions.length)return null;n=t.regions.getEndLineNumber(t.regions.length-1)}for(;null!==i;){if(!(i.regionIndex<t.regions.length))return null;if(i=t.regions.toRegion(i.regionIndex+1),i.startLineNumber>=n)return null;if(i.parentIndex===e)return i.startLineNumber}}else if(t.regions.length>0)for(i=t.regions.toRegion(0);null!==i;){if(i.startLineNumber>e)return i.startLineNumber;i=i.regionIndex<t.regions.length?t.regions.toRegion(i.regionIndex+1):null}return null}(n[0],t);null!==e&&i.setSelection({startLineNumber:e,startColumn:1,endLineNumber:e,endColumn:1})}}}),Hu(class extends H9{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:x(993,"Create Folding Range from Selection"),precondition:B9,kbOpts:{kbExpr:Xu.editorTextFocus,primary:De(2089,2135),weight:100}})}invoke(e,t,i){const n=[],o=i.getSelections();if(o){for(const e of o){let t=e.endLineNumber;1===e.endColumn&&--t,t>e.startLineNumber&&(n.push({startLineNumber:e.startLineNumber,endLineNumber:t,type:void 0,isCollapsed:!0,source:1}),i.setSelection({startLineNumber:e.startLineNumber,startColumn:1,endLineNumber:e.startLineNumber,endColumn:1}))}if(n.length>0){n.sort(((e,t)=>e.startLineNumber-t.startLineNumber));const e=h9.sanitizeAndMerge(t.regions,n,i.getModel()?.getLineCount());t.updatePost(h9.fromFoldRanges(e))}}}}),Hu(class extends H9{constructor(){super({id:"editor.removeManualFoldingRanges",label:x(994,"Remove Manual Folding Ranges"),precondition:B9,kbOpts:{kbExpr:Xu.editorTextFocus,primary:De(2089,2137),weight:100}})}invoke(e,t,i){const n=i.getSelections();if(n){const i=[];for(const e of n){const{startLineNumber:t,endLineNumber:n}=e;i.push(n>=t?{startLineNumber:t,endLineNumber:n}:{endLineNumber:n,startLineNumber:t})}t.removeManualRanges(i),e.triggerFoldingModelChanged()}}}),Hu(class extends H9{constructor(){super({id:"editor.toggleImportFold",label:x(995,"Toggle Import Fold"),precondition:B9,kbOpts:{kbExpr:Xu.editorTextFocus,weight:100}})}async invoke(e,t){const i=[],n=t.regions;for(let e=n.length-1;e>=0;e--)n.getType(e)===QS.Imports.value&&i.push(n.toRegion(e));t.toggleCollapseState(i),e.triggerFoldingModelChanged()}});for(let e=1;e<=7;e++)K9=new U9({id:U9.ID(e),label:x(996,"Fold Level {0}",e),precondition:B9,kbOpts:{kbExpr:Xu.editorTextFocus,primary:De(2089,2048|21+e),weight:100}}),ju.INSTANCE.registerEditorAction(K9);var K9;fc.registerCommand("_executeFoldingRangeProvider",(async function(e,...t){const[i]=t;if(!(i instanceof uo))throw Pe();const n=e.get(BD),o=e.get(ac).getModel(i);if(!o)throw Pe();const s=e.get(up);if(!s.getValue("editor.folding",{resource:i}))return[];const r=e.get(Qp),a=s.getValue("editor.foldingStrategy",{resource:i}),l={get limit(){return s.getValue("editor.foldingMaximumRegions",{resource:i})},update:(e,t)=>{}},d=new C9(o,r,l);let h=d;if("indentation"!==a){const e=W9.getFoldingRangeProviders(n,o);e.length&&(h=new R9(o,e,(()=>{}),l,d))}const c=await h.compute(oi.None),u=[];try{if(c)for(let e=0;e<c.length;e++){const t=c.getType(e);u.push({start:c.getStartLineNumber(e),end:c.getEndLineNumber(e),kind:t?QS.fromValue(t):void 0})}return u}finally{h.dispose()}})),Hu(class extends Pu{constructor(){super({id:"editor.action.fontZoomIn",label:x(1006,"Increase Editor Font Size"),precondition:void 0})}run(e,t){ZF.setZoomLevel(ZF.getZoomLevel()+1)}}),Hu(class extends Pu{constructor(){super({id:"editor.action.fontZoomOut",label:x(1007,"Decrease Editor Font Size"),precondition:void 0})}run(e,t){ZF.setZoomLevel(ZF.getZoomLevel()-1)}}),Hu(class extends Pu{constructor(){super({id:"editor.action.fontZoomReset",label:x(1008,"Reset Editor Font Size"),precondition:void 0})}run(e,t){ZF.setZoomLevel(0)}});class j9{static _handleEolEdits(e,t){let i;const n=[];for(const e of t)"number"==typeof e.eol&&(i=e.eol),e.range&&"string"==typeof e.text&&n.push(e);return"number"==typeof i&&e.hasModel()&&e.getModel().pushEOL(i),n}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),n=i.validateRange(t.range);return i.getFullModelRange().equalsRange(n)}static execute(e,t,i){i&&e.pushUndoStop();const n=mq.capture(e),o=j9._handleEolEdits(e,t);1===o.length&&j9._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map((e=>qZ.replace(Yu.lift(e.range),e.text)))):e.executeEdits("formatEditsCommand",o.map((e=>qZ.replaceMove(Yu.lift(e.range),e.text)))),i&&e.pushUndoStop(),n.restoreRelativeVerticalPositionOfCursor(e)}}class q9{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return"string"==typeof e?e.toLowerCase():e._lower}}class $9{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(q9.toKey(e))}has(e){return this._set.has(q9.toKey(e))}}function G9(e,t,i){const n=[],o=new $9,s=e.ordered(i);for(const e of s)n.push(e),e.extensionId&&o.add(e.extensionId);const r=t.ordered(i);for(const e of r){if(e.extensionId){if(o.has(e.extensionId))continue;o.add(e.extensionId)}n.push({displayName:e.displayName,extensionId:e.extensionId,provideDocumentFormattingEdits:(t,i,n)=>e.provideDocumentRangeFormattingEdits(t,t.getFullModelRange(),i,n)})}return n}class Z9{static{this._selectors=new Wt}static setFormatterSelector(e){return{dispose:Z9._selectors.unshift(e)}}static async select(e,t,i,n){if(0===e.length)return;const o=Ct.first(Z9._selectors);return o?await o(e,t,i,n):void 0}}async function Y9(e,t,i,n,o,s,r){const a=e.get(nc),{documentRangeFormattingEditProvider:l}=e.get(BD),d=iY(t)?t.getModel():t,h=l.ordered(d),c=await Z9.select(h,d,n,2);c&&(o.report(c),await a.invokeFunction(Q9,c,t,i,s,r))}async function Q9(e,t,i,n,o,s){const r=e.get(Xq),a=e.get(yu),l=e.get(kP);let d,h;iY(i)?(d=i.getModel(),h=new UD(i,5,void 0,o)):(d=i,h=new KD(i,o));const c=[];let u=0;for(const e of _s(n).sort(Yu.compareRangesUsingStarts))u>0&&Yu.areIntersectingOrTouching(c[u-1],e)?c[u-1]=Yu.fromPositions(c[u-1].getStartPosition(),e.getEndPosition()):u=c.push(e);const g=async e=>{a.trace("[format][provideDocumentRangeFormattingEdits] (request)",t.extensionId?.value,e);const i=await t.provideDocumentRangeFormattingEdits(d,e,d.getFormattingOptions(),h.token)||[];return a.trace("[format][provideDocumentRangeFormattingEdits] (response)",t.extensionId?.value,i),i},p=(e,t)=>{if(!e.length||!t.length)return!1;const i=e.reduce(((e,t)=>Yu.plusRange(e,t.range)),e[0].range);if(!t.some((e=>Yu.intersectRanges(i,e.range))))return!1;for(const i of e)for(const e of t)if(Yu.intersectRanges(i.range,e.range))return!0;return!1},m=[],f=[];try{if("function"==typeof t.provideDocumentRangesFormattingEdits){a.trace("[format][provideDocumentRangeFormattingEdits] (request)",t.extensionId?.value,c);const e=await t.provideDocumentRangesFormattingEdits(d,c,d.getFormattingOptions(),h.token)||[];a.trace("[format][provideDocumentRangeFormattingEdits] (response)",t.extensionId?.value,e),f.push(e)}else{for(const e of c){if(h.token.isCancellationRequested)return!0;f.push(await g(e))}for(let e=0;e<c.length;++e)for(let t=e+1;t<c.length;++t){if(h.token.isCancellationRequested)return!0;if(p(f[e],f[t])){const i=Yu.plusRange(c[e],c[t]),n=await g(i);c.splice(t,1),c.splice(e,1),c.push(i),f.splice(t,1),f.splice(e,1),f.push(n),e=0,t=0}}}for(const e of f){if(h.token.isCancellationRequested)return!0;const t=await r.computeMoreMinimalEdits(d.uri,e);t&&m.push(...t)}if(h.token.isCancellationRequested)return!0}finally{h.dispose()}if(0===m.length)return!1;if(iY(i))j9.execute(i,m,!0),i.revealPositionInCenterIfOutsideViewport(i.getPosition(),1);else{const[{range:e}]=m,t=new Qu(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn);d.pushEditOperations([t],m.map((e=>({text:e.text,range:Yu.lift(e.range),forceMoveMarkers:!0}))),(e=>{for(const{range:i}of e)if(Yu.areIntersectingOrTouching(i,t))return[new Qu(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn)];return null}))}return l.playSignal(EP.format,{userGesture:s}),!0}async function X9(e,t,i,n,o,s){const r=e.get(nc),a=e.get(BD),l=iY(t)?t.getModel():t,d=G9(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),h=await Z9.select(d,l,i,1);h&&(n.report(h),await r.invokeFunction(J9,h,t,i,o,s))}async function J9(e,t,i,n,o,s){const r=e.get(Xq),a=e.get(kP);let l,d,h;iY(i)?(l=i.getModel(),d=new UD(i,5,void 0,o)):(l=i,d=new KD(i,o));try{const e=await t.provideDocumentFormattingEdits(l,l.getFormattingOptions(),d.token);if(h=await r.computeMoreMinimalEdits(l.uri,e),d.token.isCancellationRequested)return!0}finally{d.dispose()}if(!h||0===h.length)return!1;if(iY(i))j9.execute(i,h,2!==n),2!==n&&i.revealPositionInCenterIfOutsideViewport(i.getPosition(),1);else{const[{range:e}]=h,t=new Qu(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn);l.pushEditOperations([t],h.map((e=>({text:e.text,range:Yu.lift(e.range),forceMoveMarkers:!0}))),(e=>{for(const{range:i}of e)if(Yu.areIntersectingOrTouching(i,t))return[new Qu(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn)];return null}))}return a.playSignal(EP.format,{userGesture:s}),!0}function e7(e,t,i,n,o,s,r){const a=t.onTypeFormattingEditProvider.ordered(i);return 0===a.length||a[0].autoFormatTriggerCharacters.indexOf(o)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(i,n,o,s,r)).catch(Te).then((t=>e.computeMoreMinimalEdits(i.uri,t)))}fc.registerCommand("_executeFormatRangeProvider",(async function(e,...t){const[i,n,o]=t;_t(uo.isUri(i)),_t(Yu.isIRange(n));const s=e.get(lc),r=e.get(Xq),a=e.get(BD),l=await s.createModelReference(i);try{return async function(e,t,i,n,o,s){const r=t.documentRangeFormattingEditProvider.ordered(i);for(const t of r){const r=await Promise.resolve(t.provideDocumentRangeFormattingEdits(i,n,o,s)).catch(Te);if(hs(r))return await e.computeMoreMinimalEdits(i.uri,r)}}(r,a,l.object.textEditorModel,Yu.lift(n),o,oi.None)}finally{l.dispose()}})),fc.registerCommand("_executeFormatDocumentProvider",(async function(e,...t){const[i,n]=t;_t(uo.isUri(i));const o=e.get(lc),s=e.get(Xq),r=e.get(BD),a=await o.createModelReference(i);try{return async function(e,t,i,n,o){const s=G9(t.documentFormattingEditProvider,t.documentRangeFormattingEditProvider,i);for(const t of s){const s=await Promise.resolve(t.provideDocumentFormattingEdits(i,n,o)).catch(Te);if(hs(s))return await e.computeMoreMinimalEdits(i.uri,s)}}(s,r,a.object.textEditorModel,n,oi.None)}finally{a.dispose()}})),fc.registerCommand("_executeFormatOnTypeProvider",(async function(e,...t){const[i,n,o,s]=t;_t(uo.isUri(i)),_t(rc.isIPosition(n)),_t("string"==typeof o);const r=e.get(lc),a=e.get(Xq),l=e.get(BD),d=await r.createModelReference(i);try{return e7(a,l,d.object.textEditorModel,rc.lift(n),o,s,oi.None)}finally{d.dispose()}}));var t7=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},i7=function(e,t){return function(i,n){t(i,n,e)}};let n7=class{static{this.ID="editor.contrib.autoFormat"}constructor(e,t,i,n){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._accessibilitySignalService=n,this._disposables=new Mt,this._sessionDisposables=new Mt,this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(e.onDidChangeModel((()=>this._update()))),this._disposables.add(e.onDidChangeModelLanguage((()=>this._update()))),this._disposables.add(e.onDidChangeConfiguration((e=>{e.hasChanged(65)&&this._update()}))),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(65))return;if(!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const i=new Uy;for(const e of t.autoFormatTriggerCharacters)i.add(e.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType((e=>{const t=e.charCodeAt(e.length-1);i.has(t)&&this._trigger(String.fromCharCode(t))})))}_trigger(e){if(!this._editor.hasModel())return;if(this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),i=this._editor.getPosition(),n=new ri,o=this._editor.onDidChangeModelContent((e=>{if(e.isFlush)return n.cancel(),void o.dispose();for(let t=0,s=e.changes.length;t<s;t++)if(e.changes[t].range.endLineNumber<=i.lineNumber)return n.cancel(),void o.dispose()}));e7(this._workerService,this._languageFeaturesService,t,i,e,t.getFormattingOptions(),n.token).then((e=>{n.token.isCancellationRequested||hs(e)&&(this._accessibilitySignalService.playSignal(EP.format,{userGesture:!1}),j9.execute(this._editor,e,!0))})).finally((()=>{o.dispose()}))}};n7=t7([i7(1,BD),i7(2,Xq),i7(3,kP)],n7);let o7=class{static{this.ID="editor.contrib.formatOnPaste"}constructor(e,t,i){this.editor=e,this._languageFeaturesService=t,this._instantiationService=i,this._callOnDispose=new Mt,this._callOnModel=new Mt,this._callOnDispose.add(e.onDidChangeConfiguration((()=>this._update()))),this._callOnDispose.add(e.onDidChangeModel((()=>this._update()))),this._callOnDispose.add(e.onDidChangeModelLanguage((()=>this._update()))),this._callOnDispose.add(t.documentRangeFormattingEditProvider.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(64)&&this.editor.hasModel()&&this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste((({range:e})=>this._trigger(e))))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(Y9,this.editor,e,2,bD.None,oi.None,!1).catch(Ie))}};o7=t7([i7(1,BD),i7(2,nc)],o7),Uu(n7.ID,n7,2),Uu(o7.ID,o7,2),Hu(class extends Pu{constructor(){super({id:"editor.action.formatDocument",label:x(1009,"Format Document"),precondition:Ac.and(Xu.notInCompositeEditor,Xu.writable,Xu.hasDocumentFormattingProvider),kbOpts:{kbExpr:Xu.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t){if(t.hasModel()){const i=e.get(nc),n=e.get(wD);await n.showWhile(i.invokeFunction(X9,t,1,bD.None,oi.None,!0),250)}}}),Hu(class extends Pu{constructor(){super({id:"editor.action.formatSelection",label:x(1010,"Format Selection"),precondition:Ac.and(Xu.writable,Xu.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:Xu.editorTextFocus,primary:De(2089,2084),weight:100},contextMenuOpts:{when:Xu.hasNonEmptySelection,group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const i=e.get(nc),n=t.getModel(),o=t.getSelections().map((e=>e.isEmpty()?new Yu(e.startLineNumber,1,e.startLineNumber,n.getLineMaxColumn(e.startLineNumber)):e)),s=e.get(wD);await s.showWhile(i.invokeFunction(Y9,t,o,1,bD.None,oi.None,!0),250)}}),fc.registerCommand("editor.action.format",(async e=>{const t=e.get(sc).getFocusedCodeEditor();if(!t||!t.hasModel())return;const i=e.get(mc);t.getSelection().isEmpty()?await i.executeCommand("editor.action.formatDocument"):await i.executeCommand("editor.action.formatSelection")}));var s7=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},r7=function(e,t){return function(i,n){t(i,n,e)}};class a7{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let l7=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new Zt,this.onDidChange=this._onDidChange.event,this._dispoables=new Mt,this._markers=[],this._nextIdx=-1,uo.isUri(e)?this._resourceFilter=t=>t.toString()===e.toString():e&&(this._resourceFilter=e);const n=this._configService.getValue("problems.sortOrder"),o=(e,t)=>{let i=Yi(e.resource.toString(),t.resource.toString());return 0===i&&(i="position"===n?Yu.compareRangesUsingStarts(e,t)||qP.compare(e.severity,t.severity):qP.compare(e.severity,t.severity)||Yu.compareRangesUsingStarts(e,t)),i},s=()=>{let t=this._markerService.read({resource:uo.isUri(e)?e:void 0,severities:qP.Error|qP.Warning|qP.Info});return"function"==typeof e&&(t=t.filter((e=>this._resourceFilter(e.resource)))),t.sort(o),!es(t,this._markers,((e,t)=>e.resource.toString()===t.resource.toString()&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn&&e.severity===t.severity&&e.message===t.message))&&(this._markers=t,!0)};s(),this._dispoables.add(t.onMarkerChanged((e=>{this._resourceFilter&&!e.some((e=>this._resourceFilter(e)))||s()&&(this._nextIdx=-1,this._onDidChange.fire())})))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e||!(!this._resourceFilter||!e)&&this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new a7(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=this._markers.findIndex((t=>Ph(t.resource,e.uri)));if(n<0)n=is(this._markers.length,(t=>Yi(this._markers[t].resource.toString(),e.uri.toString()))),n<0&&(n=~n),this._nextIdx=i?n:(this._markers.length+n-1)%this._markers.length;else{let o=!1,s=!1;for(let i=n;i<this._markers.length;i++){let n=Yu.lift(this._markers[i]);if(n.isEmpty()){const t=e.getWordAtPosition(n.getStartPosition());t&&(n=new Yu(n.startLineNumber,t.startColumn,n.startLineNumber,t.endColumn))}if(t&&(n.containsPosition(t)||t.isBeforeOrEqual(n.getStartPosition()))){this._nextIdx=i,o=!0,s=!n.containsPosition(t);break}if(this._markers[i].resource.toString()!==e.uri.toString())break}o?s&&!i&&(this._nextIdx-=1):this._nextIdx=i?0:this._markers.length-1}this._nextIdx<0&&(this._nextIdx=this._markers.length-1)}resetIndex(){this._nextIdx=-1}move(e,t,i){if(0===this._markers.length)return!1;const n=this._nextIdx;return-1===this._nextIdx?this._initIdx(t,i,e):e?this._nextIdx=(this._nextIdx+1)%this._markers.length:e||(this._nextIdx=(this._nextIdx-1+this._markers.length)%this._markers.length),n!==this._nextIdx}find(e,t){let i=this._markers.findIndex((t=>t.resource.toString()===e.toString()));if(!(i<0))for(;i<this._markers.length;i++)if(Yu.containsPosition(this._markers[i],t))return new a7(this._markers[i],i+1,this._markers.length)}};l7=s7([r7(1,ZP),r7(2,up)],l7);const d7=oc("IMarkerNavigationService");let h7=class{constructor(e,t){this._markerService=e,this._configService=t,this._provider=new Wt}getMarkerList(e){for(const t of this._provider){const i=t.getMarkerList(e);if(i)return i}return new l7(e,this._markerService,this._configService)}};h7=s7([r7(0,ZP),r7(1,up)],h7),wp(d7,h7,1);var c7=i(1788),u7={};u7.styleTagTransform=zl(),u7.setAttributes=Bl(),u7.insert=Pl().bind(null,"head"),u7.domAPI=Rl(),u7.insertStyleElement=Vl(),Ml()(c7.A,u7),c7.A&&c7.A.locals&&c7.A.locals;var g7,p7=i(3267),m7={};m7.styleTagTransform=zl(),m7.setAttributes=Bl(),m7.insert=Pl().bind(null,"head"),m7.domAPI=Rl(),m7.insertStyleElement=Vl(),Ml()(p7.A,m7),p7.A&&p7.A.locals&&p7.A.locals,function(e){e.className=function(e){switch(e){case rO.Ignore:return"severity-ignore "+vh.asClassName(fh.info);case rO.Info:return vh.asClassName(fh.info);case rO.Warning:return vh.asClassName(fh.warning);case rO.Error:return vh.asClassName(fh.error);default:return""}}}(g7||(g7={}));var f7,_7=function(e,t){return function(i,n){t(i,n,e)}};class v7{constructor(e,t,i,n,o){this._openerService=n,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new Mt,this._editor=t;const s=document.createElement("div");s.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),s.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),s.appendChild(this._relatedBlock),this._disposables.add(ma(this._relatedBlock,"click",(e=>{e.preventDefault();const t=this._relatedDiagnostics.get(e.target);t&&i(t)}))),this._scrollable=new aA(s,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll((e=>{s.style.left=`-${e.scrollLeft}px`,s.style.top=`-${e.scrollTop}px`}))),this._disposables.add(this._scrollable)}dispose(){Et(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:o}=e;let s=(t?.length||0)+2;o&&(s+="string"==typeof o?o.length:o.value.length);const r=qi(i);this._lines=r.length,this._longestLineLength=0;for(const e of r)this._longestLineLength=Math.max(e.length+s,this._longestLineLength);ca(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let a=this._messageBlock;for(const e of r)a=document.createElement("div"),a.innerText=e,""===e&&(a.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(a);if(t||o){const e=document.createElement("span");if(e.classList.add("details"),a.appendChild(e),t){const i=document.createElement("span");i.innerText=t,i.classList.add("source"),e.appendChild(i)}if(o)if("string"==typeof o){const t=document.createElement("span");t.innerText=`(${o})`,t.classList.add("code"),e.appendChild(t)}else this._codeLink=ll("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=e=>{this._openerService.open(o.target,{allowCommands:!0}),e.preventDefault(),e.stopPropagation()},il(this._codeLink,ll("span")).innerText=o.value,e.appendChild(this._codeLink)}if(ca(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),hs(n)){const e=this._relatedBlock.appendChild(document.createElement("div"));e.style.paddingTop=`${Math.floor(.66*this._editor.getOption(75))}px`,this._lines+=1;for(const t of n){const i=document.createElement("div"),n=document.createElement("a");n.classList.add("filename"),n.innerText=`${this._labelService.getUriBasenameLabel(t.resource)}(${t.startLineNumber}, ${t.startColumn}): `,n.title=this._labelService.getUriLabel(t.resource),this._relatedDiagnostics.set(n,t);const o=document.createElement("span");o.innerText=t.message,i.appendChild(n),i.appendChild(o),this._lines+=1,e.appendChild(i)}}const l=this._editor.getOption(59),d=Math.ceil(l.typicalFullwidthCharacterWidth*this._longestLineLength*.75),h=l.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:d,scrollHeight:h})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case qP.Error:t=y(1019,"Error");break;case qP.Warning:t=y(1020,"Warning");break;case qP.Info:t=y(1021,"Info");break;case qP.Hint:t=y(1022,"Hint")}let i=y(1023,"{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const n=this._editor.getModel();return n&&e.startLineNumber<=n.getLineCount()&&e.startLineNumber>=1&&(i=`${n.getLineContent(e.startLineNumber)}, ${i}`),i}}let b7=class extends DY{static{f7=this}static{this.TitleMenu=new gu("gotoErrorTitleMenu")}constructor(e,t,i,n,o,s,r){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=s,this._labelService=r,this._callOnDispose=new Mt,this._onDidSelectRelatedInformation=new Zt,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=qP.Warning,this._backgroundColor=Lg.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(N7);let t=S7,i=x7;this._severity===qP.Warning?(t=k7,i=L7):this._severity===qP.Info&&(t=D7,i=E7);const n=e.getColor(t),o=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:o,primaryHeadingColor:e.getColor(NY),secondaryHeadingColor:e.getColor(IY)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun((e=>this.editor.focus())));const t=function(e){const t=[];return R$(e,t,void 0,void 0,void 0),t}(this._menuService.getMenuActions(f7.TitleMenu,this._contextKeyService));this._actionbarWidget.push(t,{label:!1,icon:!0,index:0})}_fillTitleIcon(e){this._icon=il(e,ll(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new v7(this._container,this.editor,(e=>this._onDidSelectRelatedInformation.fire(e)),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const n=Yu.lift(e),o=this.editor.getPosition(),s=o&&n.containsPosition(o)?o:n.getStartPosition();super.show(s,this.computeRequiredHeight());const r=this.editor.getModel();if(r){const e=i>1?y(1024,"{0} of {1} problems",t,i):y(1025,"{0} of {1} problem",t,i);this.setTitle(Bh(r.uri),e)}this._icon.className=`codicon ${g7.className(qP.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(s,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};b7=f7=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([_7(1,sw),_7(2,ZI),_7(3,pu),_7(4,nc),_7(5,eu),_7(6,C0)],b7);const w7=Hf(u_,g_),C7=Hf(m_,f_),y7=Hf(__,v_),S7=Ff("editorMarkerNavigationError.background",{dark:w7,light:w7,hcDark:Qf,hcLight:Qf},y(1026,"Editor marker navigation widget error color.")),x7=Ff("editorMarkerNavigationError.headerBackground",{dark:Vf(S7,.1),light:Vf(S7,.1),hcDark:null,hcLight:null},y(1027,"Editor marker navigation widget error heading background.")),k7=Ff("editorMarkerNavigationWarning.background",{dark:C7,light:C7,hcDark:Qf,hcLight:Qf},y(1028,"Editor marker navigation widget warning color.")),L7=Ff("editorMarkerNavigationWarning.headerBackground",{dark:Vf(k7,.1),light:Vf(k7,.1),hcDark:"#0C141F",hcLight:Vf(k7,.2)},y(1029,"Editor marker navigation widget warning heading background.")),D7=Ff("editorMarkerNavigationInfo.background",{dark:y7,light:y7,hcDark:Qf,hcLight:Qf},y(1030,"Editor marker navigation widget info color.")),E7=Ff("editorMarkerNavigationInfo.headerBackground",{dark:Vf(D7,.1),light:Vf(D7,.1),hcDark:null,hcLight:null},y(1031,"Editor marker navigation widget info heading background.")),N7=Ff("editorMarkerNavigation.background",a_,y(1032,"Editor marker navigation widget background."));var I7,T7=function(e,t){return function(i,n){t(i,n,e)}};let M7=class{static{I7=this}static{this.ID="editor.contrib.markerController"}static get(e){return e.getContribution(I7.ID)}constructor(e,t,i,n,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=o,this._sessionDispoables=new Mt,this._editor=e,this._widgetVisible=P7.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(b7,this._editor),this._widget.onDidClose((()=>this.close()),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition((e=>{this._model?.selected&&Yu.containsPosition(this._model?.selected.marker,e.position)||this._model?.resetIndex()}))),this._sessionDispoables.add(this._model.onDidChange((()=>{if(!this._widget||!this._widget.position||!this._model)return;const e=this._model.find(this._editor.getModel().uri,this._widget.position);e?this._widget.updateMarker(e.marker):this._widget.showStale()}))),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation((e=>{this._editorService.openCodeEditor({resource:e.resource,options:{pinned:!0,revealIfOpened:!0,selection:Yu.lift(e).collapseToStart()}},this._editor),this.close(!1)}))),this._sessionDispoables.add(this._editor.onDidChangeModel((()=>this._cleanUp()))),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._getOrCreateModel(t.uri);i.resetIndex(),i.move(!0,t,new rc(e.startLineNumber,e.startColumn)),i.selected&&this._widget.showAtMarker(i.selected.marker,i.selected.index,i.selected.total)}async navigate(e,t){if(!this._editor.hasModel())return;const i=this._editor.getModel(),n=this._getOrCreateModel(t?void 0:i.uri);if(n.move(e,i,this._editor.getPosition()),n.selected)if(n.selected.marker.resource.toString()!==i.uri.toString()){this._cleanUp();const i=await this._editorService.openCodeEditor({resource:n.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:n.selected.marker}},this._editor);i&&(I7.get(i)?.close(),I7.get(i)?.navigate(e,t))}else this._widget.showAtMarker(n.selected.marker,n.selected.index,n.selected.total)}};M7=I7=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([T7(1,d7),T7(2,eu),T7(3,sc),T7(4,nc)],M7);class A7 extends Pu{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){t.hasModel()&&await(M7.get(t)?.navigate(this._next,this._multiFile))}}class R7 extends A7{static{this.ID="editor.action.marker.next"}static{this.LABEL=x(1015,"Go to Next Problem (Error, Warning, Info)")}constructor(){super(!0,!1,{id:R7.ID,label:R7.LABEL,precondition:void 0,kbOpts:{kbExpr:Xu.focus,primary:578,weight:100},menuOpts:{menuId:b7.TitleMenu,title:R7.LABEL.value,icon:bF("marker-navigation-next",fh.arrowDown,y(1011,"Icon for goto next marker.")),group:"navigation",order:1}})}}class O7 extends A7{static{this.ID="editor.action.marker.prev"}static{this.LABEL=x(1016,"Go to Previous Problem (Error, Warning, Info)")}constructor(){super(!1,!1,{id:O7.ID,label:O7.LABEL,precondition:void 0,kbOpts:{kbExpr:Xu.focus,primary:1602,weight:100},menuOpts:{menuId:b7.TitleMenu,title:O7.LABEL.value,icon:bF("marker-navigation-previous",fh.arrowUp,y(1012,"Icon for goto previous marker.")),group:"navigation",order:2}})}}Uu(M7.ID,M7,4),Hu(R7),Hu(O7),Hu(class extends A7{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:x(1017,"Go to Next Problem in Files (Error, Warning, Info)"),precondition:void 0,kbOpts:{kbExpr:Xu.focus,primary:66,weight:100},menuOpts:{menuId:gu.MenubarGoMenu,title:y(1013,"Next &&Problem"),group:"6_problem_nav",order:1}})}}),Hu(class extends A7{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:x(1018,"Go to Previous Problem in Files (Error, Warning, Info)"),precondition:void 0,kbOpts:{kbExpr:Xu.focus,primary:1090,weight:100},menuOpts:{menuId:gu.MenubarGoMenu,title:y(1014,"Previous &&Problem"),group:"6_problem_nav",order:2}})}});const P7=new Jc("markersNavigationVisible",!1);Vu(new(Ou.bindToContribution(M7.get))({id:"closeMarkersNavigation",precondition:P7,handler:e=>e.close(),kbOpts:{weight:150,kbExpr:Xu.focus,primary:9,secondary:[1033]}}));class F7{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){const n=new Mt;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=n.add(new Rt);return o.value=this.doProvide(e,t,i),n.add(this.onDidActiveTextEditorControlChange((()=>{o.value=void 0,o.value=this.doProvide(e,t)}))),n}doProvide(e,t,i){const n=new Mt,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const s={editor:o},r=oY(o);if(r){let e=o.saveViewState()??void 0;n.add(r.onDidChangeCursorPosition((()=>{e=o.saveViewState()??void 0}))),s.restoreViewState=()=>{e&&o===this.activeTextEditorControl&&o.restoreViewState(e)},n.add(tt(t.onCancellationRequested)((()=>s.restoreViewState?.())))}n.add(Tt((()=>this.clearDecorations(o)))),n.add(this.provideWithTextEditor(s,e,t,i))}else n.add(this.provideWithoutTextEditor(e,t));return n}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,"code.jump"),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Ql(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){return nY(e)?e.getModel()?.modified:e.getModel()}addDecorations(e,t){e.changeDecorations((e=>{const i=[];this.rangeHighlightDecorationId&&(i.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),i.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const n=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:rw(Uw),position:ug.Full}}}],[o,s]=e.deltaDecorations(i,n);this.rangeHighlightDecorationId={rangeHighlightId:o,overviewRulerDecorationId:s}}))}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations((e=>{e.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])})),this.rangeHighlightDecorationId=void 0)}}class B7 extends F7{static{this.PREFIX=":"}constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=y(1325,"Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,At.None}provideWithTextEditor(e,t,i){const n=e.editor,o=new Mt;o.add(t.onDidAccept((i=>{const[o]=t.selectedItems;if(o){if(!this.isValidLineNumber(n,o.lineNumber))return;this.gotoLocation(e,{range:this.toRange(o.lineNumber,o.column),keyMods:t.keyMods,preserveFocus:i.inBackground}),i.inBackground||t.hide()}})));const s=()=>{const e=this.parsePosition(n,t.value.trim().substr(B7.PREFIX.length)),i=this.getPickLabel(n,e.lineNumber,e.column);if(t.items=[{lineNumber:e.lineNumber,column:e.column,label:i}],t.ariaLabel=i,!this.isValidLineNumber(n,e.lineNumber))return void this.clearDecorations(n);const o=this.toRange(e.lineNumber,e.column);n.revealRangeInCenter(o,0),this.addDecorations(n,o)};s(),o.add(t.onDidChangeValue((()=>s())));const r=oY(n);return r&&2===r.getOptions().get(76).renderType&&(r.updateOptions({lineNumbers:"on"}),o.add(Tt((()=>r.updateOptions({lineNumbers:"relative"}))))),o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map((e=>parseInt(e,10))).filter((e=>!isNaN(e))),n=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:n+i[0],column:i[1]}}getPickLabel(e,t,i){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,i)?y(1326,"Go to line {0} and character {1}.",t,i):y(1327,"Go to line {0}.",t);const n=e.getPosition()||{lineNumber:1,column:1},o=this.lineCount(e);return o>1?y(1328,"Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",n.lineNumber,n.column,o):y(1329,"Current Line: {0}, Character: {1}. Type a line number to navigate to.",n.lineNumber,n.column)}isValidLineNumber(e,t){return!(!t||"number"!=typeof t)&&t>0&&t<=this.lineCount(e)}isValidColumn(e,t,i){if(!i||"number"!=typeof i)return!1;const n=this.getModel(e);if(!n)return!1;const o={lineNumber:t,column:i};return n.validatePosition(o).equals(o)}lineCount(e){return this.getModel(e)?.getLineCount()??0}}var W7;!function(e){e[e.PRESERVE=0]="PRESERVE",e[e.LAST=1]="LAST"}(W7||(W7={}));const V7="workbench.contributions.quickaccess";var H7,z7,U7,K7,j7,q7,$7,G7;ru.add(V7,new class{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return 0===e.prefix.length?this.defaultProvider=e:this.providers.push(e),this.providers.sort(((e,t)=>t.prefix.length-e.prefix.length)),Tt((()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)}))}getQuickAccessProviders(){return as([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){const t=e&&this.providers.find((t=>e.startsWith(t.prefix)))||void 0;return t||this.defaultProvider}}),function(e){e.inspectTokensAction=y(782,"Developer: Inspect Tokens")}(H7||(H7={})),function(e){e.gotoLineActionLabel=y(783,"Go to Line/Column...")}(z7||(z7={})),function(e){e.helpQuickAccessActionLabel=y(784,"Show all Quick Access Providers")}(U7||(U7={})),function(e){e.quickCommandActionLabel=y(785,"Command Palette"),e.quickCommandHelp=y(786,"Show And Run Commands")}(K7||(K7={})),function(e){e.quickOutlineActionLabel=y(787,"Go to Symbol..."),e.quickOutlineByCategoryActionLabel=y(788,"Go to Symbol by Category...")}(j7||(j7={})),function(e){e.editorViewAccessibleLabel=y(789,"Editor content")}(q7||(q7={})),function(e){e.toggleHighContrast=y(790,"Toggle High Contrast Theme")}($7||($7={})),function(e){e.bulkEditServiceSummary=y(791,"Made {0} edits in {1} files")}(G7||(G7={}));let Z7=class extends B7{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=zt.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};Z7=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,sc)],Z7);class Y7 extends Pu{static{this.ID="editor.action.gotoLine"}constructor(){super({id:Y7.ID,label:z7.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:Xu.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(LD).quickAccess.show(Z7.PREFIX)}}Hu(Y7),ru.as(V7).registerQuickAccessProvider({ctor:Z7,prefix:Z7.PREFIX,helpEntries:[{description:z7.gotoLineActionLabel,commandId:Y7.ID}]});var Q7=i(1503),X7={};X7.styleTagTransform=zl(),X7.setAttributes=Bl(),X7.insert=Pl().bind(null,"head"),X7.domAPI=Rl(),X7.insertStyleElement=Vl(),Ml()(Q7.A,X7),Q7.A&&Q7.A.locals&&Q7.A.locals;var J7,e8=function(e,t){return function(i,n){t(i,n,e)}};let t8=class{static{J7=this}static{this.ID="editor.contrib.gotodefinitionatposition"}static{this.MAX_SOURCE_PREVIEW_LINES=8}constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,this.toUnhook=new Mt,this.toUnhookForKeyboard=new Mt,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new XZ(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown((([e,t])=>{this.startFindDefinitionFromMouse(e,t??void 0)}))),this.toUnhook.add(o.onExecute((e=>{this.isEnabled(e)&&this.gotoDefinition(e.target.position,e.hasSideBySideModifier).catch((e=>{Ie(e)})).finally((()=>{this.removeLinkDecorations()}))}))),this.toUnhook.add(o.onCancel((()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null})))}static get(e){return e.getContribution(J7.ID)}async startFindDefinitionFromCursor(e){await this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition((()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()}))),this.toUnhookForKeyboard.add(this.editor.onKeyDown((e=>{e&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())})))}startFindDefinitionFromMouse(e,t){if(9===e.target.type&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t))return this.currentWordAtPosition=null,void this.removeLinkDecorations();const i=e.target.position;this.startFindDefinition(i)}async startFindDefinition(e){this.toUnhookForKeyboard.clear();const t=e?this.editor.getModel()?.getWordAtPosition(e):null;if(!t)return this.currentWordAtPosition=null,void this.removeLinkDecorations();if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===t.startColumn&&this.currentWordAtPosition.endColumn===t.endColumn&&this.currentWordAtPosition.word===t.word)return;this.currentWordAtPosition=t;const i=new zD(this.editor,15);let n;this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=hi((t=>this.findDefinition(e,t)));try{n=await this.previousPromise}catch(e){return void Ie(e)}if(!n||!n.length||!i.validate(this.editor))return void this.removeLinkDecorations();const o=n[0].originSelectionRange?Yu.lift(n[0].originSelectionRange):new Yu(e.lineNumber,t.startColumn,e.lineNumber,t.endColumn);if(!(n.length>1)){const e=n[0];if(!e.uri)return;return this.textModelResolverService.createModelReference(e.uri).then((t=>{if(!t.object||!t.object.textEditorModel)return void t.dispose();const{object:{textEditorModel:i}}=t,{startLineNumber:n}=e.range;if(n<1||n>i.getLineCount())return void t.dispose();const s=this.getPreviewValue(i,n,e),r=this.languageService.guessLanguageIdByFilepathOrFirstLine(i.uri);this.addDecoration(o,s?(new Gh).appendCodeblock(r||"",s):void 0),t.dispose()}))}{let e=o;for(const{originSelectionRange:t}of n)t&&(e=Yu.plusRange(e,t));this.addDecoration(e,(new Gh).appendText(y(1072,"Click to show {0} definitions.",n.length)))}}getPreviewValue(e,t,i){let n=i.range;return n.endLineNumber-n.startLineNumber>=J7.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(e,t)),n=e.validateRange(n),this.stripIndentationFromPreviewRange(e,t,n)}stripIndentationFromPreviewRange(e,t,i){let n=e.getLineFirstNonWhitespaceColumn(t);for(let o=t+1;o<i.endLineNumber;o++){const t=e.getLineFirstNonWhitespaceColumn(o);n=Math.min(n,t)}return e.getValueInRange(i).replace(new RegExp(`^\\s{${n-1}}`,"gm"),"").trim()}getPreviewRangeBasedOnIndentation(e,t){const i=e.getLineFirstNonWhitespaceColumn(t),n=Math.min(e.getLineCount(),t+J7.MAX_SOURCE_PREVIEW_LINES);let o=t+1;for(;o<n&&i!==e.getLineFirstNonWhitespaceColumn(o);o++);return new Yu(t,1,o+1,1)}addDecoration(e,t){const i={range:e,options:{description:"goto-definition-link",inlineClassName:"goto-definition-link",hoverMessage:t}};this.linkDecorations.set([i])}removeLinkDecorations(){this.linkDecorations.clear()}isEnabled(e,t){return this.editor.hasModel()&&e.isLeftClick&&e.isNoneOrSingleMouseDown&&6===e.target.type&&!(e.target.detail.injectedText?.options instanceof vk)&&(e.hasTriggerModifier||!!t&&t.keyCodeIsTriggerKey)&&this.languageFeaturesService.definitionProvider.has(this.editor.getModel())}findDefinition(e,t){const i=this.editor.getModel();return i?e1(this.languageFeaturesService.definitionProvider,i,e,!1,t):Promise.resolve(null)}gotoDefinition(e,t){return this.editor.setPosition(e),this.editor.invokeWithinContext((e=>{const i=!t&&this.editor.getOption(101)&&!this.isInPeekEditor(e);return new l1({openToSide:t,openInPeek:i,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(e)}))}isInPeekEditor(e){const t=e.get(eu);return xY.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};t8=J7=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([e8(1,lc),e8(2,Tg),e8(3,BD)],t8),Uu(t8.ID,t8,2);const i8=oc("fileService");var n8,o8;!function(e){e[e.FILE=0]="FILE",e[e.FOLDER=1]="FOLDER",e[e.ROOT_FOLDER=2]="ROOT_FOLDER"}(n8||(n8={})),Hu(class extends Pu{constructor(){super({id:"editor.action.debugEditorGpuRenderer",label:x(1096,"Developer: Debug Editor GPU Renderer"),precondition:Ac.true()})}async run(e,t){const i=e.get(nc),n=e.get(LD),o=await n.pick([{label:y(1093,"Log Texture Atlas Stats"),id:"logTextureAtlasStats"},{label:y(1094,"Save Texture Atlas"),id:"saveTextureAtlas"},{label:y(1095,"Draw Glyph"),id:"drawGlyph"}],{canPickMany:!1});if(o)switch(o.id){case"logTextureAtlasStats":i.invokeFunction((e=>{const t=e.get(yu),i=Bz.atlas;if(!Bz.atlas)return void t.error("No texture atlas found");const n=i.getStats();t.info(["Texture atlas stats",...n].join("\n\n"))}));break;case"saveTextureAtlas":i.invokeFunction((async e=>{const t=e.get(CT),i=e.get(i8),n=t.getWorkspace().folders;if(n.length>0){const e=Bz.atlas,t=[];for(const[o,s]of e.pages.entries())t.push(i.writeFile(uo.joinPath(n[0].uri,`textureAtlasPage${o}_actual.png`),Mo.wrap(new Uint8Array(await(await s.source.convertToBlob()).arrayBuffer()))),i.writeFile(uo.joinPath(n[0].uri,`textureAtlasPage${o}_usage.png`),Mo.wrap(new Uint8Array(await(await s.getUsagePreview()).arrayBuffer()))));await Promise.all(t)}}));break;case"drawGlyph":i.invokeFunction((async e=>{const t=e.get(up),i=e.get(i8),n=e.get(LD),o=e.get(CT).getWorkspace().folders;if(0===o.length)return;const s=Bz.atlas,r=t.getValue("editor.fontFamily"),a=t.getValue("editor.fontSize"),l=new pz(a,r,Ka().devicePixelRatio,Bz.decorationStyleCache);let d=await n.input({prompt:"Enter a character to draw (prefix with 0x for code point))"});if(!d)return;const h=d.match(/0x(?<codePoint>[0-9a-f]+)/i)?.groups?.codePoint;void 0!==h&&(d=String.fromCodePoint(parseInt(h,16)));const c=s.getGlyph(l,d,0,0,0);if(!c)return;const u=s.pages[c.pageIndex].source.getContext("2d")?.getImageData(c.x,c.y,c.w,c.h);if(!u)return;const g=new OffscreenCanvas(u.width,u.height);cz(g.getContext("2d")).putImageData(u,0,0);const p=await g.convertToBlob({type:"image/png"}),m=uo.joinPath(o[0].uri,`glyph_${d}_0_${a}px_${r.replaceAll(/[,\\\/\.'\s]/g,"_")}.png`);await i.writeFile(m,Mo.wrap(new Uint8Array(await p.arrayBuffer())))}))}}}),function(e){e.NoAutoFocus="noAutoFocus",e.FocusIfVisible="focusIfVisible",e.AutoFocusImmediately="autoFocusImmediately"}(o8||(o8={}));var s8=function(e,t){return function(i,n){t(i,n,e)}};const r8=ll;class a8{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const l8={type:1,filter:{include:NP.QuickFix},triggerAction:IP.QuickFixHover};let d8=class{constructor(e,t,i,n){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=n,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||1!==e.type&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),n=e.range;if(!i.isValidRange(e.range))return[];const o=n.startLineNumber,s=i.getLineMaxColumn(o),r=[];for(const n of t){const t=n.range.startLineNumber===o?n.range.startColumn:1,a=n.range.endLineNumber===o?n.range.endColumn:s,l=this._markerDecorationsService.getMarker(i.uri,n);if(!l)continue;const d=new Yu(e.range.startLineNumber,t,e.range.startLineNumber,a);r.push(new a8(this,d,l))}return r}renderHoverParts(e,t){if(!t.length)return new Yq([]);const i=[];t.forEach((t=>{const n=this._renderMarkerHover(t);e.fragment.appendChild(n.hoverElement),i.push(n)}));const n=1===t.length?t[0]:t.sort(((e,t)=>qP.compare(e.marker.severity,t.marker.severity)))[0],o=this._renderMarkerStatusbar(e,n);return new Yq(i,o)}_renderMarkerHover(e){const t=new Mt,i=r8("div.hover-row"),n=il(i,r8("div.marker.hover-contents")),{source:o,message:s,code:r,relatedInformation:a}=e.marker;this._editor.applyFontInfo(n);const l=il(n,r8("span"));if(l.style.whiteSpace="pre-wrap",l.innerText=s,o||r)if(r&&"string"!=typeof r){const e=r8("span");o&&(il(e,r8("span")).innerText=o);const i=il(e,r8("a.code-link"));i.setAttribute("href",r.target.toString(!0)),t.add(ga(i,"click",(e=>{this._openerService.open(r.target,{allowCommands:!0}),e.preventDefault(),e.stopPropagation()}))),il(i,r8("span")).innerText=r.value;const s=il(n,e);s.style.opacity="0.6",s.style.paddingLeft="6px"}else{const e=il(n,r8("span"));e.style.opacity="0.6",e.style.paddingLeft="6px",e.innerText=o&&r?`${o}(${r})`:o||`(${r})`}if(hs(a))for(const{message:e,resource:i,startLineNumber:o,startColumn:s}of a){const r=il(n,r8("div"));r.style.marginTop="8px";const a=il(r,r8("a"));a.innerText=`${Bh(i)}(${o}, ${s}): `,a.style.cursor="pointer",t.add(ga(a,"click",(e=>{if(e.stopPropagation(),e.preventDefault(),this._openerService){const e={selection:{startLineNumber:o,startColumn:s}};this._openerService.open(i,{fromUserGesture:!0,editorOptions:e}).catch(Ie)}})));const l=il(r,r8("span"));l.innerText=e,this._editor.applyFontInfo(l)}return{hoverPart:e,hoverElement:i,dispose:()=>t.dispose()}}_renderMarkerStatusbar(e,t){const i=new Mt;if(t.marker.severity===qP.Error||t.marker.severity===qP.Warning||t.marker.severity===qP.Info){const i=M7.get(this._editor);i&&e.statusBar.addAction({label:y(1132,"View Problem"),commandId:R7.ID,run:()=>{e.hide(),i.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(104)){const n=e.statusBar.append(r8("div"));this.recentMarkerCodeActionsInfo&&($P.makeKey(this.recentMarkerCodeActionsInfo.marker)===$P.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=y(1133,"No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?At.None:fi((()=>n.textContent=y(1134,"Checking for quick fixes...")),200,i);n.textContent||(n.textContent=String.fromCharCode(160));const s=this.getCodeActions(t.marker);i.add(Tt((()=>s.cancel()))),s.then((s=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:s.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions)return s.dispose(),void(n.textContent=y(1135,"No quick fixes available"));n.style.display="none";let r=!1;i.add(Tt((()=>{r||s.dispose()}))),e.statusBar.addAction({label:y(1136,"Quick Fix..."),commandId:OP,run:t=>{r=!0;const i=OF.get(this._editor),n=Na(t);e.hide(),i?.showCodeActions(l8,s,{x:n.left,y:n.top,width:n.width,height:n.height})}});const a=s.validActions.find((e=>e.action.isAI));a&&e.statusBar.addAction({label:a.action.title,commandId:a.action.command?.id??"",iconClass:vh.asClassName(fh.sparkle),run:()=>{const e=OF.get(this._editor);e?.applyCodeAction(a,!1,!1,jP.FromProblemsHover)}}),e.onContentsChanged()}),Ie)}return i}getCodeActions(e){return hi((t=>UP(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new Yu(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),l8,bD.None,t)))}};d8=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([s8(1,WF),s8(2,ZI),s8(3,BD)],d8);class h8{constructor(e){this._editor=e}computeSync(e){const t=e=>({value:e}),i=this._editor.getLineDecorations(e.lineNumber),n=[],o="lineNo"===e.laneOrLine;if(!i)return n;for(const s of i){const i=s.options.glyphMargin?.position??gg.Center;if(!o&&i!==e.laneOrLine)continue;const r=o?s.options.lineNumberHoverMessage:s.options.glyphMarginHoverMessage;r&&!Zh(r)&&n.push(..._s(r).map(t))}return n}}var c8,u8=function(e,t){return function(i,n){t(i,n,e)}};const g8=ll;let p8=class extends At{static{c8=this}static{this.ID="editor.contrib.modesGlyphHoverWidget"}constructor(e,t,i){super(),this._renderDisposeables=this._register(new Mt),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new jG(!0)),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=new aT({editor:this._editor},t,i),this._hoverOperation=this._register(new DG(this._editor,new h8(this._editor))),this._register(this._hoverOperation.onResult((e=>this._withResult(e)))),this._register(this._editor.onDidChangeModelDecorations((()=>this._onModelDecorationsChanged()))),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(59)&&this._updateFont()}))),this._register(ma(this._hover.containerDomNode,"mouseleave",(e=>{this._onMouseLeave(e)}))),this._editor.addOverlayWidget(this)}dispose(){this._hoverComputerOptions=void 0,this._editor.removeOverlayWidget(this),super.dispose()}getId(){return c8.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach((e=>this._editor.applyFontInfo(e)))}_onModelDecorationsChanged(){this._isVisible&&this._hoverComputerOptions&&(this._hoverOperation.cancel(),this._hoverOperation.start(0,this._hoverComputerOptions))}showsOrWillShow(e){const t=e.target;return 2===t.type&&t.detail.glyphMarginLane?(this._startShowingAt(t.position.lineNumber,t.detail.glyphMarginLane),!0):3===t.type&&(this._startShowingAt(t.position.lineNumber,"lineNo"),!0)}_startShowingAt(e,t){this._hoverComputerOptions&&this._hoverComputerOptions.lineNumber===e&&this._hoverComputerOptions.laneOrLine===t||(this._hoverOperation.cancel(),this.hide(),this._hoverComputerOptions={lineNumber:e,laneOrLine:t},this._hoverOperation.start(0,this._hoverComputerOptions))}hide(){this._hoverComputerOptions=void 0,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e.value,this._messages.length>0?this._renderMessages(e.options.lineNumber,e.options.laneOrLine,this._messages):this.hide()}_renderMessages(e,t,i){this._renderDisposeables.clear();const n=document.createDocumentFragment();for(const e of i){const t=g8("div.hover-row.markdown-hover"),i=il(t,g8("div.hover-contents")),o=this._renderDisposeables.add(this._markdownRenderer.render(e.value));i.appendChild(o.element),n.appendChild(t)}this._updateContents(n),this._showAt(e,t)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e,t){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const i=this._editor.getLayoutInfo(),n=this._editor.getTopForLineNumber(e),o=this._editor.getScrollTop(),s=this._editor.getOption(75),r=n-o-(this._hover.containerDomNode.clientHeight-s)/2,a=i.glyphMarginLeft+i.glyphMarginWidth+("lineNo"===t?i.lineNumbersWidth:0);this._hover.containerDomNode.style.left=`${a}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(r),0)}px`,this._hover.containerDomNode.style.zIndex="11"}_onMouseLeave(e){const t=this._editor.getDomNode();(!t||!kG(t,e.x,e.y))&&this.hide()}};p8=c8=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([u8(1,Tg),u8(2,ZI)],p8);let m8=class extends At{static{this.ID="editor.contrib.marginHover"}constructor(e,t){super(),this._editor=e,this._instantiationService=t,this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new Mt,this._hoverState={mouseDown:!1},this._reactToEditorMouseMoveRunner=this._register(new Ci((()=>this._reactToEditorMouseMove(this._mouseMoveEvent)),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(69)&&(this._unhookListeners(),this._hookListeners())})))}_hookListeners(){const e=this._editor.getOption(69);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.hidingDelay},e.enabled?(this._listenersStore.add(this._editor.onMouseDown((e=>this._onEditorMouseDown(e)))),this._listenersStore.add(this._editor.onMouseUp((()=>this._onEditorMouseUp()))),this._listenersStore.add(this._editor.onMouseMove((e=>this._onEditorMouseMove(e)))),this._listenersStore.add(this._editor.onKeyDown((e=>this._onKeyDown(e))))):(this._listenersStore.add(this._editor.onMouseMove((e=>this._onEditorMouseMove(e)))),this._listenersStore.add(this._editor.onKeyDown((e=>this._onKeyDown(e))))),this._listenersStore.add(this._editor.onMouseLeave((e=>this._onEditorMouseLeave(e)))),this._listenersStore.add(this._editor.onDidChangeModel((()=>{this._cancelScheduler(),this.hideGlyphHover()}))),this._listenersStore.add(this._editor.onDidChangeModelContent((()=>this._cancelScheduler()))),this._listenersStore.add(this._editor.onDidScrollChange((e=>this._onEditorScrollChanged(e))))}_unhookListeners(){this._listenersStore.clear()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this.hideGlyphHover()}_onEditorMouseDown(e){this._hoverState.mouseDown=!0,this._isMouseOnGlyphHoverWidget(e)||this.hideGlyphHover()}_isMouseOnGlyphHoverWidget(e){const t=this._glyphWidget?.getDomNode();return!!t&&kG(t,e.event.posx,e.event.posy)}_onEditorMouseUp(){this._hoverState.mouseDown=!1}_onEditorMouseLeave(e){this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._isMouseOnGlyphHoverWidget(e)||this.hideGlyphHover())}_shouldNotRecomputeCurrentHoverWidget(e){const t=this._hoverSettings.sticky,i=this._isMouseOnGlyphHoverWidget(e);return t&&i}_onEditorMouseMove(e){this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._mouseMoveEvent=e,this._shouldNotRecomputeCurrentHoverWidget(e)?this._reactToEditorMouseMoveRunner.cancel():this._reactToEditorMouseMove(e))}_reactToEditorMouseMove(e){e&&(this._tryShowHoverWidget(e)||this.hideGlyphHover())}_tryShowHoverWidget(e){return this._getOrCreateGlyphWidget().showsOrWillShow(e)}_onKeyDown(e){this._editor.hasModel()&&5!==e.keyCode&&6!==e.keyCode&&57!==e.keyCode&&4!==e.keyCode&&this.hideGlyphHover()}hideGlyphHover(){this._glyphWidget?.hide()}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=this._instantiationService.createInstance(p8,this._editor)),this._glyphWidget}dispose(){super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),this._glyphWidget?.dispose()}};m8=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,nc)],m8);const f8=new class{constructor(){this._implementations=[]}register(e){return this._implementations.push(e),{dispose:()=>{const t=this._implementations.indexOf(e);-1!==t&&this._implementations.splice(t,1)}}}getImplementations(){return this._implementations}};Uu(V1.ID,V1,2),Uu(m8.ID,m8,2),Hu(class extends Pu{constructor(){super({id:m$,label:x(1102,"Show or Focus Hover"),metadata:{description:x(1103,"Show or focus the editor hover which shows documentation, references, and other content for a symbol at the current cursor position."),args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if and when the hover should take focus upon being triggered by this action.",enum:[o8.NoAutoFocus,o8.FocusIfVisible,o8.AutoFocusImmediately],enumDescriptions:[y(1099,"The hover will not automatically take focus."),y(1100,"The hover will take focus only if it is already visible."),y(1101,"The hover will automatically take focus when it appears.")],default:o8.FocusIfVisible}}}}]},precondition:void 0,kbOpts:{kbExpr:Xu.editorTextFocus,primary:De(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const n=V1.get(t);if(!n)return;const o=i?.focus;let s=o8.FocusIfVisible;Object.values(o8).includes(o)?s=o:"boolean"==typeof o&&o&&(s=o8.AutoFocusImmediately);const r=e=>{const i=t.getPosition(),o=new Yu(i.lineNumber,i.column,i.lineNumber,i.column);n.showContentHover(o,1,2,e)},a=2===t.getOption(2);n.isHoverVisible?s!==o8.NoAutoFocus?n.focus():r(a):r(a||s===o8.AutoFocusImmediately)}}),Hu(class extends Pu{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:x(1104,"Show Definition Preview Hover"),precondition:void 0,metadata:{description:x(1105,"Show the definition preview hover in the editor.")}})}run(e,t){const i=V1.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const o=new Yu(n.lineNumber,n.column,n.lineNumber,n.column),s=t8.get(t);s&&s.startFindDefinitionFromCursor(n).then((()=>{i.showContentHover(o,1,2,!0)}))}}),Hu(class extends Pu{constructor(){super({id:"editor.action.hideHover",label:x(1106,"Hide Hover"),alias:"Hide Content Hover",precondition:void 0})}run(e,t){V1.get(t)?.hideContentHover()}}),Hu(class extends Pu{constructor(){super({id:"editor.action.scrollUpHover",label:x(1107,"Scroll Up Hover"),precondition:Xu.hoverFocused,kbOpts:{kbExpr:Xu.hoverFocused,primary:16,weight:100},metadata:{description:x(1108,"Scroll up the editor hover.")}})}run(e,t){const i=V1.get(t);i&&i.scrollUp()}}),Hu(class extends Pu{constructor(){super({id:"editor.action.scrollDownHover",label:x(1109,"Scroll Down Hover"),precondition:Xu.hoverFocused,kbOpts:{kbExpr:Xu.hoverFocused,primary:18,weight:100},metadata:{description:x(1110,"Scroll down the editor hover.")}})}run(e,t){const i=V1.get(t);i&&i.scrollDown()}}),Hu(class extends Pu{constructor(){super({id:"editor.action.scrollLeftHover",label:x(1111,"Scroll Left Hover"),precondition:Xu.hoverFocused,kbOpts:{kbExpr:Xu.hoverFocused,primary:15,weight:100},metadata:{description:x(1112,"Scroll left the editor hover.")}})}run(e,t){const i=V1.get(t);i&&i.scrollLeft()}}),Hu(class extends Pu{constructor(){super({id:"editor.action.scrollRightHover",label:x(1113,"Scroll Right Hover"),precondition:Xu.hoverFocused,kbOpts:{kbExpr:Xu.hoverFocused,primary:17,weight:100},metadata:{description:x(1114,"Scroll right the editor hover.")}})}run(e,t){const i=V1.get(t);i&&i.scrollRight()}}),Hu(class extends Pu{constructor(){super({id:"editor.action.pageUpHover",label:x(1115,"Page Up Hover"),precondition:Xu.hoverFocused,kbOpts:{kbExpr:Xu.hoverFocused,primary:11,secondary:[528],weight:100},metadata:{description:x(1116,"Page up the editor hover.")}})}run(e,t){const i=V1.get(t);i&&i.pageUp()}}),Hu(class extends Pu{constructor(){super({id:"editor.action.pageDownHover",label:x(1117,"Page Down Hover"),precondition:Xu.hoverFocused,kbOpts:{kbExpr:Xu.hoverFocused,primary:12,secondary:[530],weight:100},metadata:{description:x(1118,"Page down the editor hover.")}})}run(e,t){const i=V1.get(t);i&&i.pageDown()}}),Hu(class extends Pu{constructor(){super({id:"editor.action.goToTopHover",label:x(1119,"Go To Top Hover"),precondition:Xu.hoverFocused,kbOpts:{kbExpr:Xu.hoverFocused,primary:14,secondary:[2064],weight:100},metadata:{description:x(1120,"Go to the top of the editor hover.")}})}run(e,t){const i=V1.get(t);i&&i.goToTop()}}),Hu(class extends Pu{constructor(){super({id:"editor.action.goToBottomHover",label:x(1121,"Go To Bottom Hover"),precondition:Xu.hoverFocused,kbOpts:{kbExpr:Xu.hoverFocused,primary:13,secondary:[2066],weight:100},metadata:{description:x(1122,"Go to the bottom of the editor hover.")}})}run(e,t){const i=V1.get(t);i&&i.goToBottom()}}),Hu(class extends Pu{constructor(){super({id:f$,label:_$,alias:"Increase Hover Verbosity Level",precondition:Xu.hoverVisible})}run(e,t,i){const n=V1.get(t);if(!n)return;const o=void 0!==i?.index?i.index:n.focusedHoverPartIndex();n.updateHoverVerbosityLevel(OS.Increase,o,i?.focus)}}),Hu(class extends Pu{constructor(){super({id:v$,label:b$,alias:"Decrease Hover Verbosity Level",precondition:Xu.hoverVisible})}run(e,t,i){const n=V1.get(t);if(!n)return;const o=void 0!==i?.index?i.index:n.focusedHoverPartIndex();V1.get(t)?.updateHoverVerbosityLevel(OS.Decrease,o,i?.focus)}}),Qq.register(bZ),Qq.register(d8),hw(((e,t)=>{const i=e.getColor(M_);i&&(t.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${i.transparent(.5)}; }`),t.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${i.transparent(.5)}; }`),t.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${i.transparent(.5)}; }`))})),f8.register(new class{}),f8.register(new class{}),f8.register(new class{});var _8=i(9337),v8={};v8.styleTagTransform=zl(),v8.setAttributes=Bl(),v8.insert=Pl().bind(null,"head"),v8.domAPI=Rl(),v8.insertStyleElement=Vl(),Ml()(_8.A,v8),_8.A&&_8.A.locals&&_8.A.locals;class b8 extends At{static{this.ID="editor.contrib.iPadShowKeyboard"}constructor(e){super(),this.editor=e,this.widget=null,X&&(this._register(e.onDidChangeConfiguration((()=>this.update()))),this.update())}update(){const e=!this.editor.getOption(104);!this.widget&&e?this.widget=new w8(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}class w8 extends At{static{this.ID="editor.contrib.ShowKeyboardWidget"}constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(ga(this._domNode,"touchstart",(e=>{this.editor.focus()}))),this._register(ga(this._domNode,"focus",(e=>{this.editor.focus()}))),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return w8.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}Uu(b8.ID,b8,3);class C8{constructor(e,t,i){this._editRange=e,this._originalSelection=t,this._text=i}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new Qu(i.endLineNumber,Math.min(this._originalSelection.positionColumn,i.endColumn),i.endLineNumber,Math.min(this._originalSelection.positionColumn,i.endColumn)):new Qu(i.endLineNumber,i.endColumn-this._text.length,i.endLineNumber,i.endColumn)}}var y8=i(6437),S8={};S8.styleTagTransform=zl(),S8.setAttributes=Bl(),S8.insert=Pl().bind(null,"head"),S8.domAPI=Rl(),S8.insertStyleElement=Vl(),Ml()(y8.A,S8),y8.A&&y8.A.locals&&y8.A.locals;var x8;let k8=class{static{x8=this}static{this.ID="editor.contrib.inPlaceReplaceController"}static get(e){return e.getContribution(x8.ID)}static{this.DECORATION=bk.register({description:"in-place-replace",className:"valueSetReplacement"})}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){this.currentRequest?.cancel();const i=this.editor.getSelection(),n=this.editor.getModel();if(!n||!i)return;let o=i;if(o.startLineNumber!==o.endLineNumber)return;const s=new zD(this.editor,5),r=n.uri;return this.editorWorkerService.canNavigateValueSet(r)?(this.currentRequest=hi((e=>this.editorWorkerService.navigateValueSet(r,o,t))),this.currentRequest.then((t=>{if(!t||!t.range||!t.value)return;if(!s.validate(this.editor))return;const i=Yu.lift(t.range);let n=t.range;const r=t.value.length-(o.endColumn-o.startColumn);n={startLineNumber:n.startLineNumber,startColumn:n.startColumn,endLineNumber:n.endLineNumber,endColumn:n.startColumn+t.value.length},r>1&&(o=new Qu(o.startLineNumber,o.startColumn,o.endLineNumber,o.endColumn+r-1));const a=new C8(i,o,t.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,a),this.editor.pushUndoStop(),this.decorations.set([{range:n,options:x8.DECORATION}]),this.decorationRemover?.cancel(),this.decorationRemover=mi(350),this.decorationRemover.then((()=>this.decorations.clear())).catch(Ie)})).catch(Ie)):Promise.resolve(void 0)}};function L8(e,t){let i=0;for(let n=0;n<e.length;n++)"\t"===e.charAt(n)?i+=t:i++;return i}function D8(e,t,i){e=e<0?0:e;let n="";if(!i){const i=Math.floor(e/t);e%=t;for(let e=0;e<i;e++)n+="\t"}for(let t=0;t<e;t++)n+=" ";return n}function E8(e,t,i,n){if(1===e.getLineCount()&&1===e.getLineMaxColumn(1))return[];const o=t.getLanguageConfiguration(e.getLanguageId()).indentRulesSupport;if(!o)return[];const s=new oL(e,o,t);for(n=Math.min(n,e.getLineCount());i<=n&&s.shouldIgnore(i);)i++;if(i>n-1)return[];const{tabSize:r,indentSize:a,insertSpaces:l}=e.getOptions(),d=(e,t)=>(t=t||1,uL.shiftIndent(e,e.length+t,r,a,l)),h=(e,t)=>(t=t||1,uL.unshiftIndent(e,e.length+t,r,a,l)),c=[];let u=Gi(e.getLineContent(i)),g=u;s.shouldIncrease(i)?(g=d(g),u=d(u)):s.shouldIndentNextLine(i)&&(g=d(g));for(let t=++i;t<=n;t++){if(N8(e,t))continue;const i=Gi(e.getLineContent(t)),n=g;s.shouldDecrease(t,n)&&(g=h(g),u=h(u)),i!==g&&c.push(qZ.replaceMove(new Qu(t,1,t,i.length+1),Ng(g,a,l))),s.shouldIgnore(t)||(s.shouldIncrease(t,n)?(u=d(u),g=u):g=s.shouldIndentNextLine(t,n)?d(g):u)}return c}function N8(e,t){return!!e.tokenization.isCheapToTokenize(t)&&2===e.tokenization.getLineTokens(t).getStandardTokenType(0)}k8=x8=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,Xq)],k8),Uu(k8.ID,k8,4),Hu(class extends Pu{constructor(){super({id:"editor.action.inPlaceReplace.up",label:x(1230,"Replace with Previous Value"),precondition:Xu.writable,kbOpts:{kbExpr:Xu.editorTextFocus,primary:3159,weight:100}})}run(e,t){const i=k8.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}),Hu(class extends Pu{constructor(){super({id:"editor.action.inPlaceReplace.down",label:x(1231,"Replace with Next Value"),precondition:Xu.writable,kbOpts:{kbExpr:Xu.editorTextFocus,primary:3161,weight:100}})}run(e,t){const i=k8.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}});class I8 extends Pu{static{this.ID="editor.action.indentationToSpaces"}constructor(){super({id:I8.ID,label:x(1141,"Convert Indentation to Spaces"),precondition:Xu.writable,metadata:{description:x(1142,"Convert the tab indentation to spaces.")}})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),o=t.getSelection();if(!o)return;const s=new V8(o,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}}class T8 extends Pu{static{this.ID="editor.action.indentationToTabs"}constructor(){super({id:T8.ID,label:x(1143,"Convert Indentation to Tabs"),precondition:Xu.writable,metadata:{description:x(1144,"Convert the spaces indentation to tabs.")}})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),o=t.getSelection();if(!o)return;const s=new H8(o,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}}class M8 extends Pu{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(LD),n=e.get(ac),o=t.getModel();if(!o)return;const s=n.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget),r=o.getOptions(),a=[1,2,3,4,5,6,7,8].map((e=>({id:e.toString(),label:e.toString(),description:e===s.tabSize&&e===r.tabSize?y(1137,"Configured Tab Size"):e===s.tabSize?y(1138,"Default Tab Size"):e===r.tabSize?y(1139,"Current Tab Size"):void 0}))),l=Math.min(o.getOptions().tabSize-1,7);setTimeout((()=>{i.pick(a,{placeHolder:y(1140,"Select Tab Size for Current File"),activeItem:a[l]}).then((e=>{if(e&&o&&!o.isDisposed()){const t=parseInt(e.label,10);this.displaySizeOnly?o.updateOptions({tabSize:t}):o.updateOptions({tabSize:t,indentSize:t,insertSpaces:this.insertSpaces})}}))}),50)}}class A8 extends M8{static{this.ID="editor.action.indentUsingTabs"}constructor(){super(!1,!1,{id:A8.ID,label:x(1145,"Indent Using Tabs"),precondition:void 0,metadata:{description:x(1146,"Use indentation with tabs.")}})}}class R8 extends M8{static{this.ID="editor.action.indentUsingSpaces"}constructor(){super(!0,!1,{id:R8.ID,label:x(1147,"Indent Using Spaces"),precondition:void 0,metadata:{description:x(1148,"Use indentation with spaces.")}})}}class O8 extends M8{static{this.ID="editor.action.changeTabDisplaySize"}constructor(){super(!0,!0,{id:O8.ID,label:x(1149,"Change Tab Display Size"),precondition:void 0,metadata:{description:x(1150,"Change the space size equivalent of the tab.")}})}}class P8 extends Pu{static{this.ID="editor.action.detectIndentation"}constructor(){super({id:P8.ID,label:x(1151,"Detect Indentation from Content"),precondition:void 0,metadata:{description:x(1152,"Detect the indentation from content.")}})}run(e,t){const i=e.get(ac),n=t.getModel();if(!n)return;const o=i.getCreationOptions(n.getLanguageId(),n.uri,n.isForSimpleWidget);n.detectIndentation(o.insertSpaces,o.tabSize)}}class F8{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const t of e)t.range&&"string"==typeof t.text&&this._edits.push(t)}getEditOperations(e,t){for(const e of this._edits)t.addEditOperation(Yu.lift(e.range),e.text);let i=!1;Array.isArray(this._edits)&&1===this._edits.length&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),i||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}let B8=class{static{this.ID="editor.contrib.autoIndentOnPaste"}constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new Mt,this.callOnModel=new Mt,this.callOnDispose.add(e.onDidChangeConfiguration((()=>this.update()))),this.callOnDispose.add(e.onDidChangeModel((()=>this.update()))),this.callOnDispose.add(e.onDidChangeModelLanguage((()=>this.update())))}update(){this.callOnModel.clear(),!this.editor.getOption(17)||this.editor.getOption(16)<4||this.editor.hasModel()&&this.callOnModel.add(this.editor.onDidPaste((({range:e})=>{this.trigger(e)})))}trigger(e){const t=this.editor.getSelections();if(null===t||t.length>1)return;const i=this.editor.getModel();if(!i)return;if(this.rangeContainsOnlyWhitespaceCharacters(i,e))return;if(!this.editor.getOption(18)&&function(e,t){const i=t=>{const i=function(e,t){const i=t.lineNumber;if(!e.tokenization.isCheapToTokenize(i))return;e.tokenization.forceTokenization(i);const n=e.tokenization.getLineTokens(i),o=n.findTokenIndexAtOffset(t.column-1);return n.getStandardTokenType(o)}(e,t);return 2===i};return i(t.getStartPosition())||i(t.getEndPosition())}(i,e))return;if(!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const n=this.editor.getOption(16),{tabSize:o,indentSize:s,insertSpaces:r}=i.getOptions(),a=[],l={shiftIndent:e=>uL.shiftIndent(e,e.length+1,o,s,r),unshiftIndent:e=>uL.unshiftIndent(e,e.length+1,o,s,r)};let d=e.startLineNumber,h=i.getLineContent(d);if(!/\S/.test(h.substring(0,e.startColumn-1))){const e=fL(n,i,i.getLanguageId(),d,l,this._languageConfigurationService);if(null!==e){const t=Gi(h),n=L8(e,o);if(n!==L8(t,o)){const e=D8(n,o,r);a.push({range:new Yu(d,1,d,t.length+1),text:e}),h=e+h.substring(t.length)}else{const e=_L(i,d,this._languageConfigurationService);if(0===e||8===e)return}}}const c=d;for(;d<e.endLineNumber&&!/\S/.test(i.getLineContent(d+1));)d++;if(d!==e.endLineNumber){const t=fL(n,{tokenization:{getLineTokens:e=>i.tokenization.getLineTokens(e),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(e,t)=>i.getLanguageIdAtPosition(e,t)},getLineContent:e=>e===c?h:i.getLineContent(e)},i.getLanguageId(),d+1,l,this._languageConfigurationService);if(null!==t){const n=L8(t,o),s=L8(Gi(i.getLineContent(d+1)),o);if(n!==s){const t=n-s;for(let n=d+1;n<=e.endLineNumber;n++){const e=Gi(i.getLineContent(n)),s=D8(L8(e,o)+t,o,r);s!==e&&a.push({range:new Yu(n,1,n,e.length+1),text:s})}}}}if(a.length>0){this.editor.pushUndoStop();const e=new F8(a,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",e),this.editor.pushUndoStop()}}rangeContainsOnlyWhitespaceCharacters(e,t){const i=e=>0===e.trim().length;let n=!0;if(t.startLineNumber===t.endLineNumber)n=i(e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1));else for(let o=t.startLineNumber;o<=t.endLineNumber;o++){const s=e.getLineContent(o);if(n=o===t.startLineNumber?i(s.substring(t.startColumn-1)):o===t.endLineNumber?i(s.substring(0,t.endColumn-1)):0===e.getLineFirstNonWhitespaceColumn(o),!n)break}return n}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}};function W8(e,t,i,n){if(1===e.getLineCount()&&1===e.getLineMaxColumn(1))return;let o="";for(let e=0;e<i;e++)o+=" ";const s=new RegExp(o,"gi");for(let i=1,r=e.getLineCount();i<=r;i++){let r=e.getLineFirstNonWhitespaceColumn(i);if(0===r&&(r=e.getLineMaxColumn(i)),1===r)continue;const a=new Yu(i,1,i,r),l=e.getValueInRange(a),d=n?l.replace(/\t/gi,o):l.replace(s,"\t");t.addEditOperation(a,d)}}B8=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,Qp)],B8);class V8{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),W8(e,t,this.tabSize,!0)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}class H8{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),W8(e,t,this.tabSize,!1)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}Uu(B8.ID,B8,2),Hu(I8),Hu(T8),Hu(A8),Hu(R8),Hu(O8),Hu(P8),Hu(class extends Pu{constructor(){super({id:"editor.action.reindentlines",label:x(1153,"Reindent Lines"),precondition:Xu.writable,metadata:{description:x(1154,"Reindent the lines of the editor.")}})}run(e,t){const i=e.get(Qp),n=t.getModel();if(!n)return;const o=E8(n,i,1,n.getLineCount());o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}),Hu(class extends Pu{constructor(){super({id:"editor.action.reindentselectedlines",label:x(1155,"Reindent Selected Lines"),precondition:Xu.writable,metadata:{description:x(1156,"Reindent the selected lines of the editor.")}})}run(e,t){const i=e.get(Qp),n=t.getModel();if(!n)return;const o=t.getSelections();if(null===o)return;const s=[];for(const e of o){let t=e.startLineNumber,o=e.endLineNumber;if(t!==o&&1===e.endColumn&&o--,1===t){if(t===o)continue}else t--;const r=E8(n,i,t,o);s.push(...r)}s.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop())}}),Uu(y1.ID,y1,1),Qq.register(k1);class z8{constructor(e){this.instantiationService=e}init(...e){}}let U8=class extends z8{constructor(e,t){super(t),this.init(e)}};U8=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,nc)],U8);const K8={Visible:e6,HasFocusedSuggestion:new Jc("suggestWidgetHasFocusedSuggestion",!1,y(1440,"Whether any suggestion is focused")),DetailsVisible:new Jc("suggestWidgetDetailsVisible",!1,y(1441,"Whether suggestion details are visible")),MultipleSuggestions:new Jc("suggestWidgetMultipleSuggestions",!1,y(1442,"Whether there are multiple suggestions to pick from")),MakesTextEdit:new Jc("suggestionMakesTextEdit",!0,y(1443,"Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new Jc("acceptSuggestionOnEnter",!0,y(1444,"Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new Jc("suggestionHasInsertAndReplaceRange",!1,y(1445,"Whether the current suggestion has insert and replace behaviour")),InsertMode:new Jc("suggestionInsertMode",void 0,{type:"string",description:y(1446,"Whether the default behaviour is to insert or replace")}),CanResolve:new Jc("suggestionCanResolve",!1,y(1447,"Whether the current suggestion supports to resolve further details"))},j8=new gu("suggestWidgetStatusBar");class q8{constructor(e,t,i,n){this.position=e,this.completion=t,this.container=i,this.provider=n,this.isInvalid=!1,this.score=ah.Default,this.distance=0,this.textLabel="string"==typeof t.label?t.label:t.label?.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),this.extensionId=t.extensionId,Yu.isIRange(t.range)?(this.editStart=new rc(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new rc(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new rc(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||Yu.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new rc(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new rc(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new rc(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||Yu.spansMultipleLines(t.range.insert)||Yu.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),"function"!=typeof n.resolveCompletionItem&&(this._resolveCache=Promise.resolve(),this._resolveDuration=0)}get isResolved(){return void 0!==this._resolveDuration}get resolveDuration(){return void 0!==this._resolveDuration?this._resolveDuration:-1}async resolve(e){if(!this._resolveCache){const t=e.onCancellationRequested((()=>{this._resolveCache=void 0,this._resolveDuration=void 0})),i=new Ht(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then((e=>{Object.assign(this.completion,e),this._resolveDuration=i.elapsed()}),(e=>{Re(e)&&(this._resolveCache=void 0,this._resolveDuration=void 0)})).finally((()=>{t.dispose()}))}return this._resolveCache}}class $8{static{this.default=new $8}constructor(e=2,t=new Set,i=new Set,n=new Map,o=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=n,this.showDeprecated=o}}class G8{constructor(e,t,i,n){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=n}}async function Z8(e,t,i,n=$8.default,o={triggerKind:0},s=oi.None){const r=new Ht;i=i.clone();const a=t.getWordAtPosition(i),l=a?new Yu(i.lineNumber,a.startColumn,i.lineNumber,a.endColumn):Yu.fromPositions(i),d={replace:l,insert:l.setEndPosition(i.lineNumber,i.column)},h=[],c=new Mt,u=[];let g=!1;const p=(e,t,o)=>{let s=!1;if(!t)return s;for(const o of t.suggestions)if(!n.kindFilter.has(o.kind)){if(!n.showDeprecated&&o?.tags?.includes(1))continue;o.range||(o.range=d),o.sortText||(o.sortText="string"==typeof o.label?o.label:o.label.label),!g&&o.insertTextRules&&4&o.insertTextRules&&(g=GT.guessNeedsClipboard(o.insertText)),h.push(new q8(i,o,t,e)),s=!0}return Dt(t)&&c.add(t),u.push({providerName:e._debugDisplayName??"unknown_provider",elapsedProvider:t.duration??-1,elapsedOverall:o.elapsed()}),s},m=(async()=>{})();for(const r of e.orderedGroups(t)){let e=!1;if(await Promise.all(r.map((async r=>{if(n.providerItemsToReuse.has(r)){const t=n.providerItemsToReuse.get(r);return t.forEach((e=>h.push(e))),void(e=e||t.length>0)}if(!(n.providerFilter.size>0)||n.providerFilter.has(r))try{const n=new Ht,a=await r.provideCompletionItems(t,i,o,s);e=p(r,a,n)||e}catch(e){Te(e)}}))),e||s.isCancellationRequested)break}return await m,s.isCancellationRequested?(c.dispose(),Promise.reject(new Oe)):new G8(h.sort((f=n.snippetSortOrder,Q8.get(f))),g,{entries:u,elapsed:r.elapsed()},c);var f}function Y8(e,t){if(e.sortTextLow&&t.sortTextLow){if(e.sortTextLow<t.sortTextLow)return-1;if(e.sortTextLow>t.sortTextLow)return 1}return e.textLabel<t.textLabel?-1:e.textLabel>t.textLabel?1:e.completion.kind-t.completion.kind}const Q8=new Map;Q8.set(0,(function(e,t){if(e.completion.kind!==t.completion.kind){if(28===e.completion.kind)return-1;if(28===t.completion.kind)return 1}return Y8(e,t)})),Q8.set(2,(function(e,t){if(e.completion.kind!==t.completion.kind){if(28===e.completion.kind)return 1;if(28===t.completion.kind)return-1}return Y8(e,t)})),Q8.set(1,Y8),fc.registerCommand("_executeCompletionItemProvider",(async(e,...t)=>{const[i,n,o,s]=t;_t(uo.isUri(i)),_t(rc.isIPosition(n)),_t("string"==typeof o||!o),_t("number"==typeof s||!s);const{completionProvider:r}=e.get(BD),a=await e.get(lc).createModelReference(i);try{const e={incomplete:!1,suggestions:[]},t=[],i=a.object.textEditorModel.validatePosition(n),l=await Z8(r,a.object.textEditorModel,i,void 0,{triggerCharacter:o??void 0,triggerKind:o?1:0});for(const i of l.items)t.length<(s??0)&&t.push(i.resolve(oi.None)),e.incomplete=e.incomplete||i.container.incomplete,e.suggestions.push(i.completion);try{return await Promise.all(t),e}finally{setTimeout((()=>l.disposable.dispose()),100)}}finally{a.dispose()}}));class X8{static isAllOff(e){return"off"===e.other&&"off"===e.comments&&"off"===e.strings}static isAllOn(e){return"on"===e.other&&"on"===e.comments&&"on"===e.strings}static valueFor(e,t){switch(t){case 1:return e.comments;case 2:return e.strings;default:return e.other}}}class J8{static{this.inlineSuggestionVisible=new Jc("inlineSuggestionVisible",!1,y(1184,"Whether an inline suggestion is visible"))}static{this.inlineSuggestionHasIndentation=new Jc("inlineSuggestionHasIndentation",!1,y(1185,"Whether the inline suggestion starts with whitespace"))}static{this.inlineSuggestionHasIndentationLessThanTabSize=new Jc("inlineSuggestionHasIndentationLessThanTabSize",!0,y(1186,"Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab"))}static{this.suppressSuggestions=new Jc("inlineSuggestionSuppressSuggestions",void 0,y(1187,"Whether suggestions should be suppressed for the current suggestion"))}static{this.cursorBeforeGhostText=new Jc("cursorBeforeGhostText",!1,y(1188,"Whether the cursor is at ghost text"))}static{this.cursorInIndentation=new Jc("cursorInIndentation",!1,y(1189,"Whether the cursor is in indentation"))}static{this.hasSelection=new Jc("editor.hasSelection",!1,y(1190,"Whether the editor has a selection"))}static{this.cursorAtInlineEdit=new Jc("cursorAtInlineEdit",!1,y(1191,"Whether the cursor is at an inline edit"))}static{this.inlineEditVisible=new Jc("inlineEditIsVisible",!1,y(1192,"Whether an inline edit is visible"))}static{this.tabShouldJumpToInlineEdit=new Jc("tabShouldJumpToInlineEdit",!1,y(1193,"Whether tab should jump to an inline edit."))}static{this.tabShouldAcceptInlineEdit=new Jc("tabShouldAcceptInlineEdit",!1,y(1194,"Whether tab should accept the inline edit."))}static{this.inInlineEditsPreviewEditor=new Jc("inInlineEditsPreviewEditor",!0,y(1195,"Whether the current code editor is showing an inline edits preview"))}}const eee=oc("dataChannelService");var tee=function(e,t){return function(i,n){t(i,n,e)}};let iee=class extends At{static cast(){return this}constructor(e,t,i){var n,o;super(),this._key=e,this._contextKeyService=t,this._dataChannelService=i,this._isEnabledContextKeyValue=(n="structuredLogger.enabled:"+this._key,o=this._contextKeyService,Sr(o.onDidChangeContext,(()=>o.getContextKeyValue(n)))).recomputeInitiallyAndOnChange(this._store),this.isEnabled=this._isEnabledContextKeyValue.map((e=>void 0!==e))}log(e){return!!this._isEnabledContextKeyValue.get()&&(this._dataChannelService.getDataChannel("structuredLogger:"+this._key).sendData(e),!0)}};iee=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([tee(1,eu),tee(2,eee)],iee);var nee=function(e,t){return function(i,n){t(i,n,e)}};let oee=class extends At{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._loggerService=i,this._structuredLogger=this._register(this._instantiationService.createInstance(iee.cast(),"editor.inlineSuggest.logChangeReason.commandId"));const n=this._loggerService?.createLogger("textModelChanges",{hidden:!1,name:"Text Model Changes Reason"}),o=Sr(this,n.onDidChangeLogLevel,(()=>n.getLevel()));this._register(ar((e=>{Lu(o.read(e),xu.Trace)&&e.store.add(this._editor.onDidChangeModelContent((e=>{"output"!==this._editor.getModel()?.uri.scheme&&n.trace("onDidChangeModelContent: "+e.detailedReasons.map((e=>e.toKey(Number.MAX_VALUE))).join(", "))})))}))),this._register(ar((e=>{this._editor instanceof tq&&this._structuredLogger.isEnabled.read(e)&&e.store.add(this._editor.onDidChangeModelContent((e=>{const t=this._editor.getModel();if(!t)return;const i=e.detailedReasons[0],n={...i.metadata,sourceId:"TextModel.setChangeReason",source:i.metadata.source,time:Date.now(),modelUri:t.uri,modelVersion:t.getVersionId()};setTimeout((()=>{this._structuredLogger.log(n)}),0)})))})))}};oee=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([nee(1,nc),nee(2,Su)],oee);var see=i(69),ree={};function aee(e,t=q){return function(e,t=q){return!!t&&Mh(e.charCodeAt(0))&&58===e.charCodeAt(1)}(e,t)?e.charAt(0).toUpperCase()+e.slice(1):e}ree.styleTagTransform=zl(),ree.setAttributes=Bl(),ree.insert=Pl().bind(null,"head"),ree.domAPI=Rl(),ree.insertStyleElement=Vl(),Ml()(see.A,ree),see.A&&see.A.locals&&see.A.locals,Object.create(null);Object.freeze({CURRENT_YEAR:!0,CURRENT_YEAR_SHORT:!0,CURRENT_MONTH:!0,CURRENT_DATE:!0,CURRENT_HOUR:!0,CURRENT_MINUTE:!0,CURRENT_SECOND:!0,CURRENT_DAY_NAME:!0,CURRENT_DAY_NAME_SHORT:!0,CURRENT_MONTH_NAME:!0,CURRENT_MONTH_NAME_SHORT:!0,CURRENT_SECONDS_UNIX:!0,CURRENT_TIMEZONE_OFFSET:!0,SELECTION:!0,CLIPBOARD:!0,TM_SELECTED_TEXT:!0,TM_CURRENT_LINE:!0,TM_CURRENT_WORD:!0,TM_LINE_INDEX:!0,TM_LINE_NUMBER:!0,TM_FILENAME:!0,TM_FILENAME_BASE:!0,TM_DIRECTORY:!0,TM_FILEPATH:!0,CURSOR_INDEX:!0,CURSOR_NUMBER:!0,RELATIVE_FILEPATH:!0,BLOCK_COMMENT_START:!0,BLOCK_COMMENT_END:!0,LINE_COMMENT:!0,WORKSPACE_NAME:!0,WORKSPACE_FOLDER:!0,RANDOM:!0,RANDOM_HEX:!0,UUID:!0});class lee{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const i=t.resolve(e);if(void 0!==i)return i}}}class dee{constructor(e,t,i,n){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=n}resolve(e){const{name:t}=e;if("SELECTION"===t||"TM_SELECTED_TEXT"===t){let t=this._model.getValueInRange(this._selection)||void 0,i=this._selection.startLineNumber!==this._selection.endLineNumber;if(!t&&this._overtypingCapturer){const e=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);e&&(t=e.value,i=e.multiline)}if(t&&i&&e.snippet){const i=Gi(this._model.getLineContent(this._selection.startLineNumber),0,this._selection.startColumn-1);let n=i;e.snippet.walk((t=>t!==e&&(t instanceof WT&&(n=Gi(qi(t.value).pop())),!0)));const o=rn(n,i);t=t.replace(/(\r\n|\r|\n)(.*)/g,((e,t,i)=>`${t}${n.substr(o)}${i}`))}return t}if("TM_CURRENT_LINE"===t)return this._model.getLineContent(this._selection.positionLineNumber);if("TM_CURRENT_WORD"===t){const e=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return e&&e.word||void 0}return"TM_LINE_INDEX"===t?String(this._selection.positionLineNumber-1):"TM_LINE_NUMBER"===t?String(this._selection.positionLineNumber):"CURSOR_INDEX"===t?String(this._selectionIdx):"CURSOR_NUMBER"===t?String(this._selectionIdx+1):void 0}}class hee{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if("TM_FILENAME"===t)return io(this._model.uri.fsPath);if("TM_FILENAME_BASE"===t){const e=io(this._model.uri.fsPath),t=e.lastIndexOf(".");return t<=0?e:e.slice(0,t)}return"TM_DIRECTORY"===t?"."===to(this._model.uri.fsPath)?"":this._labelService.getUriLabel(Vh(this._model.uri)):"TM_FILEPATH"===t?this._labelService.getUriLabel(this._model.uri):"RELATIVE_FILEPATH"===t?this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0}):void 0}}class cee{constructor(e,t,i,n){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=n}resolve(e){if("CLIPBOARD"!==e.name)return;const t=this._readClipboardText();if(t){if(this._spread){const e=t.split(/\r\n|\n|\r/).filter((e=>!Pi(e)));if(e.length===this._selectionCount)return e[this._selectionIdx]}return t}}}let uee=class{constructor(e,t,i){this._model=e,this._selection=t,this._languageConfigurationService=i}resolve(e){const{name:t}=e,i=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),n=this._languageConfigurationService.getLanguageConfiguration(i).comments;if(n)return"LINE_COMMENT"===t?n.lineCommentToken||void 0:"BLOCK_COMMENT_START"===t?n.blockCommentStartToken||void 0:"BLOCK_COMMENT_END"===t&&n.blockCommentEndToken||void 0}};uee=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(2,Qp)],uee);class gee{constructor(){this._date=new Date}static{this.dayNames=[y(1391,"Sunday"),y(1392,"Monday"),y(1393,"Tuesday"),y(1394,"Wednesday"),y(1395,"Thursday"),y(1396,"Friday"),y(1397,"Saturday")]}static{this.dayNamesShort=[y(1398,"Sun"),y(1399,"Mon"),y(1400,"Tue"),y(1401,"Wed"),y(1402,"Thu"),y(1403,"Fri"),y(1404,"Sat")]}static{this.monthNames=[y(1405,"January"),y(1406,"February"),y(1407,"March"),y(1408,"April"),y(1409,"May"),y(1410,"June"),y(1411,"July"),y(1412,"August"),y(1413,"September"),y(1414,"October"),y(1415,"November"),y(1416,"December")]}static{this.monthNamesShort=[y(1417,"Jan"),y(1418,"Feb"),y(1419,"Mar"),y(1420,"Apr"),y(1421,"May"),y(1422,"Jun"),y(1423,"Jul"),y(1424,"Aug"),y(1425,"Sep"),y(1426,"Oct"),y(1427,"Nov"),y(1428,"Dec")]}resolve(e){const{name:t}=e;if("CURRENT_YEAR"===t)return String(this._date.getFullYear());if("CURRENT_YEAR_SHORT"===t)return String(this._date.getFullYear()).slice(-2);if("CURRENT_MONTH"===t)return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if("CURRENT_DATE"===t)return String(this._date.getDate().valueOf()).padStart(2,"0");if("CURRENT_HOUR"===t)return String(this._date.getHours().valueOf()).padStart(2,"0");if("CURRENT_MINUTE"===t)return String(this._date.getMinutes().valueOf()).padStart(2,"0");if("CURRENT_SECOND"===t)return String(this._date.getSeconds().valueOf()).padStart(2,"0");if("CURRENT_DAY_NAME"===t)return gee.dayNames[this._date.getDay()];if("CURRENT_DAY_NAME_SHORT"===t)return gee.dayNamesShort[this._date.getDay()];if("CURRENT_MONTH_NAME"===t)return gee.monthNames[this._date.getMonth()];if("CURRENT_MONTH_NAME_SHORT"===t)return gee.monthNamesShort[this._date.getMonth()];if("CURRENT_SECONDS_UNIX"===t)return String(Math.floor(this._date.getTime()/1e3));if("CURRENT_TIMEZONE_OFFSET"===t){const e=this._date.getTimezoneOffset(),t=e>0?"-":"+",i=Math.trunc(Math.abs(e/60)),n=i<10?"0"+i:i,o=Math.abs(e)-60*i;return t+n+":"+(o<10?"0"+o:o)}}}class pee{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=function(e){if("string"==typeof e||void 0===e)return"string"==typeof e?{id:io(e)}:ST;const t=e;return t.configuration?{id:t.id,configPath:t.configuration}:1===t.folders.length?{id:t.id,uri:t.folders[0].uri}:{id:t.id}}(this._workspaceService.getWorkspace());return function(e){const t=e;return"string"==typeof t?.id&&!yT(e)&&!function(e){const t=e;return"string"==typeof t?.id&&uo.isUri(t.configPath)}(e)}(t)?void 0:"WORKSPACE_NAME"===e.name?this._resolveWorkspaceName(t):"WORKSPACE_FOLDER"===e.name?this._resoveWorkspacePath(t):void 0}_resolveWorkspaceName(e){if(yT(e))return io(e.uri.path);let t=io(e.configPath.path);return t.endsWith("code-workspace")&&(t=t.substr(0,t.length-14-1)),t}_resoveWorkspacePath(e){if(yT(e))return aee(e.uri.fsPath);const t=io(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?aee(i):"/"}}class mee{resolve(e){const{name:t}=e;return"RANDOM"===t?Math.random().toString().slice(-6):"RANDOM_HEX"===t?Math.random().toString(16).slice(-6):"UUID"===t?_C():void 0}}var fee;class _ee{static{this._decor={active:bk.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:bk.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:bk.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:bk.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})}}constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=os(t.placeholders,HT.compareByIndex),this._placeholderGroupsIdx=-1}initialize(e){this._offset=e.newPosition}dispose(){this._placeholderDecorations&&this._editor.removeDecorations([...this._placeholderDecorations.values()]),this._placeholderGroups.length=0}_initDecorations(){if(-1===this._offset)throw new Error("Snippet not initialized!");if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations((t=>{for(const i of this._snippet.placeholders){const n=this._snippet.offset(i),o=this._snippet.fullLen(i),s=Yu.fromPositions(e.getPositionAt(this._offset+n),e.getPositionAt(this._offset+n+o)),r=i.isFinalTabstop?_ee._decor.inactiveFinal:_ee._decor.inactive,a=t.addDecoration(s,r);this._placeholderDecorations.set(i,a)}}))}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const e=[];for(const t of this._placeholderGroups[this._placeholderGroupsIdx])if(t.transform){const i=this._placeholderDecorations.get(t),n=this._editor.getModel().getDecorationRange(i),o=this._editor.getModel().getValueInRange(n),s=t.transform.resolve(o).split(/\r\n|\r|\n/);for(let e=1;e<s.length;e++)s[e]=this._editor.getModel().normalizeIndentation(this._snippetLineLeadingWhitespace+s[e]);e.push(qZ.replace(n,s.join(this._editor.getModel().getEOL())))}e.length>0&&this._editor.executeEdits("snippet.placeholderTransform",e)}let t=!1;!0===e&&this._placeholderGroupsIdx<this._placeholderGroups.length-1?(this._placeholderGroupsIdx+=1,t=!0):!1===e&&this._placeholderGroupsIdx>0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations((e=>{const i=new Set,n=[];for(const o of this._placeholderGroups[this._placeholderGroupsIdx]){const s=this._placeholderDecorations.get(o),r=this._editor.getModel().getDecorationRange(s);n.push(new Qu(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(o),e.changeDecorationOptions(s,o.isFinalTabstop?_ee._decor.activeFinal:_ee._decor.active),i.add(o);for(const t of this._snippet.enclosingPlaceholders(o)){const n=this._placeholderDecorations.get(t);e.changeDecorationOptions(n,t.isFinalTabstop?_ee._decor.activeFinal:_ee._decor.active),i.add(t)}}for(const[t,n]of this._placeholderDecorations)i.has(t)||e.changeDecorationOptions(n,t.isFinalTabstop?_ee._decor.inactiveFinal:_ee._decor.inactive);return n}));return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof HT){const e=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(e).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||0===this._placeholderGroups.length}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}get isTrivialSnippet(){if(0===this._snippet.placeholders.length)return!0;if(1===this._snippet.placeholders.length){const[e]=this._snippet.placeholders;if(e.isFinalTabstop&&this._snippet.rightMostDescendant===e)return!0}return!1}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let i;for(const n of t){if(n.isFinalTabstop)break;i||(i=[],e.set(n.index,i));const t=this._placeholderDecorations.get(n),o=this._editor.getModel().getDecorationRange(t);if(!o){e.delete(n.index);break}i.push(o)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!e?.choice)return;const t=this._placeholderDecorations.get(e);if(!t)return;const i=this._editor.getModel().getDecorationRange(t);return i?{range:i,choice:e.choice}:void 0}get hasChoice(){let e=!1;return this._snippet.walk((t=>(e=t instanceof zT,!e))),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations((i=>{for(const n of this._placeholderGroups[this._placeholderGroupsIdx]){const o=e.shift();console.assert(-1!==o._offset),console.assert(!o._placeholderDecorations);const s=o._snippet.placeholderInfo.last.index;for(const e of o._snippet.placeholderInfo.all)e.isFinalTabstop?e.index=n.index+(s+1)/this._nestingLevel:e.index=n.index+e.index/this._nestingLevel;this._snippet.replace(n,o._snippet.children);const r=this._placeholderDecorations.get(n);i.removeDecoration(r),this._placeholderDecorations.delete(n);for(const e of o._snippet.placeholders){const n=o._snippet.offset(e),s=o._snippet.fullLen(e),r=Yu.fromPositions(t.getPositionAt(o._offset+n),t.getPositionAt(o._offset+n+s)),a=i.addDecoration(r,_ee._decor.inactive);this._placeholderDecorations.set(e,a)}}this._placeholderGroups=os(this._snippet.placeholders,HT.compareByIndex)}))}}const vee={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let bee=fee=class{static adjustWhitespace(e,t,i,n,o){const s=Gi(e.getLineContent(t.lineNumber),0,t.column-1);let r;return n.walk((t=>{if(!(t instanceof WT)||t.parent instanceof zT)return!0;if(o&&!o.has(t))return!0;const a=t.value.split(/\r\n|\r|\n/);if(i){const i=n.offset(t);if(0===i)a[0]=e.normalizeIndentation(a[0]);else{r=r??n.toString();const t=r.charCodeAt(i-1);10!==t&&13!==t||(a[0]=e.normalizeIndentation(s+a[0]))}for(let t=1;t<a.length;t++)a[t]=e.normalizeIndentation(s+a[t])}const l=a.join(e.getEOL());return l!==t.value&&(t.parent.replace(t,[new WT(l)]),r=void 0),!0})),s}static adjustSelection(e,t,i,n){if(0!==i||0!==n){const{positionLineNumber:o,positionColumn:s}=t,r=s-i,a=s+n,l=e.validateRange({startLineNumber:o,startColumn:r,endLineNumber:o,endColumn:a});t=Qu.createWithDirection(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn,t.getDirection())}return t}static createEditsAndSnippetsFromSelections(e,t,i,n,o,s,r,a,l){const d=[],h=[];if(!e.hasModel())return{edits:d,snippets:h};const c=e.getModel(),u=e.invokeWithinContext((e=>e.get(CT))),g=e.invokeWithinContext((e=>new hee(e.get(C0),c))),p=()=>r,m=c.getValueInRange(fee.adjustSelection(c,e.getSelection(),i,0)),f=c.getValueInRange(fee.adjustSelection(c,e.getSelection(),0,n)),_=c.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),v=e.getSelections().map(((e,t)=>({selection:e,idx:t}))).sort(((e,t)=>Yu.compareRangesUsingStarts(e.selection,t.selection)));for(const{selection:r,idx:b}of v){let w=fee.adjustSelection(c,r,i,0),C=fee.adjustSelection(c,r,0,n);m!==c.getValueInRange(w)&&(w=r),f!==c.getValueInRange(C)&&(C=r);const y=r.setStartPosition(w.startLineNumber,w.startColumn).setEndPosition(C.endLineNumber,C.endColumn),S=(new GT).parse(t,!0,o),x=y.getStartPosition(),k=fee.adjustWhitespace(c,x,s||b>0&&_!==c.getLineFirstNonWhitespaceColumn(r.positionLineNumber),S);S.resolveVariables(new lee([g,new cee(p,b,v.length,"spread"===e.getOption(88)),new dee(c,r,b,a),new uee(c,r,l),new gee,new pee(u),new mee])),d[b]=qZ.replace(y,S.toString()),d[b].identifier={major:b,minor:0},d[b]._isTracked=!0,h[b]=new _ee(e,S,k)}return{edits:d,snippets:h}}static createEditsAndSnippetsFromEdits(e,t,i,n,o,s,r){if(!e.hasModel()||0===t.length)return{edits:[],snippets:[]};const a=[],l=e.getModel(),d=new GT,h=new $T,c=new lee([e.invokeWithinContext((e=>new hee(e.get(C0),l))),new cee((()=>o),0,e.getSelections().length,"spread"===e.getOption(88)),new dee(l,e.getSelection(),0,s),new uee(l,e.getSelection(),r),new gee,new pee(e.invokeWithinContext((e=>e.get(CT)))),new mee]);t=t.sort(((e,t)=>Yu.compareRangesUsingStarts(e.range,t.range)));let u=0;for(let e=0;e<t.length;e++){const{range:i,template:o,keepWhitespace:s}=t[e];if(e>0){const n=t[e-1].range,o=Yu.fromPositions(n.getEndPosition(),i.getStartPosition()),s=new WT(l.getValueInRange(o));h.appendChild(s),u+=s.value.length}const r=d.parseFragment(o,h);fee.adjustWhitespace(l,i.getStartPosition(),void 0!==s?!s:n,h,new Set(r)),h.resolveVariables(c);const g=h.toString(),p=g.slice(u);u=g.length;const m=qZ.replace(i,p);m.identifier={major:e,minor:0},m._isTracked=!0,a.push(m)}return d.ensureFinalTabstop(h,i,!0),{edits:a,snippets:[new _ee(e,h,"")]}}constructor(e,t,i=vee,n){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=n,this._templateMerges=[],this._snippets=[]}dispose(){Et(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(e){if(!this._editor.hasModel())return;const{edits:t,snippets:i}="string"==typeof this._template?fee.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):fee.createEditsAndSnippetsFromEdits(this._editor,this._template,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService);this._snippets=i,this._editor.executeEdits(e??IC(),t,(e=>{const t=e.filter((e=>!!e.identifier));for(let e=0;e<i.length;e++)i[e].initialize(t[e].textChange);return this._snippets[0].hasPlaceholder?this._move(!0):t.map((e=>Qu.fromPositions(e.range.getEndPosition())))})),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=vee){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:n}=fee.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,(e=>{const t=e.filter((e=>!!e.identifier));for(let e=0;e<n.length;e++)n[e].initialize(t[e].textChange);const i=n[0].isTrivialSnippet;if(!i){for(const e of this._snippets)e.merge(n);console.assert(0===n.length)}return this._snippets[0].hasPlaceholder&&!i?this._move(void 0):t.map((e=>Qu.fromPositions(e.range.getEndPosition())))}))}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const t=[];for(const i of this._snippets){const n=i.move(e);t.push(...n)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get hasChoice(){return this._snippets[0].hasChoice}get activeChoice(){return this._snippets[0].activeChoice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length<this._snippets.length)return!1;const t=new Map;for(const i of this._snippets){const n=i.computePossibleSelections();if(0===t.size)for(const[i,o]of n){o.sort(Yu.compareRangesUsingStarts);for(const n of e)if(o[0].containsRange(n)){t.set(i,[]);break}}if(0===t.size)return!1;t.forEach(((e,t)=>{e.push(...n.get(t))}))}e.sort(Yu.compareRangesUsingStarts);for(const[i,n]of t)if(n.length===e.length){n.sort(Yu.compareRangesUsingStarts);for(let o=0;o<n.length;o++)n[o].containsRange(e[o])||t.delete(i)}else t.delete(i);return t.size>0}};bee=fee=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(3,Qp)],bee);var wee,Cee=function(e,t){return function(i,n){t(i,n,e)}};const yee={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let See=class{static{wee=this}static{this.ID="snippetController2"}static get(e){return e.getContribution(wee.ID)}static{this.InSnippetMode=new Jc("inSnippetMode",!1,y(1387,"Whether the editor in current in snippet mode"))}static{this.HasNextTabstop=new Jc("hasNextTabstop",!1,y(1388,"Whether there is a next tab stop when in snippet mode"))}static{this.HasPrevTabstop=new Jc("hasPrevTabstop",!1,y(1389,"Whether there is a previous tab stop when in snippet mode"))}constructor(e,t,i,n,o){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=o,this._inSnippetObservable=Js(this,!1),this._snippetListener=new Mt,this._modelVersionId=-1,this._inSnippet=wee.InSnippetMode.bindTo(n),this._hasNextTabstop=wee.HasNextTabstop.bindTo(n),this._hasPrevTabstop=wee.HasPrevTabstop.bindTo(n)}dispose(){this._inSnippet.reset(),this._inSnippetObservable.set(!1,void 0),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._session?.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,void 0===t?yee:{...yee,...t})}catch(t){this.cancel(),this._logService.error(t),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"<no_session>")}}_doInsert(e,t){if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&"string"!=typeof e&&this.cancel(),this._session?(_t("string"==typeof e),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new bee(this._editor,e,t,this._languageConfigurationService),this._session.insert(t.reason)),t.undoStopAfter&&this._editor.getModel().pushStackElement(),this._session?.hasChoice){const e={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(e,t)=>{if(!this._session||e!==this._editor.getModel()||!rc.equals(this._editor.getPosition(),t))return;const{activeChoice:i}=this._session;if(!i||0===i.choice.options.length)return;const n=e.getValueInRange(i.range),o=Boolean(i.choice.options.find((e=>e.value===n))),s=[];for(let e=0;e<i.choice.options.length;e++){const t=i.choice.options[e];s.push({kind:13,label:t.value,insertText:t.value,sortText:"a".repeat(e+1),range:i.range,filterText:o?`${n}_${t.value}`:void 0,command:{id:"jumpToNextSnippetPlaceholder",title:y(1390,"Go to next placeholder...")}})}return{suggestions:s}}},t=this._editor.getModel();let i,n=!1;const o=()=>{i?.dispose(),n=!1},s=()=>{n||(i=this._languageFeaturesService.completionProvider.register({language:t.getLanguageId(),pattern:t.uri.fsPath,scheme:t.uri.scheme,exclusive:!0},e),this._snippetListener.add(i),n=!0)};this._choiceCompletions={provider:e,enable:s,disable:o}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent((e=>e.isFlush&&this.cancel()))),this._snippetListener.add(this._editor.onDidChangeModel((()=>this.cancel()))),this._snippetListener.add(this._editor.onDidChangeCursorSelection((()=>this._updateState())))}}_updateState(){if(this._session&&this._editor.hasModel()){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this._editor.getModel().pushStackElement(),this.cancel();this._inSnippet.set(!0),this._inSnippetObservable.set(!0,void 0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){if(!this._session||!this._editor.hasModel())return void(this._currentChoice=void 0);const{activeChoice:e}=this._session;if(!e||!this._choiceCompletions)return this._choiceCompletions?.disable(),void(this._currentChoice=void 0);this._currentChoice!==e.choice&&(this._currentChoice=e.choice,this._choiceCompletions.enable(),queueMicrotask((()=>{!function(e,t){e.getContribution("editor.contrib.suggestController")?.triggerSuggest((new Set).add(t),void 0,!0)}(this._editor,this._choiceCompletions.provider)})))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){this._inSnippet.reset(),this._inSnippetObservable.set(!1,void 0),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,this._session?.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){this._session?.prev(),this._updateState()}next(){this._session?.next(),this._updateState()}isInSnippet(){return Boolean(this._inSnippet.get())}get isInSnippetObservable(){return this._inSnippetObservable}};See=wee=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Cee(1,yu),Cee(2,BD),Cee(3,eu),Cee(4,Qp)],See),Uu(See.ID,See,4);const xee=Ou.bindToContribution(See.get);function kee(e){return new Lee(e)}Vu(new xee({id:"jumpToNextSnippetPlaceholder",precondition:Ac.and(See.InSnippetMode,See.HasNextTabstop),handler:e=>e.next(),kbOpts:{weight:130,kbExpr:Xu.textInputFocus,primary:2}})),Vu(new xee({id:"jumpToPrevSnippetPlaceholder",precondition:Ac.and(See.InSnippetMode,See.HasPrevTabstop),handler:e=>e.prev(),kbOpts:{weight:130,kbExpr:Xu.textInputFocus,primary:1026}})),Vu(new xee({id:"leaveSnippet",precondition:See.InSnippetMode,handler:e=>e.cancel(!0),kbOpts:{weight:130,kbExpr:Xu.textInputFocus,primary:9,secondary:[1033]}})),Vu(new xee({id:"acceptSnippet",precondition:See.InSnippetMode,handler:e=>e.finish()}));class Lee extends NU{constructor(e){super(),this._textModel=e}getOffset(e){return this._textModel.getOffsetAt(e)}getPosition(e){return this._textModel.getPositionAt(e)}}const Dee=[];function Eee(e){const t=function(e){const t=Ds.createSortPermutation(e,Cs((e=>e.range),Yu.compareRangesUsingStarts)),i=new PU(t.apply(e)).getNewRanges();return t.inverse().apply(i)}(e);return t.map((e=>e.getEndPosition()))}class Nee{constructor(e){this._contextKeyService=e}bind(e,t){return l2(e,this._contextKeyService,t instanceof Function?t:e=>t.read(e))}}function Iee(e,t){return new Promise((i=>{let n;const o=setTimeout((()=>{n&&n.dispose(),i()}),e);t&&(n=t.onCancellationRequested((()=>{clearTimeout(o),n&&n.dispose(),i()})))}))}class Tee{constructor(e,t,i,n=Mee){this.startValue=e,this.endValue=t,this.durationMs=i,this._interpolationFunction=n,this.startTimeMs=Date.now(),e===t&&(this.durationMs=0)}isFinished(){return Date.now()>=this.startTimeMs+this.durationMs}getValue(){const e=Date.now()-this.startTimeMs;return e>=this.durationMs?this.endValue:this._interpolationFunction(e,this.startValue,this.endValue-this.startValue,this.durationMs)}}function Mee(e,t,i,n){return e===n?t+i:i*(1-Math.pow(2,-10*e/n))+t}function Aee(e,t,i,n){return i*((e=e/n-1)*e*e+1)+t}class Ree{constructor(e){this._value=Js(this,e)}getValue(e){const t=this._value.read(e);return t.isFinished()||Oee.instance.invalidateOnNextAnimationFrame(e),t.getValue()}}class Oee{constructor(){this._counter=Lr(this),this._isScheduled=!1}static{this.instance=new Oee}invalidateOnNextAnimationFrame(e){this._counter.read(e),this._isScheduled||(this._isScheduled=!0,Ka().requestAnimationFrame((()=>{this._isScheduled=!1,this._update()})))}_update(){this._counter.trigger(void 0)}}class Pee{constructor(e,t){this.lineNumber=e,this.parts=t,rt((()=>at(t,((e,t)=>e.column<=t.column))))}equals(e){return this.lineNumber===e.lineNumber&&this.parts.length===e.parts.length&&this.parts.every(((t,i)=>t.equals(e.parts[i])))}renderForScreenReader(e){if(0===this.parts.length)return"";const t=this.parts[this.parts.length-1],i=e.substr(0,t.column-1),n=new PU([...this.parts.map((e=>new FU(Yu.fromPositions(new rc(1,e.column)),e.lines.map((e=>e.line)).join("\n"))))]).applyToString(i);return n.substring(this.parts[0].column-1)}isEmpty(){return this.parts.every((e=>0===e.lines.length))}get lineCount(){return 1+this.parts.reduce(((e,t)=>e+t.lines.length-1),0)}}class Fee{constructor(e,t,i,n=[]){this.column=e,this.text=t,this.preview=i,this._inlineDecorations=n,this.lines=qi(this.text).map(((e,t)=>({line:e,lineDecorations:WB.filter(this._inlineDecorations,t+1,1,e.length+1)})))}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every(((t,i)=>t.line===e.lines[i].line&&WB.equalsArr(t.lineDecorations,e.lines[i].lineDecorations)))}}class Bee{constructor(e,t,i,n=0){this.lineNumber=e,this.columnRange=t,this.text=i,this.additionalReservedLineCount=n,this.parts=[new Fee(this.columnRange.endColumnExclusive,this.text,!1)],this.newLines=qi(this.text)}renderForScreenReader(e){return this.newLines.join("\n")}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every((e=>0===e.lines.length))}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every(((t,i)=>t===e.newLines[i]))&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function Wee(e,t){return es(e,t,Vee)}function Vee(e,t){return e===t||!(!e||!t)&&(e instanceof Pee&&t instanceof Pee||e instanceof Bee&&t instanceof Bee)&&e.equals(t)}function Hee(e,t,i){const n=i?e.range.intersectRanges(i):e.range;if(!n)return e;const o=e.text.replaceAll("\r\n","\n"),s=t.getValueInRange(n,1),r=rn(s,o),a=xm.ofText(s.substring(0,r)).addToPosition(e.range.getStartPosition()),l=o.substring(r),d=Yu.fromPositions(a,e.range.getEndPosition());return new FU(d,l)}function zee(e,t){return e.text.startsWith(t.text)&&(i=e.range,(n=t.range).getStartPosition().equals(i.getStartPosition())&&n.getEndPosition().isBeforeOrEqual(i.getEndPosition()));var i,n}function Uee(e,t,i,n,o=0){let s=Hee(e,t);if(s.range.endLineNumber!==s.range.startLineNumber)return;const r=t.getLineContent(s.range.startLineNumber),a=Gi(r).length;if(s.range.startColumn-1<=a){const e=Gi(s.text).length,t=r.substring(s.range.startColumn-1,a),[i,n]=[s.range.getStartPosition(),s.range.getEndPosition()],o=i.column+t.length<=n.column?i.delta(0,t.length):n,l=Yu.fromPositions(o,n),d=s.text.startsWith(t)?s.text.substring(t.length):s.text.substring(e);s=new FU(l,d)}const l=t.getValueInRange(s.range),d=function(e,t){if(Kee?.originalValue===e&&Kee?.newValue===t)return Kee?.changes;{let i=qee(e,t,!0);if(i){const n=jee(i);if(n>0){const o=qee(e,t,!1);o&&jee(o)<n&&(i=o)}}return Kee={originalValue:e,newValue:t,changes:i},i}}(l,s.text);if(!d)return;const h=s.range.startLineNumber,c=new Array;if("prefix"===i){const e=d.filter((e=>0===e.originalLength));if(e.length>1||1===e.length&&e[0].originalStart!==l.length)return}const u=s.text.length-o;for(const e of d){const t=s.range.startColumn+e.originalStart+e.originalLength;if("subwordSmart"===i&&n&&n.lineNumber===s.range.startLineNumber&&t<n.column)return;if(e.originalLength>0)return;if(0===e.modifiedLength)continue;const o=e.modifiedStart+e.modifiedLength,r=Math.max(e.modifiedStart,Math.min(o,u)),a=s.text.substring(e.modifiedStart,r),l=s.text.substring(r,Math.max(e.modifiedStart,o));a.length>0&&c.push(new Fee(t,a,!1)),l.length>0&&c.push(new Fee(t,l,!0))}return new Pee(h,c)}let Kee;function jee(e){let t=0;for(const i of e)t+=i.originalLength;return t}function qee(e,t,i){if(e.length>5e3||t.length>5e3)return;function n(e){let t=0;for(let i=0,n=e.length;i<n;i++){const n=e.charCodeAt(i);n>t&&(t=n)}return t}const o=Math.max(n(e),n(t));function s(e){if(e<0)throw new Error("unexpected");return o+e+1}function r(e){let t=0,n=0;const o=new Int32Array(e.length);for(let r=0,a=e.length;r<a;r++)if(i&&"("===e[r]){const e=100*n+t;o[r]=s(2*e),t++}else if(i&&")"===e[r]){t=Math.max(t-1,0);const e=100*n+t;o[r]=s(2*e+1),0===t&&n++}else o[r]=e.charCodeAt(r);return o}const a=r(e),l=r(t);return new OQ({getElements:()=>a},{getElements:()=>l}).ComputeDiff(!1).changes}var $ee=function(e,t){return function(i,n){t(i,n,e)}};class Gee{constructor(e,t){this._baseService=e,this._intercept=t}publicLog2(e,t){this._intercept(e,t),this._baseService.publicLog2(e,t)}}let Zee=class extends Gee{constructor(e,t){super(e,((e,i)=>{let n=!0;i&&Yee in i&&(n=Boolean(i[Yee])),n&&t.getDataChannel("editTelemetry").sendData({eventName:e,data:i})}))}};Zee=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([$ee(0,Cu),$ee(1,eee)],Zee);const Yee=Symbol("shouldForwardToChannel");class Qee{computeDiff(e,t,i){const n=new nte(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),o=[];let s=null;for(const e of n.changes){let t,i;t=0===e.originalEndLineNumber?new ym(e.originalStartLineNumber+1,e.originalStartLineNumber+1):new ym(e.originalStartLineNumber,e.originalEndLineNumber+1),i=0===e.modifiedEndLineNumber?new ym(e.modifiedStartLineNumber+1,e.modifiedStartLineNumber+1):new ym(e.modifiedStartLineNumber,e.modifiedEndLineNumber+1);let n=new L2(t,i,e.charChanges?.map((e=>new D2(new Yu(e.originalStartLineNumber,e.originalStartColumn,e.originalEndLineNumber,e.originalEndColumn),new Yu(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn)))));s&&(s.modified.endLineNumberExclusive!==n.modified.startLineNumber&&s.original.endLineNumberExclusive!==n.original.startLineNumber||(n=new L2(s.original.join(n.original),s.modified.join(n.modified),s.innerChanges&&n.innerChanges?s.innerChanges.concat(n.innerChanges):void 0),o.pop())),o.push(n),s=n}return rt((()=>at(o,((e,t)=>t.original.startLineNumber-e.original.endLineNumberExclusive==t.modified.startLineNumber-e.modified.endLineNumberExclusive&&e.original.endLineNumberExclusive<t.original.startLineNumber&&e.modified.endLineNumberExclusive<t.modified.startLineNumber)))),new c4(o,[],n.quitEarly)}}function Xee(e,t,i,n){return new OQ(e,t,i).ComputeDiff(n)}class Jee{constructor(e){const t=[],i=[];for(let n=0,o=e.length;n<o;n++)t[n]=ote(e[n],1),i[n]=ste(e[n],1);this.lines=e,this._startColumns=t,this._endColumns=i}getElements(){const e=[];for(let t=0,i=this.lines.length;t<i;t++)e[t]=this.lines[t].substring(this._startColumns[t]-1,this._endColumns[t]-1);return e}getStrictElement(e){return this.lines[e]}getStartLineNumber(e){return e+1}getEndLineNumber(e){return e+1}createCharSequence(e,t,i){const n=[],o=[],s=[];let r=0;for(let a=t;a<=i;a++){const t=this.lines[a],l=e?this._startColumns[a]:1,d=e?this._endColumns[a]:t.length+1;for(let e=l;e<d;e++)n[r]=t.charCodeAt(e-1),o[r]=a+1,s[r]=e,r++;!e&&a<i&&(n[r]=10,o[r]=a+1,s[r]=t.length+1,r++)}return new ete(n,o,s)}}class ete{constructor(e,t,i){this._charCodes=e,this._lineNumbers=t,this._columns=i}toString(){return"["+this._charCodes.map(((e,t)=>(10===e?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`)).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return-1===e?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),10===this._charCodes[e]?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return-1===e?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),10===this._charCodes[e]?1:this._columns[e]+1)}}class tte{constructor(e,t,i,n,o,s,r,a){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=n,this.modifiedStartLineNumber=o,this.modifiedStartColumn=s,this.modifiedEndLineNumber=r,this.modifiedEndColumn=a}static createFromDiffChange(e,t,i){const n=t.getStartLineNumber(e.originalStart),o=t.getStartColumn(e.originalStart),s=t.getEndLineNumber(e.originalStart+e.originalLength-1),r=t.getEndColumn(e.originalStart+e.originalLength-1),a=i.getStartLineNumber(e.modifiedStart),l=i.getStartColumn(e.modifiedStart),d=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),h=i.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new tte(n,o,s,r,a,l,d,h)}}class ite{constructor(e,t,i,n,o){this.originalStartLineNumber=e,this.originalEndLineNumber=t,this.modifiedStartLineNumber=i,this.modifiedEndLineNumber=n,this.charChanges=o}static createFromDiffResult(e,t,i,n,o,s,r){let a,l,d,h,c;if(0===t.originalLength?(a=i.getStartLineNumber(t.originalStart)-1,l=0):(a=i.getStartLineNumber(t.originalStart),l=i.getEndLineNumber(t.originalStart+t.originalLength-1)),0===t.modifiedLength?(d=n.getStartLineNumber(t.modifiedStart)-1,h=0):(d=n.getStartLineNumber(t.modifiedStart),h=n.getEndLineNumber(t.modifiedStart+t.modifiedLength-1)),s&&t.originalLength>0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const s=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),a=n.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(s.getElements().length>0&&a.getElements().length>0){let e=Xee(s,a,o,!0).changes;r&&(e=function(e){if(e.length<=1)return e;const t=[e[0]];let i=t[0];for(let n=1,o=e.length;n<o;n++){const o=e[n],s=o.originalStart-(i.originalStart+i.originalLength),r=o.modifiedStart-(i.modifiedStart+i.modifiedLength);Math.min(s,r)<3?(i.originalLength=o.originalStart+o.originalLength-i.originalStart,i.modifiedLength=o.modifiedStart+o.modifiedLength-i.modifiedStart):(t.push(o),i=o)}return t}(e)),c=[];for(let t=0,i=e.length;t<i;t++)c.push(tte.createFromDiffChange(e[t],s,a))}}return new ite(a,l,d,h,c)}}class nte{constructor(e,t,i){this.shouldComputeCharChanges=i.shouldComputeCharChanges,this.shouldPostProcessCharChanges=i.shouldPostProcessCharChanges,this.shouldIgnoreTrimWhitespace=i.shouldIgnoreTrimWhitespace,this.shouldMakePrettyDiff=i.shouldMakePrettyDiff,this.originalLines=e,this.modifiedLines=t,this.original=new Jee(e),this.modified=new Jee(t),this.continueLineDiff=rte(i.maxComputationTime),this.continueCharDiff=rte(0===i.maxComputationTime?0:Math.min(i.maxComputationTime,5e3))}computeDiff(){if(1===this.original.lines.length&&0===this.original.lines[0].length)return 1===this.modified.lines.length&&0===this.modified.lines[0].length?{quitEarly:!1,changes:[]}:{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:1,modifiedStartLineNumber:1,modifiedEndLineNumber:this.modified.lines.length,charChanges:void 0}]};if(1===this.modified.lines.length&&0===this.modified.lines[0].length)return{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:this.original.lines.length,modifiedStartLineNumber:1,modifiedEndLineNumber:1,charChanges:void 0}]};const e=Xee(this.original,this.modified,this.continueLineDiff,this.shouldMakePrettyDiff),t=e.changes,i=e.quitEarly;if(this.shouldIgnoreTrimWhitespace){const e=[];for(let i=0,n=t.length;i<n;i++)e.push(ite.createFromDiffResult(this.shouldIgnoreTrimWhitespace,t[i],this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges));return{quitEarly:i,changes:e}}const n=[];let o=0,s=0;for(let e=-1,i=t.length;e<i;e++){const r=e+1<i?t[e+1]:null,a=r?r.originalStart:this.originalLines.length,l=r?r.modifiedStart:this.modifiedLines.length;for(;o<a&&s<l;){const e=this.originalLines[o],t=this.modifiedLines[s];if(e!==t){{let i=ote(e,1),r=ote(t,1);for(;i>1&&r>1&&e.charCodeAt(i-2)===t.charCodeAt(r-2);)i--,r--;(i>1||r>1)&&this._pushTrimWhitespaceCharChange(n,o+1,1,i,s+1,1,r)}{let i=ste(e,1),r=ste(t,1);const a=e.length+1,l=t.length+1;for(;i<a&&r<l&&e.charCodeAt(i-1)===e.charCodeAt(r-1);)i++,r++;(i<a||r<l)&&this._pushTrimWhitespaceCharChange(n,o+1,i,a,s+1,r,l)}}o++,s++}r&&(n.push(ite.createFromDiffResult(this.shouldIgnoreTrimWhitespace,r,this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges)),o+=r.originalLength,s+=r.modifiedLength)}return{quitEarly:i,changes:n}}_pushTrimWhitespaceCharChange(e,t,i,n,o,s,r){if(this._mergeTrimWhitespaceCharChange(e,t,i,n,o,s,r))return;let a;this.shouldComputeCharChanges&&(a=[new tte(t,i,t,n,o,s,o,r)]),e.push(new ite(t,t,o,o,a))}_mergeTrimWhitespaceCharChange(e,t,i,n,o,s,r){const a=e.length;if(0===a)return!1;const l=e[a-1];return 0!==l.originalEndLineNumber&&0!==l.modifiedEndLineNumber&&(l.originalEndLineNumber===t&&l.modifiedEndLineNumber===o?(this.shouldComputeCharChanges&&l.charChanges&&l.charChanges.push(new tte(t,i,t,n,o,s,o,r)),!0):l.originalEndLineNumber+1===t&&l.modifiedEndLineNumber+1===o&&(l.originalEndLineNumber=t,l.modifiedEndLineNumber=o,this.shouldComputeCharChanges&&l.charChanges&&l.charChanges.push(new tte(t,i,t,n,o,s,o,r)),!0))}}function ote(e,t){const i=$i(e);return-1===i?t:i+1}function ste(e,t){const i=Zi(e);return-1===i?t:i+2}function rte(e){if(0===e)return()=>!0;const t=Date.now();return()=>Date.now()-t<e}const ate=()=>new W4;var lte,dte,hte,cte;!function(e){e.create=function(e,t){return e.isInlineEdit?_te.create(e,t):mte.create(e,t)}}(lte||(lte={}));class ute{constructor(e,t,i){this._data=e,this.identity=t,this.displayLocation=i}get source(){return this._data.source}get isFromExplicitRequest(){return this._data.context.triggerKind===FS.Explicit}get forwardStable(){return this.source.inlineSuggestions.enableForwardStability??!1}get editRange(){return this.getSingleTextEdit().range}get targetRange(){return this.displayLocation?.range??this.editRange}get insertText(){return this.getSingleTextEdit().text}get semanticId(){return this.hash}get action(){return this._sourceInlineCompletion.action}get command(){return this._sourceInlineCompletion.command}get warning(){return this._sourceInlineCompletion.warning}get showInlineEditMenu(){return!!this._sourceInlineCompletion.showInlineEditMenu}get hash(){return JSON.stringify([this.getSingleTextEdit().text,this.getSingleTextEdit().range.getStartPosition().toString()])}get requestUuid(){return this._data.context.requestUuid}get partialAccepts(){return this._data.partialAccepts}get _sourceInlineCompletion(){return this._data.sourceInlineCompletion}addRef(){this.identity.addRef(),this.source.addRef()}removeRef(){this.identity.removeRef(),this.source.removeRef()}reportInlineEditShown(e,t,i){this._data.reportInlineEditShown(e,this.insertText,t,i)}reportPartialAccept(e,t,i){this._data.reportPartialAccept(e,t,i)}reportEndOfLife(e){this._data.reportEndOfLife(e)}setEndOfLifeReason(e){this._data.setEndOfLifeReason(e)}reportInlineEditError(e){this._data.reportInlineEditError(e)}setIsPreceeded(e){this._data.setIsPreceeded(e.partialAccepts)}setNotShownReasonIfNotSet(e){this._data.setNotShownReason(e)}getSourceCompletion(){return this._sourceInlineCompletion}}class gte{constructor(){this._onDispose=Lr(this),this._refCount=1,this.id="InlineCompletionIdentity"+gte.idCounter++}static{this.idCounter=0}addRef(){this._refCount++}removeRef(){this._refCount--,0===this._refCount&&this._onDispose.trigger(void 0)}}class pte{static create(e){return new pte(e.range,e.label,e.kind)}constructor(e,t,i){this.range=e,this.label=t,this.kind=i}withEdit(e,t){const i=EU([new cm(t.getOffset(this.range.getStartPosition()),t.getOffset(this.range.getEndPosition()))],e)[0];if(!i)return;const n=t.getRange(i);return new pte(n,this.label,this.kind)}}class mte extends ute{static create(e,t){const i=new gte,n=kee(t),o=e.insertText.replace(/\r\n|\r|\n/g,t.getEOL()),s=function(e,t){const i=t.getEOL();return e.replaceRange.isEmpty&&e.newText.includes(i)&&(e=bte(e,t)),e}(new DU(n.getOffsetRange(e.range),o),t),r=s.removeCommonSuffixAndPrefix(t.getValue()),a=n.getTextReplacement(s),l=e.displayLocation?pte.create(e.displayLocation):void 0;return new mte(s,r,a,a.range,e.snippetInfo,e.additionalTextEdits,e,i,l)}constructor(e,t,i,n,o,s,r,a,l){super(r,a,l),this._edit=e,this._trimmedEdit=t,this._textEdit=i,this._originalRange=n,this.snippetInfo=o,this.additionalTextEdits=s,this.isInlineEdit=!1}get hash(){return JSON.stringify(this._trimmedEdit.toJson())}getSingleTextEdit(){return this._textEdit}withIdentity(e){return new mte(this._edit,this._trimmedEdit,this._textEdit,this._originalRange,this.snippetInfo,this.additionalTextEdits,this._data,e,this.displayLocation)}withEdit(e,t){const i=EU([this._edit.replaceRange],e);if(0===i.length)return;const n=new DU(i[0],this._textEdit.text),o=kee(t),s=o.getTextReplacement(n);let r=this.displayLocation;if(r&&(r=r.withEdit(e,o),!r))return;const a=n.removeCommonSuffixAndPrefix(t.getValue());return new mte(n,a,s,this._originalRange,this.snippetInfo,this.additionalTextEdits,this._data,this.identity,r)}canBeReused(e,t){const i=this._textEdit.range;return!!i&&i.containsPosition(t)&&this.isVisible(e,t)&&xm.ofRange(i).isGreaterThanOrEqualTo(xm.ofRange(this._originalRange))}isVisible(e,t){return fte(this.getSingleTextEdit(),this._originalRange,e,t)}}function fte(e,t,i,n){const o=Hee(e,i),s=e.range;if(!s||t&&!t.getStartPosition().equals(s.getStartPosition())||n.lineNumber!==o.range.startLineNumber||o.isEmpty)return!1;const r=i.getValueInRange(o.range,1),a=o.text,l=Math.max(0,n.column-o.range.startColumn);let d=a.substring(0,l),h=a.substring(l),c=r.substring(0,l),u=r.substring(l);const g=i.getLineIndentColumn(o.range.startLineNumber);return o.range.startColumn<=g&&(c=c.trimStart(),0===c.length&&(u=u.trimStart()),d=d.trimStart(),0===d.length&&(h=h.trimStart())),d.startsWith(c)&&!!yd(u,h)}class _te extends ute{static create(e,t){const i=function(e,t,i){const n=e.getEOL(),o=e.getValueInRange(t),s=i.replace(/\r\n|\r|\n/g,n),r=ate().computeDiff(qi(o),qi(s),{ignoreTrimWhitespace:!1,computeMoves:!1,extendToSubwords:!0,maxComputationTimeMs:500}).changes.flatMap((e=>e.innerChanges??[]));const a=new OU(s),l=new LU(r.map((i=>{const n=function(e,t){const i=xm.fromPosition(t.getStartPosition());return xm.ofRange(t).createRange(i.addToPosition(e))}(t.getStartPosition(),i.originalRange),o=kee(e).getOffsetRange(n),s=a.getValueOfRange(i.modifiedRange);return function(e,t,i,n){const o=n.getEOL();if(e.newText.endsWith(o)&&t.endsWith(o)&&(e=new DU(e.replaceRange.deltaEnd(-o.length),e.newText.slice(0,-o.length))),1===i&&e.replaceRange.isEmpty&&e.newText.includes(o)){const t=n.getPositionAt(e.replaceRange.start);0!==n.getLineLength(t.lineNumber)&&(e=bte(e,n))}if(1===i){const i=rn(t,e.newText),n=an(t.slice(i),e.newText.slice(i));if(i+n===t.length)return new DU(e.replaceRange.deltaStart(i).deltaEnd(-n),e.newText.substring(i,e.newText.length-n));if(i+n===e.newText.length)return new DU(e.replaceRange.deltaStart(i).deltaEnd(-n),"")}return e}(new DU(o,s),e.getValueInRange(n),r.length,e)})));return l}(t,e.range,e.insertText),n=new m5(t),o=PU.fromStringEdit(i,n).toReplacement(n),s=new gte,r=i.replacements.map((e=>{const i=Yu.fromPositions(t.getPositionAt(e.replaceRange.start),t.getPositionAt(e.replaceRange.endExclusive)),n=t.getValueInRange(i);return vte.create(e,n)})),a=e.displayLocation?pte.create(e.displayLocation):void 0;return new _te(i,o,e,s,r,a,!1,t.getVersionId())}constructor(e,t,i,n,o,s,r=!1,a){super(i,n,s),this._edit=e,this._textEdit=t,this._edits=o,this._lastChangePartOfInlineEdit=r,this._inlineEditModelVersion=a,this.snippetInfo=void 0,this.additionalTextEdits=[],this.isInlineEdit=!0}get updatedEditModelVersion(){return this._inlineEditModelVersion}get updatedEdit(){return this._edit}getSingleTextEdit(){return this._textEdit}withIdentity(e){return new _te(this._edit,this._textEdit,this._data,e,this._edits,this.displayLocation,this._lastChangePartOfInlineEdit,this._inlineEditModelVersion)}canBeReused(e,t){return this._lastChangePartOfInlineEdit&&this.updatedEditModelVersion===e.getVersionId()}withEdit(e,t){return this._applyTextModelChanges(e,this._edits,t)}_applyTextModelChanges(e,t,i){if((t=t.map((t=>t.applyTextModelChanges(e)))).some((e=>void 0===e.edit)))return;const n=i.getVersionId();let o=this._inlineEditModelVersion;const s=t.some((e=>e.lastChangeUpdatedEdit));if(s&&(o=n??-1),null===n||o+20<n)return;if(0===(t=t.filter((e=>!e.edit.isEmpty))).length)return;const r=new LU(t.map((e=>e.edit))),a=kee(i),l=a.getTextEdit(r).toReplacement(new m5(i));let d=this.displayLocation;return!d||(d=d.withEdit(e,a),d)?new _te(r,l,this._data,this.identity,t,d,s,o):void 0}}class vte{static create(e,t){const i=rn(e.newText,t),n=an(e.newText,t),o=e.newText.substring(i,e.newText.length-n);return new vte(e,o,i,n)}get edit(){return this._edit}get lastChangeUpdatedEdit(){return this._lastChangeUpdatedEdit}constructor(e,t,i,n,o=!1){this._edit=e,this._trimmedNewText=t,this._prefixLength=i,this._suffixLength=n,this._lastChangeUpdatedEdit=o}applyTextModelChanges(e){const t=this._clone();return t._applyTextModelChanges(e),t}_clone(){return new vte(this._edit,this._trimmedNewText,this._prefixLength,this._suffixLength,this._lastChangeUpdatedEdit)}_applyTextModelChanges(e){if(this._lastChangeUpdatedEdit=!1,!this._edit)throw new Ve("UpdatedInnerEdits: No edit to apply changes to");const t=this._applyChanges(this._edit,e);t?(this._edit=t.edit,this._lastChangeUpdatedEdit=t.editHasChanged):this._edit=void 0}_applyChanges(e,t){let i=e.replaceRange.start,n=e.replaceRange.endExclusive,o=e.newText,s=!1;const r=this._prefixLength>0||this._suffixLength>0;for(let a=t.replacements.length-1;a>=0;a--){const l=t.replacements[a],d=l.newText.length>0&&l.replaceRange.isEmpty;if(d&&!r&&l.replaceRange.start===i&&o.startsWith(l.newText))i+=l.newText.length,o=o.substring(l.newText.length),n=Math.max(i,n),s=!0;else if(d&&r&&l.replaceRange.start===i+this._prefixLength&&this._trimmedNewText.startsWith(l.newText))n+=l.newText.length,s=!0,this._prefixLength+=l.newText.length,this._trimmedNewText=this._trimmedNewText.substring(l.newText.length);else if(0===l.newText.length&&l.replaceRange.length>0&&l.replaceRange.start>=i+this._prefixLength&&l.replaceRange.endExclusive<=n-this._suffixLength)n-=l.replaceRange.length,s=!0;else if(l.equals(e))s=!0,i=l.replaceRange.endExclusive,o="";else if(!(l.replaceRange.start>n)){if(!(l.replaceRange.endExclusive<i))return;i+=l.newText.length-l.replaceRange.length,n+=l.newText.length-l.replaceRange.length}}return 0===this._trimmedNewText.length&&i+this._prefixLength===n-this._suffixLength?{edit:new DU(new cm(i+this._prefixLength,i+this._prefixLength),""),editHasChanged:!0}:{edit:new DU(new cm(i,n),o),editHasChanged:s}}}function bte(e,t){if(!e.replaceRange.isEmpty)throw new Ve("Unexpected original range");if(0===e.replaceRange.start)return e;const i=t.getEOL(),n=t.getPositionAt(e.replaceRange.start),o=n.column,s=n.lineNumber;return 1===o&&s>1&&e.newText.endsWith(i)&&!e.newText.startsWith(i)?new DU(e.replaceRange.delta(-1),i+e.newText.slice(0,-i.length)):e}class wte{constructor(e){this.lines=e,this.tokenization={getLineTokens:e=>this.lines[e-1]}}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}class Cte{constructor(){this._nodes=new Set,this._outgoingEdges=new Map}static from(e,t){const i=new Cte;for(const t of e)i._nodes.add(t);for(const n of e){const e=t(n);if(e.length>0){const t=new Set;for(const i of e)t.add(i);i._outgoingEdges.set(n,t)}}return i}removeCycles(){const e=[],t=new Set,i=new Set,n=[],o=s=>{t.add(s),i.add(s);const r=this._outgoingEdges.get(s);if(r)for(const a of r)t.has(a)?i.has(a)&&(e.push(a),n.push({from:s,to:a})):o(a);i.delete(s)};for(const e of this._nodes)t.has(e)||o(e);for(const{from:e,to:t}of n){const i=this._outgoingEdges.get(e);i&&i.delete(t)}return{foundCycles:e}}getOutgoing(e){const t=this._outgoingEdges.get(e);return t?Array.from(t):[]}}function yte(e,t){if(e.isCancellationRequested)return t(),At.None;{const i=e.onCancellationRequested((()=>{i.dispose(),t()}));return{dispose:()=>i.dispose()}}}function Ste(e,t,i,n,o,s,r,a){let l,d,h=e.range?Yu.lift(e.range):i;if("string"==typeof e.insertText){if(l=e.insertText,o&&e.completeBracketPairs){l=Lte(l,h.getStartPosition(),n,o);const t=l.length-e.insertText.length;0!==t&&(h=new Yu(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn+t))}d=void 0}else if("snippet"in e.insertText){const t=e.insertText.snippet.length;if(o&&e.completeBracketPairs){e.insertText.snippet=Lte(e.insertText.snippet,h.getStartPosition(),n,o);const i=e.insertText.snippet.length-t;0!==i&&(h=new Yu(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn+i))}const i=(new GT).parse(e.insertText.snippet);1===i.children.length&&i.children[0]instanceof WT?(l=i.children[0].value,d=void 0):(l=i.toString(),d={snippet:e.insertText.snippet,range:h})}else nt(e.insertText);const c=e.displayLocation?{range:Yu.lift(e.displayLocation.range),label:e.displayLocation.label,kind:e.displayLocation.kind}:void 0;return new xte(h,l,d,c,e.additionalTextEdits||Dee,e,t,s,e.isInlineEdit??!1,r,a,e.correlationId)}!function(e){e.Jump="jump",e.Accept="accept",e.Inactive="inactive"}(dte||(dte={})),function(e){e.GhostText="ghostText",e.Custom="custom",e.SideBySide="sideBySide",e.Deletion="deletion",e.InsertionInline="insertionInline",e.InsertionMultiLine="insertionMultiLine",e.WordReplacements="wordReplacements",e.LineReplacement="lineReplacement",e.Collapsed="collapsed"}(hte||(hte={}));class xte{constructor(e,t,i,n,o,s,r,a,l,d,h,c){this.range=e,this.insertText=t,this.snippetInfo=i,this.displayLocation=n,this.additionalTextEdits=o,this.sourceInlineCompletion=s,this.source=r,this.context=a,this.isInlineEdit=l,this._requestInfo=d,this._providerRequestInfo=h,this._correlationId=c,this._didShow=!1,this._timeUntilShown=void 0,this._showStartTime=void 0,this._shownDuration=0,this._showUncollapsedStartTime=void 0,this._showUncollapsedDuration=0,this._notShownReason=void 0,this._didReportEndOfLife=!1,this._lastSetEndOfLifeReason=void 0,this._isPreceeded=!1,this._partiallyAcceptedCount=0,this._partiallyAcceptedSinceOriginal={characters:0,ratio:0,count:0},this._viewData={editorType:d.editorType}}get showInlineEditMenu(){return this.sourceInlineCompletion.showInlineEditMenu??!1}get partialAccepts(){return this._partiallyAcceptedSinceOriginal}async reportInlineEditShown(e,t,i,n){if(this.updateShownDuration(i),this._didShow)return;this._didShow=!0,this._viewData.viewKind=i,this._viewData.renderData=n,this._timeUntilShown=Date.now()-this._requestInfo.startTime;const o=new RC(n.lineCountModified,n.lineCountOriginal,n.characterCountModified,n.characterCountOriginal);this.source.provider.handleItemDidShow?.(this.source.inlineSuggestions,this.sourceInlineCompletion,t,o),this.sourceInlineCompletion.shownCommand&&await e.executeCommand(this.sourceInlineCompletion.shownCommand.id,...this.sourceInlineCompletion.shownCommand.arguments||[])}reportPartialAccept(e,t,i){this._partiallyAcceptedCount++,this._partiallyAcceptedSinceOriginal.characters+=i.characters,this._partiallyAcceptedSinceOriginal.ratio=Math.min(this._partiallyAcceptedSinceOriginal.ratio+(1-this._partiallyAcceptedSinceOriginal.ratio)*i.ratio,1),this._partiallyAcceptedSinceOriginal.count+=i.count,this.source.provider.handlePartialAccept?.(this.source.inlineSuggestions,this.sourceInlineCompletion,e,t)}reportEndOfLife(e){if(!this._didReportEndOfLife&&(this._didReportEndOfLife=!0,this.reportInlineEditHidden(),e||(e=this._lastSetEndOfLifeReason??{kind:WS.Ignored,userTypingDisagreed:!1,supersededBy:void 0}),e.kind===WS.Rejected&&this.source.provider.handleRejection&&this.source.provider.handleRejection(this.source.inlineSuggestions,this.sourceInlineCompletion),this.source.provider.handleEndOfLifetime)){const t={requestUuid:this.context.requestUuid,correlationId:this._correlationId,selectedSuggestionInfo:!!this.context.selectedSuggestionInfo,partiallyAccepted:this._partiallyAcceptedCount,partiallyAcceptedCountSinceOriginal:this._partiallyAcceptedSinceOriginal.count,partiallyAcceptedRatioSinceOriginal:this._partiallyAcceptedSinceOriginal.ratio,partiallyAcceptedCharactersSinceOriginal:this._partiallyAcceptedSinceOriginal.characters,shown:this._didShow,shownDuration:this._shownDuration,shownDurationUncollapsed:this._showUncollapsedDuration,preceeded:this._isPreceeded,timeUntilShown:this._timeUntilShown,timeUntilProviderRequest:this._providerRequestInfo.startTime-this._requestInfo.startTime,timeUntilProviderResponse:this._providerRequestInfo.endTime-this._requestInfo.startTime,editorType:this._viewData.editorType,languageId:this._requestInfo.languageId,requestReason:this._requestInfo.reason,viewKind:this._viewData.viewKind,notShownReason:this._notShownReason,error:this._viewData.error,typingInterval:this._requestInfo.typingInterval,typingIntervalCharacterCount:this._requestInfo.typingIntervalCharacterCount,availableProviders:this._requestInfo.availableProviders.map((e=>e.toString())).join(","),...this._viewData.renderData};this.source.provider.handleEndOfLifetime(this.source.inlineSuggestions,this.sourceInlineCompletion,e,t)}}reportInlineEditError(e){this._viewData.error?this._viewData.error+=`; ${e}`:this._viewData.error=e}setIsPreceeded(e){this._isPreceeded=!0,0===this._partiallyAcceptedSinceOriginal.characters&&0===this._partiallyAcceptedSinceOriginal.ratio&&0===this._partiallyAcceptedSinceOriginal.count||console.warn("Expected partiallyAcceptedCountSinceOriginal to be { characters: 0, rate: 0, partialAcceptances: 0 } before setIsPreceeded."),this._partiallyAcceptedSinceOriginal=e}setNotShownReason(e){this._notShownReason??=e}setEndOfLifeReason(e){this.reportInlineEditHidden(),this._lastSetEndOfLifeReason=e}updateShownDuration(e){const t=Date.now();this._showStartTime||(this._showStartTime=t);const i=e===hte.Collapsed;i||void 0!==this._showUncollapsedStartTime||(this._showUncollapsedStartTime=t),i&&void 0!==this._showUncollapsedStartTime&&(this._showUncollapsedDuration+=t-this._showUncollapsedStartTime)}reportInlineEditHidden(){if(void 0===this._showStartTime)return;const e=Date.now();this._shownDuration+=e-this._showStartTime,this._showStartTime=void 0,void 0!==this._showUncollapsedStartTime&&(this._showUncollapsedDuration+=e-this._showUncollapsedStartTime,this._showUncollapsedStartTime=void 0)}}!function(e){e.TextEditor="textEditor",e.DiffEditor="diffEditor",e.Notebook="notebook"}(cte||(cte={}));class kte{constructor(e,t,i){this.inlineSuggestions=e,this.inlineSuggestionsData=t,this.provider=i,this.refCount=0}addRef(){this.refCount++}removeRef(e={kind:"other"}){if(this.refCount--,0===this.refCount){for(const e of this.inlineSuggestionsData)e.reportEndOfLife();this.provider.disposeInlineCompletions(this.inlineSuggestions,e)}}}function Lte(e,t,i,n){const o=i.getLineContent(t.lineNumber),s=DU.replace(new cm(t.column-1,o.length),e),r=i.tokenization.tokenizeLinesAt(t.lineNumber,[s.replace(o)]),a=r?.[0].sliceZeroCopy(s.getRangeAfterReplace());if(!a)return e;const l=function(e,t){const i=new Km,n=new hf(i,(e=>t.getLanguageConfiguration(e))),o=_f(new rf(new wte([e]),n),[],void 0,!0);let s="";const r=e.getLineContent();return function e(t,i){if(2===t.kind)if(e(t.openingBracket,i),i=Nm(i,t.openingBracket.length),t.child&&(e(t.child,i),i=Nm(i,t.child.length)),t.closingBracket)e(t.closingBracket,i),i=Nm(i,t.closingBracket.length);else{const e=n.getSingleLanguageBracketTokens(t.openingBracket.languageId).findClosingTokenText(t.openingBracket.bracketIds);s+=e}else if(3===t.kind);else if(0===t.kind||1===t.kind)s+=r.substring(i,Nm(i,t.length));else if(4===t.kind)for(const n of t.children)e(n,i),i=Nm(i,n.length)}(o,0),s}(a,n);return l}var Dte,Ete=function(e,t){return function(i,n){t(i,n,e)}};let Nte=class extends At{static{Dte=this}static{this._requestId=0}constructor(e,t,i,n,o,s,r,a){super(),this._textModel=e,this._versionId=t,this._debounceValue=i,this._cursorPosition=n,this._languageConfigurationService=o,this._logService=s,this._configurationService=r,this._instantiationService=a,this._updateOperation=this._register(new Rt),this._state=function(e,t){let i,n=!1;const o=new gr(new $o(e,void 0,t.update),((e,o)=>{n||(i=t.initial instanceof Function?t.initial():t.initial,n=!0);const s=t.update(e,i,o);return i=s,s}),t.changeTracker,(()=>{n&&(t.disposeFinal?.(i),n=!1)}),t.equalityComparer??Ns,((e,t,s)=>{if(!n)throw new Ve("Can only set when there is a listener! This is to prevent leaks.");zs(t,(t=>{i=e,o.setValue(e,t,s)}))}),Ks.ofCaller());return o}(this,{initial:()=>({inlineCompletions:Ate.createEmpty(),suggestWidgetInlineCompletions:Ate.createEmpty()}),disposeFinal:e=>{e.inlineCompletions.dispose(),e.suggestWidgetInlineCompletions.dispose()},changeTracker:Rr((()=>({versionId:this._versionId}))),update:(e,t,i)=>{const n=LU.compose(i.changes.map((e=>e.change?function(e){const t=e.map((e=>new DU(cm.ofStartAndLength(e.rangeOffset,e.rangeLength),e.text)));return t.reverse(),new LU(t)}(e.change.changes):LU.empty)).filter(mt));if(n.isEmpty())return t;try{return{inlineCompletions:t.inlineCompletions.createStateWithAppliedEdit(n,this._textModel),suggestWidgetInlineCompletions:t.suggestWidgetInlineCompletions.createStateWithAppliedEdit(n,this._textModel)}}finally{t.inlineCompletions.dispose(),t.suggestWidgetInlineCompletions.dispose()}}}),this.inlineCompletions=this._state.map(this,(e=>e.inlineCompletions)),this.suggestWidgetInlineCompletions=this._state.map(this,(e=>e.suggestWidgetInlineCompletions)),this.clearOperationOnTextModelChange=pr(this,(e=>{this._versionId.read(e),this._updateOperation.clear()})),this._loadingCount=Js(this,0),this._loggingEnabled=a2("editor.inlineSuggest.logFetch",!1,this._configurationService).recomputeInitiallyAndOnChange(this._store),this._sendRequestData=a2("editor.inlineSuggest.emptyResponseInformation",!0,this._configurationService).recomputeInitiallyAndOnChange(this._store),this._structuredFetchLogger=this._register(this._instantiationService.createInstance(iee.cast(),"editor.inlineSuggest.logFetch.commandId")),this.clearOperationOnTextModelChange.recomputeInitiallyAndOnChange(this._store)}_log(e){this._loggingEnabled.get()&&this._logService.info(function(e){return e.sourceId+" @@ "+JSON.stringify({...e,modelUri:e.modelUri?.toString(),sourceId:void 0})}(e)),this._structuredFetchLogger.log(e)}fetch(e,t,i,n,o,s,r){const a=this._cursorPosition.get(),l=new Ite(a,i,this._textModel.getVersionId(),new Set(e)),d=i.selectedSuggestionInfo?this.suggestWidgetInlineCompletions.get():this.inlineCompletions.get();if(this._updateOperation.value?.request.satisfies(l))return this._updateOperation.value.promise;if(d?.request?.satisfies(l))return Promise.resolve(!0);const h=!!this._updateOperation.value;this._updateOperation.clear();const c=new ri,u=(async()=>{this._loadingCount.set(this._loadingCount.get()+1,void 0);const a=new Mt,d=e.filter((e=>e.providerId)),u=new Tte(i,r,d);try{const d=this._debounceValue.get(this._textModel),p=bm(e.map((e=>e.debounceDelayMs)),(g=ys,(e,t)=>void 0===e?void 0===t?ws.neitherLessOrGreaterThan:ws.lessThan:void 0===t?ws.greaterThan:g(e,t)))??d;if((h||o&&i.triggerKind===FS.Automatic)&&await Iee(p,c.token),c.token.isCancellationRequested||this._store.isDisposed||this._textModel.getVersionId()!==l.versionId)return u.setNoSuggestionReasonIfNotSet("canceled:beforeFetch"),!1;const m=Dte._requestId++;(this._loggingEnabled.get()||this._structuredFetchLogger.isEnabled.get())&&this._log({sourceId:"InlineCompletions.fetch",kind:"start",requestId:m,modelUri:this._textModel.uri,modelVersion:this._textModel.getVersionId(),context:{triggerKind:i.triggerKind,suggestInfo:!!i.selectedSuggestionInfo||void 0},time:Date.now(),provider:t});const f=new Date,_=function(e,t,i,n,o,s){const r=vC("icr"),a=new ri;let l;const d={...n,requestUuid:r},h=function(e,t){const i=t.getWordAtPosition(e),n=t.getLineMaxColumn(e.lineNumber);return i?new Yu(e.lineNumber,i.startColumn,e.lineNumber,n):Yu.fromPositions(e,e.with(void 0,n))}(t,i),c=function(e,t){const i=new Map;for(const n of e){const e=t(n);let o=i.get(e);o||(o=[],i.set(e,o)),o.push(n)}return i}(e,(e=>e.groupId)),u=Cte.from(e,(e=>e.yieldsToGroupIds?.flatMap((e=>c.get(e)??[]))??[])),{foundCycles:g}=u.removeCycles();g.length>0&&Te(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${g.map((e=>e.toString?e.toString():""+e)).join(" -> ")}`));let p=0;const m=new Ri((async e=>{try{if(p++,a.token.isCancellationRequested)return;const n=u.getOutgoing(e);for(const e of n){const n=await m.get(e);if(n)for(const e of n.inlineSuggestions.items){if(e.isInlineEdit||"string"!=typeof e.insertText)return;if(fte(new FU(Yu.lift(e.range)??h,e.insertText),void 0,i,t))return}}let r;const c=Date.now();try{r=await e.provideInlineCompletions(i,t,d,a.token)}catch(e){return void Te(e)}const g=Date.now();if(!r)return;const f=[],_=new kte(r,f,e);if(_.addRef(),yte(a.token,(()=>_.removeRef(l))),a.token.isCancellationRequested)return;for(const e of r.items)f.push(Ste(e,_,h,i,s,d,o,{startTime:c,endTime:g}));return _}finally{p--}})),f=Ii.fromPromisesResolveOrder(e.map((e=>m.get(e)))).filter(mt);return{contextWithUuid:d,get didAllProvidersReturn(){return 0===p},lists:f,cancelAndDispose:e=>{void 0===l&&(l=e,a.dispose(!0))}}}(e,this._cursorPosition.get(),this._textModel,i,r,this._languageConfigurationService);yte(c.token,(()=>_.cancelAndDispose({kind:"tokenCancellation"})));let v=!1,b=!1;const w=[];for await(const e of _.lists)if(e){e.addRef(),a.add(Tt((()=>e.removeRef(0===e.inlineSuggestionsData.length?{kind:"empty"}:{kind:"notTaken"}))));for(const t of e.inlineSuggestionsData){if(b=!0,!i.includeInlineEdits&&(t.isInlineEdit||t.showInlineEditMenu)){t.setNotShownReason("notInlineEditRequested");continue}if(!i.includeInlineCompletions&&!t.isInlineEdit&&!t.showInlineEditMenu){t.setNotShownReason("notInlineCompletionRequested");continue}const e=lte.create(t,this._textModel);w.push(e),e.isInlineEdit||e.showInlineEditMenu||i.triggerKind!==FS.Automatic||e.isVisible(this._textModel,this._cursorPosition.get())&&(v=!0)}if(v)break}if(_.cancelAndDispose({kind:"lostRace"}),this._loggingEnabled.get()||this._structuredFetchLogger.isEnabled.get()){const e=_.didAllProvidersReturn;let t;(c.token.isCancellationRequested||this._store.isDisposed||this._textModel.getVersionId()!==l.versionId)&&(t="canceled");const i=w.map((e=>({range:e.editRange.toString(),text:e.insertText,isInlineEdit:!!e.isInlineEdit,source:e.source.provider.groupId})));this._log({sourceId:"InlineCompletions.fetch",kind:"end",requestId:m,durationMs:Date.now()-f.getTime(),error:t,result:i,time:Date.now(),didAllProvidersReturn:e})}u.setRequestUuid(_.contextWithUuid.requestUuid),b?(u.setHasProducedSuggestion(),w.length>0&&c.token.isCancellationRequested&&w.forEach((e=>e.setNotShownReasonIfNotSet("canceled:whileAwaitingOtherProviders")))):c.token.isCancellationRequested?u.setNoSuggestionReasonIfNotSet("canceled:whileFetching"):u.setNoSuggestionReasonIfNotSet("noSuggestion");const C=i.earliestShownDateTime-Date.now();if(C>0&&await Iee(C,c.token),c.token.isCancellationRequested||this._store.isDisposed||this._textModel.getVersionId()!==l.versionId||s.get()){const e=c.token.isCancellationRequested?"canceled:afterMinShowDelay":this._store.isDisposed?"canceled:disposed":this._textModel.getVersionId()!==l.versionId?"canceled:documentChanged":s.get()?"canceled:userJumped":"unknown";return w.forEach((t=>t.setNotShownReasonIfNotSet(e))),!1}const y=new Date;this._debounceValue.update(this._textModel,y.getTime()-f.getTime());const S=this._cursorPosition.get();this._updateOperation.clear(),Vs((e=>{const t=this._state.get();i.selectedSuggestionInfo?this._state.set({inlineCompletions:Ate.createEmpty(),suggestWidgetInlineCompletions:t.suggestWidgetInlineCompletions.createStateWithAppliedResults(w,l,this._textModel,S,n)},e):this._state.set({inlineCompletions:t.inlineCompletions.createStateWithAppliedResults(w,l,this._textModel,S,n),suggestWidgetInlineCompletions:Ate.createEmpty()},e),t.inlineCompletions.dispose(),t.suggestWidgetInlineCompletions.dispose()}))}finally{this._loadingCount.set(this._loadingCount.get()-1,void 0),a.dispose(),this.sendInlineCompletionsRequestTelemetry(u)}var g;return!0})(),g=new Mte(l,c,u);return this._updateOperation.value=g,u}clear(e){this._updateOperation.clear();const t=this._state.get();this._state.set({inlineCompletions:Ate.createEmpty(),suggestWidgetInlineCompletions:Ate.createEmpty()},e),t.inlineCompletions.dispose(),t.suggestWidgetInlineCompletions.dispose()}seedInlineCompletionsWithSuggestWidget(){const e=this.inlineCompletions.get(),t=this.suggestWidgetInlineCompletions.get();t&&Vs((i=>{if(!e||(t.request?.versionId??-1)>(e.request?.versionId??-1)){e?.dispose();const n=this._state.get();this._state.set({inlineCompletions:t.clone(),suggestWidgetInlineCompletions:Ate.createEmpty()},i),n.inlineCompletions.dispose(),n.suggestWidgetInlineCompletions.dispose()}this.clearSuggestWidgetInlineCompletions(i)}))}sendInlineCompletionsRequestTelemetry(e){if(!this._sendRequestData.get())return;if(void 0===e.requestUuid||e.hasProducedSuggestion)return;const t={id:e.requestUuid,opportunityId:e.requestUuid,noSuggestionReason:e.noSuggestionReason??"unknown",extensionId:"vscode-core",extensionVersion:"0.0.0",groupId:"empty",shown:!1,editorType:e.requestInfo.editorType,requestReason:e.requestInfo.reason,typingInterval:e.requestInfo.typingInterval,typingIntervalCharacterCount:e.requestInfo.typingIntervalCharacterCount,languageId:e.requestInfo.languageId,selectedSuggestionInfo:!!e.context.selectedSuggestionInfo,availableProviders:e.providers.map((e=>e.providerId?.toString())).filter(mt).join(","),...(i=e.providers.some((e=>function(e){if(!e)return!1;const t=e.toLowerCase();return"github.copilot"===t||"github.copilot-chat"===t}(e.providerId?.extensionId))),{[Yee]:i}),timeUntilProviderRequest:void 0,timeUntilProviderResponse:void 0,viewKind:void 0,preceeded:void 0,error:void 0,superseded:void 0,reason:void 0,correlationId:void 0,shownDuration:void 0,shownDurationUncollapsed:void 0,timeUntilShown:void 0,partiallyAccepted:void 0,partiallyAcceptedCountSinceOriginal:void 0,partiallyAcceptedRatioSinceOriginal:void 0,partiallyAcceptedCharactersSinceOriginal:void 0,cursorColumnDistance:void 0,cursorLineDistance:void 0,lineCountOriginal:void 0,lineCountModified:void 0,characterCountOriginal:void 0,characterCountModified:void 0,disjointReplacements:void 0,sameShapeReplacements:void 0,notShownReason:void 0};var i,n,o;n=this._instantiationService.createInstance(Zee),o=t,n.publicLog2("inlineCompletion.endOfLife",o)}clearSuggestWidgetInlineCompletions(e){this._updateOperation.value?.request.context.selectedSuggestionInfo&&this._updateOperation.clear()}cancelUpdate(){this._updateOperation.clear()}};Nte=Dte=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Ete(4,Qp),Ete(5,yu),Ete(6,up),Ete(7,nc)],Nte);class Ite{constructor(e,t,i,n){this.position=e,this.context=t,this.versionId=i,this.providers=n}satisfies(e){return this.position.equals(e.position)&&Ts(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,((e,t)=>e.equals(t)))&&(e.context.triggerKind===FS.Automatic||this.context.triggerKind===FS.Explicit)&&this.versionId===e.versionId&&(t=e.providers,i=this.providers,[...t].every((e=>i.has(e))));var t,i}}class Tte{constructor(e,t,i){this.context=e,this.requestInfo=t,this.providers=i,this.hasProducedSuggestion=!1}setRequestUuid(e){this.requestUuid=e}setNoSuggestionReasonIfNotSet(e){this.noSuggestionReason??=e}setHasProducedSuggestion(){this.hasProducedSuggestion=!0}}class Mte{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class Ate extends At{static createEmpty(){return new Ate([],void 0)}constructor(e,t){for(const t of e)t.addRef();super(),this.inlineCompletions=e,this.request=t,this._register({dispose:()=>{for(const e of this.inlineCompletions)e.removeRef()}})}_findById(e){return this.inlineCompletions.find((t=>t.identity===e))}_findByHash(e){return this.inlineCompletions.find((t=>t.hash===e))}createStateWithAppliedEdit(e,t){const i=this.inlineCompletions.map((i=>i.withEdit(e,t))).filter(mt);return new Ate(i,this.request)}createStateWithAppliedResults(e,t,i,n,o){let s;if(o){const n=this._findById(o);if(n&&n.canBeReused(i,t.position)){s=n;const t=e.find((e=>e.hash===n.hash));e=t?function(e,t){const i=t.indexOf(e);return i>-1?[e,...t.slice(0,i),...t.slice(i+1)]:t}(t,e):[n,...e]}}const r=s?!s.isInlineEdit:e.some((e=>!e.isInlineEdit&&e.isVisible(i,n)));let a=[];for(const t of e){const e=this._findByHash(t.hash);let i;e&&e!==t?(i=t.withIdentity(e.identity),t.setIsPreceeded(e),e.setEndOfLifeReason({kind:WS.Ignored,userTypingDisagreed:!1,supersededBy:t.getSourceCompletion()})):i=t,r!==i.isInlineEdit&&a.push(i)}return a.sort(Cs((e=>e.showInlineEditMenu),Ss)),a=function(e){const t=new Set;return e.filter((e=>{const i=(e=>e.semanticId)(e);return!t.has(i)&&(t.add(i),!0)}))}(a),new Ate(a,t)}clone(){return new Ate(this.inlineCompletions,this.request)}}class Rte{constructor(e,t,i){this.edit=e,this.commands=t,this.inlineCompletion=i}equals(e){return this.edit.equals(e.edit)&&this.inlineCompletion===e.inlineCompletion}}var Ote=function(e,t){return function(i,n){t(i,n,e)}};const Pte=oc("IInlineCompletionsService"),Fte=new Jc("inlineCompletions.snoozed",!1,y(76,"Whether inline completions are currently snoozed"));let Bte=class extends At{get snoozeTimeLeft(){return void 0===this._snoozeTimeEnd?0:Math.max(0,this._snoozeTimeEnd-Date.now())}constructor(e,t){super(),this._contextKeyService=e,this._telemetryService=t,this._onDidChangeIsSnoozing=this._register(new Zt),this.onDidChangeIsSnoozing=this._onDidChangeIsSnoozing.event,this._snoozeTimeEnd=void 0,this._recentCompletionIds=[],this._timer=this._register(new ya);const i=Fte.bindTo(this._contextKeyService);this._register(this.onDidChangeIsSnoozing((()=>i.set(this.isSnoozing()))))}setSnoozeDuration(e){if(e<0)throw new Ve(`Invalid snooze duration: ${e}. Duration must be non-negative.`);if(0===e)return void this.cancelSnooze();const t=this.isSnoozing(),i=this.snoozeTimeLeft;this._snoozeTimeEnd=Date.now()+e,t||this._onDidChangeIsSnoozing.fire(!0),this._timer.cancelAndSet((()=>{if(this.isSnoozing())throw new Ve("Snooze timer did not fire as expected");this._onDidChangeIsSnoozing.fire(!1)}),this.snoozeTimeLeft+1),this._reportSnooze(e-i,e)}isSnoozing(){return this.snoozeTimeLeft>0}cancelSnooze(){this.isSnoozing()&&(this._reportSnooze(-this.snoozeTimeLeft,0),this._snoozeTimeEnd=void 0,this._timer.cancel(),this._onDidChangeIsSnoozing.fire(!1))}reportNewCompletion(e){this._lastCompletionId=e,this._recentCompletionIds.unshift(e),this._recentCompletionIds.length>5&&this._recentCompletionIds.pop()}_reportSnooze(e,t){const i=Math.round(e/1e3),n=Math.round(t/1e3);this._telemetryService.publicLog2("inlineCompletions.snooze",{deltaSeconds:i,totalSeconds:n,lastCompletionId:this._lastCompletionId,recentCompletionIds:this._recentCompletionIds})}};Bte=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Ote(0,eu),Ote(1,Cu)],Bte),wp(Pte,Bte,1);const Wte="inlineCompletions.lastSnoozeDuration";class Vte extends bu{static{this.ID="editor.action.inlineSuggest.snooze"}constructor(){super({id:Vte.ID,title:x(78,"Snooze Inline Suggestions"),precondition:Ac.true(),f1:!0})}async run(e,...t){const i=e.get(LD),n=e.get(Pte),o=e.get(Sq);let s;t.length>0&&"number"==typeof t[0]&&(s=t[0]),s||(s=await this.getDurationFromUser(i,o)),s&&n.setSnoozeDuration(s)}async getDurationFromUser(e,t){const i=t.getNumber(Wte,0,3e5),n=[{label:"1 minute",id:"1",value:6e4},{label:"5 minutes",id:"5",value:3e5},{label:"10 minutes",id:"10",value:6e5},{label:"15 minutes",id:"15",value:9e5},{label:"30 minutes",id:"30",value:18e5},{label:"60 minutes",id:"60",value:36e5}],o=await e.pick(n,{placeHolder:y(77,"Select snooze duration for Code completions and NES"),activeItem:n.find((e=>e.value===i))});if(o)return t.store(Wte,o.value,0,0),o.value}}class Hte extends bu{static{this.ID="editor.action.inlineSuggest.cancelSnooze"}constructor(){super({id:Hte.ID,title:x(79,"Cancel Snooze Inline Suggestions"),precondition:Fte,f1:!0})}async run(e){e.get(Pte).cancelSnooze()}}class zte extends At{static{this.MAX_SESSION_GAP_MS=3e3}static{this.MIN_SESSION_DURATION_MS=1e3}static{this.SESSION_HISTORY_LIMIT=50}static{this.TYPING_SPEED_WINDOW_MS=3e5}static{this.MIN_CHARS_FOR_RELIABLE_SPEED=20}getTypingInterval(){return(this._cacheInvalidated||null===this._cachedTypingIntervalResult)&&(this._cachedTypingIntervalResult=this._calculateTypingInterval(),this._cacheInvalidated=!1),this._cachedTypingIntervalResult}constructor(e){super(),this._textModel=e,this._typingSessions=[],this._currentSession=null,this._lastChangeTime=0,this._cachedTypingIntervalResult=null,this._cacheInvalidated=!0,this._register(this._textModel.onDidChangeContent((e=>this._updateTypingSpeed(e))))}_updateTypingSpeed(e){const t=Date.now();this._isUserTyping(e)?(this._currentSession&&t-this._lastChangeTime>zte.MAX_SESSION_GAP_MS&&this._finalizeCurrentSession(),this._currentSession||(this._currentSession={startTime:t,endTime:t,characterCount:0}),this._currentSession.endTime=t,this._currentSession.characterCount+=this._getActualCharacterCount(e),this._lastChangeTime=t,this._cacheInvalidated=!0):this._finalizeCurrentSession()}_getActualCharacterCount(e){let t=0;for(const i of e.changes)t+=Math.max(i.text.length,i.rangeLength);return t}_isUserTyping(e){if(!e.detailedReasons||0===e.detailedReasons.length)return!1;for(const t of e.detailedReasons)if(this._isUserTypingReason(t))return!0;return!1}_isUserTypingReason(e){if(e.metadata.isUndoing||e.metadata.isRedoing)return!1;if("cursor"===e.metadata.source){const t=e.metadata.kind;return"type"===t||"compositionType"===t||"compositionEnd"===t}return!1}_finalizeCurrentSession(){this._currentSession&&(this._currentSession.endTime-this._currentSession.startTime>=zte.MIN_SESSION_DURATION_MS&&this._currentSession.characterCount>0&&(this._typingSessions.push(this._currentSession),this._typingSessions.length>zte.SESSION_HISTORY_LIMIT&&this._typingSessions.shift()),this._currentSession=null)}_calculateTypingInterval(){if(this._currentSession){const e={...this._currentSession};if(e.endTime-e.startTime>=zte.MIN_SESSION_DURATION_MS&&e.characterCount>0){const t=[...this._typingSessions,e];return this._calculateSpeedFromSessions(t)}}return this._calculateSpeedFromSessions(this._typingSessions)}_calculateSpeedFromSessions(e){if(0===e.length)return{averageInterval:0,characterCount:0};const t=[...e].sort(((e,t)=>t.endTime-e.endTime)),i=Date.now()-zte.TYPING_SPEED_WINDOW_MS,n=t.filter((e=>e.endTime>i)),o=t.splice(n.length);let s=Es(n.map((e=>e.characterCount)));for(let e=0;e<o.length&&s<zte.MIN_CHARS_FOR_RELIABLE_SPEED;e++)n.push(o[e]),s+=o[e].characterCount;const r=Es(n.map((e=>e.endTime-e.startTime)));if(0===r||s<=1)return{averageInterval:0,characterCount:s};const a=r/Math.max(1,s-1);return{averageInterval:Math.round(a),characterCount:s}}dispose(){this._finalizeCurrentSession(),super.dispose()}}var Ute=function(e,t){return function(i,n){t(i,n,e)}};let Kte=class extends At{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,n,o,s,r,a,l,d,h,c,u,g){super(),this.textModel=e,this._selectedSuggestItem=t,this._textModelVersionId=i,this._positions=n,this._debounceValue=o,this._enabled=s,this._editor=r,this._instantiationService=a,this._commandService=l,this._languageConfigurationService=d,this._accessibilityService=h,this._languageFeaturesService=c,this._codeEditorService=u,this._inlineCompletionsService=g,this._isActive=Js(this,!1),this._onlyRequestInlineEditsSignal=Lr(this),this._forceUpdateExplicitlySignal=Lr(this),this._noDelaySignal=Lr(this),this._fetchSpecificProviderSignal=Lr(this),this._selectedInlineCompletionId=Js(this,void 0),this.primaryPosition=pr(this,(e=>this._positions.read(e)[0]??new rc(1,1))),this._isAcceptingPartially=!1,this._appearedInsideViewport=pr(this,(e=>{const t=this.state.read(e);if(!t||!t.inlineCompletion)return!1;const i=t.inlineCompletion.targetRange,n=this._editorObs.editor.getVisibleRanges();return!(n.length<1)&&new Yu(n[0].startLineNumber,n[0].startColumn,n[n.length-1].endLineNumber,n[n.length-1].endColumn).containsRange(i)})),this._onDidAccept=new Zt,this.onDidAccept=this._onDidAccept.event,this._lastShownInlineCompletionInfo=void 0,this._lastAcceptedInlineCompletionInfo=void 0,this._didUndoInlineEdits=_r({owner:this,changeTracker:{createChangeSummary:()=>({didUndo:!1}),handleChange:(e,t)=>(t.didUndo=e.didChange(this._textModelVersionId)&&!!e.change?.isUndoing,!0)}},((e,t)=>{const i=this._textModelVersionId.read(e);return!!(null!==i&&this._lastAcceptedInlineCompletionInfo&&this._lastAcceptedInlineCompletionInfo.textModelVersionIdAfter===i-1&&this._lastAcceptedInlineCompletionInfo.inlineCompletion.isInlineEdit&&t.didUndo)&&(this._lastAcceptedInlineCompletionInfo=void 0,!0)})),this._preserveCurrentCompletionReasons=new Set([jte.Redo,jte.Undo,jte.AcceptWord]),this.dontRefetchSignal=Lr(this),this._fetchInlineCompletionsPromise=_r({owner:this,changeTracker:{createChangeSummary:()=>({dontRefetch:!1,preserveCurrentCompletion:!1,inlineCompletionTriggerKind:FS.Automatic,onlyRequestInlineEdits:!1,shouldDebounce:!0,provider:void 0,textChange:!1,changeReason:""}),handleChange:(e,t)=>{if(e.didChange(this._textModelVersionId)){this._preserveCurrentCompletionReasons.has(this._getReason(e.change))&&(t.preserveCurrentCompletion=!0);const i=e.change?.detailedReasons??[];t.changeReason=i.length>0?i[0].getType():"",t.textChange=!0}else e.didChange(this._forceUpdateExplicitlySignal)?(t.preserveCurrentCompletion=!0,t.inlineCompletionTriggerKind=FS.Explicit):e.didChange(this.dontRefetchSignal)?t.dontRefetch=!0:e.didChange(this._onlyRequestInlineEditsSignal)?t.onlyRequestInlineEdits=!0:e.didChange(this._fetchSpecificProviderSignal)&&(t.provider=e.change);return!0}}},((e,t)=>{if(this._source.clearOperationOnTextModelChange.read(e),this._noDelaySignal.read(e),this.dontRefetchSignal.read(e),this._onlyRequestInlineEditsSignal.read(e),this._forceUpdateExplicitlySignal.read(e),this._fetchSpecificProviderSignal.read(e),!(this._enabled.read(e)&&this._selectedSuggestItem.read(e)||this._isActive.read(e))||this._inlineCompletionsService.isSnoozing()&&t.inlineCompletionTriggerKind!==FS.Explicit)return void this._source.cancelUpdate();this._textModelVersionId.read(e);const i=this._source.suggestWidgetInlineCompletions.read(void 0);let n=this._selectedSuggestItem.read(e);if(this._shouldShowOnSuggestConflict.read(void 0)&&(n=void 0),i&&!n&&this._source.seedInlineCompletionsWithSuggestWidget(),t.dontRefetch)return Promise.resolve(!0);if(this._didUndoInlineEdits.read(e)&&t.inlineCompletionTriggerKind!==FS.Explicit)return void Vs((e=>{this._source.clear(e)}));let o="";t.provider?o+="providerOnDidChange":t.inlineCompletionTriggerKind===FS.Explicit&&(o+="explicit"),t.changeReason&&(o+=o.length>0?`:${t.changeReason}`:t.changeReason);const s=this._typing.getTypingInterval(),r={editorType:this.editorType,startTime:Date.now(),languageId:this.textModel.getLanguageId(),reason:o,typingInterval:s.averageInterval,typingIntervalCharacterCount:s.characterCount,availableProviders:[]};let a={triggerKind:t.inlineCompletionTriggerKind,selectedSuggestionInfo:n?.toSelectedSuggestionInfo(),includeInlineCompletions:!t.onlyRequestInlineEdits,includeInlineEdits:this._inlineEditsEnabled.read(e),requestIssuedDateTime:r.startTime,earliestShownDateTime:r.startTime+(t.inlineCompletionTriggerKind===FS.Explicit||this.inAcceptFlow.read(void 0)?0:this._minShowDelay.read(void 0))};a.triggerKind===FS.Automatic&&t.textChange&&this.textModel.getAlternativeVersionId()===this._lastShownInlineCompletionInfo?.alternateTextModelVersionId&&(a={...a,includeInlineCompletions:!this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit,includeInlineEdits:this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit});const l=this.selectedInlineCompletion.read(void 0)??this._inlineCompletionItems.read(void 0)?.inlineEdit,d=t.preserveCurrentCompletion||l?.forwardStable?l:void 0,h=this._jumpedToId.map((e=>!!e&&e===this._inlineCompletionItems.read(void 0)?.inlineEdit?.semanticId)),c=t.provider?{providers:[t.provider],label:"single:"+t.provider.providerId?.toString()}:{providers:this._languageFeaturesService.inlineCompletionsProvider.all(this.textModel),label:void 0},u=this.getAvailableProviders(c.providers);return r.availableProviders=u.map((e=>e.providerId)).filter(mt),this._source.fetch(u,c.label,a,d?.identity,t.shouldDebounce,h,r)})),this._inlineCompletionItems=fr({owner:this},(e=>{const t=this._source.inlineCompletions.read(e);if(!t)return;const i=this.primaryPosition.read(e);let n;const o=[];for(const e of t.inlineCompletions)e.isInlineEdit?n=e:e.isVisible(this.textModel,i)&&o.push(e);return 0!==o.length&&(n=void 0),{inlineCompletions:o,inlineEdit:n}})),this._filteredInlineCompletionItems=fr({owner:this,equalsFn:Is()},(e=>{const t=this._inlineCompletionItems.read(e);return t?.inlineCompletions??[]})),this.selectedInlineCompletionIndex=pr(this,(e=>{const t=this._selectedInlineCompletionId.read(e),i=this._filteredInlineCompletionItems.read(e),n=void 0===this._selectedInlineCompletionId?-1:i.findIndex((e=>e.semanticId===t));return-1===n?(this._selectedInlineCompletionId.set(void 0,void 0),0):n})),this.selectedInlineCompletion=pr(this,(e=>this._filteredInlineCompletionItems.read(e)[this.selectedInlineCompletionIndex.read(e)])),this.activeCommands=fr({owner:this,equalsFn:Is()},(e=>this.selectedInlineCompletion.read(e)?.source.inlineSuggestions.commands??[])),this.inlineCompletionsCount=pr(this,(e=>this.lastTriggerKind.read(e)===FS.Explicit?this._filteredInlineCompletionItems.read(e).length:void 0)),this._hasVisiblePeekWidgets=pr(this,(e=>this._editorObs.openedPeekWidgets.read(e)>0)),this._shouldShowOnSuggestConflict=pr(this,(e=>{const t=this._showOnSuggestConflict.read(e);if("never"!==t&&this.selectedInlineCompletion.read(e)){const i=this._selectedSuggestItem.read(e);return!!i&&("whenSuggestListIsIncomplete"!==t||i.listIncomplete)}return!1})),this.state=fr({owner:this,equalsFn:(e,t)=>e&&t?"ghostText"===e.kind&&"ghostText"===t.kind?Wee(e.ghostTexts,t.ghostTexts)&&e.inlineCompletion===t.inlineCompletion&&e.suggestItem===t.suggestItem:"inlineEdit"===e.kind&&"inlineEdit"===t.kind&&e.inlineEdit.equals(t.inlineEdit):e===t},(e=>{const t=this.textModel;if(this._suppressInSnippetMode.read(e)&&this._isInSnippetMode.read(e))return;const i=this._inlineCompletionItems.read(e),n=i?.inlineEdit;if(n){if(this._hasVisiblePeekWidgets.read(e))return;let o=n.getSingleTextEdit();o=Hee(o,t);const s=this.primaryPosition.map((e=>ym.fromRangeInclusive(n.targetRange).addMargin(1,1).contains(e.lineNumber))),r=n.source.inlineSuggestions.commands,a=new Rte(o,r??[],n),l=n.updatedEdit,d=l?PU.fromStringEdit(l,new m5(this.textModel)).replacements:[o],h="vscode.open"!==i.inlineEdit?.command?.id&&"_workbench.open"!==i.inlineEdit?.command?.id||!i.inlineEdit?.command.arguments?.length?void 0:uo.from(i.inlineEdit?.command.arguments[0]);return{kind:"inlineEdit",inlineEdit:a,inlineCompletion:n,edits:d,cursorAtInlineEdit:s,nextEditUri:h}}const o=this._selectedSuggestItem.read(e);if(!this._shouldShowOnSuggestConflict.read(e)&&o){const i=Hee(o.getSingleTextEdit(),t),n=this._computeAugmentation(i,e);if(!this._suggestPreviewEnabled.read(e)&&!n)return;const s=n?.edit??i,r=n?n.edit.text.length-i.text.length:0,a=this._suggestPreviewMode.read(e),l=this._positions.read(e),d=[s,...qte(this.textModel,l,s)].map(((e,i)=>({edit:e,ghostText:e?Uee(e,t,a,l[i],r):void 0}))).filter((({edit:e,ghostText:t})=>void 0!==e&&void 0!==t)),h=d.map((({edit:e})=>e)),c=d.map((({ghostText:e})=>e));return{kind:"ghostText",edits:h,primaryGhostText:c[0]??new Pee(s.range.endLineNumber,[]),ghostTexts:c,inlineCompletion:n?.completion,suggestItem:o}}{if(!this._isActive.read(e))return;const i=this.selectedInlineCompletion.read(e);if(!i)return;const n=i.getSingleTextEdit(),o=this._inlineSuggestMode.read(e),s=this._positions.read(e),r=[n,...qte(this.textModel,s,n)].map(((e,i)=>({edit:e,ghostText:e?Uee(e,t,o,s[i],0):void 0}))).filter((({edit:e,ghostText:t})=>void 0!==e&&void 0!==t)),a=r.map((({edit:e})=>e)),l=r.map((({ghostText:e})=>e));if(!l[0])return;return{kind:"ghostText",edits:a,primaryGhostText:l[0],ghostTexts:l,inlineCompletion:i,suggestItem:void 0}}})),this.inlineCompletionState=pr(this,(e=>{const t=this.state.read(e);if(t&&"ghostText"===t.kind&&!this._editorObs.inComposition.read(e))return t})),this.inlineEditState=pr(this,(e=>{const t=this.state.read(e);if(t&&"inlineEdit"===t.kind)return t})),this.inlineEditAvailable=pr(this,(e=>!!this.inlineEditState.read(e))),this.warning=pr(this,(e=>this.inlineCompletionState.read(e)?.inlineCompletion?.warning)),this.ghostTexts=fr({owner:this,equalsFn:Wee},(e=>{const t=this.inlineCompletionState.read(e);if(t)return t.ghostTexts})),this.primaryGhostText=fr({owner:this,equalsFn:Vee},(e=>{const t=this.inlineCompletionState.read(e);if(t)return t?.primaryGhostText})),this.showCollapsed=pr(this,(e=>{const t=this.state.read(e);if(!t||"inlineEdit"!==t.kind)return!1;if(t.inlineCompletion.displayLocation)return!1;const i=t.inlineCompletion.updatedEditModelVersion===this._textModelVersionId.read(e);return(this._inlineEditsShowCollapsedEnabled.read(e)||!i)&&this._jumpedToId.read(e)!==t.inlineCompletion.semanticId&&!this._inAcceptFlow.read(e)})),this._tabShouldIndent=pr(this,(e=>{if(this._inAcceptFlow.read(e))return!1;const t=this._editorObs.selections.read(e);return t?.some((e=>e.isEmpty()?0===this.textModel.getLineLength(e.startLineNumber):function(e){return e.startLineNumber!==e.endLineNumber}(e)||e.containsRange(function(e,t){const i=e.getLineIndentColumn(t),n=e.getLineLastNonWhitespaceColumn(t),o=Math.max(n,i);return new Yu(t,i,t,o)}(this.textModel,e.startLineNumber))))})),this.tabShouldJumpToInlineEdit=pr(this,(e=>{if(this._tabShouldIndent.read(e))return!1;const t=this.inlineEditState.read(e);return!(!t||!this.showCollapsed.read(e)&&(this._inAcceptFlow.read(e)&&this._appearedInsideViewport.read(e)||t.cursorAtInlineEdit.read(e)))})),this.tabShouldAcceptInlineEdit=pr(this,(e=>{const t=this.inlineEditState.read(e);return!!t&&!this.showCollapsed.read(e)&&(!(!this._inAcceptFlow.read(e)||!this._appearedInsideViewport.read(e))||t.inlineCompletion.targetRange.startLineNumber===this._editorObs.cursorLineNumber.read(e)||this._jumpedToId.read(e)===t.inlineCompletion.semanticId||!this._tabShouldIndent.read(e)&&t.cursorAtInlineEdit.read(e))})),this._jumpedToId=Js(this,void 0),this._inAcceptFlow=Js(this,!1),this.inAcceptFlow=this._inAcceptFlow,this._source=this._register(this._instantiationService.createInstance(Nte,this.textModel,this._textModelVersionId,this._debounceValue,this.primaryPosition)),this.lastTriggerKind=this._source.inlineCompletions.map(this,(e=>e?.request?.context.triggerKind)),this._editorObs=bY(this._editor);const p=this._editorObs.getOption(134);this._suggestPreviewEnabled=p.map((e=>e.preview)),this._suggestPreviewMode=p.map((e=>e.previewMode));const m=this._editorObs.getOption(71);this._inlineSuggestMode=m.map((e=>e.mode)),this._suppressedInlineCompletionGroupIds=m.map((e=>new Set(e.experimental.suppressInlineSuggestions.split(",")))),this._inlineEditsEnabled=m.map((e=>!!e.edits.enabled)),this._inlineEditsShowCollapsedEnabled=m.map((e=>e.edits.showCollapsed)),this._triggerCommandOnProviderChange=m.map((e=>e.triggerCommandOnProviderChange)),this._minShowDelay=m.map((e=>e.minShowDelay)),this._showOnSuggestConflict=m.map((e=>e.experimental.showOnSuggestConflict)),this._suppressInSnippetMode=m.map((e=>e.suppressInSnippetMode));const f=See.get(this._editor);this._isInSnippetMode=f?.isInSnippetObservable??Or(!1),this._typing=this._register(new zte(this.textModel)),this._register(this._inlineCompletionsService.onDidChangeIsSnoozing((e=>{e&&this.stop()})));{const e="vscode-notebook-cell"===this.textModel.uri.scheme,[t]=this._codeEditorService.listDiffEditors().filter((e=>e.getOriginalEditor().getId()===this._editor.getId()||e.getModifiedEditor().getId()===this._editor.getId()));this.isInDiffEditor=!!t,this.editorType=e?cte.Notebook:this.isInDiffEditor?cte.DiffEditor:cte.TextEditor}this._register(Nr(this.state,(e=>{e&&e.inlineCompletion&&this._inlineCompletionsService.reportNewCompletion(e.inlineCompletion.requestUuid)}))),this._register(Nr(this._fetchInlineCompletionsPromise)),this._register(ar((e=>{this._editorObs.versionId.read(e),this._inAcceptFlow.set(!1,void 0)}))),this._register(ar((e=>{const t=this.state.map(((e,t)=>!e||"inlineEdit"===e.kind&&!e.cursorAtInlineEdit.read(t))).read(e);t&&this._jumpedToId.set(void 0,void 0)})));const _=this.inlineEditState.map((e=>e?.inlineCompletion.semanticId));this._register(ar((e=>{_.read(e)&&(this._editor.pushUndoStop(),this._lastShownInlineCompletionInfo={alternateTextModelVersionId:this.textModel.getAlternativeVersionId(),inlineCompletion:this.state.get().inlineCompletion})}))),Mr(this,Sr(this._languageFeaturesService.inlineCompletionsProvider.onDidChange,(()=>this._languageFeaturesService.inlineCompletionsProvider.all(e))),((e,t)=>{e.onDidChangeInlineCompletions&&t.add(e.onDidChangeInlineCompletions((()=>{if(!this._enabled.get())return;if((this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor())!==this._editor)return;if(this._triggerCommandOnProviderChange.get())return void this.trigger(void 0,{onlyFetchInlineEdits:!0});const t=this.state.get();t&&(t.inlineCompletion||t.edits)&&t.inlineCompletion?.source.provider!==e||Vs((t=>{this._fetchSpecificProviderSignal.trigger(t,e),this.trigger(t)}))})))})).recomputeInitiallyAndOnChange(this._store),this._didUndoInlineEdits.recomputeInitiallyAndOnChange(this._store)}getIndentationInfo(e){let t=!1,i=!0;const n=this?.primaryGhostText.read(e);if(this?._selectedSuggestItem&&n&&n.parts.length>0){const{column:e,lines:o}=n.parts[0],s=o[0].line;if(e<=this.textModel.getLineIndentColumn(n.lineNumber)){let e=$i(s);-1===e&&(e=s.length-1),t=e>0;const n=this.textModel.getOptions().tabSize;i=Eg.visibleColumnFromColumn(s,e+1,n)<n}}return{startsWithIndentation:t,startsWithIndentationLessThanTabSize:i}}_getReason(e){return e?.isUndoing?jte.Undo:e?.isRedoing?jte.Redo:this.isAcceptingPartially?jte.AcceptWord:jte.Other}getAvailableProviders(e){const t=this._suppressedInlineCompletionGroupIds.get(),i=e.filter((e=>!(e.groupId&&t.has(e.groupId)))),n=new Set;for(const e of i)e.excludesGroupIds?.forEach((e=>n.add(e)));const o=[];for(const e of i)e.groupId&&n.has(e.groupId)||o.push(e);return o}async trigger(e,t){zs(e,(e=>{t?.onlyFetchInlineEdits&&this._onlyRequestInlineEditsSignal.trigger(e),t?.noDelay&&this._noDelaySignal.trigger(e),this._isActive.set(!0,e)})),await this._fetchInlineCompletionsPromise.get()}async triggerExplicitly(e,t=!1){zs(e,(e=>{t&&this._onlyRequestInlineEditsSignal.trigger(e),this._isActive.set(!0,e),this._inAcceptFlow.set(!0,e),this._forceUpdateExplicitlySignal.trigger(e)})),await this._fetchInlineCompletionsPromise.get()}stop(e="automatic",t){zs(t,(t=>{if("explicitCancel"===e){const e=this.state.get()?.inlineCompletion;e&&e.reportEndOfLife({kind:WS.Rejected})}this._isActive.set(!1,t),this._source.clear(t)}))}_computeAugmentation(e,t){const i=this.textModel,n=this._source.suggestWidgetInlineCompletions.read(t),o=function(e,t){for(const i of e){const e=t(i);if(void 0!==e)return e}}(n?n.inlineCompletions.filter((e=>!e.isInlineEdit)):[this.selectedInlineCompletion.read(t)].filter(mt),(t=>{let n=t.getSingleTextEdit();return n=Hee(n,i,Yu.fromPositions(n.range.getStartPosition(),e.range.getEndPosition())),zee(n,e)?{completion:t,edit:n}:void 0}));return o}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)}async next(){await this._deltaSelectedInlineCompletionIndex(1)}async previous(){await this._deltaSelectedInlineCompletionIndex(-1)}_getMetadata(e,t,i=void 0){return i?kC({nes:e.isInlineEdit,requestUuid:e.requestUuid,providerId:e.source.provider.providerId,languageId:t,type:i}):xC({nes:e.isInlineEdit,requestUuid:e.requestUuid,providerId:e.source.provider.providerId,languageId:t})}async accept(e=this._editor){if(e.getModel()!==this.textModel)throw new Ve;let t,i=!1;const n=this.state.get();if("ghostText"===n?.kind){if(!n||n.primaryGhostText.isEmpty()||!n.inlineCompletion)return;t=n.inlineCompletion}else{if("inlineEdit"!==n?.kind)return;t=n.inlineCompletion,i=!!n.nextEditUri}t.addRef();try{if(e.pushUndoStop(),i);else if(t.snippetInfo){const i=FU.delete(t.editRange),n=t.additionalTextEdits.map((e=>new FU(Yu.lift(e.range),e.text??""))),o=PU.fromParallelReplacementsUnsorted([i,...n]);e.edit(o,this._getMetadata(t,this.textModel.getLanguageId())),e.setPosition(t.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),See.get(e)?.insert(t.snippetInfo.snippet,{undoStopBefore:!1})}else{const i=n.edits;let o=i;"ghostText"===n.kind&&(o=function(e,t){const i=kee(t),n=t.getValue(),o=e.map((e=>i.getStringReplacement(e)));return o.map((e=>e.removeCommonSuffixPrefix(n))).map((e=>i.getTextReplacement(e)))}(i,this.textModel));const s=Eee(o).map((e=>Qu.fromPositions(e))),r=t.additionalTextEdits.map((e=>new FU(Yu.lift(e.range),e.text??""))),a=PU.fromParallelReplacementsUnsorted([...i,...r]);if(e.edit(a,this._getMetadata(t,this.textModel.getLanguageId())),void 0===t.displayLocation&&e.setSelections("inlineEdit"===n.kind?s.slice(-1):s,"inlineCompletionAccept"),"inlineEdit"===n.kind&&!this._accessibilityService.isMotionReduced()){const t=a.getNewRanges(),i=this._store.add(new $te(e,t,(()=>{this._store.delete(i)})))}}this._onDidAccept.fire(),this.stop(),t.command&&await this._commandService.executeCommand(t.command.id,...t.command.arguments||[]).then(void 0,Te),t.reportEndOfLife({kind:WS.Accepted})}finally{t.removeRef(),this._inAcceptFlow.set(!0,void 0),this._lastAcceptedInlineCompletionInfo={textModelVersionIdAfter:this.textModel.getVersionId(),inlineCompletion:t}}}async acceptNextWord(){await this._acceptNext(this._editor,"word",((e,t)=>{const i=this.textModel.getLanguageIdAtPosition(e.lineNumber,e.column),n=this._languageConfigurationService.getLanguageConfiguration(i),o=new RegExp(n.wordDefinition.source,n.wordDefinition.flags.replace("g","")),s=t.match(o);let r=0;r=s&&void 0!==s.index?0===s.index?s[0].length:s.index:t.length;const a=/\s+/g.exec(t);return a&&void 0!==a.index&&a.index+a[0].length<r&&(r=a.index+a[0].length),r}),0)}async acceptNextLine(){await this._acceptNext(this._editor,"line",((e,t)=>{const i=t.match(/\n/);return i&&void 0!==i.index?i.index+1:t.length}),1)}async _acceptNext(e,t,i,n){if(e.getModel()!==this.textModel)throw new Ve;const o=this.inlineCompletionState.get();if(!o||o.primaryGhostText.isEmpty()||!o.inlineCompletion)return;const s=o.primaryGhostText,r=o.inlineCompletion;if(r.snippetInfo)return void await this.accept(e);const a=s.parts[0],l=new rc(s.lineNumber,a.column),d=a.text,h=i(l,d);if(h===d.length&&1===s.parts.length)return void this.accept(e);const c=d.substring(0,h),u=this._positions.get(),g=u[0];r.addRef();try{this._isAcceptingPartially=!0;try{e.pushUndoStop();const i=Yu.fromPositions(g,l),n=e.getModel().getValueInRange(i)+c,o=new FU(i,n),s=[o,...qte(this.textModel,u,o)].filter(mt),a=Eee(s).map((e=>Qu.fromPositions(e)));e.edit(PU.fromParallelReplacementsUnsorted(s),this._getMetadata(r,t)),e.setSelections(a,"inlineCompletionPartialAccept"),e.revealPositionInCenterIfOutsideViewport(e.getPosition(),1)}finally{this._isAcceptingPartially=!1}const i=Yu.fromPositions(r.editRange.getStartPosition(),xm.ofText(c).addToPosition(l)),o=e.getModel().getValueInRange(i,1).length;r.reportPartialAccept(o,{kind:n,acceptedLength:o},{characters:h,ratio:h/d.length,count:1})}finally{r.removeRef()}}handleSuggestAccepted(e){const t=Hee(e.getSingleTextEdit(),this.textModel),i=this._computeAugmentation(t,void 0);if(!i)return;const n=this.textModel.getValueInRange(i.completion.editRange,1).length+t.text.length;i.completion.reportPartialAccept(t.text.length,{kind:2,acceptedLength:n},{characters:t.text.length,count:1,ratio:1})}extractReproSample(){const e=this.textModel.getValue(),t=this.state.get()?.inlineCompletion;return{documentValue:e,inlineCompletion:t?.getSourceCompletion()}}jump(){const e=this.inlineEditState.get();e&&Vs((t=>{this._jumpedToId.set(e.inlineCompletion.semanticId,t),this.dontRefetchSignal.trigger(t);const i=e.inlineCompletion.targetRange,n=i.getStartPosition();if(this._editor.setPosition(n,"inlineCompletions.jump"),!i.isSingleLine()||!e.inlineCompletion.displayLocation&&e.inlineCompletion.insertText.includes("\n")){const e=new Yu(i.startLineNumber-1,1,i.endLineNumber+1,1);this._editor.revealRange(e,1)}else this._editor.revealPosition(n);this._editor.focus()}))}async handleInlineSuggestionShown(e,t,i){await e.reportInlineEditShown(this._commandService,t,i)}};var jte;function qte(e,t,i){if(1===t.length)return[];const n=new m5(e),o=n.getTransformer(),s=o.getOffset(t[0]),r=t.slice(1).map((e=>o.getOffset(e)));i=i.removeCommonPrefixAndSuffix(n);const a=o.getStringReplacement(i),l=a.replaceRange.start-s,d=a.replaceRange.join(cm.emptyAt(s)),h=n.getValueOfOffsetRange(d),c=r.map((e=>{const t=e+l,i=t+a.replaceRange.length,s=new cm(t,i),r=s.join(cm.emptyAt(e));if(n.getValueOfOffsetRange(r)!==h)return;const d=new DU(s,a.newText);return o.getTextReplacement(d)})).filter(mt);return c}Kte=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Ute(7,nc),Ute(8,mc),Ute(9,Qp),Ute(10,rB),Ute(11,BD),Ute(12,sc),Ute(13,Pte)],Kte),function(e){e[e.Undo=0]="Undo",e[e.Redo=1]="Redo",e[e.AcceptWord=2]="AcceptWord",e[e.Other=3]="Other"}(jte||(jte={}));class $te extends At{constructor(e,t,i){super(),i&&this._register({dispose:()=>i()}),this._register(bY(e).setDecorations(Or(t.map((e=>({range:e,options:{description:"animation",className:"edits-fadeout-decoration",zIndex:1}}))))));const n=new Tee(1,0,1e3,Aee),o=new Ree(n);this._register(ar((t=>{const i=o.getValue(t);e.getContainerDomNode().style.setProperty("--animation-opacity",i.toString()),n.isFinished()&&this.dispose()})))}}var Gte,Zte=function(e,t){return function(i,n){t(i,n,e)}};class Yte{constructor(e){this.name=e}select(e,t,i){if(0===i.length)return 0;const n=i[0].score[0];for(let e=0;e<i.length;e++){const{score:t,completion:o}=i[e];if(t[0]!==n)break;if(o.preselect)return e}return 0}}class Qte extends Yte{constructor(){super("first")}memorize(e,t,i){}toJSON(){}fromJSON(){}}class Xte extends Yte{constructor(){super("recentlyUsed"),this._cache=new ad(300,.66),this._seq=0}memorize(e,t,i){const n=`${e.getLanguageId()}/${i.textLabel}`;this._cache.set(n,{touch:this._seq++,type:i.completion.kind,insertText:i.completion.insertText})}select(e,t,i){if(0===i.length)return 0;const n=e.getLineContent(t.lineNumber).substr(t.column-10,t.column-1);if(/\s$/.test(n))return super.select(e,t,i);const o=i[0].score[0];let s=-1,r=-1;for(let t=0;t<i.length&&i[t].score[0]===o;t++){const n=`${e.getLanguageId()}/${i[t].textLabel}`,o=this._cache.peek(n);if(o&&o.touch>r&&o.type===i[t].completion.kind&&o.insertText===i[t].completion.insertText&&(r=o.touch,s=t),i[t].completion.preselect)return t}return-1!==s?s:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();for(const[t,i]of e)i.touch=0,i.type="number"==typeof i.type?i.type:PS.fromString(i.type),this._cache.set(t,i);this._seq=this._cache.size}}class Jte extends Yte{constructor(){super("recentlyUsedByPrefix"),this._trie=wT.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),o=`${e.getLanguageId()}/${n}`;this._trie.set(o,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:n}=e.getWordUntilPosition(t);if(!n)return super.select(e,t,i);const o=`${e.getLanguageId()}/${n}`;let s=this._trie.get(o);if(s||(s=this._trie.findSubstr(o)),s)for(let e=0;e<i.length;e++){const{kind:t,insertText:n}=i[e].completion;if(t===s.type&&n===s.insertText)return e}return super.select(e,t,i)}toJSON(){const e=[];return this._trie.forEach(((t,i)=>e.push([i,t]))),e.sort(((e,t)=>-(e[1].touch-t[1].touch))).forEach(((e,t)=>e[1].touch=t)),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type="number"==typeof i.type?i.type:PS.fromString(i.type),this._trie.set(t,i)}}}let eie=class{static{Gte=this}static{this._strategyCtors=new Map([["recentlyUsedByPrefix",Jte],["recentlyUsed",Xte],["first",Qte]])}static{this._storagePrefix="suggest/memories"}constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new Mt,this._persistSoon=new Ci((()=>this._saveState()),500),this._disposables.add(e.onWillSaveState((e=>{e.reason===xq.SHUTDOWN&&this._saveState()})))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(e,t){const i=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(this._strategy?.name!==i){this._saveState();const e=Gte._strategyCtors.get(i)||Qte;this._strategy=new e;try{const e=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,t=this._storageService.get(`${Gte._storagePrefix}/${i}`,e);t&&this._strategy.fromJSON(JSON.parse(t))}catch(e){}}return this._strategy}_saveState(){if(this._strategy){const e=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,t=JSON.stringify(this._strategy);this._storageService.store(`${Gte._storagePrefix}/${this._strategy.name}`,t,e,1)}}};eie=Gte=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Zte(0,Sq),Zte(1,up)],eie);const tie=oc("ISuggestMemories");wp(tie,eie,1);var iie;let nie=class{static{iie=this}static{this.AtEnd=new Jc("atEndOfWord",!1,{type:"boolean",description:y(1479,"A context key that is true when at the end of a word. Note that this is only defined when tab-completions are enabled")})}constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=iie.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration((e=>e.hasChanged(139)&&this._update())),this._update()}dispose(){this._configListener.dispose(),this._selectionListener?.dispose(),this._ckAtEnd.reset()}_update(){const e="on"===this._editor.getOption(139);if(this._enabled!==e)if(this._enabled=e,this._enabled){const e=()=>{if(!this._editor.hasModel())return void this._ckAtEnd.set(!1);const e=this._editor.getModel(),t=this._editor.getSelection(),i=e.getWordAtPosition(t.getStartPosition());i?this._ckAtEnd.set(i.endColumn===t.getStartPosition().column&&t.getStartPosition().lineNumber===t.getEndPosition().lineNumber):this._ckAtEnd.set(!1)};this._selectionListener=this._editor.onDidChangeCursorSelection(e),e()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};nie=iie=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,eu)],nie);var oie;let sie=class{static{oie=this}static{this.OtherSuggestions=new Jc("hasOtherSuggestions",!1)}constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=oie.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){this._ckOtherSuggestions.reset(),this._listener?.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},i){0!==e.items.length&&oie._moveIndex(!0,e,t)!==t?(this._acceptNext=i,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition((()=>{this._ignore||this.reset()})),this._ckOtherSuggestions.set(!0)):this.reset()}static _moveIndex(e,t,i){let n=i;for(let o=t.items.length;o>0&&(n=(n+t.items.length+(e?1:-1))%t.items.length,n!==i)&&t.items[n].completion.additionalTextEdits;o--);return n}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=oie._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};sie=oie=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,eu)],sie);class rie{constructor(e,t,i,n){this._disposables=new Mt,this._disposables.add(i.onDidSuggest((e=>{0===e.completionModel.items.length&&this.reset()}))),this._disposables.add(i.onDidCancel((e=>{this.reset()}))),this._disposables.add(t.onDidShow((()=>this._onItem(t.getFocusedItem())))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType((o=>{if(this._active&&!t.isFrozen()&&0!==i.state){const t=o.charCodeAt(o.length-1);this._active.acceptCharacters.has(t)&&e.getOption(0)&&n(this._active.item)}})))}_onItem(e){if(!e||!hs(e.item.completion.commitCharacters))return void this.reset();if(this._active&&this._active.item.item===e.item)return;const t=new Uy;for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}class aie{async provideSelectionRanges(e,t){const i=[];for(const n of t){const t=[];i.push(t);const o=new Map;await new Promise((t=>aie._bracketsRightYield(t,0,e,n,o))),await new Promise((i=>aie._bracketsLeftYield(i,0,e,n,o,t)))}return i}static{this._maxDuration=30}static{this._maxRounds=2}static _bracketsRightYield(e,t,i,n,o){const s=new Map,r=Date.now();for(;;){if(t>=aie._maxRounds){e();break}if(!n){e();break}const a=i.bracketPairs.findNextBracket(n);if(!a){e();break}if(Date.now()-r>aie._maxDuration){setTimeout((()=>aie._bracketsRightYield(e,t+1,i,n,o)));break}if(a.bracketInfo.isOpeningBracket){const e=a.bracketInfo.bracketText,t=s.has(e)?s.get(e):0;s.set(e,t+1)}else{const e=a.bracketInfo.getOpeningBrackets()[0].bracketText;let t=s.has(e)?s.get(e):0;if(t-=1,s.set(e,Math.max(0,t)),t<0){let t=o.get(e);t||(t=new Wt,o.set(e,t)),t.push(a.range)}}n=a.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,n,o,s){const r=new Map,a=Date.now();for(;;){if(t>=aie._maxRounds&&0===o.size){e();break}if(!n){e();break}const l=i.bracketPairs.findPrevBracket(n);if(!l){e();break}if(Date.now()-a>aie._maxDuration){setTimeout((()=>aie._bracketsLeftYield(e,t+1,i,n,o,s)));break}if(l.bracketInfo.isOpeningBracket){const e=l.bracketInfo.bracketText;let t=r.has(e)?r.get(e):0;if(t-=1,r.set(e,Math.max(0,t)),t<0){const t=o.get(e);if(t){const n=t.shift();0===t.size&&o.delete(e);const r=Yu.fromPositions(l.range.getEndPosition(),n.getStartPosition()),a=Yu.fromPositions(l.range.getStartPosition(),n.getEndPosition());s.push({range:r}),s.push({range:a}),aie._addBracketLeading(i,a,s)}}}else{const e=l.bracketInfo.getOpeningBrackets()[0].bracketText,t=r.has(e)?r.get(e):0;r.set(e,t+1)}n=l.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const n=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(n);0!==o&&o!==t.startColumn&&(i.push({range:Yu.fromPositions(new rc(n,o),t.getEndPosition())}),i.push({range:Yu.fromPositions(new rc(n,1),t.getEndPosition())}));const s=n-1;if(s>0){const n=e.getLineFirstNonWhitespaceColumn(s);n===t.startColumn&&n!==e.getLineLastNonWhitespaceColumn(s)&&(i.push({range:Yu.fromPositions(new rc(s,n),t.getEndPosition())}),i.push({range:Yu.fromPositions(new rc(s,1),t.getEndPosition())}))}}}class lie{static{this.None=new class extends lie{distance(){return 0}}}static async create(e,t){if(!t.getOption(134).localityBonus)return lie.None;if(!t.hasModel())return lie.None;const i=t.getModel(),n=t.getPosition();if(!e.canComputeWordRanges(i.uri))return lie.None;const[o]=await(new aie).provideSelectionRanges(i,[n]);if(0===o.length)return lie.None;const s=await e.computeWordRanges(i.uri,o[0].range);if(!s)return lie.None;const r=i.getWordUntilPosition(n);return delete s[r.word],new class extends lie{distance(e,i){if(!n.equals(t.getPosition()))return 0;if(17===i.kind)return 2<<20;const r="string"==typeof i.label?i.label:i.label.label,a=s[r];if(ds(a))return 2<<20;const l=ts(a,Yu.fromPositions(e),Yu.compareRangesUsingStarts),d=l>=0?a[l]:a[Math.max(0,~l-1)];let h=o.length;for(const e of o){if(!Yu.containsRange(e.range,d))break;h-=1}return h}}}}class die{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}}class hie{constructor(e,t,i,n,o,s,r=lh.default,a=void 0){this.clipboardText=a,this._snippetCompareFn=hie._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=n,this._options=o,this._refilterKind=1,this._lineContext=i,this._fuzzyScoreOptions=r,"top"===s?this._snippetCompareFn=hie._compareCompletionItemsSnippetsUp:"bottom"===s&&(this._snippetCompareFn=hie._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){this._lineContext.leadingLineContent===e.leadingLineContent&&this._lineContext.characterCountDelta===e.characterCountDelta||(this._refilterKind=this._lineContext.characterCountDelta<e.characterCountDelta&&this._filteredItems?2:1,this._lineContext=e)}get items(){return this._ensureCachedState(),this._filteredItems}getItemsByProvider(){return this._ensureCachedState(),this._itemsByProvider}getIncompleteProvider(){this._ensureCachedState();const e=new Set;for(const[t,i]of this.getItemsByProvider())i.length>0&&i[0].container.incomplete&&e.add(t);return e}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){0!==this._refilterKind&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let n="",o="";const s=1===this._refilterKind?this._items:this._filteredItems,r=[],a=!this._options.filterGraceful||s.length>2e3?dh:ch;for(let l=0;l<s.length;l++){const d=s[l];if(d.isInvalid)continue;const h=this._itemsByProvider.get(d.provider);h?h.push(d):this._itemsByProvider.set(d.provider,[d]);const c=d.position.column-d.editStart.column,u=c+i-(d.position.column-this._column);if(n.length!==u&&(n=0===u?"":t.slice(-u),o=n.toLowerCase()),d.word=n,0===u)d.score=ah.Default;else{let e=0;for(;e<c;){const t=n.charCodeAt(e);if(32!==t&&9!==t)break;e+=1}if(e>=u)d.score=ah.Default;else if("string"==typeof d.completion.filterText){const t=a(n,o,e,d.completion.filterText,d.filterTextLow,0,this._fuzzyScoreOptions);if(!t)continue;0===Xi(d.completion.filterText,d.textLabel)?d.score=t:(d.score=qd(n,o,e,d.textLabel,d.labelLow,0),d.score[0]=t[0])}else{const t=a(n,o,e,d.textLabel,d.labelLow,0,this._fuzzyScoreOptions);if(!t)continue;d.score=t}}d.idx=l,d.distance=this._wordDistance.distance(d.position,d.completion),r.push(d),e.push(d.textLabel.length)}this._filteredItems=r.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?ns(e.length-.85,e,((e,t)=>e-t)):0}}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]<t.score[0]?1:e.distance<t.distance?-1:e.distance>t.distance?1:e.idx<t.idx?-1:e.idx>t.idx?1:0}static _compareCompletionItemsSnippetsDown(e,t){if(e.completion.kind!==t.completion.kind){if(28===e.completion.kind)return 1;if(28===t.completion.kind)return-1}return hie._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(28===e.completion.kind)return-1;if(28===t.completion.kind)return 1}return hie._compareCompletionItems(e,t)}}var cie,uie=function(e,t){return function(i,n){t(i,n,e)}};class gie{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenization.tokenizeIfCheap(i.lineNumber);const n=t.getWordAtPosition(i);return!(!n||n.endColumn!==i.column&&n.startColumn+1!==i.column||!isNaN(Number(n.word)))}constructor(e,t,i){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.triggerOptions=i}}let pie=cie=class{constructor(e,t,i,n,o,s,r,a,l){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=n,this._logService=o,this._contextKeyService=s,this._configurationService=r,this._languageFeaturesService=a,this._envService=l,this._toDispose=new Mt,this._triggerCharacterListener=new Mt,this._triggerQuickSuggest=new bi,this._triggerState=void 0,this._completionDisposables=new Mt,this._onDidCancel=new Zt,this._onDidTrigger=new Zt,this._onDidSuggest=new Zt,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._currentSelection=this._editor.getSelection()||new Qu(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel((()=>{this._updateTriggerCharacters(),this.cancel()}))),this._toDispose.add(this._editor.onDidChangeModelLanguage((()=>{this._updateTriggerCharacters(),this.cancel()}))),this._toDispose.add(this._editor.onDidChangeConfiguration((()=>{this._updateTriggerCharacters()}))),this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange((()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()})));let d=!1;this._toDispose.add(this._editor.onDidCompositionStart((()=>{d=!0}))),this._toDispose.add(this._editor.onDidCompositionEnd((()=>{d=!1,this._onCompositionEnd()}))),this._toDispose.add(this._editor.onDidChangeCursorSelection((e=>{d||this._onCursorChange(e)}))),this._toDispose.add(this._editor.onDidChangeModelContent((()=>{d||void 0===this._triggerState||this._refilterCompletionItems()}))),this._updateTriggerCharacters()}dispose(){Et(this._triggerCharacterListener),Et([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(104)||!this._editor.hasModel()||!this._editor.getOption(137))return;const e=new Map;for(const t of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const i of t.triggerCharacters||[]){let n=e.get(i);if(!n){n=new Set;const t=undefined;t&&n.add(t),e.set(i,n)}n.add(t)}const t=t=>{if(!function(e,t){if(!Boolean(t.getContextKeyValue("inlineSuggestionVisible")))return!0;const i=t.getContextKeyValue(J8.suppressSuggestions.key);return void 0!==i?!i:!e.getOption(71).suppressSuggestions}(this._editor,this._contextKeyService,this._configurationService))return;if(gie.shouldAutoTrigger(this._editor))return;if(!t){const e=this._editor.getPosition();t=this._editor.getModel().getLineContent(e.lineNumber).substr(0,e.column-1)}let i="";dn(t.charCodeAt(t.length-1))?ln(t.charCodeAt(t.length-2))&&(i=t.substr(t.length-2)):i=t.charAt(t.length-1);const n=e.get(i);if(n){const e=new Map;if(this._completionModel)for(const[t,i]of this._completionModel.getItemsByProvider())n.has(t)||e.set(t,i);this.trigger({auto:!0,triggerKind:1,triggerCharacter:i,retrigger:Boolean(this._completionModel),clipboardText:this._completionModel?.clipboardText,completionOptions:{providerFilter:n,providerItemsToReuse:e}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd((()=>t())))}get state(){return this._triggerState?this._triggerState.auto?2:1:0}cancel(e=!1){void 0!==this._triggerState&&(this._triggerQuickSuggest.cancel(),this._requestToken?.cancel(),this._requestToken=void 0,this._triggerState=void 0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){void 0!==this._triggerState&&(this._editor.hasModel()&&this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.trigger({auto:this._triggerState.auto,retrigger:!0}):this.cancel())}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||0!==e.reason&&3!==e.reason||"keyboard"!==e.source&&"deleteLeft"!==e.source?this.cancel():void 0===this._triggerState&&0===e.reason?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():void 0!==this._triggerState&&3===e.reason&&this._refilterCompletionItems()}_onCompositionEnd(){void 0===this._triggerState?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){X8.isAllOff(this._editor.getOption(102))||this._editor.getOption(134).snippetsPreventQuickSuggestions&&See.get(this._editor)?.isInSnippet()||(this.cancel(),this._triggerQuickSuggest.cancelAndSet((()=>{if(void 0!==this._triggerState)return;if(!gie.shouldAutoTrigger(this._editor))return;if(!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const e=this._editor.getModel(),t=this._editor.getPosition(),i=this._editor.getOption(102);if(!X8.isAllOff(i)){if(!X8.isAllOn(i)){e.tokenization.tokenizeIfCheap(t.lineNumber);const n=e.tokenization.getLineTokens(t.lineNumber),o=n.getStandardTokenType(n.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if("on"!==X8.valueFor(i,o))return}(function(e,t){if(!Boolean(t.getContextKeyValue(J8.inlineSuggestionVisible.key)))return!0;const i=t.getContextKeyValue(J8.suppressSuggestions.key);return void 0!==i?!i:!e.getOption(71).suppressSuggestions})(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(e)&&this.trigger({auto:!0})}}),this._editor.getOption(103)))}_refilterCompletionItems(){_t(this._editor.hasModel()),_t(void 0!==this._triggerState);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new gie(e,t,{...this._triggerState,refilter:!0});this._onNewContext(i)}trigger(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=new gie(t,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:e.shy??!1,position:this._editor.getPosition()}),this._context=i;let n={triggerKind:e.triggerKind??0};e.triggerCharacter&&(n={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new ri;let o=1;switch(this._editor.getOption(128)){case"top":o=0;break;case"bottom":o=2}const{itemKind:s,showDeprecated:r}=cie.createSuggestFilter(this._editor),a=new $8(o,e.completionOptions?.kindFilter??s,e.completionOptions?.providerFilter,e.completionOptions?.providerItemsToReuse,r),l=lie.create(this._editorWorkerService,this._editor),d=Z8(this._languageFeaturesService.completionProvider,t,this._editor.getPosition(),a,n,this._requestToken.token);Promise.all([d,l]).then((async([t,i])=>{if(this._requestToken?.dispose(),!this._editor.hasModel())return void t.disposable.dispose();let n=e?.clipboardText;if(!n&&t.needsClipboard&&(n=await this._clipboardService.readText()),void 0===this._triggerState)return void t.disposable.dispose();const o=this._editor.getModel(),s=new gie(o,this._editor.getPosition(),e),r={...lh.default,firstMatchCanBeWeak:!this._editor.getOption(134).matchOnWordStartOnly};if(this._completionModel=new hie(t.items,this._context.column,{leadingLineContent:s.leadingLineContent,characterCountDelta:s.column-this._context.column},i,this._editor.getOption(134),this._editor.getOption(128),r,n),this._completionDisposables.add(t.disposable),this._onNewContext(s),this._reportDurationsTelemetry(t.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const e of t.items)e.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${e.provider._debugDisplayName}`,e.completion)})).catch(Ie)}_reportDurationsTelemetry(e){Math.random()>1e-4||setTimeout((()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)}))}static createSuggestFilter(e){const t=new Set;"none"===e.getOption(128)&&t.add(28);const i=e.getOption(134);return i.showMethods||t.add(0),i.showFunctions||t.add(1),i.showConstructors||t.add(2),i.showFields||t.add(3),i.showVariables||t.add(4),i.showClasses||t.add(5),i.showStructs||t.add(6),i.showInterfaces||t.add(7),i.showModules||t.add(8),i.showProperties||t.add(9),i.showEvents||t.add(10),i.showOperators||t.add(11),i.showUnits||t.add(12),i.showValues||t.add(13),i.showConstants||t.add(14),i.showEnums||t.add(15),i.showEnumMembers||t.add(16),i.showKeywords||t.add(17),i.showWords||t.add(18),i.showColors||t.add(19),i.showFiles||t.add(20),i.showReferences||t.add(21),i.showColors||t.add(22),i.showFolders||t.add(23),i.showTypeParameters||t.add(24),i.showSnippets||t.add(28),i.showUsers||t.add(25),i.showIssues||t.add(26),{itemKind:t,showDeprecated:i.showDeprecated}}_onNewContext(e){if(this._context)if(e.lineNumber===this._context.lineNumber)if(Gi(e.leadingLineContent)===Gi(this._context.leadingLineContent)){if(e.column<this._context.column)e.leadingWord.word?this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0}):this.cancel();else if(this._completionModel)if(0!==e.leadingWord.word.length&&e.leadingWord.startColumn>this._context.leadingWord.startColumn){if(gie.shouldAutoTrigger(this._editor)&&this._context){const e=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:e}})}}else if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&0!==e.leadingWord.word.length){const e=new Map,t=new Set;for(const[i,n]of this._completionModel.getItemsByProvider())n.length>0&&n[0].container.incomplete?t.add(i):e.set(i,n);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:t,providerItemsToReuse:e}})}else{const t=this._completionModel.lineContext;let i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},0===this._completionModel.items.length){const n=gie.shouldAutoTrigger(this._editor);if(!this._context)return void this.cancel();if(n&&this._context.leadingWord.endColumn<e.leadingWord.startColumn)return void this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0});if(this._context.triggerOptions.auto)return void this.cancel();if(this._completionModel.lineContext=t,i=this._completionModel.items.length>0,i&&0===e.leadingWord.word.length)return void this.cancel()}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:i})}}else this.cancel();else this.cancel()}};pie=cie=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([uie(1,Xq),uie(2,oD),uie(3,Cu),uie(4,yu),uie(5,eu),uie(6,up),uie(7,BD),uie(8,Pq)],pie);class mie{static{this._maxSelectionLength=51200}constructor(e,t){this._disposables=new Mt,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType((()=>{if(this._locked||!e.hasModel())return;const t=e.getSelections(),i=t.length;let n=!1;for(let e=0;e<i;e++)if(!t[e].isEmpty()){n=!0;break}if(!n)return void(0!==this._lastOvertyped.length&&(this._lastOvertyped.length=0));this._lastOvertyped=[];const o=e.getModel();for(let e=0;e<i;e++){const i=t[e];if(o.getValueLengthInRange(i)>mie._maxSelectionLength)return;this._lastOvertyped[e]={value:o.getValueInRange(i),multiline:i.startLineNumber!==i.endLineNumber}}}))),this._disposables.add(t.onDidTrigger((e=>{this._locked=!0}))),this._disposables.add(t.onDidCancel((e=>{this._locked=!1})))}getLastOvertypedInfo(e){if(e>=0&&e<this._lastOvertyped.length)return this._lastOvertyped[e]}dispose(){this._disposables.dispose()}}var fie=i(7160),_ie={};_ie.styleTagTransform=zl(),_ie.setAttributes=Bl(),_ie.insert=Pl().bind(null,"head"),_ie.domAPI=Rl(),_ie.insertStyleElement=Vl(),Ml()(fie.A,_ie),fie.A&&fie.A.locals&&fie.A.locals;var vie=function(e,t){return function(i,n){t(i,n,e)}};let bie=class{constructor(e,t,i,n,o){this._menuId=t,this._menuService=n,this._contextKeyService=o,this._menuDisposables=new Mt,this.element=il(e,ll(".suggest-status-bar"));const s=e=>e instanceof vu?i.createInstance(F$,e,{useComma:!1}):void 0;this._leftActions=new uR(this.element,{actionViewItemProvider:s}),this._rightActions=new uR(this.element,{actionViewItemProvider:s}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this._leftActions.dispose(),this._rightActions.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(this._menuId,this._contextKeyService),t=()=>{const t=[],i=[];for(const[n,o]of e.getActions())"left"===n?t.push(...o):i.push(...o);this._leftActions.clear(),this._leftActions.push(t),this._rightActions.clear(),this._rightActions.push(i)};this._menuDisposables.add(e.onDidChange((()=>t()))),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};bie=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([vie(2,nc),vie(3,pu),vie(4,eu)],bie);function wie(e){return!!e&&Boolean(e.completion.documentation||e.completion.detail&&e.completion.detail!==e.completion.label)}let Cie=class{constructor(e,t){this._editor=e,this._onDidClose=new Zt,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new Zt,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new Mt,this._renderDisposeable=new Mt,this._borderWidth=1,this._size=new Da(330,0),this.domNode=ll(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(aT,{editor:e}),this._body=ll(".body"),this._scrollbar=new dA(this._body,{alwaysConsumeMouseWheel:!0}),il(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=il(this._body,ll(".header")),this._close=il(this._header,ll("span"+vh.asCSSSelector(fh.close))),this._close.title=y(1475,"Close"),this._close.role="button",this._close.tabIndex=-1,this._type=il(this._header,ll("p.type")),this._docs=il(this._body,ll("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(59)&&this._configureFont()})))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(59),i=t.getMassagedFontFamily(),n=e.get(135)||t.fontSize,o=e.get(136)||t.lineHeight,s=t.fontWeight,r=`${n}px`,a=`${o}px`;this.domNode.style.fontSize=r,this.domNode.style.lineHeight=""+o/n,this.domNode.style.fontWeight=s,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=a,this._close.style.width=a}getLayoutInfo(){const e=this._editor.getOption(136)||this._editor.getOption(59).lineHeight,t=this._borderWidth;return{lineHeight:e,borderWidth:t,borderHeight:2*t,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=y(1476,"Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,2*this.getLayoutInfo().lineHeight),this._onDidChangeContents.fire(this)}renderItem(e,t){this._renderDisposeable.clear();let{detail:i,documentation:n}=e.completion;if(t){let t="";t+=`score: ${e.score[0]}\n`,t+=`prefix: ${e.word??"(no prefix)"}\n`,t+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel}\n`,t+=`distance: ${e.distance} (localityBonus-setting)\n`,t+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"}\n`,t+=`commit_chars: ${e.completion.commitCharacters?.join("")}\n`,n=(new Gh).appendCodeblock("empty",t),i=`Provider: ${e.provider._debugDisplayName}`}if(t||wie(e)){if(this.domNode.classList.remove("no-docs","no-type"),i){const e=i.length>1e5?`${i.substr(0,1e5)}…`:i;this._type.textContent=e,this._type.title=e,dl(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gim.test(e))}else ca(this._type),this._type.title="",hl(this._type),this.domNode.classList.add("no-type");if(ca(this._docs),"string"==typeof n)this._docs.classList.remove("markdown-docs"),this._docs.textContent=n;else if(n){this._docs.classList.add("markdown-docs"),ca(this._docs);const e=this._markdownRenderer.render(n,{asyncRenderCallback:()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}});this._docs.appendChild(e.element),this._renderDisposeable.add(e)}this.domNode.classList.toggle("detail-and-doc",!!i&&!!n),this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=e=>{e.preventDefault(),e.stopPropagation()},this._close.onclick=e=>{e.preventDefault(),e.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}else this.clearContents()}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get isEmpty(){return this.domNode.classList.contains("no-docs")}get size(){return this._size}layout(e,t){const i=new Da(e,t);Da.equals(i,this._size)||(this._size=i,function(e,t,i){"number"==typeof t&&(e.style.width=`${t}px`),"number"==typeof i&&(e.style.height=`${i}px`)}(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}set borderWidth(e){this._borderWidth=e}get borderWidth(){return this._borderWidth}focus(){this.domNode.focus()}};Cie=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,nc)],Cie);class yie{constructor(e,t){let i,n;this.widget=e,this._editor=t,this.allowEditorOverflow=!0,this._disposables=new Mt,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new VG,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let o=0,s=0;this._disposables.add(this._resizable.onDidWillResize((()=>{i=this._topLeft,n=this._resizable.size}))),this._disposables.add(this._resizable.onDidResize((e=>{if(i&&n){this.widget.layout(e.dimension.width,e.dimension.height);let t=!1;e.west&&(s=n.width-e.dimension.width,t=!0),e.north&&(o=n.height-e.dimension.height,t=!0),t&&this._applyTopLeft({top:i.top+o,left:i.left+s})}e.done&&(i=void 0,n=void 0,o=0,s=0,this._userSize=e.dimension)}))),this._disposables.add(this.widget.onDidChangeContents((()=>{this._anchorBox&&this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,this._preferAlignAtTop)})))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return this._topLeft?{preference:this._topLeft}:null}show(){this._added||(this._editor.addOverlayWidget(this),this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){const i=e.getBoundingClientRect();this._anchorBox=i,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,t)}_placeAtAnchor(e,t,i){const n=ka(this.getDomNode().ownerDocument.body),o=this.widget.getLayoutInfo(),s=new Da(220,2*o.lineHeight),r=e.top,a=function(){const i=n.width-(e.left+e.width+o.borderWidth+o.horizontalPadding),a=-o.borderWidth+e.left+e.width,l=new Da(i,n.height-e.top-o.borderHeight-o.verticalPadding),d=l.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:r,left:a,fit:i-t.width,maxSizeTop:l,maxSizeBottom:d,minSize:s.with(Math.min(i,s.width))}}(),l=function(){const i=e.left-o.borderWidth-o.horizontalPadding,a=Math.max(o.horizontalPadding,e.left-t.width-o.borderWidth),l=new Da(i,n.height-e.top-o.borderHeight-o.verticalPadding),d=l.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:r,left:a,fit:i-t.width,maxSizeTop:l,maxSizeBottom:d,minSize:s.with(Math.min(i,s.width))}}(),d=function(){const i=e.left,r=-o.borderWidth+e.top+e.height,a=new Da(e.width-o.borderHeight,n.height-e.top-e.height-o.verticalPadding);return{top:r,left:i,fit:a.height-t.height,maxSizeBottom:a,maxSizeTop:a,minSize:s.with(a.width)}}(),h=[a,l,d],c=h.find((e=>e.fit>=0))??h.sort(((e,t)=>t.fit-e.fit))[0],u=e.top+e.height-o.borderHeight;let g,p=t.height;const m=Math.max(c.maxSizeTop.height,c.maxSizeBottom.height);let f;p>m&&(p=m),i?p<=c.maxSizeTop.height?(g=!0,f=c.maxSizeTop):(g=!1,f=c.maxSizeBottom):p<=c.maxSizeBottom.height?(g=!1,f=c.maxSizeBottom):(g=!0,f=c.maxSizeTop);let{top:_,left:v}=c;!g&&p>e.height&&(_=u-p);const b=this._editor.getDomNode();if(b){const e=b.getBoundingClientRect();_-=e.top,v-=e.left}this._applyTopLeft({left:v,top:_}),this._resizable.enableSashes(!g,c===a,g,c!==a),this._resizable.minSize=c.minSize,this._resizable.maxSize=f,this._resizable.layout(p,Math.min(f.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this._editor.layoutOverlayWidget(this)}}const Sie=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function xie(e,t,i,n,o){if(vh.isThemeIcon(o))return[`codicon-${o.id}`,"predefined-file-icon"];if(uo.isUri(o))return[];const s=n===n8.ROOT_FOLDER?["rootfolder-icon"]:n===n8.FOLDER?["folder-icon"]:["file-icon"];if(i){let o;if(i.scheme===So.data)o=$h.parseMetaData(i).get($h.META_DATA_LABEL);else{const e=i.path.match(Sie);e?(o=kie(e[2].toLowerCase()),e[1]&&s.push(`${kie(e[1].toLowerCase())}-name-dir-icon`)):o=kie(i.authority.toLowerCase())}if(n===n8.ROOT_FOLDER)s.push(`${o}-root-name-folder-icon`);else if(n===n8.FOLDER)s.push(`${o}-name-folder-icon`);else{if(o){if(s.push(`${o}-name-file-icon`),s.push("name-file-icon"),o.length<=255){const e=o.split(".");for(let t=1;t<e.length;t++)s.push(`${e.slice(t).join(".")}-ext-file-icon`)}s.push("ext-file-icon")}const n=function(e,t,i){if(!i)return null;let n=null;if(i.scheme===So.data){const e=$h.parseMetaData(i).get($h.META_DATA_MIME);e&&(n=t.getLanguageIdByMimeType(e))}else{const t=e.getModel(i);t&&(n=t.getLanguageId())}return n&&n!==Up?n:t.guessLanguageIdByFilepathOrFirstLine(i)}(e,t,i);n&&s.push(`${kie(n)}-lang-file-icon`)}}return s}function kie(e){return e.replace(/[\s]/g,"/")}var Lie=function(e,t){return function(i,n){t(i,n,e)}};const Die=bF("suggest-more-info",fh.chevronRight,y(1477,"Icon for more information in the suggest widget.")),Eie=new class e{static{this._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/}static{this._regexStrict=new RegExp(`^${e._regexRelaxed.source}$`,"i")}extract(t,i){if(t.textLabel.match(e._regexStrict))return i[0]=t.textLabel,!0;if(t.completion.detail&&t.completion.detail.match(e._regexStrict))return i[0]=t.completion.detail,!0;if(t.completion.documentation){const n="string"==typeof t.completion.documentation?t.completion.documentation:t.completion.documentation.value,o=e._regexRelaxed.exec(n);if(o&&(0===o.index||o.index+o[0].length===n.length))return i[0]=o[0],!0}return!1}};let Nie=class{constructor(e,t,i,n){this._editor=e,this._modelService=t,this._languageService=i,this._themeService=n,this._onDidToggleDetails=new Zt,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new Mt,i=e;i.classList.add("show-file-icons");const n=il(e,ll(".icon")),o=il(n,ll("span.colorspan")),s=il(e,ll(".contents")),r=il(s,ll(".main")),a=il(r,ll(".icon-label.codicon")),l=il(r,ll("span.left")),d=il(r,ll("span.right")),h=new v0(l,{supportHighlights:!0,supportIcons:!0});t.add(h);const c=il(l,ll("span.signature-label")),u=il(l,ll("span.qualifier-label")),g=il(d,ll("span.details-label")),p=il(d,ll("span.readMore"+vh.asCSSSelector(Die)));return p.title=y(1478,"Read More"),{root:i,left:l,right:d,icon:n,colorspan:o,iconLabel:h,iconContainer:a,parametersLabel:c,qualifierLabel:u,detailsLabel:g,readMore:p,disposables:t,configureFont:()=>{const e=this._editor.getOptions(),t=e.get(59),o=t.getMassagedFontFamily(),s=t.fontFeatureSettings,a=t.fontVariationSettings,l=e.get(135)||t.fontSize,d=e.get(136)||t.lineHeight,h=t.fontWeight,c=`${l}px`,u=`${d}px`,g=`${t.letterSpacing}px`;i.style.fontSize=c,i.style.fontWeight=h,i.style.letterSpacing=g,r.style.fontFamily=o,r.style.fontFeatureSettings=s,r.style.fontVariationSettings=a,r.style.lineHeight=u,n.style.height=u,n.style.width=u,p.style.height=u,p.style.width=u}}}renderElement(e,t,i){i.configureFont();const{completion:n}=e;i.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:$d(e.score)},s=[];if(19===n.kind&&Eie.extract(e,s))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=s[0];else if(20===n.kind&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const t=xie(this._modelService,this._languageService,uo.from({scheme:"fake",path:e.textLabel}),n8.FILE),s=xie(this._modelService,this._languageService,uo.from({scheme:"fake",path:n.detail}),n8.FILE);o.extraClasses=t.length>s.length?t:s}else 23===n.kind&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",o.extraClasses=[xie(this._modelService,this._languageService,uo.from({scheme:"fake",path:e.textLabel}),n8.FOLDER),xie(this._modelService,this._languageService,uo.from({scheme:"fake",path:n.detail}),n8.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...vh.asClassNameArray(PS.toIcon(n.kind))));n.tags&&n.tags.indexOf(1)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,o),"string"==typeof n.label?(i.parametersLabel.textContent="",i.detailsLabel.textContent=Iie(n.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=Iie(n.label.detail||""),i.detailsLabel.textContent=Iie(n.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(134).showInlineDetails?dl(i.detailsLabel):hl(i.detailsLabel),wie(e)?(i.right.classList.add("can-expand-details"),dl(i.readMore),i.readMore.onmousedown=e=>{e.stopPropagation(),e.preventDefault()},i.readMore.onclick=e=>{e.stopPropagation(),e.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),hl(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};function Iie(e){return e.replace(/\r\n|\r|\n/g,"")}Nie=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Lie(1,ac),Lie(2,Tg),Lie(3,sw)],Nie);var Tie,Mie=function(e,t){return function(i,n){t(i,n,e)}};Ff("editorSuggestWidget.background",d_,y(1458,"Background color of the suggest widget.")),Ff("editorSuggestWidget.border",c_,y(1459,"Border color of the suggest widget."));const Aie=Ff("editorSuggestWidget.foreground",l_,y(1460,"Foreground color of the suggest widget."));Ff("editorSuggestWidget.selectedForeground",Xb,y(1461,"Foreground color of the selected entry in the suggest widget.")),Ff("editorSuggestWidget.selectedIconForeground",Jb,y(1462,"Icon foreground color of the selected entry in the suggest widget."));const Rie=Ff("editorSuggestWidget.selectedBackground",ew,y(1463,"Background color of the selected entry in the suggest widget."));Ff("editorSuggestWidget.highlightForeground",Lb,y(1464,"Color of the match highlights in the suggest widget.")),Ff("editorSuggestWidget.focusHighlightForeground",Db,y(1465,"Color of the match highlights in the suggest widget when an item is focused.")),Ff("editorSuggestWidgetStatus.foreground",Vf(Aie,.5),y(1466,"Foreground color of the suggest widget status."));class Oie{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof rY}`}restore(){const e=this._service.get(this._key,0)??"";try{const t=JSON.parse(e);if(Da.is(t))return Da.lift(t)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let Pie=class{static{Tie=this}static{this.LOADING_MESSAGE=y(1467,"Loading...")}static{this.NO_SUGGESTIONS_MESSAGE=y(1468,"No suggestions.")}constructor(e,t,i,n,o){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new Rt,this._pendingShowDetails=new Rt,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new bi,this._disposables=new Mt,this._onDidSelect=new Qt,this._onDidFocus=new Qt,this._onDidHide=new Zt,this._onDidShow=new Zt,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new Zt,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new VG,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new Fie(this,e),this._persistedSize=new Oie(t,e);class s{constructor(e,t,i=!1,n=!1){this.persistedSize=e,this.currentSize=t,this.persistHeight=i,this.persistWidth=n}}let r;this._disposables.add(this.element.onDidWillResize((()=>{this._contentWidget.lockPreference(),r=new s(this._persistedSize.restore(),this.element.size)}))),this._disposables.add(this.element.onDidResize((e=>{if(this._resize(e.dimension.width,e.dimension.height),r&&(r.persistHeight=r.persistHeight||!!e.north||!!e.south,r.persistWidth=r.persistWidth||!!e.east||!!e.west),e.done){if(r){const{itemHeight:e,defaultSize:t}=this.getLayoutInfo(),i=Math.round(e/2);let{width:n,height:o}=this.element.size;(!r.persistHeight||Math.abs(r.currentSize.height-o)<=i)&&(o=r.persistedSize?.height??t.height),(!r.persistWidth||Math.abs(r.currentSize.width-n)<=i)&&(n=r.persistedSize?.width??t.width),this._persistedSize.store(new Da(n,o))}this._contentWidget.unlockPreference(),r=void 0}}))),this._messageElement=il(this.element.domNode,ll(".message")),this._listElement=il(this.element.domNode,ll(".tree"));const a=this._disposables.add(o.createInstance(Cie,this.editor));a.onDidClose((()=>this.toggleDetails()),this,this._disposables),this._details=new yie(a,this.editor);const l=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(134).showIcons);l();const d=o.createInstance(Nie,this.editor);this._disposables.add(d),this._disposables.add(d.onDidToggleDetails((()=>this.toggleDetails()))),this._list=new XA("SuggestWidget",this._listElement,{getHeight:e=>this.getLayoutInfo().itemHeight,getTemplateId:e=>"suggestion"},[d],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>q?"listitem":"option",getWidgetAriaLabel:()=>y(1469,"Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:e=>{let t=e.textLabel;const i=PS.toLabel(e.completion.kind);if("string"!=typeof e.completion.label){const{detail:n,description:o}=e.completion.label;n&&o?t=y(1470,"{0} {1}, {2}, {3}",t,n,o,i):n?t=y(1471,"{0} {1}, {2}",t,n,i):o&&(t=y(1472,"{0}, {1}, {2}",t,o,i))}else t=y(1473,"{0}, {1}",t,i);if(!e.isResolved||!this._isDetailsVisible())return t;const{documentation:n,detail:o}=e.completion;return y(1474,"{0}, docs: {1}",t,Bi("{0}{1}",o||"",n?"string"==typeof n?n:n.value:""))}}}),this._list.style(BR({listInactiveFocusBackground:Rie,listInactiveFocusOutline:Xf})),this._status=o.createInstance(bie,this.element.domNode,j8);const h=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(134).showStatusBar);h(),this._disposables.add(n.onDidColorThemeChange((e=>this._onThemeChange(e)))),this._onThemeChange(n.getColorTheme()),this._disposables.add(this._list.onMouseDown((e=>this._onListMouseDownOrTap(e)))),this._disposables.add(this._list.onTap((e=>this._onListMouseDownOrTap(e)))),this._disposables.add(this._list.onDidChangeSelection((e=>this._onListSelection(e)))),this._disposables.add(this._list.onDidChangeFocus((e=>this._onListFocus(e)))),this._disposables.add(this.editor.onDidChangeCursorSelection((()=>this._onCursorSelectionChanged()))),this._disposables.add(this.editor.onDidChangeConfiguration((e=>{e.hasChanged(134)&&(h(),l()),this._completionModel&&(e.hasChanged(59)||e.hasChanged(135)||e.hasChanged(136))&&this._list.splice(0,this._list.length,this._completionModel.items)}))),this._ctxSuggestWidgetVisible=K8.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=K8.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=K8.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=K8.HasFocusedSuggestion.bindTo(i),this._disposables.add(ma(this._details.widget.domNode,"keydown",(e=>{this._onDetailsKeydown.fire(e)}))),this._disposables.add(this.editor.onMouseDown((e=>this._onEditorMouseDown(e))))}dispose(){this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),this._loadingTimeout?.dispose(),this._pendingLayout.dispose(),this._pendingShowDetails.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){0!==this._state&&this._contentWidget.layout()}_onListMouseDownOrTap(e){void 0!==e.element&&void 0!==e.index&&(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const i=this._completionModel;i&&(this._onDidSelect.fire({item:e,index:t,model:i}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth=nw(e.type)?2:1}_onListFocus(e){if(this._ignoreFocusEvents)return;if(5===this._state&&this._setState(3),!e.elements.length)return this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),void this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const t=e.elements[0],i=e.indexes[0];t!==this._focusedItem&&(this._currentSuggestionDetails?.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=t,this._list.reveal(i),this._currentSuggestionDetails=hi((async e=>{const i=fi((()=>{this._isDetailsVisible()&&this._showDetails(!0,!1)}),250),n=e.onCancellationRequested((()=>i.dispose()));try{return await t.resolve(e)}finally{i.dispose(),n.dispose()}})),this._currentSuggestionDetails.then((()=>{i>=this._list.length||t!==this._list.element(i)||(this._ignoreFocusEvents=!0,this._list.splice(i,1,[t]),this._list.setFocus([i]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this._showDetails(!1,!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:this._list.getElementID(i)}))})).catch(Ie)),this._onDidFocus.fire({item:t,index:i,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",4===e),this.element.domNode.classList.remove("message"),e){case 0:hl(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._ctxSuggestWidgetHasFocusedSuggestion.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=Tie.LOADING_MESSAGE,hl(this._listElement,this._status.element),dl(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Ql(Tie.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=Tie.NO_SUGGESTIONS_MESSAGE,hl(this._listElement,this._status.element),dl(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Ql(Tie.NO_SUGGESTIONS_MESSAGE);break;case 3:case 4:hl(this._messageElement),dl(this._listElement,this._status.element),this._show();break;case 5:hl(this._messageElement),dl(this._listElement,this._status.element),this._details.show(),this._show(),this._details.widget.focus()}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet((()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)}),100)}showTriggered(e,t){0===this._state&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=fi((()=>this._setState(1)),t)))}showSuggestions(e,t,i,n,o){if(this._contentWidget.setPosition(this.editor.getPosition()),this._loadingTimeout?.dispose(),this._currentSuggestionDetails?.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&2!==this._state&&0!==this._state)return void this._setState(4);const s=this._completionModel.items.length,r=0===s;if(this._ctxSuggestWidgetMultipleSuggestions.set(s>1),r)return this._setState(n?0:2),void(this._completionModel=void 0);this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(i?4:3),this._list.reveal(t,0,0===t?0:.33*this.getLayoutInfo().itemHeight),this._list.setFocus(o?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=wa(ta(this.element.domNode),(()=>{this._pendingLayout.clear(),this._layout(this.element.size),this._details.widget.domNode.classList.remove("focused")}))}focusSelected(){this._list.length>0&&this._list.setFocus([0])}selectNextPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(0!==this._state&&2!==this._state&&1!==this._state&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){5===this._state?(this._list.setFocus(this._list.getFocus()),this._setState(3)):3===this._state&&(this._setState(5),this._isDetailsVisible()?this._details.widget.focus():this.toggleDetails(!0))}toggleDetails(e=!1){this._isDetailsVisible()?(this._pendingShowDetails.clear(),this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):!wie(this._list.getFocusedElements()[0])&&!this._explainMode||3!==this._state&&5!==this._state&&4!==this._state||(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this._showDetails(!1,e))}_showDetails(e,t){this._pendingShowDetails.value=wa(ta(this.element.domNode),(()=>{this._pendingShowDetails.clear(),this._details.show();let i=!1;e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._details.widget.isEmpty?this._details.hide():(this._positionDetails(),this.element.domNode.classList.add("shows-details"),t&&(this._details.widget.focus(),i=!0)),i||this.editor.focus()}))}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this._showDetails(!1,!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){this._pendingLayout.clear(),this._pendingShowDetails.clear(),this._loadingTimeout?.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const e=this._persistedSize.restore(),t=Math.ceil(4.3*this.getLayoutInfo().itemHeight);e&&e.height<t&&this._persistedSize.store(e.with(void 0,t))}isFrozen(){return 4===this._state}_afterRender(e){null!==e?2!==this._state&&1!==this._state&&(this._isDetailsVisible()&&!this._details.widget.isEmpty&&this._details.show(),this._positionDetails()):this._isDetailsVisible()&&this._details.hide()}_layout(e){if(!this.editor.hasModel())return;if(!this.editor.getDomNode())return;const t=ka(this.element.domNode.ownerDocument.body),i=this.getLayoutInfo();e||(e=i.defaultSize);let n=e.height,o=e.width;if(this._status.element.style.height=`${i.itemHeight}px`,2===this._state||1===this._state)n=i.itemHeight+i.borderHeight,o=i.defaultSize.width/2,this.element.enableSashes(!1,!1,!1,!1),this.element.minSize=this.element.maxSize=new Da(o,n),this._contentWidget.setPreference(2);else{const s=t.width-i.borderHeight-2*i.horizontalPadding;o>s&&(o=s);const r=this._completionModel?this._completionModel.stats.pLabelLen*i.typicalHalfwidthCharacterWidth:o,a=i.statusBarHeight+this._list.contentHeight+i.borderHeight,l=i.itemHeight+i.statusBarHeight,d=Na(this.editor.getDomNode()),h=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),c=d.top+h.top+h.height,u=Math.min(t.height-c-i.verticalPadding,a),g=d.top+h.top-i.verticalPadding,p=Math.min(g,a);let m=Math.min(Math.max(p,u)+i.borderHeight,a);n===this._cappedHeight?.capped&&(n=this._cappedHeight.wanted),n<l&&(n=l),n>m&&(n=m);const f=150;n>u&&p>u||this._forceRenderingAbove&&g>f?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),m=p):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),m=u),this.element.preferredSize=new Da(r,i.defaultSize.height),this.element.maxSize=new Da(s,m),this.element.minSize=new Da(220,l),this._cappedHeight=n===a?{wanted:this._cappedHeight?.wanted??e.height,capped:n}:void 0}this._resize(o,n)}_resize(e,t){const{width:i,height:n}=this.element.maxSize;e=Math.min(i,e),t=Math.min(n,t);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(t-o,e),this._listElement.style.height=t-o+"px",this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,2===this._contentWidget.getPosition()?.preference[0])}getLayoutInfo(){const e=this.editor.getOption(59),t=FM(this.editor.getOption(136)||e.lineHeight,8,1e3),i=this.editor.getOption(134).showStatusBar&&2!==this._state&&1!==this._state?t:0,n=this._details.widget.borderWidth;return{itemHeight:t,statusBarHeight:i,borderWidth:n,borderHeight:2*n,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new Da(430,i+12*t)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}};Pie=Tie=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Mie(1,Sq),Mie(2,eu),Mie(3,sw),Mie(4,nc)],Pie);class Fie{constructor(e,t){this._widget=e,this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return!this._hidden&&this._position&&this._preference?{position:this._position,preference:[this._preference]}:null}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:i,horizontalPadding:n}=this._widget.getLayoutInfo();return new Da(t+2*i+n,e+2*i)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}var Bie,Wie=function(e,t){return function(i,n){t(i,n,e)}};class Vie{constructor(e,t){if(this._model=e,this._position=t,this._decorationOptions=bk.register({description:"suggest-line-suffix",stickiness:1}),e.getLineMaxColumn(t.lineNumber)!==t.column){const i=e.getOffsetAt(t),n=e.getPositionAt(i+1);e.changeDecorations((e=>{this._marker&&e.removeDecoration(this._marker),this._marker=e.addDecoration(Yu.fromPositions(t,n),this._decorationOptions)}))}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.changeDecorations((e=>{e.removeDecoration(this._marker),this._marker=void 0}))}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}return this._model.getLineMaxColumn(e.lineNumber)-e.column}}let Hie=class{static{Bie=this}static{this.ID="editor.contrib.suggestController"}static get(e){return e.getContribution(Bie.ID)}get onWillInsertSuggestItem(){return this._onWillInsertSuggestItem.event}constructor(e,t,i,n,o,s,r){this._memoryService=t,this._commandService=i,this._contextKeyService=n,this._instantiationService=o,this._logService=s,this._telemetryService=r,this._lineSuffix=new Rt,this._toDispose=new Mt,this._selectors=new zie((e=>e.priority)),this._onWillInsertSuggestItem=new Zt,this._wantsForceRenderingAbove=!1,this.editor=e,this.model=o.createInstance(pie,this.editor),this._selectors.register({priority:0,select:(e,t,i)=>this._memoryService.select(e,t,i)});const a=K8.InsertMode.bindTo(n);a.set(e.getOption(134).insertMode),this._toDispose.add(this.model.onDidTrigger((()=>a.set(e.getOption(134).insertMode)))),this.widget=this._toDispose.add(new ba(ta(e.getDomNode()),(()=>{const e=this._instantiationService.createInstance(Pie,this.editor);this._toDispose.add(e),this._toDispose.add(e.onDidSelect((e=>this._insertSuggestion(e,0)),this));const t=new rie(this.editor,e,this.model,(e=>this._insertSuggestion(e,2)));this._toDispose.add(t);const i=K8.MakesTextEdit.bindTo(this._contextKeyService),n=K8.HasInsertAndReplaceRange.bindTo(this._contextKeyService),o=K8.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(Tt((()=>{i.reset(),n.reset(),o.reset()}))),this._toDispose.add(e.onDidFocus((({item:e})=>{const t=this.editor.getPosition(),s=e.editStart.column,r=t.column;let a=!0;"smart"!==this.editor.getOption(1)||2!==this.model.state||e.completion.additionalTextEdits||4&e.completion.insertTextRules||r-s!==e.completion.insertText.length||(a=this.editor.getModel().getValueInRange({startLineNumber:t.lineNumber,startColumn:s,endLineNumber:t.lineNumber,endColumn:r})!==e.completion.insertText),i.set(a),n.set(!rc.equals(e.editInsertEnd,e.editReplaceEnd)),o.set(Boolean(e.provider.resolveCompletionItem)||Boolean(e.completion.documentation)||e.completion.detail!==e.completion.label)}))),this._toDispose.add(e.onDetailsKeyDown((e=>{e.toKeyCodeChord().equals(new Ue(!0,!1,!1,!1,33))||$&&e.toKeyCodeChord().equals(new Ue(!1,!1,!1,!0,33))?e.stopPropagation():e.toKeyCodeChord().isModifierKey()||this.editor.focus()}))),this._wantsForceRenderingAbove&&e.forceRenderingAbove(),e}))),this._overtypingCapturer=this._toDispose.add(new ba(ta(e.getDomNode()),(()=>this._toDispose.add(new mie(this.editor,this.model))))),this._alternatives=this._toDispose.add(new ba(ta(e.getDomNode()),(()=>this._toDispose.add(new sie(this.editor,this._contextKeyService))))),this._toDispose.add(o.createInstance(nie,e)),this._toDispose.add(this.model.onDidTrigger((e=>{this.widget.value.showTriggered(e.auto,e.shy?250:50),this._lineSuffix.value=new Vie(this.editor.getModel(),e.position)}))),this._toDispose.add(this.model.onDidSuggest((e=>{if(e.triggerOptions.shy)return;let t=-1;for(const i of this._selectors.itemsOrderedByPriorityDesc)if(t=i.select(this.editor.getModel(),this.editor.getPosition(),e.completionModel.items),-1!==t)break;if(-1===t&&(t=0),0===this.model.state)return;let i=!1;if(e.triggerOptions.auto){const t=this.editor.getOption(134);"never"===t.selectionMode||"always"===t.selectionMode?i="never"===t.selectionMode:"whenTriggerCharacter"===t.selectionMode?i=1!==e.triggerOptions.triggerKind:"whenQuickSuggestion"===t.selectionMode&&(i=1===e.triggerOptions.triggerKind&&!e.triggerOptions.refilter)}this.widget.value.showSuggestions(e.completionModel,t,e.isFrozen,e.triggerOptions.auto,i)}))),this._toDispose.add(this.model.onDidCancel((e=>{e.retrigger||this.widget.value.hideWidget()}))),this._toDispose.add(this.editor.onDidBlurEditorWidget((()=>{this.model.cancel(),this.model.clear()})));const l=K8.AcceptSuggestionsOnEnter.bindTo(n),d=()=>{const e=this.editor.getOption(1);l.set("on"===e||"smart"===e)};this._toDispose.add(this.editor.onDidChangeConfiguration((()=>d()))),d()}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose(),this._onWillInsertSuggestItem.dispose()}_insertSuggestion(e,t){if(!e||!e.item)return this._alternatives.value.reset(),this.model.cancel(),void this.model.clear();if(!this.editor.hasModel())return;const i=See.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const n=this.editor.getModel(),o=n.getAlternativeVersionId(),{item:s}=e,r=[],a=new ri;1&t||this.editor.pushUndoStop();const l=this.getOverwriteInfo(s,Boolean(8&t));this._memoryService.memorize(n,this.editor.getPosition(),s);const d=s.isResolved;let h=-1,c=-1;if(Array.isArray(s.completion.additionalTextEdits)){this.model.cancel();const e=mq.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",s.completion.additionalTextEdits.map((e=>{let t=Yu.lift(e.range);if(t.startLineNumber===s.position.lineNumber&&t.startColumn>s.position.column){const e=this.editor.getPosition().column-s.position.column,i=e,n=Yu.spansMultipleLines(t)?0:e;t=new Yu(t.startLineNumber,t.startColumn+i,t.endLineNumber,t.endColumn+n)}return qZ.replaceMove(t,e.text)}))),e.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!d){const e=new Ht;let i;const o=n.onDidChangeContent((e=>{if(e.isFlush)return a.cancel(),void o.dispose();for(const t of e.changes){const e=Yu.getEndPosition(t.range);i&&!rc.isBefore(e,i)||(i=e)}})),l=t;t|=2;let d=!1;const h=this.editor.onWillType((()=>{h.dispose(),d=!0,2&l||this.editor.pushUndoStop()}));r.push(s.resolve(a.token).then((()=>{if(!s.completion.additionalTextEdits||a.token.isCancellationRequested)return;if(i&&s.completion.additionalTextEdits.some((e=>rc.isBefore(i,Yu.getStartPosition(e.range)))))return!1;d&&this.editor.pushUndoStop();const e=mq.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",s.completion.additionalTextEdits.map((e=>qZ.replaceMove(Yu.lift(e.range),e.text)))),e.restoreRelativeVerticalPositionOfCursor(this.editor),!d&&2&l||this.editor.pushUndoStop(),!0})).then((t=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",e.elapsed(),t),c=!0===t?1:!1===t?0:-2})).finally((()=>{o.dispose(),h.dispose()})))}let{insertText:u}=s.completion;if(4&s.completion.insertTextRules||(u=GT.escape(u)),this.model.cancel(),i.insert(u,{overwriteBefore:l.overwriteBefore,overwriteAfter:l.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(1&s.completion.insertTextRules),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value,reason:TC({providerId:KS.fromExtensionId(s.extensionId?.value)})}),2&t||this.editor.pushUndoStop(),s.completion.command)if(s.completion.command.id===Uie.id)this.model.trigger({auto:!0,retrigger:!0});else{const e=new Ht;r.push(this._commandService.executeCommand(s.completion.command.id,...s.completion.command.arguments?[...s.completion.command.arguments]:[]).catch((e=>{s.completion.extensionId?Te(e):Ie(e)})).finally((()=>{h=e.elapsed()})))}4&t&&this._alternatives.value.set(e,(e=>{for(a.cancel();n.canUndo();){o!==n.getAlternativeVersionId()&&n.undo(),this._insertSuggestion(e,3|(8&t?8:0));break}})),this._alertCompletionItem(s),Promise.all(r).finally((()=>{this._reportSuggestionAcceptedTelemetry(s,n,d,h,c,e.index,e.model.items),this.model.clear(),a.dispose()}))}_reportSuggestionAcceptedTelemetry(e,t,i,n,o,s,r){if(Math.random()>1e-4)return;const a=new Map;for(let e=0;e<Math.min(30,r.length);e++){const t=r[e].textLabel;a.has(t)?a.get(t).push(e):a.set(t,[e])}const l=a.get(e.textLabel),d=l&&l.length>1?l[0]:-1;this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:e.extensionId?.value??"unknown",providerId:e.provider._debugDisplayName??"unknown",kind:e.completion.kind,basenameHash:Vo(Bh(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:Wh(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:n,additionalEditsAsync:o,index:s,firstIndex:d})}getOverwriteInfo(e,t){_t(this.editor.hasModel());let i="replace"===this.editor.getOption(134).insertMode;t&&(i=!i);const n=e.position.column-e.editStart.column,o=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column;return{overwriteBefore:n+(this.editor.getPosition().column-e.position.column),overwriteAfter:o+(this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0)}}_alertCompletionItem(e){hs(e.completion.additionalTextEdits)&&Yl(y(1448,"Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length))}triggerSuggest(e,t,i){this.editor.hasModel()&&(this.model.trigger({auto:t??!1,completionOptions:{providerFilter:e,kindFilter:i?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},n=e=>{if(4&e.completion.insertTextRules||e.completion.additionalTextEdits)return!0;const t=this.editor.getPosition(),i=e.editStart.column,n=t.column;return n-i!==e.completion.insertText.length||this.editor.getModel().getValueInRange({startLineNumber:t.lineNumber,startColumn:i,endLineNumber:t.lineNumber,endColumn:n})!==e.completion.insertText};zt.once(this.model.onDidTrigger)((e=>{const t=[];zt.any(this.model.onDidTrigger,this.model.onDidCancel)((()=>{Et(t),i()}),void 0,t),this.model.onDidSuggest((({completionModel:e})=>{if(Et(t),0===e.items.length)return void i();const o=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),e.items),s=e.items[o];n(s)?(this.editor.pushUndoStop(),this._insertSuggestion({index:o,item:s,model:e},7)):i()}),void 0,t)})),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let n=0;e&&(n|=4),t&&(n|=8),this._insertSuggestion(i,n)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}focusSuggestion(){this.widget.value.focusSelected()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.isInitialized?this.widget.value.forceRenderingAbove():this._wantsForceRenderingAbove=!0}stopForceRenderingAbove(){this.widget.isInitialized?this.widget.value.stopForceRenderingAbove():this._wantsForceRenderingAbove=!1}registerSelector(e){return this._selectors.register(e)}};Hie=Bie=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Wie(1,tie),Wie(2,mc),Wie(3,eu),Wie(4,nc),Wie(5,yu),Wie(6,Cu)],Hie);class zie{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(-1!==this._items.indexOf(e))throw new Error("Value is already registered");return this._items.push(e),this._items.sort(((e,t)=>this.prioritySelector(t)-this.prioritySelector(e))),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class Uie extends Pu{static{this.id="editor.action.triggerSuggest"}constructor(){super({id:Uie.id,label:x(1456,"Trigger Suggest"),precondition:Ac.and(Xu.writable,Xu.hasCompletionItemProvider,K8.Visible.toNegated()),kbOpts:{kbExpr:Xu.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,i){const n=Hie.get(t);if(!n)return;let o;i&&"object"==typeof i&&!0===i.auto&&(o=!0),n.triggerSuggest(void 0,o,void 0)}}Uu(Hie.ID,Hie,2),Hu(Uie);const Kie=190,jie=Ou.bindToContribution(Hie.get);Vu(new jie({id:"acceptSelectedSuggestion",precondition:Ac.and(K8.Visible,K8.HasFocusedSuggestion),handler(e){e.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:Ac.and(K8.Visible,Xu.textInputFocus),weight:Kie},{primary:3,kbExpr:Ac.and(K8.Visible,Xu.textInputFocus,K8.AcceptSuggestionsOnEnter,K8.MakesTextEdit),weight:Kie}],menuOpts:[{menuId:j8,title:y(1449,"Insert"),group:"left",order:1,when:K8.HasInsertAndReplaceRange.toNegated()},{menuId:j8,title:y(1450,"Insert"),group:"left",order:1,when:Ac.and(K8.HasInsertAndReplaceRange,K8.InsertMode.isEqualTo("insert"))},{menuId:j8,title:y(1451,"Replace"),group:"left",order:1,when:Ac.and(K8.HasInsertAndReplaceRange,K8.InsertMode.isEqualTo("replace"))}]})),Vu(new jie({id:"acceptAlternativeSelectedSuggestion",precondition:Ac.and(K8.Visible,Xu.textInputFocus,K8.HasFocusedSuggestion),kbOpts:{weight:Kie,kbExpr:Xu.textInputFocus,primary:1027,secondary:[1026]},handler(e){e.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:j8,group:"left",order:2,when:Ac.and(K8.HasInsertAndReplaceRange,K8.InsertMode.isEqualTo("insert")),title:y(1452,"Replace")},{menuId:j8,group:"left",order:2,when:Ac.and(K8.HasInsertAndReplaceRange,K8.InsertMode.isEqualTo("replace")),title:y(1453,"Insert")}]})),fc.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion"),Vu(new jie({id:"hideSuggestWidget",precondition:K8.Visible,handler:e=>e.cancelSuggestWidget(),kbOpts:{weight:Kie,kbExpr:Xu.textInputFocus,primary:9,secondary:[1033]}})),Vu(new jie({id:"selectNextSuggestion",precondition:Ac.and(K8.Visible,Ac.or(K8.MultipleSuggestions,K8.HasFocusedSuggestion.negate())),handler:e=>e.selectNextSuggestion(),kbOpts:{weight:Kie,kbExpr:Xu.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})),Vu(new jie({id:"selectNextPageSuggestion",precondition:Ac.and(K8.Visible,Ac.or(K8.MultipleSuggestions,K8.HasFocusedSuggestion.negate())),handler:e=>e.selectNextPageSuggestion(),kbOpts:{weight:Kie,kbExpr:Xu.textInputFocus,primary:12,secondary:[2060]}})),Vu(new jie({id:"selectLastSuggestion",precondition:Ac.and(K8.Visible,Ac.or(K8.MultipleSuggestions,K8.HasFocusedSuggestion.negate())),handler:e=>e.selectLastSuggestion()})),Vu(new jie({id:"selectPrevSuggestion",precondition:Ac.and(K8.Visible,Ac.or(K8.MultipleSuggestions,K8.HasFocusedSuggestion.negate())),handler:e=>e.selectPrevSuggestion(),kbOpts:{weight:Kie,kbExpr:Xu.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})),Vu(new jie({id:"selectPrevPageSuggestion",precondition:Ac.and(K8.Visible,Ac.or(K8.MultipleSuggestions,K8.HasFocusedSuggestion.negate())),handler:e=>e.selectPrevPageSuggestion(),kbOpts:{weight:Kie,kbExpr:Xu.textInputFocus,primary:11,secondary:[2059]}})),Vu(new jie({id:"selectFirstSuggestion",precondition:Ac.and(K8.Visible,Ac.or(K8.MultipleSuggestions,K8.HasFocusedSuggestion.negate())),handler:e=>e.selectFirstSuggestion()})),Vu(new jie({id:"focusSuggestion",precondition:Ac.and(K8.Visible,K8.HasFocusedSuggestion.negate()),handler:e=>e.focusSuggestion(),kbOpts:{weight:Kie,kbExpr:Xu.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}})),Vu(new jie({id:"focusAndAcceptSuggestion",precondition:Ac.and(K8.Visible,K8.HasFocusedSuggestion.negate()),handler:e=>{e.focusSuggestion(),e.acceptSelectedSuggestion(!0,!1)}})),Vu(new jie({id:"toggleSuggestionDetails",precondition:Ac.and(K8.Visible,K8.HasFocusedSuggestion),handler:e=>e.toggleSuggestionDetails(),kbOpts:{weight:Kie,kbExpr:Xu.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:j8,group:"right",order:1,when:Ac.and(K8.DetailsVisible,K8.CanResolve),title:y(1454,"Show Less")},{menuId:j8,group:"right",order:1,when:Ac.and(K8.DetailsVisible.toNegated(),K8.CanResolve),title:y(1455,"Show More")}]})),Vu(new jie({id:"toggleExplainMode",precondition:K8.Visible,handler:e=>e.toggleExplainMode(),kbOpts:{weight:100,primary:2138}})),Vu(new jie({id:"toggleSuggestionFocus",precondition:K8.Visible,handler:e=>e.toggleSuggestionFocus(),kbOpts:{weight:Kie,kbExpr:Xu.textInputFocus,primary:2570,mac:{primary:778}}})),Vu(new jie({id:"insertBestCompletion",precondition:Ac.and(Xu.textInputFocus,Ac.equals("config.editor.tabCompletion","on"),nie.AtEnd,K8.Visible.toNegated(),sie.OtherSuggestions.toNegated(),See.InSnippetMode.toNegated()),handler:(e,t)=>{e.triggerSuggestAndAcceptBest(dt(t)?{fallback:"tab",...t}:{fallback:"tab"})},kbOpts:{weight:Kie,primary:2}})),Vu(new jie({id:"insertNextSuggestion",precondition:Ac.and(Xu.textInputFocus,Ac.equals("config.editor.tabCompletion","on"),sie.OtherSuggestions,K8.Visible.toNegated(),See.InSnippetMode.toNegated()),handler:e=>e.acceptNextSuggestion(),kbOpts:{weight:Kie,kbExpr:Xu.textInputFocus,primary:2}})),Vu(new jie({id:"insertPrevSuggestion",precondition:Ac.and(Xu.textInputFocus,Ac.equals("config.editor.tabCompletion","on"),sie.OtherSuggestions,K8.Visible.toNegated(),See.InSnippetMode.toNegated()),handler:e=>e.acceptPrevSuggestion(),kbOpts:{weight:Kie,kbExpr:Xu.textInputFocus,primary:1026}})),Hu(class extends Pu{constructor(){super({id:"editor.action.resetSuggestSize",label:x(1457,"Reset Suggest Widget Size"),precondition:void 0})}run(e,t){Hie.get(t)?.resetWidgetSize()}});class qie extends At{get selectedItem(){return this._currentSuggestItemInfo}constructor(e,t,i){super(),this.editor=e,this.suggestControllerPreselector=t,this.onWillAccept=i,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._onDidSelectedItemChange=this._register(new Zt),this.onDidSelectedItemChange=this._onDidSelectedItemChange.event,this._register(e.onKeyDown((e=>{e.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))}))),this._register(e.onKeyUp((e=>{e.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))})));const n=Hie.get(this.editor);if(n){this._register(n.registerSelector({priority:100,select:(e,t,i)=>{const o=this.editor.getModel();if(!o)return-1;const s=this.suggestControllerPreselector(),r=s?Hee(s,o):void 0;if(!r)return-1;const a=rc.lift(t),l=vm(i.map(((e,t)=>{const i=Hee($ie.fromSuggestion(n,o,a,e,this.isShiftKeyPressed).getSingleTextEdit(),o);return{index:t,valid:zee(r,i),prefixLength:i.text.length,suggestItem:e}})).filter((e=>e&&e.valid&&e.prefixLength>0)),Cs((e=>e.prefixLength),ys));return l?l.index:-1}}));let e=!1;const t=()=>{e||(e=!0,this._register(n.widget.value.onDidShow((()=>{this.isSuggestWidgetVisible=!0,this.update(!0)}))),this._register(n.widget.value.onDidHide((()=>{this.isSuggestWidgetVisible=!1,this.update(!1)}))),this._register(n.widget.value.onDidFocus((()=>{this.isSuggestWidgetVisible=!0,this.update(!0)}))))};this._register(zt.once(n.model.onDidTrigger)((e=>{t()}))),this._register(n.onWillInsertSuggestItem((e=>{const t=this.editor.getPosition(),i=this.editor.getModel();if(!t||!i)return;const o=$ie.fromSuggestion(n,i,t,e.item,this.isShiftKeyPressed);this.onWillAccept(o)})))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();this._isActive===e&&function(e,t){return e===t||!(!e||!t)&&e.equals(t)}(this._currentSuggestItemInfo,t)||(this._isActive=e,this._currentSuggestItemInfo=t,this._onDidSelectedItemChange.fire())}getSuggestItemInfo(){const e=Hie.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),i=this.editor.getPosition(),n=this.editor.getModel();return t&&i&&n?$ie.fromSuggestion(e,n,i,t.item,this.isShiftKeyPressed):void 0}stopForceRenderingAbove(){const e=Hie.get(this.editor);e?.stopForceRenderingAbove()}forceRenderingAbove(){const e=Hie.get(this.editor);e?.forceRenderingAbove()}}class $ie{static fromSuggestion(e,t,i,n,o){let{insertText:s}=n.completion,r=!1;if(4&n.completion.insertTextRules){const e=(new GT).parse(s);e.children.length<100&&bee.adjustWhitespace(t,i,!0,e),s=e.toString(),r=!0}const a=e.getOverwriteInfo(n,o);return new $ie(Yu.fromPositions(i.delta(0,-a.overwriteBefore),i.delta(0,Math.max(a.overwriteAfter,0))),s,n.completion.kind,r,n.container.incomplete??!1)}constructor(e,t,i,n,o){this.range=e,this.insertText=t,this.completionItemKind=i,this.isSnippetText=n,this.listIncomplete=o}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new US(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}getSingleTextEdit(){return new FU(this.range,this.insertText)}}class Gie extends At{constructor(e,t,i){super(),this._editorObs=e,this._handleSuggestAccepted=t,this._suggestControllerPreselector=i,this._suggestWidgetAdaptor=this._register(new qie(this._editorObs.editor,(()=>(this._editorObs.forceUpdate(),this._suggestControllerPreselector())),(e=>this._editorObs.forceUpdate((t=>{this._handleSuggestAccepted(e)}))))),this.selectedItem=Sr(this,(e=>this._suggestWidgetAdaptor.onDidSelectedItemChange((()=>{this._editorObs.forceUpdate((t=>e(void 0)))}))),(()=>this._suggestWidgetAdaptor.selectedItem))}stopForceRenderingAbove(){this._suggestWidgetAdaptor.stopForceRenderingAbove()}forceRenderingAbove(){this._suggestWidgetAdaptor.forceRenderingAbove()}}class Zie{constructor(e,t){this.lineNumber=e,this.columnRange=t}}class Yie{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new Ve(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new Yu(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}toZeroBasedOffsetRange(){return new cm(this.startColumn-1,this.endColumnExclusive-1)}}var Qie=i(4085),Xie={};Xie.styleTagTransform=zl(),Xie.setAttributes=Bl(),Xie.insert=Pl().bind(null,"head"),Xie.domAPI=Rl(),Xie.insertStyleElement=Vl(),Ml()(Qie.A,Xie),Qie.A&&Qie.A.locals&&Qie.A.locals;class Jie{static fromLineTokens(e){const t=[];for(let i=0;i<e.getCount();i++)t.push(new ene(e.getTokenText(i),e.getMetadata(i)));return Jie.create(t)}static create(e){return new Jie(e)}constructor(e){this._tokenInfo=e}toLineTokens(e){return uS.createFromTextAndMetadata(this.map(((e,t)=>({text:t.text,metadata:t.metadata}))),e)}map(e){const t=[];let i=0;for(const n of this._tokenInfo){const o=new cm(i,i+n.text.length);t.push(e(o,n)),i+=n.text.length}return t}slice(e){const t=[];let i=0;for(const n of this._tokenInfo){const o=i,s=o+n.text.length;if(s>e.start){if(o>=e.endExclusive)break;const i=Math.max(0,e.start-o),r=Math.max(0,s-e.endExclusive);t.push(new ene(n.text.slice(i,n.text.length-r),n.metadata))}i+=n.text.length}return Jie.create(t)}append(e){const t=this._tokenInfo.concat(e._tokenInfo);return Jie.create(t)}}class ene{constructor(e,t){this.text=e,this.metadata=t}}var tne;const ine="ghost-text";let nne=class extends At{static{tne=this}static{this.hot=C$(tne)}constructor(e,t,i,n,o,s){super(),this._editor=e,this._model=t,this._options=i,this._shouldKeepCursorStable=n,this._isClickable=o,this._languageService=s,this._isDisposed=Js(this,!1),this._editorObs=bY(this._editor),this._warningState=pr((e=>{const t=this._model.ghostText.read(e);if(!t)return;const i=this._model.warning.read(e);return i?{lineNumber:t.lineNumber,position:new rc(t.lineNumber,t.parts[0].column),icon:i.icon}:void 0})),this._onDidClick=this._register(new Zt),this.onDidClick=this._onDidClick.event,this._useSyntaxHighlighting=this._options.map((e=>e.syntaxHighlightingEnabled)),this._extraClassNames=pr(this,(e=>{const t=[...this._options.read(e).extraClasses??[]];return this._useSyntaxHighlighting.read(e)&&t.push("syntax-highlighted"),this._warningState.read(e)&&t.push("warning"),t.map((e=>` ${e}`)).join("")})),this.uiState=pr(this,(e=>{if(this._isDisposed.read(e))return;const t=this._editorObs.model.read(e);if(t!==this._model.targetTextModel.read(e))return;const i=this._model.ghostText.read(e);if(!i)return;const n=i instanceof Bee?i.columnRange:void 0,o=this._useSyntaxHighlighting.read(e),s=this._extraClassNames.read(e),{inlineTexts:r,additionalLines:a,hiddenRange:l,additionalLinesOriginalSuffix:d}=function(e,t,i){const n=[],o=[];function s(e,t){if(o.length>0){const i=o[o.length-1];t&&i.decorations.push(new WB(i.content.length+1,i.content.length+1+e[0].line.length,t,0)),i.content+=e[0].line,e=e.slice(1)}for(const i of e)o.push({content:i.line,decorations:t?[new WB(1,i.line.length+1,t,0),...i.lineDecorations]:[...i.lineDecorations]})}const r=t.getLineContent(e.lineNumber);let a,l,d=0;for(const t of e.parts){let e=t.lines;void 0===a?(n.push({column:t.column,text:e[0].line,preview:t.preview,lineDecorations:e[0].lineDecorations}),e=e.slice(1)):s([{line:r.substring(d,t.column-1),lineDecorations:[]}],void 0),e.length>0&&(s(e,i),void 0===a&&t.column<=r.length&&(a=t.column)),d=t.column-1}void 0!==a&&(l=new Zie(e.lineNumber,new Yie(d+1,r.length+1)));const h=void 0!==a?new Yie(a,r.length+1):void 0;return{inlineTexts:n,additionalLines:o,hiddenRange:h,additionalLinesOriginalSuffix:l}}(i,t,ine+s),h=t.getLineContent(i.lineNumber),c=new LU(r.map((e=>DU.insert(e.column-1,e.text)))),u=o?t.tokenization.tokenizeLinesAt(i.lineNumber,[c.apply(h),...a.map((e=>e.content))]):void 0,g=c.getNewRanges(),p=r.map(((e,t)=>({...e,tokens:u?.[0]?.getTokensInRange(g[t])}))),m=a.map(((e,i)=>{let n=u?.[i+1]??uS.createEmpty(e.content,this._languageService.languageIdCodec);if(i===a.length-1&&d){const e=Jie.fromLineTokens(t.tokenization.getLineTokens(d.lineNumber)).slice(d.columnRange.toZeroBasedOffsetRange());n=Jie.fromLineTokens(n).append(e).toLineTokens(n.languageIdCodec)}return{content:n,decorations:e.decorations}})),f=this._editor.getSelection()?.getStartPosition().column,_=p.filter((e=>""!==e.text)),v=0!==_.length,b={cursorColumnDistance:(v?_[0].column:1)-f,cursorLineDistance:v?0:a.findIndex((e=>""!==e.content))+1,lineCountOriginal:v?1:0,lineCountModified:a.length+(v?1:0),characterCountOriginal:0,characterCountModified:Es(_.map((e=>e.text.length)))+Es(m.map((e=>e.content.getTextLength()))),disjointReplacements:_.length+(a.length>0?1:0),sameShapeReplacements:_.length>1&&0===m.length?_.every((e=>e.text===_[0].text)):void 0};return this._model.handleInlineCompletionShown.read(e)?.(b),{replacedRange:n,inlineTexts:p,additionalLines:m,hiddenRange:l,lineNumber:i.lineNumber,additionalReservedLineCount:this._model.minReservedLineCount.read(e),targetTextModel:t,syntaxHighlightingEnabled:o}})),this.decorations=pr(this,(e=>{const t=this.uiState.read(e);if(!t)return[];const i=[],n=this._extraClassNames.read(e);t.replacedRange&&i.push({range:t.replacedRange.toRange(t.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace"+n,description:"GhostTextReplacement"}}),t.hiddenRange&&i.push({range:t.hiddenRange.toRange(t.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const e of t.inlineTexts)i.push({range:Yu.fromPositions(new rc(t.lineNumber,e.column)),options:{description:"ghost-text-decoration",after:{content:e.text,tokens:e.tokens,inlineClassName:(e.preview?"ghost-text-decoration-preview":"ghost-text-decoration")+(this._isClickable?" clickable":"")+n+e.lineDecorations.map((e=>" "+e.className)).join(" "),cursorStops:mg.Left,attachedData:new one(this)},showIfCollapsed:!0}});return i})),this._additionalLinesWidget=this._register(new sne(this._editor,pr((e=>{const t=this.uiState.read(e);return t?{lineNumber:t.lineNumber,additionalLines:t.additionalLines,minReservedLineCount:t.additionalReservedLineCount,targetTextModel:t.targetTextModel}:void 0})),this._shouldKeepCursorStable,this._isClickable)),this._isInlineTextHovered=this._editorObs.isTargetHovered((e=>6===e.target.type&&e.target.detail.injectedText?.options.attachedData instanceof one&&e.target.detail.injectedText.options.attachedData.owner===this),this._store),this.isHovered=pr(this,(e=>!this._isDisposed.read(e)&&(this._isInlineTextHovered.read(e)||this._additionalLinesWidget.isHovered.read(e)))),this.height=pr(this,(e=>this._editorObs.getOption(75).read(e)+(this._additionalLinesWidget.viewZoneHeight.read(e)??0))),this._register(Tt((()=>{this._isDisposed.set(!0,void 0)}))),this._register(this._editorObs.setDecorations(this.decorations)),this._isClickable&&(this._register(this._additionalLinesWidget.onDidClick((e=>this._onDidClick.fire(e)))),this._register(this._editor.onMouseUp((e=>{if(6!==e.target.type)return;const t=e.target.detail.injectedText?.options.attachedData;t instanceof one&&t.owner===this&&this._onDidClick.fire(e.event)})))),this._register(hr(((e,t)=>{})))}static getWarningWidgetContext(e){return e.ghostTextViewWarningWidgetData||(e.parentElement?this.getWarningWidgetContext(e.parentElement):void 0)}ownsViewZone(e){return this._additionalLinesWidget.viewZoneId===e}};nne=tne=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(5,Tg)],nne);class one{constructor(e){this.owner=e}}class sne extends At{get viewZoneId(){return this._viewZoneInfo?.viewZoneId}get viewZoneHeight(){return this._viewZoneHeight}constructor(e,t,i,n){super(),this._editor=e,this._lines=t,this._shouldKeepCursorStable=i,this._isClickable=n,this._viewZoneHeight=Js("viewZoneHeight",void 0),this.editorOptionsChanged=Fr("editorOptionChanged",zt.filter(this._editor.onDidChangeConfiguration,(e=>e.hasChanged(40)||e.hasChanged(133)||e.hasChanged(113)||e.hasChanged(108)||e.hasChanged(60)||e.hasChanged(59)||e.hasChanged(75)))),this._onDidClick=this._register(new Zt),this.onDidClick=this._onDidClick.event,this._viewZoneListener=this._register(new Rt),this.isHovered=bY(this._editor).isTargetHovered((e=>rne(e.target.element)),this._store),this.hasBeenAccepted=!1,this._editor instanceof tq&&this._shouldKeepCursorStable&&this._register(this._editor.onBeforeExecuteEdit((e=>this.hasBeenAccepted="inlineSuggestion.accept"===e.source))),this._register(ar((e=>{const t=this._lines.read(e);this.editorOptionsChanged.read(e),t?(this.hasBeenAccepted=!1,this.updateLines(t.lineNumber,t.additionalLines,t.minReservedLineCount)):this.clear()})))}dispose(){super.dispose(),this.clear()}clear(){this._viewZoneListener.clear(),this._editor.changeViewZones((e=>{this.removeActiveViewZone(e)}))}updateLines(e,t,i){const n=this._editor.getModel();if(!n)return;const{tabSize:o}=n.getOptions();this._editor.changeViewZones((n=>{const s=new Mt;this.removeActiveViewZone(n);const r=Math.max(t.length,i);if(r>0){const i=document.createElement("div");!function(e,t,i,n,o){const s=n.get(40),r=n.get(133),a=n.get(108),l=n.get(60),d=n.get(59),h=n.get(75);let c="suggest-preview-text";o&&(c+=" clickable");const u=new Xg(1e4);u.appendString(`<div class="${c}">`);for(let e=0,n=i.length;e<n;e++){const n=i[e],o=n.content;u.appendString('<div class="view-line'),u.appendString('" style="top:'),u.appendString(String(e*h)),u.appendString('px;width:1000000px;">');const c=o.getLineContent(),g=bn(c),p=_n(c);GB(new KB(d.isMonospace&&!s,d.canUseHalfwidthRightwardsArrow,c,!1,g,p,0,o,n.decorations,t,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,r,"none",a,l!==eP.OFF,null,null,0),u),u.appendString("</div>")}u.appendString("</div>"),iT(e,d);const g=u.build(),p=ane?ane.createHTML(g):g;e.innerHTML=p}(i,o,t,this._editor.getOptions(),this._isClickable),this._isClickable&&(s.add(ga(i,"mousedown",(e=>{e.preventDefault()}))),s.add(ga(i,"click",(e=>{rne(e.target)&&this._onDidClick.fire(new Je(ta(e),e))})))),this.addViewZone(n,e,r,i)}this._viewZoneListener.value=s}))}addViewZone(e,t,i,n){const o=e.addZone({afterLineNumber:t,heightInLines:i,domNode:n,afterColumnAffinity:1,onComputedHeight:e=>{this._viewZoneHeight.set(e,void 0)}});this.keepCursorStable(t,i),this._viewZoneInfo={viewZoneId:o,heightInLines:i,lineNumber:t}}removeActiveViewZone(e){this._viewZoneInfo&&(e.removeZone(this._viewZoneInfo.viewZoneId),this.hasBeenAccepted||this.keepCursorStable(this._viewZoneInfo.lineNumber,-this._viewZoneInfo.heightInLines),this._viewZoneInfo=void 0,this._viewZoneHeight.set(void 0,void 0))}keepCursorStable(e,t){if(!this._shouldKeepCursorStable)return;const i=this._editor.getSelection()?.getStartPosition()?.lineNumber;void 0!==i&&e<i&&this._editor.setScrollTop(this._editor.getScrollTop()+t*this._editor.getOption(75))}}function rne(e){return qa(e)&&e.classList.contains(ine)}const ane=GI("editorGhostText",{createHTML:e=>e});class lne{static{this.empty=new lne([])}constructor(e){this.replacements=e,ot(at(e,((e,t)=>e.lineRange.endLineNumberExclusive<=t.lineRange.startLineNumber)))}toString(){return this.replacements.map((e=>e.toString())).join(",")}getNewLineRanges(){const e=[];let t=0;for(const i of this.replacements)e.push(ym.ofLength(i.lineRange.startLineNumber+t,i.newLines.length)),t+=i.newLines.length-i.lineRange.length;return e}}class dne{static fromSingleTextEdit(e,t){const i=qi(e.text);let n=e.range.startLineNumber;const o=t.getValueOfRange(Yu.fromPositions(new rc(e.range.startLineNumber,1),e.range.getStartPosition()));i[0]=o+i[0];let s=e.range.endLineNumber+1;const r=t.getTransformer().getLineLength(e.range.endLineNumber)+1,a=t.getValueOfRange(Yu.fromPositions(e.range.getEndPosition(),new rc(e.range.endLineNumber,r)));i[i.length-1]=i[i.length-1]+a;const l=e.range.startColumn===t.getTransformer().getLineLength(e.range.startLineNumber)+1,d=1===e.range.endColumn;return l&&i[0].length===o.length&&(n++,i.shift()),i.length>0&&n<s&&d&&i[i.length-1].length===a.length&&(s--,i.pop()),new dne(new ym(n,s),i)}constructor(e,t){this.lineRange=e,this.newLines=t}toString(){return`${this.lineRange}->${JSON.stringify(this.newLines)}`}toLineEdit(){return new lne([this])}}class hne{get lineEdit(){return dne.fromSingleTextEdit(this.edit.toReplacement(this.originalText),this.originalText)}get originalLineRange(){return this.lineEdit.lineRange}get modifiedLineRange(){return this.lineEdit.toLineEdit().getNewLineRanges()[0]}get displayRange(){return this.originalText.lineRange.intersect(this.originalLineRange.join(ym.ofLength(this.originalLineRange.startLineNumber,this.lineEdit.newLines.length)))}constructor(e,t,i,n,o){this.originalText=e,this.edit=t,this.cursorPosition=i,this.commands=n,this.inlineCompletion=o}}class cne{constructor(e,t,i){this._model=e,this.inlineEdit=t,this.tabAction=i,this.action=this.inlineEdit.inlineCompletion.action,this.displayName=this.inlineEdit.inlineCompletion.source.provider.displayName??y(1209,"Inline Edit"),this.extensionCommands=this.inlineEdit.inlineCompletion.source.inlineSuggestions.commands??[],this.isInDiffEditor=this._model.isInDiffEditor,this.displayLocation=this.inlineEdit.inlineCompletion.displayLocation,this.showCollapsed=this._model.showCollapsed}accept(){this._model.accept()}jump(){this._model.jump()}abort(e){console.error(e),this.inlineEdit.inlineCompletion.reportInlineEditError(e),this._model.stop()}handleInlineEditShown(e,t){this._model.handleInlineSuggestionShown(this.inlineEdit.inlineCompletion,e,t)}}class une{constructor(e){this._model=e,this.onDidAccept=this._model.onDidAccept,this.inAcceptFlow=this._model.inAcceptFlow}}class gne{constructor(e,t,i,n){this.lineRange=i;const o=bY(e),s=pr(this,(e=>o.isFocused.read(e)&&n.showInlineEditMenu?dte.Accept:dte.Inactive));this.model=new cne(t,new hne(new OU(""),new PU([n.getSingleTextEdit()]),t.primaryPosition.get(),n.source.inlineSuggestions.commands??[],n),s)}}class pne{static fromPoints(e,t){return new pne(e.x,e.y,t.x,t.y)}static fromPointSize(e,t){return new pne(e.x,e.y,e.x+t.x,e.y+t.y)}static fromLeftTopRightBottom(e,t,i,n){return new pne(e,t,i,n)}static fromLeftTopWidthHeight(e,t,i,n){return new pne(e,t,e+i,t+n)}static fromRanges(e,t){return new pne(e.start,t.start,e.endExclusive,t.endExclusive)}static hull(e){let t=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,n=Number.MIN_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;for(const s of e)t=Math.min(t,s.left),i=Math.min(i,s.top),n=Math.max(n,s.right),o=Math.max(o,s.bottom);return new pne(t,i,n,o)}get width(){return this.right-this.left}get height(){return this.bottom-this.top}constructor(e,t,i,n){if(this.left=e,this.top=t,this.right=i,this.bottom=n,e>i)throw new Ve("Invalid arguments: Horizontally offset by "+(e-i));if(t>n)throw new Ve("Invalid arguments: Vertically offset by "+(t-n))}withMargin(e,t,i,n){let o,s,r,a;return void 0===t&&void 0===i&&void 0===n?o=s=r=a=e:void 0===i&&void 0===n?(o=s=t,r=a=e):(o=n,s=t,r=e,a=i),new pne(this.left-o,this.top-r,this.right+s,this.bottom+a)}intersectVertical(e){const t=Math.max(this.top,e.start),i=Math.min(this.bottom,e.endExclusive);return new pne(this.left,t,this.right,Math.max(t,i))}intersectHorizontal(e){const t=Math.max(this.left,e.start),i=Math.min(this.right,e.endExclusive);return new pne(t,this.top,Math.max(t,i),this.bottom)}toString(){return`Rect{(${this.left},${this.top}), (${this.right},${this.bottom})}`}intersect(e){const t=Math.max(this.left,e.left),i=Math.min(this.right,e.right),n=Math.max(this.top,e.top),o=Math.min(this.bottom,e.bottom);if(!(t>i||n>o))return new pne(t,n,i,o)}containsRect(e){return this.left<=e.left&&this.top<=e.top&&this.right>=e.right&&this.bottom>=e.bottom}containsPoint(e){return this.left<=e.x&&this.top<=e.y&&this.right>=e.x&&this.bottom>=e.y}moveToBeContainedIn(e){const t=this.width,i=this.height;let n=this.left,o=this.top;return n<e.left?n=e.left:n+t>e.right&&(n=e.right-t),o<e.top?o=e.top:o+i>e.bottom&&(o=e.bottom-i),new pne(n,o,n+t,o+i)}withWidth(e){return new pne(this.left,this.top,this.left+e,this.bottom)}withHeight(e){return new pne(this.left,this.top,this.right,this.top+e)}withTop(e){return new pne(this.left,e,this.right,this.bottom)}withLeft(e){return new pne(e,this.top,this.right,this.bottom)}translateX(e){return new pne(this.left+e,this.top,this.right+e,this.bottom)}translateY(e){return new pne(this.left,this.top+e,this.right,this.bottom+e)}getLeftBottom(){return new vY(this.left,this.bottom)}getRightBottom(){return new vY(this.right,this.bottom)}getRightTop(){return new vY(this.right,this.top)}toStyles(){return{position:"absolute",left:`${this.left}px`,top:`${this.top}px`,width:`${this.width}px`,height:`${this.height}px`}}}var mne=i(7689),fne={};fne.styleTagTransform=zl(),fne.setAttributes=Bl(),fne.insert=Pl().bind(null,"head"),fne.domAPI=Rl(),fne.insertStyleElement=Vl(),Ml()(mne.A,fne),mne.A&&mne.A.locals&&mne.A.locals;class _ne{constructor(e,t,i,n=null){this.startLineNumbers=e,this.endLineNumbers=t,this.lastLineRelativePosition=i,this.showEndForLine=n}equals(e){return!!e&&this.lastLineRelativePosition===e.lastLineRelativePosition&&this.showEndForLine===e.showEndForLine&&es(this.startLineNumbers,e.startLineNumbers)&&es(this.endLineNumbers,e.endLineNumbers)}static get Empty(){return new _ne([],[],0)}}const vne=GI("stickyScrollViewLayer",{createHTML:e=>e}),bne="data-sticky-line-index",wne="data-sticky-is-line",Cne="data-sticky-is-folding-icon";class yne extends At{get height(){return this._height}constructor(e){super(),this._foldingIconStore=new Mt,this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._renderedStickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._height=-1,this._onDidChangeStickyScrollHeight=this._register(new Zt),this.onDidChangeStickyScrollHeight=this._onDidChangeStickyScrollHeight.event,this._editor=e,this._lineHeight=e.getOption(75),this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof rY),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable),this._setHeight(0);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(131).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(131)&&t(),e.hasChanged(75)&&(this._lineHeight=this._editor.getOption(75))}))),this._register(this._editor.onDidScrollChange((e=>{e.scrollLeftChanged&&t(),e.scrollWidthChanged&&this._updateWidgetWidth()}))),this._register(this._editor.onDidChangeModel((()=>{t(),this._updateWidgetWidth()}))),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange((e=>{this._updateWidgetWidth()}))),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getRenderedStickyLine(e){return this._renderedStickyLines.find((t=>t.lineNumber===e))}getCurrentLines(){return this._lineNumbers}setState(e,t,i){const n=!this._state&&!e,o=this._state&&this._state.equals(e);if(void 0===i&&(n||o))return;const s=this._findRenderingData(e),r=this._lineNumbers;this._lineNumbers=s.lineNumbers,this._lastLineRelativePosition=s.lastLineRelativePosition;const a=this._findIndexToRebuildFrom(r,this._lineNumbers,i);this._renderRootNode(this._lineNumbers,this._lastLineRelativePosition,t,a),this._state=e}_findRenderingData(e){if(!e)return{lineNumbers:[],lastLineRelativePosition:0};const t=[...e.startLineNumbers];null!==e.showEndForLine&&(t[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]);let i=0;for(let e=0;e<t.length;e++)i+=this._editor.getLineHeightForPosition(new rc(t[e],1));return 0===i?{lineNumbers:[],lastLineRelativePosition:0}:{lineNumbers:t,lastLineRelativePosition:e.lastLineRelativePosition}}_findIndexToRebuildFrom(e,t,i){if(0===t.length)return 0;if(void 0!==i)return i;const n=t.findIndex((t=>!e.includes(t)));return-1===n?0:n}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",this._editor.getScrollWidth()-e.verticalScrollbarWidth+"px"),this._rootDomNode.style.width=e.width-e.verticalScrollbarWidth+"px"}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const t of this._renderedStickyLines){const i=t.foldingIcon;i&&i.setVisible(!!e||i.isCollapsed)}}async _renderRootNode(e,t,i,n){const o=this._editor._getViewModel();if(!o)return void this._clearWidget();if(0===e.length)return void this._clearWidget();const s=[],r=e[e.length-1];let a=0;for(let e=0;e<this._renderedStickyLines.length;e++)if(e<n){const t=this._renderedStickyLines[e];s.push(this._updatePosition(t,a,t.lineNumber===r)),a+=t.height}else{const t=this._renderedStickyLines[e];t.lineNumberDomNode.remove(),t.lineDomNode.remove()}const l=this._editor.getLayoutInfo();for(let t=n;t<e.length;t++){const n=this._renderChildNode(o,t,e[t],a,r===e[t],i,l);a+=n.height,this._linesDomNode.appendChild(n.lineDomNode),this._lineNumbersDomNode.appendChild(n.lineNumberDomNode),s.push(n)}i&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin)),this._minContentWidthInPx=Math.max(...this._renderedStickyLines.map((e=>e.scrollWidth)))+l.verticalScrollbarWidth,this._renderedStickyLines=s,this._setHeight(a+t),this._editor.layoutOverlayWidget(this)}_clearWidget(){for(let e=0;e<this._renderedStickyLines.length;e++){const t=this._renderedStickyLines[e];t.lineNumberDomNode.remove(),t.lineDomNode.remove()}this._setHeight(0)}_setHeight(e){this._height!==e&&(this._height=e,0===this._height?this._rootDomNode.style.display="none":(this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height=`${this._height}px`,this._linesDomNodeScrollable.style.height=`${this._height}px`,this._rootDomNode.style.height=`${this._height}px`),this._onDidChangeStickyScrollHeight.fire({height:this._height}))}_setFoldingHoverListeners(){"mouseover"===this._editor.getOption(126)&&(this._foldingIconStore.add(ga(this._lineNumbersDomNode,Qa.MOUSE_ENTER,(()=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)}))),this._foldingIconStore.add(ga(this._lineNumbersDomNode,Qa.MOUSE_LEAVE,(()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)}))))}_renderChildNode(e,t,i,n,o,s,r){const a=e.coordinatesConverter.convertModelPositionToViewPosition(new rc(i,1)).lineNumber,l=e.getViewLineRenderingData(a),d=this._editor.getOption(76),h=this._editor.getOption(117).verticalScrollbarSize;let c;try{c=WB.filter(l.inlineDecorations,a,l.minColumn,l.maxColumn)}catch(e){c=[]}const u=this._editor.getLineHeightForPosition(new rc(i,1)),g=e.getTextDirection(i),p=new KB(!0,!0,l.content,l.continuesWithWrappedLine,l.isBasicASCII,l.containsRTL,0,l.tokens,c,l.tabSize,l.startVisibleColumn,1,1,1,500,"none",!0,!0,null,g,h),m=new Xg(2e3),f=GB(p,m);let _;_=vne?vne.createHTML(m.build()):m.build();const v=document.createElement("span");v.setAttribute(bne,String(t)),v.setAttribute(wne,""),v.setAttribute("role","listitem"),v.tabIndex=0,v.className="sticky-line-content",v.classList.add(`stickyLine${i}`),v.style.lineHeight=`${u}px`,v.innerHTML=_;const b=document.createElement("span");b.setAttribute(bne,String(t)),b.setAttribute("data-sticky-is-line-number",""),b.className="sticky-line-number",b.style.lineHeight=`${u}px`;const w=r.contentLeft;b.style.width=`${w}px`;const C=document.createElement("span");1===d.renderType||3===d.renderType&&i%10==0?C.innerText=i.toString():2===d.renderType&&(C.innerText=Math.abs(i-this._editor.getPosition().lineNumber).toString()),C.className="sticky-line-number-inner",C.style.width=`${r.lineNumbersWidth}px`,C.style.paddingLeft=`${r.lineNumbersLeft}px`,b.appendChild(C);const y=this._renderFoldingIconForLine(s,i);y&&(b.appendChild(y.domNode),y.domNode.style.left=`${r.lineNumbersWidth+r.lineNumbersLeft}px`,y.domNode.style.lineHeight=`${u}px`),this._editor.applyFontInfo(v),this._editor.applyFontInfo(b),b.style.lineHeight=`${u}px`,v.style.lineHeight=`${u}px`,b.style.height=`${u}px`,v.style.height=`${u}px`;const S=new Sne(t,i,v,b,y,f.characterMapping,v.scrollWidth,u);return this._updatePosition(S,n,o)}_updatePosition(e,t,i){const n=e.lineDomNode,o=e.lineNumberDomNode;if(i){const i="0";n.style.zIndex=i,o.style.zIndex=i;const s=`${t+this._lastLineRelativePosition+(e.foldingIcon?.isCollapsed?1:0)}px`;n.style.top=s,o.style.top=s}else{const e="1";n.style.zIndex=e,o.style.zIndex=e,n.style.top=`${t}px`,o.style.top=`${t}px`}return e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(126);if(!e||"never"===i)return;const n=e.regions,o=n.findRange(t),s=n.getStartLineNumber(o);if(t!==s)return;const r=n.isCollapsed(o),a=new xne(r,s,n.getEndLineNumber(o),this._lineHeight);return a.setVisible(!!this._isOnGlyphMargin||r||"always"===i),a.domNode.setAttribute(Cne,""),a}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:2,stackOridinal:10}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e<this._renderedStickyLines.length&&this._renderedStickyLines[e].lineDomNode.focus()}getEditorPositionFromNode(e){if(!e||e.children.length>0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=aW(t.characterMapping,e,0);return new rc(t.lineNumber,i)}getLineNumberFromChildDomNode(e){return this._getRenderedStickyLineFromChildDomNode(e)?.lineNumber??null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return null===t||t<0||t>=this._renderedStickyLines.length?null:this._renderedStickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,bne);return t?parseInt(t,10):null}isInStickyLine(e){return void 0!==this._getAttributeValue(e,wne)}isInFoldingIconDomNode(e){return void 0!==this._getAttributeValue(e,Cne)}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(null!==i)return i;e=e.parentElement}}}class Sne{constructor(e,t,i,n,o,s,r,a){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=n,this.foldingIcon=o,this.characterMapping=s,this.scrollWidth=r,this.height=a}}class xne{constructor(e,t,i,n){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=n,this.domNode=document.createElement("div"),this.domNode.style.width="26px",this.domNode.style.height=`${n}px`,this.domNode.style.lineHeight=`${n}px`,this.domNode.className=vh.asClassName(e?L9:k9)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class kne{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class Lne{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class Dne{constructor(e,t,i,n){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=n}}var Ene,Nne,Ine=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Tne=function(e,t){return function(i,n){t(i,n,e)}};!function(e){e.OUTLINE_MODEL="outlineModel",e.FOLDING_PROVIDER_MODEL="foldingProviderModel",e.INDENTATION_MODEL="indentationModel"}(Ene||(Ene={})),function(e){e[e.VALID=0]="VALID",e[e.INVALID=1]="INVALID",e[e.CANCELED=2]="CANCELED"}(Nne||(Nne={}));let Mne=class extends At{constructor(e,t,i,n){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new gi(300)),this._updateOperation=this._register(new Mt),this._editor.getOption(131).defaultModel){case Ene.OUTLINE_MODEL:this._modelProviders.push(new Rne(this._editor,n));case Ene.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new Fne(this._editor,t,n));case Ene.INDENTATION_MODEL:this._modelProviders.push(new Pne(this._editor,i))}}dispose(){this._modelProviders.forEach((e=>e.dispose())),this._updateOperation.clear(),this._cancelModelPromise(),super.dispose()}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger((async()=>{for(const t of this._modelProviders){const{statusPromise:i,modelPromise:n}=t.computeStickyModel(e);this._modelPromise=n;const o=await i;if(this._modelPromise!==n)return null;switch(o){case Nne.CANCELED:return this._updateOperation.clear(),null;case Nne.VALID:return t.stickyModel}}return null})).catch((e=>(Ie(e),null)))}};Mne=Ine([Tne(2,nc),Tne(3,BD)],Mne);class Ane extends At{constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,Nne.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=hi((e=>this.createModelFromProvider(e)));return{statusPromise:t.then((t=>this.isModelValid(t)?e.isCancellationRequested?Nne.CANCELED:(this._stickyModel=this.createStickyModel(e,t),Nne.VALID):this._invalid())).then(void 0,(e=>(Ie(e),Nne.CANCELED))),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let Rne=class extends Ane{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return G5.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){const{stickyOutlineElement:i,providerID:n}=this._stickyModelFromOutlineModel(t,this._stickyModel?.outlineProviderId),o=this._editor.getModel();return new Dne(o.uri,o.getVersionId(),i,n)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(Ct.first(e.children.values())instanceof $5){const n=Ct.find(e.children.values(),(e=>e.id===t));if(n)i=n.children;else{let n,o="",s=-1;for(const[t,i]of e.children.entries()){const e=this._findSumOfRangesOfGroup(i);e>s&&(n=i,s=e,o=i.id)}t=o,i=n.children}}else i=e.children;const n=[],o=Array.from(i.values()).sort(((e,t)=>{const i=new kne(e.symbol.range.startLineNumber,e.symbol.range.endLineNumber),n=new kne(t.symbol.range.startLineNumber,t.symbol.range.endLineNumber);return this._comparator(i,n)}));for(const e of o)n.push(this._stickyModelFromOutlineElement(e,e.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new Lne(void 0,n,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const n of e.children.values())if(n.symbol.selectionRange.startLineNumber!==n.symbol.range.endLineNumber)if(n.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(n,n.symbol.selectionRange.startLineNumber));else for(const e of n.children.values())i.push(this._stickyModelFromOutlineElement(e,n.symbol.selectionRange.startLineNumber));i.sort(((e,t)=>this._comparator(e.range,t.range)));const n=new kne(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new Lne(n,i,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const i of e.children.values())t+=this._findSumOfRangesOfGroup(i);return e instanceof q5?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};Rne=Ine([Tne(1,BD)],Rne);class One extends Ane{constructor(e){super(e),this._foldingLimitReporter=this._register(new V9(e))}createStickyModel(e,t){const i=this._fromFoldingRegions(t),n=this._editor.getModel();return new Dne(n.uri,n.getVersionId(),i,void 0)}isModelValid(e){return null!==e}_fromFoldingRegions(e){const t=e.length,i=[],n=new Lne(void 0,[],void 0);for(let o=0;o<t;o++){const t=e.getParentIndex(o);let s;s=-1!==t?i[t]:n;const r=new Lne(new kne(e.getStartLineNumber(o),e.getEndLineNumber(o)+1),[],s);s.children.push(r),i.push(r)}return n}}let Pne=class extends One{constructor(e,t){super(e),this._languageConfigurationService=t,this.provider=this._register(new C9(e.getModel(),this._languageConfigurationService,this._foldingLimitReporter))}async createModelFromProvider(e){return this.provider.compute(e)}};Pne=Ine([Tne(1,Qp)],Pne);let Fne=class extends One{constructor(e,t,i){super(e),this._languageFeaturesService=i,this.provider=this._register(new Rt),this._register(this._languageFeaturesService.foldingRangeProvider.onDidChange((()=>{this._updateProvider(e,t)}))),this._updateProvider(e,t)}_updateProvider(e,t){const i=W9.getFoldingRangeProviders(this._languageFeaturesService,e.getModel());0!==i.length&&(this.provider.value=new R9(e.getModel(),i,t,this._foldingLimitReporter,void 0))}isProviderValid(){return void 0!==this.provider}async createModelFromProvider(e){return this.provider.value?.compute(e)??null}};Fne=Ine([Tne(2,BD)],Fne);var Bne=function(e,t){return function(i,n){t(i,n,e)}};class Wne{constructor(e,t,i,n){this.startLineNumber=e,this.endLineNumber=t,this.top=i,this.height=n}}let Vne=class extends At{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new Zt),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new Mt),this._updateSoon=this._register(new Ci((()=>this.update()),50)),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(131)&&this.readConfiguration()}))),this.readConfiguration()}readConfiguration(){this._sessionStore.clear(),this._editor.getOption(131).enabled&&(this._sessionStore.add(this._editor.onDidChangeModel((()=>{this._model=null,this.updateStickyModelProvider(),this._onDidChangeStickyScroll.fire(),this.update()}))),this._sessionStore.add(this._editor.onDidChangeHiddenAreas((()=>this.update()))),this._sessionStore.add(this._editor.onDidChangeModelContent((()=>this._updateSoon.schedule()))),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange((()=>this.update()))),this._sessionStore.add(Tt((()=>{this._stickyModelProvider?.dispose(),this._stickyModelProvider=null}))),this.updateStickyModelProvider(),this.update())}getVersionId(){return this._model?.version}updateStickyModelProvider(){this._stickyModelProvider?.dispose(),this._stickyModelProvider=null,this._editor.hasModel()&&(this._stickyModelProvider=new Mne(this._editor,(()=>this._updateSoon.schedule()),this._languageConfigurationService,this._languageFeaturesService))}async update(){this._cts?.dispose(!0),this._cts=new ri,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization())return void(this._model=null);const t=await this._stickyModelProvider.update(e);e.isCancellationRequested||(this._model=t)}getCandidateStickyLinesIntersecting(e){if(!this._model?.element)return[];const t=[];return this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,t,0,0,-1),this.filterHiddenRanges(t)}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,n,o,s){const r=this._editor.getModel();if(!r)return;if(0===t.children.length)return;let a=s;const l=[];for(let e=0;e<t.children.length;e++){const i=t.children[e];i.range&&l.push(i.range.startLineNumber)}const d=this.updateIndex(ts(l,e.startLineNumber,((e,t)=>e-t))),h=this.updateIndex(ts(l,e.endLineNumber,((e,t)=>e-t)));for(let s=d;s<=h;s++){const l=t.children[s];if(!l||!l.range)continue;const{startLineNumber:d,endLineNumber:h}=l.range;if(h>d+1&&e.startLineNumber<=h+1&&d-1<=e.endLineNumber&&d!==a&&r.isValidRange(new Yu(d,1,h,1))){a=d;const t=this._editor.getLineHeightForPosition(new rc(d,1));i.push(new Wne(d,h-1,o,t)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,l,i,n+1,o+t,d)}}}filterHiddenRanges(e){const t=this._editor._getViewModel()?.getHiddenAreas();return t?e.filter((e=>!t.some((t=>e.startLineNumber>=t.startLineNumber&&e.endLineNumber<=t.endLineNumber+1)))):e}updateIndex(e){return-1===e?0:e<0?-e-2:e}};Vne=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Bne(1,BD),Bne(2,Qp)],Vne);var Hne,zne=function(e,t){return function(i,n){t(i,n,e)}};let Une=class extends At{static{Hne=this}static{this.ID="store.contrib.stickyScrollController"}constructor(e,t,i,n,o,s,r){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=n,this._contextKeyService=r,this._sessionStore=new Mt,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._mouseTarget=null,this._onDidChangeStickyScrollHeight=this._register(new Zt),this.onDidChangeStickyScrollHeight=this._onDidChangeStickyScrollHeight.event,this._stickyScrollWidget=new yne(this._editor),this._stickyLineCandidateProvider=new Vne(this._editor,i,o),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=_ne.Empty;const a=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeLineHeight((e=>{e.changes.forEach((e=>{const t=e.lineNumber;this._widgetState.startLineNumbers.includes(t)&&this._renderStickyScroll(t)}))}))),this._register(this._editor.onDidChangeFont((e=>{e.changes.forEach((e=>{const t=e.lineNumber;this._widgetState.startLineNumbers.includes(t)&&this._renderStickyScroll(t)}))}))),this._register(this._editor.onDidChangeConfiguration((e=>{this._readConfigurationChange(e)}))),this._register(ga(a,Qa.CONTEXT_MENU,(async e=>{this._onContextMenu(ta(a),e)}))),this._stickyScrollFocusedContextKey=Xu.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=Xu.stickyScrollVisible.bindTo(this._contextKeyService);const l=this._register(tl(a));this._register(l.onDidBlur((e=>{!1===this._positionRevealed&&0===a.clientHeight?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()}))),this._register(l.onDidFocus((e=>{this.focus()}))),this._registerMouseListeners(),this._register(ga(a,Qa.MOUSE_DOWN,(e=>{this._onMouseDown=!0}))),this._register(this._stickyScrollWidget.onDidChangeStickyScrollHeight((e=>{this._onDidChangeStickyScrollHeight.fire(e)}))),this._onDidResize(),this._readConfiguration()}get stickyScrollWidgetHeight(){return this._stickyScrollWidget.height}static get(e){return e.getContribution(Hne.ID)}_disposeFocusStickyScrollStore(){this._stickyScrollFocusedContextKey.set(!1),this._focusDisposableStore?.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}isFocused(){return this._focused}focus(){if(this._onMouseDown)return this._onMouseDown=!1,void this._editor.focus();!0!==this._stickyScrollFocusedContextKey.get()&&(this._focused=!0,this._focusDisposableStore=new Mt,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex<this._stickyScrollWidget.lineNumberCount-1&&this._focusNav(!0)}focusPrevious(){this._focusedStickyElementIndex>0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,(()=>this._editor.revealPosition(e)))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,(()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,0)))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(Yu.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new Mt),t=this._register(new XZ(this._editor,{extractLineNumberFromMouseEvent:e=>{const t=this._stickyScrollWidget.getEditorPositionFromNode(e.target.element);return t?t.lineNumber:0}})),i=e=>{if(!this._editor.hasModel())return null;if(12!==e.target.type||e.target.detail!==this._stickyScrollWidget.getId())return null;const t=e.target.element;if(!t||t.innerText!==t.innerHTML)return null;const i=this._stickyScrollWidget.getEditorPositionFromNode(t);return i?{range:new Yu(i.lineNumber,i.column,i.lineNumber,i.column+t.innerText.length),textElement:t}:null},n=this._stickyScrollWidget.getDomNode();this._register(ma(n,Qa.CLICK,(e=>{if(e.ctrlKey||e.altKey||e.metaKey)return;if(!e.leftButton)return;if(e.shiftKey){const t=this._stickyScrollWidget.getLineIndexFromChildDomNode(e.target);if(null===t)return;const i=new rc(this._endLineNumbers[t],1);return void this._revealLineInCenterIfOutsideViewport(i)}if(this._stickyScrollWidget.isInFoldingIconDomNode(e.target)){const t=this._stickyScrollWidget.getLineNumberFromChildDomNode(e.target);return void this._toggleFoldingRegionForLine(t)}if(!this._stickyScrollWidget.isInStickyLine(e.target))return;let t=this._stickyScrollWidget.getEditorPositionFromNode(e.target);if(!t){const i=this._stickyScrollWidget.getLineNumberFromChildDomNode(e.target);if(null===i)return;t=new rc(i,1)}this._revealPosition(t)}))),this._register(ga(r,Qa.MOUSE_MOVE,(e=>{this._mouseTarget=e.target,this._onMouseMoveOrKeyDown(e)}))),this._register(ga(r,Qa.KEY_DOWN,(e=>{this._onMouseMoveOrKeyDown(e)}))),this._register(ga(r,Qa.KEY_UP,(()=>{void 0!==this._showEndForLine&&(this._showEndForLine=void 0,this._renderStickyScroll())}))),this._register(t.onMouseMoveOrRelevantKeyDown((([t,n])=>{const o=i(t);if(!o||!t.hasTriggerModifier||!this._editor.hasModel())return void e.clear();const{range:s,textElement:r}=o;if(s.equalsRange(this._stickyRangeProjectedOnEditor)){if("underline"===r.style.textDecoration)return}else this._stickyRangeProjectedOnEditor=s,e.clear();const a=new ri;let l;e.add(Tt((()=>a.dispose(!0)))),e1(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new rc(s.startLineNumber,s.startColumn+1),!1,a.token).then((t=>{if(!a.token.isCancellationRequested)if(0!==t.length){this._candidateDefinitionsLength=t.length;const i=r;l!==i?(e.clear(),l=i,l.style.textDecoration="underline",e.add(Tt((()=>{l.style.textDecoration="none"})))):l||(l=i,l.style.textDecoration="underline",e.add(Tt((()=>{l.style.textDecoration="none"}))))}else e.clear()}))}))),this._register(t.onCancel((()=>{e.clear()}))),this._register(t.onExecute((async e=>{if(12!==e.target.type||e.target.detail!==this._stickyScrollWidget.getId())return;const t=this._stickyScrollWidget.getEditorPositionFromNode(e.target.element);t&&this._editor.hasModel()&&this._stickyRangeProjectedOnEditor&&(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:t.lineNumber,column:1})),this._instaService.invokeFunction(m1,e,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor}))})))}_onContextMenu(e,t){const i=new Je(e,t);this._contextMenuService.showContextMenu({menuId:gu.StickyScrollContext,getAnchor:()=>i})}_onMouseMoveOrKeyDown(e){if(!e.shiftKey)return;if(!this._mouseTarget||!qa(this._mouseTarget))return;const t=this._stickyScrollWidget.getLineIndexFromChildDomNode(this._mouseTarget);null!==t&&this._showEndForLine!==t&&(this._showEndForLine=t,this._renderStickyScroll())}_toggleFoldingRegionForLine(e){if(!this._foldingModel||null===e)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),i=t?.foldingIcon;if(!i)return;g9(this._foldingModel,1,[e]),i.isCollapsed=!i.isCollapsed;const n=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(75)*t.index+1;this._editor.setScrollTop(n),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(131);if(!1===e.enabled)return this._editor.removeOverlayWidget(this._stickyScrollWidget),this._resetState(),this._sessionStore.clear(),void(this._enabled=!1);e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange((e=>{e.scrollTopChanged&&(this._showEndForLine=void 0,this._renderStickyScroll())}))),this._sessionStore.add(this._editor.onDidLayoutChange((()=>this._onDidResize()))),this._sessionStore.add(this._editor.onDidChangeModelTokens((e=>this._onTokensChange(e)))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll((()=>{this._showEndForLine=void 0,this._renderStickyScroll()}))),this._enabled=!0),2===this._editor.getOption(76).renderType&&this._sessionStore.add(this._editor.onDidChangeCursorPosition((()=>{this._showEndForLine=void 0,this._renderStickyScroll(0)})))}_readConfigurationChange(e){(e.hasChanged(131)||e.hasChanged(81)||e.hasChanged(75)||e.hasChanged(126)||e.hasChanged(76))&&this._readConfiguration(),(e.hasChanged(76)||e.hasChanged(52)||e.hasChanged(126))&&this._renderStickyScroll(0)}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const t of e.ranges)if(i>=t.fromLineNumber&&i<=t.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(0)}_onDidResize(){const e=this._editor.getLayoutInfo().height/this._editor.getOption(75);this._maxStickyLines=Math.round(.25*e),this._renderStickyScroll(0)}async _renderStickyScroll(e){const t=this._editor.getModel();if(!t||t.isTooLargeForTokenization())return void this._resetState();const i=this._updateAndGetMinRebuildFromLine(e),n=this._stickyLineCandidateProvider.getVersionId();if(void 0===n||n===t.getVersionId())if(this._focused)if(-1===this._focusedStickyElementIndex)await this._updateState(i),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,-1!==this._focusedStickyElementIndex&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const e=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];await this._updateState(i),0===this._stickyScrollWidget.lineNumberCount?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(e)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}else await this._updateState(i)}_updateAndGetMinRebuildFromLine(e){if(void 0!==e){const t=void 0!==this._minRebuildFromLine?this._minRebuildFromLine:1/0;this._minRebuildFromLine=Math.min(e,t)}return this._minRebuildFromLine}async _updateState(e){this._minRebuildFromLine=void 0,this._foldingModel=await(W9.get(this._editor)?.getFoldingModel())??void 0,this._widgetState=this.findScrollWidgetState();const t=this._widgetState.startLineNumbers.length>0;this._stickyScrollVisibleContextKey.set(t),this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e)}async _resetState(){this._minRebuildFromLine=void 0,this._foldingModel=void 0,this._widgetState=_ne.Empty,this._stickyScrollVisibleContextKey.set(!1),this._stickyScrollWidget.setState(void 0,void 0)}findScrollWidgetState(){const e=Math.min(this._maxStickyLines,this._editor.getOption(131).maxLineCount),t=this._editor.getScrollTop();let i=0;const n=[],o=[],s=this._editor.getVisibleRanges();if(0!==s.length){const r=new kne(s[0].startLineNumber,s[s.length-1].endLineNumber),a=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(r);for(const s of a){const r=s.startLineNumber,a=s.endLineNumber,l=s.top,d=l+s.height,h=this._editor.getTopForLineNumber(r)-t,c=this._editor.getBottomForLineNumber(a)-t;if(l>h&&l<=c&&(n.push(r),o.push(a+1),d>c&&(i=c-d)),n.length===e)break}}return this._endLineNumbers=o,new _ne(n,o,i,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};Une=Hne=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([zne(1,DR),zne(2,BD),zne(3,nc),zne(4,Qp),zne(5,Bq),zne(6,eu)],Une);const Kne=Ff("inlineEdit.originalBackground",Vf(U_,.2),y(1210,"Background color for the original text in inline edits."),!0),jne=Ff("inlineEdit.modifiedBackground",Vf(z_,.3),y(1211,"Background color for the modified text in inline edits."),!0),qne=(Ff("inlineEdit.originalChangedLineBackground",Vf(U_,.8),y(1212,"Background color for the changed lines in the original text of inline edits."),!0),Ff("inlineEdit.originalChangedTextBackground",Vf(U_,.8),y(1213,"Overlay color for the changed text in the original text of inline edits."),!0)),$ne=Ff("inlineEdit.modifiedChangedLineBackground",{light:Vf(K_,.7),dark:Vf(K_,.7),hcDark:K_,hcLight:K_},y(1214,"Background color for the changed lines in the modified text of inline edits."),!0),Gne=Ff("inlineEdit.modifiedChangedTextBackground",Vf(z_,.7),y(1215,"Overlay color for the changed text in the modified text of inline edits."),!0),Zne=Ff("inlineEdit.gutterIndicator.primaryForeground",Vv,y(1216,"Foreground color for the primary inline edit gutter indicator.")),Yne=Ff("inlineEdit.gutterIndicator.primaryBorder",zv,y(1217,"Border color for the primary inline edit gutter indicator.")),Qne=Ff("inlineEdit.gutterIndicator.primaryBackground",{light:Vf(Yne,.5),dark:Vf(Yne,.4),hcDark:Vf(Yne,.4),hcLight:Vf(Yne,.5)},y(1218,"Background color for the primary inline edit gutter indicator.")),Xne=Ff("inlineEdit.gutterIndicator.secondaryForeground",jv,y(1219,"Foreground color for the secondary inline edit gutter indicator.")),Jne=Ff("inlineEdit.gutterIndicator.secondaryBorder",qv,y(1220,"Border color for the secondary inline edit gutter indicator.")),eoe=Ff("inlineEdit.gutterIndicator.secondaryBackground",Jne,y(1221,"Background color for the secondary inline edit gutter indicator.")),toe=Ff("inlineEdit.gutterIndicator.successfulForeground",Vv,y(1222,"Foreground color for the successful inline edit gutter indicator.")),ioe=Ff("inlineEdit.gutterIndicator.successfulBorder",zv,y(1223,"Border color for the successful inline edit gutter indicator.")),noe=Ff("inlineEdit.gutterIndicator.successfulBackground",ioe,y(1224,"Background color for the successful inline edit gutter indicator.")),ooe=Ff("inlineEdit.gutterIndicator.background",{hcDark:Vf("tab.inactiveBackground",.5),hcLight:Vf("tab.inactiveBackground",.5),dark:Vf("tab.inactiveBackground",.5),light:"#5f5f5f18"},y(1225,"Background color for the inline edit gutter indicator.")),soe=Ff("inlineEdit.originalBorder",{light:U_,dark:U_,hcDark:U_,hcLight:U_},y(1226,"Border color for the original text in inline edits.")),roe=Ff("inlineEdit.modifiedBorder",{light:Bf(z_,.6),dark:z_,hcDark:z_,hcLight:z_},y(1227,"Border color for the modified text in inline edits.")),aoe=Ff("inlineEdit.tabWillAcceptModifiedBorder",{light:Bf(roe,0),dark:Bf(roe,0),hcDark:Bf(roe,0),hcLight:Bf(roe,0)},y(1228,"Modified border color for the inline edits widget when tab will accept it.")),loe=Ff("inlineEdit.tabWillAcceptOriginalBorder",{light:Bf(soe,0),dark:Bf(soe,0),hcDark:Bf(soe,0),hcLight:Bf(soe,0)},y(1229,"Original border color for the inline edits widget over the original text when tab will accept it."));function doe(e){return e.map((e=>e===dte.Accept?aoe:roe))}function hoe(e){return e.map((e=>e===dte.Accept?loe:soe))}function coe(e,t){let i;i="string"==typeof e?uoe(e,t):e.map(((e,i)=>uoe(e,t).read(i)));const n=uoe(a_,t);return i.map(((e,t)=>e.makeOpaque(n.read(t))))}function uoe(e,t){return xr({owner:{observeColor:e},equalsFn:(e,t)=>e.equals(t),debugName:()=>`observeColor(${e})`},t.onDidColorThemeChange,(()=>{const i=t.getColorTheme().getColor(e);if(!i)throw new Ve(`Missing color: ${e}`);return i}))}function goe(e,t,i){e.layoutInfo.read(i),e.value.read(i);const n=e.model.read(i);if(!n)return 0;let o=0;e.scrollTop.read(i);for(let i=t.startLineNumber;i<t.endLineNumberExclusive;i++){const t=n.getLineMaxColumn(i);let s=e.editor.getOffsetForColumn(i,t);-1===s&&(s=t*e.editor.getOption(59).typicalHalfwidthCharacterWidth),o=Math.max(o,s)}const s=t.mapToLineArray((e=>n.getLineContent(e)));return o<5&&s.some((e=>e.length>0))&&"file"!==n.uri.scheme&&console.error("unexpected width"),o}function poe(e,t,i,n){const o=n.getModel();if(!o)return{prefixTrim:0,prefixLeftOffset:0};const s=e.map((e=>e.isSingleLine()?e.startColumn-1:0)),r=t.mapToLineArray((e=>dk(o.getLineContent(e)))),a=i.filter((e=>""!==e)).map((e=>dk(e))),l=Math.min(...s,...r,...a);let d;if(o.getLineIndentColumn(t.startLineNumber)>=l+1)d=n.getOffsetForColumn(t.startLineNumber,l+1);else{if(!(i.length>0))return{prefixTrim:0,prefixLeftOffset:0};d=moe(i[0].slice(0,l),n,o)}return{prefixTrim:l,prefixLeftOffset:d}}function moe(e,t,i){const n=t.getOption(59).typicalHalfwidthCharacterWidth,o=i.getOptions().tabSize*n,s=e.split("\t").length-1;return(e.length-s)*n+s*o}function foe(e){const t=e.layoutInfoContentLeft,i=pr({name:"editor.validOverlay.width"},(i=>{const n=0!==e.layoutInfoMinimap.read(i).minimapLeft,o=e.layoutInfoWidth.read(i)-t.read(i);return n?o-(e.layoutInfoMinimap.read(i).minimapWidth+e.layoutInfoVerticalScrollbarWidth.read(i)):o})),n=pr({name:"editor.validOverlay.height"},(t=>e.layoutInfoHeight.read(t)+e.contentHeight.read(t)));return pr({name:"editor.validOverlay"},(e=>pne.fromLeftTopWidthHeight(t.read(e),0,i.read(e),n.read(e))))}function _oe(...e){return e.filter((e=>"string"==typeof e)).join(" ")}class voe{constructor(){this._data=""}moveTo(e){return this._data+=`M ${e.x} ${e.y} `,this}lineTo(e){return this._data+=`L ${e.x} ${e.y} `,this}build(){return this._data}}function boe(e){const t=Tr(void 0,((t,i)=>e.read(t)||i));return fr({debugName:()=>`${e.debugName}.mapOutFalsy`},(i=>{if(t.read(i),e.read(i))return t}))}function woe(e){return{left:pr({name:"editor.validOverlay.left"},(t=>e(t).left)),top:pr({name:"editor.validOverlay.top"},(t=>e(t).top)),width:pr({name:"editor.validOverlay.width"},(t=>e(t).right-e(t).left)),height:pr({name:"editor.validOverlay.height"},(t=>e(t).bottom-e(t).top))}}var Coe=function(e,t){return function(i,n){t(i,n,e)}};let yoe=class{constructor(e,t,i,n,o,s){this._model=e,this._close=t,this._editorObs=i,this._contextKeyService=n,this._keybindingService=o,this._commandService=s,this._inlineEditsShowCollapsed=this._editorObs.getOption(71).map((e=>e.edits.showCollapsed))}toDisposableLiveElement(){return this._createHoverContent().toDisposableLiveElement()}_createHoverContent(){const e=Js("active",void 0),t=t=>({title:t.title,icon:t.icon,keybinding:"string"==typeof t.commandId?this._getKeybinding(t.commandArgs?void 0:t.commandId):pr(this,(e=>"string"==typeof t.commandId?void 0:this._getKeybinding(t.commandArgs?void 0:t.commandId.read(e)).read(e))),isActive:e.map((e=>e===t.id)),onHoverChange:i=>e.set(i?t.id:void 0,void 0),onAction:()=>(this._close(!0),this._commandService.executeCommand("string"==typeof t.commandId?t.commandId:t.commandId.get(),...t.commandArgs??[]))}),i=function(e){return bl.div({class:"header",style:{color:Af(Gf),fontSize:"13px",fontWeight:"600",padding:"0 4px",lineHeight:28}},[e])}(this._model.displayName),n=Soe(t({id:"gotoAndAccept",title:`${y(1203,"Go To")} / ${y(1204,"Accept")}`,icon:fh.check,commandId:lG})),o=Soe(t({id:"reject",title:y(1205,"Reject"),icon:fh.close,commandId:cG})),s=this._model.extensionCommands.map(((e,i)=>Soe(t({id:e.command.id+"_"+i,title:e.command.title,icon:e.icon??fh.symbolEvent,commandId:e.command.id,commandArgs:e.command.arguments})))),r=this._inlineEditsShowCollapsed.map((e=>Soe(t(e?{id:"showExpanded",title:y(1206,"Show Expanded"),icon:fh.expandAll,commandId:uG}:{id:"showCollapsed",title:y(1207,"Show Collapsed"),icon:fh.collapseAll,commandId:uG})))),a=Soe(t({id:"settings",title:y(1208,"Settings"),icon:fh.gear,commandId:"workbench.action.openSettings",commandArgs:["@tag:nextEditSuggestions"]})),l=this._model.action?[this._model.action]:[],d=l.length>0?function(e,t){return pr({name:"inlineEdits.actionBar"},(i=>bl.div({class:["action-widget-action-bar"],style:{padding:"3px 24px"}},[bl.div({ref:n=>{i.store.add(new uR(n,t)).push(e,{icon:!1,label:!0})}})])))}(l.map((e=>({id:e.id,label:e.title+"...",enabled:!0,run:()=>this._commandService.executeCommand(e.id,...e.arguments??[]),class:void 0,tooltip:e.tooltip??e.title}))),{hoverDelegate:rZ}):void 0;return h=[i,n,o,r,s.length?xoe():void 0,a,...s,d?xoe():void 0,d],bl.div({class:"content",style:{margin:4,minWidth:180}},h);var h}_getKeybinding(e){return e?Sr(this._contextKeyService.onDidChangeContext,(()=>this._keybindingService.lookupKeybinding(e))):Or(void 0)}};function Soe(e){return pr({name:"inlineEdits.option"},(t=>bl.div({class:["monaco-menu-option",e.isActive?.map((e=>e&&"active"))],onmouseenter:()=>e.onHoverChange?.(!0),onmouseleave:()=>e.onHoverChange?.(!1),onclick:e.onAction,onkeydown:t=>{"Enter"===t.key&&e.onAction?.()},tabIndex:0,style:{borderRadius:3}},[bl.elem("span",{style:{fontSize:16,display:"flex"}},[vh.isThemeIcon(e.icon)?wI(e.icon):e.icon.map((e=>wI(e)))]),bl.elem("span",{},[e.title]),bl.div({style:{marginLeft:"auto"},ref:i=>{const n=t.store.add(new kR(i,se,{disableTitle:!0,...NR,keybindingLabelShadow:void 0,keybindingLabelForeground:Af(Gf),keybindingLabelBackground:"transparent",keybindingLabelBorder:"transparent",keybindingLabelBottomBorder:void 0}));t.store.add(ar((t=>{n.set(e.keybinding.read(t))})))}})])))}function xoe(){return bl.div({id:"inline-edit-gutter-indicator-menu-separator",class:"menu-separator",style:{color:Af(Bb),padding:"2px 0"}},bl.div({style:{borderBottom:`1px solid ${Af(M_)}`}}))}yoe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Coe(3,eu),Coe(4,ER),Coe(5,mc)],yoe);var koe=function(e,t){return function(i,n){t(i,n,e)}};let Loe=class extends At{get model(){const e=this._model.get();if(!e)throw new Ve("Inline Edit Model not available");return e}constructor(e,t,i,n,o,s,r,a,l,d){super(),this._editorObs=e,this._originalRange=t,this._verticalOffset=i,this._model=n,this._isHoveringOverInlineEdit=o,this._focusIsInMenu=s,this._hoverService=r,this._instantiationService=a,this._accessibilityService=l,this._tabAction=pr(this,(e=>{const t=this._model.read(e);return t?t.tabAction.read(e):dte.Inactive})),this._hoverVisible=Js(this,!1),this.isHoverVisible=this._hoverVisible,this._isHoveredOverIcon=Js(this,!1),this._isHoveredOverIconDebounced=Er(this._isHoveredOverIcon,100),this.isHoveredOverIcon=this._isHoveredOverIconDebounced,this._isHoveredOverInlineEditDebounced=Er(this._isHoveringOverInlineEdit,100),this._gutterIndicatorStyles=this._tabAction.map(this,((e,t)=>{switch(e){case dte.Inactive:return{background:coe(eoe,d).read(t).toString(),foreground:coe(Xne,d).read(t).toString(),border:coe(Jne,d).read(t).toString()};case dte.Jump:return{background:coe(Qne,d).read(t).toString(),foreground:coe(Zne,d).read(t).toString(),border:coe(Yne,d).read(t).toString()};case dte.Accept:return{background:coe(noe,d).read(t).toString(),foreground:coe(toe,d).read(t).toString(),border:coe(ioe,d).read(t).toString()};default:nt()}})),this._originalRangeObs=boe(this._originalRange),this._state=pr(this,(e=>{const t=this._originalRangeObs.read(e);if(t)return{range:t,lineOffsetRange:this._editorObs.observeLineOffsetRange(t,this._store)}})),this._stickyScrollController=Une.get(this._editorObs.editor),this._stickyScrollHeight=this._stickyScrollController?Sr(this._stickyScrollController.onDidChangeStickyScrollHeight,(()=>this._stickyScrollController.stickyScrollWidgetHeight)):Or(0),this._lineNumberToRender=pr(this,(e=>{if(0!==this._verticalOffset.read(e))return"";const t=this._originalRange.read(e)?.startLineNumber,i=this._editorObs.getOption(76).read(e);if(void 0===t||0===i.renderType)return"";if(3===i.renderType){const i=this._editorObs.cursorPosition.read(e);return t%10==0||i&&i.lineNumber===t?t.toString():""}if(2===i.renderType){const i=this._editorObs.cursorPosition.read(e);if(!i)return"";const n=Math.abs(t-i.lineNumber);return 0===n?t.toString():n.toString()}return 4===i.renderType?i.renderFn?i.renderFn(t):"":t.toString()})),this._availableWidthForIcon=pr(this,(e=>{const t=this._editorObs.editor.getModel(),i=this._editorObs.editor,n=this._editorObs.layoutInfo.read(e),o=n.decorationsLeft+n.decorationsWidth-n.glyphMarginLeft;if(!t||o<=0)return()=>0;if(0===n.lineNumbersLeft)return()=>o;const s=this._editorObs.getOption(76).read(e);if(2===s.renderType||0===s.renderType)return()=>o;const r=i.getOption(59).typicalHalfwidthCharacterWidth,a=n.lineNumbersLeft+n.lineNumbersWidth,l=(t.getLineCount()+1).toString().length,d=[];for(let e=1;e<=l;e++){const t=10**(e-1),s=i.getTopForLineNumber(t),l=e*r,h=Math.min(o,Math.max(0,a-l-n.glyphMarginLeft));d.push({firstLineNumberWithDigitCount:t,topOfLineNumber:s,usableWidthLeftOfLineNumber:h})}return e=>{for(let t=d.length-1;t>=0;t--)if(e>=d[t].topOfLineNumber)return d[t].usableWidthLeftOfLineNumber;throw new Ve("Could not find avilable width for icon")}})),this._layout=pr(this,(e=>{const t=this._state.read(e);if(!t)return;const i=this._editorObs.layoutInfo.read(e),n=this._editorObs.observeLineHeightForLine(t.range.map((e=>e.startLineNumber))).read(e),o=i.decorationsLeft+i.decorationsWidth-i.glyphMarginLeft-4,s=i.height-4,r=pne.fromLeftTopWidthHeight(2,2,o,s),a=r.withTop(this._stickyScrollHeight.read(e)),l=r.withTop(a.top+2),d=t.lineOffsetRange.read(e),h=pne.fromRanges(cm.fromTo(l.left,l.right),d),c=n,u=this._verticalOffset.read(e),g=h.withHeight(c).translateY(u),p=a.containsRect(g),m=this._tabAction.map((e=>e===dte.Accept?fh.keyboardTab:fh.arrowRight)),f=pr(this,(e=>this._isHoveredOverIconDebounced.read(e)||this._isHoveredOverInlineEditDebounced.read(e)?fh.check:this._tabAction.read(e)===dte.Accept?fh.keyboardTab:(this._editorObs.cursorLineNumber.read(e)??0)<=t.range.read(e).startLineNumber?fh.keyboardTabAbove:fh.keyboardTabBelow)),_=e=>{const t=this._availableWidthForIcon.read(void 0)(e.bottom+this._editorObs.editor.getScrollTop())-2;return Math.max(Math.min(t,22),16)};if(p){const e=g;let t;t=0===i.lineNumbersWidth?Math.min(Math.max(i.lineNumbersLeft-r.left,0),e.width-22):Math.max(i.lineNumbersLeft+i.lineNumbersWidth-r.left,0);const n=e.withWidth(t),o=Math.max(Math.min(i.decorationsWidth,22),16);return{gutterEditArea:h,icon:f,iconDirection:"right",iconRect:e.withWidth(o).translateX(t),pillRect:e,lineNumberRect:n}}const v=r.intersect(h);if(v&&v.height>=c){const e=g.moveToBeContainedIn(l).moveToBeContainedIn(v),t=e.withWidth(_(e));return{gutterEditArea:h,icon:f,iconDirection:"right",iconRect:t,pillRect:t}}const b=g.moveToBeContainedIn(r),w=b.withWidth(_(b)),C=w;return{gutterEditArea:h,icon:m,iconDirection:w.top<g.top?"top":"bottom",iconRect:C,pillRect:w}})),this._iconRef=bl.ref(),this.isVisible=this._layout.map((e=>!!e)),this._indicator=bl.div({class:"inline-edits-view-gutter-indicator",onclick:()=>{const e=this._layout.get(),t=e?.icon.get()===fh.check;this._editorObs.editor.focus(),t?this.model.accept():this.model.jump()},tabIndex:0,style:{position:"absolute",overflow:"visible"}},boe(this._layout).map((e=>e?[bl.div({style:{position:"absolute",background:Af(ooe),borderRadius:"4px",...woe((t=>e.read(t).gutterEditArea))}}),bl.div({class:"icon",ref:this._iconRef,onmouseenter:()=>{this._showHover()},style:{cursor:"pointer",zIndex:"20",position:"absolute",backgroundColor:this._gutterIndicatorStyles.map((e=>e.background)),"--vscodeIconForeground":this._gutterIndicatorStyles.map((e=>e.foreground)),border:this._gutterIndicatorStyles.map((e=>`1px solid ${e.border}`)),boxSizing:"border-box",borderRadius:"4px",display:"flex",justifyContent:"flex-end",transition:"background-color 0.2s ease-in-out, width 0.2s ease-in-out",...woe((t=>e.read(t).pillRect))}},[bl.div({className:"line-number",style:{lineHeight:e.map((e=>e.lineNumberRect?e.lineNumberRect.height:0)),display:e.map((e=>e.lineNumberRect?"flex":"none")),alignItems:"center",justifyContent:"flex-end",width:e.map((e=>e.lineNumberRect?e.lineNumberRect.width:0)),height:"100%",color:this._gutterIndicatorStyles.map((e=>e.foreground))}},this._lineNumberToRender),bl.div({style:{rotate:e.map((e=>`${function(e){switch(e){case"top":return 90;case"bottom":return-90;case"right":return 0}}(e.iconDirection)}deg`)),transition:"rotate 0.2s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",marginRight:e.map((e=>e.pillRect.width-e.iconRect.width-(e.lineNumberRect?.width??0))),width:e.map((e=>e.iconRect.width))}},[e.map(((e,t)=>wI(e.icon.read(t))))])])]:[]))).keepUpdated(this._store),this._register(this._editorObs.createOverlayWidget({domNode:this._indicator.element,position:Or(null),allowEditorOverflow:!1,minContentWidthInPx:Or(0)})),this._register(this._editorObs.editor.onMouseMove((e=>{if(void 0===this._state.get())return;const t=this._iconRef.element.getBoundingClientRect(),i=pne.fromLeftTopWidthHeight(t.left,t.top,t.width,t.height),n=new vY(e.event.posx,e.event.posy);this._isHoveredOverIcon.set(i.containsPoint(n),void 0)}))),this._register(this._editorObs.editor.onDidScrollChange((()=>{this._isHoveredOverIcon.set(!1,void 0)}))),this._register(Wr(this._isHoveredOverInlineEditDebounced,(e=>{e&&this.triggerAnimation()}))),this._register(ar((e=>{this._indicator.readEffect(e),this._indicator.element&&this._editorObs.editor.applyFontInfo(this._indicator.element)})))}triggerAnimation(){if(this._accessibilityService.isMotionReduced())return new Animation(null,null).finished;const e=this._iconRef.element.animate([{outline:`2px solid ${this._gutterIndicatorStyles.map((e=>e.border)).get()}`,outlineOffset:"-1px",offset:0},{outline:"2px solid transparent",outlineOffset:"10px",offset:1}],{duration:500});return e.finished}_showHover(){if(this._hoverVisible.get())return;const e=new Mt,t=e.add(this._instantiationService.createInstance(yoe,this.model,(e=>{e&&this._editorObs.editor.focus(),n?.dispose()}),this._editorObs).toDisposableLiveElement()),i=e.add(tl(t.element));e.add(i.onDidBlur((()=>this._focusIsInMenu.set(!1,void 0)))),e.add(i.onDidFocus((()=>this._focusIsInMenu.set(!0,void 0)))),e.add(Tt((()=>this._focusIsInMenu.set(!1,void 0))));const n=this._hoverService.showInstantHover({target:this._iconRef.element,content:t.element});n?(this._hoverVisible.set(!0,void 0),e.add(this._editorObs.editor.onDidScrollChange((()=>n.dispose()))),e.add(n.onDispose((()=>{this._hoverVisible.set(!1,void 0),e.dispose()})))):e.dispose()}};Loe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([koe(6,oZ),koe(7,nc),koe(8,rB),koe(9,sw)],Loe);var Doe,Eoe=function(e,t){return function(i,n){t(i,n,e)}};!function(e){e.FirstTime="firstTime",e.SecondTime="secondTime",e.Active="active"}(Doe||(Doe={}));let Noe=class extends At{constructor(e,t,i,n,o,s){super(),this._host=e,this._model=t,this._indicator=i,this._collapsedView=n,this._storageService=o,this._configurationService=s,this._disposables=this._register(new Rt),this._setupDone=Js({name:"setupDone"},!1),this._activeCompletionId=pr((e=>{const t=this._model.read(e);if(!t)return;if(!this._setupDone.read(e))return;const i=this._indicator.read(e);return i&&i.isVisible.read(e)?t.inlineEdit.inlineCompletion.identity.id:void 0})),this._register(this._initializeDebugSetting()),this._disposables.value=this.setupNewUserExperience(),this._setupDone.set(!0,void 0)}setupNewUserExperience(){if(this.getNewUserType()===Doe.Active)return;const e=new Mt;let t=!1,i=!1,n=0,o=0;var s,r;return e.add((s=this._activeCompletionId,r=async(e,s,r,a)=>{if(void 0===e)return;let l=this.getNewUserType();switch(l){case Doe.FirstTime:(n++>=5||t)&&(l=Doe.SecondTime,this.setNewUserType(l));break;case Doe.SecondTime:o++>=3&&i&&(l=Doe.Active,this.setNewUserType(l))}switch(l){case Doe.FirstTime:for(let e=0;e<3&&!a.isCancellationRequested;e++)await(this._indicator.get()?.triggerAnimation()),await mi(500);break;case Doe.SecondTime:this._indicator.get()?.triggerAnimation()}},Vr(s,((e,t,i,n)=>{r(e,0,0,ai(n))})))),e.add(ar((e=>{this._collapsedView.isVisible.read(e)&&this.getNewUserType()!==Doe.Active&&this._collapsedView.triggerAnimation()}))),e.add(hr(((e,i)=>{const n=this._indicator.read(e);n&&i.add(Wr(n.isHoveredOverIcon,(async e=>{e&&(t=!0)})))}))),e.add(hr(((e,t)=>{const n=this._host.read(e);n&&t.add(n.onDidAccept((()=>{i=!0})))}))),e}getNewUserType(){return this._storageService.get("inlineEditsGutterIndicatorUserKind",-1,Doe.FirstTime)}setNewUserType(e){switch(e){case Doe.FirstTime:throw new Ve("UserKind should not be set to first time");case Doe.SecondTime:break;case Doe.Active:this._disposables.clear()}this._storageService.store("inlineEditsGutterIndicatorUserKind",e,-1,0)}_initializeDebugSetting(){const e="editor.inlineSuggest.edits.resetNewUserExperience";return this._configurationService.getValue(e)&&this._storageService.remove("inlineEditsGutterIndicatorUserKind",-1),this._configurationService.onDidChangeConfiguration((t=>{t.affectsConfiguration(e)&&this._configurationService.getValue(e)&&(this._storageService.remove("inlineEditsGutterIndicatorUserKind",-1),this._disposables.value=this.setupNewUserExperience())}))}};Noe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Eoe(4,Sq),Eoe(5,up)],Noe);let Ioe=class extends At{constructor(e,t,i){super(),this._editor=e,this._edit=t,this._accessibilityService=i,this._onDidClick=this._register(new Zt),this.onDidClick=this._onDidClick.event,this._iconRef=bl.ref(),this.isHovered=Or(!1),this._editorObs=bY(this._editor);const n=this._edit.map((e=>e?.edit.replacements[0]??null)).map((e=>e?Hee(e,this._editor.getModel()).range.getStartPosition():null)),o=this._editorObs.observePosition(n,this._store),s=pr((e=>{const t=o.read(e);if(!t)return null;const i=this._editorObs.layoutInfoContentLeft.read(e),n=this._editorObs.scrollLeft.read(e);return new vY(i+t.x-n,t.y)})),r=bl.div({class:"inline-edits-collapsed-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:"block"}},[[this.getCollapsedIndicator(s)]]).keepUpdated(this._store).element;this._register(this._editorObs.createOverlayWidget({domNode:r,position:Or(null),allowEditorOverflow:!1,minContentWidthInPx:Or(0)})),this.isVisible=this._edit.map(((e,t)=>!!e&&null!==s.read(t)))}triggerAnimation(){return this._accessibilityService.isMotionReduced()?new Animation(null,null).finished:this._iconRef.element.animate([{offset:0,transform:"translateY(-3px)"},{offset:.2,transform:"translateY(1px)"},{offset:.36,transform:"translateY(-1px)"},{offset:.52,transform:"translateY(1px)"},{offset:.68,transform:"translateY(-1px)"},{offset:.84,transform:"translateY(1px)"},{offset:1,transform:"translateY(0px)"}],{duration:2e3}).finished}getCollapsedIndicator(e){const t=this._editorObs.layoutInfoContentLeft,i=e.map(((e,i)=>e?e.deltaX(-t.read(i)):null)),n=this.createIconPath(i);return bl.svg({class:"collapsedView",ref:this._iconRef,style:{position:"absolute",...woe((e=>foe(this._editorObs).read(e))),overflow:"hidden",pointerEvents:"none"}},[bl.svgElem("path",{class:"collapsedViewPath",d:n,fill:Af(Yne)})])}createIconPath(e){return e.map((e=>{if(!e)return(new voe).build();const t=e.deltaX(-3).deltaY(-1),i=t.deltaX(6),n=t.deltaY(1),o=i.deltaY(1),s=n.deltaX(3).deltaY(3);return(new voe).moveTo(t).lineTo(i).lineTo(o).lineTo(s).lineTo(n).lineTo(t).build()}))}};Ioe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(2,rB)],Ioe);var Toe=function(e,t){return function(i,n){t(i,n,e)}};let Moe=class extends At{constructor(e,t,i,n,o){super(),this._editor=e,this._languageService=o,this._onDidClick=this._register(new Zt),this.onDidClick=this._onDidClick.event,this._isHovered=Js(this,!1),this.isHovered=this._isHovered,this._viewRef=bl.ref(),this._editorObs=bY(this._editor);const s=i.map(((e,t)=>{let i;switch(e){case dte.Inactive:i=eoe;break;case dte.Jump:i=Qne;break;case dte.Accept:i=noe}return{border:coe(i,n).read(t).toString(),background:Af(a_)}})),r=t.map((e=>e?this.getState(e):void 0)),a=r.map((e=>e?this.getRendering(e,s):void 0));this.minEditorScrollHeight=pr(this,(e=>{const t=r.read(e);return t?t.rect.read(e).bottom+this._editor.getScrollTop():0}));const l=bl.div({class:"inline-edits-custom-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:"block"}},[a]).keepUpdated(this._store);this._register(this._editorObs.createOverlayWidget({domNode:l.element,position:Or(null),allowEditorOverflow:!1,minContentWidthInPx:Tr(this,((e,t)=>{const i=r.read(e);if(!i)return t??0;const n=i.rect.map((e=>e.right)).read(e)+this._editorObs.layoutInfoVerticalScrollbarWidth.read(e)+4-this._editorObs.layoutInfoContentLeft.read(e);return Math.max(t??0,n)})).recomputeInitiallyAndOnChange(this._store)})),this._register(ar((e=>{a.read(e)?this._isHovered.set(l.isHovered.read(e),void 0):this._isHovered.set(!1,void 0)})))}fitsInsideViewport(e,t,i){const n=this._editorObs.layoutInfoWidth.read(i),o=this._editorObs.layoutInfoContentLeft.read(i),s=this._editor.getLayoutInfo().verticalScrollbarWidth,r=0!==this._editorObs.layoutInfoMinimap.read(i).minimapLeft?this._editorObs.layoutInfoMinimap.read(i).minimapWidth:0;return goe(this._editorObs,e,void 0)+moe(t,this._editor,this._editor.getModel())+18<n-o-s-r}getState(e){const t=pr(this,(t=>{const i=e.range.startLineNumber,n=e.range.endLineNumber,o=e.range.startColumn,s=e.range.endColumn,r=this._editor.getModel()?.getLineCount()??0;return{lineWidth:goe(this._editorObs,new ym(i,i+1),t),lineWidthBelow:i+1<=r?goe(this._editorObs,new ym(i+1,i+2),t):void 0,lineWidthAbove:i-1>=1?goe(this._editorObs,new ym(i-1,i),t):void 0,startContentLeftOffset:this._editor.getOffsetForColumn(i,o),endContentLeftOffset:this._editor.getOffsetForColumn(n,s)}})),i=e.range.startLineNumber,n=e.range.endLineNumber,o=this.fitsInsideViewport(new ym(i,n+1),e.label,void 0),s=pr(this,(s=>{const r=this._editorObs.getOption(59).read(s).typicalHalfwidthCharacterWidth,{lineWidth:a,lineWidthBelow:l,lineWidthAbove:d,startContentLeftOffset:h,endContentLeftOffset:c}=t.read(s),u=this._editorObs.layoutInfoContentLeft.read(s),g=this._editorObs.observeLineHeightForLine(i).recomputeInitiallyAndOnChange(s.store).read(s),p=this._editorObs.scrollTop.read(s),m=this._editorObs.scrollLeft.read(s);let f,_,v;f=i===n&&c+5*r>=a&&o?"end":void 0!==l&&l+14-4-4<h?"below":void 0!==d&&d+14-4-4<h?"above":"end";let b=0,w=0;switch(f){case"end":_=this._editorObs.editor.getTopForLineNumber(i),v=a,b=18;break;case"below":_=this._editorObs.editor.getTopForLineNumber(i+1),v=h,b=8,w=2;break;case"above":_=this._editorObs.editor.getTopForLineNumber(i-1),v=h,b=8,w=2}return pne.fromLeftTopWidthHeight(u+v-m,_-p,r*e.label.length,g).withMargin(0,4).translateX(b).translateY(w)}));return{rect:s,label:e.label,kind:e.kind}}getRendering(e,t){const i=document.createElement("div"),n=this._editor.getModel().tokenization.tokenizeLinesAt(1,[e.label])?.[0];let o;o=n&&e.kind===BS.Code?pS.fromLineTokens(n).toLineTokens(e.label,this._languageService.languageIdCodec):uS.createEmpty(e.label,this._languageService.languageIdCodec);const s=q4(new $4([o]),G4.fromEditor(this._editor).withSetWidth(!1).withScrollBeyondLastColumn(0),[],i,!0);i.style.width=`${s.minWidthInPx}px`;const r=e.rect.map((e=>e.withMargin(0,4)));return bl.div({class:"collapsedView",ref:this._viewRef,style:{position:"absolute",...woe((e=>r.read(e))),overflow:"hidden",boxSizing:"border-box",cursor:"pointer",border:t.map((e=>`1px solid ${e.border}`)),borderRadius:"4px",backgroundColor:t.map((e=>e.background)),display:"flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap"},onmousedown:e=>{e.preventDefault()},onclick:e=>{this._onDidClick.fire(new Je(ta(e),e))}},[i])}};Moe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Toe(3,sw),Toe(4,Tg)],Moe);class Aoe extends At{constructor(e,t,i,n){super(),this._editor=e,this._edit=t,this._uiState=i,this._tabAction=n,this._onDidClick=this._register(new Zt),this.onDidClick=this._onDidClick.event,this._display=pr(this,(e=>this._uiState.read(e)?"block":"none")),this._editorMaxContentWidthInRange=pr(this,(e=>{const t=this._originalDisplayRange.read(e);return t?(this._editorObs.versionId.read(e),Tr(this,((e,i)=>{const n=goe(this._editorObs,t,e);return Math.max(n,i??0)}))):Or(0)})).map(((e,t)=>e.read(t))),this._maxPrefixTrim=pr(this,(e=>{const t=this._uiState.read(e);return t?poe(t.deletions,t.originalRange,[],this._editor):{prefixTrim:0,prefixLeftOffset:0}})),this._editorLayoutInfo=pr(this,(e=>{const t=this._edit.read(e);if(!t)return null;if(!this._uiState.read(e))return null;const i=this._editorObs.layoutInfo.read(e),n=this._editorObs.scrollLeft.read(e),o=this._editorObs.getOption(59).map((e=>e.typicalHalfwidthCharacterWidth)).read(e),s=i.contentLeft+Math.max(this._editorMaxContentWidthInRange.read(e),o)-n,r=t.originalLineRange,a=this._originalVerticalStartPosition.read(e)??this._editor.getTopForLineNumber(r.startLineNumber)-this._editorObs.scrollTop.read(e),l=this._originalVerticalEndPosition.read(e)??this._editor.getTopForLineNumber(r.endLineNumberExclusive)-this._editorObs.scrollTop.read(e),d=i.contentLeft+this._maxPrefixTrim.read(e).prefixLeftOffset-n;return s<=d?null:{codeRect:pne.fromLeftTopRightBottom(d,a,s,l).withMargin(0,0),contentLeft:i.contentLeft}})).recomputeInitiallyAndOnChange(this._store),this._originalOverlay=bl.div({style:{pointerEvents:"none"}},pr(this,(e=>{const t=boe(this._editorLayoutInfo).read(e);if(!t)return;const i=t.map((e=>pne.fromLeftTopRightBottom(e.contentLeft-4-1,e.codeRect.top,e.contentLeft,e.codeRect.bottom))),n=pr(this,(e=>{const n=t.read(e).codeRect,o=i.read(e);return n.intersectHorizontal(new cm(o.left,Number.MAX_SAFE_INTEGER))})),o=this._uiState.map((e=>e?.inDiffEditor?3:1)).read(e),s=n.map((e=>e.withMargin(o,o)));return[bl.div({class:"originalSeparatorDeletion",style:{...s.read(e).toStyles(),borderRadius:"4px",border:`${1+o}px solid ${Af(a_)}`,boxSizing:"border-box"}}),bl.div({class:"originalOverlayDeletion",style:{...n.read(e).toStyles(),borderRadius:"4px",border:hoe(this._tabAction).map((e=>`1px solid ${Af(e)}`)),boxSizing:"border-box",backgroundColor:Af(Kne)}}),bl.div({class:"originalOverlayHiderDeletion",style:{...i.read(e).toStyles(),backgroundColor:Af(a_)}})]}))).keepUpdated(this._store),this._nonOverflowView=bl.div({class:"inline-edits-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:this._display}},[[this._originalOverlay]]).keepUpdated(this._store),this.isHovered=Or(!1),this._editorObs=bY(this._editor);const o=pr(this,(e=>{const t=this._edit.read(e);return t?new rc(t.originalLineRange.startLineNumber,1):null})),s=pr(this,(e=>{const t=this._edit.read(e);return t?new rc(t.originalLineRange.endLineNumberExclusive,1):null}));this._originalDisplayRange=this._uiState.map((e=>e?.originalRange)),this._originalVerticalStartPosition=this._editorObs.observePosition(o,this._store).map((e=>e?.y)),this._originalVerticalEndPosition=this._editorObs.observePosition(s,this._store).map((e=>e?.y)),this._register(this._editorObs.createOverlayWidget({domNode:this._nonOverflowView.element,position:Or(null),allowEditorOverflow:!1,minContentWidthInPx:pr(this,(e=>{const t=this._editorLayoutInfo.read(e);return null===t?0:t.codeRect.width}))}))}}var Roe=function(e,t){return function(i,n){t(i,n,e)}};let Ooe=class extends At{constructor(e,t,i,n,o){super(),this._editor=e,this._input=t,this._tabAction=i,this._languageService=o,this._onDidClick=this._register(new Zt),this.onDidClick=this._onDidClick.event,this._state=pr(this,(e=>{const t=this._input.read(e);if(!t)return;const i=this._editor.getModel(),n=i.getEOL();if(1===t.startColumn&&t.lineNumber>1&&0!==i.getLineLength(t.lineNumber)&&t.text.endsWith(n)&&!t.text.startsWith(n)){const e=i.getLineLength(t.lineNumber-1)+1;return{lineNumber:t.lineNumber-1,column:e,text:n+t.text.slice(0,-n.length)}}return{lineNumber:t.lineNumber,column:t.startColumn,text:t.text}})),this._trimVertically=pr(this,(e=>{const t=this._state.read(e),i=t?.text;if(!i||""===i.trim())return{topOffset:0,bottomOffset:0,linesTop:0,linesBottom:0};const n=this._editor.getLineHeightForPosition(new rc(t.lineNumber,1)),o=this._editor.getModel().getEOL();let s=0,r=0,a=0;for(;a<i.length&&i.startsWith(o,a);a+=o.length)s+=1;for(let e=i.length;e>a&&i.endsWith(o,e);e-=o.length)r+=1;return{topOffset:s*n,bottomOffset:r*n,linesTop:s,linesBottom:r}})),this._maxPrefixTrim=pr(this,(e=>{const t=this._state.read(e);if(!t)return{prefixLeftOffset:0,prefixTrim:0};const i=this._editor.getModel(),n=i.getEOL(),o=this._trimVertically.read(e),s=t.text.split(n),r=s.slice(o.linesTop,s.length-o.linesBottom);return 0===o.linesTop&&(r[0]=i.getLineContent(t.lineNumber)+r[0]),poe([],new ym(t.lineNumber,t.lineNumber+(o.linesTop>0?0:1)),r,this._editor)})),this._ghostText=pr((e=>{const t=this._state.read(e),i=this._maxPrefixTrim.read(e);if(!t)return;const n=this._editor.getModel().getEOL(),o=t.text.split(n).map(((e,t)=>new kj(new Yu(t+1,0===t?1:i.prefixTrim+1,t+1,e.length+1),"modified-background",0)));return new Pee(t.lineNumber,[new Fee(t.column,t.text,!1,o)])})),this._display=pr(this,(e=>this._state.read(e)?"block":"none")),this._editorMaxContentWidthInRange=pr(this,(e=>{const t=this._state.read(e);if(!t)return 0;this._editorObs.versionId.read(e);const i=this._editor.getModel(),n=i.getEOL(),o=t.text.startsWith(n)?"":i.getValueInRange(new Yu(t.lineNumber,1,t.lineNumber,t.column)),s=i.getValueInRange(new Yu(t.lineNumber,t.column,t.lineNumber,i.getLineLength(t.lineNumber)+1)),r=(o+t.text+s).split(n),a=G4.fromEditor(this._editor).withSetWidth(!1).withScrollBeyondLastColumn(0),l=r.map((e=>{const n=i.tokenization.tokenizeLinesAt(t.lineNumber,[e])?.[0];let o;return o=n?pS.fromLineTokens(n).toLineTokens(e,this._languageService.languageIdCodec):uS.createEmpty(e,this._languageService.languageIdCodec),q4(new $4([o]),a,[],ll("div"),!0).minWidthInPx}));return Math.max(...l)})),this.startLineOffset=this._trimVertically.map((e=>e.topOffset)),this.originalLines=this._state.map((e=>e?new ym(e.lineNumber,Math.min(e.lineNumber+2,this._editor.getModel().getLineCount()+1)):void 0)),this._overlayLayout=pr(this,(e=>{this._ghostText.read(e);const t=this._state.read(e);if(!t)return null;this._editorObs.observePosition(Js(this,new rc(t.lineNumber,t.column)),e.store).read(e);const i=this._editorObs.layoutInfo.read(e),n=this._editorObs.scrollLeft.read(e),o=this._editorObs.layoutInfoVerticalScrollbarWidth.read(e),s=i.contentLeft+this._editorMaxContentWidthInRange.read(e)-n,r=this._maxPrefixTrim.read(e).prefixLeftOffset??0,a=i.contentLeft+r-n;if(s<=a)return null;const{topOffset:l,bottomOffset:d}=this._trimVertically.read(e),h=this._editorObs.scrollTop.read(e),c=this._ghostTextView.height.read(e)-l-d,u=this._editor.getTopForLineNumber(t.lineNumber)-h+l,g=new pne(a,u,s,u+c);return{overlay:g,startsAtContentLeft:0===r,contentLeft:i.contentLeft,minContentWidthRequired:r+g.width+o}})).recomputeInitiallyAndOnChange(this._store),this._modifiedOverlay=bl.div({style:{pointerEvents:"none"}},pr(this,(e=>{const t=boe(this._overlayLayout).read(e);if(!t)return;const i=t.map((e=>pne.fromLeftTopRightBottom(e.contentLeft-4-1,e.overlay.top,e.contentLeft,e.overlay.bottom))).read(e),n=this._input.map((e=>e?.inDiffEditor?3:1)).read(e),o=t.map((e=>e.overlay.withMargin(0,1,0,e.startsAtContentLeft?0:1).intersectHorizontal(new cm(i.left,Number.MAX_SAFE_INTEGER)))),s=o.map((e=>e.withMargin(n,n)));return[bl.div({class:"originalUnderlayInsertion",style:{...s.read(e).toStyles(),borderRadius:4,border:`${1+n}px solid ${Af(a_)}`,boxSizing:"border-box"}}),bl.div({class:"originalOverlayInsertion",style:{...o.read(e).toStyles(),borderRadius:4,border:doe(this._tabAction).map((e=>`1px solid ${Af(e)}`)),boxSizing:"border-box",backgroundColor:Af(jne)}}),bl.div({class:"originalOverlayHiderInsertion",style:{...i.toStyles(),backgroundColor:Af(a_)}})]}))).keepUpdated(this._store),this._view=bl.div({class:"inline-edits-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:this._display}},[[this._modifiedOverlay]]).keepUpdated(this._store),this._editorObs=bY(this._editor),this._ghostTextView=this._register(n.createInstance(nne,this._editor,{ghostText:this._ghostText,minReservedLineCount:Or(0),targetTextModel:this._editorObs.model.map((e=>e??void 0)),warning:Or(void 0),handleInlineCompletionShown:Or((()=>{}))},Js(this,{syntaxHighlightingEnabled:!0,extraClasses:["inline-edit"]}),!0,!0)),this.isHovered=this._ghostTextView.isHovered,this._register(this._ghostTextView.onDidClick((e=>{this._onDidClick.fire(e)}))),this._register(this._editorObs.createOverlayWidget({domNode:this._view.element,position:Or(null),allowEditorOverflow:!1,minContentWidthInPx:pr(this,(e=>{const t=this._overlayLayout.read(e);return null===t?0:t.minContentWidthRequired}))}))}};Ooe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Roe(3,nc),Roe(4,Tg)],Ooe);var Poe=function(e,t){return function(i,n){t(i,n,e)}};let Foe=class extends At{constructor(e,t,i,n,o,s){super(),this._editor=e,this._edit=t,this._isInDiffEditor=i,this._tabAction=n,this._languageService=o,this._themeService=s,this._onDidClick=this._register(new Zt),this.onDidClick=this._onDidClick.event,this._maxPrefixTrim=this._edit.map((e=>e?poe(e.replacements.flatMap((e=>[e.originalRange,e.modifiedRange])),e.originalRange,e.modifiedLines,this._editor.editor):void 0)),this._modifiedLineElements=pr(this,(e=>{const t=[];let i=0;const n=this._maxPrefixTrim.read(e),o=this._edit.read(e);if(!o||!n)return;const s=n.prefixTrim,r=function(e){const t=[];for(;e.length;){let i=e.shift();i.startLineNumber!==i.endLineNumber&&(e.push(new Yu(i.startLineNumber+1,1,i.endLineNumber,i.endColumn)),i=new Yu(i.startLineNumber,i.startColumn,i.startLineNumber,Number.MAX_SAFE_INTEGER)),t.push(i)}return t}(o.replacements.map((e=>e.modifiedRange))).map((e=>new Yu(e.startLineNumber,e.startColumn-s,e.endLineNumber,e.endColumn-s))),a=this._editor.model.get(),l=o.modifiedRange.startLineNumber;for(let n=0;n<o.modifiedRange.length;n++){const d=document.createElement("div"),h=l+n,c=o.modifiedLines[n].slice(s),u=a.tokenization.tokenizeLinesAt(h,[c])?.[0];let g;g=u?pS.fromLineTokens(u).toLineTokens(c,this._languageService.languageIdCodec):uS.createEmpty(c,this._languageService.languageIdCodec);const p=[];for(const e of r.filter((e=>e.startLineNumber===h))){const t=Math.min(e.endColumn,c.length+1);p.push(new kj(new Yu(1,e.startColumn,1,t),"inlineCompletions-modified-bubble",0))}const m=q4(new $4([g]),G4.fromEditor(this._editor.editor).withSetWidth(!1).withScrollBeyondLastColumn(0),p,d,!0);this._editor.getOption(59).read(e),i=Math.max(i,m.minWidthInPx),t.push(d)}return{lines:t,requiredWidth:i}})),this._layout=pr(this,(e=>{const t=this._modifiedLineElements.read(e),i=this._maxPrefixTrim.read(e),n=this._edit.read(e);if(!t||!i||!n)return;const{prefixLeftOffset:o}=i,{requiredWidth:s}=t,r=this._editor.observeLineHeightsForLineRange(n.originalRange).read(e),a=(()=>{const e=r.slice(0,n.modifiedRange.length);for(;e.length<n.modifiedRange.length;)e.push(r[r.length-1]);return e})(),l=this._editor.layoutInfoContentLeft.read(e),d=this._editor.layoutInfoVerticalScrollbarWidth.read(e),h=this._editor.scrollLeft.read(e),c=this._editor.scrollTop.read(e),u=l-h,g=this._editor.editor.getModel(),p=n.originalRange.mapToLineArray((e=>this._editor.editor.getOffsetForColumn(e,g.getLineMaxColumn(e))-o)),m=Math.max(...p,s),f=n.originalRange.startLineNumber,_=n.originalRange.endLineNumberExclusive-1,v=this._editor.editor.getTopForLineNumber(f)-c,b=this._editor.editor.getBottomForLineNumber(_)-c,w=pne.fromLeftTopWidthHeight(u+o,v,m,b-v),C=pne.fromLeftTopWidthHeight(w.left,w.bottom,w.width,a.reduce(((e,t)=>e+t),0)),y=pne.hull([w,C]),S=y.intersectVertical(new cm(w.bottom,Number.MAX_SAFE_INTEGER));return{originalLinesOverlay:w,modifiedLinesOverlay:C,background:y,lowerBackground:S,lowerText:new pne(S.left,S.top,S.right,S.bottom),modifiedLineHeights:a,minContentWidthRequired:o+m+d}})),this._viewZoneInfo=pr((e=>{if(!this._editor.getOption(71).map((e=>"always"===e.edits.allowCodeShifting)).read(e))return;const t=this._layout.read(e),i=this._edit.read(e);return t&&i?{height:t.lowerBackground.height,lineNumber:i.originalRange.endLineNumberExclusive}:void 0})),this.minEditorScrollHeight=pr(this,(e=>{const t=boe(this._layout).read(e);return t&&void 0===this._viewZoneInfo.read(e)?t.read(e).lowerText.bottom+this._editor.editor.getScrollTop():0})),this._div=bl.div({class:"line-replacement"},[pr(this,(e=>{const t=boe(this._layout).read(e),i=this._modifiedLineElements.read(e);if(!t||!i)return[];const n=t.read(e),o=this._editor.layoutInfoContentLeft.read(e),s=this._isInDiffEditor.read(e)?3:1;i.lines.forEach(((e,t)=>{e.style.width=`${n.lowerText.width}px`,e.style.height=`${n.modifiedLineHeights[t]}px`,e.style.position="relative"}));const r=doe(this._tabAction).read(e),a=hoe(this._tabAction).read(e);return[bl.div({style:{position:"absolute",...woe((e=>foe(this._editor).read(e))),overflow:"hidden",pointerEvents:"none"}},[bl.div({class:"borderAroundLineReplacement",style:{position:"absolute",...woe((e=>t.read(e).background.translateX(-o).withMargin(s))),borderRadius:"4px",border:`${s+1}px solid ${Af(a_)}`,boxSizing:"border-box",pointerEvents:"none"}}),bl.div({class:"originalOverlayLineReplacement",style:{position:"absolute",...woe((e=>t.read(e).background.translateX(-o))),borderRadius:"4px",border:coe(a,this._themeService).map((e=>`1px solid ${e.toString()}`)),pointerEvents:"none",boxSizing:"border-box",background:Af(Kne)}}),bl.div({class:"modifiedOverlayLineReplacement",style:{position:"absolute",...woe((e=>t.read(e).lowerBackground.translateX(-o))),borderRadius:"0 0 4px 4px",background:Af(a_),boxShadow:`${Af(i_)} 0 6px 6px -6px`,border:`1px solid ${Af(r)}`,boxSizing:"border-box",overflow:"hidden",cursor:"pointer",pointerEvents:"auto"},onmousedown:e=>{e.preventDefault()},onclick:e=>this._onDidClick.fire(new Je(ta(e),e))},[bl.div({style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:Af($ne)}})]),bl.div({class:"modifiedLinesLineReplacement",style:{position:"absolute",boxSizing:"border-box",...woe((e=>t.read(e).lowerText.translateX(-o))),fontFamily:this._editor.getOption(58),fontSize:this._editor.getOption(61),fontWeight:this._editor.getOption(62),pointerEvents:"none",whiteSpace:"nowrap",borderRadius:"0 0 4px 4px",overflow:"hidden"}},[...i.lines])])]}))]).keepUpdated(this._store),this.isHovered=this._editor.isTargetHovered((e=>this._isMouseOverWidget(e)),this._store),this._previousViewZoneInfo=void 0,this._register(Tt((()=>this._editor.editor.changeViewZones((e=>this.removePreviousViewZone(e)))))),this._register(function(e,t){let i;return lr({debugReferenceFn:t},(n=>{const o=e.read(n),s=i;i=o,t({lastValue:s,newValue:o})}))}(this._viewZoneInfo,(({lastValue:e,newValue:t})=>{e===t||e?.height===t?.height&&e?.lineNumber===t?.lineNumber||this._editor.editor.changeViewZones((e=>{this.removePreviousViewZone(e),t&&this.addViewZone(t,e)}))}))),this._register(this._editor.createOverlayWidget({domNode:this._div.element,minContentWidthInPx:pr(this,(e=>this._layout.read(e)?.minContentWidthRequired??0)),position:Or({preference:{top:0,left:0}}),allowEditorOverflow:!1}))}_isMouseOverWidget(e){const t=this._layout.get();return!!(t&&e.event instanceof CB)&&t.lowerBackground.containsPoint(new vY(e.event.relativePos.x,e.event.relativePos.y))}removePreviousViewZone(e){if(!this._previousViewZoneInfo)return;e.removeZone(this._previousViewZoneInfo.id);const t=this._editor.cursorLineNumber.get();null!==t&&t>=this._previousViewZoneInfo.lineNumber&&this._editor.editor.setScrollTop(this._editor.scrollTop.get()-this._previousViewZoneInfo.height),this._previousViewZoneInfo=void 0}addViewZone(e,t){const i=t.addZone({afterLineNumber:e.lineNumber-1,heightInPx:e.height,domNode:ll("div")});this._previousViewZoneInfo={height:e.height,lineNumber:e.lineNumber,id:i};const n=this._editor.cursorLineNumber.get();null!==n&&n>=e.lineNumber&&this._editor.editor.setScrollTop(this._editor.scrollTop.get()+e.height)}};Foe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Poe(4,Tg),Poe(5,sw)],Foe);var Boe=function(e,t){return function(i,n){t(i,n,e)}};let Woe=class extends At{static fitsInsideViewport(e,t,i,n){const o=bY(e),s=o.layoutInfoWidth.read(n),r=o.layoutInfoContentLeft.read(n),a=e.getLayoutInfo().verticalScrollbarWidth,l=0!==o.layoutInfoMinimap.read(n).minimapLeft?o.layoutInfoMinimap.read(n).minimapWidth:0;return goe(o,i.displayRange,void 0)+i.lineEdit.newLines.reduce(((i,n)=>Math.max(i,moe(n,e,t))),0)+20+14<s-r-a-l}constructor(e,t,i,n,o,s,r){super(),this._editor=e,this._edit=t,this._previewTextModel=i,this._uiState=n,this._tabAction=o,this._instantiationService=s,this._themeService=r,this._editorObs=bY(this._editor),this._onDidClick=this._register(new Zt),this.onDidClick=this._onDidClick.event,this._display=pr(this,(e=>this._uiState.read(e)?"block":"none")),this.previewRef=bl.ref();const a=this._uiState.map((e=>e?.isInDiffEditor?3:1));this._editorContainer=bl.div({class:["editorContainer"],style:{position:"absolute",overflow:"hidden",cursor:"pointer"},onmousedown:e=>{e.preventDefault()},onclick:e=>{this._onDidClick.fire(new Je(ta(e),e))}},[bl.div({class:"preview",style:{pointerEvents:"none"},ref:this.previewRef})]).keepUpdated(this._store),this.isHovered=this._editorContainer.didMouseMoveDuringHover,this.previewEditor=this._register(this._instantiationService.createInstance(rY,this.previewRef.element,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},rulers:[],padding:{top:0,bottom:0},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0,revealHorizontalRightPadding:0,bracketPairColorization:{enabled:!0,independentColorPoolPerBracketType:!1},scrollBeyondLastLine:!1,scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1},readOnly:!0,wordWrap:"off",wordWrapOverride1:"off",wordWrapOverride2:"off"},{contextKeyValues:{[J8.inInlineEditsPreviewEditor.key]:!0},contributions:[]},this._editor)),this._previewEditorObs=bY(this.previewEditor),this._activeViewZones=[],this._updatePreviewEditor=pr(this,(e=>{this._editorContainer.readEffect(e),this._previewEditorObs.model.read(e),this._display.read(e),this._nonOverflowView&&(this._nonOverflowView.element.style.display=this._display.read(e));const t=this._uiState.read(e),i=this._edit.read(e);if(!t||!i)return;const n=i.originalLineRange,o=[];n.startLineNumber>1&&o.push(new Yu(1,1,n.startLineNumber-1,1)),n.startLineNumber+t.newTextLineCount<this._previewTextModel.getLineCount()+1&&o.push(new Yu(n.startLineNumber+t.newTextLineCount,1,this._previewTextModel.getLineCount()+1,1)),this.previewEditor.setHiddenAreas(o,void 0,!0);const s=[...this._activeViewZones];this._activeViewZones=[];const r=n.endLineNumberExclusive-n.startLineNumber-t.newTextLineCount;this.previewEditor.changeViewZones((e=>{s.forEach((t=>e.removeZone(t))),r>0&&this._activeViewZones.push(e.addZone({afterLineNumber:n.startLineNumber+t.newTextLineCount-1,heightInLines:r,showInHiddenAreas:!0,domNode:ll("div.diagonal-fill.inline-edits-view-zone")}))}))})),this._previewEditorWidth=pr(this,(e=>{const t=this._edit.read(e);return t?(this._updatePreviewEditor.read(e),goe(this._previewEditorObs,t.modifiedLineRange,e)):0})),this._cursorPosIfTouchesEdit=pr(this,(e=>{const t=this._editorObs.cursorPosition.read(e),i=this._edit.read(e);if(i&&t)return i.modifiedLineRange.contains(t.lineNumber)?t:void 0})),this._originalStartPosition=pr(this,(e=>{const t=this._edit.read(e);return t?new rc(t.originalLineRange.startLineNumber,1):null})),this._originalEndPosition=pr(this,(e=>{const t=this._edit.read(e);return t?new rc(t.originalLineRange.endLineNumberExclusive,1):null})),this._originalVerticalStartPosition=this._editorObs.observePosition(this._originalStartPosition,this._store).map((e=>e?.y)),this._originalVerticalEndPosition=this._editorObs.observePosition(this._originalEndPosition,this._store).map((e=>e?.y)),this._originalDisplayRange=this._edit.map((e=>e?.displayRange)),this._editorMaxContentWidthInRange=pr(this,(e=>{const t=this._originalDisplayRange.read(e);return t?(this._editorObs.versionId.read(e),Tr(this,((e,i)=>{const n=goe(this._editorObs,t,e);return Math.max(n,i??0)}))):Or(0)})).map(((e,t)=>e.read(t))),this._previewEditorLayoutInfo=pr(this,(e=>{const t=this._edit.read(e);if(!t)return null;if(!this._uiState.read(e))return null;const i=t.originalLineRange,n=this._editorObs.scrollLeft.read(e),o=this._editorMaxContentWidthInRange.read(e),s=this._editorObs.layoutInfo.read(e),r=this._previewEditorWidth.read(e),a=s.contentWidth-s.verticalScrollbarWidth,l=this._editor.getContainerDomNode().getBoundingClientRect(),d=s.contentLeft+s.contentWidth+l.left,h=ta(this._editor.getContainerDomNode()).innerWidth-d,c=ta(this._editor.getContainerDomNode()).innerWidth-l.right,u=Math.min(.3*s.contentWidth,r,100),g=0+h,p=this._cursorPosIfTouchesEdit.read(e),m=Math.max(a+n-0-Math.max(0,u-g),Math.min(p?function(e,t,i){return e.layoutInfo.read(i),e.value.read(i),e.model.read(i)?(e.scrollTop.read(i),e.editor.getOffsetForColumn(t.lineNumber,t.column)):0}(this._editorObs,p,e)+50:0,a+n)),f=Math.min(o+20,m),_=o+20+r+70,v=m-f;let b,w;f>n?(b=0,w=s.contentLeft+f-n):(b=n-f,w=s.contentLeft);const C=this._originalVerticalStartPosition.read(e)??this._editor.getTopForLineNumber(i.startLineNumber)-this._editorObs.scrollTop.read(e),y=this._originalVerticalEndPosition.read(e)??this._editor.getBottomForLineNumber(i.endLineNumberExclusive-1)-this._editorObs.scrollTop.read(e),S=s.contentLeft-n;let x=pne.fromLeftTopRightBottom(S,C,w,y);const k=0===x.height;k||(x=x.withMargin(0,0));const L=this._previewEditorObs.observeLineHeightsForLineRange(t.modifiedLineRange).read(e).reduce(((e,t)=>e+t),0),D=y-C,E=Math.max(D,L),N=0===v,I=Math.min(r+12,c+s.width-s.contentLeft-0);let T=pne.fromLeftTopWidthHeight(x.right+0,C,I,E);return T=k?T.withMargin(0,0).translateY(0):T.withMargin(0,0).translateX(1),{codeRect:x,editRect:T,codeScrollLeft:n,contentLeft:s.contentLeft,isInsertion:k,maxContentWidth:_,shouldShowShadow:N,desiredPreviewEditorScrollLeft:b,previewEditorWidth:I}})),this._stickyScrollController=Une.get(this._editorObs.editor),this._stickyScrollHeight=this._stickyScrollController?Sr(this._stickyScrollController.onDidChangeStickyScrollHeight,(()=>this._stickyScrollController.stickyScrollWidgetHeight)):Or(0),this._shouldOverflow=pr(this,(e=>!1)),this._originalBackgroundColor=Sr(this,this._themeService.onDidColorThemeChange,(()=>this._themeService.getColorTheme().getColor(Kne)??Lg.transparent)),this._backgroundSvg=bl.svg({transform:"translate(-0.5 -0.5)",style:{overflow:"visible",pointerEvents:"none",position:"absolute"}},[bl.svgElem("path",{class:"rightOfModifiedBackgroundCoverUp",d:pr(this,(e=>{const t=this._previewEditorLayoutInfo.read(e);if(t)return this._originalBackgroundColor.read(e).isTransparent()?void 0:(new voe).moveTo(t.codeRect.getRightTop()).lineTo(t.codeRect.getRightTop().deltaX(1e3)).lineTo(t.codeRect.getRightBottom().deltaX(1e3)).lineTo(t.codeRect.getRightBottom()).build()})),style:{fill:Rf(a_,"transparent")}})]).keepUpdated(this._store),this._originalOverlay=bl.div({style:{pointerEvents:"none",display:this._previewEditorLayoutInfo.map((e=>e?.isInsertion?"none":"block"))}},pr(this,(e=>{const t=boe(this._previewEditorLayoutInfo).read(e);if(!t)return;const i=a.read(e),n=hoe(this._tabAction).map((e=>`1px solid ${Af(e)}`)),o=`${1+i}px solid ${Af(a_)}`,s=0!==t.read(e).codeScrollLeft,r=t.map((e=>e.codeRect.bottom<e.editRect.bottom)),l=t.map((e=>pne.fromLeftTopRightBottom(e.contentLeft-4-1,e.codeRect.top,e.contentLeft,e.codeRect.bottom+10))).read(e),d=new cm(l.left,Number.MAX_SAFE_INTEGER),h=t.map((e=>e.codeRect.intersectHorizontal(d))),c=h.map((e=>e.withMargin(i,0,i,i).intersectHorizontal(d))),u=h.map((e=>pne.fromLeftTopWidthHeight(e.right-10+1,e.bottom-1,10,10).intersectHorizontal(d)));return[bl.div({class:"originalSeparatorSideBySide",style:{...c.read(e).toStyles(),boxSizing:"border-box",borderRadius:"4px 0 0 4px",borderTop:o,borderBottom:o,borderLeft:s?"none":o}}),bl.div({class:"originalOverlaySideBySide",style:{...h.read(e).toStyles(),boxSizing:"border-box",borderRadius:"4px 0 0 4px",borderTop:n,borderBottom:n,borderLeft:s?"none":n,backgroundColor:Af(Kne)}}),bl.div({class:"originalCornerCutoutSideBySide",style:{pointerEvents:"none",display:r.map((e=>e?"block":"none")),...u.read(e).toStyles()}},[bl.div({class:"originalCornerCutoutBackground",style:{position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",backgroundColor:coe(Kne,this._themeService).map((e=>e.toString()))}}),bl.div({class:"originalCornerCutoutBorder",style:{position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",boxSizing:"border-box",borderTop:n,borderRight:n,borderRadius:"0 100% 0 0",backgroundColor:Af(a_)}})]),bl.div({class:"originalOverlaySideBySideHider",style:{...l.toStyles(),backgroundColor:Af(a_)}})]}))).keepUpdated(this._store),this._modifiedOverlay=bl.div({style:{pointerEvents:"none"}},pr(this,(e=>{const t=boe(this._previewEditorLayoutInfo).read(e);if(!t)return;const i=t.map((e=>e.codeRect.bottom<e.editRect.bottom)),n=a.read(e),o=i.map((e=>`0 4px 4px ${e?4:0}px`)),s=coe(doe(this._tabAction),this._themeService).map((e=>`1px solid ${e.toString()}`)),r=`${1+n}px solid ${Af(a_)}`,l=t.map((e=>e.editRect.withMargin(0,1))),d=l.map((e=>e.withMargin(n,n,n,0))),h=pr(this,(e=>{const i=l.read(e),n=t.read(e);return!n.isInsertion||n.contentLeft>=i.left?pne.fromLeftTopWidthHeight(i.left,i.top,0,0):new pne(n.contentLeft,i.top,i.left,i.top+2)}));return[bl.div({class:"modifiedInsertionSideBySide",style:{...h.read(e).toStyles(),backgroundColor:doe(this._tabAction).map((e=>Af(e)))}}),bl.div({class:"modifiedSeparatorSideBySide",style:{...d.read(e).toStyles(),borderRadius:o,borderTop:r,borderBottom:r,borderRight:r,boxSizing:"border-box"}}),bl.div({class:"modifiedOverlaySideBySide",style:{...l.read(e).toStyles(),borderRadius:o,border:s,boxSizing:"border-box",backgroundColor:Af(jne)}})]}))).keepUpdated(this._store),this._nonOverflowView=bl.div({class:"inline-edits-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:this._display}},[this._backgroundSvg,pr(this,(e=>this._shouldOverflow.read(e)?[]:[this._editorContainer,this._originalOverlay,this._modifiedOverlay]))]).keepUpdated(this._store),this._register(this._editorObs.createOverlayWidget({domNode:this._nonOverflowView.element,position:Or(null),allowEditorOverflow:!1,minContentWidthInPx:pr(this,(e=>{const t=this._previewEditorLayoutInfo.read(e)?.maxContentWidth;return void 0===t?0:t}))})),this.previewEditor.setModel(this._previewTextModel),this._register(ar((e=>{const t=this._previewEditorLayoutInfo.read(e);if(!t)return;const i=t.editRect.withMargin(-0,-0);this.previewEditor.layout({height:i.height,width:t.previewEditorWidth+15}),this._editorContainer.element.style.top=`${i.top}px`,this._editorContainer.element.style.left=`${i.left}px`,this._editorContainer.element.style.width=`${t.previewEditorWidth+0}px`}))),this._register(ar((e=>{const t=this._previewEditorLayoutInfo.read(e);t&&this._previewEditorObs.editor.setScrollLeft(t.desiredPreviewEditorScrollLeft)}))),this._updatePreviewEditor.recomputeInitiallyAndOnChange(this._store)}};Woe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Boe(5,nc),Boe(6,sw)],Woe);let Voe=class extends At{static{this.MAX_LENGTH=100}constructor(e,t,i,n){super(),this._editor=e,this._edit=t,this._tabAction=i,this._languageService=n,this._onDidClick=this._register(new Zt),this.onDidClick=this._onDidClick.event,this._start=this._editor.observePosition(Or(this._edit.range.getStartPosition()),this._store),this._end=this._editor.observePosition(Or(this._edit.range.getEndPosition()),this._store),this._line=document.createElement("div"),this._hoverableElement=Js(this,null),this.isHovered=this._hoverableElement.map(((e,t)=>e?.didMouseMoveDuringHover.read(t)??!1)),this._renderTextEffect=pr(this,(e=>{const t=this._editor.model.get(),i=t.getLineContent(this._edit.range.startLineNumber),n=DU.replace(new cm(this._edit.range.startColumn-1,this._edit.range.endColumn-1),this._edit.text),o=n.replace(i),s=t.tokenization.tokenizeLinesAt(this._edit.range.startLineNumber,[o])?.[0];let r;r=s?pS.fromLineTokens(s).slice(n.getRangeAfterReplace()).toLineTokens(this._edit.text,this._languageService.languageIdCodec):uS.createEmpty(this._edit.text,this._languageService.languageIdCodec);const a=q4(new $4([r]),G4.fromEditor(this._editor.editor).withSetWidth(!1).withScrollBeyondLastColumn(0),[],this._line,!0);this._line.style.width=`${a.minWidthInPx}px`}));const o=this._editor.observeLineHeightForPosition(this._edit.range.getStartPosition());this._layout=pr(this,(e=>{this._renderTextEffect.read(e);const t=this._start.read(e),i=this._end.read(e);if(!t||!i||t.x>i.x||t.y>i.y)return;const n=o.read(e),s=this._editor.scrollLeft.read(e),r=this._editor.getOption(59).read(e).typicalHalfwidthCharacterWidth,a=new vY(3*r,4),l=pne.fromPoints(t,i).withHeight(n).translateX(-s),d=pne.fromPointSize(l.getLeftBottom().add(a),new vY(this._edit.text.length*r,l.height)),h=d.withLeft(l.left);return{originalLine:l,modifiedLine:d,lowerBackground:h,lineHeight:n}})),this.minEditorScrollHeight=pr(this,(e=>{const t=boe(this._layout).read(e);return t?t.read(e).modifiedLine.bottom+1+this._editor.editor.getScrollTop():0})),this._root=bl.div({class:"word-replacement"},[pr(this,(e=>{const t=boe(this._layout).read(e);if(!t)return[];const i=hoe(this._tabAction).map((e=>Af(e))).read(e),n=doe(this._tabAction).map((e=>Af(e))).read(e);return[bl.div({style:{position:"absolute",...woe((e=>foe(this._editor).read(e))),overflow:"hidden",pointerEvents:"none"}},[bl.div({style:{position:"absolute",...woe((e=>t.read(e).lowerBackground.withMargin(1,2,1,0))),background:Af(a_),cursor:"pointer",pointerEvents:"auto"},onmousedown:e=>{e.preventDefault()},onmouseup:e=>this._onDidClick.fire(new Je(ta(e),e)),obsRef:e=>{this._hoverableElement.set(e,void 0)}}),bl.div({style:{position:"absolute",...woe((e=>t.read(e).modifiedLine.withMargin(1,2))),fontFamily:this._editor.getOption(58),fontSize:this._editor.getOption(61),fontWeight:this._editor.getOption(62),pointerEvents:"none",boxSizing:"border-box",borderRadius:"4px",border:`1px solid ${n}`,background:Af(Gne),display:"flex",justifyContent:"center",alignItems:"center",outline:`2px solid ${Af(a_)}`}},[this._line]),bl.div({style:{position:"absolute",...woe((e=>t.read(e).originalLine.withMargin(1))),boxSizing:"border-box",borderRadius:"4px",border:`1px solid ${i}`,background:Af(qne),pointerEvents:"none"}},[]),bl.svg({width:11,height:14,viewBox:"0 0 11 14",fill:"none",style:{position:"absolute",left:t.map((e=>e.modifiedLine.left-16)),top:t.map((e=>e.modifiedLine.top+Math.round((e.lineHeight-14-5)/2)))}},[bl.svgElem("path",{d:"M1 0C1 2.98966 1 5.92087 1 8.49952C1 9.60409 1.89543 10.5 3 10.5H10.5",stroke:Af(T_)}),bl.svgElem("path",{d:"M6 7.5L9.99999 10.49998L6 13.5",stroke:Af(T_)})])])]}))]).keepUpdated(this._store),this._register(this._editor.createOverlayWidget({domNode:this._root.element,minContentWidthInPx:Or(0),position:Or({preference:{top:0,left:0}}),allowEditorOverflow:!1}))}};Voe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(3,Tg)],Voe);class Hoe extends At{constructor(e,t,i){super(),this._originalEditor=e,this._state=t,this._modifiedTextModel=i,this._onDidClick=this._register(new Zt),this.onDidClick=this._onDidClick.event,this.isHovered=bY(this._originalEditor).isTargetHovered((e=>6===e.target.type&&e.target.detail.injectedText?.options.attachedData instanceof zoe&&e.target.detail.injectedText.options.attachedData.owner===this),this._store),this._tokenizationFinished=Sr(this._modifiedTextModel.onDidChangeTokens,(()=>Uoe++)),this._decorations=pr(this,(e=>{const t=this._state.read(e);if(!t)return;const i=t.modifiedText,n="insertionInline"===t.mode,o=1===t.diff.length&&1===t.diff[0].innerChanges?.length,s=[],r=[],a=bk.register({className:"inlineCompletions-line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),l=bk.register({className:"inlineCompletions-line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),d=bk.register({className:"inlineCompletions-char-delete",description:"char-delete",isWholeLine:!1,zIndex:1}),h=bk.register({className:"inlineCompletions-char-insert",description:"char-insert",isWholeLine:!0}),c=bk.register({className:"inlineCompletions-char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),u=bk.register({className:"inlineCompletions-char-insert diff-range-empty",description:"char-insert diff-range-empty"}),g=bk.register({className:"inlineCompletions-original-lines",description:"inlineCompletions-original-lines",isWholeLine:!1,shouldFillLineOnLineBreak:!0}),p="sideBySide"!==t.mode&&"deletion"!==t.mode&&"insertionInline"!==t.mode&&"lineReplacement"!==t.mode,m="lineReplacement"===t.mode;for(const g of t.diff)if(p&&(g.original.isEmpty||s.push({range:g.original.toInclusiveRange(),options:l}),g.modified.isEmpty||r.push({range:g.modified.toInclusiveRange(),options:a})),g.modified.isEmpty||g.original.isEmpty)g.original.isEmpty||s.push({range:g.original.toInclusiveRange(),options:d}),g.modified.isEmpty||r.push({range:g.modified.toInclusiveRange(),options:h});else{const a=n&&(!!(f=g).innerChanges&&f.innerChanges.every((e=>t5(e.modifiedRange)&&t5(e.originalRange))));for(const n of g.innerChanges||[]){if(g.original.contains(n.originalRange.startLineNumber)&&(!m||!n.originalRange.isEmpty())){const e=this._originalEditor.getModel()?.getValueInRange(n.originalRange,1);s.push({range:n.originalRange,options:{description:"char-delete",shouldFillLineOnLineBreak:!1,className:_oe("inlineCompletions-char-delete",n.originalRange.isSingleLine()&&"insertionInline"===t.mode&&"single-line-inline",n.originalRange.isEmpty()&&"empty",(n.originalRange.isEmpty()&&o||"deletion"===t.mode&&"\n"===e)&&!a&&"diff-range-empty"),inlineClassName:a?_oe("strike-through","inlineCompletions"):null,zIndex:1}})}if(g.modified.contains(n.modifiedRange.startLineNumber)&&r.push({range:n.modifiedRange,options:n.modifiedRange.isEmpty()&&!a&&o?u:c}),a){const o=i.getValueOfRange(n.modifiedRange),r=o.length>3?[{text:o.slice(0,1),extraClasses:["start"],offsetRange:new cm(n.modifiedRange.startColumn-1,n.modifiedRange.startColumn)},{text:o.slice(1,-1),extraClasses:[],offsetRange:new cm(n.modifiedRange.startColumn,n.modifiedRange.endColumn-2)},{text:o.slice(-1),extraClasses:["end"],offsetRange:new cm(n.modifiedRange.endColumn-2,n.modifiedRange.endColumn-1)}]:[{text:o,extraClasses:["start","end"],offsetRange:new cm(n.modifiedRange.startColumn-1,n.modifiedRange.endColumn)}];this._tokenizationFinished.read(e);const a=this._modifiedTextModel.tokenization.getLineTokens(n.modifiedRange.startLineNumber);for(const{text:e,extraClasses:i,offsetRange:o}of r)s.push({range:Yu.fromPositions(n.originalRange.getEndPosition()),options:{description:"inserted-text",before:{tokens:a.getTokensInRange(o),content:e,inlineClassName:_oe("inlineCompletions-char-insert",n.modifiedRange.isSingleLine()&&"insertionInline"===t.mode&&"single-line-inline",...i),cursorStops:mg.None,attachedData:new zoe(this)},zIndex:2,showIfCollapsed:!0}})}}}var f;if(t.isInDiffEditor)for(const e of t.diff)e.original.isEmpty||s.push({range:e.original.toExclusiveRange(),options:g});return{originalDecorations:s,modifiedDecorations:r}})),this._register(bY(this._originalEditor).setDecorations(this._decorations.map((e=>e?.originalDecorations??[]))));const n=this._state.map((e=>e?.modifiedCodeEditor));this._register(hr(((e,t)=>{const i=n.read(e);i&&t.add(bY(i).setDecorations(this._decorations.map((e=>e?.modifiedDecorations??[]))))}))),this._register(this._originalEditor.onMouseUp((e=>{if(6!==e.target.type)return;const t=e.target.detail.injectedText?.options.attachedData;t instanceof zoe&&t.owner===this&&this._onDidClick.fire(e.event)})))}}class zoe{constructor(e){this.owner=e}}let Uoe=0;var Koe=i(233),joe={};joe.styleTagTransform=zl(),joe.setAttributes=Bl(),joe.insert=Pl().bind(null,"head"),joe.domAPI=Rl(),joe.insertStyleElement=Vl(),Ml()(Koe.A,joe),Koe.A&&Koe.A.locals&&Koe.A.locals;let qoe=class extends At{constructor(e,t,i,n,o,s){super(),this._editor=e,this._host=t,this._model=i,this._ghostTextIndicator=n,this._focusIsInMenu=o,this._instantiationService=s,this._editorObs=bY(this._editor),this._tabAction=pr((e=>this._model.read(e)?.tabAction.read(e)??dte.Inactive)),this._constructorDone=Js(this,!1),this._uiState=pr(this,(e=>{const t=this._model.read(e);if(!t||!this._constructorDone.read(e))return;const i=t.inlineEdit;let n=D2.fromEdit(i.edit),o=i.edit.apply(i.originalText),s=E2(n,i.originalText,new OU(o)),r=this.determineRenderState(t,e,s,new OU(o));if(r){if(r.kind===hte.SideBySide){const e=function(e,t,i){const n=qi(e),o=[],s=wm(t.mapToLineArray((e=>function(e,t){let i=0;e:for(let n=0,o=e.length;n<o;n++)switch(e.charCodeAt(n)){case 9:i+=t;break;case 32:i++;break;default:break e}return i-i%t}(n[e-1],i))),ys);return t.forEach((e=>{const t=function(e,t,i){let n=t-t%i,o=0;for(;o<e.length&&0!==n;o++)switch(e.charCodeAt(o)){case 9:n-=i;break;case 32:n--;break;default:throw new Ve("Unexpected character found while calculating indent length")}return o}(n[e-1],s,i);var r,a;o.push(new FU((r=new cm(0,t),a=new rc(e,1),new Yu(a.lineNumber,a.column+r.start,a.lineNumber,a.column+r.endExclusive)),""))})),new PU(o)}(o,i.modifiedLineRange,a.getOptions().tabSize);o=e.applyToString(o),n=function(e,t){const i=[];for(const n of e){const e=t.mapRange(n.modifiedRange);i.push(new D2(n.originalRange,e))}return i}(n,e),s=E2(n,i.originalText,new OU(o))}return this._previewTextModel.setLanguage(this._editor.getModel().getLanguageId()),this._previewTextModel.getValue()!==o&&this._previewTextModel.setValue(o),t.showCollapsed.read(e)&&!this._indicator.read(e)?.isHoverVisible.read(e)&&(r={kind:hte.Collapsed,viewData:r.viewData}),t.handleInlineEditShown(r.kind,r.viewData),{state:r,diff:s,edit:i,newText:o,newTextLineCount:i.modifiedLineRange.length,isInDiffEditor:t.isInDiffEditor}}t.abort(`unable to determine view: tried to render ${this._previousView?.view}`)})),this._previewTextModel=this._register(this._instantiationService.createInstance(lk,"",this._editor.getModel().getLanguageId(),{...lk.DEFAULT_CREATION_OPTIONS,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}},null)),this._indicatorCyclicDependencyCircuitBreaker=Js(this,!1),this._indicator=pr(this,(e=>{if(!this._indicatorCyclicDependencyCircuitBreaker.read(e))return;const t=fr({owner:this,equalsFn:Ts(((e,t)=>e.equals(t)))},(e=>{const t=this._ghostTextIndicator.read(e);if(t)return t.lineRange;const i=this._uiState.read(e);if(i){if("custom"===i.state?.kind){const e=i.state.displayLocation?.range;if(!e)throw new Ve("custom view should have a range");return new ym(e.startLineNumber,e.endLineNumber)}return"insertionMultiLine"===i.state?.kind?this._insertion.originalLines.read(e):i.edit.displayRange}})),i=pr(this,(e=>{const t=this._model.read(e);if(t)return t;const i=this._ghostTextIndicator.read(e);return i?i.model:t}));return e.store.add(this._instantiationService.createInstance(Loe,this._editorObs,t,this._gutterIndicatorOffset,i,this._inlineEditsIsHovered,this._focusIsInMenu))})),this._inlineEditsIsHovered=pr(this,(e=>this._sideBySide.isHovered.read(e)||this._wordReplacementViews.read(e).some((t=>t.isHovered.read(e)))||this._deletion.isHovered.read(e)||this._inlineDiffView.isHovered.read(e)||this._lineReplacementView.isHovered.read(e)||this._insertion.isHovered.read(e)||this._customView.isHovered.read(e))),this._gutterIndicatorOffset=pr(this,(e=>{if("insertionMultiLine"===this._uiState.read(e)?.state?.kind)return this._insertion.startLineOffset.read(e);const t=this._ghostTextIndicator.read(e);return t?function(e,t){const i=e.model.inlineEdit.edit.replacements;if(1!==i.length)return 0;const n=t.getModel();if(!n)return 0;const o=n.getEOL(),s=i[0];if(s.range.isEmpty()&&s.text.startsWith(o)){const e=t.getLineHeightForPosition(s.range.getStartPosition());return function(e,t){if(!t.length)return 0;let i=0,n=0;for(;e.startsWith(t,n);)i++,n+=t.length;return i}(s.text,o)*e}return 0}(t,this._editor):0})),this._sideBySide=this._register(this._instantiationService.createInstance(Woe,this._editor,this._model.map((e=>e?.inlineEdit)),this._previewTextModel,this._uiState.map((e=>e&&e.state?.kind===hte.SideBySide?{newTextLineCount:e.newTextLineCount,isInDiffEditor:e.isInDiffEditor}:void 0)),this._tabAction)),this._deletion=this._register(this._instantiationService.createInstance(Aoe,this._editor,this._model.map((e=>e?.inlineEdit)),this._uiState.map((e=>e&&e.state?.kind===hte.Deletion?{originalRange:e.state.originalRange,deletions:e.state.deletions,inDiffEditor:e.isInDiffEditor}:void 0)),this._tabAction)),this._insertion=this._register(this._instantiationService.createInstance(Ooe,this._editor,this._uiState.map((e=>e&&e.state?.kind===hte.InsertionMultiLine?{lineNumber:e.state.lineNumber,startColumn:e.state.column,text:e.state.text,inDiffEditor:e.isInDiffEditor}:void 0)),this._tabAction)),this._inlineDiffViewState=pr(this,(e=>{const t=this._uiState.read(e);if(t&&t.state&&"wordReplacements"!==t.state.kind&&"insertionMultiLine"!==t.state.kind&&"collapsed"!==t.state.kind&&"custom"!==t.state.kind)return{modifiedText:new OU(t.newText),diff:t.diff,mode:t.state.kind,modifiedCodeEditor:this._sideBySide.previewEditor,isInDiffEditor:t.isInDiffEditor}})),this._inlineCollapsedView=this._register(this._instantiationService.createInstance(Ioe,this._editor,this._model.map(((e,t)=>"collapsed"===this._uiState.read(t)?.state?.kind?e?.inlineEdit:void 0)))),this._customView=this._register(this._instantiationService.createInstance(Moe,this._editor,this._model.map(((e,t)=>"custom"===this._uiState.read(t)?.state?.kind?e?.displayLocation:void 0)),this._tabAction)),this._inlineDiffView=this._register(new Hoe(this._editor,this._inlineDiffViewState,this._previewTextModel)),this._wordReplacementViews=Mr(this,this._uiState.map((e=>"wordReplacements"===e?.state?.kind?e.state.replacements:[])),((e,t)=>t.add(this._instantiationService.createInstance(Voe,this._editorObs,e,this._tabAction)))),this._lineReplacementView=this._register(this._instantiationService.createInstance(Foe,this._editorObs,this._uiState.map((e=>e?.state?.kind===hte.LineReplacement?{originalRange:e.state.originalRange,modifiedRange:e.state.modifiedRange,modifiedLines:e.state.modifiedLines,replacements:e.state.replacements}:void 0)),this._uiState.map((e=>e?.isInDiffEditor??!1)),this._tabAction)),this._useCodeShifting=this._editorObs.getOption(71).map((e=>e.edits.allowCodeShifting)),this._renderSideBySide=this._editorObs.getOption(71).map((e=>e.edits.renderSideBySide)),this._register(hr(((e,t)=>{const i=this._model.read(e);i&&t.add(zt.any(this._sideBySide.onDidClick,this._deletion.onDidClick,this._lineReplacementView.onDidClick,this._insertion.onDidClick,...this._wordReplacementViews.read(e).map((e=>e.onDidClick)),this._inlineDiffView.onDidClick,this._customView.onDidClick)((e=>{this._viewHasBeenShownLongerThan(350)&&(e.preventDefault(),i.accept())})))}))),this._indicator.recomputeInitiallyAndOnChange(this._store),this._wordReplacementViews.recomputeInitiallyAndOnChange(this._store),this._indicatorCyclicDependencyCircuitBreaker.set(!0,void 0),this._register(this._instantiationService.createInstance(Noe,this._host,this._model,this._indicator,this._inlineCollapsedView));const r=pr(this,(e=>Math.max(...this._wordReplacementViews.read(e).map((t=>t.minEditorScrollHeight.read(e))),this._lineReplacementView.minEditorScrollHeight.read(e),this._customView.minEditorScrollHeight.read(e)))).recomputeInitiallyAndOnChange(this._store),a=this._editor.getModel();let l;this._register(ar((e=>{const t=r.read(e);this._editor.changeViewZones((e=>{const i=this._editor.getScrollHeight(),n=t-i+1;0!==n&&l&&(e.removeZone(l),l=void 0),n<=0||(l=e.addZone({afterLineNumber:a.getLineCount(),heightInPx:n,domNode:ll("div.minScrollHeightViewZone")}))}))}))),this._constructorDone.set(!0,void 0)}getCacheId(e){return e.inlineEdit.inlineCompletion.identity.id}determineView(e,t,i,n){const o=e.inlineEdit,s=this._previousView?.id===this.getCacheId(e),r=this._previousView?.editorWidth!==this._editorObs.layoutInfoWidth.read(t)&&(this._previousView?.view===hte.SideBySide||this._previousView?.view===hte.LineReplacement);if(s&&!r)return this._previousView.view;if(e.displayLocation)return hte.Custom;const a=o.originalLineRange.length,l=o.modifiedLineRange.length,d=i.flatMap((e=>e.innerChanges??[])),h=1===d.length;if(!e.isInDiffEditor){if(h&&"never"!==this._useCodeShifting.read(t)&&$oe(i))return function(e,t){if(!t)return!1;if(!$oe(e))return!1;const i=t;return e.every((e=>e.innerChanges.every((e=>function(e){const t=e.originalRange.getStartPosition();return!!i.isBeforeOrEqual(t)||t.lineNumber<i.lineNumber}(e)))))}(i,o.cursorPosition)?hte.InsertionInline:hte.LineReplacement;if(Zoe(d,o,n))return hte.Deletion;if(Goe(i)&&"always"===this._useCodeShifting.read(t))return hte.InsertionMultiLine;const s=d.every((e=>xm.ofRange(e.originalRange).columnCount<Voe.MAX_LENGTH&&xm.ofRange(e.modifiedRange).columnCount<Voe.MAX_LENGTH));if(s&&h&&1===a&&1===l){const t=d.map((e=>n.getValueOfRange(e.modifiedRange))),i=d.map((t=>e.inlineEdit.originalText.getValueOfRange(t.originalRange)));if(!(t.some((e=>e.includes("\t")))||i.some((e=>e.includes("\t")))||d.some((e=>e.originalRange.isEmpty()))&&Yoe(d.map((e=>new FU(e.originalRange,""))),o.originalText).some((e=>e.range.isEmpty()&&xm.ofRange(e.range).columnCount<Voe.MAX_LENGTH))))return hte.WordReplacements}}if(a>0&&l>0)return(1!==a||1!==l||e.isInDiffEditor)&&"never"!==this._renderSideBySide.read(t)&&Woe.fitsInsideViewport(this._editor,this._previewTextModel,o,t)?hte.SideBySide:hte.LineReplacement;if(e.isInDiffEditor){if(Zoe(d,o,n))return hte.Deletion;if(Goe(i)&&"always"===this._useCodeShifting.read(t))return hte.InsertionMultiLine}return hte.SideBySide}determineRenderState(e,t,i,n){const o=e.inlineEdit,s=this.determineView(e,t,i,n);this._previousView={id:this.getCacheId(e),view:s,editorWidth:this._editor.getLayoutInfo().width,timestamp:Date.now()};const r=i.flatMap((e=>e.innerChanges??[])),a=this._editor.getModel(),l=r.map((e=>({originalRange:e.originalRange,modifiedRange:e.modifiedRange,original:a.getValueInRange(e.originalRange),modified:n.getValueOfRange(e.modifiedRange)}))),d=o.cursorPosition,h=l[0].modified.startsWith(a.getEOL()),c={cursorColumnDistance:o.edit.replacements[0].range.getStartPosition().column-d.column,cursorLineDistance:o.lineEdit.lineRange.startLineNumber-d.lineNumber+(h&&o.lineEdit.lineRange.startLineNumber>=d.lineNumber?1:0),lineCountOriginal:o.lineEdit.lineRange.length,lineCountModified:o.lineEdit.newLines.length,characterCountOriginal:l.reduce(((e,t)=>e+t.original.length),0),characterCountModified:l.reduce(((e,t)=>e+t.modified.length),0),disjointReplacements:l.length,sameShapeReplacements:l.every((e=>e.original===l[0].original&&e.modified===l[0].modified))};switch(s){case hte.InsertionInline:return{kind:hte.InsertionInline,viewData:c};case hte.SideBySide:return{kind:hte.SideBySide,viewData:c};case hte.Collapsed:return{kind:hte.Collapsed,viewData:c};case hte.Custom:return{kind:hte.Custom,displayLocation:e.displayLocation,viewData:c}}if(s===hte.Deletion)return{kind:hte.Deletion,originalRange:o.originalLineRange,deletions:r.map((e=>e.originalRange)),viewData:c};if(s===hte.InsertionMultiLine){const e=r[0];return{kind:hte.InsertionMultiLine,lineNumber:e.originalRange.startLineNumber,column:e.originalRange.startColumn,text:n.getValueOfRange(e.modifiedRange),viewData:c}}const u=l.map((e=>new FU(e.originalRange,e.modified)));if(0!==u.length){if(s===hte.WordReplacements){let e=function(e,t){return Qoe(e,t,(e=>/^[a-zA-Z]$/.test(e)))}(u,o.originalText);return e.some((e=>e.range.isEmpty()))&&(e=Yoe(u,o.originalText)),{kind:hte.WordReplacements,replacements:e,viewData:c}}return s===hte.LineReplacement?{kind:hte.LineReplacement,originalRange:o.originalLineRange,modifiedRange:o.modifiedLineRange,modifiedLines:o.modifiedLineRange.mapToLineArray((e=>n.getLineAt(e))),replacements:r.map((e=>({originalRange:e.originalRange,modifiedRange:e.modifiedRange}))),viewData:c}:void 0}}_viewHasBeenShownLongerThan(e){const t=this._previousView?.timestamp;if(!t)throw new Ve("viewHasBeenShownLongThan called before a view has been shown");return Date.now()-t>=e}};function $oe(e){return e.every((e=>e.innerChanges.every((e=>function(e){if(!e.originalRange.isEmpty())return!1;return!(e.modifiedRange.startLineNumber!==e.modifiedRange.endLineNumber)}(e)))))}function Goe(e){const t=e.flatMap((e=>e.innerChanges??[]));if(1!==t.length)return!1;const i=t[0];return!!i.originalRange.isEmpty()&&i.modifiedRange.startLineNumber!==i.modifiedRange.endLineNumber}function Zoe(e,t,i){const n=e.map((e=>({original:t.originalText.getValueOfRange(e.originalRange),modified:i.getValueOfRange(e.modifiedRange)})));return n.every((({original:e,modified:t})=>""===t.trim()&&e.length>0&&(e.length>t.length||""!==e.trim())))}function Yoe(e,t){return Qoe(e,t,(e=>!/^\s$/.test(e)))}function Qoe(e,t,i){const n=[];e.sort(((e,t)=>Yu.compareRangesUsingStarts(e.range,t.range)));for(const i of e){let e=i.range.startColumn-1,s=i.range.endColumn-2,r="",a="";const l=t.getLineAt(i.range.startLineNumber),d=t.getLineAt(i.range.endLineNumber);if(o(l[e]))for(;o(l[e-1]);)r=l[e-1]+r,e--;if(o(d[s])||s<e)for(;o(d[s+1]);)a+=d[s+1],s++;let h=new FU(new Yu(i.range.startLineNumber,e+1,i.range.endLineNumber,s+2),r+i.text+a);n.length>0&&Yu.areIntersectingOrTouching(n[n.length-1].range,h.range)&&(h=FU.joinReplacements([n.pop(),h],t)),n.push(h)}function o(e){return void 0!==e&&i(e)}return n}qoe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(5,nc)],qoe);var Xoe;let Joe=class extends At{static{Xoe=this}static{this.hot=C$(Xoe)}constructor(e,t,i,n,o){super(),this._editor=e,this._edit=t,this._model=i,this._focusIsInMenu=n,this._inlineEdit=pr(this,(e=>{const t=this._model.read(e);if(!t)return;const i=this._edit.read(e);if(!i)return;const n=this._editor.getModel();if(!n)return;const o=t.inlineEditState.read(void 0)?.inlineCompletion.updatedEdit;if(!o)return;const s=o.replacements.map((e=>{const t=Yu.fromPositions(n.getPositionAt(e.replaceRange.start),n.getPositionAt(e.replaceRange.endExclusive));return new FU(t,e.newText)})),r=new PU(s),a=new m5(n);return new hne(a,r,t.primaryPosition.read(void 0),i.commands,i.inlineCompletion)})),this._inlineEditModel=pr(this,(e=>{const t=this._model.read(e);if(!t)return;const i=this._inlineEdit.read(e);if(!i)return;const n=pr(this,(e=>{if(this._editorObs.isFocused.read(e)){if(t.tabShouldJumpToInlineEdit.read(e))return dte.Jump;if(t.tabShouldAcceptInlineEdit.read(e))return dte.Accept}return dte.Inactive}));return new cne(t,i,n)})),this._inlineEditHost=pr(this,(e=>{const t=this._model.read(e);if(t)return new une(t)})),this._ghostTextIndicator=pr(this,(e=>{const t=this._model.read(e);if(!t)return;const i=t.inlineCompletionState.read(e);if(!i)return;const n=i.inlineCompletion;if(!n)return;if(!n.showInlineEditMenu)return;const o=ym.ofLength(i.primaryGhostText.lineNumber,1);return new gne(this._editor,t,o,n)})),this._editorObs=bY(this._editor),this._register(o.createInstance(qoe,this._editor,this._inlineEditHost,this._inlineEditModel,this._ghostTextIndicator,this._focusIsInMenu))}};Joe=Xoe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(4,nc)],Joe);let ese=class extends At{constructor(e,t,i,n){super(),this._editor=e,this._model=t,this._focusIsInMenu=i,this._instantiationService=n,this._ghostTexts=pr(this,(e=>{const t=this._model.read(e);return t?.ghostTexts.read(e)??[]})),this._stablizedGhostTexts=function(e,t){const i=Js("result",[]),n=[];return t.add(ar((t=>{const o=e.read(t);Vs((e=>{if(o.length!==n.length){n.length=o.length;for(let e=0;e<n.length;e++)n[e]||(n[e]=Js("item",o[e]));i.set([...n],e)}n.forEach(((t,i)=>t.set(o[i],e)))}))}))),i}(this._ghostTexts,this._store),this._editorObs=bY(this._editor),this._ghostTextWidgets=Mr(this,this._stablizedGhostTexts,((e,t)=>vr((t=>this._instantiationService.createInstance(nne.hot.read(t),this._editor,{ghostText:e,warning:this._model.map(((e,t)=>{const i=e?.warning?.read(t);return i?{icon:i.icon}:void 0})),minReservedLineCount:Or(0),targetTextModel:this._model.map((e=>e?.textModel)),handleInlineCompletionShown:this._model.map(((e,t)=>{const i=e?.inlineCompletionState.read(t)?.inlineCompletion;return i?t=>e.handleInlineSuggestionShown(i,hte.GhostText,t):()=>{}}))},this._editorObs.getOption(71).map((e=>({syntaxHighlightingEnabled:e.syntaxHighlightingEnabled}))),!1,!1))).recomputeInitiallyAndOnChange(t))).recomputeInitiallyAndOnChange(this._store),this._inlineEdit=pr(this,(e=>this._model.read(e)?.inlineEditState.read(e)?.inlineEdit)),this._everHadInlineEdit=Tr(this,((e,t)=>t||!!this._inlineEdit.read(e)||!!this._model.read(e)?.inlineCompletionState.read(e)?.inlineCompletion?.showInlineEditMenu)),this._inlineEditWidget=vr((e=>{if(this._everHadInlineEdit.read(e))return this._instantiationService.createInstance(Joe.hot.read(e),this._editor,this._inlineEdit,this._model,this._focusIsInMenu)})).recomputeInitiallyAndOnChange(this._store),this._fontFamily=this._editorObs.getOption(71).map((e=>e.fontFamily)),this._register(function(e){const t=new Mt,i=t.add(new LM);return t.add(ar((t=>{i.setStyle(e.read(t))}))),t}(pr((e=>`\n.monaco-editor .ghost-text-decoration,\n.monaco-editor .ghost-text-decoration-preview,\n.monaco-editor .ghost-text {\n\tfont-family: ${this._fontFamily.read(e)};\n}`)))),this._register(new vG(this._editor,this._model,this._instantiationService))}shouldShowHoverAtViewZone(e){return this._ghostTextWidgets.get()[0]?.get().ownsViewZone(e)??!1}};ese=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(3,nc)],ese);var tse,ise=function(e,t){return function(i,n){t(i,n,e)}};let nse=class extends At{static{tse=this}static{this._instances=new Set}static{this.hot=C$(tse)}static{this.ID="editor.contrib.inlineCompletionsController"}static getInFocusedEditorOrParent(e){const t=aY(e);return t?tse.get(t):null}static get(e){return(t=e.getContribution(tse.ID))instanceof z8?t._instance:t;var t}constructor(e,t,i,n,o,s,r,a,l,d){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._configurationService=n,this._commandService=o,this._debounceService=s,this._languageFeaturesService=r,this._accessibilitySignalService=a,this._keybindingService=l,this._accessibilityService=d,this._editorObs=bY(this.editor),this._positions=pr(this,(e=>this._editorObs.selections.read(e)?.map((e=>e.getEndPosition()))??[new rc(1,1)])),this._suggestWidgetAdapter=this._register(new Gie(this._editorObs,(e=>this.model.get()?.handleSuggestAccepted(e)),(()=>this.model.get()?.selectedInlineCompletion.get()?.getSingleTextEdit()))),this._enabledInConfig=Sr(this,this.editor.onDidChangeConfiguration,(()=>this.editor.getOption(71).enabled)),this._isScreenReaderEnabled=Sr(this,this._accessibilityService.onDidChangeScreenReaderOptimized,(()=>this._accessibilityService.isScreenReaderOptimized())),this._editorDictationInProgress=Sr(this,this._contextKeyService.onDidChangeContext,(()=>!0===this._contextKeyService.getContext(this.editor.getDomNode()).getValue("editorDictation.inProgress"))),this._enabled=pr(this,(e=>this._enabledInConfig.read(e)&&(!this._isScreenReaderEnabled.read(e)||!this._editorDictationInProgress.read(e)))),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._focusIsInMenu=Js(this,!1),this._focusIsInEditorOrMenu=pr(this,(e=>{const t=this._editorObs.isFocused.read(e),i=this._focusIsInMenu.read(e);return t||i})),this._cursorIsInIndentation=pr(this,(e=>{const t=this._editorObs.cursorPosition.read(e);if(null===t)return!1;const i=this._editorObs.model.read(e);if(!i)return!1;this._editorObs.versionId.read(e);const n=i.getLineIndentColumn(t.lineNumber);return t.column<=n})),this.model=vr(this,(e=>{if(this._editorObs.isReadonly.read(e))return;const t=this._editorObs.model.read(e);return t?this._instantiationService.createInstance(Kte,t,this._suggestWidgetAdapter.selectedItem,this._editorObs.versionId,this._positions,this._debounceValue,this._enabled,this.editor):void 0})).recomputeInitiallyAndOnChange(this._store),this._playAccessibilitySignal=Lr(this),this._hideInlineEditOnSelectionChange=this._editorObs.getOption(71).map((e=>!0)),this._view=this._register(this._instantiationService.createInstance(ese,this.editor,this.model,this._focusIsInMenu)),tse._instances.add(this),this._register(Tt((()=>tse._instances.delete(this)))),this._register(ar((e=>{const t=this.model.read(e);if(!t)return;const i=t.state.read(e);if(!i)return;if(!this._focusIsInEditorOrMenu.read(void 0))return;const n="inlineEdit"===i.kind?i.nextEditUri:void 0;for(const e of tse._instances)e!==this&&(n&&Ph(n,e.editor.getModel()?.uri)?e.model.read(void 0)?.trigger():e.reject())}))),this._register(ar((e=>{const t=this.model.read(e),i=this.editor.getModel()?.uri;t&&i&&e.store.add(t.onDidAccept((()=>{for(const e of tse._instances){if(e===this)continue;const t=e.model.read(void 0)?.state.read(void 0);"inlineEdit"===t?.kind&&Ph(t.nextEditUri,i)&&e.model.read(void 0)?.stop("automatic")}})))}))),this._register(Wr(this._editorObs.onDidType,((e,t)=>{this._enabled.get()&&this.model.get()?.trigger()}))),this._register(Wr(this._editorObs.onDidPaste,((e,t)=>{this._enabled.get()&&this.model.get()?.trigger()}))),this._register(this._commandService.onDidExecuteCommand((t=>{if(new Set([JL.Tab.id,JL.DeleteLeft.id,JL.DeleteRight.id,lG,"acceptSelectedSuggestion"]).has(t.commandId)&&e.hasTextFocus()&&this._enabled.get()){let e=!1;t.commandId===lG&&(e=!0),this._editorObs.forceUpdate((t=>{this.model.get()?.trigger(t,{noDelay:e})}))}}))),this._register(Wr(this._editorObs.selections,((e,t,i)=>{if(i.some((e=>3===e.reason||"api"===e.source))){if(!this._hideInlineEditOnSelectionChange.get()&&"inlineEdit"===this.model.get()?.state.get()?.kind)return;const e=this.model.get();if(!e)return;"ghostText"===e.state.get()?.kind&&this.model.get()?.stop()}}))),this._register(ar((t=>{const i=this._focusIsInEditorOrMenu.read(t),n=this.model.read(void 0);if(i){const e=n?.state.read(void 0);e&&"inlineEdit"===e.kind&&e.nextEditUri||Vs((e=>{for(const t of tse._instances)t!==this&&t.model.read(void 0)?.stop("automatic",e)}))}else this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(71).keepOnBlur||CG.dropDownVisible||n&&(n.state.read(void 0)?.inlineCompletion?.isFromExplicitRequest&&n.inlineEditAvailable.read(void 0)||Vs((e=>{n.stop("automatic",e)})))}))),this._register(ar((e=>{const t=this.model.read(e)?.inlineCompletionState.read(e);t?.suggestItem?t.primaryGhostText.lineCount>=2&&this._suggestWidgetAdapter.forceRenderingAbove():this._suggestWidgetAdapter.stopForceRenderingAbove()}))),this._register(Tt((()=>{this._suggestWidgetAdapter.stopForceRenderingAbove()})));const h=Tr(this,((e,t)=>{const i=this.model.read(e),n=i?.state.read(e);return this._suggestWidgetAdapter.selectedItem.get()?t:n?.inlineCompletion?.semanticId}));this._register(Vr(pr((e=>(this._playAccessibilitySignal.read(e),h.read(e),{}))),(async(e,t,i,n)=>{let o=this.model.get(),s=o?.state.get();if(!s||!o)return;if(await mi(50,ai(n)),await yr(this._suggestWidgetAdapter.selectedItem,pt,(()=>!1),ai(n)),o=this.model.get(),s=o?.state.get(),!s||!o)return;const r="ghostText"===s.kind?o.textModel.getLineContent(s.primaryGhostText.lineNumber):"";this._accessibilitySignalService.playSignal("ghostText"===s.kind?EP.inlineSuggestion:EP.nextEditSuggestion),this.editor.getOption(12)&&("ghostText"===s.kind?this._provideScreenReaderUpdate(s.primaryGhostText.renderForScreenReader(r)):this._provideScreenReaderUpdate(""))}))),this._register(this._configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})}))),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")});const c=new Nee(this._contextKeyService);this._register(c.bind(J8.cursorInIndentation,this._cursorIsInIndentation)),this._register(c.bind(J8.hasSelection,(e=>!this._editorObs.cursorSelection.read(e)?.isEmpty()))),this._register(c.bind(J8.cursorAtInlineEdit,this.model.map(((e,t)=>e?.inlineEditState?.read(t)?.cursorAtInlineEdit.read(t))))),this._register(c.bind(J8.tabShouldAcceptInlineEdit,this.model.map(((e,t)=>!!e?.tabShouldAcceptInlineEdit.read(t))))),this._register(c.bind(J8.tabShouldJumpToInlineEdit,this.model.map(((e,t)=>!!e?.tabShouldJumpToInlineEdit.read(t))))),this._register(c.bind(J8.inlineEditVisible,(e=>void 0!==this.model.read(e)?.inlineEditState.read(e)))),this._register(c.bind(J8.inlineSuggestionHasIndentation,(e=>this.model.read(e)?.getIndentationInfo(e)?.startsWithIndentation))),this._register(c.bind(J8.inlineSuggestionHasIndentationLessThanTabSize,(e=>this.model.read(e)?.getIndentationInfo(e)?.startsWithIndentationLessThanTabSize))),this._register(c.bind(J8.suppressSuggestions,(e=>{const t=this.model.read(e),i=t?.inlineCompletionState.read(e);return i?.primaryGhostText&&i?.inlineCompletion?i.inlineCompletion.source.inlineSuggestions.suppressSuggestions:void 0}))),this._register(c.bind(J8.inlineSuggestionVisible,(e=>{const t=this.model.read(e),i=t?.inlineCompletionState.read(e);return!!i?.inlineCompletion&&void 0!==i?.primaryGhostText&&!i?.primaryGhostText.isEmpty()})));const u=pr(this,(e=>{const t=this.model.read(e),i=t?.inlineCompletionState.read(e),n=i?.primaryGhostText;if(n&&!n.isEmpty())return new rc(n.lineNumber,n.parts[0].column)}));this._register(c.bind(J8.cursorBeforeGhostText,(e=>{const t=u.read(e);if(!t)return!1;const i=this._editorObs.cursorPosition.read(e);return!!i&&t.equals(i)}))),this._register(this._instantiationService.createInstance(oee,this.editor))}playAccessibilitySignal(e){this._playAccessibilitySignal.trigger(e)}_provideScreenReaderUpdate(e){const t=this._contextKeyService.getContextKeyValue("accessibleViewIsShown"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let n;!t&&i&&this.editor.getOption(169)&&(n=y(1196,"Inspect this in the accessible view ({0})",i.getAriaLabel())),Yl(n?e+", "+n:e)}shouldShowHoverAt(e){const t=this.model.get()?.primaryGhostText.get();return!!t&&t.parts.some((i=>e.containsPosition(new rc(t.lineNumber,i.column))))}shouldShowHoverAtViewZone(e){return this._view.shouldShowHoverAtViewZone(e)}reject(){Vs((e=>{const t=this.model.get();if(t&&(t.stop("explicitCancel",e),this._focusIsInEditorOrMenu.get()))for(const t of tse._instances)t!==this&&t.model.get()?.stop("automatic",e)}))}jump(){const e=this.model.get();e&&e.jump()}};nse=tse=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([ise(1,nc),ise(2,eu),ise(3,up),ise(4,mc),ise(5,Bq),ise(6,BD),ise(7,kP),ise(8,ER),ise(9,rB)],nse);class ose extends Pu{static{this.ID=hG}constructor(){super({id:ose.ID,label:x(1174,"Show Next Inline Suggestion"),precondition:Ac.and(Xu.writable,J8.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}async run(e,t){const i=nse.get(t);i?.model.get()?.next()}}class sse extends Pu{static{this.ID=dG}constructor(){super({id:sse.ID,label:x(1175,"Show Previous Inline Suggestion"),precondition:Ac.and(Xu.writable,J8.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}async run(e,t){const i=nse.get(t);i?.model.get()?.previous()}}lu.registerKeybindingRule({id:lG,weight:202,primary:2,when:Ac.and(J8.inInlineEditsPreviewEditor)});class rse extends Pu{static{this.ID=cG}constructor(){super({id:rse.ID,label:x(1182,"Hide Inline Suggestion"),precondition:Ac.or(J8.inlineSuggestionVisible,J8.inlineEditVisible),kbOpts:{weight:190,primary:9},menuOpts:[{menuId:gu.InlineEditsActions,title:y(1171,"Reject"),group:"primary",order:3}]})}async run(e,t){const i=nse.getInFocusedEditorOrParent(e);Vs((e=>{i?.model.get()?.stop("explicitCancel",e)})),i?.editor.focus()}}class ase extends Pu{static{this.ID=uG}constructor(){super({id:ase.ID,label:x(1183,"Toggle Inline Suggestions Show Collapsed"),precondition:Ac.true()})}async run(e,t){const i=e.get(up),n=i.getValue("editor.inlineSuggest.edits.showCollapsed");i.updateValue("editor.inlineSuggest.edits.showCollapsed",!n)}}lu.registerKeybindingRule({id:rse.ID,weight:-1,primary:9,secondary:[1033],when:Ac.and(J8.inInlineEditsPreviewEditor)});class lse extends bu{static{this.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar"}constructor(){super({id:lse.ID,title:y(1172,"Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:gu.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:Ac.equals("config.editor.inlineSuggest.showToolbar","always")})}async run(e){const t=e.get(up),i="always"===t.getValue("editor.inlineSuggest.showToolbar")?"onHover":"always";t.updateValue("editor.inlineSuggest.showToolbar",i)}}var dse=function(e,t){return function(i,n){t(i,n,e)}};class hse{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let cse=class{constructor(e,t,i,n,o,s){this._editor=e,this._languageService=t,this._openerService=i,this.accessibilityService=n,this._instantiationService=o,this._telemetryService=s,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=nse.get(this._editor);if(!t)return null;const i=e.target;if(8===i.type){const n=i.detail;if(t.shouldShowHoverAtViewZone(n.viewZoneId))return new Zq(1e3,this,Yu.fromPositions(this._editor.getModel().validatePosition(n.positionBefore||n.position)),e.event.posx,e.event.posy,!1)}if(7===i.type&&t.shouldShowHoverAt(i.range))return new Zq(1e3,this,i.range,e.event.posx,e.event.posy,!1);if(6===i.type&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range))return new Zq(1e3,this,i.range,e.event.posx,e.event.posy,!1);if(9===i.type&&i.element){const n=nne.getWarningWidgetContext(i.element);if(n&&t.shouldShowHoverAt(n.range))return new Zq(1e3,this,n.range,e.event.posx,e.event.posy,!1)}return null}computeSync(e,t){if("onHover"!==this._editor.getOption(71).showToolbar)return[];const i=nse.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new hse(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new Mt,n=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(12)&&i.add(this.renderScreenReaderText(e,n));const o=n.controller.model.get(),s=document.createElement("div");return e.fragment.appendChild(s),i.add(hr(((t,i)=>{const n=i.add(this._instantiationService.createInstance(CG.hot.read(t),this._editor,!1,Or(null),o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.activeCommands,o.warning,(()=>{e.onContentsChanged()})));s.replaceChildren(n.getDomNode())}))),o.triggerExplicitly(),new Yq([{hoverPart:n,hoverElement:s,dispose(){i.dispose()}}])}renderScreenReaderText(e,t){const i=new Mt,n=ll,o=n("div.hover-row.markdown-hover"),s=il(o,n("div.hover-contents",{"aria-live":"assertive"})),r=new aT({editor:this._editor},this._languageService,this._openerService);return i.add(ar((n=>{const o=t.controller.model.read(n)?.primaryGhostText.read(n);if(o){const t=this._editor.getModel().getLineContent(o.lineNumber);(t=>{const n=y(1197,"Suggestion:"),o=i.add(r.render((new Gh).appendText(n).appendCodeblock("text",t),{asyncRenderCallback:()=>{s.className="hover-contents code-hover-contents",e.onContentsChanged()}}));s.replaceChildren(o.element)})(o.renderForScreenReader(t))}else ol(s)}))),e.fragment.appendChild(o),i}};cse=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([dse(1,Tg),dse(2,ZI),dse(3,rB),dse(4,nc),dse(5,Cu)],cse),Uu(nse.ID,nse.hot.get(),3),Hu(class extends Pu{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:x(1176,"Trigger Inline Suggestion"),precondition:Xu.writable})}async run(e,t){const i=nse.get(t);await async function(e){const t=new Us(e,void 0);try{await e(t)}finally{t.finish()}}((async e=>{await(i?.model.get()?.triggerExplicitly(e)),i?.playAccessibilitySignal(e)}))}}),Hu(class extends Pu{constructor(){super({id:"editor.action.inlineSuggest.triggerInlineEditExplicit",label:x(1177,"Trigger Next Edit Suggestion"),precondition:Xu.writable})}async run(e,t){const i=e.get(lO),n=nse.get(t);await(n?.model.get()?.triggerExplicitly(void 0,!0)),n?.model.get()?.inlineEditAvailable.get()||i.notify({severity:aO.Info,message:y(1165,"No inline edit is available.")})}}),Vu(new class extends Ou{constructor(){super({id:"editor.action.inlineSuggest.triggerInlineEdit",precondition:Xu.writable})}async runEditorCommand(e,t,i){const n=nse.get(t);await(n?.model.get()?.trigger(void 0,{onlyFetchInlineEdits:!0}))}}),Hu(ose),Hu(sse),Hu(class extends Pu{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:x(1178,"Accept Next Word Of Inline Suggestion"),precondition:Ac.and(Xu.writable,J8.inlineSuggestionVisible),kbOpts:{weight:101,primary:2065,kbExpr:Ac.and(Xu.writable,J8.inlineSuggestionVisible,J8.cursorBeforeGhostText,aB.negate())},menuOpts:[{menuId:gu.InlineSuggestionToolbar,title:y(1166,"Accept Word"),group:"primary",order:2}]})}async run(e,t){const i=nse.get(t);await(i?.model.get()?.acceptNextWord())}}),Hu(class extends Pu{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:x(1179,"Accept Next Line Of Inline Suggestion"),precondition:Ac.and(Xu.writable,J8.inlineSuggestionVisible),kbOpts:{weight:101},menuOpts:[{menuId:gu.InlineSuggestionToolbar,title:y(1167,"Accept Line"),group:"secondary",order:2}]})}async run(e,t){const i=nse.get(t);await(i?.model.get()?.acceptNextLine())}}),Hu(class extends Pu{constructor(){super({id:lG,label:x(1180,"Accept Inline Suggestion"),precondition:Ac.or(J8.inlineSuggestionVisible,J8.inlineEditVisible),menuOpts:[{menuId:gu.InlineSuggestionToolbar,title:y(1168,"Accept"),group:"primary",order:2},{menuId:gu.InlineEditsActions,title:y(1169,"Accept"),group:"primary",order:2}],kbOpts:[{primary:2,weight:200,kbExpr:Ac.or(Ac.and(J8.inlineSuggestionVisible,Xu.tabMovesFocus.toNegated(),K8.Visible.toNegated(),Xu.hoverFocused.toNegated(),J8.hasSelection.toNegated(),J8.inlineSuggestionHasIndentationLessThanTabSize),Ac.and(J8.inlineEditVisible,Xu.tabMovesFocus.toNegated(),K8.Visible.toNegated(),Xu.hoverFocused.toNegated(),J8.tabShouldAcceptInlineEdit))}]})}async run(e,t){const i=nse.getInFocusedEditorOrParent(e);i&&(i.model.get()?.accept(i.editor),i.editor.focus())}}),Hu(ase),Hu(rse),Hu(class extends Pu{constructor(){super({id:"editor.action.inlineSuggest.jump",label:x(1181,"Jump to next inline edit"),precondition:J8.inlineEditVisible,menuOpts:[{menuId:gu.InlineEditsActions,title:y(1170,"Jump"),group:"primary",order:1,when:J8.cursorAtInlineEdit.toNegated()}],kbOpts:{primary:2,weight:201,kbExpr:Ac.and(J8.inlineEditVisible,Xu.tabMovesFocus.toNegated(),K8.Visible.toNegated(),Xu.hoverFocused.toNegated(),J8.tabShouldJumpToInlineEdit)}})}async run(e,t){const i=nse.get(t);i&&i.jump()}}),wu(lse),Hu(class extends Pu{constructor(){super({id:"editor.action.inlineSuggest.dev.extractRepro",label:y(1173,"Developer: Extract Inline Suggest State"),alias:"Developer: Inline Suggest Extract Repro",precondition:Ac.or(J8.inlineEditVisible,J8.inlineSuggestionVisible)})}async run(e,t){const i=e.get(oD),n=nse.get(t),o=n?.model.get();if(!o)return;const s=o.extractReproSample(),r=qi(JSON.stringify({inlineCompletion:s.inlineCompletion},null,4)).map((e=>"// "+e)).join("\n"),a=`${s.documentValue}\n\n// <json>\n${r}\n// </json>\n`;return await i.writeText(a),{reproCase:a}}}),wu(Vte),wu(Hte),Qq.register(cse),f8.register(new class{});class use{constructor(e){this._selection=e,this._selectionId=null}getEditOperations(e,t){const i=function(e){const t=e.getLineCount(),i=-1===Zi(e.getLineContent(t));if(t&&!i)return qZ.insert(new rc(t,e.getLineMaxColumn(t)),e.getEOL())}(e);i&&t.addEditOperation(i.range,i.text),this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}class gse extends Pu{static{this.ID="editor.action.insertFinalNewLine"}constructor(){super({id:gse.ID,label:x(1232,"Insert Final New Line"),precondition:Xu.writable})}run(e,t,i){const n=t.getSelection();if(null===n)return;const o=new use(n);t.pushUndoStop(),t.executeCommands(this.id,[o]),t.pushUndoStop()}}Hu(gse);var pse=i(2931),mse={};mse.styleTagTransform=zl(),mse.setAttributes=Bl(),mse.insert=Pl().bind(null,"head"),mse.domAPI=Rl(),mse.insertStyleElement=Vl(),Ml()(pse.A,mse),pse.A&&pse.A.locals&&pse.A.locals;const fse=oc("themeService");var _se,vse=function(e,t){return function(i,n){t(i,n,e)}};let bse=class extends At{static{_se=this}static{this.ID="editor.contrib.inspectTokens"}static get(e){return e.getContribution(_se.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel((e=>this.stop()))),this._register(this._editor.onDidChangeModelLanguage((e=>this.stop()))),this._register(JS.onDidChange((e=>this.stop()))),this._register(this._editor.onKeyUp((e=>9===e.keyCode&&this.stop())))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new wse(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};bse=_se=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([vse(1,fse),vse(2,Tg)],bse);class wse extends At{static{this._ID="editor.contrib.inspectTokensWidget"}constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=function(e,t){const i=JS.get(t);if(i)return i;const n=e.encodeLanguageId(t);return{getInitialState:()=>ex,tokenize:(e,i,n)=>tx(t,n),tokenizeEncoded:(e,t,i)=>ix(n,i)}}(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition((e=>this._compute(this._editor.getPosition())))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return wse._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let n=t.tokens1.length-1;n>=0;n--){const o=t.tokens1[n];if(e.column-1>=o.offset){i=n;break}}let n=0;for(let i=t.tokens2.length>>>1;i>=0;i--)if(e.column-1>=t.tokens2[i<<1]){n=i;break}const o=this._model.getLineContent(e.lineNumber);let s="";if(i<t.tokens1.length){const e=t.tokens1[i].offset,n=i+1<t.tokens1.length?t.tokens1[i+1].offset:o.length;s=o.substring(e,n)}ol(this._domNode,ll("h2.tm-token",void 0,function(e){let t="";for(let i=0,n=e.length;i<n;i++){const n=e.charCodeAt(i);switch(n){case 9:t+="→";break;case 32:t+="·";break;default:t+=String.fromCharCode(n)}}return t}(s),ll("span.tm-token-length",void 0,`${s.length} ${1===s.length?"char":"chars"}`))),il(this._domNode,ll("hr.tokens-inspect-separator",{style:"clear:both"}));const r=1+(n<<1)<t.tokens2.length?this._decodeMetadata(t.tokens2[1+(n<<1)]):null;il(this._domNode,ll("table.tm-metadata-table",void 0,ll("tbody",void 0,ll("tr",void 0,ll("td.tm-metadata-key",void 0,"language"),ll("td.tm-metadata-value",void 0,`${r?r.languageId:"-?-"}`)),ll("tr",void 0,ll("td.tm-metadata-key",void 0,"token type"),ll("td.tm-metadata-value",void 0,`${r?this._tokenTypeToString(r.tokenType):"-?-"}`)),ll("tr",void 0,ll("td.tm-metadata-key",void 0,"font style"),ll("td.tm-metadata-value",void 0,`${r?this._fontStyleToString(r.fontStyle):"-?-"}`)),ll("tr",void 0,ll("td.tm-metadata-key",void 0,"foreground"),ll("td.tm-metadata-value",void 0,`${r?Lg.Format.CSS.formatHex(r.foreground):"-?-"}`)),ll("tr",void 0,ll("td.tm-metadata-key",void 0,"background"),ll("td.tm-metadata-value",void 0,`${r?Lg.Format.CSS.formatHex(r.background):"-?-"}`))))),il(this._domNode,ll("hr.tokens-inspect-separator")),i<t.tokens1.length&&il(this._domNode,ll("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){const t=JS.getColorMap(),i=of.getLanguageId(e),n=of.getTokenType(e),o=of.getFontStyle(e),s=of.getForeground(e),r=of.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(i),tokenType:n,fontStyle:o,foreground:t[s],background:t[r]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 3:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return 1&e&&(t+="italic "),2&e&&(t+="bold "),4&e&&(t+="underline "),8&e&&(t+="strikethrough "),0===t.length&&(t="---"),t}_getTokensAtLine(e){const t=this._getStateBeforeLine(e),i=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t),n=this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e),!0,t);return{startState:t,tokens1:i.tokens,tokens2:n.tokens,endState:i.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let i=1;i<e;i++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(i),!0,t).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}}Uu(bse.ID,bse,4),Hu(class extends Pu{constructor(){super({id:"editor.action.inspectTokens",label:H7.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const i=bse.get(t);i?.launch()}}),Hu(class extends Pu{constructor(){super({id:"expandLineSelection",label:x(1233,"Expand Line Selection"),precondition:void 0,kbOpts:{weight:0,kbExpr:Xu.textInputFocus,primary:2090}})}run(e,t,i){if(i=i||{},!t.hasModel())return;const n=t._getViewModel();n.model.pushStackElement(),n.setCursorStates(i.source,3,iL.expandLineSelection(n,n.getCursorStates())),n.revealAllCursors(i.source,!0)}});class Cse{constructor(e,t,i){this._selection=e,this._cursors=t,this._selectionId=null,this._trimInRegexesAndStrings=i}getEditOperations(e,t){const i=function(e,t,i){t.sort(((e,t)=>e.lineNumber===t.lineNumber?e.column-t.column:e.lineNumber-t.lineNumber));for(let e=t.length-2;e>=0;e--)t[e].lineNumber===t[e+1].lineNumber&&t.splice(e,1);const n=[];let o=0,s=0;const r=t.length;for(let a=1,l=e.getLineCount();a<=l;a++){const l=e.getLineContent(a),d=l.length+1;let h=0;if(s<r&&t[s].lineNumber===a&&(h=t[s].column,s++,h===d))continue;if(0===l.length)continue;const c=Zi(l);let u=0;if(-1===c)u=1;else{if(c===l.length-1)continue;u=c+2}if(!i){if(!e.tokenization.hasAccurateTokensForLine(a))continue;const t=e.tokenization.getLineTokens(a),i=t.getStandardTokenType(t.findTokenIndexAtOffset(u));if(2===i||3===i)continue}u=Math.max(h,u),n[o++]=qZ.delete(new Yu(a,u,a,d))}return n}(e,this._cursors,this._trimInRegexesAndStrings);for(let e=0,n=i.length;e<n;e++){const n=i[e];t.addEditOperation(n.range,n.text)}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}class yse{constructor(e,t,i){this._selection=e,this._isCopyingDown=t,this._noop=i||!1,this._selectionDirection=0,this._selectionId=null,this._startLineNumberDelta=0,this._endLineNumberDelta=0}getEditOperations(e,t){let i=this._selection;this._startLineNumberDelta=0,this._endLineNumberDelta=0,i.startLineNumber<i.endLineNumber&&1===i.endColumn&&(this._endLineNumberDelta=1,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));const n=[];for(let t=i.startLineNumber;t<=i.endLineNumber;t++)n.push(e.getLineContent(t));const o=n.join("\n");""===o&&this._isCopyingDown&&(this._startLineNumberDelta++,this._endLineNumberDelta++),this._noop?t.addEditOperation(new Yu(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber+1,1),i.endLineNumber===e.getLineCount()?"":"\n"):this._isCopyingDown?t.addEditOperation(new Yu(i.startLineNumber,1,i.startLineNumber,1),o+"\n"):t.addEditOperation(new Yu(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),"\n"+o),this._selectionId=t.trackSelection(i),this._selectionDirection=this._selection.getDirection()}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);if(0!==this._startLineNumberDelta||0!==this._endLineNumberDelta){let e=i.startLineNumber,t=i.startColumn,n=i.endLineNumber,o=i.endColumn;0!==this._startLineNumberDelta&&(e+=this._startLineNumberDelta,t=1),0!==this._endLineNumberDelta&&(n+=this._endLineNumberDelta,o=1),i=Qu.createWithDirection(e,t,n,o,this._selectionDirection)}return i}}let Sse=class{constructor(e,t,i,n){this._languageConfigurationService=n,this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const i=()=>e.getLanguageId(),n=(t,i)=>e.getLanguageIdAtPosition(t,i),o=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===o)return void(this._selectionId=t.trackSelection(this._selection));if(!this._isMovingDown&&1===this._selection.startLineNumber)return void(this._selectionId=t.trackSelection(this._selection));this._moveEndPositionDown=!1;let s=this._selection;s.startLineNumber<s.endLineNumber&&1===s.endColumn&&(this._moveEndPositionDown=!0,s=s.setEndPosition(s.endLineNumber-1,e.getLineMaxColumn(s.endLineNumber-1)));const{tabSize:r,indentSize:a,insertSpaces:l}=e.getOptions(),d=this.buildIndentConverter(r,a,l);if(s.startLineNumber===s.endLineNumber&&1===e.getLineMaxColumn(s.startLineNumber)){const i=s.startLineNumber,n=this._isMovingDown?i+1:i-1;1===e.getLineMaxColumn(n)?t.addEditOperation(new Yu(1,1,1,1),null):(t.addEditOperation(new Yu(i,1,i,1),e.getLineContent(n)),t.addEditOperation(new Yu(n,1,n,e.getLineMaxColumn(n)),null)),s=new Qu(n,1,n,1)}else{let o,a;if(this._isMovingDown){o=s.endLineNumber+1,a=e.getLineContent(o),t.addEditOperation(new Yu(o-1,e.getLineMaxColumn(o-1),o,e.getLineMaxColumn(o)),null);let h=a;if(this.shouldAutoIndent(e,s)){const c=this.matchEnterRule(e,d,r,o,s.startLineNumber-1);if(null!==c){const t=D8(c+L8(Gi(e.getLineContent(o)),r),r,l);h=t+this.trimStart(a)}else{const t={tokenization:{getLineTokens:t=>t===s.startLineNumber?e.tokenization.getLineTokens(o):e.tokenization.getLineTokens(t),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:t=>t===s.startLineNumber?e.getLineContent(o):e.getLineContent(t)},c=fL(this._autoIndent,t,e.getLanguageIdAtPosition(o,1),s.startLineNumber,d,this._languageConfigurationService);if(null!==c){const t=Gi(e.getLineContent(o)),i=L8(c,r);if(i!==L8(t,r)){const e=D8(i,r,l);h=e+this.trimStart(a)}}}t.addEditOperation(new Yu(s.startLineNumber,1,s.startLineNumber,1),h+"\n");const u=this.matchEnterRuleMovingDown(e,d,r,s.startLineNumber,o,h);if(null!==u)0!==u&&this.getIndentEditsOfMovingBlock(e,t,s,r,l,u);else{const a={tokenization:{getLineTokens:t=>t===s.startLineNumber?e.tokenization.getLineTokens(o):t>=s.startLineNumber+1&&t<=s.endLineNumber+1?e.tokenization.getLineTokens(t-1):e.tokenization.getLineTokens(t),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:t=>t===s.startLineNumber?h:t>=s.startLineNumber+1&&t<=s.endLineNumber+1?e.getLineContent(t-1):e.getLineContent(t)},c=fL(this._autoIndent,a,e.getLanguageIdAtPosition(o,1),s.startLineNumber+1,d,this._languageConfigurationService);if(null!==c){const i=Gi(e.getLineContent(s.startLineNumber)),n=L8(c,r),o=L8(i,r);if(n!==o){const i=n-o;this.getIndentEditsOfMovingBlock(e,t,s,r,l,i)}}}}else t.addEditOperation(new Yu(s.startLineNumber,1,s.startLineNumber,1),h+"\n")}else if(o=s.startLineNumber-1,a=e.getLineContent(o),t.addEditOperation(new Yu(o,1,o+1,1),null),t.addEditOperation(new Yu(s.endLineNumber,e.getLineMaxColumn(s.endLineNumber),s.endLineNumber,e.getLineMaxColumn(s.endLineNumber)),"\n"+a),this.shouldAutoIndent(e,s)){const a={tokenization:{getLineTokens:t=>t===o?e.tokenization.getLineTokens(s.startLineNumber):e.tokenization.getLineTokens(t),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:t=>t===o?e.getLineContent(s.startLineNumber):e.getLineContent(t)},h=this.matchEnterRule(e,d,r,s.startLineNumber,s.startLineNumber-2);if(null!==h)0!==h&&this.getIndentEditsOfMovingBlock(e,t,s,r,l,h);else{const i=fL(this._autoIndent,a,e.getLanguageIdAtPosition(s.startLineNumber,1),o,d,this._languageConfigurationService);if(null!==i){const n=Gi(e.getLineContent(s.startLineNumber)),o=L8(i,r),a=L8(n,r);if(o!==a){const i=o-a;this.getIndentEditsOfMovingBlock(e,t,s,r,l,i)}}}}}this._selectionId=t.trackSelection(s)}buildIndentConverter(e,t,i){return{shiftIndent:n=>uL.shiftIndent(n,n.length+1,e,t,i),unshiftIndent:n=>uL.unshiftIndent(n,n.length+1,e,t,i)}}parseEnterResult(e,t,i,n,o){if(o){let s=o.indentation;o.indentAction===Bg.None||o.indentAction===Bg.Indent?s=o.indentation+o.appendText:o.indentAction===Bg.IndentOutdent?s=o.indentation:o.indentAction===Bg.Outdent&&(s=t.unshiftIndent(o.indentation)+o.appendText);const r=e.getLineContent(n);if(this.trimStart(r).indexOf(this.trimStart(s))>=0){const o=Gi(e.getLineContent(n));let r=Gi(s);const a=_L(e,n,this._languageConfigurationService);return null!==a&&2&a&&(r=t.unshiftIndent(r)),L8(r,i)-L8(o,i)}}return null}matchEnterRuleMovingDown(e,t,i,n,o,s){if(Zi(s)>=0){const s=e.getLineMaxColumn(o),r=lL(this._autoIndent,e,new Yu(o,s,o,s),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,r)}{let o=n-1;for(;o>=1&&!(Zi(e.getLineContent(o))>=0);)o--;if(o<1||n>e.getLineCount())return null;const s=e.getLineMaxColumn(o),r=lL(this._autoIndent,e,new Yu(o,s,o,s),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,r)}}matchEnterRule(e,t,i,n,o,s){let r=o;for(;r>=1;){let t;if(t=r===o&&void 0!==s?s:e.getLineContent(r),Zi(t)>=0)break;r--}if(r<1||n>e.getLineCount())return null;const a=e.getLineMaxColumn(r),l=lL(this._autoIndent,e,new Yu(r,a,r,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,l)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4)return!1;if(!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const i=e.getLanguageIdAtPosition(t.startLineNumber,1);return i===e.getLanguageIdAtPosition(t.endLineNumber,1)&&null!==this._languageConfigurationService.getLanguageConfiguration(i).indentRulesSupport}getIndentEditsOfMovingBlock(e,t,i,n,o,s){for(let r=i.startLineNumber;r<=i.endLineNumber;r++){const a=Gi(e.getLineContent(r)),l=D8(L8(a,n)+s,n,o);l!==a&&(t.addEditOperation(new Yu(r,1,r,a.length+1),l),r===i.endLineNumber&&i.endColumn<=a.length+1&&""===l&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber<i.endLineNumber&&(i=i.setEndPosition(i.endLineNumber,2)),i}};Sse=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(3,Qp)],Sse);class xse{static{this._COLLATOR=Fy()}constructor(e,t){this.selection=e,this.descending=t,this.selectionId=null}getEditOperations(e,t){const i=function(e,t,i){const n=kse(e,t,i);return n?qZ.replace(new Yu(n.startLineNumber,1,n.endLineNumber,e.getLineMaxColumn(n.endLineNumber)),n.after.join("\n")):null}(e,this.selection,this.descending);i&&t.addEditOperation(i.range,i.text),this.selectionId=t.trackSelection(this.selection)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}static canRun(e,t,i){if(null===e)return!1;const n=kse(e,t,i);if(!n)return!1;for(let e=0,t=n.before.length;e<t;e++)if(n.before[e]!==n.after[e])return!0;return!1}}function kse(e,t,i){const n=t.startLineNumber;let o=t.endLineNumber;if(1===t.endColumn&&o--,n>=o)return null;const s=[];for(let t=n;t<=o;t++)s.push(e.getLineContent(t));let r=s.slice(0);return r.sort(xse._COLLATOR.value.compare),!0===i&&(r=r.reverse()),{startLineNumber:n,endLineNumber:o,before:s,after:r}}class Lse extends Pu{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map(((e,t)=>({selection:e,index:t,ignore:!1})));i.sort(((e,t)=>Yu.compareRangesUsingStarts(e.selection,t.selection)));let n=i[0];for(let e=1;e<i.length;e++){const t=i[e];n.selection.endLineNumber===t.selection.startLineNumber&&(n.index<t.index?t.ignore=!0:(n.ignore=!0,n=t))}const o=[];for(const e of i)o.push(new yse(e.selection,this.down,e.ignore));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class Dse extends Pu{constructor(e,t){super(t),this.down=e}run(e,t){const i=e.get(Qp),n=[],o=t.getSelections()||[],s=t.getOption(16);for(const e of o)n.push(new Sse(e,this.down,s,i));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class Ese extends Pu{constructor(e,t){super(t),this.descending=e}run(e,t){if(!t.hasModel())return;const i=t.getModel();let n=t.getSelections();1===n.length&&n[0].isEmpty()&&(n=[new Qu(1,1,i.getLineCount(),i.getLineMaxColumn(i.getLineCount()))]);for(const e of n)if(!xse.canRun(t.getModel(),e,this.descending))return;const o=[];for(let e=0,t=n.length;e<t;e++)o[e]=new xse(n[e],this.descending);t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class Nse extends Pu{static{this.ID="editor.action.trimTrailingWhitespace"}constructor(){super({id:Nse.ID,label:x(1248,"Trim Trailing Whitespace"),precondition:Xu.writable,kbOpts:{kbExpr:Xu.editorTextFocus,primary:De(2089,2102),weight:100}})}run(e,t,i){let n=[];"auto-save"===i.reason&&(n=(t.getSelections()||[]).map((e=>new rc(e.positionLineNumber,e.positionColumn))));const o=t.getSelection();if(null===o)return;const s=e.get(up),r=t.getModel(),a=s.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:r?.getLanguageId(),resource:r?.uri}),l=new Cse(o,n,a);t.pushUndoStop(),t.executeCommands(this.id,[l]),t.pushUndoStop()}}class Ise extends Pu{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),n=this._getRangesToDelete(t),o=[];for(let e=0,t=n.length-1;e<t;e++){const t=n[e],i=n[e+1];null===Yu.intersectRanges(t,i)?o.push(t):n[e+1]=Yu.plusRange(t,i)}o.push(n[n.length-1]);const s=this._getEndCursorState(i,o),r=o.map((e=>qZ.replace(e,"")));t.pushUndoStop(),t.executeEdits(this.id,r,s),t.pushUndoStop()}}class Tse extends Pu{run(e,t){const i=t.getSelections();if(null===i)return;const n=t.getModel();if(null===n)return;const o=t.getOption(148),s=[];for(const e of i)if(e.isEmpty()){const i=e.getStartPosition(),r=t.getConfiguredWordAtPosition(i);if(!r)continue;const a=new Yu(i.lineNumber,r.startColumn,i.lineNumber,r.endColumn),l=n.getValueInRange(a);s.push(qZ.replace(a,this._modifyText(l,o)))}else{const t=n.getValueInRange(e);s.push(qZ.replace(e,this._modifyText(t,o)))}t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop()}}class Mse{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch(e){}}return this._actual}isSupported(){return null!==this.get()}}class Ase extends Tse{static{this.titleBoundary=new Mse("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu")}constructor(){super({id:"editor.action.transformToTitlecase",label:x(1260,"Transform to Title Case"),precondition:Xu.writable})}_modifyText(e,t){const i=Ase.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,(e=>e.toLocaleUpperCase())):e}}class Rse extends Tse{static{this.caseBoundary=new Mse("(\\p{Ll})(\\p{Lu})","gmu")}static{this.singleLetters=new Mse("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu")}constructor(){super({id:"editor.action.transformToSnakecase",label:x(1261,"Transform to Snake Case"),precondition:Xu.writable})}_modifyText(e,t){const i=Rse.caseBoundary.get(),n=Rse.singleLetters.get();return i&&n?e.replace(i,"$1_$2").replace(n,"$1_$2$3").toLocaleLowerCase():e}}class Ose extends Tse{static{this.singleLineWordBoundary=new Mse("[_\\s-]+","gm")}static{this.multiLineWordBoundary=new Mse("[_-]+","gm")}static{this.validWordStart=new Mse("^(\\p{Lu}[^\\p{Lu}])","gmu")}constructor(){super({id:"editor.action.transformToCamelcase",label:x(1262,"Transform to Camel Case"),precondition:Xu.writable})}_modifyText(e,t){const i=/\r\n|\r|\n/.test(e)?Ose.multiLineWordBoundary.get():Ose.singleLineWordBoundary.get(),n=Ose.validWordStart.get();if(!i||!n)return e;const o=e.split(i),s=o.shift()?.replace(n,(e=>e.toLocaleLowerCase()));return s+o.map((e=>e.substring(0,1).toLocaleUpperCase()+e.substring(1))).join("")}}class Pse extends Tse{static{this.wordBoundary=new Mse("[_ \\t-]","gm")}static{this.wordBoundaryToMaintain=new Mse("(?<=\\.)","gm")}constructor(){super({id:"editor.action.transformToPascalcase",label:x(1263,"Transform to Pascal Case"),precondition:Xu.writable})}_modifyText(e,t){const i=Pse.wordBoundary.get(),n=Pse.wordBoundaryToMaintain.get();return i&&n?e.split(n).map((e=>e.split(i))).flat().map((e=>e.substring(0,1).toLocaleUpperCase()+e.substring(1))).join(""):e}}class Fse extends Tse{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every((e=>e.isSupported()))}static{this.caseBoundary=new Mse("(\\p{Ll})(\\p{Lu})","gmu")}static{this.singleLetters=new Mse("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu")}static{this.underscoreBoundary=new Mse("(\\S)(_)(\\S)","gm")}constructor(){super({id:"editor.action.transformToKebabcase",label:x(1264,"Transform to Kebab Case"),precondition:Xu.writable})}_modifyText(e,t){const i=Fse.caseBoundary.get(),n=Fse.singleLetters.get(),o=Fse.underscoreBoundary.get();return i&&n&&o?e.replace(o,"$1-$3").replace(i,"$1-$2").replace(n,"$1-$2").toLocaleLowerCase():e}}Hu(class extends Lse{constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:x(1239,"Copy Line Up"),precondition:Xu.writable,kbOpts:{kbExpr:Xu.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:gu.MenubarSelectionMenu,group:"2_line",title:y(1234,"&&Copy Line Up"),order:1}})}}),Hu(class extends Lse{constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:x(1240,"Copy Line Down"),precondition:Xu.writable,kbOpts:{kbExpr:Xu.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:gu.MenubarSelectionMenu,group:"2_line",title:y(1235,"Co&&py Line Down"),order:2}})}}),Hu(class extends Pu{constructor(){super({id:"editor.action.duplicateSelection",label:x(1241,"Duplicate Selection"),precondition:Xu.writable,menuOpts:{menuId:gu.MenubarSelectionMenu,group:"2_line",title:y(1236,"&&Duplicate Selection"),order:5}})}run(e,t,i){if(!t.hasModel())return;const n=[],o=t.getSelections(),s=t.getModel();for(const e of o)if(e.isEmpty())n.push(new yse(e,!0));else{const t=new Qu(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn);n.push(new Uk(t,s.getValueInRange(e)))}t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}),Hu(class extends Dse{constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:x(1242,"Move Line Up"),precondition:Xu.writable,kbOpts:{kbExpr:Xu.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:gu.MenubarSelectionMenu,group:"2_line",title:y(1237,"Mo&&ve Line Up"),order:3}})}}),Hu(class extends Dse{constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:x(1243,"Move Line Down"),precondition:Xu.writable,kbOpts:{kbExpr:Xu.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:gu.MenubarSelectionMenu,group:"2_line",title:y(1238,"Move &&Line Down"),order:4}})}}),Hu(class extends Ese{constructor(){super(!1,{id:"editor.action.sortLinesAscending",label:x(1244,"Sort Lines Ascending"),precondition:Xu.writable})}}),Hu(class extends Ese{constructor(){super(!0,{id:"editor.action.sortLinesDescending",label:x(1245,"Sort Lines Descending"),precondition:Xu.writable})}}),Hu(class extends Pu{constructor(){super({id:"editor.action.removeDuplicateLines",label:x(1246,"Delete Duplicate Lines"),precondition:Xu.writable})}run(e,t){if(!t.hasModel())return;const i=t.getModel();if(1===i.getLineCount()&&1===i.getLineMaxColumn(1))return;const n=[],o=[];let s=0,r=!0,a=t.getSelections();1===a.length&&a[0].isEmpty()&&(a=[new Qu(1,1,i.getLineCount(),i.getLineMaxColumn(i.getLineCount()))],r=!1);for(const e of a){const t=new Set,r=[];for(let n=e.startLineNumber;n<=e.endLineNumber;n++){const e=i.getLineContent(n);t.has(e)||(r.push(e),t.add(e))}const a=new Qu(e.startLineNumber,1,e.endLineNumber,i.getLineMaxColumn(e.endLineNumber)),l=e.startLineNumber-s,d=new Qu(l,1,l+r.length-1,r[r.length-1].length);n.push(qZ.replace(a,r.join("\n"))),o.push(d),s+=e.endLineNumber-e.startLineNumber+1-r.length}t.pushUndoStop(),t.executeEdits(this.id,n,r?o:void 0),t.pushUndoStop()}}),Hu(Nse),Hu(class extends Pu{constructor(){super({id:"editor.action.deleteLines",label:x(1249,"Delete Line"),precondition:Xu.writable,kbOpts:{kbExpr:Xu.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),n=t.getModel();if(1===n.getLineCount()&&1===n.getLineMaxColumn(1))return;let o=0;const s=[],r=[];for(let e=0,t=i.length;e<t;e++){const t=i[e];let a=t.startLineNumber,l=t.endLineNumber,d=1,h=n.getLineMaxColumn(l);l<n.getLineCount()?(l+=1,h=1):a>1&&(a-=1,d=n.getLineMaxColumn(a)),s.push(qZ.replace(new Qu(a,d,l,h),"")),r.push(new Qu(a-o,t.positionColumn,a-o,t.positionColumn)),o+=t.endLineNumber-t.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,s,r),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map((e=>{let t=e.endLineNumber;return e.startLineNumber<e.endLineNumber&&1===e.endColumn&&(t-=1),{startLineNumber:e.startLineNumber,selectionStartColumn:e.selectionStartColumn,endLineNumber:t,positionColumn:e.positionColumn}}));t.sort(((e,t)=>e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber));const i=[];let n=t[0];for(let e=1;e<t.length;e++)n.endLineNumber+1>=t[e].startLineNumber?n.endLineNumber=t[e].endLineNumber:(i.push(n),n=t[e]);return i.push(n),i}}),Hu(class extends Pu{constructor(){super({id:"editor.action.indentLines",label:x(1250,"Indent Line"),precondition:Xu.writable,kbOpts:{kbExpr:Xu.editorTextFocus,primary:2142,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,UL.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}),Hu(class extends Pu{constructor(){super({id:"editor.action.outdentLines",label:x(1251,"Outdent Line"),precondition:Xu.writable,kbOpts:{kbExpr:Xu.editorTextFocus,primary:2140,weight:100}})}run(e,t){JL.Outdent.runEditorCommand(e,t,null)}}),Hu(class extends Pu{constructor(){super({id:"editor.action.insertLineBefore",label:x(1252,"Insert Line Above"),precondition:Xu.writable,kbOpts:{kbExpr:Xu.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,LL.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}),Hu(class extends Pu{constructor(){super({id:"editor.action.insertLineAfter",label:x(1253,"Insert Line Below"),precondition:Xu.writable,kbOpts:{kbExpr:Xu.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,LL.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}),Hu(class extends Ise{constructor(){super({id:"deleteAllLeft",label:x(1254,"Delete All Left"),precondition:Xu.writable,kbOpts:{kbExpr:Xu.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let i=null;const n=[];let o=0;return t.forEach((t=>{let s;if(1===t.endColumn&&o>0){const e=t.startLineNumber-o;s=new Qu(e,t.startColumn,e,t.startColumn)}else s=new Qu(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn);o+=t.endLineNumber-t.startLineNumber,t.intersectRanges(e)?i=s:n.push(s)})),i&&n.unshift(i),n}_getRangesToDelete(e){const t=e.getSelections();if(null===t)return[];let i=t;const n=e.getModel();return null===n?[]:(i.sort(Yu.compareRangesUsingStarts),i=i.map((e=>{if(e.isEmpty()){if(1===e.startColumn){const t=Math.max(1,e.startLineNumber-1),i=1===e.startLineNumber?1:n.getLineLength(t)+1;return new Yu(t,i,e.startLineNumber,1)}return new Yu(e.startLineNumber,1,e.startLineNumber,e.startColumn)}return new Yu(e.startLineNumber,1,e.endLineNumber,e.endColumn)})),i)}}),Hu(class extends Ise{constructor(){super({id:"deleteAllRight",label:x(1255,"Delete All Right"),precondition:Xu.writable,kbOpts:{kbExpr:Xu.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let i=null;const n=[];for(let o=0,s=t.length,r=0;o<s;o++){const s=t[o],a=new Qu(s.startLineNumber-r,s.startColumn,s.startLineNumber-r,s.startColumn);s.intersectRanges(e)?i=a:n.push(a)}return i&&n.unshift(i),n}_getRangesToDelete(e){const t=e.getModel();if(null===t)return[];const i=e.getSelections();if(null===i)return[];const n=i.map((e=>{if(e.isEmpty()){const i=t.getLineMaxColumn(e.startLineNumber);return e.startColumn===i?new Yu(e.startLineNumber,e.startColumn,e.startLineNumber+1,1):new Yu(e.startLineNumber,e.startColumn,e.startLineNumber,i)}return e}));return n.sort(Yu.compareRangesUsingStarts),n}}),Hu(class extends Pu{constructor(){super({id:"editor.action.joinLines",label:x(1256,"Join Lines"),precondition:Xu.writable,kbOpts:{kbExpr:Xu.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){const i=t.getSelections();if(null===i)return;let n=t.getSelection();if(null===n)return;i.sort(Yu.compareRangesUsingStarts);const o=[],s=i.reduce(((e,t)=>e.isEmpty()?e.endLineNumber===t.startLineNumber?(n.equalsSelection(e)&&(n=t),t):t.startLineNumber>e.endLineNumber+1?(o.push(e),t):new Qu(e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn):t.startLineNumber>e.endLineNumber?(o.push(e),t):new Qu(e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn)));o.push(s);const r=t.getModel();if(null===r)return;const a=[],l=[];let d=n,h=0;for(let e=0,t=o.length;e<t;e++){const t=o[e],i=t.startLineNumber,s=1;let c,u,g=0;const p=r.getLineLength(t.endLineNumber)-t.endColumn;if(t.isEmpty()||t.startLineNumber===t.endLineNumber){const e=t.getStartPosition();e.lineNumber<r.getLineCount()?(c=i+1,u=r.getLineMaxColumn(c)):(c=e.lineNumber,u=r.getLineMaxColumn(e.lineNumber))}else c=t.endLineNumber,u=r.getLineMaxColumn(c);let m=r.getLineContent(i);for(let e=i+1;e<=c;e++){const t=r.getLineContent(e),i=r.getLineFirstNonWhitespaceColumn(e);if(i>=1){let e=!0;""===m&&(e=!1),!e||" "!==m.charAt(m.length-1)&&"\t"!==m.charAt(m.length-1)||(e=!1,m=m.replace(/[\s\uFEFF\xA0]+$/g," "));const n=t.substr(i-1);m+=(e?" ":"")+n,g=e?n.length+1:n.length}else g=0}const f=new Yu(i,s,c,u);if(!f.isEmpty()){let e;t.isEmpty()?(a.push(qZ.replace(f,m)),e=new Qu(f.startLineNumber-h,m.length-g+1,i-h,m.length-g+1)):t.startLineNumber===t.endLineNumber?(a.push(qZ.replace(f,m)),e=new Qu(t.startLineNumber-h,t.startColumn,t.endLineNumber-h,t.endColumn)):(a.push(qZ.replace(f,m)),e=new Qu(t.startLineNumber-h,t.startColumn,t.startLineNumber-h,m.length-p)),null!==Yu.intersectRanges(f,n)?d=e:l.push(e)}h+=f.endLineNumber-f.startLineNumber}l.unshift(d),t.pushUndoStop(),t.executeEdits(this.id,a,l),t.pushUndoStop()}}),Hu(class extends Pu{constructor(){super({id:"editor.action.transpose",label:x(1257,"Transpose Characters around the Cursor"),precondition:Xu.writable})}run(e,t){const i=t.getSelections();if(null===i)return;const n=t.getModel();if(null===n)return;const o=[];for(let e=0,t=i.length;e<t;e++){const t=i[e];if(!t.isEmpty())continue;const s=t.getStartPosition(),r=n.getLineMaxColumn(s.lineNumber);if(s.column>=r){if(s.lineNumber===n.getLineCount())continue;const e=new Yu(s.lineNumber,Math.max(1,s.column-1),s.lineNumber+1,1),t=n.getValueInRange(e).split("").reverse().join("");o.push(new Hk(new Qu(s.lineNumber,Math.max(1,s.column-1),s.lineNumber+1,1),t))}else{const e=new Yu(s.lineNumber,Math.max(1,s.column-1),s.lineNumber,s.column+1),t=n.getValueInRange(e).split("").reverse().join("");o.push(new $k(e,t,new Qu(s.lineNumber,s.column+1,s.lineNumber,s.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}),Hu(class extends Tse{constructor(){super({id:"editor.action.transformToUppercase",label:x(1258,"Transform to Uppercase"),precondition:Xu.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}),Hu(class extends Tse{constructor(){super({id:"editor.action.transformToLowercase",label:x(1259,"Transform to Lowercase"),precondition:Xu.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}),Hu(class extends Pu{constructor(){super({id:"editor.action.reverseLines",label:x(1247,"Reverse lines"),precondition:Xu.writable})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=t.getSelections();let o=n;1===o.length&&o[0].isEmpty()&&(o=[new Qu(1,1,i.getLineCount(),i.getLineMaxColumn(i.getLineCount()))]);const s=[],r=[];for(let e=0;e<o.length;e++){const t=o[e],a=n[e];let l=t.endLineNumber;t.startLineNumber<t.endLineNumber&&1===t.endColumn&&l--;let d=new Yu(t.startLineNumber,1,l,i.getLineMaxColumn(l));l===i.getLineCount()&&""===i.getLineContent(d.endLineNumber)&&(d=d.setEndPosition(d.endLineNumber-1,i.getLineMaxColumn(d.endLineNumber-1)));const h=[];for(let e=d.endLineNumber;e>=d.startLineNumber;e--)h.push(i.getLineContent(e));const c=qZ.replace(d,h.join("\n"));s.push(c);const u=function(e){return e<=d.endLineNumber?d.endLineNumber-e+d.startLineNumber:e},g=function(e){if(e.isEmpty())return new Qu(u(e.positionLineNumber),e.positionColumn,u(e.positionLineNumber),e.positionColumn);{const t=u(e.selectionStartLineNumber),i=u(e.positionLineNumber),n=e.selectionStartColumn,o=e.positionColumn;return new Qu(t,n,i,o)}};r.push(g(a))}t.pushUndoStop(),t.executeEdits(this.id,s,r),t.pushUndoStop()}}),Rse.caseBoundary.isSupported()&&Rse.singleLetters.isSupported()&&Hu(Rse),Ose.singleLineWordBoundary.isSupported()&&Ose.multiLineWordBoundary.isSupported()&&Hu(Ose),Pse.wordBoundary.isSupported()&&Hu(Pse),Ase.titleBoundary.isSupported()&&Hu(Ase),Fse.isSupported()&&Hu(Fse);var Bse=i(3293),Wse={};Wse.styleTagTransform=zl(),Wse.setAttributes=Bl(),Wse.insert=Pl().bind(null,"head"),Wse.domAPI=Rl(),Wse.insertStyleElement=Vl(),Ml()(Bse.A,Wse),Bse.A&&Bse.A.locals&&Bse.A.locals;var Vse,Hse=function(e,t){return function(i,n){t(i,n,e)}};const zse=new Jc("LinkedEditingInputVisible",!1);let Use=class extends At{static{Vse=this}static{this.ID="editor.contrib.linkedEditing"}static{this.DECORATION=bk.register({description:"linked-editing",stickiness:0,className:"linked-editing-decoration"})}static get(e){return e.getContribution(Vse.ID)}constructor(e,t,i,n,o){super(),this.languageConfigurationService=n,this._syncRangesToken=0,this._localToDispose=this._register(new Mt),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=zse.bindTo(t),this._debounceInformation=o.for(this._providers,"Linked Editing",{max:200}),this._currentDecorations=this._editor.createDecorationsCollection(),this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new Mt),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequestCts=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel((()=>this.reinitialize(!0)))),this._register(this._editor.onDidChangeConfiguration((e=>{(e.hasChanged(78)||e.hasChanged(106))&&this.reinitialize(!1)}))),this._register(this._providers.onDidChange((()=>this.reinitialize(!1)))),this._register(this._editor.onDidChangeModelLanguage((()=>this.reinitialize(!0)))),this.reinitialize(!0)}reinitialize(e){const t=this._editor.getModel(),i=null!==t&&(this._editor.getOption(78)||this._editor.getOption(106))&&this._providers.has(t);if(i===this._enabled&&!e)return;if(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||null===t)return;this._localToDispose.add(zt.runAndSubscribe(t.onDidChangeLanguageConfiguration,(()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()})));const n=new gi(this._debounceInformation.get(t)),o=()=>{this._rangeUpdateTriggerPromise=n.trigger((()=>this.updateRanges()),this._debounceDuration??this._debounceInformation.get(t))},s=new gi(0),r=e=>{this._rangeSyncTriggerPromise=s.trigger((()=>this._syncRanges(e)))};this._localToDispose.add(this._editor.onDidChangeCursorPosition((()=>{o()}))),this._localToDispose.add(this._editor.onDidChangeModelContent((e=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const t=this._currentDecorations.getRange(0);if(t&&e.changes.every((e=>t.intersectRanges(e.range))))return void r(this._syncRangesToken)}o()}))),this._localToDispose.add({dispose:()=>{n.dispose(),s.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||0===this._currentDecorations.length)return;const t=this._editor.getModel(),i=this._currentDecorations.getRange(0);if(!i||i.startLineNumber!==i.endLineNumber)return this.clearRanges();const n=t.getValueInRange(i);if(this._currentWordPattern){const e=n.match(this._currentWordPattern);if((e?e[0].length:0)!==n.length)return this.clearRanges()}const o=[];for(let e=1,i=this._currentDecorations.length;e<i;e++){const i=this._currentDecorations.getRange(e);if(i)if(i.startLineNumber!==i.endLineNumber)o.push({range:i,text:n});else{let e=t.getValueInRange(i),s=n,r=i.startColumn,a=i.endColumn;const l=rn(e,s);r+=l,e=e.substr(l),s=s.substr(l);const d=an(e,s);a-=d,e=e.substr(0,e.length-d),s=s.substr(0,s.length-d),r===a&&0===s.length||o.push({range:new Yu(i.startLineNumber,r,i.endLineNumber,a),text:s})}}if(0!==o.length)try{this._editor.popUndoStop(),this._ignoreChangeEvent=!0;const e=this._editor._getViewModel().getPrevEditOperationType();this._editor.executeEdits("linkedEditing",o),this._editor._getViewModel().setPrevEditOperationType(e)}finally{this._ignoreChangeEvent=!1}}dispose(){this.clearRanges(),super.dispose()}clearRanges(){this._visibleContextKey.set(!1),this._currentDecorations.clear(),this._currentRequestCts&&(this._currentRequestCts.cancel(),this._currentRequestCts=null,this._currentRequestPosition=null)}async updateRanges(e=!1){if(!this._editor.hasModel())return void this.clearRanges();const t=this._editor.getPosition();if(!this._enabled&&!e||this._editor.getSelections().length>1)return void this.clearRanges();const i=this._editor.getModel(),n=i.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===n){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const e=this._currentDecorations.getRange(0);if(e&&e.containsPosition(t))return}}if(!this._currentRequestPosition?.equals(t)){const e=this._currentDecorations.getRange(0);e?.containsPosition(t)||this.clearRanges()}this._currentRequestPosition=t,this._currentRequestModelVersion=n;const o=this._currentRequestCts=new ri;try{const e=new Ht(!1),s=await Kse(this._providers,i,t,o.token);if(this._debounceInformation.update(i,e.elapsed()),o!==this._currentRequestCts)return;if(this._currentRequestCts=null,n!==i.getVersionId())return;let r=[];s?.ranges&&(r=s.ranges),this._currentWordPattern=s?.wordPattern||this._languageWordPattern;let a=!1;for(let e=0,i=r.length;e<i;e++)if(Yu.containsPosition(r[e],t)){if(a=!0,0!==e){const t=r[e];r.splice(e,1),r.unshift(t)}break}if(!a)return void this.clearRanges();const l=r.map((e=>({range:e,options:Vse.DECORATION})));this._visibleContextKey.set(!0),this._currentDecorations.set(l),this._syncRangesToken++}catch(e){Re(e)||Ie(e),this._currentRequestCts!==o&&this._currentRequestCts||this.clearRanges()}}};function Kse(e,t,i,n){return _i(e.ordered(t).map((e=>async()=>{try{return await e.provideLinkedEditingRanges(t,i,n)}catch(e){return void Te(e)}})),(e=>!!e&&hs(e?.ranges)))}Use=Vse=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Hse(1,eu),Hse(2,BD),Hse(3,Qp),Hse(4,Bq)],Use),Vu(new(Ou.bindToContribution(Use.get))({id:"cancelLinkedEditingInput",precondition:zse,handler:e=>e.clearRanges(),kbOpts:{kbExpr:Xu.editorTextFocus,weight:199,primary:9,secondary:[1033]}})),Ff("editor.linkedEditingBackground",{dark:Lg.fromHex("#f00").transparent(.3),light:Lg.fromHex("#f00").transparent(.3),hcDark:Lg.fromHex("#f00").transparent(.3),hcLight:Lg.white},y(1265,"Background color when the editor auto renames on type.")),Wu("_executeLinkedEditingProvider",((e,t,i)=>{const{linkedEditingRangeProvider:n}=e.get(BD);return Kse(n,t,i,oi.None)})),Uu(Use.ID,Use,1),Hu(class extends Pu{constructor(){super({id:"editor.action.linkedEditing",label:x(1266,"Start Linked Editing"),precondition:Ac.and(Xu.writable,Xu.hasRenameProvider),kbOpts:{kbExpr:Xu.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const i=e.get(sc),[n,o]=Array.isArray(t)&&t||[void 0,void 0];return uo.isUri(n)&&rc.isIPosition(o)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then((e=>{e&&(e.setPosition(o),e.invokeWithinContext((t=>(this.reportTelemetry(t,e),this.run(t,e)))))}),Ie):super.runCommand(e,t)}run(e,t){const i=Use.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}});var jse=i(1177),qse={};qse.styleTagTransform=zl(),qse.setAttributes=Bl(),qse.insert=Pl().bind(null,"head"),qse.domAPI=Rl(),qse.insertStyleElement=Vl(),Ml()(jse.A,qse),jse.A&&jse.A.locals&&jse.A.locals;class $se{constructor(e,t){this._link=e,this._provider=t}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}async resolve(e){return this._link.url?this._link.url:"function"==typeof this._provider.resolveLink?Promise.resolve(this._provider.resolveLink(this._link,e)).then((t=>(this._link=t||this._link,this._link.url?this.resolve(e):Promise.reject(new Error("missing"))))):Promise.reject(new Error("missing"))}}class Gse{static{this.Empty=new Gse([])}constructor(e){this._disposables=new Mt;let t=[];for(const[i,n]of e){const e=i.links.map((e=>new $se(e,n)));t=Gse._union(t,e),Dt(i)&&(this._disposables??=new Mt,this._disposables.add(i))}this.links=t}dispose(){this._disposables?.dispose(),this.links.length=0}static _union(e,t){const i=[];let n,o,s,r;for(n=0,s=0,o=e.length,r=t.length;n<o&&s<r;){const o=e[n],r=t[s];Yu.areIntersectingOrTouching(o.range,r.range)?n++:Yu.compareRangesUsingStarts(o.range,r.range)<0?(i.push(o),n++):(i.push(r),s++)}for(;n<o;n++)i.push(e[n]);for(;s<r;s++)i.push(t[s]);return i}}async function Zse(e,t,i){const n=[],o=e.ordered(t).reverse().map((async(e,o)=>{try{const s=await e.provideLinks(t,i);s&&(n[o]=[s,e])}catch(e){Te(e)}}));await Promise.all(o);let s=new Gse(as(n));return i.isCancellationRequested&&(s.dispose(),s=Gse.Empty),s}fc.registerCommand("_executeLinkProvider",(async(e,...t)=>{let[i,n]=t;_t(i instanceof uo),"number"!=typeof n&&(n=0);const{linkProvider:o}=e.get(BD),s=e.get(ac).getModel(i);if(!s)return[];const r=await Zse(o,s,oi.None);if(!r)return[];for(let e=0;e<Math.min(n,r.links.length);e++)await r.links[e].resolve(oi.None);const a=r.links.slice(0);return r.dispose(),a}));var Yse,Qse=function(e,t){return function(i,n){t(i,n,e)}};let Xse=class extends At{static{Yse=this}static{this.ID="editor.linkDetector"}static get(e){return e.getContribution(Yse.ID)}constructor(e,t,i,n,o){super(),this.editor=e,this.openerService=t,this.notificationService=i,this.languageFeaturesService=n,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=o.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new Ci((()=>this.computeLinksNow()),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const s=this._register(new XZ(e));this._register(s.onMouseMoveOrRelevantKeyDown((([e,t])=>{this._onEditorMouseMove(e,t)}))),this._register(s.onExecute((e=>{this.onEditorMouseUp(e)}))),this._register(s.onCancel((e=>{this.cleanUpActiveLinkDecoration()}))),this._register(e.onDidChangeConfiguration((e=>{e.hasChanged(79)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))}))),this._register(e.onDidChangeModelContent((e=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))}))),this._register(e.onDidChangeModel((e=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)}))),this._register(e.onDidChangeModelLanguage((e=>{this.stop(),this.computeLinks.schedule(0)}))),this._register(this.providers.onDidChange((e=>{this.stop(),this.computeLinks.schedule(0)}))),this.computeLinks.schedule(0)}async computeLinksNow(){if(!this.editor.hasModel()||!this.editor.getOption(79))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=hi((t=>Zse(this.providers,e,t)));try{const t=new Ht(!1);if(this.activeLinksList=await this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(e){Ie(e)}finally{this.computePromise=null}}}updateDecorations(e){const t="altKey"===this.editor.getOption(86),i=[],n=Object.keys(this.currentOccurrences);for(const e of n){const t=this.currentOccurrences[e];i.push(t.decorationId)}const o=[];if(e)for(const i of e)o.push(tre.decoration(i,t));this.editor.changeDecorations((t=>{const n=t.deltaDecorations(i,o);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let t=0,i=n.length;t<i;t++){const i=new tre(e[t],n[t]);this.currentOccurrences[i.decorationId]=i}}))}_onEditorMouseMove(e,t){const i="altKey"===this.editor.getOption(86);if(this.isEnabled(e,t)){this.cleanUpActiveLinkDecoration();const t=this.getLinkOccurrence(e.target.position);t&&this.editor.changeDecorations((e=>{t.activate(e,i),this.activeLinkDecorationId=t.decorationId}))}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e="altKey"===this.editor.getOption(86);if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations((i=>{t.deactivate(i,e)})),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,i=!1){if(!this.openerService)return;const{link:n}=e;n.resolve(oi.None).then((e=>{if("string"==typeof e&&this.editor.hasModel()){const t=this.editor.getModel().uri;if(t.scheme===So.file&&e.startsWith(`${So.file}:`)){const i=uo.parse(e);if(i.scheme===So.file){const n=Ah(i);let o=null;n.startsWith("/./")||n.startsWith("\\.\\")?o=`.${n.substr(1)}`:(n.startsWith("//./")||n.startsWith("\\\\.\\"))&&(o=`.${n.substr(2)}`),o&&(e=Hh(t,o))}}}return this.openerService.open(e,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})}),(e=>{const t=e instanceof Error?e.message:e;"invalid"===t?this.notificationService.warn(y(1267,"Failed to open this link because it is not well-formed: {0}",n.url.toString())):"missing"===t?this.notificationService.warn(y(1268,"Failed to open this link because its target is missing.")):Ie(e)}))}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const e of t){const t=this.currentOccurrences[e.id];if(t)return t}return null}isEnabled(e,t){return Boolean(6===e.target.type&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey||e.isMiddleClick&&"openLink"===e.mouseMiddleClickAction))}stop(){this.computeLinks.cancel(),this.activeLinksList&&(this.activeLinksList?.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}};Xse=Yse=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Qse(1,ZI),Qse(2,lO),Qse(3,BD),Qse(4,Bq)],Xse);const Jse=bk.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),ere=bk.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"});class tre{static decoration(e,t){return{range:e.range,options:tre._getOptions(e,t,!1)}}static _getOptions(e,t,i){const n={...i?ere:Jse};return n.hoverMessage=function(e,t){const i=e.url&&/^command:/i.test(e.url.toString()),n=e.tooltip?e.tooltip:i?y(1269,"Execute command"):y(1270,"Follow link"),o=t?$?y(1271,"cmd + click"):y(1272,"ctrl + click"):$?y(1273,"option + click"):y(1274,"alt + click");if(e.url){let t="";if(/^command:/i.test(e.url.toString())){const i=e.url.toString().match(/^command:([^?#]+)/);i&&(t=y(1275,"Execute command {0}",i[1]))}return new Gh("",!0).appendLink(e.url.toString(!0).replace(/ /g,"%20"),n,t).appendMarkdown(` (${o})`)}return(new Gh).appendText(`${n} (${o})`)}(e,t),n}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,tre._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,tre._getOptions(this.link,t,!1))}}Uu(Xse.ID,Xse,1),Hu(class extends Pu{constructor(){super({id:"editor.action.openLink",label:x(1276,"Open Link"),precondition:void 0})}run(e,t){const i=Xse.get(t);if(!i)return;if(!t.hasModel())return;const n=t.getSelections();for(const e of n){const t=i.getLinkOccurrence(e.getEndPosition());t&&i.openLinkOccurrence(t,!1)}}});class ire extends At{static{this.ID="editor.contrib.longLinesHelper"}constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown((e=>{const t=this._editor.getOption(133);t>=0&&6===e.target.type&&e.target.position.column>=t&&this._editor.updateOptions({stopRenderingLineAfter:-1})})))}}Uu(ire.ID,ire,2);var nre=i(3717),ore={};ore.styleTagTransform=zl(),ore.setAttributes=Bl(),ore.insert=Pl().bind(null,"head"),ore.domAPI=Rl(),ore.insertStyleElement=Vl(),Ml()(nre.A,ore),nre.A&&nre.A.locals&&nre.A.locals;class sre extends At{static{this.ID="editor.contrib.middleScroll"}constructor(e){super(),this._editor=e;const t=bY(this._editor),i=t.getOption(171);this._register(ar((e=>{if(!i.read(e))return;const n=t.domNode.read(e);if(!n)return;const o=e.store.add(tr("scrollingSession",void 0));e.store.add(this._editor.onMouseDown((e=>{if(o.read(void 0))return void o.set(void 0,void 0);if(!e.event.middleButton)return;e.event.stopPropagation(),e.event.preventDefault();const t=new Mt,i=new vY(e.event.posx,e.event.posy),s=function(e,t,i){const n=Js("pos",t);return i.add(ga(e,"mousemove",(e=>{n.set(new vY(e.pageX,e.pageY),void 0)}))),n}(ta(n),i,t),r=s.map((e=>e.subtract(i).withThreshold(5))),a=n.getBoundingClientRect(),l=new vY(i.x-a.left,i.y-a.top);o.set({mouseDeltaAfterThreshold:r,initialMousePosInEditor:l,didScroll:!1,dispose:()=>t.dispose()},void 0),t.add(this._editor.onMouseUp((e=>{const t=o.read(void 0);t&&t.didScroll&&o.set(void 0,void 0)}))),t.add(this._editor.onKeyDown((e=>{o.set(void 0,void 0)})))}))),e.store.add(ar((e=>{const t=o.read(e);if(!t)return;let i=Date.now();e.store.add(ar((e=>{Oee.instance.invalidateOnNextAnimationFrame(e);const n=Date.now(),o=n-i;i=n;const s=o/32,r=t.mouseDeltaAfterThreshold.read(void 0).scale(s),a=new vY(this._editor.getScrollLeft(),this._editor.getScrollTop());this._editor.setScrollPosition(function(e){return{scrollLeft:e.x,scrollTop:e.y}}(a.add(r))),r.isZero()||(t.didScroll=!0)})));const s=pr((e=>{const i=t.mouseDeltaAfterThreshold.read(e);let n="";return n+=i.y<0?"n":i.y>0?"s":"",n+=i.x<0?"w":i.x>0?"e":"",n}));e.store.add(ar((e=>{n.setAttribute("data-scroll-direction",s.read(e))})))})));const s=e.store.add(bl.div({class:["scroll-editor-on-middle-click-dot",o.map((e=>e?"":"hidden"))],style:{left:o.map((e=>e?e.initialMousePosInEditor.x:0)),top:o.map((e=>e?e.initialMousePosInEditor.y:0))}}).toDisposableLiveElement());e.store.add(h2(n,s.element)),e.store.add(ar((e=>{const t=o.read(e);n.classList.toggle("scroll-editor-on-middle-click-editor",!!t)})))})))}}Uu(sre.ID,sre,2);var rre=i(9803),are={};are.styleTagTransform=zl(),are.setAttributes=Bl(),are.insert=Pl().bind(null,"head"),are.domAPI=Rl(),are.insertStyleElement=Vl(),Ml()(rre.A,are),rre.A&&rre.A.locals&&rre.A.locals;const lre=Ff("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},y(1548,"Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0);Ff("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},y(1549,"Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0),Ff("editor.wordHighlightTextBackground",lre,y(1550,"Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const dre=Ff("editor.wordHighlightBorder",{light:null,dark:null,hcDark:Xf,hcLight:Xf},y(1551,"Border color of a symbol during read-access, like reading a variable."));Ff("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:Xf,hcLight:Xf},y(1552,"Border color of a symbol during write-access, like writing to a variable.")),Ff("editor.wordHighlightTextBorder",dre,y(1553,"Border color of a textual occurrence for a symbol."));const hre=Ff("editorOverviewRuler.wordHighlightForeground","#A0A0A0CC",y(1554,"Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),cre=Ff("editorOverviewRuler.wordHighlightStrongForeground","#C0A0C0CC",y(1555,"Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),ure=Ff("editorOverviewRuler.wordHighlightTextForeground",lv,y(1556,"Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0),gre=bk.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:rw(cre),position:ug.Center},minimap:{color:rw(gv),position:1}}),pre=bk.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:rw(ure),position:ug.Center},minimap:{color:rw(gv),position:1}}),mre=bk.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:rw(lv),position:ug.Center},minimap:{color:rw(gv),position:1}}),fre=bk.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),_re=bk.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:rw(hre),position:ug.Center},minimap:{color:rw(gv),position:1}});function vre(e){return e?fre:mre}hw(((e,t)=>{const i=e.getColor(x_);i&&t.addRule(`.monaco-editor .selectionHighlight { background-color: ${i.transparent(.5)}; }`)}));var bre;function wre(e,t){const i=t.filter((t=>!e.find((e=>e.equals(t)))));if(i.length>=1){const e=i.map((e=>`line ${e.viewState.position.lineNumber} column ${e.viewState.position.column}`)).join(", ");Ql(1===i.length?y(1278,"Cursor added: {0}",e):y(1279,"Cursors added: {0}",e))}}class Cre{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class yre{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new yre(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let n,o,s=!1;const r=e.getSelections();1===r.length&&r[0].isEmpty()?(s=!0,n=!0,o=!0):(n=i.wholeWord,o=i.matchCase);const a=e.getSelection();let l,d=null;if(a.isEmpty()){const t=e.getConfiguredWordAtPosition(a.getStartPosition());if(!t)return null;l=t.word,d=new Qu(a.startLineNumber,t.startColumn,a.startLineNumber,t.endColumn)}else l=e.getModel().getValueInRange(a).replace(/\r\n/g,"\n");return new yre(e,t,s,l,n,o,d)}constructor(e,t,i,n,o,s,r){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=n,this.wholeWord=o,this.matchCase=s,this.currentMatch=r}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new Cre(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new Cre(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const e=this.currentMatch;return this.currentMatch=null,e}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1);return i?new Qu(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new Cre(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new Cre(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const e=this.currentMatch;return this.currentMatch=null,e}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1);return i?new Qu(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1,1073741824)}}class Sre extends At{static{this.ID="editor.contrib.multiCursorController"}static get(e){return e.getContribution(Sre.ID)}constructor(e){super(),this._sessionDispose=this._register(new Mt),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=yre.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=1,i.matchCaseOverride=1,i.isRegexOverride=2),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection((e=>{this._ignoreSelectionChange||this._endSession()}))),this._sessionDispose.add(this._editor.onDidBlurEditorText((()=>{this._endSession()}))),this._sessionDispose.add(e.getState().onFindReplaceStateChange((e=>{(e.matchCase||e.wholeWord)&&this._endSession()})))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new Qu(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const i=e.getState().matchCase;if(!Dre(this._editor.getModel(),t,i)){const e=this._editor.getModel(),i=[];for(let n=0,o=t.length;n<o;n++)i[n]=this._expandEmptyToWord(e,t[n]);return void this._editor.setSelections(i)}}}this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToNextFindMatch())}}addSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToPreviousFindMatch())}moveSelectionToNextFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToNextFindMatch())}moveSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToPreviousFindMatch())}selectAll(e){if(!this._editor.hasModel())return;let t=null;const i=e.getState();if(i.isRevealed&&i.searchString.length>0&&i.isRegex){const e=this._editor.getModel();t=i.searchScope?e.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(148):null,!1,1073741824):e.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(148):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const e=this._editor.getSelection();for(let i=0,n=t.length;i<n;i++){const n=t[i];if(n.range.intersectRanges(e)){t[i]=t[0],t[0]=n;break}}this._setSelections(t.map((e=>new Qu(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn))))}}}class xre extends Pu{run(e,t){const i=Sre.get(t);if(!i)return;const n=t._getViewModel();if(n){const o=n.getCursorStates(),s=G6.get(t);if(s)this._run(i,s);else{const n=e.get(nc).createInstance(G6,t);this._run(i,n),n.dispose()}wre(o,n.getCursorStates())}}}class kre{constructor(e,t,i,n,o){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=n,this._cachedFindMatches=null,this._modelVersionId=this._model.getVersionId(),o&&this._model===o._model&&this._searchText===o._searchText&&this._matchCase===o._matchCase&&this._wordSeparators===o._wordSeparators&&this._modelVersionId===o._modelVersionId&&(this._cachedFindMatches=o._cachedFindMatches)}findMatches(){return null===this._cachedFindMatches&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map((e=>e.range)),this._cachedFindMatches.sort(Yu.compareRangesUsingStarts)),this._cachedFindMatches}}let Lre=class extends At{static{bre=this}static{this.ID="editor.contrib.selectionHighlighter"}constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(122),this._isEnabledMultiline=e.getOption(124),this._maxLength=e.getOption(123),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new Ci((()=>this._update()),300)),this.state=null,this._register(e.onDidChangeConfiguration((t=>{this._isEnabled=e.getOption(122),this._isEnabledMultiline=e.getOption(124),this._maxLength=e.getOption(123)}))),this._register(e.onDidChangeCursorSelection((e=>{this._isEnabled&&(e.selection.isEmpty()?3===e.reason?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())}))),this._register(e.onDidChangeModel((e=>{this._setState(null)}))),this._register(e.onDidChangeModelContent((e=>{this._isEnabled&&this.updateSoon.schedule()})));const i=G6.get(e);i&&this._register(i.getState().onFindReplaceStateChange((e=>{this._update()}))),this.updateSoon.schedule()}_update(){this._setState(bre._createState(this.state,this._isEnabled,this._isEnabledMultiline,this._maxLength,this.editor))}static _createState(e,t,i,n,o){if(!t)return null;if(!o.hasModel())return null;if(!i){const e=o.getSelection();if(e.startLineNumber!==e.endLineNumber)return null}const s=Sre.get(o);if(!s)return null;const r=G6.get(o);if(!r)return null;let a=s.getSession(r);if(!a){const e=o.getSelections();if(e.length>1){const t=r.getState().matchCase;if(!Dre(o.getModel(),e,t))return null}a=yre.create(o,r)}if(!a)return null;if(a.currentMatch)return null;if(/^[ \t]+$/.test(a.searchText))return null;if(n>0&&a.searchText.length>n)return null;const l=r.getState(),d=l.matchCase;if(l.isRevealed){let e=l.searchString;d||(e=e.toLowerCase());let t=a.searchText;if(d||(t=t.toLowerCase()),e===t&&a.matchCase===l.matchCase&&a.wholeWord===l.wholeWord&&!l.isRegex)return null}return new kre(o.getModel(),a.searchText,a.matchCase,a.wholeWord?o.getOption(148):null,e)}_setState(e){if(this.state=e,!this.state)return void this._decorations.clear();if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const i=this.state.findMatches(),n=this.editor.getSelections();n.sort(Yu.compareRangesUsingStarts);const o=[];for(let e=0,t=0,s=i.length,r=n.length;e<s;){const s=i[e];if(t>=r)o.push(s),e++;else{const i=Yu.compareRangesUsingStarts(s,n[t]);i<0?(!n[t].isEmpty()&&Yu.areIntersecting(s,n[t])||o.push(s),e++):(i>0||e++,t++)}}const s="off"!==this.editor.getOption(90),r=this._languageFeaturesService.documentHighlightProvider.has(t)&&s,a=o.map((e=>({range:e,options:vre(r)})));this._decorations.set(a)}dispose(){this._setState(null),super.dispose()}};function Dre(e,t,i){const n=Ere(e,t[0],!i);for(let o=1,s=t.length;o<s;o++){const s=t[o];if(s.isEmpty())return!1;if(n!==Ere(e,s,!i))return!1}return!0}function Ere(e,t,i){const n=e.getValueInRange(t);return i?n.toLowerCase():n}Lre=bre=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,BD)],Lre),Uu(Sre.ID,Sre,4),Uu(Lre.ID,Lre,1),Hu(class extends Pu{constructor(){super({id:"editor.action.insertCursorAbove",label:x(1288,"Add Cursor Above"),precondition:void 0,kbOpts:{kbExpr:Xu.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:gu.MenubarSelectionMenu,group:"3_multi",title:y(1280,"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let n=!0;i&&!1===i.logicalLine&&(n=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const s=o.getCursorStates();o.setCursorStates(i.source,3,iL.addCursorUp(o,s,n)),o.revealTopMostCursor(i.source),wre(s,o.getCursorStates())}}),Hu(class extends Pu{constructor(){super({id:"editor.action.insertCursorBelow",label:x(1289,"Add Cursor Below"),precondition:void 0,kbOpts:{kbExpr:Xu.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:gu.MenubarSelectionMenu,group:"3_multi",title:y(1281,"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let n=!0;i&&!1===i.logicalLine&&(n=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const s=o.getCursorStates();o.setCursorStates(i.source,3,iL.addCursorDown(o,s,n)),o.revealBottomMostCursor(i.source),wre(s,o.getCursorStates())}}),Hu(class extends Pu{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:x(1290,"Add Cursors to Line Ends"),precondition:void 0,kbOpts:{kbExpr:Xu.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:gu.MenubarSelectionMenu,group:"3_multi",title:y(1282,"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let n=e.startLineNumber;n<e.endLineNumber;n++){const e=t.getLineMaxColumn(n);i.push(new Qu(n,e,n,e))}e.endColumn>1&&i.push(new Qu(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=t.getSelections(),o=t._getViewModel(),s=o.getCursorStates(),r=[];n.forEach((e=>this.getCursorsForSelection(e,i,r))),r.length>0&&t.setSelections(r),wre(s,o.getCursorStates())}}),Hu(class extends xre{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:x(1293,"Add Selection to Next Find Match"),precondition:void 0,kbOpts:{kbExpr:Xu.focus,primary:2082,weight:100},menuOpts:{menuId:gu.MenubarSelectionMenu,group:"3_multi",title:y(1283,"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}),Hu(class extends xre{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:x(1294,"Add Selection to Previous Find Match"),precondition:void 0,menuOpts:{menuId:gu.MenubarSelectionMenu,group:"3_multi",title:y(1284,"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}),Hu(class extends xre{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:x(1295,"Move Last Selection to Next Find Match"),precondition:void 0,kbOpts:{kbExpr:Xu.focus,primary:De(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}),Hu(class extends xre{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:x(1296,"Move Last Selection to Previous Find Match"),precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}),Hu(class extends xre{constructor(){super({id:"editor.action.selectHighlights",label:x(1297,"Select All Occurrences of Find Match"),precondition:void 0,kbOpts:{kbExpr:Xu.focus,primary:3114,weight:100},menuOpts:{menuId:gu.MenubarSelectionMenu,group:"3_multi",title:y(1285,"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}),Hu(class extends xre{constructor(){super({id:"editor.action.changeAll",label:x(1298,"Change All Occurrences"),precondition:Ac.and(Xu.writable,Xu.editorTextFocus),kbOpts:{kbExpr:Xu.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}),Hu(class extends Pu{constructor(){super({id:"editor.action.addCursorsToBottom",label:x(1291,"Add Cursors to Bottom"),precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),n=t.getModel().getLineCount(),o=[];for(let e=i[0].startLineNumber;e<=n;e++)o.push(new Qu(e,i[0].startColumn,e,i[0].endColumn));const s=t._getViewModel(),r=s.getCursorStates();o.length>0&&t.setSelections(o),wre(r,s.getCursorStates())}}),Hu(class extends Pu{constructor(){super({id:"editor.action.addCursorsToTop",label:x(1292,"Add Cursors to Top"),precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),n=[];for(let e=i[0].startLineNumber;e>=1;e--)n.push(new Qu(e,i[0].startColumn,e,i[0].endColumn));const o=t._getViewModel(),s=o.getCursorStates();n.length>0&&t.setSelections(n),wre(s,o.getCursorStates())}}),Hu(class extends Pu{constructor(){super({id:"editor.action.focusNextCursor",label:x(1299,"Focus Next Cursor"),metadata:{description:y(1286,"Focuses the next cursor"),args:[]},precondition:void 0})}run(e,t,i){if(!t.hasModel())return;const n=t._getViewModel();if(n.cursorConfig.readOnly)return;n.model.pushStackElement();const o=Array.from(n.getCursorStates()),s=o.shift();s&&(o.push(s),n.setCursorStates(i.source,3,o),n.revealPrimaryCursor(i.source,!0),wre(o,n.getCursorStates()))}}),Hu(class extends Pu{constructor(){super({id:"editor.action.focusPreviousCursor",label:x(1300,"Focus Previous Cursor"),metadata:{description:y(1287,"Focuses the previous cursor"),args:[]},precondition:void 0})}run(e,t,i){if(!t.hasModel())return;const n=t._getViewModel();if(n.cursorConfig.readOnly)return;n.model.pushStackElement();const o=Array.from(n.getCursorStates()),s=o.pop();s&&(o.unshift(s),n.setCursorStates(i.source,3,o),n.revealPrimaryCursor(i.source,!0),wre(o,n.getCursorStates()))}});const Nre={Visible:new Jc("parameterHintsVisible",!1),MultipleSignatures:new Jc("parameterHintsMultipleSignatures",!1)};async function Ire(e,t,i,n,o){const s=e.ordered(t);for(const e of s)try{const s=await e.provideSignatureHelp(t,i,o,n);if(s)return s}catch(e){Te(e)}}var Tre;fc.registerCommand("_executeSignatureHelpProvider",(async(e,...t)=>{const[i,n,o]=t;_t(uo.isUri(i)),_t(rc.isIPosition(n)),_t("string"==typeof o||!o);const s=e.get(BD),r=await e.get(lc).createModelReference(i);try{const e=await Ire(s.signatureHelpProvider,r.object.textEditorModel,rc.lift(n),{triggerKind:HS.Invoke,isRetrigger:!1,triggerCharacter:o},oi.None);if(!e)return;return setTimeout((()=>e.dispose()),0),e.value}finally{r.dispose()}})),function(e){e.Default={type:0},e.Pending=class{constructor(e,t){this.request=e,this.previouslyActiveHints=t,this.type=2}},e.Active=class{constructor(e){this.hints=e,this.type=1}}}(Tre||(Tre={}));class Mre extends At{static{this.DEFAULT_DELAY=120}constructor(e,t,i=Mre.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new Zt),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=Tre.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Rt),this.triggerChars=new Uy,this.retriggerChars=new Uy,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new gi(i),this._register(this.editor.onDidBlurEditorWidget((()=>this.cancel()))),this._register(this.editor.onDidChangeConfiguration((()=>this.onEditorConfigurationChange()))),this._register(this.editor.onDidChangeModel((e=>this.onModelChanged()))),this._register(this.editor.onDidChangeModelLanguage((e=>this.onModelChanged()))),this._register(this.editor.onDidChangeCursorSelection((e=>this.onCursorChange(e)))),this._register(this.editor.onDidChangeModelContent((e=>this.onModelContentChange()))),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType((e=>this.onDidType(e)))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){2===this._state.type&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=Tre.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!this.providers.has(i))return;const n=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger((()=>this.doTrigger(n)),t).catch(Ie)}next(){if(1!==this.state.type)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e==e-1,n=this.editor.getOption(98).cycle;!(e<2||i)||n?this.updateActiveSignature(i&&n?0:t+1):this.cancel()}previous(){if(1!==this.state.type)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=0===t,n=this.editor.getOption(98).cycle;!(e<2||i)||n?this.updateActiveSignature(i&&n?e-1:t-1):this.cancel()}updateActiveSignature(e){1===this.state.type&&(this.state=new Tre.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){const t=1===this.state.type||2===this.state.type,i=this.getLastActiveHints();if(this.cancel(!0),0===this._pendingTriggers.length)return!1;const n=this._pendingTriggers.reduce(Are);this._pendingTriggers=[];const o={triggerKind:n.triggerKind,triggerCharacter:n.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const s=this.editor.getModel(),r=this.editor.getPosition();this.state=new Tre.Pending(hi((e=>Ire(this.providers,s,r,o,e))),i);try{const t=await this.state.request;return e!==this.triggerId?(t?.dispose(),!1):t&&t.value.signatures&&0!==t.value.signatures.length?(this.state=new Tre.Active(t.value),this._lastSignatureHelpResult.value=t,this._onChangedHints.fire(this.state.hints),!0):(t?.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1)}catch(t){return e===this.triggerId&&(this.state=Tre.Default),Ie(t),!1}}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return 1===this.state.type||2===this.state.type||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();const e=this.editor.getModel();if(e)for(const t of this.providers.ordered(e)){for(const e of t.signatureHelpTriggerCharacters||[])if(e.length){const t=e.charCodeAt(0);this.triggerChars.add(t),this.retriggerChars.add(t)}for(const e of t.signatureHelpRetriggerCharacters||[])e.length&&this.retriggerChars.add(e.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,i=e.charCodeAt(t);(this.triggerChars.has(i)||this.isTriggered&&this.retriggerChars.has(i))&&this.trigger({triggerKind:HS.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){"mouse"===e.source?this.cancel():this.isTriggered&&this.trigger({triggerKind:HS.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:HS.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(98).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}function Are(e,t){switch(t.triggerKind){case HS.Invoke:return t;case HS.ContentChange:return e;case HS.TriggerCharacter:default:return t}}var Rre=i(991),Ore={};Ore.styleTagTransform=zl(),Ore.setAttributes=Bl(),Ore.insert=Pl().bind(null,"head"),Ore.domAPI=Rl(),Ore.insertStyleElement=Vl(),Ml()(Rre.A,Ore),Rre.A&&Rre.A.locals&&Rre.A.locals;var Pre,Fre=function(e,t){return function(i,n){t(i,n,e)}};const Bre=ll,Wre=bF("parameter-hints-next",fh.chevronDown,y(1302,"Icon for show next parameter hint.")),Vre=bF("parameter-hints-previous",fh.chevronUp,y(1303,"Icon for show previous parameter hint."));let Hre=class extends At{static{Pre=this}static{this.ID="editor.widget.parameterHintsWidget"}constructor(e,t,i,n,o){super(),this.editor=e,this.model=t,this.renderDisposeables=this._register(new Mt),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=new aT({editor:e},o,n),this.keyVisible=Nre.Visible.bindTo(i),this.keyMultipleSignatures=Nre.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=Bre(".editor-widget.parameter-hints-widget"),t=il(e,Bre(".phwrapper"));t.tabIndex=-1;const i=il(t,Bre(".controls")),n=il(i,Bre(".button"+vh.asCSSSelector(Vre))),o=il(i,Bre(".overloads")),s=il(i,Bre(".button"+vh.asCSSSelector(Wre)));this._register(ga(n,"click",(e=>{Ja(e),this.previous()}))),this._register(ga(s,"click",(e=>{Ja(e),this.next()})));const r=Bre(".body"),a=new dA(r,{alwaysConsumeMouseWheel:!0});this._register(a),t.appendChild(a.getDomNode());const l=il(r,Bre(".signature")),d=il(r,Bre(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:l,overloads:o,docs:d,scrollbar:a},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection((e=>{this.visible&&this.editor.layoutContentWidget(this)})));const h=()=>{if(!this.domNodes)return;const e=this.editor.getOption(59),t=this.domNodes.element;t.style.fontSize=`${e.fontSize}px`,t.style.lineHeight=""+e.lineHeight/e.fontSize,t.style.setProperty("--vscode-parameterHintsWidget-editorFontFamily",e.fontFamily),t.style.setProperty("--vscode-parameterHintsWidget-editorFontFamilyDefault",fP.fontFamily)};h(),this._register(zt.chain(this.editor.onDidChangeConfiguration.bind(this.editor),(e=>e.filter((e=>e.hasChanged(59)))))(h)),this._register(this.editor.onDidLayoutChange((e=>this.updateMaxHeight()))),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout((()=>{this.domNodes?.element.classList.add("visible")}),100),this.editor.layoutContentWidget(this))}hide(){this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,this.domNodes?.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){if(this.renderDisposeables.clear(),!this.domNodes)return;const t=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",t),this.keyMultipleSignatures.set(t),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const i=e.signatures[e.activeSignature];if(!i)return;const n=il(this.domNodes.signature,Bre(".code")),o=i.parameters.length>0,s=i.activeParameter??e.activeParameter;o?this.renderParameters(n,i,s):il(n,Bre("span")).textContent=i.label;const r=i.parameters[s];if(r?.documentation){const e=Bre("span.documentation");if("string"==typeof r.documentation)e.textContent=r.documentation;else{const t=this.renderMarkdownDocs(r.documentation);e.appendChild(t.element)}il(this.domNodes.docs,Bre("p",{},e))}if(void 0===i.documentation);else if("string"==typeof i.documentation)il(this.domNodes.docs,Bre("p",{},i.documentation));else{const e=this.renderMarkdownDocs(i.documentation);il(this.domNodes.docs,e.element)}const a=this.hasDocs(i,r);if(this.domNodes.signature.classList.toggle("has-docs",a),this.domNodes.docs.classList.toggle("empty",!a),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,r){let e="";const t=i.parameters[s];e=Array.isArray(t.label)?i.label.substring(t.label[0],t.label[1]):t.label,t.documentation&&(e+="string"==typeof t.documentation?`, ${t.documentation}`:`, ${t.documentation.value}`),i.documentation&&(e+="string"==typeof i.documentation?`, ${i.documentation}`:`, ${i.documentation.value}`),this.announcedLabel!==e&&(Yl(y(1304,"{0}, hint",e)),this.announcedLabel=e)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{this.domNodes?.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&"string"==typeof t.documentation&&vt(t.documentation).length>0||t&&"object"==typeof t.documentation&&vt(t.documentation).value.length>0||e.documentation&&"string"==typeof e.documentation&&vt(e.documentation).length>0||e.documentation&&"object"==typeof e.documentation&&vt(e.documentation.value).length>0)}renderParameters(e,t,i){const[n,o]=this.getParameterLabelOffsets(t,i),s=document.createElement("span");s.textContent=t.label.substring(0,n);const r=document.createElement("span");r.textContent=t.label.substring(n,o),r.className="parameter active";const a=document.createElement("span");a.textContent=t.label.substring(o),il(e,s,r,a)}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const t=new RegExp(`(\\W|^)${Vi(i.label)}(?=\\W|$)`,"g");t.test(e.label);const n=t.lastIndex-i.label.length;return n>=0?[n,t.lastIndex]:[0,0]}return[0,0]}return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return Pre.ID}updateMaxHeight(){if(!this.domNodes)return;const e=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=e;const t=this.domNodes.element.getElementsByClassName("phwrapper");t.length&&(t[0].style.maxHeight=e)}};Hre=Pre=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Fre(2,eu),Fre(3,ZI),Fre(4,Tg)],Hre),Ff("editorHoverWidget.highlightForeground",Lb,y(1305,"Foreground color of the active item in the parameter hint."));var zre,Ure=function(e,t){return function(i,n){t(i,n,e)}};let Kre=class extends At{static{zre=this}static{this.ID="editor.controller.parameterHints"}static get(e){return e.getContribution(zre.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new Mre(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints((e=>{e?(this.widget.value.show(),this.widget.value.render(e)):this.widget.rawValue?.hide()}))),this.widget=new Oi((()=>this._register(t.createInstance(Hre,this.editor,this.model))))}cancel(){this.model.cancel()}previous(){this.widget.rawValue?.previous()}next(){this.widget.rawValue?.next()}trigger(e){this.model.trigger(e,0)}};Kre=zre=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Ure(1,nc),Ure(2,BD)],Kre),Uu(Kre.ID,Kre,2),Hu(class extends Pu{constructor(){super({id:"editor.action.triggerParameterHints",label:x(1301,"Trigger Parameter Hints"),precondition:Xu.hasSignatureHelpProvider,kbOpts:{kbExpr:Xu.editorTextFocus,primary:3082,weight:100}})}run(e,t){const i=Kre.get(t);i?.trigger({triggerKind:HS.Invoke})}});const jre=Ou.bindToContribution(Kre.get);Vu(new jre({id:"closeParameterHints",precondition:Nre.Visible,handler:e=>e.cancel(),kbOpts:{weight:175,kbExpr:Xu.focus,primary:9,secondary:[1033]}})),Vu(new jre({id:"showPrevParameterHint",precondition:Ac.and(Nre.Visible,Nre.MultipleSignatures),handler:e=>e.previous(),kbOpts:{weight:175,kbExpr:Xu.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}})),Vu(new jre({id:"showNextParameterHint",precondition:Ac.and(Nre.Visible,Nre.MultipleSignatures),handler:e=>e.next(),kbOpts:{weight:175,kbExpr:Xu.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var qre=i(8874),$re={};$re.styleTagTransform=zl(),$re.setAttributes=Bl(),$re.insert=Pl().bind(null,"head"),$re.domAPI=Rl(),$re.insertStyleElement=Vl(),Ml()(qre.A,$re),qre.A&&qre.A.locals&&qre.A.locals;class Gre extends At{static{this.ID="editor.contrib.placeholderText"}constructor(e){var t;super(),this._editor=e,this._editorObs=bY(this._editor),this._placeholderText=this._editorObs.getOption(100),this._state=fr({owner:this,equalsFn:Ms},(e=>{const t=this._placeholderText.read(e);if(t&&this._editorObs.valueIsEmpty.read(e))return{placeholder:t}})),this._shouldViewBeAlive=(t=e=>void 0!==this._state.read(e)?.placeholder,Tr(this,((e,i)=>!0===i||t(e)))),this._view=pr((e=>{if(!this._shouldViewBeAlive.read(e))return;const t=fl("div.editorPlaceholder");e.store.add(ar((e=>{const i=this._state.read(e),n=void 0!==i?.placeholder;t.root.style.display=n?"block":"none",t.root.innerText=i?.placeholder??""}))),e.store.add(ar((e=>{const i=this._editorObs.layoutInfo.read(e);t.root.style.left=`${i.contentLeft}px`,t.root.style.width=i.contentWidth-i.verticalScrollbarWidth+"px",t.root.style.top=`${this._editor.getTopForLineNumber(0)}px`}))),e.store.add(ar((e=>{t.root.style.fontFamily=this._editorObs.getOption(58).read(e),t.root.style.fontSize=this._editorObs.getOption(61).read(e)+"px",t.root.style.lineHeight=this._editorObs.getOption(75).read(e)+"px"}))),e.store.add(this._editorObs.createOverlayWidget({allowEditorOverflow:!1,minContentWidthInPx:Or(0),position:Or(null),domNode:t.root}))})),this._view.recomputeInitiallyAndOnChange(this._store)}}class Zre{constructor(e){this.instantiationService=e}init(...e){}}let Yre=class extends Zre{constructor(e,t){super(t),this.init(e)}};Yre=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,nc)],Yre),Uu(Gre.ID,Gre,0),Ff("editor.placeholder.foreground",zw,y(1324,"Foreground color of the placeholder text in the editor."));class Qre{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=new Map,o=[];for(const[e,s]of this.documents){if(t.isCancellationRequested)return[];for(const t of s.chunks){const s=this.computeSimilarityScore(t,i,n);s>0&&o.push({key:e,score:s})}}return o}static termFrequencies(e){return function(e){const t=new Map;for(const i of e)t.set(i,(t.get(i)??0)+1);return t}(Qre.splitTerms(e))}static*splitTerms(e){const t=e=>e.toLowerCase();for(const[i]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(i);const e=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(e.length>1)for(const i of e)i.length>2&&/\p{Letter}{3,}/gu.test(i)&&(yield t(i))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const e=[];for(const i of t.textChunks){const t=Qre.termFrequencies(i);for(const e of t.keys())this.chunkOccurrences.set(e,(this.chunkOccurrences.get(e)??0)+1);e.push({text:i,tf:t})}this.chunkCount+=e.length,this.documents.set(t.key,{chunks:e})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const e of t.chunks)for(const t of e.tf.keys()){const e=this.chunkOccurrences.get(t);if("number"==typeof e){const i=e-1;i<=0?this.chunkOccurrences.delete(t):this.chunkOccurrences.set(t,i)}}}}computeSimilarityScore(e,t,i){let n=0;for(const[o,s]of Object.entries(t)){const t=e.tf.get(o);if(!t)continue;let r=i.get(o);"number"!=typeof r&&(r=this.computeIdf(o),i.set(o,r)),n+=t*r*s}return n}computeEmbedding(e){const t=Qre.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[i,n]of e){const e=this.computeIdf(i);e>0&&(t[i]=n*e)}return t}}const Xre=oc("dialogService");var Jre;function eae(e){const t=e;return Array.isArray(t.items)}function tae(e){const t=e;return!!t.picks&&t.additionalPicks instanceof Promise}!function(e){e[e.NO_ACTION=0]="NO_ACTION",e[e.CLOSE_PICKER=1]="CLOSE_PICKER",e[e.REFRESH_PICKER=2]="REFRESH_PICKER",e[e.REMOVE_ITEM=3]="REMOVE_ITEM"}(Jre||(Jre={}));class iae extends At{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){const n=new Mt;let o;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const s=n.add(new Rt),r=async()=>{o?.dispose(!0),e.busy=!1;const n=s.value=new Mt;o=n.add(new ri(t));const r=o.token;let a=e.value.substring(this.prefix.length);this.options?.shouldSkipTrimPickFilter||(a=a.trim());const l=this._getPicks(a,n,r,i),d=(t,i)=>{let n,o;if(eae(t)?(n=t.items,o=t.active):n=t,0===n.length){if(i)return!1;(a.length>0||e.hideInput)&&this.options?.noResultsPick&&(n=bt(this.options.noResultsPick)?[this.options.noResultsPick(a)]:[this.options.noResultsPick])}return e.items=n,o&&(e.activeItems=[o]),!0},h=async t=>{let i=!1,n=!1;await Promise.all([(async()=>{"number"==typeof t.mergeDelay&&(await mi(t.mergeDelay),r.isCancellationRequested)||n||(i=d(t.picks,!0))})(),(async()=>{e.busy=!0;try{const n=await t.additionalPicks;if(r.isCancellationRequested)return;let o,s,a,l;if(eae(t.picks)?(o=t.picks.items,s=t.picks.active):o=t.picks,eae(n)?(a=n.items,l=n.active):a=n,a.length>0||!i){let t;if(!s&&!l){const i=e.activeItems[0];i&&-1!==o.indexOf(i)&&(t=i)}d({items:[...o,...a],active:s||l||t})}}finally{r.isCancellationRequested||(e.busy=!1),n=!0}})()])};if(null===l);else if(tae(l))await h(l);else if(l instanceof Promise){e.busy=!0;try{const e=await l;if(r.isCancellationRequested)return;tae(e)?await h(e):d(e)}finally{r.isCancellationRequested||(e.busy=!1)}}else d(l)};n.add(e.onDidChangeValue((()=>r()))),r(),n.add(e.onDidAccept((t=>{if(i?.handleAccept)return t.inBackground||e.hide(),void i.handleAccept?.(e.activeItems[0],t.inBackground);const[n]=e.selectedItems;"function"==typeof n?.accept&&(t.inBackground||e.hide(),n.accept(e.keyMods,t))})));const a=async(i,n)=>{if("function"!=typeof n.trigger)return;const o=n.buttons?.indexOf(i)??-1;if(o>=0){const i=n.trigger(o,e.keyMods),s="number"==typeof i?i:await i;if(t.isCancellationRequested)return;switch(s){case Jre.NO_ACTION:break;case Jre.CLOSE_PICKER:e.hide();break;case Jre.REFRESH_PICKER:r();break;case Jre.REMOVE_ITEM:{const t=e.items.indexOf(n);if(-1!==t){const i=e.items.slice(),n=i.splice(t,1),o=e.activeItems.filter((e=>e!==n[0])),s=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=i,o&&(e.activeItems=o),e.keepScrollPosition=s}break}}}};return n.add(e.onDidTriggerItemButton((({button:e,item:t})=>a(e,t)))),n.add(e.onDidTriggerSeparatorButton((({button:e,separator:t})=>a(e,t)))),n}}var nae,oae,sae=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},rae=function(e,t){return function(i,n){t(i,n,e)}};let aae=class extends iae{static{nae=this}static{this.PREFIX=">"}static{this.TFIDF_THRESHOLD=.5}static{this.TFIDF_MAX_RESULTS=5}static{this.WORD_FILTER=vd(bd,Bd,Cd)}constructor(e,t,i,n,o,s){super(nae.PREFIX,e),this.keybindingService=i,this.commandService=n,this.telemetryService=o,this.dialogService=s,this.commandsHistory=this._register(t.createInstance(lae)),this.options=e}async _getPicks(e,t,i,n){const o=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const s=tt((()=>{const t=new Qre;return t.updateDocuments(o.map((e=>({key:e.commandId,textChunks:[this.getTfIdfChunk(e)]})))),function(e){const t=e.slice(0);t.sort(((e,t)=>t.score-e.score));const i=t[0]?.score??0;if(i>0)for(const e of t)e.score/=i;return t}(t.calculateScores(e,i)).filter((e=>e.score>nae.TFIDF_THRESHOLD)).slice(0,nae.TFIDF_MAX_RESULTS)})),r=[];for(const t of o){const n=nae.WORD_FILTER(e,t.label)??void 0,o=t.commandAlias?nae.WORD_FILTER(e,t.commandAlias)??void 0:void 0;if(n||o)t.highlights={label:n,detail:this.options.showAlias?o:void 0},r.push(t);else if(e===t.commandId)r.push(t);else if(e.length>=3){const e=s();if(i.isCancellationRequested)return[];const n=e.find((e=>e.key===t.commandId));n&&(t.tfIdfScore=n.score,r.push(t))}}const a=new Map;for(const e of r){const t=a.get(e.label);t?(e.description=e.commandId,t.description=t.commandId):a.set(e.label,e)}r.sort(((e,t)=>{if(e.tfIdfScore&&t.tfIdfScore)return e.tfIdfScore===t.tfIdfScore?e.label.localeCompare(t.label):t.tfIdfScore-e.tfIdfScore;if(e.tfIdfScore)return 1;if(t.tfIdfScore)return-1;const i=this.commandsHistory.peek(e.commandId),n=this.commandsHistory.peek(t.commandId);if(i&&n)return i>n?-1:1;if(i)return-1;if(n)return 1;if(this.options.suggestedCommandIds){const i=this.options.suggestedCommandIds.has(e.commandId),n=this.options.suggestedCommandIds.has(t.commandId);if(i&&n)return 0;if(i)return-1;if(n)return 1}return e.label.localeCompare(t.label)}));const l=[];let d=!1,h=!0,c=!!this.options.suggestedCommandIds;for(let e=0;e<r.length;e++){const t=r[e];0===e&&this.commandsHistory.peek(t.commandId)&&(l.push({type:"separator",label:y(1723,"recently used")}),d=!0),h&&void 0!==t.tfIdfScore&&(l.push({type:"separator",label:y(1724,"similar commands")}),h=!1),c&&void 0===t.tfIdfScore&&!this.commandsHistory.peek(t.commandId)&&this.options.suggestedCommandIds?.has(t.commandId)&&(l.push({type:"separator",label:y(1725,"commonly used")}),d=!0,c=!1),!d||void 0!==t.tfIdfScore||this.commandsHistory.peek(t.commandId)||this.options.suggestedCommandIds?.has(t.commandId)||(l.push({type:"separator",label:y(1726,"other commands")}),d=!1),l.push(this.toCommandPick(t,n))}return this.hasAdditionalCommandPicks(e,i)?{picks:l,additionalPicks:(async()=>{const t=await this.getAdditionalCommandPicks(o,r,e,i);if(i.isCancellationRequested)return[];const s=t.map((e=>this.toCommandPick(e,n)));return h&&"separator"!==s[0]?.type&&s.unshift({type:"separator",label:y(1727,"similar commands")}),s})()}:l}toCommandPick(e,t){if("separator"===e.type)return e;const i=this.keybindingService.lookupKeybinding(e.commandId),n=i?y(1728,"{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:n,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:t?.from??"quick open"});try{e.args?.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(t){Re(t)||this.dialogService.error(y(1729,"Command '{0}' resulted in an error",e.label),pM(t))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let n=e;return t&&t!==e&&(n+=` - ${t}`),i&&i.value!==e&&(n+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),n}};aae=nae=sae([rae(1,nc),rae(2,ER),rae(3,mc),rae(4,Cu),rae(5,Xre)],aae);let lae=class extends At{static{oae=this}static{this.DEFAULT_COMMANDS_HISTORY_LENGTH=50}static{this.PREF_KEY_CACHE="commandPalette.mru.cache"}static{this.PREF_KEY_COUNTER="commandPalette.mru.counter"}static{this.counter=1}static{this.hasChanges=!1}constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.logService=i,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration((e=>this.updateConfiguration(e)))),this._register(this.storageService.onWillSaveState((e=>{e.reason===xq.SHUTDOWN&&this.saveState()})))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=oae.getConfiguredCommandHistoryLength(this.configurationService),oae.cache&&oae.cache.limit!==this.configuredCommandsHistoryLength&&(oae.cache.limit=this.configuredCommandsHistoryLength,oae.hasChanges=!0))}load(){const e=this.storageService.get(oae.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(e){this.logService.error(`[CommandsHistory] invalid data: ${e}`)}const i=oae.cache=new ad(this.configuredCommandsHistoryLength,1);if(t){let e;e=t.usesLRU?t.entries:t.entries.sort(((e,t)=>e.value-t.value)),e.forEach((e=>i.set(e.key,e.value)))}oae.counter=this.storageService.getNumber(oae.PREF_KEY_COUNTER,0,oae.counter)}push(e){oae.cache&&(oae.cache.set(e,oae.counter++),oae.hasChanges=!0)}peek(e){return oae.cache?.peek(e)}saveState(){if(!oae.cache)return;if(!oae.hasChanges)return;const e={usesLRU:!0,entries:[]};oae.cache.forEach(((t,i)=>e.entries.push({key:i,value:t}))),this.storageService.store(oae.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(oae.PREF_KEY_COUNTER,oae.counter,0,0),oae.hasChanges=!1}static getConfiguredCommandHistoryLength(e){const t=e.getValue(),i=t.workbench?.commandPalette?.history;return"number"==typeof i?i:oae.DEFAULT_COMMANDS_HISTORY_LENGTH}};lae=oae=sae([rae(0,Sq),rae(1,up),rae(2,yu)],lae);class dae extends aae{constructor(e,t,i,n,o,s){super(e,t,i,n,o,s)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const n of e.getSupportedActions()){let e;n.metadata?.description&&(e=(i=n.metadata.description)&&"object"==typeof i&&"string"==typeof i.original&&"string"==typeof i.value?n.metadata.description:{original:n.metadata.description,value:n.metadata.description}),t.push({commandId:n.id,commandAlias:n.alias,commandDescription:e,label:Sh(n.label)||n.id})}var i;return t}}var hae=function(e,t){return function(i,n){t(i,n,e)}};let cae=class extends dae{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,i,n,o,s){super({showAlias:!1},e,i,n,o,s),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};cae=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([hae(0,nc),hae(1,sc),hae(2,ER),hae(3,mc),hae(4,Cu),hae(5,Xre)],cae);class uae extends Pu{static{this.ID="editor.action.quickCommand"}constructor(){super({id:uae.ID,label:K7.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:Xu.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(LD).quickAccess.show(cae.PREFIX)}}Hu(uae),ru.as(V7).registerQuickAccessProvider({ctor:cae,prefix:cae.PREFIX,helpEntries:[{description:K7.quickCommandHelp,commandId:uae.ID}]});var gae,pae=function(e,t){return function(i,n){t(i,n,e)}};let mae=class{static{gae=this}static{this.PREFIX="?"}constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=ru.as(V7)}provide(e){const t=new Mt;return t.add(e.onDidAccept((()=>{const[t]=e.selectedItems;t&&this.quickInputService.quickAccess.show(t.prefix,{preserveValue:!0})}))),t.add(e.onDidChangeValue((e=>{const t=this.registry.getQuickAccessProvider(e.substr(gae.PREFIX.length));t&&t.prefix&&t.prefix!==gae.PREFIX&&this.quickInputService.quickAccess.show(t.prefix,{preserveValue:!0})}))),e.items=this.getQuickAccessProviders().filter((e=>e.prefix!==gae.PREFIX)),t}getQuickAccessProviders(){const e=this.registry.getQuickAccessProviders().sort(((e,t)=>e.prefix.localeCompare(t.prefix))).flatMap((e=>this.createPicks(e)));return e}createPicks(e){return e.helpEntries.map((t=>{const i=t.prefix||e.prefix,n=i||"…";return{prefix:i,label:n,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:y(1730,"{0}, {1}",n,t.description),description:t.description}}))}};mae=gae=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([pae(0,LD),pae(1,ER)],mae),ru.as(V7).registerQuickAccessProvider({ctor:mae,prefix:"",helpEntries:[{description:U7.helpQuickAccessActionLabel}]});const fae=[void 0,[]];function _ae(e,t,i=0,n=0){const o=t;return o.values&&o.values.length>1?function(e,t,i,n){let o=0;const s=[];for(const r of t){const[t,a]=vae(e,r,i,n);if("number"!=typeof t)return fae;o+=t,s.push(...a)}return[o,bae(s)]}(e,o.values,i,n):vae(e,t,i,n)}function vae(e,t,i,n){const o=dh(t.original,t.originalLowercase,i,e,e.toLowerCase(),n,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return o?[o[0],$d(o)]:fae}function bae(e){const t=e.sort(((e,t)=>e.start-t.start)),i=[];let n;for(const e of t)!n||(s=e,(o=n).end<s.start||s.end<o.start)?(n=e,i.push(e)):(n.start=Math.min(n.start,e.start),n.end=Math.max(n.end,e.end));var o,s;return i}function wae(e){return e.startsWith('"')&&e.endsWith('"')}function Cae(e){"string"!=typeof e&&(e="");const t=e.toLowerCase(),{pathNormalized:i,normalized:n,normalizedLowercase:o}=yae(e),s=i.indexOf(oo)>=0,r=wae(e);let a;const l=e.split(" ");if(l.length>1)for(const e of l){const t=wae(e),{pathNormalized:i,normalized:n,normalizedLowercase:o}=yae(e);n&&(a||(a=[]),a.push({original:e,originalLowercase:e.toLowerCase(),pathNormalized:i,normalized:n,normalizedLowercase:o,expectContiguousMatch:t}))}return{original:e,originalLowercase:t,pathNormalized:i,normalized:n,normalizedLowercase:o,values:a,containsPathSeparator:s,expectContiguousMatch:r}}function yae(e){let t;t=q?e.replace(/\//g,oo):e.replace(/\\/g,oo);const i=t.replace(/[\*\u2026\s"]/g,"");return{pathNormalized:t,normalized:i,normalizedLowercase:i.toLowerCase()}}function Sae(e){return Array.isArray(e)?Cae(e.map((e=>e.original)).join(" ")):Cae(e.original)}Object.freeze({score:0});var xae,kae=function(e,t){return function(i,n){t(i,n,e)}};let Lae=class extends F7{static{xae=this}static{this.PREFIX="@"}static{this.SCOPE_PREFIX=":"}static{this.PREFIX_BY_CATEGORY=`${this.PREFIX}${this.SCOPE_PREFIX}`}constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,y(1330,"To go to a symbol, first open a text editor with symbol information.")),At.None}provideWithTextEditor(e,t,i,n){const o=e.editor,s=this.getModel(o);return s?this._languageFeaturesService.documentSymbolProvider.has(s)?this.doProvideWithEditorSymbols(e,s,t,i,n):this.doProvideWithoutEditorSymbols(e,s,t,i):At.None}doProvideWithoutEditorSymbols(e,t,i,n){const o=new Mt;return this.provideLabelPick(i,y(1331,"The active text editor does not provide symbol information.")),(async()=>{await this.waitForLanguageSymbolRegistry(t,o)&&!n.isCancellationRequested&&o.add(this.doProvideWithEditorSymbols(e,t,i,n))})(),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new Li,n=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange((()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(n.dispose(),i.complete(!0))})));return t.add(Tt((()=>i.complete(!1)))),i.p}doProvideWithEditorSymbols(e,t,i,n,o){const s=e.editor,r=new Mt;r.add(i.onDidAccept((t=>{const[n]=i.selectedItems;n&&n.range&&(this.gotoLocation(e,{range:n.range.selection,keyMods:i.keyMods,preserveFocus:t.inBackground}),o?.handleAccept?.(n,t.inBackground),t.inBackground||i.hide())}))),r.add(i.onDidTriggerItemButton((({item:t})=>{t&&t.range&&(this.gotoLocation(e,{range:t.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())})));const a=this.getDocumentSymbols(t,n),l=r.add(new Rt),d=async e=>{l?.value?.cancel(),i.busy=!1,l.value=new ri,i.busy=!0;try{const o=Cae(i.value.substr(xae.PREFIX.length).trim()),s=await this.doGetSymbolPicks(a,o,void 0,l.value.token,t);if(n.isCancellationRequested)return;if(s.length>0){if(i.items=s,e&&0===o.original.length){const t=gm(s,(t=>Boolean("separator"!==t.type&&t.range&&Yu.containsPosition(t.range.decoration,e))));t&&(i.activeItems=[t])}}else o.original.length>0?this.provideLabelPick(i,y(1332,"No matching editor symbols")):this.provideLabelPick(i,y(1333,"No editor symbols"))}finally{n.isCancellationRequested||(i.busy=!1)}};return r.add(i.onDidChangeValue((()=>d(void 0)))),d(s.getSelection()?.getPosition()),r.add(i.onDidChangeActive((()=>{const[e]=i.activeItems;e&&e.range&&(s.revealRangeInCenter(e.range.selection,0),this.addDecorations(s,e.range.decoration))}))),r}async doGetSymbolPicks(e,t,i,n,o){const s=await e;if(n.isCancellationRequested)return[];const r=0===t.original.indexOf(xae.SCOPE_PREFIX),a=r?1:0;let l,d,h;t.values&&t.values.length>1?(l=Sae(t.values[0]),d=Sae(t.values.slice(1))):l=t;const c=this.options?.openSideBySideDirection?.();c&&(h=[{iconClass:"right"===c?vh.asClassName(fh.splitHorizontal):vh.asClassName(fh.splitVertical),tooltip:"right"===c?y(1334,"Open to the Side"):y(1335,"Open to the Bottom")}]);const u=[];for(let _=0;_<s.length;_++){const v=s[_],b=Hi(v.name),w=`$(${qS.toIcon(v.kind).id}) ${b}`,C=w.length-b.length;let S,x,k,L,D=v.containerName;if(i?.extraContainerLabel&&(D=D?`${i.extraContainerLabel} • ${D}`:i.extraContainerLabel),t.original.length>a){let N=!1;if(l!==t&&([S,x]=_ae(w,{...t,values:void 0},a,C),"number"==typeof S&&(N=!0)),"number"!=typeof S&&([S,x]=_ae(w,l,a,C),"number"!=typeof S))continue;if(!N&&d){if(D&&d.original.length>0&&([k,L]=_ae(D,d)),"number"!=typeof k)continue;"number"==typeof S&&(S+=k)}}const E=v.tags&&v.tags.indexOf(1)>=0;u.push({index:_,kind:v.kind,score:S,label:w,ariaLabel:(g=v.name,p=v.kind,y(779,"{0} ({1})",g,jS[p])),description:D,highlights:E?void 0:{label:x,description:L},range:{selection:Yu.collapseToStart(v.selectionRange),decoration:v.range},uri:o.uri,symbolName:b,strikethrough:E,buttons:h})}var g,p;const m=u.sort(((e,t)=>r?this.compareByKindAndScore(e,t):this.compareByScore(e,t)));let f=[];if(r){let I,T,M=0;function A(){T&&"number"==typeof I&&M>0&&(T.label=Bi(Eae[I]||Dae,M))}for(const R of m)I!==R.kind?(A(),I=R.kind,M=1,T={type:"separator"},f.push(T)):M++,f.push(R);A()}else m.length>0&&(f=[{label:y(1336,"symbols ({0})",u.length),type:"separator"},...m]);return f}compareByScore(e,t){if("number"!=typeof e.score&&"number"==typeof t.score)return 1;if("number"==typeof e.score&&"number"!=typeof t.score)return-1;if("number"==typeof e.score&&"number"==typeof t.score){if(e.score>t.score)return-1;if(e.score<t.score)return 1}return e.index<t.index?-1:e.index>t.index?1:0}compareByKindAndScore(e,t){const i=Eae[e.kind]||Dae,n=Eae[t.kind]||Dae,o=i.localeCompare(n);return 0===o?this.compareByScore(e,t):o}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}};Lae=xae=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([kae(0,BD),kae(1,Z5)],Lae);const Dae=y(1337,"properties ({0})"),Eae={5:y(1338,"methods ({0})"),11:y(1339,"functions ({0})"),8:y(1340,"constructors ({0})"),12:y(1341,"variables ({0})"),4:y(1342,"classes ({0})"),22:y(1343,"structs ({0})"),23:y(1344,"events ({0})"),24:y(1345,"operators ({0})"),10:y(1346,"interfaces ({0})"),2:y(1347,"namespaces ({0})"),3:y(1348,"packages ({0})"),25:y(1349,"type parameters ({0})"),1:y(1350,"modules ({0})"),6:y(1351,"properties ({0})"),9:y(1352,"enumerations ({0})"),21:y(1353,"enumeration members ({0})"),14:y(1354,"strings ({0})"),0:y(1355,"files ({0})"),17:y(1356,"arrays ({0})"),15:y(1357,"numbers ({0})"),16:y(1358,"booleans ({0})"),18:y(1359,"objects ({0})"),19:y(1360,"keys ({0})"),7:y(1361,"fields ({0})"),13:y(1362,"constants ({0})")};var Nae=function(e,t){return function(i,n){t(i,n,e)}};let Iae=class extends Lae{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=zt.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};Iae=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Nae(0,sc),Nae(1,BD),Nae(2,Z5)],Iae);class Tae extends Pu{static{this.ID="editor.action.quickOutline"}constructor(){super({id:Tae.ID,label:j7.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:Xu.hasDocumentSymbolProvider,kbOpts:{kbExpr:Xu.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(LD).quickAccess.show(Lae.PREFIX,{itemActivation:SD.NONE})}}Hu(Tae),ru.as(V7).registerQuickAccessProvider({ctor:Iae,prefix:Lae.PREFIX,helpEntries:[{description:j7.quickOutlineActionLabel,prefix:Lae.PREFIX,commandId:Tae.ID},{description:j7.quickOutlineByCategoryActionLabel,prefix:Lae.PREFIX_BY_CATEGORY}]});class Mae extends At{static{this.ID="editor.contrib.readOnlyMessageController"}constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit((()=>this._onDidAttemptReadOnlyEdit())))}_onDidAttemptReadOnlyEdit(){const e=uT.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(105);t||(t=this.editor.isSimpleWidget?new Gh(y(1363,"Cannot edit in read-only input")):new Gh(y(1364,"Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}}Uu(Mae.ID,Mae,2);var Aae=function(e,t){return function(i,n){t(i,n,e)}};let Rae=class extends K0{constructor(e,t,i,n,o,s,r){super(!0,e,t,i,n,o,s,r)}};Rae=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Aae(1,eu),Aae(2,sc),Aae(3,lO),Aae(4,nc),Aae(5,Sq),Aae(6,up)],Rae),Uu(K0.ID,Rae,4);const Oae=oc("textResourceConfigurationService"),Pae=oc("textResourcePropertiesService");var Fae=i(8033),Bae={};Bae.styleTagTransform=zl(),Bae.setAttributes=Bl(),Bae.insert=Pl().bind(null,"head"),Bae.domAPI=Rl(),Bae.insertStyleElement=Vl(),Ml()(Fae.A,Bae),Fae.A&&Fae.A.locals&&Fae.A.locals;var Wae=function(e,t){return function(i,n){t(i,n,e)}};const Vae=new Jc("renameInputVisible",!1,y(1376,"Whether the rename input widget is visible"));new Jc("renameInputFocused",!1,y(1377,"Whether the rename input widget is focused"));let Hae=class{constructor(e,t,i,n,o,s){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=n,this._logService=s,this.allowEditorOverflow=!0,this._disposables=new Mt,this._visibleContextKey=Vae.bindTo(o),this._isEditingRenameCandidate=!1,this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,this._candidates=new Set,this._beforeFirstInputFieldEditSW=new Ht,this._inputWithButton=new Uae,this._disposables.add(this._inputWithButton),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(59)&&this._updateFont()}))),this._disposables.add(i.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._domNode.appendChild(this._inputWithButton.domNode),this._renameCandidateListView=this._disposables.add(new zae(this._domNode,{fontInfo:this._editor.getOption(59),onFocusChange:e=>{this._inputWithButton.input.value=e,this._isEditingRenameCandidate=!1},onSelectionChange:()=>{this._isEditingRenameCandidate=!1,this.acceptInput(!1)}})),this._disposables.add(this._inputWithButton.onDidInputChange((()=>{void 0!==this._renameCandidateListView?.focusedCandidate&&(this._isEditingRenameCandidate=!0),this._timeBeforeFirstInputFieldEdit??=this._beforeFirstInputFieldEditSW.elapsed(),!1===this._renameCandidateProvidersCts?.token.isCancellationRequested&&this._renameCandidateProvidersCts.cancel(),this._renameCandidateListView?.clearFocus()}))),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){if(!this._domNode)return;const t=e.getColor($_),i=e.getColor(G_);this._domNode.style.backgroundColor=String(e.getColor(d_)??""),this._domNode.style.boxShadow=t?` 0 0 8px 2px ${t}`:"",this._domNode.style.border=i?`1px solid ${i}`:"",this._domNode.style.color=String(e.getColor(Cv)??"");const n=e.getColor(yv);this._inputWithButton.domNode.style.backgroundColor=String(e.getColor(wv)??""),this._inputWithButton.input.style.backgroundColor=String(e.getColor(wv)??""),this._inputWithButton.domNode.style.borderWidth=n?"1px":"0px",this._inputWithButton.domNode.style.borderStyle=n?"solid":"none",this._inputWithButton.domNode.style.borderColor=n?.toString()??"none"}_updateFont(){if(void 0===this._domNode)return;_t(void 0!==this._label,"RenameWidget#_updateFont: _label must not be undefined given _domNode is defined"),this._editor.applyFontInfo(this._inputWithButton.input);const e=this._editor.getOption(59);this._label.style.fontSize=`${this._computeLabelFontSize(e.fontSize)}px`}_computeLabelFontSize(e){return.8*e}getPosition(){if(!this._visible)return null;if(!this._editor.hasModel()||!this._editor.getDomNode())return null;const e=ka(this.getDomNode().ownerDocument.body),t=Na(this._editor.getDomNode()),i=this._getTopForPosition();this._nPxAvailableAbove=i+t.top,this._nPxAvailableBelow=e.height-this._nPxAvailableAbove;const n=this._editor.getOption(75),{totalHeight:o}=Kae.getLayoutInfo({lineHeight:n}),s=this._nPxAvailableBelow>6*o?[2,1]:[1,2];return{position:this._position,preference:s}}beforeRender(){const[e,t]=this._acceptKeybindings;return this._label.innerText=y(1378,"{0} to Rename, {1} to Preview",this._keybindingService.lookupKeybinding(e)?.getLabel(),this._keybindingService.lookupKeybinding(t)?.getLabel()),this._domNode.style.minWidth="200px",null}afterRender(e){if(null===e)return void this.cancelInput(!0,"afterRender (because position is null)");if(!this._editor.hasModel()||!this._editor.getDomNode())return;_t(this._renameCandidateListView),_t(void 0!==this._nPxAvailableAbove),_t(void 0!==this._nPxAvailableBelow);const t=Ra(this._inputWithButton.domNode),i=Ra(this._label);let n;n=2===e?this._nPxAvailableBelow:this._nPxAvailableAbove,this._renameCandidateListView.layout({height:n-i-t,width:Ta(this._inputWithButton.domNode)})}acceptInput(e){this._trace("invoking acceptInput"),this._currentAcceptInput?.(e)}cancelInput(e,t){this._currentCancelInput?.(e)}focusNextRenameSuggestion(){this._renameCandidateListView?.focusNext()||(this._inputWithButton.input.value=this._currentName)}focusPreviousRenameSuggestion(){this._renameCandidateListView?.focusPrevious()||(this._inputWithButton.input.value=this._currentName)}getInput(e,t,i,n,o){const{start:s,end:r}=this._getSelection(e,t);this._renameCts=o;const a=new Mt;this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,void 0===n?this._inputWithButton.button.style.display="none":(this._inputWithButton.button.style.display="flex",this._requestRenameCandidatesOnce=n,this._requestRenameCandidates(t,!1),a.add(ga(this._inputWithButton.button,"click",(()=>this._requestRenameCandidates(t,!0)))),a.add(ga(this._inputWithButton.button,Qa.KEY_DOWN,(e=>{const i=new Ze(e);(i.equals(3)||i.equals(10))&&(i.stopPropagation(),i.preventDefault(),this._requestRenameCandidates(t,!0))})))),this._isEditingRenameCandidate=!1,this._domNode.classList.toggle("preview",i),this._position=new rc(e.startLineNumber,e.startColumn),this._currentName=t,this._inputWithButton.input.value=t,this._inputWithButton.input.setAttribute("selectionStart",s.toString()),this._inputWithButton.input.setAttribute("selectionEnd",r.toString()),this._inputWithButton.input.size=Math.max(1.1*(e.endColumn-e.startColumn),20),this._beforeFirstInputFieldEditSW.reset(),a.add(Tt((()=>{this._renameCts=void 0,o.dispose(!0)}))),a.add(Tt((()=>{void 0!==this._renameCandidateProvidersCts&&(this._renameCandidateProvidersCts.dispose(!0),this._renameCandidateProvidersCts=void 0)}))),a.add(Tt((()=>this._candidates.clear())));const l=new Li;return l.p.finally((()=>{a.dispose(),this._hide()})),this._currentCancelInput=e=>(this._trace("invoking _currentCancelInput"),this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView?.clearCandidates(),l.complete(e),!0),this._currentAcceptInput=e=>{this._trace("invoking _currentAcceptInput"),_t(void 0!==this._renameCandidateListView);const n=this._renameCandidateListView.nCandidates;let o,s;const r=this._renameCandidateListView.focusedCandidate;void 0!==r?(this._trace("using new name from renameSuggestion"),o=r,s={k:"renameSuggestion"}):(this._trace("using new name from inputField"),o=this._inputWithButton.input.value,s=this._isEditingRenameCandidate?{k:"userEditedRenameSuggestion"}:{k:"inputField"}),o!==t&&0!==o.trim().length?(this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView.clearCandidates(),l.complete({newName:o,wantsPreview:i&&e,stats:{source:s,nRenameSuggestions:n,timeBeforeFirstInputFieldEdit:this._timeBeforeFirstInputFieldEdit,nRenameSuggestionsInvocations:this._nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:this._hadAutomaticRenameSuggestionsInvocation}})):this.cancelInput(!0,"_currentAcceptInput (because newName === value || newName.trim().length === 0)")},a.add(o.token.onCancellationRequested((()=>this.cancelInput(!0,"cts.token.onCancellationRequested")))),a.add(this._editor.onDidBlurEditorWidget((()=>this.cancelInput(!this._domNode?.ownerDocument.hasFocus(),"editor.onDidBlurEditorWidget")))),this._show(),l.p}_requestRenameCandidates(e,t){if(void 0!==this._requestRenameCandidatesOnce&&(void 0!==this._renameCandidateProvidersCts&&this._renameCandidateProvidersCts.dispose(!0),_t(this._renameCts),"stop"!==this._inputWithButton.buttonState)){this._renameCandidateProvidersCts=new ri;const i=t?GS.Invoke:GS.Automatic,n=this._requestRenameCandidatesOnce(i,this._renameCandidateProvidersCts.token);if(0===n.length)return void this._inputWithButton.setSparkleButton();t||(this._hadAutomaticRenameSuggestionsInvocation=!0),this._nRenameSuggestionsInvocations+=1,this._inputWithButton.setStopButton(),this._updateRenameCandidates(n,e,this._renameCts.token)}}_getSelection(e,t){_t(this._editor.hasModel());const i=this._editor.getSelection();let n=0,o=t.length;return Yu.isEmpty(i)||Yu.spansMultipleLines(i)||!Yu.containsRange(e,i)||(n=Math.max(0,i.startColumn-e.startColumn),o=Math.min(e.endColumn,i.endColumn)-e.startColumn),{start:n,end:o}}_show(){this._trace("invoking _show"),this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout((()=>{this._inputWithButton.input.focus(),this._inputWithButton.input.setSelectionRange(parseInt(this._inputWithButton.input.getAttribute("selectionStart")),parseInt(this._inputWithButton.input.getAttribute("selectionEnd")))}),100)}async _updateRenameCandidates(e,t,i){const n=(...e)=>this._trace("_updateRenameCandidates",...e);n("start");const o=await ci(Promise.allSettled(e),i);if(this._inputWithButton.setSparkleButton(),void 0===o)return void n("returning early - received updateRenameCandidates results - undefined");const s=o.flatMap((e=>"fulfilled"===e.status&&mt(e.value)?e.value:[]));n(`received updateRenameCandidates results - total (unfiltered) ${s.length} candidates.`);const r=cs(s,(e=>e.newSymbolName));n(`distinct candidates - ${r.length} candidates.`);const a=r.filter((({newSymbolName:e})=>e.trim().length>0&&e!==this._inputWithButton.input.value&&e!==t&&!this._candidates.has(e)));n(`valid distinct candidates - ${s.length} candidates.`),a.forEach((e=>this._candidates.add(e.newSymbolName))),a.length<1?n("returning early - no valid distinct candidates"):(n("setting candidates"),this._renameCandidateListView.setCandidates(a),n("asking editor to re-layout"),this._editor.layoutContentWidget(this))}_hide(){this._trace("invoked _hide"),this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}_getTopForPosition(){const e=this._editor.getVisibleRanges();let t;return e.length>0?t=e[0].startLineNumber:(this._logService.warn("RenameWidget#_getTopForPosition: this should not happen - visibleRanges is empty"),t=Math.max(1,this._position.lineNumber-5)),this._editor.getTopForLineNumber(this._position.lineNumber)-this._editor.getTopForLineNumber(t)}_trace(...e){this._logService.trace("RenameWidget",...e)}};Hae=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Wae(2,sw),Wae(3,ER),Wae(4,eu),Wae(5,yu)],Hae);class zae{constructor(e,t){this._disposables=new Mt,this._availableHeight=0,this._minimumWidth=0,this._lineHeight=t.fontInfo.lineHeight,this._typicalHalfwidthCharacterWidth=t.fontInfo.typicalHalfwidthCharacterWidth,this._listContainer=document.createElement("div"),this._listContainer.className="rename-box rename-candidate-list-container",e.appendChild(this._listContainer),this._listWidget=zae._createListWidget(this._listContainer,this._candidateViewHeight,t.fontInfo),this._disposables.add(this._listWidget.onDidChangeFocus((e=>{1===e.elements.length&&t.onFocusChange(e.elements[0].newSymbolName)}),this._disposables)),this._disposables.add(this._listWidget.onDidChangeSelection((e=>{1===e.elements.length&&t.onSelectionChange()}),this._disposables)),this._disposables.add(this._listWidget.onDidBlur((e=>{this._listWidget.setFocus([])}))),this._listWidget.style(BR({listInactiveFocusForeground:Xb,listInactiveFocusBackground:ew}))}dispose(){this._listWidget.dispose(),this._disposables.dispose()}layout({height:e,width:t}){this._availableHeight=e,this._minimumWidth=t}setCandidates(e){this._listWidget.splice(0,0,e);const t=this._pickListHeight(this._listWidget.length),i=this._pickListWidth(e);this._listWidget.layout(t,i),this._listContainer.style.height=`${t}px`,this._listContainer.style.width=`${i}px`,Ql(y(1379,"Received {0} rename suggestions",e.length))}clearCandidates(){this._listContainer.style.height="0px",this._listContainer.style.width="0px",this._listWidget.splice(0,this._listWidget.length,[])}get nCandidates(){return this._listWidget.length}get focusedCandidate(){if(0===this._listWidget.length)return;const e=this._listWidget.getSelectedElements()[0];if(void 0!==e)return e.newSymbolName;const t=this._listWidget.getFocusedElements()[0];return void 0!==t?t.newSymbolName:void 0}focusNext(){if(0===this._listWidget.length)return!1;const e=this._listWidget.getFocus();if(0===e.length)return this._listWidget.focusFirst(),this._listWidget.reveal(0),!0;if(e[0]===this._listWidget.length-1)return this._listWidget.setFocus([]),this._listWidget.reveal(0),!1;{this._listWidget.focusNext();const e=this._listWidget.getFocus()[0];return this._listWidget.reveal(e),!0}}focusPrevious(){if(0===this._listWidget.length)return!1;const e=this._listWidget.getFocus();if(0===e.length){this._listWidget.focusLast();const e=this._listWidget.getFocus()[0];return this._listWidget.reveal(e),!0}if(0===e[0])return this._listWidget.setFocus([]),!1;{this._listWidget.focusPrevious();const e=this._listWidget.getFocus()[0];return this._listWidget.reveal(e),!0}}clearFocus(){this._listWidget.setFocus([])}get _candidateViewHeight(){const{totalHeight:e}=Kae.getLayoutInfo({lineHeight:this._lineHeight});return e}_pickListHeight(e){const t=this._candidateViewHeight*e;return Math.min(t,this._availableHeight,7*this._candidateViewHeight)}_pickListWidth(e){const t=Math.ceil(Math.max(...e.map((e=>e.newSymbolName.length)))*this._typicalHalfwidthCharacterWidth);return Math.max(this._minimumWidth,25+t+10)}static _createListWidget(e,t,i){const n=new class{getTemplateId(e){return"candidate"}getHeight(e){return t}},o=new class{constructor(){this.templateId="candidate"}renderTemplate(e){return new Kae(e,i)}renderElement(e,t,i){i.populate(e)}disposeTemplate(e){e.dispose()}};return new XA("NewSymbolNameCandidates",e,n,[o],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1})}}class Uae{constructor(){this._buttonHoverContent="",this._onDidInputChange=new Zt,this.onDidInputChange=this._onDidInputChange.event,this._disposables=new Mt}get domNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="rename-input-with-button",this._domNode.style.display="flex",this._domNode.style.flexDirection="row",this._domNode.style.alignItems="center",this._inputNode=document.createElement("input"),this._inputNode.className="rename-input",this._inputNode.type="text",this._inputNode.style.border="none",this._inputNode.setAttribute("aria-label",y(1380,"Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._inputNode),this._buttonNode=document.createElement("div"),this._buttonNode.className="rename-suggestions-button",this._buttonNode.setAttribute("tabindex","0"),this._buttonGenHoverText=y(1381,"Generate new name suggestions"),this._buttonCancelHoverText=y(1382,"Cancel"),this._buttonHoverContent=this._buttonGenHoverText,this._disposables.add(lM().setupDelayedHover(this._buttonNode,(()=>({content:this._buttonHoverContent,appearance:{showPointer:!0,compact:!0}})))),this._domNode.appendChild(this._buttonNode),this._disposables.add(ga(this.input,Qa.INPUT,(()=>this._onDidInputChange.fire()))),this._disposables.add(ga(this.input,Qa.KEY_DOWN,(e=>{const t=new Ze(e);15!==t.keyCode&&17!==t.keyCode||this._onDidInputChange.fire()}))),this._disposables.add(ga(this.input,Qa.CLICK,(()=>this._onDidInputChange.fire()))),this._disposables.add(ga(this.input,Qa.FOCUS,(()=>{this.domNode.style.outlineWidth="1px",this.domNode.style.outlineStyle="solid",this.domNode.style.outlineOffset="-1px",this.domNode.style.outlineColor="var(--vscode-focusBorder)"}))),this._disposables.add(ga(this.input,Qa.BLUR,(()=>{this.domNode.style.outline="none"})))),this._domNode}get input(){return _t(this._inputNode),this._inputNode}get button(){return _t(this._buttonNode),this._buttonNode}get buttonState(){return this._buttonState}setSparkleButton(){this._buttonState="sparkle",this._sparkleIcon??=wI(fh.sparkle),ca(this.button),this.button.appendChild(this._sparkleIcon),this.button.setAttribute("aria-label","Generating new name suggestions"),this._buttonHoverContent=this._buttonGenHoverText,this.input.focus()}setStopButton(){this._buttonState="stop",this._stopIcon??=wI(fh.stopCircle),ca(this.button),this.button.appendChild(this._stopIcon),this.button.setAttribute("aria-label","Cancel generating new name suggestions"),this._buttonHoverContent=this._buttonCancelHoverText,this.input.focus()}dispose(){this._disposables.dispose()}}class Kae{static{this._PADDING=2}constructor(e,t){this._domNode=document.createElement("div"),this._domNode.className="rename-box rename-candidate",this._domNode.style.display="flex",this._domNode.style.columnGap="5px",this._domNode.style.alignItems="center",this._domNode.style.height=`${t.lineHeight}px`,this._domNode.style.padding=`${Kae._PADDING}px`;const i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.width=i.style.height=.8*t.lineHeight+"px",this._domNode.appendChild(i),this._icon=wI(fh.sparkle),this._icon.style.display="none",i.appendChild(this._icon),this._label=document.createElement("div"),iT(this._label,t),this._domNode.appendChild(this._label),e.appendChild(this._domNode)}populate(e){this._updateIcon(e),this._updateLabel(e)}_updateIcon(e){const t=!!e.tags?.includes($S.AIGenerated);this._icon.style.display=t?"inherit":"none"}_updateLabel(e){this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:e}){return{totalHeight:e+2*Kae._PADDING}}dispose(){}}var jae,qae=function(e,t){return function(i,n){t(i,n,e)}};class $ae{constructor(e,t,i){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=i.ordered(e)}hasProvider(){return this._providers.length>0}async resolveRenameLocation(e){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx<this._providers.length;this._providerRenameIdx++){const i=this._providers[this._providerRenameIdx];if(!i.resolveRenameLocation)break;const n=await i.resolveRenameLocation(this.model,this.position,e);if(n){if(!n.rejectReason)return n;t.push(n.rejectReason)}}this._providerRenameIdx=0;const i=this.model.getWordAtPosition(this.position);return i?{range:new Yu(this.position.lineNumber,i.startColumn,this.position.lineNumber,i.endColumn),text:i.word,rejectReason:t.length>0?t.join("\n"):void 0}:{range:Yu.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join("\n"):void 0}}async provideRenameEdits(e,t){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}async _provideRenameEdits(e,t,i,n){const o=this._providers[t];if(!o)return{edits:[],rejectReason:i.join("\n")};const s=await o.provideRenameEdits(this.model,this.position,e,n);return s?s.rejectReason?this._provideRenameEdits(e,t+1,i.concat(s.rejectReason),n):s:this._provideRenameEdits(e,t+1,i.concat(y(1365,"No result.")),n)}}let Gae=class{static{jae=this}static{this.ID="editor.contrib.renameController"}static get(e){return e.getContribution(jae.ID)}constructor(e,t,i,n,o,s,r,a){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=o,this._logService=s,this._configService=r,this._languageFeaturesService=a,this._disposableStore=new Mt,this._cts=new ri,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(Hae,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new ri,!this.editor.hasModel())return void e("editor has no model");const t=this.editor.getPosition(),i=new $ae(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider())return void e("skeleton has no provider");const n=new UD(this.editor,5,void 0,this._cts.token);let o;try{e("resolving rename location");const t=i.resolveRenameLocation(n.token);this._progressService.showWhile(t,250),o=await t,e("resolved rename location")}catch(i){return void(i instanceof Oe?e("resolve rename location cancelled",JSON.stringify(i,null,"\t")):(e("resolve rename location failed",i instanceof Error?i:JSON.stringify(i,null,"\t")),("string"==typeof i||Yh(i))&&uT.get(this.editor)?.showMessage(i||y(1366,"An unknown error occurred while resolving rename location"),t)))}finally{n.dispose()}if(!o)return void e("returning early - no loc");if(o.rejectReason)return e(`returning early - rejected with reason: ${o.rejectReason}`,o.rejectReason),void uT.get(this.editor)?.showMessage(o.rejectReason,t);if(n.token.isCancellationRequested)return void e("returning early - cts1 cancelled");const s=new UD(this.editor,5,o.range,this._cts.token),r=this.editor.getModel(),a=this._languageFeaturesService.newSymbolNamesProvider.all(r),l=await Promise.all(a.map((async e=>[e,await e.supportsAutomaticNewSymbolNamesTriggerKind??!1])));e("creating rename input field and awaiting its result");const d=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),h=await this._renameWidget.getInput(o.range,o.text,d,a.length>0?(e,t)=>{let i=l.slice();return e===GS.Automatic&&(i=i.filter((([e,t])=>t))),i.map((([i])=>i.provideNewSymbolNames(r,o.range,e,t)))}:void 0,s);if(e("received response from rename input field"),"boolean"==typeof h)return e(`returning early - rename input field response - ${h}`),h&&this.editor.focus(),void s.dispose();this.editor.focus(),e("requesting rename edits");const c=ci(i.provideRenameEdits(h.newName,s.token),s.token).then((async t=>{if(t)if(this.editor.hasModel()){if(t.rejectReason)return e(`returning early - rejected with reason: ${t.rejectReason}`),void this._notificationService.info(t.rejectReason);this.editor.setSelection(Yu.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(t,{editor:this.editor,showPreview:h.wantsPreview,label:y(1367,"Renaming '{0}' to '{1}'",o?.text,h.newName),code:"undoredo.rename",quotableLabel:y(1368,"Renaming {0} to {1}",o?.text,h.newName),respectAutoSaveConfig:!0,reason:SC()}).then((t=>{e("edits applied"),t.ariaSummary&&Yl(y(1369,"Successfully renamed '{0}' to '{1}'. Summary: {2}",o.text,h.newName,t.ariaSummary))})).catch((t=>{e(`error when applying edits ${JSON.stringify(t,null,"\t")}`),this._notificationService.error(y(1370,"Rename failed to apply edits")),this._logService.error(t)}))}else e("returning early - no model after rename edits are provided");else e("returning early - no rename edits result")}),(t=>{e("error when providing rename edits",JSON.stringify(t,null,"\t")),this._notificationService.error(y(1371,"Rename failed to compute edits")),this._logService.error(t)})).finally((()=>{s.dispose()}));return e("returning rename operation"),this._progressService.showWhile(c,250),c}acceptRenameInput(e){this._renameWidget.acceptInput(e)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}};Gae=jae=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([qae(1,nc),qae(2,lO),qae(3,RD),qae(4,wD),qae(5,yu),qae(6,Oae),qae(7,BD)],Gae),Uu(Gae.ID,Gae,4),Hu(class extends Pu{constructor(){super({id:"editor.action.rename",label:x(1373,"Rename Symbol"),precondition:Ac.and(Xu.writable,Xu.hasRenameProvider),kbOpts:{kbExpr:Xu.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(sc),[n,o]=Array.isArray(t)&&t||[void 0,void 0];return uo.isUri(n)&&rc.isIPosition(o)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then((e=>{e&&(e.setPosition(o),e.invokeWithinContext((t=>(this.reportTelemetry(t,e),this.run(t,e)))))}),Ie):super.runCommand(e,t)}run(e,t){const i=e.get(yu),n=Gae.get(t);return n?(i.trace("[RenameAction] got controller, running..."),n.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}});const Zae=Ou.bindToContribution(Gae.get);Vu(new Zae({id:"acceptRenameInput",precondition:Vae,handler:e=>e.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:Ac.and(Xu.focus,Ac.not("isComposing")),primary:3}})),Vu(new Zae({id:"acceptRenameInputWithPreview",precondition:Ac.and(Vae,Ac.has("config.editor.rename.enablePreview")),handler:e=>e.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:Ac.and(Xu.focus,Ac.not("isComposing")),primary:2051}})),Vu(new Zae({id:"cancelRenameInput",precondition:Vae,handler:e=>e.cancelRenameInput(),kbOpts:{weight:199,kbExpr:Xu.focus,primary:9,secondary:[1033]}})),wu(class extends bu{constructor(){super({id:"focusNextRenameSuggestion",title:{...x(1374,"Focus Next Rename Suggestion")},precondition:Vae,keybinding:[{primary:18,weight:199}]})}run(e){const t=e.get(sc).getFocusedCodeEditor();if(!t)return;const i=Gae.get(t);i&&i.focusNextRenameSuggestion()}}),wu(class extends bu{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...x(1375,"Focus Previous Rename Suggestion")},precondition:Vae,keybinding:[{primary:16,weight:199}]})}run(e){const t=e.get(sc).getFocusedCodeEditor();if(!t)return;const i=Gae.get(t);i&&i.focusPreviousRenameSuggestion()}}),Wu("_executeDocumentRenameProvider",(function(e,t,i,...n){const[o]=n;_t("string"==typeof o);const{renameProvider:s}=e.get(BD);return async function(e,t,i,n){const o=new $ae(t,i,e),s=await o.resolveRenameLocation(oi.None);return s?.rejectReason?{edits:[],rejectReason:s.rejectReason}:o.provideRenameEdits(n,oi.None)}(s,t,i,o)})),Wu("_executePrepareRename",(async function(e,t,i){const{renameProvider:n}=e.get(BD),o=new $ae(t,i,n),s=await o.resolveRenameLocation(oi.None);if(s?.rejectReason)throw new Error(s.rejectReason);return s})),ru.as(kp).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:6,description:y(1372,"Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var Yae=function(e,t){return function(i,n){t(i,n,e)}};let Qae=class extends At{static{this.ID="editor.sectionHeaderDetector"}constructor(e,t,i){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=i,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(81)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel((t=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0)}))),this._register(e.onDidChangeModelLanguage((t=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0)}))),this._register(t.onDidChange((t=>{const i=this.editor.getModel()?.getLanguageId();i&&t.affects(i)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0))}))),this._register(e.onDidChangeConfiguration((t=>{this.options&&!t.hasChanged(81)||(this.options=this.createOptions(e.getOption(81)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))}))),this._register(this.editor.onDidChangeModelContent((e=>{this.computeSectionHeaders.schedule()}))),this._register(e.onDidChangeModelTokens((e=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)}))),this.computeSectionHeaders=this._register(new Ci((()=>{this.findSectionHeaders()}),250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;const t=this.editor.getModel().getLanguageId();if(!t)return;const i=this.languageConfigurationService.getLanguageConfiguration(t).comments,n=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;return i||n?.markers?{foldingRules:n,markSectionHeaderRegex:e.markSectionHeaderRegex,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}:void 0}findSectionHeaders(){if(!this.editor.hasModel()||!this.options?.findMarkSectionHeaders&&!this.options?.findRegionSectionHeaders)return;const e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;const t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then((i=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(i)}))}updateDecorations(e){const t=this.editor.getModel();t&&(e=e.filter((e=>{if(!e.shouldBeInComments)return!0;const i=t.validateRange(e.range),n=t.tokenization.getLineTokens(i.startLineNumber),o=n.findTokenIndexAtOffset(i.startColumn-1),s=n.getStandardTokenType(o);return n.getLanguageId(o)===t.getLanguageId()&&1===s})));const i=Object.values(this.currentOccurrences).map((e=>e.decorationId)),n=e.map((e=>function(e){return{range:e.range,options:bk.createDynamic({description:"section-header",stickiness:3,collapseOnReplaceEdit:!0,minimap:{color:void 0,position:1,sectionHeaderStyle:e.hasSeparatorLine?2:1,sectionHeaderText:e.text}})}}(e)));this.editor.changeDecorations((t=>{const o=t.deltaDecorations(i,n);this.currentOccurrences={};for(let t=0,i=o.length;t<i;t++){const i={sectionHeader:e[t],decorationId:o[t]};this.currentOccurrences[i.decorationId]=i}}))}stop(){this.computeSectionHeaders.cancel(),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop(),this.decorations.clear()}};Qae=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Yae(1,Qp),Yae(2,Xq)],Qae),Uu(Qae.ID,Qae,1);class Xae{constructor(e=5){this.timesPerSecond=e,this._lastRun=0,this._minimumTimeBetweenRuns=1e3/e}runIfNotLimited(e){const t=Date.now();t-this._lastRun>=this._minimumTimeBetweenRuns&&(this._lastRun=t,e())}}class Jae{static create(e,t){return new Jae(e,new ele(t))}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._endLineNumber}constructor(e,t){this._startLineNumber=e,this._tokens=t,this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}toString(){return this._tokens.toString(this._startLineNumber)}_updateEndLineNumber(){this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}isEmpty(){return this._tokens.isEmpty()}getLineTokens(e){return this._startLineNumber<=e&&e<=this._endLineNumber?this._tokens.getLineTokens(e-this._startLineNumber):null}getRange(){const e=this._tokens.getRange();return e?new Yu(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn):e}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,i,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber,[n,o,s]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new Jae(this._startLineNumber,n),new Jae(this._startLineNumber+s,o)]}applyEdit(e,t){const[i,n,o]=Dg(t);this.acceptEdit(e,i,n,o,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,i,n,o){this._acceptDeleteRange(e),this._acceptInsertText(new rc(e.startLineNumber,e.startColumn),t,i,n,o),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;if(i<0){const e=i-t;return void(this._startLineNumber-=e)}const n=this._tokens.getMaxDeltaLine();if(!(t>=n+1)){if(t<0&&i>=n+1)return this._startLineNumber=0,void this._tokens.clear();if(t<0){const n=-t;this._startLineNumber-=n,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,n,o){if(0===t&&0===i)return;const s=e.lineNumber-this._startLineNumber;s<0?this._startLineNumber+=t:s>=this._tokens.getMaxDeltaLine()+1||this._tokens.acceptInsertText(s,e.column-1,t,i,n,o)}reportIfInvalid(e){this._tokens.reportIfInvalid(e,this._startLineNumber)}}class ele{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;i<this._tokenCount;i++)t.push(`(${this._getDeltaLine(i)+e},${this._getStartCharacter(i)}-${this._getEndCharacter(i)})`);return`[${t.join(",")}]`}getMaxDeltaLine(){const e=this._getTokenCount();return 0===e?-1:this._getDeltaLine(e-1)}getRange(){const e=this._getTokenCount();if(0===e)return null;const t=this._getStartCharacter(0),i=this._getDeltaLine(e-1),n=this._getEndCharacter(e-1);return new Yu(0,t+1,i,n+1)}_getTokenCount(){return this._tokenCount}_getDeltaLine(e){return this._tokens[4*e]}_getStartCharacter(e){return this._tokens[4*e+1]}_getEndCharacter(e){return this._tokens[4*e+2]}isEmpty(){return 0===this._getTokenCount()}getLineTokens(e){let t=0,i=this._getTokenCount()-1;for(;t<i;){const n=t+Math.floor((i-t)/2),o=this._getDeltaLine(n);if(o<e)t=n+1;else{if(!(o>e)){let o=n;for(;o>t&&this._getDeltaLine(o-1)===e;)o--;let s=n;for(;s<i&&this._getDeltaLine(s+1)===e;)s++;return new tle(this._tokens.subarray(4*o,4*s+4))}i=n-1}}return this._getDeltaLine(t)===e?new tle(this._tokens.subarray(4*t,4*t+4)):null}clear(){this._tokenCount=0}removeTokens(e,t,i,n){const o=this._tokens,s=this._tokenCount;let r=0,a=!1,l=0;for(let d=0;d<s;d++){const s=4*d,h=o[s],c=o[s+1],u=o[s+2],g=o[s+3];if((h>e||h===e&&u>=t)&&(h<i||h===i&&c<=n))a=!0;else{if(0===r&&(l=h),a){const e=4*r;o[e]=h-l,o[e+1]=c,o[e+2]=u,o[e+3]=g}r++}}return this._tokenCount=r,l}split(e,t,i,n){const o=this._tokens,s=this._tokenCount,r=[],a=[];let l=r,d=0,h=0;for(let r=0;r<s;r++){const s=4*r,c=o[s],u=o[s+1],g=o[s+2],p=o[s+3];if(c>e||c===e&&g>=t){if(c<i||c===i&&u<=n)continue;l!==a&&(l=a,d=0,h=c)}l[d++]=c-h,l[d++]=u,l[d++]=g,l[d++]=p}return[new ele(new Uint32Array(r)),new ele(new Uint32Array(a)),h]}acceptDeleteRange(e,t,i,n,o){const s=this._tokens,r=this._tokenCount,a=n-t;let l=0,d=!1;for(let h=0;h<r;h++){const c=4*h;let u=s[c],g=s[c+1],p=s[c+2];const m=s[c+3];if(u<t||u===t&&p<=i){l++;continue}if(u===t&&g<i)u===n&&p>o?p-=o-i:p=i;else if(u===t&&g===i){if(!(u===n&&p>o)){d=!0;continue}p-=o-i}else if(u<n||u===n&&g<o){if(!(u===n&&p>o)){d=!0;continue}u=t,g=i,p=g+(p-o)}else if(u>n){if(0===a&&!d){l=r;break}u-=a}else{if(!(u===n&&g>=o))throw new Error("Not possible!");e&&0===u&&(g+=e,p+=e),u-=a,g-=o-i,p-=o-i}const f=4*l;s[f]=u,s[f+1]=g,s[f+2]=p,s[f+3]=m,l++}this._tokenCount=l}acceptInsertText(e,t,i,n,o,s){const r=0===i&&1===n&&(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122),a=this._tokens,l=this._tokenCount;for(let s=0;s<l;s++){const l=4*s;let d=a[l],h=a[l+1],c=a[l+2];if(!(d<e||d===e&&c<t)){if(d===e&&c===t){if(!r)continue;c+=1}else if(d===e&&h<t&&t<c)0===i?c+=n:c=t;else{if(d===e&&h===t&&r)continue;if(d===e)if(d+=i,0===i)h+=n,c+=n;else{const e=c-h;h=o+(h-t),c=h+e}else d+=i}a[l]=d,a[l+1]=h,a[l+2]=c}}}static{this._rateLimiter=new Xae(10/60)}reportIfInvalid(e,t){for(let i=0;i<this._tokenCount;i++){const n=this._getDeltaLine(i)+t;n<1?ele._rateLimiter.runIfNotLimited((()=>{console.error("Invalid Semantic Tokens Data From Extension: lineNumber < 1")})):n>e.getLineCount()?ele._rateLimiter.runIfNotLimited((()=>{console.error("Invalid Semantic Tokens Data From Extension: lineNumber > model.getLineCount()")})):this._getEndCharacter(i)>e.getLineLength(n)&&ele._rateLimiter.runIfNotLimited((()=>{console.error("Invalid Semantic Tokens Data From Extension: end character > model.getLineLength(lineNumber)")}))}}}class tle{constructor(e){this._tokens=e}getCount(){return this._tokens.length/4}getStartCharacter(e){return this._tokens[4*e+1]}getEndCharacter(e){return this._tokens[4*e+2]}getMetadata(e){return this._tokens[4*e+3]}}var ile=function(e,t){return function(i,n){t(i,n,e)}};let nle=class{constructor(e,t,i,n){this._legend=e,this._themeService=t,this._languageService=i,this._logService=n,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new rle}getMetadata(e,t,i){const n=this._languageService.languageIdCodec.encodeLanguageId(i),o=this._hashTable.get(e,t,n);let s;if(o)s=o.metadata;else{let o=this._legend.tokenTypes[e];const r=[];if(o){let e=t;for(let t=0;e>0&&t<this._legend.tokenModifiers.length;t++)1&e&&r.push(this._legend.tokenModifiers[t]),e>>=1;const n=this._themeService.getColorTheme().getTokenStyleMetadata(o,r,i);void 0===n?s=2147483647:(s=0,void 0!==n.italic&&(s|=1|(n.italic?1:0)<<11),void 0!==n.bold&&(s|=2|(n.bold?2:0)<<11),void 0!==n.underline&&(s|=4|(n.underline?4:0)<<11),void 0!==n.strikethrough&&(s|=8|(n.strikethrough?8:0)<<11),n.foreground&&(s|=16|n.foreground<<15),0===s&&(s=2147483647))}else s=2147483647,o="not-in-legend";this._hashTable.add(e,t,n,s)}return s}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,this._logService.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,this._logService.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,n,o){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,this._logService.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${n} is outside the previous data (length ${o}).`))}};function ole(e,t,i){const n=e.data,o=e.data.length/5|0,s=Math.max(Math.ceil(o/1024),400),r=[];let a=0,l=1,d=0;for(;a<o;){const e=a;let h=Math.min(e+s,o);if(h<o){let t=h;for(;t-1>e&&0===n[5*t];)t--;if(t-1===e){let e=h;for(;e+1<o&&0===n[5*e];)e++;h=e}else h=t}let c=new Uint32Array(4*(h-e)),u=0,g=0,p=0,m=0;for(;a<h;){const e=5*a,o=n[e],s=n[e+1],r=l+o|0,h=0===o?d+s|0:s,f=h+n[e+2]|0,_=n[e+3],v=n[e+4];if(f<=h)t.warnInvalidLengthSemanticTokens(r,h+1);else if(p===r&&m>h)t.warnOverlappingSemanticTokens(r,h+1);else{const e=t.getMetadata(_,v,i);2147483647!==e&&(0===g&&(g=r),c[u]=r-g,c[u+1]=h,c[u+2]=f,c[u+3]=e,u+=4,p=r,m=f)}l=r,d=h,a++}u!==c.length&&(c=c.subarray(0,u));const f=Jae.create(g,c);r.push(f)}return r}nle=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([ile(1,sw),ile(2,Tg),ile(3,yu)],nle);class sle{constructor(e,t,i,n){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=n,this.next=null}}class rle{static{this._SIZES=[3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143]}constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=rle._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<rle._SIZES.length?2/3*this._currentLength:0),this._elements=[],rle._nullOutEntries(this._elements,this._currentLength)}static _nullOutEntries(e,t){for(let i=0;i<t;i++)e[i]=null}_hash2(e,t){return(e<<5)-e+t|0}_hashFunc(e,t,i){return this._hash2(this._hash2(e,t),i)%this._currentLength}get(e,t,i){const n=this._hashFunc(e,t,i);let o=this._elements[n];for(;o;){if(o.tokenTypeIndex===e&&o.tokenModifierSet===t&&o.languageId===i)return o;o=o.next}return null}add(e,t,i,n){if(this._elementsCount++,0!==this._growCount&&this._elementsCount>=this._growCount){const e=this._elements;this._currentLengthIndex++,this._currentLength=rle._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<rle._SIZES.length?2/3*this._currentLength:0),this._elements=[],rle._nullOutEntries(this._elements,this._currentLength);for(const t of e){let e=t;for(;e;){const t=e.next;e.next=null,this._add(e),e=t}}}this._add(new sle(e,t,i,n))}_add(e){const t=this._hashFunc(e.tokenTypeIndex,e.tokenModifierSet,e.languageId);e.next=this._elements[t],this._elements[t]=e}}const ale=oc("semanticTokensStylingService");function lle(e){const t=new Uint32Array(function(e){let t=0;if(t+=2,"full"===e.type)t+=1+e.data.length;else{t+=1,t+=3*e.deltas.length;for(const i of e.deltas)i.data&&(t+=i.data.length)}return t}(e));let i=0;if(t[i++]=e.id,"full"===e.type)t[i++]=1,t[i++]=e.data.length,t.set(e.data,i),i+=e.data.length;else{t[i++]=2,t[i++]=e.deltas.length;for(const n of e.deltas)t[i++]=n.start,t[i++]=n.deleteCount,n.data?(t[i++]=n.data.length,t.set(n.data,i),i+=n.data.length):t[i++]=0}return function(e){const t=new Uint8Array(e.buffer,e.byteOffset,4*e.length);return le()||function(e){for(let t=0,i=e.length;t<i;t+=4){const i=e[t+0],n=e[t+1],o=e[t+2],s=e[t+3];e[t+0]=s,e[t+1]=o,e[t+2]=n,e[t+3]=i}}(t),Mo.wrap(t)}(t)}function dle(e){return e&&!!e.data}function hle(e){return e&&Array.isArray(e.edits)}class cle{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function ule(e,t){return e.has(t)}async function gle(e,t,i,n,o){const s=function(e,t){const i=e.orderedGroups(t);return i.length>0?i[0]:[]}(e,t),r=await Promise.all(s.map((async e=>{let s,r=null;try{s=await e.provideDocumentSemanticTokens(t,e===i?n:null,o)}catch(e){r=e,s=null}return s&&(dle(s)||hle(s))||(s=null),new cle(e,s,r)})));for(const e of r){if(e.error)throw e.error;if(e.tokens)return e}return r.length>0?r[0]:null}class ple{constructor(e,t){this.provider=e,this.tokens=t}}function mle(e,t){const i=e.orderedGroups(t);return i.length>0?i[0]:[]}async function fle(e,t,i,n){const o=mle(e,t),s=await Promise.all(o.map((async e=>{let o;try{o=await e.provideDocumentRangeSemanticTokens(t,i,n)}catch(e){Te(e),o=null}return o&&dle(o)||(o=null),new ple(e,o)})));for(const e of s)if(e.tokens)return e;return s.length>0?s[0]:null}fc.registerCommand("_provideDocumentSemanticTokensLegend",(async(e,...t)=>{const[i]=t;_t(i instanceof uo);const n=e.get(ac).getModel(i);if(!n)return;const{documentSemanticTokensProvider:o}=e.get(BD),s=function(e,t){const i=e.orderedGroups(t);return i.length>0?i[0]:null}(o,n);return s?s[0].getLegend():e.get(mc).executeCommand("_provideDocumentRangeSemanticTokensLegend",i)})),fc.registerCommand("_provideDocumentSemanticTokens",(async(e,...t)=>{const[i]=t;_t(i instanceof uo);const n=e.get(ac).getModel(i);if(!n)return;const{documentSemanticTokensProvider:o}=e.get(BD);if(!ule(o,n))return e.get(mc).executeCommand("_provideDocumentRangeSemanticTokens",i,n.getFullModelRange());const s=await gle(o,n,null,null,oi.None);if(!s)return;const{provider:r,tokens:a}=s;if(!a||!dle(a))return;const l=lle({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),l})),fc.registerCommand("_provideDocumentRangeSemanticTokensLegend",(async(e,...t)=>{const[i,n]=t;_t(i instanceof uo);const o=e.get(ac).getModel(i);if(!o)return;const{documentRangeSemanticTokensProvider:s}=e.get(BD),r=mle(s,o);if(0===r.length)return;if(1===r.length)return r[0].getLegend();if(!n||!Yu.isIRange(n))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),r[0].getLegend();const a=await fle(s,o,Yu.lift(n),oi.None);return a?a.provider.getLegend():void 0})),fc.registerCommand("_provideDocumentRangeSemanticTokens",(async(e,...t)=>{const[i,n]=t;_t(i instanceof uo),_t(Yu.isIRange(n));const o=e.get(ac).getModel(i);if(!o)return;const{documentRangeSemanticTokensProvider:s}=e.get(BD),r=await fle(s,o,Yu.lift(n),oi.None);return r&&r.tokens?lle({id:0,type:"full",data:r.tokens.data}):void 0}));const _le="editor.semanticHighlighting";function vle(e,t,i){const n=i.getValue(_le,{overrideIdentifier:e.getLanguageId(),resource:e.uri})?.enabled;return"boolean"==typeof n?n:t.getColorTheme().semanticHighlighting}var ble,wle=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Cle=function(e,t){return function(i,n){t(i,n,e)}};let yle=class extends At{constructor(e,t,i,n,o,s){super(),this._watchers=new nd;const r=t=>{this._watchers.get(t.uri)?.dispose(),this._watchers.set(t.uri,new Sle(t,e,i,o,s))},a=(e,t)=>{t.dispose(),this._watchers.delete(e.uri)},l=()=>{for(const e of t.getModels()){const t=this._watchers.get(e.uri);vle(e,i,n)?t||r(e):t&&a(e,t)}};t.getModels().forEach((e=>{vle(e,i,n)&&r(e)})),this._register(t.onModelAdded((e=>{vle(e,i,n)&&r(e)}))),this._register(t.onModelRemoved((e=>{const t=this._watchers.get(e.uri);t&&a(e,t)}))),this._register(n.onDidChangeConfiguration((e=>{e.affectsConfiguration(_le)&&l()}))),this._register(i.onDidColorThemeChange(l))}dispose(){Et(this._watchers.values()),this._watchers.clear(),super.dispose()}};yle=wle([Cle(0,ale),Cle(1,ac),Cle(2,sw),Cle(3,up),Cle(4,Bq),Cle(5,BD)],yle);let Sle=class extends At{static{ble=this}static{this.REQUEST_MIN_DELAY=300}static{this.REQUEST_MAX_DELAY=2e3}constructor(e,t,i,n,o){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=o.documentSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentSemanticTokens",{min:ble.REQUEST_MIN_DELAY,max:ble.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new Ci((()=>this._fetchDocumentSemanticTokensNow()),ble.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent((()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))}))),this._register(this._model.onDidChangeAttached((()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))}))),this._register(this._model.onDidChangeLanguage((()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)})));const s=()=>{Et(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const t of this._provider.all(e))"function"==typeof t.onDidChange&&this._documentProvidersChangeListeners.push(t.onDidChange((()=>{this._currentDocumentRequestCancellationTokenSource?this._providersChangedDuringRequest=!0:this._fetchDocumentSemanticTokens.schedule(0)})))};s(),this._register(this._provider.onDidChange((()=>{s(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))}))),this._register(i.onDidColorThemeChange((e=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))}))),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),Et(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!ule(this._provider,this._model))return void(this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1));if(!this._model.isAttachedToEditor())return;const e=new ri,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=gle(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const o=[],s=this._model.onDidChangeContent((e=>{o.push(e)})),r=new Ht(!1);n.then((e=>{if(this._debounceInformation.update(this._model,r.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),e){const{provider:t,tokens:i}=e,n=this._semanticTokensStylingService.getStyling(t);this._setDocumentSemanticTokens(t,i||null,n,o)}else this._setDocumentSemanticTokens(null,null,null,o)}),(e=>{e&&(Re(e)||"string"==typeof e.message&&-1!==e.message.indexOf("busy"))||Ie(e),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),(o.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))}))}static _copy(e,t,i,n,o){o=Math.min(o,i.length-n,e.length-t);for(let s=0;s<o;s++)i[n+s]=e[t+s]}_setDocumentSemanticTokens(e,t,i,n){const o=this._currentDocumentResponse,s=()=>{(n.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed)e&&t&&e.releaseDocumentSemanticTokens(t.resultId);else if(e&&i){if(!t)return this._model.tokenization.setSemanticTokens(null,!0),void s();if(hle(t)){if(!o)return void this._model.tokenization.setSemanticTokens(null,!0);if(0===t.edits.length)t={resultId:t.resultId,data:o.data};else{let e=0;for(const i of t.edits)e+=(i.data?i.data.length:0)-i.deleteCount;const n=o.data,s=new Uint32Array(n.length+e);let r=n.length,a=s.length;for(let e=t.edits.length-1;e>=0;e--){const l=t.edits[e];if(l.start>n.length)return i.warnInvalidEditStart(o.resultId,t.resultId,e,l.start,n.length),void this._model.tokenization.setSemanticTokens(null,!0);const d=r-(l.start+l.deleteCount);d>0&&(ble._copy(n,r-d,s,a-d,d),a-=d),l.data&&(ble._copy(l.data,0,s,a-l.data.length,l.data.length),a-=l.data.length),r=l.start}r>0&&ble._copy(n,0,s,0,r),t={resultId:t.resultId,data:s}}}if(dle(t)){this._currentDocumentResponse=new xle(e,t.resultId,t.data);const o=ole(t,i,this._model.getLanguageId());if(n.length>0)for(const e of n)for(const t of o)for(const i of e.changes)t.applyEdit(i.range,i.text);this._model.tokenization.setSemanticTokens(o,!0)}else this._model.tokenization.setSemanticTokens(null,!0);s()}else this._model.tokenization.setSemanticTokens(null,!1)}};Sle=ble=wle([Cle(1,ale),Cle(2,sw),Cle(3,Bq),Cle(4,BD)],Sle);class xle{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}qq(yle);var kle=function(e,t){return function(i,n){t(i,n,e)}};let Lle=class extends At{static{this.ID="editor.contrib.viewportSemanticTokens"}constructor(e,t,i,n,o,s){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=s.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new Ci((()=>this._tokenizeViewportNow()),100)),this._outstandingRequests=[];const r=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange((()=>{r()}))),this._register(this._editor.onDidChangeModel((()=>{this._cancelAll(),r()}))),this._register(this._editor.onDidChangeModelContent((e=>{this._cancelAll(),r()}))),this._register(this._provider.onDidChange((()=>{this._cancelAll(),r()}))),this._register(this._configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration(_le)&&(this._cancelAll(),r())}))),this._register(this._themeService.onDidColorThemeChange((()=>{this._cancelAll(),r()}))),r()}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;t<i;t++)if(this._outstandingRequests[t]===e)return void this._outstandingRequests.splice(t,1)}_tokenizeViewportNow(){if(!this._editor.hasModel())return;const e=this._editor.getModel();if(e.tokenization.hasCompleteSemanticTokens())return;if(!vle(e,this._themeService,this._configurationService))return void(e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1));if(!function(e,t){return e.has(t)}(this._provider,e))return void(e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1));const t=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(t.map((t=>this._requestRange(e,t))))}_requestRange(e,t){const i=e.getVersionId(),n=hi((i=>Promise.resolve(fle(this._provider,e,t,i)))),o=new Ht(!1);return n.then((n=>{if(this._debounceInformation.update(e,o.elapsed()),!n||!n.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:s,tokens:r}=n,a=this._semanticTokensStylingService.getStyling(s);e.tokenization.setPartialSemanticTokens(t,ole(r,a,e.getLanguageId()))})).then((()=>this._removeOutstandingRequest(n)),(()=>this._removeOutstandingRequest(n))),n}};Lle=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([kle(1,ale),kle(2,sw),kle(3,up),kle(4,Bq),kle(5,BD)],Lle),Uu(Lle.ID,Lle,1);class Dle{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const n of t){const t=[];i.push(t),this.selectSubwords&&this._addInWordRanges(t,e,n),this._addWordRanges(t,e,n),this._addWhitespaceLine(t,e,n),t.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:o,startColumn:s}=n,r=i.column-s;let a=r,l=r,d=0;for(;a>=0;a--){const e=o.charCodeAt(a);if(a!==r&&(95===e||45===e))break;if(tn(e)&&nn(d))break;d=e}for(a+=1;l<o.length;l++){const e=o.charCodeAt(l);if(nn(e)&&tn(d))break;if(95===e||45===e)break;d=e}a<l&&e.push({range:new Yu(i.lineNumber,s+a,i.lineNumber,s+l)})}_addWordRanges(e,t,i){const n=t.getWordAtPosition(i);n&&e.push({range:new Yu(i.lineNumber,n.startColumn,i.lineNumber,n.endColumn)})}_addWhitespaceLine(e,t,i){t.getLineLength(i.lineNumber)>0&&0===t.getLineFirstNonWhitespaceColumn(i.lineNumber)&&0===t.getLineLastNonWhitespaceColumn(i.lineNumber)&&e.push({range:new Yu(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var Ele;class Nle{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new Nle(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}let Ile=class{static{Ele=this}static{this.ID="editor.contrib.smartSelectController"}static get(e){return e.getContribution(Ele.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){this._selectionListener?.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await Mle(this._languageFeaturesService.selectionRangeProvider,i,t.map((e=>e.getPosition())),this._editor.getOption(129),oi.None).then((e=>{if(hs(e)&&e.length===t.length&&this._editor.hasModel()&&es(this._editor.getSelections(),t,((e,t)=>e.equalsSelection(t)))){for(let i=0;i<e.length;i++)e[i]=e[i].filter((e=>e.containsPosition(t[i].getStartPosition())&&e.containsPosition(t[i].getEndPosition()))),e[i].unshift(t[i]);this._state=e.map((e=>new Nle(0,e))),this._selectionListener?.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition((()=>{this._ignoreSelection||(this._selectionListener?.dispose(),this._state=void 0)}))}})),!this._state)return;this._state=this._state.map((t=>t.mov(e)));const n=this._state.map((e=>Qu.fromPositions(e.ranges[e.index].getStartPosition(),e.ranges[e.index].getEndPosition())));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}}};Ile=Ele=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,BD)],Ile);class Tle extends Pu{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=Ile.get(t);i&&await i.run(this._forward)}}async function Mle(e,t,i,n,o){const s=e.all(t).concat(new Dle(n.selectSubwords));1===s.length&&s.unshift(new aie);const r=[],a=[];for(const e of s)r.push(Promise.resolve(e.provideSelectionRanges(t,i,o)).then((e=>{if(hs(e)&&e.length===i.length)for(let t=0;t<i.length;t++){a[t]||(a[t]=[]);for(const n of e[t])Yu.isIRange(n.range)&&Yu.containsPosition(n.range,i[t])&&a[t].push(Yu.lift(n.range))}}),Te));return await Promise.all(r),a.map((e=>{if(0===e.length)return[];e.sort(((e,t)=>rc.isBefore(e.getStartPosition(),t.getStartPosition())?1:rc.isBefore(t.getStartPosition(),e.getStartPosition())||rc.isBefore(e.getEndPosition(),t.getEndPosition())?-1:rc.isBefore(t.getEndPosition(),e.getEndPosition())?1:0));const i=[];let o;for(const t of e)(!o||Yu.containsRange(t,o)&&!Yu.equalsRange(t,o))&&(i.push(t),o=t);if(!n.selectLeadingAndTrailingWhitespace)return i;const s=[i[0]];for(let e=1;e<i.length;e++){const n=i[e-1],o=i[e];if(o.startLineNumber!==n.startLineNumber||o.endLineNumber!==n.endLineNumber){const e=new Yu(n.startLineNumber,t.getLineFirstNonWhitespaceColumn(n.startLineNumber),n.endLineNumber,t.getLineLastNonWhitespaceColumn(n.endLineNumber));e.containsRange(n)&&!e.equalsRange(n)&&o.containsRange(e)&&!o.equalsRange(e)&&s.push(e);const i=new Yu(n.startLineNumber,1,n.endLineNumber,t.getLineMaxColumn(n.endLineNumber));i.containsRange(n)&&!i.equalsRange(e)&&o.containsRange(i)&&!o.equalsRange(i)&&s.push(i)}s.push(o)}return s}))}fc.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand"),Uu(Ile.ID,Ile,4),Hu(class extends Tle{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:x(1385,"Expand Selection"),precondition:void 0,kbOpts:{kbExpr:Xu.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:gu.MenubarSelectionMenu,group:"1_basic",title:y(1383,"&&Expand Selection"),order:2}})}}),Hu(class extends Tle{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:x(1386,"Shrink Selection"),precondition:void 0,kbOpts:{kbExpr:Xu.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:gu.MenubarSelectionMenu,group:"1_basic",title:y(1384,"&&Shrink Selection"),order:3}})}}),fc.registerCommand("_executeSelectionRangeProvider",(async function(e,...t){const[i,n]=t;_t(uo.isUri(i));const o=e.get(BD).selectionRangeProvider,s=await e.get(lc).createModelReference(i);try{return Mle(o,s.object.textEditorModel,n,{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},oi.None)}finally{s.dispose()}}));const Ale=Object.freeze({View:x(1623,"View"),Help:x(1624,"Help"),Test:x(1625,"Test"),File:x(1626,"File"),Preferences:x(1627,"Preferences"),Developer:x(1628,"Developer")}),Rle=100;Uu(Une.ID,Une,1),wu(class extends Bu{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...x(1433,"Toggle Editor Sticky Scroll"),mnemonicTitle:y(1429,"&&Toggle Editor Sticky Scroll")},metadata:{description:x(1434,"Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:Ale.View,toggled:{condition:Ac.equals("config.editor.stickyScroll.enabled",!0),title:y(1430,"Sticky Scroll"),mnemonicTitle:y(1431,"&&Sticky Scroll")},menu:[{id:gu.CommandPalette},{id:gu.MenubarAppearanceMenu,group:"4_editor",order:3},{id:gu.StickyScrollContext}]})}async runEditorCommand(e,t){const i=e.get(up),n=!i.getValue("editor.stickyScroll.enabled"),o=Une.get(t)?.isFocused();i.updateValue("editor.stickyScroll.enabled",n),o&&t.focus()}}),wu(class extends Bu{constructor(){super({id:"editor.action.focusStickyScroll",title:{...x(1435,"Focus Editor Sticky Scroll"),mnemonicTitle:y(1432,"&&Focus Editor Sticky Scroll")},precondition:Ac.and(Ac.has("config.editor.stickyScroll.enabled"),Xu.stickyScrollVisible),menu:[{id:gu.CommandPalette}]})}runEditorCommand(e,t){Une.get(t)?.focus()}}),wu(class extends Bu{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:x(1437,"Select the previous sticky scroll line"),precondition:Xu.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Rle,primary:16}})}runEditorCommand(e,t){Une.get(t)?.focusPrevious()}}),wu(class extends Bu{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:x(1436,"Select the next editor sticky scroll line"),precondition:Xu.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Rle,primary:18}})}runEditorCommand(e,t){Une.get(t)?.focusNext()}}),wu(class extends Bu{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:x(1438,"Go to the focused sticky scroll line"),precondition:Xu.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Rle,primary:3}})}runEditorCommand(e,t){Une.get(t)?.goToFocused()}}),wu(class extends Bu{constructor(){super({id:"editor.action.selectEditor",title:x(1439,"Select Editor"),precondition:Xu.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Rle,primary:9}})}runEditorCommand(e,t){Une.get(t)?.selectEditor()}});var Ole=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Ple=function(e,t){return function(i,n){t(i,n,e)}};class Fle{constructor(e,t,i,n,o,s,r){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=o,this.action=s,this.completion=r}}let Ble=class extends Ot{constructor(e,t,i,n,o,s){super(o.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=n,this._suggestMemoryService=s}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn<i.endColumn&&0===this.completionModel.getIncompleteProvider().size}get items(){const e=[],{items:t}=this.completionModel,i=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},t),n=Ct.slice(t,i),o=Ct.slice(t,0,i);let s=5;for(const t of Ct.concat(n,o)){if(t.score===ah.Default)continue;const i=new Yu(t.editStart.lineNumber,t.editStart.column,t.editInsertEnd.lineNumber,t.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),n=t.completion.insertTextRules&&4&t.completion.insertTextRules?{snippet:t.completion.insertText}:t.completion.insertText;e.push(new Fle(i,n,t.filterTextLow??t.labelLow,t.completion.additionalTextEdits,t.completion.command,t.completion.action,t)),s-- >=0&&t.resolve(oi.None)}return e}};Ble=Ole([Ple(5,tie)],Ble);let Wle=class extends At{constructor(e,t,i,n){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=i,this._editorService=n,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,i,n){if(i.selectedSuggestionInfo)return;let o;for(const t of this._editorService.listCodeEditors())if(t.getModel()===e){o=t;break}if(!o)return;const s=o.getOption(102);if(X8.isAllOff(s))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const r=e.tokenization.getLineTokens(t.lineNumber),a=r.getStandardTokenType(r.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if("inline"!==X8.valueFor(s,a))return;let l,d,h=e.getWordAtPosition(t);if(h?.word||(l=this._getTriggerCharacterInfo(e,t)),!h?.word&&!l)return;if(h||(h=e.getWordUntilPosition(t)),h.endColumn!==t.column)return;const c=e.getValueInRange(new Yu(t.lineNumber,1,t.lineNumber,t.column));if(!l&&this._lastResult?.canBeReused(e,t.lineNumber,h)){const e=new die(c,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=e,this._lastResult.acquire(),d=this._lastResult}else{const i=await Z8(this._languageFeatureService.completionProvider,e,t,new $8(void 0,pie.createSuggestFilter(o).itemKind,l?.providers),l&&{triggerKind:1,triggerCharacter:l.ch},n);let s;i.needsClipboard&&(s=await this._clipboardService.readText());const r=new hie(i.items,t.column,new die(c,0),lie.None,o.getOption(134),o.getOption(128),{boostFullMatch:!1,firstMatchCanBeWeak:!1},s);d=new Ble(e,t.lineNumber,h,r,i,this._suggestMemoryService)}return this._lastResult=d,d}handleItemDidShow(e,t){t.completion.resolve(oi.None)}disposeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){const i=e.getValueInRange(Yu.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),n=new Set;for(const t of this._languageFeatureService.completionProvider.all(e))t.triggerCharacters?.includes(i)&&n.add(t);if(0!==n.size)return{providers:n,ch:i}}};Wle=Ole([Ple(0,BD),Ple(1,oD),Ple(2,tie),Ple(3,sc)],Wle),qq(Wle);class Vle{constructor(e,t,i,n,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=o}}const Hle=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;class zle{constructor(){this._lastColorId=0,this._id2color=[],this._color2id=new Map}getId(e){if(null===e)return 0;const t=e.match(Hle);if(!t)throw new Error("Illegal value for token color: "+e);e=t[1].toUpperCase();let i=this._color2id.get(e);return i||(i=++this._lastColorId,this._color2id.set(e,i),this._id2color[i]=Lg.fromHex("#"+e),i)}getColorMap(){return this._id2color.slice(0)}}class Ule{static createFromRawTokenTheme(e,t){return this.createFromParsedTokenTheme(function(e){if(!e||!Array.isArray(e))return[];const t=[];let i=0;for(let n=0,o=e.length;n<o;n++){const o=e[n];let s=-1;if("string"==typeof o.fontStyle){s=0;const e=o.fontStyle.split(" ");for(let t=0,i=e.length;t<i;t++)switch(e[t]){case"italic":s|=1;break;case"bold":s|=2;break;case"underline":s|=4;break;case"strikethrough":s|=8}}let r=null;"string"==typeof o.foreground&&(r=o.foreground);let a=null;"string"==typeof o.background&&(a=o.background),t[i++]=new Vle(o.token||"",n,s,r,a)}return t}(e),t)}static createFromParsedTokenTheme(e,t){return function(e,t){e.sort(((e,t)=>{const i=function(e,t){return e<t?-1:e>t?1:0}(e.token,t.token);return 0!==i?i:e.index-t.index}));let i=0,n="000000",o="ffffff";for(;e.length>=1&&""===e[0].token;){const t=e.shift();-1!==t.fontStyle&&(i=t.fontStyle),null!==t.foreground&&(n=t.foreground),null!==t.background&&(o=t.background)}const s=new zle;for(const e of t)s.getId(e);const r=s.getId(n),a=s.getId(o),l=new jle(i,r,a),d=new qle(l);for(let t=0,i=e.length;t<i;t++){const i=e[t];d.insert(i.token,i.fontStyle,s.getId(i.foreground),s.getId(i.background))}return new Ule(s,d)}(e,t)}constructor(e,t){this._colorMap=e,this._root=t,this._cache=new Map}getColorMap(){return this._colorMap.getColorMap()}_match(e){return this._root.match(e)}match(e,t){let i=this._cache.get(t);if(void 0===i){const e=this._match(t),n=function(e){const t=e.match(Kle);if(!t)return 0;switch(t[1]){case"comment":return 1;case"string":return 2;case"regex":case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}(t);i=(e.metadata|n<<8)>>>0,this._cache.set(t,i)}return(i|e)>>>0}}const Kle=/\b(comment|string|regex|regexp)\b/;class jle{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new jle(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){-1!==e&&(this._fontStyle=e),0!==t&&(this._foreground=t),0!==i&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class qle{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(""===e)return this._mainRule;const t=e.indexOf(".");let i,n;-1===t?(i=e,n=""):(i=e.substring(0,t),n=e.substring(t+1));const o=this._children.get(i);return void 0!==o?o.match(n):this._mainRule}insert(e,t,i,n){if(""===e)return void this._mainRule.acceptOverwrite(t,i,n);const o=e.indexOf(".");let s,r;-1===o?(s=e,r=""):(s=e.substring(0,o),r=e.substring(o+1));let a=this._children.get(s);void 0===a&&(a=new qle(this._mainRule.clone()),this._children.set(s,a)),a.insert(r,t,i,n)}}const $le={base:"vs",inherit:!1,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"001188"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"FF0000"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"FF0000"},{token:"attribute.value",foreground:"0451A5"},{token:"attribute.value.number",foreground:"098658"},{token:"attribute.value.unit",foreground:"098658"},{token:"attribute.value.html",foreground:"0000FF"},{token:"attribute.value.xml",foreground:"0000FF"},{token:"string",foreground:"A31515"},{token:"string.html",foreground:"0000FF"},{token:"string.sql",foreground:"FF0000"},{token:"string.yaml",foreground:"0451A5"},{token:"keyword",foreground:"0000FF"},{token:"keyword.json",foreground:"0451A5"},{token:"keyword.flow",foreground:"AF00DB"},{token:"keyword.flow.scss",foreground:"0000FF"},{token:"operator.scss",foreground:"666666"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[a_]:"#FFFFFE",[l_]:"#000000",[S_]:"#E5EBF1",[xw]:"#D3D3D3",[Iw]:"#939393",[x_]:"#ADD6FF4D"}},Gle={base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"74B0DF"},{token:"variable.predefined",foreground:"4864AA"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"B5CEA8"},{token:"number.hex",foreground:"5BB498"},{token:"regexp",foreground:"B46695"},{token:"annotation",foreground:"cc6666"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"DCDCDC"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"A79873"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"DD6A6F"},{token:"metatag.content.html",foreground:"9CDCFE"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"},{token:"attribute.value.number.css",foreground:"B5CEA8"},{token:"attribute.value.unit.css",foreground:"B5CEA8"},{token:"attribute.value.hex.css",foreground:"D4D4D4"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.json",foreground:"CE9178"},{token:"keyword.flow.scss",foreground:"569CD6"},{token:"operator.scss",foreground:"909090"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[a_]:"#1E1E1E",[l_]:"#D4D4D4",[S_]:"#3A3D41",[xw]:"#404040",[Iw]:"#707070",[x_]:"#ADD6FF26"}},Zle={base:"hc-black",inherit:!1,rules:[{token:"",foreground:"FFFFFF",background:"000000"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"1AEBFF"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"FFFFFF"},{token:"regexp",foreground:"C0C0C0"},{token:"annotation",foreground:"569CD6"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"FFFF00"},{token:"delimiter.html",foreground:"FFFF00"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta",foreground:"D4D4D4"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"569CD6"},{token:"metatag.content.html",foreground:"1AEBFF"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key",foreground:"9CDCFE"},{token:"string.value",foreground:"CE9178"},{token:"attribute.name",foreground:"569CD6"},{token:"attribute.value",foreground:"3FF23F"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[a_]:"#000000",[l_]:"#FFFFFF",[xw]:"#FFFFFF",[Iw]:"#FFFFFF"}},Yle={base:"hc-light",inherit:!1,rules:[{token:"",foreground:"292929",background:"FFFFFF"},{token:"invalid",foreground:"B5200D"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"264F70"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"B5200D"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"264F78"},{token:"attribute.value",foreground:"0451A5"},{token:"string",foreground:"A31515"},{token:"string.sql",foreground:"B5200D"},{token:"keyword",foreground:"0000FF"},{token:"keyword.flow",foreground:"AF00DB"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[a_]:"#FFFFFF",[l_]:"#292929",[xw]:"#292929",[Iw]:"#292929"}};class Qle{getIcon(e){const t=wF();let i=e.defaults;for(;vh.isThemeIcon(i);){const e=t.getIcon(i.id);if(!e)return;i=e.defaults}return i}}const Xle="vs",Jle="vs-dark",ede="hc-black",tde="hc-light",ide=ru.as(Of),nde=ru.as(lw);class ode{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(sde(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,Lg.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=rde(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,Lg.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){return this.getColors().get(e)||(!1!==t?this.getDefault(e):void 0)}getDefault(e){let t=this.defaultColors[e];return t||(t=ide.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case Xle:return tw.LIGHT;case ede:return tw.HIGH_CONTRAST_DARK;case tde:return tw.HIGH_CONTRAST_LIGHT;default:return tw.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const i=rde(this.themeData.base);e=i.rules,i.encodedTokensColors&&(t=i.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const t={token:""};i&&(t.foreground=i),n&&(t.background=n),e.push(t)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=Ule.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const n=this.tokenTheme._match([e].concat(t).join(".")).metadata,o=of.getForeground(n),s=of.getFontStyle(n);return{foreground:o,italic:Boolean(1&s),bold:Boolean(2&s),underline:Boolean(4&s),strikethrough:Boolean(8&s)}}get tokenColorMap(){return[]}}function sde(e){return e===Xle||e===Jle||e===ede||e===tde}function rde(e){switch(e){case Xle:return $le;case Jle:return Gle;case ede:return Zle;case tde:return Yle}}function ade(e){const t=rde(e);return new ode(e,t)}Hu(class extends Pu{constructor(){super({id:"editor.action.toggleHighContrast",label:$7.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(fse),n=i.getColorTheme();nw(n.type)?(i.setTheme(this._originalThemeName||(ow(n.type)?Jle:Xle)),this._originalThemeName=null):(i.setTheme(ow(n.type)?ede:tde),this._originalThemeName=n.themeName)}});class lde extends bu{static{this.ID="editor.action.toggleTabFocusMode"}constructor(){super({id:lde.ID,title:x(1515,"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},metadata:{description:x(1516,"Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.")},f1:!0})}run(){const e=!sB.getTabFocusMode();sB.setTabFocusMode(e),Yl(e?y(1513,"Pressing Tab will now move focus to the next focusable element"):y(1514,"Pressing Tab will now insert the tab character"))}}wu(lde),Hu(class extends Pu{constructor(){super({id:"editor.action.forceRetokenize",label:x(1517,"Developer: Force Retokenize"),precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const n=new Ht;i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}});var dde=i(8245),hde={};hde.styleTagTransform=zl(),hde.setAttributes=Bl(),hde.insert=Pl().bind(null,"head"),hde.domAPI=Rl(),hde.insertStyleElement=Vl(),Ml()(dde.A,hde),dde.A&&dde.A.locals&&dde.A.locals;class cde{static computeUnicodeHighlights(e,t,i){const n=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),s=new ude(t),r=s.getCandidateCodePoints();let a;a="allNonBasicAscii"===r?new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):new RegExp(`${function(e){const t=`[${Vi(e.map((e=>String.fromCodePoint(e))).join(""))}]`;return t}(Array.from(r))}`,"g");const l=new Jy(null,a),d=[];let h,c=!1,u=0,g=0,p=0;e:for(let t=n,i=o;t<=i;t++){const i=e.getLineContent(t),n=i.length;l.reset(0);do{if(h=l.next(i),h){let e=h.index,o=h.index+h[0].length;e>0&&ln(i.charCodeAt(e-1))&&e--,o+1<n&&ln(i.charCodeAt(o-1))&&o++;const r=i.substring(e,o);let a=Pg(e+1,Ag,i,0);a&&a.endColumn<=e+1&&(a=null);const l=s.shouldHighlightNonBasicASCII(r,a?a.word:null);if(0!==l){3===l?u++:2===l?g++:1===l?p++:nt();const i=1e3;if(d.length>=i){c=!0;break e}d.push(new Yu(t,e+1,t,o+1))}}}while(h)}return{ranges:d,hasMore:c,ambiguousCharacterCount:u,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const i=new ude(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const n=e.codePointAt(0),o=i.ambiguousCharacters.getPrimaryConfusable(n),s=In.getLocales().filter((e=>!In.getInstance(new Set([...t.allowedLocales,e])).isAmbiguous(n)));return{kind:0,confusableWith:String.fromCodePoint(o),notAmbiguousInLocales:s}}case 1:return{kind:2}}}}class ude{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=In.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of Tn.codePoints)gde(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const i=e.codePointAt(0);if(this.allowedCodePoints.has(i))return 0;if(this.options.nonBasicASCII)return 1;let n=!1,o=!1;if(t)for(const e of t){const t=e.codePointAt(0),i=bn(e);n=n||i,i||this.ambiguousCharacters.isAmbiguous(t)||Tn.isInvisibleCharacter(t)||(o=!0)}return!n&&o?0:this.options.invisibleCharacters&&!gde(e)&&Tn.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function gde(e){return" "===e||"\n"===e||"\t"===e}var pde=i(6065),mde={};mde.styleTagTransform=zl(),mde.setAttributes=Bl(),mde.insert=Pl().bind(null,"head"),mde.domAPI=Rl(),mde.insertStyleElement=Vl(),Ml()(pde.A,mde),pde.A&&pde.A.locals&&pde.A.locals;var fde=i(4646),_de={};_de.styleTagTransform=zl(),_de.setAttributes=Bl(),_de.insert=Pl().bind(null,"head"),_de.domAPI=Rl(),_de.insertStyleElement=Vl(),Ml()(fde.A,_de),fde.A&&fde.A.locals&&fde.A.locals;var vde=function(e,t){return function(i,n){t(i,n,e)}};let bde=class extends At{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,t,i={},n,o){super(),this._link=t,this._hoverService=n,this._enabled=!0,this.el=il(e,ll("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??nM("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const s=this._register(new OM(this.el,"click")),r=this._register(new OM(this.el,"keypress")),a=zt.chain(r.event,(e=>e.map((e=>new Ze(e))).filter((e=>3===e.keyCode)))),l=this._register(new OM(this.el,XT.Tap)).event;this._register(JT.addTarget(this.el));const d=zt.any(s.event,a,l);this._register(d((e=>{this.enabled&&(Ja(e,!0),i?.opener?i.opener(this._link.href):o.open(this._link.href,{allowCommands:!0}))}))),this.enabled=!0}setTooltip(e){!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};bde=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([vde(3,oZ),vde(4,ZI)],bde);var wde=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Cde=function(e,t){return function(i,n){t(i,n,e)}};let yde=class extends At{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(Sde))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{this.hide(),e.onClose?.()}}),this._editor.setBanner(this.banner.element,26)}};yde=wde([Cde(1,nc)],yde);let Sde=class extends At{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(aT,{}),this.element=ll("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){return e.ariaLabel?e.ariaLabel:"string"==typeof e.message?e.message:void 0}getBannerMessage(e){if("string"==typeof e){const t=ll("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){ca(this.element)}show(e){ca(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=il(this.element,ll("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(ll(`div${vh.asCSSSelector(e.icon)}`));const n=il(this.element,ll("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=il(this.element,ll("div.message-actions-container")),e.actions)for(const t of e.actions)this._register(this.instantiationService.createInstance(bde,this.messageActionsContainer,{...t,tabIndex:-1},{}));const o=il(this.element,ll("div.action-container"));this.actionBar=this._register(new uR(o)),this.actionBar.push(this._register(new dc("banner.close",y(1518,"Close Banner"),vh.asClassName(xF),!0,(()=>{"function"==typeof e.onClose&&e.onClose()}))),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};Sde=wde([Cde(0,nc)],Sde);const xde=oc("workspaceTrustManagementService");var kde=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Lde=function(e,t){return function(i,n){t(i,n,e)}};const Dde=bF("extensions-warning-message",fh.warning,y(1519,"Icon shown with a warning message in the extensions editor."));let Ede=class extends At{static{this.ID="editor.contrib.unicodeHighlighter"}constructor(e,t,i,n){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=e=>{if(e&&e.hasMore){if(this._bannerClosed)return;const t=Math.max(e.ambiguousCharacterCount,e.nonBasicAsciiCharacterCount,e.invisibleCharacterCount);let i;if(e.nonBasicAsciiCharacterCount>=t)i={message:y(1520,"This document contains many non-basic ASCII unicode characters"),command:new Hde};else if(e.ambiguousCharacterCount>=t)i={message:y(1521,"This document contains many ambiguous unicode characters"),command:new Wde};else{if(!(e.invisibleCharacterCount>=t))throw new Error("Unreachable");i={message:y(1522,"This document contains many invisible unicode characters"),command:new Vde}}this._bannerController.show({id:"unicodeHighlightBanner",message:i.message,icon:Dde,actions:[{label:i.command.shortLabel,href:`command:${i.command.desc.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(yde,e)),this._register(this._editor.onDidChangeModel((()=>{this._bannerClosed=!1,this._updateHighlighter()}))),this._options=e.getOption(142),this._register(i.onDidChangeTrust((e=>{this._updateHighlighter()}))),this._register(e.onDidChangeConfiguration((t=>{t.hasChanged(142)&&(this._options=e.getOption(142),this._updateHighlighter())}))),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=function(e,t){return{nonBasicASCII:t.nonBasicASCII===aP?!e:t.nonBasicASCII,ambiguousCharacters:t.ambiguousCharacters,invisibleCharacters:t.invisibleCharacters,includeComments:t.includeComments===aP?!e:t.includeComments,includeStrings:t.includeStrings===aP?!e:t.includeStrings,allowedCharacters:t.allowedCharacters,allowedLocales:t.allowedLocales}}(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every((e=>!1===e)))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map((e=>e.codePointAt(0))),allowedLocales:Object.keys(e.allowedLocales).map((e=>"_os"===e?Wy().value.resolvedOptions().locale:"_vscode"===e?ie:e))};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new Nde(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new Ide(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};Ede=kde([Lde(1,Xq),Lde(2,xde),Lde(3,nc)],Ede);let Nde=class extends At{constructor(e,t,i,n){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Ci((()=>this._update()),250)),this._register(this._editor.onDidChangeModelContent((()=>{this._updateSoon.schedule()}))),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII())return void this._decorations.clear();const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then((t=>{if(this._model.isDisposed())return;if(this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const e of t.ranges)i.push({range:e,options:Pde.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)}))}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();return lH(t,e)?{reason:Ode(t.getValueInRange(e.range),this._options),inComment:dH(t,e),inString:hH(t,e)}:null}};Nde=kde([Lde(3,Xq)],Nde);class Ide extends At{constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Ci((()=>this._update()),250)),this._register(this._editor.onDidLayoutChange((()=>{this._updateSoon.schedule()}))),this._register(this._editor.onDidScrollChange((()=>{this._updateSoon.schedule()}))),this._register(this._editor.onDidChangeHiddenAreas((()=>{this._updateSoon.schedule()}))),this._register(this._editor.onDidChangeModelContent((()=>{this._updateSoon.schedule()}))),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII())return void this._decorations.clear();const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const t of e){const e=cde.computeUnicodeHighlights(this._model,this._options,t);for(const t of e.ranges)i.ranges.push(t);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||e.hasMore}if(!i.hasMore)for(const e of i.ranges)t.push({range:e,options:Pde.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return lH(t,e)?{reason:Ode(i,this._options),inComment:dH(t,e),inString:hH(t,e)}:null}}const Tde=y(1523,"Configure Unicode Highlight Options");let Mde=class{constructor(e,t,i){this._editor=e,this._languageService=t,this._openerService=i,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||1!==e.type)return[];const i=this._editor.getModel(),n=this._editor.getContribution(Ede.ID);if(!n)return[];const o=[],s=new Set;let r=300;for(const e of t){const t=n.getDecorationInfo(e);if(!t)continue;const a=i.getValueInRange(e.range).codePointAt(0),l=Rde(a);let d;switch(t.reason.kind){case 0:d=bn(t.reason.confusableWith)?y(1524,"The character {0} could be confused with the ASCII character {1}, which is more common in source code.",l,Rde(t.reason.confusableWith.codePointAt(0))):y(1525,"The character {0} could be confused with the character {1}, which is more common in source code.",l,Rde(t.reason.confusableWith.codePointAt(0)));break;case 1:d=y(1526,"The character {0} is invisible.",l);break;case 2:d=y(1527,"The character {0} is not a basic ASCII character.",l)}if(s.has(d))continue;s.add(d);const h={codePoint:a,reason:t.reason,inComment:t.inComment,inString:t.inString},c=y(1528,"Adjust settings"),u=Jh(zde.ID,h),g=new Gh("",!0).appendMarkdown(d).appendText(" ").appendLink(u,c,Tde);o.push(new _Z(this,e.range,[g],!1,r++))}return o}renderHoverParts(e,t){return function(e,t,i,n,o){t.sort(Cs((e=>e.ordinal),ys));const s=[];for(const r of t){const t=yZ(i,r,n,o,e.onContentsChanged);e.fragment.appendChild(t.hoverElement),s.push(t)}return new Yq(s)}(e,t,this._editor,this._languageService,this._openerService)}};function Ade(e){return`U+${e.toString(16).padStart(4,"0")}`}function Rde(e){let t=`\`${Ade(e)}\``;return Tn.isInvisibleCharacter(e)||(t+=` "${function(e){return 96===e?"`` ` ``":"`"+String.fromCodePoint(e)+"`"}(e)}"`),t}function Ode(e,t){return cde.computeUnicodeHighlightReason(e,t)}Mde=kde([Lde(1,Tg),Lde(2,ZI)],Mde);class Pde{constructor(){this.map=new Map}static{this.instance=new Pde}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let n=this.map.get(i);return n||(n=bk.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}}class Fde extends Pu{constructor(){super({id:Wde.ID,label:x(1537,"Disable highlighting of characters in comments"),precondition:void 0}),this.shortLabel=y(1529,"Disable Highlight In Comments")}async run(e,t,i){const n=e.get(up);n&&this.runAction(n)}async runAction(e){await e.updateValue(uP,!1,2)}}class Bde extends Pu{constructor(){super({id:Wde.ID,label:x(1538,"Disable highlighting of characters in strings"),precondition:void 0}),this.shortLabel=y(1530,"Disable Highlight In Strings")}async run(e,t,i){const n=e.get(up);n&&this.runAction(n)}async runAction(e){await e.updateValue(gP,!1,2)}}class Wde extends bu{static{this.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters"}constructor(){super({id:Wde.ID,title:x(1539,"Disable highlighting of ambiguous characters"),precondition:void 0,f1:!1}),this.shortLabel=y(1531,"Disable Ambiguous Highlight")}async run(e,t,i){const n=e.get(up);n&&this.runAction(n)}async runAction(e){await e.updateValue(cP,!1,2)}}class Vde extends bu{static{this.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters"}constructor(){super({id:Vde.ID,title:x(1540,"Disable highlighting of invisible characters"),precondition:void 0,f1:!1}),this.shortLabel=y(1532,"Disable Invisible Highlight")}async run(e,t,i){const n=e.get(up);n&&this.runAction(n)}async runAction(e){await e.updateValue(dP,!1,2)}}class Hde extends bu{static{this.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters"}constructor(){super({id:Hde.ID,title:x(1541,"Disable highlighting of non basic ASCII characters"),precondition:void 0,f1:!1}),this.shortLabel=y(1533,"Disable Non ASCII Highlight")}async run(e,t,i){const n=e.get(up);n&&this.runAction(n)}async runAction(e){await e.updateValue(hP,!1,2)}}class zde extends bu{static{this.ID="editor.action.unicodeHighlight.showExcludeOptions"}constructor(){super({id:zde.ID,title:x(1542,"Show Exclude Options"),precondition:void 0,f1:!1})}async run(e,t){const{codePoint:i,reason:n,inString:o,inComment:s}=t,r=String.fromCodePoint(i),a=e.get(LD),l=e.get(up),d=[];if(0===n.kind)for(const e of n.notAmbiguousInLocales)d.push({label:y(1536,'Allow unicode characters that are more common in the language "{0}".',e),run:async()=>{Ude(l,[e])}});if(d.push({label:function(e){return Tn.isInvisibleCharacter(e)?y(1534,"Exclude {0} (invisible character) from being highlighted",Ade(e)):y(1535,"Exclude {0} from being highlighted",`${Ade(e)} "${r}"`)}(i),run:()=>async function(e,t){const i=e.getValue(lP);let n;n="object"==typeof i&&i?i:{};for(const e of t)n[String.fromCodePoint(e)]=!0;await e.updateValue(lP,n,2)}(l,[i])}),s){const e=new Fde;d.push({label:e.label,run:async()=>e.runAction(l)})}else if(o){const e=new Bde;d.push({label:e.label,run:async()=>e.runAction(l)})}function h(e){return"string"==typeof e.desc.title?e.desc.title:e.desc.title.value}if(0===n.kind){const e=new Wde;d.push({label:h(e),run:async()=>e.runAction(l)})}else if(1===n.kind){const e=new Vde;d.push({label:h(e),run:async()=>e.runAction(l)})}else if(2===n.kind){const e=new Hde;d.push({label:h(e),run:async()=>e.runAction(l)})}else!function(e){throw new Error(`Unexpected value: ${e}`)}(n);const c=await a.pick(d,{title:Tde});c&&await c.run()}}async function Ude(e,t){const i=e.inspect(pP).user?.value;let n;n="object"==typeof i&&i?Object.assign({},i):{};for(const e of t)n[e]=!0;await e.updateValue(pP,n,2)}wu(Wde),wu(Vde),wu(Hde),wu(zde),Uu(Ede.ID,Ede,1),Qq.register(Mde);var Kde=function(e,t){return function(i,n){t(i,n,e)}};const jde="ignoreUnusualLineTerminators";let qde=class extends At{static{this.ID="editor.contrib.unusualLineTerminatorsDetector"}constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(143),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(143)&&(this._config=this._editor.getOption(143),this._checkForUnusualLineTerminators())}))),this._register(this._editor.onDidChangeModel((()=>{this._checkForUnusualLineTerminators()}))),this._register(this._editor.onDidChangeModelContent((e=>{e.isUndoing||this._checkForUnusualLineTerminators()}))),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if("off"===this._config)return;if(!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators())return;const t=function(e,t){return e.getModelProperty(t.uri,jde)}(this._codeEditorService,e);if(!0===t)return;if(this._editor.getOption(104))return;if("auto"===this._config)return void e.removeUnusualLineTerminators(this._editor.getSelections());if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=await this._dialogService.confirm({title:y(1543,"Unusual Line Terminators"),message:y(1544,"Detected unusual line terminators"),detail:y(1545,"The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",Bh(e.uri)),primaryButton:y(1546,"&&Remove Unusual Line Terminators"),cancelButton:y(1547,"Ignore")})}finally{this._isPresentingDialog=!1}i.confirmed?e.removeUnusualLineTerminators(this._editor.getSelections()):function(e,t){e.setModelProperty(t.uri,jde,!0)}(this._codeEditorService,e)}};qde=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Kde(1,Xre),Kde(2,sc)],qde),Uu(qde.ID,qde,1);const $de="**",Gde="[/\\\\]",Zde="[^/\\\\]",Yde=/\//g;function Qde(e,t){switch(e){case 0:return"";case 1:return`${Zde}*?`;default:return`(?:${Gde}|${Zde}+${Gde}${t?`|${Gde}${Zde}+`:""})*?`}}function Xde(e,t){if(!e)return[];const i=[];let n=!1,o=!1,s="";for(const r of e){switch(r){case t:if(!n&&!o){i.push(s),s="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1}s+=r}return s&&i.push(s),i}function Jde(e){if(!e)return"";let t="";const i=Xde(e,"/");if(i.every((e=>e===$de)))t=".*";else{let e=!1;i.forEach(((n,o)=>{if(n===$de){if(e)return;t+=Qde(2,o===i.length-1)}else{let e=!1,s="",r=!1,a="";for(const i of n)if("}"!==i&&e)s+=i;else if(!r||"]"===i&&a)switch(i){case"{":e=!0;continue;case"[":r=!0;continue;case"}":{const i=`(?:${Xde(s,",").map((e=>Jde(e))).join("|")})`;t+=i,e=!1,s="";break}case"]":t+="["+a+"]",r=!1,a="";break;case"?":t+=Zde;continue;case"*":t+=Qde(1);continue;default:t+=Vi(i)}else{let e;e="-"===i?i:"^"!==i&&"!"!==i||a?"/"===i?"":Vi(i):"^",a+=e}o<i.length-1&&(i[o+1]!==$de||o+2<i.length)&&(t+=Gde)}e=n===$de}))}return t}const ehe=/^\*\*\/\*\.[\w\.-]+$/,the=/^\*\*\/([\w\.-]+)\/?$/,ihe=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,nhe=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,ohe=/^\*\*((\/[\w\.-]+)+)\/?$/,she=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,rhe=new ad(1e4),ahe=function(){return!1},lhe=function(){return null};function dhe(e,t){if(!e)return lhe;let i;i="string"!=typeof e?e.pattern:e,i=i.trim();const n=`${i}_${!!t.trimForExclusions}`;let o,s=rhe.get(n);return s||(s=ehe.test(i)?function(e,t){return function(i,n){return"string"==typeof i&&i.endsWith(e)?t:null}}(i.substr(4),i):(o=the.exec(hhe(i,t)))?function(e,t){const i=`/${e}`,n=`\\${e}`,o=function(o,s){return"string"!=typeof o?null:s?s===e?t:null:o===e||o.endsWith(i)||o.endsWith(n)?t:null},s=[e];return o.basenames=s,o.patterns=[t],o.allBasenames=s,o}(o[1],i):(t.trimForExclusions?nhe:ihe).test(i)?function(e,t){const i=ghe(e.slice(1,-1).split(",").map((e=>dhe(e,t))).filter((e=>e!==lhe)),e),n=i.length;if(!n)return lhe;if(1===n)return i[0];const o=function(t,n){for(let o=0,s=i.length;o<s;o++)if(i[o](t,n))return e;return null},s=i.find((e=>!!e.allBasenames));s&&(o.allBasenames=s.allBasenames);const r=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);return r.length&&(o.allPaths=r),o}(i,t):(o=ohe.exec(hhe(i,t)))?che(o[1].substr(1),i,!0):(o=she.exec(hhe(i,t)))?che(o[1],i,!1):function(e){try{const t=new RegExp(`^${Jde(e)}$`);return function(i){return t.lastIndex=0,"string"==typeof i&&t.test(i)?e:null}}catch(e){return lhe}}(i),rhe.set(n,s)),function(e,t){if("string"==typeof t)return e;const i=function(i,n){return Th(i,t.base,!G)?e(zi(i.substr(t.base.length),oo),n):null};return i.allBasenames=e.allBasenames,i.allPaths=e.allPaths,i.basenames=e.basenames,i.patterns=e.patterns,i}(s,e)}function hhe(e,t){return t.trimForExclusions&&e.endsWith("/**")?e.substr(0,e.length-2):e}function che(e,t,i){const n=oo===Qn.sep,o=n?e:e.replace(Yde,oo),s=oo+o,r=Qn.sep+e;let a;return a=i?function(i,a){return"string"!=typeof i||i!==o&&!i.endsWith(s)&&(n||i!==e&&!i.endsWith(r))?null:t}:function(i,s){return"string"!=typeof i||i!==o&&(n||i!==e)?null:t},a.allPaths=[(i?"*/":"./")+e],a}function uhe(e,t={}){if(!e)return ahe;if("string"==typeof e||function(e){const t=e;return!!t&&("string"==typeof t.base&&"string"==typeof t.pattern)}(e)){const i=dhe(e,t);if(i===lhe)return ahe;const n=function(e,t){return!!i(e,t)};return i.allBasenames&&(n.allBasenames=i.allBasenames),i.allPaths&&(n.allPaths=i.allPaths),n}return function(e,t){const i=ghe(Object.getOwnPropertyNames(e).map((i=>function(e,t,i){if(!1===t)return lhe;const n=dhe(e,i);if(n===lhe)return lhe;if("boolean"==typeof t)return n;if(t){const i=t.when;if("string"==typeof i){const t=(t,o,s,r)=>{if(!r||!n(t,o))return null;const a=r(i.replace("$(basename)",(()=>s)));return di(a)?a.then((t=>t?e:null)):a?e:null};return t.requiresSiblings=!0,t}}return n}(i,e[i],t))).filter((e=>e!==lhe))),n=i.length;if(!n)return lhe;if(!i.some((e=>!!e.requiresSiblings))){if(1===n)return i[0];const e=function(e,t){let n;for(let o=0,s=i.length;o<s;o++){const s=i[o](e,t);if("string"==typeof s)return s;di(s)&&(n||(n=[]),n.push(s))}return n?(async()=>{for(const e of n){const t=await e;if("string"==typeof t)return t}return null})():null},t=i.find((e=>!!e.allBasenames));t&&(e.allBasenames=t.allBasenames);const o=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);return o.length&&(e.allPaths=o),e}const o=function(e,t,n){let o,s;for(let r=0,a=i.length;r<a;r++){const a=i[r];a.requiresSiblings&&n&&(t||(t=io(e)),o||(o=t.substr(0,t.length-no(e).length)));const l=a(e,t,o,n);if("string"==typeof l)return l;di(l)&&(s||(s=[]),s.push(l))}return s?(async()=>{for(const e of s){const t=await e;if("string"==typeof t)return t}return null})():null},s=i.find((e=>!!e.allBasenames));s&&(o.allBasenames=s.allBasenames);const r=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);return r.length&&(o.allPaths=r),o}(e,t)}function ghe(e,t){const i=e.filter((e=>!!e.basenames));if(i.length<2)return e;const n=i.reduce(((e,t)=>{const i=t.basenames;return i?e.concat(i):e}),[]);let o;if(t){o=[];for(let e=0,i=n.length;e<i;e++)o.push(t)}else o=i.reduce(((e,t)=>{const i=t.patterns;return i?e.concat(i):e}),[]);const s=function(e,t){if("string"!=typeof e)return null;if(!t){let i;for(i=e.length;i>0;i--){const t=e.charCodeAt(i-1);if(47===t||92===t)break}t=e.substr(i)}const i=n.indexOf(t);return-1!==i?o[i]:null};s.basenames=n,s.patterns=o,s.allBasenames=n;const r=e.filter((e=>!e.basenames));return r.push(s),r}function phe(e,t,i,n,o,s){if(Array.isArray(e)){let r=0;for(const a of e){const e=phe(a,t,i,n,o,s);if(10===e)return e;e>r&&(r=e)}return r}if("string"==typeof e)return n?"*"===e?5:e===i?10:0:0;if(e){const{language:l,pattern:d,scheme:h,hasAccessToAllModels:c,notebookType:u}=e;if(!n&&!c)return 0;u&&o&&(t=o);let g=0;if(h)if(h===t.scheme)g=10;else{if("*"!==h)return 0;g=5}if(l)if(l===i)g=10;else{if("*"!==l)return 0;g=Math.max(g,5)}if(u)if(u===s)g=10;else{if("*"!==u||void 0===s)return 0;g=Math.max(g,5)}if(d){let e;if(e="string"==typeof d?d:{...d,base:Xn(d.base)},e!==t.fsPath&&(r=e,a=t.fsPath,!r||"string"!=typeof a||!uhe(r)(a,void 0,undefined)))return 0;g=10}return g}return 0;var r,a}class mhe{constructor(){this.selector={language:"*"}}provideDocumentHighlights(e,t,i){const n=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return n?e.isDisposed()?void 0:e.findMatches(n.word,!0,!1,!0,Mg,!1).map((e=>({range:e.range,kind:zS.Text}))):Promise.resolve([])}provideMultiDocumentHighlights(e,t,i,n){const o=new nd,s=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!s)return Promise.resolve(o);for(const t of[e,...i]){if(t.isDisposed())continue;const e=t.findMatches(s.word,!0,!1,!0,Mg,!1).map((e=>({range:e.range,kind:zS.Text})));e&&o.set(t.uri,e)}return o}}let fhe=class extends At{constructor(e){super(),this._register(e.documentHighlightProvider.register("*",new mhe)),this._register(e.multiDocumentHighlightProvider.register("*",new mhe))}};fhe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,BD)],fhe);var _he,vhe,bhe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},whe=function(e,t){return function(i,n){t(i,n,e)}};const Che=new Jc("hasWordHighlights",!1);function yhe(e,t,i,n){return _i(e.ordered(t).map((e=>()=>Promise.resolve(e.provideDocumentHighlights(t,i,n)).then(void 0,Te))),(e=>null!=e)).then((e=>{if(e){const i=new nd;return i.set(t.uri,e),i}return new nd}))}class She{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=hi((e=>this._compute(this._model,this._selection,this._wordSeparators,e)))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new Yu(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}cancel(){this.result.cancel()}}class xhe extends She{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return yhe(this._providers,e,t.getPosition(),n).then((e=>e||new nd))}}class khe extends She{constructor(e,t,i,n,o){super(e,t,i),this._providers=n,this._otherModels=o}_compute(e,t,i,n){return function(e,t,i,n,o){return _i(e.ordered(t).map((e=>()=>{const s=o.filter((e=>Cg(e))).filter((t=>phe(e.selector,t.uri,t.getLanguageId(),!0,void 0,void 0)>0));return Promise.resolve(e.provideMultiDocumentHighlights(t,i,s,n)).then(void 0,Te)})),(e=>null!=e))}(this._providers,e,t.getPosition(),n,this._otherModels).then((e=>e||new nd))}}Wu("_executeDocumentHighlights",(async(e,t,i)=>{const n=e.get(BD),o=await yhe(n.documentHighlightProvider,t,i,oi.None);return o?.get(t.uri)}));let Lhe=class{static{_he=this}static{this.storedDecorationIDs=new nd}static{this.query=null}constructor(e,t,i,n,o,s,r,a){this.toUnhook=new Mt,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new nd,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,this.runDelayer=this.toUnhook.add(new gi(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=s,this.textModelService=o,this.configurationService=r,this.logService=a,this._hasWordHighlights=Che.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlightEnablement=this.editor.getOption(90),this.occurrencesHighlightDelay=this.configurationService.getValue("editor.occurrencesHighlightDelay"),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition((e=>{this._ignorePositionChangeEvent||"off"!==this.occurrencesHighlightEnablement&&this.runDelayer.trigger((()=>{this._onPositionChanged(e)}))}))),this.toUnhook.add(e.onDidFocusEditorText((e=>{"off"!==this.occurrencesHighlightEnablement&&(this.workerRequest||this.runDelayer.trigger((()=>{this._run()})))}))),this.toUnhook.add(e.onDidChangeModelContent((e=>{xo(this.model.uri,"output")||this._stopAll()}))),this.toUnhook.add(e.onDidChangeModel((e=>{!e.newModelUrl&&e.oldModelUrl?this._stopSingular():_he.query&&this._run()}))),this.toUnhook.add(e.onDidChangeConfiguration((e=>{const t=this.editor.getOption(90);if(this.occurrencesHighlightEnablement!==t)switch(this.occurrencesHighlightEnablement=t,t){case"off":this._stopAll();break;case"singleFile":this._stopAll(_he.query?.modelInfo?.modelURI);break;case"multiFile":_he.query&&this._run(!0);break;default:console.warn("Unknown occurrencesHighlight setting value:",t)}}))),this.toUnhook.add(this.configurationService.onDidChangeConfiguration((e=>{if(e.affectsConfiguration("editor.occurrencesHighlightDelay")){const e=r.getValue("editor.occurrencesHighlightDelay");this.occurrencesHighlightDelay!==e&&(this.occurrencesHighlightDelay=e)}}))),this.toUnhook.add(e.onDidBlurEditorWidget((()=>{const e=this.codeEditorService.getFocusedCodeEditor();e?e.getModel()?.uri.scheme===So.vscodeNotebookCell&&this.editor.getModel()?.uri.scheme!==So.vscodeNotebookCell&&this._stopAll():this._stopAll()}))),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,_he.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(e){"off"!==this.occurrencesHighlightEnablement&&(this.runDelayer.cancel(),this.runDelayer.trigger((()=>{this._run(!1,e)})))}stop(){"off"!==this.occurrencesHighlightEnablement&&this._stopAll()}_getSortedHighlights(){return this.decorations.getRanges().sort(Yu.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),t=e.findIndex((e=>e.containsPosition(this.editor.getPosition()))),i=(t+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const t=this._getWord();t&&Yl(`${this.editor.getModel().getLineContent(n.startLineNumber)}, ${i+1} of ${e.length} for '${t.word}'`)}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),t=e.findIndex((e=>e.containsPosition(this.editor.getPosition()))),i=(t-1+e.length)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const t=this._getWord();t&&Yl(`${this.editor.getModel().getLineContent(n.startLineNumber)}, ${i+1} of ${e.length} for '${t.word}'`)}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=_he.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),_he.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){const t=this.codeEditorService.listCodeEditors(),i=[];for(const n of t){if(!n.hasModel()||Ph(n.getModel().uri,e))continue;const t=_he.storedDecorationIDs.get(n.getModel().uri);if(!t)continue;n.removeDecorations(t),i.push(n.getModel().uri);const o=Dhe.get(n);o?.wordHighlighter&&o.wordHighlighter.decorations.length>0&&(o.wordHighlighter.decorations.clear(),o.wordHighlighter.workerRequest=null,o.wordHighlighter._hasWordHighlights.set(!1))}for(const e of i)_he.storedDecorationIDs.delete(e)}_stopSingular(){this._removeSingleDecorations(),this.editor.hasTextFocus()&&(this.editor.getModel()?.uri.scheme!==So.vscodeNotebookCell&&_he.query?.modelInfo?.modelURI.scheme!==So.vscodeNotebookCell?(_he.query=null,this._run()):_he.query?.modelInfo&&(_he.query.modelInfo=null)),void 0!==this.renderDecorationsTimer&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),null!==this.workerRequest&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(e){this._removeAllDecorations(e),void 0!==this.renderDecorationsTimer&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),null!==this.workerRequest&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){"off"===this.occurrencesHighlightEnablement||"api"!==e.source&&3!==e.reason?this._stopAll():this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===So.vscodeNotebookCell){const t=[],i=this.codeEditorService.listCodeEditors();for(const n of i){const i=n.getModel();i&&i!==e&&i.uri.scheme===So.vscodeNotebookCell&&t.push(i)}return t}const t=[],i=this.codeEditorService.listCodeEditors();for(const n of i){if(!nY(n))continue;const i=n.getModel();i&&e===i.modified&&t.push(i.modified)}if(t.length)return t;if("singleFile"===this.occurrencesHighlightEnablement)return[];for(const n of i){const i=n.getModel();i&&i!==e&&t.push(i)}return t}async _run(e,t){if(this.editor.hasTextFocus()){const e=this.editor.getSelection();if(!e||e.startLineNumber!==e.endLineNumber)return _he.query=null,void this._stopAll();const t=e.startColumn,i=e.endColumn,n=this._getWord();if(!n||n.startColumn>t||n.endColumn<i)return _he.query=null,void this._stopAll();_he.query={modelInfo:{modelURI:this.model.uri,selection:e}}}else if(!_he.query)return void this._stopAll();if(this.lastCursorPositionChangeTime=(new Date).getTime(),Ph(this.editor.getModel().uri,_he.query.modelInfo?.modelURI)){if(!e){const e=this.decorations.getRanges();for(const t of e)if(t.containsPosition(this.editor.getPosition()))return}this._stopAll(e?this.model.uri:void 0);const i=++this.workerRequestTokenId;this.workerRequestCompleted=!1;const n=this.getOtherModelsToHighlight(this.editor.getModel());if(!_he.query||!_he.query.modelInfo)return;const o=await this.textModelService.createModelReference(_he.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(o.object.textEditorModel,_he.query.modelInfo.selection,n),this.workerRequest?.result.then((e=>{i===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=e||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))}),Ie)}catch(e){this.logService.error("Unexpected error during occurrence request. Log: ",e)}finally{o.dispose()}}else if(this.model.uri.scheme===So.vscodeNotebookCell){const e=++this.workerRequestTokenId;if(this.workerRequestCompleted=!1,!_he.query||!_he.query.modelInfo)return;const i=await this.textModelService.createModelReference(_he.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(i.object.textEditorModel,_he.query.modelInfo.selection,[this.model]),this.workerRequest?.result.then((i=>{e===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=i||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))}),Ie)}catch(e){this.logService.error("Unexpected error during occurrence request. Log: ",e)}finally{i.dispose()}}}computeWithModel(e,t,i){return i.length?function(e,t,i,n,o){return new khe(t,i,n,e,o)}(this.multiDocumentProviders,e,t,this.editor.getOption(148),i):function(e,t,i,n){return new xhe(t,i,n,e)}(this.providers,e,t,this.editor.getOption(148))}_beginRenderDecorations(e){const t=(new Date).getTime(),i=this.lastCursorPositionChangeTime+e;t>=i?(this.renderDecorationsTimer=void 0,this.renderDecorations()):this.renderDecorationsTimer=setTimeout((()=>{this.renderDecorations()}),i-t)}renderDecorations(){this.renderDecorationsTimer=void 0;const e=this.codeEditorService.listCodeEditors();for(const i of e){const e=Dhe.get(i);if(!e)continue;const n=[],o=i.getModel()?.uri;if(o&&this.workerRequestValue.has(o)){const s=_he.storedDecorationIDs.get(o),r=this.workerRequestValue.get(o);if(r)for(const e of r)e.range&&n.push({range:e.range,options:(t=e.kind,t===zS.Write?gre:t===zS.Text?pre:_re)});let a=[];i.changeDecorations((e=>{a=e.deltaDecorations(s??[],n)})),_he.storedDecorationIDs=_he.storedDecorationIDs.set(o,a),n.length>0&&(e.wordHighlighter?.decorations.set(n),e.wordHighlighter?._hasWordHighlights.set(!0))}}var t;this.workerRequest=null}dispose(){this._stopSingular(),this.toUnhook.dispose()}};Lhe=_he=bhe([whe(4,lc),whe(5,sc),whe(6,up),whe(7,yu)],Lhe);let Dhe=class extends At{static{vhe=this}static{this.ID="editor.contrib.wordHighlighter"}static get(e){return e.getContribution(vhe.ID)}constructor(e,t,i,n,o,s,r){super(),this._wordHighlighter=null;const a=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&e.getModel().uri.scheme!==So.accessibleView&&(this._wordHighlighter=new Lhe(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,o,n,s,r))};this._register(e.onDidChangeModel((e=>{this._wordHighlighter&&(e.newModelUrl||e.oldModelUrl?.scheme===So.vscodeNotebookCell||this.wordHighlighter?.stop(),this._wordHighlighter.dispose(),this._wordHighlighter=null),a()}))),a()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!(!this._wordHighlighter||!this._wordHighlighter.hasDecorations())}moveNext(){this._wordHighlighter?.moveNext()}moveBack(){this._wordHighlighter?.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore(250)}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}};Dhe=vhe=bhe([whe(1,eu),whe(2,BD),whe(3,sc),whe(4,lc),whe(5,up),whe(6,yu)],Dhe);class Ehe extends Pu{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=Dhe.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}Uu(Dhe.ID,Dhe,0),Hu(class extends Ehe{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:x(1557,"Go to Next Symbol Highlight"),precondition:Che,kbOpts:{kbExpr:Xu.editorTextFocus,primary:65,weight:100}})}}),Hu(class extends Ehe{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:x(1558,"Go to Previous Symbol Highlight"),precondition:Che,kbOpts:{kbExpr:Xu.editorTextFocus,primary:1089,weight:100}})}}),Hu(class extends Pu{constructor(){super({id:"editor.action.wordHighlight.trigger",label:x(1559,"Trigger Symbol Highlight"),precondition:void 0,kbOpts:{kbExpr:Xu.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const n=Dhe.get(t);n&&n.restoreViewState(!0)}}),qq(fhe);class Nhe extends Ou{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=qy(t.getOption(148),t.getOption(147)),o=t.getModel(),s=t.getSelections(),r=s.length>1,a=s.map((e=>{const t=new rc(e.positionLineNumber,e.positionColumn),i=this._move(n,o,t,this._wordNavigationType,r);return this._moveTo(e,i,this._inSelectionMode)}));if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,a.map((e=>Rk.fromModelSelection(e)))),1===a.length){const e=new rc(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(e,0)}}_moveTo(e,t,i){return i?new Qu(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new Qu(t.lineNumber,t.column,t.lineNumber,t.column)}}class Ihe extends Nhe{_move(e,t,i,n,o){return Jk.moveWordLeft(e,t,i,n,o)}}class The extends Nhe{_move(e,t,i,n,o){return Jk.moveWordRight(e,t,i,n)}}class Mhe extends Ou{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e?.get(Qp);if(!t.hasModel()||!n)return;const o=qy(t.getOption(148),t.getOption(147)),s=t.getModel(),r=t.getSelections(),a=t.getOption(10),l=t.getOption(15),d=n.getLanguageConfiguration(s.getLanguageId()).getAutoClosingPairs(),h=t._getViewModel(),c=r.map((e=>{const i=this._delete({wordSeparators:o,model:s,selection:e,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(13),autoClosingBrackets:a,autoClosingQuotes:l,autoClosingPairs:d,autoClosedCharacters:h.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Hk(i,"")}));t.pushUndoStop(),t.executeCommands(this.id,c),t.pushUndoStop()}}class Ahe extends Mhe{_delete(e,t){return Jk.deleteWordLeft(e,t)||new Yu(1,1,1,1)}}class Rhe extends Mhe{_delete(e,t){const i=Jk.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new Yu(n,o,n,o)}}Vu(new class extends Ihe{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}),Vu(new class extends Ihe{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}),Vu(new class extends Ihe{constructor(){super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:Ac.and(Xu.textInputFocus,Ac.and(aB,QX)?.negate()),primary:2063,mac:{primary:527},weight:100}})}}),Vu(new class extends Ihe{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}),Vu(new class extends Ihe{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}),Vu(new class extends Ihe{constructor(){super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:Ac.and(Xu.textInputFocus,Ac.and(aB,QX)?.negate()),primary:3087,mac:{primary:1551},weight:100}})}}),Vu(new class extends The{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}),Vu(new class extends The{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:Ac.and(Xu.textInputFocus,Ac.and(aB,QX)?.negate()),primary:2065,mac:{primary:529},weight:100}})}}),Vu(new class extends The{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}),Vu(new class extends The{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}),Vu(new class extends The{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:Ac.and(Xu.textInputFocus,Ac.and(aB,QX)?.negate()),primary:3089,mac:{primary:1553},weight:100}})}}),Vu(new class extends The{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}),Vu(new class extends Ihe{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n,o){return super._move(qy(bP.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}),Vu(new class extends Ihe{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n,o){return super._move(qy(bP.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}),Vu(new class extends The{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n,o){return super._move(qy(bP.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}),Vu(new class extends The{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n,o){return super._move(qy(bP.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}),Vu(new class extends Ahe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:Xu.writable})}}),Vu(new class extends Ahe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:Xu.writable})}}),Vu(new class extends Ahe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:Xu.writable,kbOpts:{kbExpr:Xu.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}),Vu(new class extends Rhe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:Xu.writable})}}),Vu(new class extends Rhe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:Xu.writable})}}),Vu(new class extends Rhe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:Xu.writable,kbOpts:{kbExpr:Xu.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}),Hu(class extends Pu{constructor(){super({id:"deleteInsideWord",precondition:Xu.writable,label:x(1560,"Delete Word")})}run(e,t,i){if(!t.hasModel())return;const n=qy(t.getOption(148),t.getOption(147)),o=t.getModel(),s=t.getSelections().map((e=>{const t=Jk.deleteInsideWord(n,o,e);return new Hk(t,"")}));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}});class Ohe extends Nhe{_move(e,t,i,n,o){return eL.moveWordPartLeft(e,t,i,o)}}fc.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft"),fc.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class Phe extends Nhe{_move(e,t,i,n,o){return eL.moveWordPartRight(e,t,i)}}var Fhe,Bhe,Whe,Vhe,Hhe,zhe,Uhe,Khe,jhe,qhe,$he,Ghe,Zhe,Yhe,Qhe,Xhe,Jhe,ece,tce,ice,nce,oce,sce,rce,ace,lce,dce,hce,cce,uce,gce,pce,mce,fce,_ce,vce,bce,wce,Cce,yce,Sce,xce,kce,Lce,Dce,Ece,Nce,Ice;Vu(new class extends Mhe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:Xu.writable,kbOpts:{kbExpr:Xu.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){return eL.deleteWordPartLeft(e)||new Yu(1,1,1,1)}}),Vu(new class extends Mhe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:Xu.writable,kbOpts:{kbExpr:Xu.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=eL.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new Yu(n,o,n,o)}}),Vu(new class extends Ohe{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:Xu.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}),Vu(new class extends Ohe{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:Xu.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}),Vu(new class extends Phe{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:Xu.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}),Vu(new class extends Phe{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:Xu.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}),function(e){e[e.Unknown=0]="Unknown",e[e.Disabled=1]="Disabled",e[e.Enabled=2]="Enabled"}(Fhe||(Fhe={})),function(e){e[e.Invoke=1]="Invoke",e[e.Auto=2]="Auto"}(Bhe||(Bhe={})),function(e){e[e.None=0]="None",e[e.KeepWhitespace=1]="KeepWhitespace",e[e.InsertAsSnippet=4]="InsertAsSnippet"}(Whe||(Whe={})),function(e){e[e.Method=0]="Method",e[e.Function=1]="Function",e[e.Constructor=2]="Constructor",e[e.Field=3]="Field",e[e.Variable=4]="Variable",e[e.Class=5]="Class",e[e.Struct=6]="Struct",e[e.Interface=7]="Interface",e[e.Module=8]="Module",e[e.Property=9]="Property",e[e.Event=10]="Event",e[e.Operator=11]="Operator",e[e.Unit=12]="Unit",e[e.Value=13]="Value",e[e.Constant=14]="Constant",e[e.Enum=15]="Enum",e[e.EnumMember=16]="EnumMember",e[e.Keyword=17]="Keyword",e[e.Text=18]="Text",e[e.Color=19]="Color",e[e.File=20]="File",e[e.Reference=21]="Reference",e[e.Customcolor=22]="Customcolor",e[e.Folder=23]="Folder",e[e.TypeParameter=24]="TypeParameter",e[e.User=25]="User",e[e.Issue=26]="Issue",e[e.Tool=27]="Tool",e[e.Snippet=28]="Snippet"}(Vhe||(Vhe={})),function(e){e[e.Deprecated=1]="Deprecated"}(Hhe||(Hhe={})),function(e){e[e.Invoke=0]="Invoke",e[e.TriggerCharacter=1]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"}(zhe||(zhe={})),function(e){e[e.EXACT=0]="EXACT",e[e.ABOVE=1]="ABOVE",e[e.BELOW=2]="BELOW"}(Uhe||(Uhe={})),function(e){e[e.NotSet=0]="NotSet",e[e.ContentFlush=1]="ContentFlush",e[e.RecoverFromMarkers=2]="RecoverFromMarkers",e[e.Explicit=3]="Explicit",e[e.Paste=4]="Paste",e[e.Undo=5]="Undo",e[e.Redo=6]="Redo"}(Khe||(Khe={})),function(e){e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(jhe||(jhe={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(qhe||(qhe={})),function(e){e[e.None=0]="None",e[e.Keep=1]="Keep",e[e.Brackets=2]="Brackets",e[e.Advanced=3]="Advanced",e[e.Full=4]="Full"}($he||($he={})),function(e){e[e.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",e[e.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",e[e.accessibilitySupport=2]="accessibilitySupport",e[e.accessibilityPageSize=3]="accessibilityPageSize",e[e.allowOverflow=4]="allowOverflow",e[e.allowVariableLineHeights=5]="allowVariableLineHeights",e[e.allowVariableFonts=6]="allowVariableFonts",e[e.allowVariableFontsInAccessibilityMode=7]="allowVariableFontsInAccessibilityMode",e[e.ariaLabel=8]="ariaLabel",e[e.ariaRequired=9]="ariaRequired",e[e.autoClosingBrackets=10]="autoClosingBrackets",e[e.autoClosingComments=11]="autoClosingComments",e[e.screenReaderAnnounceInlineSuggestion=12]="screenReaderAnnounceInlineSuggestion",e[e.autoClosingDelete=13]="autoClosingDelete",e[e.autoClosingOvertype=14]="autoClosingOvertype",e[e.autoClosingQuotes=15]="autoClosingQuotes",e[e.autoIndent=16]="autoIndent",e[e.autoIndentOnPaste=17]="autoIndentOnPaste",e[e.autoIndentOnPasteWithinString=18]="autoIndentOnPasteWithinString",e[e.automaticLayout=19]="automaticLayout",e[e.autoSurround=20]="autoSurround",e[e.bracketPairColorization=21]="bracketPairColorization",e[e.guides=22]="guides",e[e.codeLens=23]="codeLens",e[e.codeLensFontFamily=24]="codeLensFontFamily",e[e.codeLensFontSize=25]="codeLensFontSize",e[e.colorDecorators=26]="colorDecorators",e[e.colorDecoratorsLimit=27]="colorDecoratorsLimit",e[e.columnSelection=28]="columnSelection",e[e.comments=29]="comments",e[e.contextmenu=30]="contextmenu",e[e.copyWithSyntaxHighlighting=31]="copyWithSyntaxHighlighting",e[e.cursorBlinking=32]="cursorBlinking",e[e.cursorSmoothCaretAnimation=33]="cursorSmoothCaretAnimation",e[e.cursorStyle=34]="cursorStyle",e[e.cursorSurroundingLines=35]="cursorSurroundingLines",e[e.cursorSurroundingLinesStyle=36]="cursorSurroundingLinesStyle",e[e.cursorWidth=37]="cursorWidth",e[e.cursorHeight=38]="cursorHeight",e[e.disableLayerHinting=39]="disableLayerHinting",e[e.disableMonospaceOptimizations=40]="disableMonospaceOptimizations",e[e.domReadOnly=41]="domReadOnly",e[e.dragAndDrop=42]="dragAndDrop",e[e.dropIntoEditor=43]="dropIntoEditor",e[e.editContext=44]="editContext",e[e.emptySelectionClipboard=45]="emptySelectionClipboard",e[e.experimentalGpuAcceleration=46]="experimentalGpuAcceleration",e[e.experimentalWhitespaceRendering=47]="experimentalWhitespaceRendering",e[e.extraEditorClassName=48]="extraEditorClassName",e[e.fastScrollSensitivity=49]="fastScrollSensitivity",e[e.find=50]="find",e[e.fixedOverflowWidgets=51]="fixedOverflowWidgets",e[e.folding=52]="folding",e[e.foldingStrategy=53]="foldingStrategy",e[e.foldingHighlight=54]="foldingHighlight",e[e.foldingImportsByDefault=55]="foldingImportsByDefault",e[e.foldingMaximumRegions=56]="foldingMaximumRegions",e[e.unfoldOnClickAfterEndOfLine=57]="unfoldOnClickAfterEndOfLine",e[e.fontFamily=58]="fontFamily",e[e.fontInfo=59]="fontInfo",e[e.fontLigatures=60]="fontLigatures",e[e.fontSize=61]="fontSize",e[e.fontWeight=62]="fontWeight",e[e.fontVariations=63]="fontVariations",e[e.formatOnPaste=64]="formatOnPaste",e[e.formatOnType=65]="formatOnType",e[e.glyphMargin=66]="glyphMargin",e[e.gotoLocation=67]="gotoLocation",e[e.hideCursorInOverviewRuler=68]="hideCursorInOverviewRuler",e[e.hover=69]="hover",e[e.inDiffEditor=70]="inDiffEditor",e[e.inlineSuggest=71]="inlineSuggest",e[e.letterSpacing=72]="letterSpacing",e[e.lightbulb=73]="lightbulb",e[e.lineDecorationsWidth=74]="lineDecorationsWidth",e[e.lineHeight=75]="lineHeight",e[e.lineNumbers=76]="lineNumbers",e[e.lineNumbersMinChars=77]="lineNumbersMinChars",e[e.linkedEditing=78]="linkedEditing",e[e.links=79]="links",e[e.matchBrackets=80]="matchBrackets",e[e.minimap=81]="minimap",e[e.mouseStyle=82]="mouseStyle",e[e.mouseWheelScrollSensitivity=83]="mouseWheelScrollSensitivity",e[e.mouseWheelZoom=84]="mouseWheelZoom",e[e.multiCursorMergeOverlapping=85]="multiCursorMergeOverlapping",e[e.multiCursorModifier=86]="multiCursorModifier",e[e.mouseMiddleClickAction=87]="mouseMiddleClickAction",e[e.multiCursorPaste=88]="multiCursorPaste",e[e.multiCursorLimit=89]="multiCursorLimit",e[e.occurrencesHighlight=90]="occurrencesHighlight",e[e.occurrencesHighlightDelay=91]="occurrencesHighlightDelay",e[e.overtypeCursorStyle=92]="overtypeCursorStyle",e[e.overtypeOnPaste=93]="overtypeOnPaste",e[e.overviewRulerBorder=94]="overviewRulerBorder",e[e.overviewRulerLanes=95]="overviewRulerLanes",e[e.padding=96]="padding",e[e.pasteAs=97]="pasteAs",e[e.parameterHints=98]="parameterHints",e[e.peekWidgetDefaultFocus=99]="peekWidgetDefaultFocus",e[e.placeholder=100]="placeholder",e[e.definitionLinkOpensInPeek=101]="definitionLinkOpensInPeek",e[e.quickSuggestions=102]="quickSuggestions",e[e.quickSuggestionsDelay=103]="quickSuggestionsDelay",e[e.readOnly=104]="readOnly",e[e.readOnlyMessage=105]="readOnlyMessage",e[e.renameOnType=106]="renameOnType",e[e.renderRichScreenReaderContent=107]="renderRichScreenReaderContent",e[e.renderControlCharacters=108]="renderControlCharacters",e[e.renderFinalNewline=109]="renderFinalNewline",e[e.renderLineHighlight=110]="renderLineHighlight",e[e.renderLineHighlightOnlyWhenFocus=111]="renderLineHighlightOnlyWhenFocus",e[e.renderValidationDecorations=112]="renderValidationDecorations",e[e.renderWhitespace=113]="renderWhitespace",e[e.revealHorizontalRightPadding=114]="revealHorizontalRightPadding",e[e.roundedSelection=115]="roundedSelection",e[e.rulers=116]="rulers",e[e.scrollbar=117]="scrollbar",e[e.scrollBeyondLastColumn=118]="scrollBeyondLastColumn",e[e.scrollBeyondLastLine=119]="scrollBeyondLastLine",e[e.scrollPredominantAxis=120]="scrollPredominantAxis",e[e.selectionClipboard=121]="selectionClipboard",e[e.selectionHighlight=122]="selectionHighlight",e[e.selectionHighlightMaxLength=123]="selectionHighlightMaxLength",e[e.selectionHighlightMultiline=124]="selectionHighlightMultiline",e[e.selectOnLineNumbers=125]="selectOnLineNumbers",e[e.showFoldingControls=126]="showFoldingControls",e[e.showUnused=127]="showUnused",e[e.snippetSuggestions=128]="snippetSuggestions",e[e.smartSelect=129]="smartSelect",e[e.smoothScrolling=130]="smoothScrolling",e[e.stickyScroll=131]="stickyScroll",e[e.stickyTabStops=132]="stickyTabStops",e[e.stopRenderingLineAfter=133]="stopRenderingLineAfter",e[e.suggest=134]="suggest",e[e.suggestFontSize=135]="suggestFontSize",e[e.suggestLineHeight=136]="suggestLineHeight",e[e.suggestOnTriggerCharacters=137]="suggestOnTriggerCharacters",e[e.suggestSelection=138]="suggestSelection",e[e.tabCompletion=139]="tabCompletion",e[e.tabIndex=140]="tabIndex",e[e.trimWhitespaceOnDelete=141]="trimWhitespaceOnDelete",e[e.unicodeHighlighting=142]="unicodeHighlighting",e[e.unusualLineTerminators=143]="unusualLineTerminators",e[e.useShadowDOM=144]="useShadowDOM",e[e.useTabStops=145]="useTabStops",e[e.wordBreak=146]="wordBreak",e[e.wordSegmenterLocales=147]="wordSegmenterLocales",e[e.wordSeparators=148]="wordSeparators",e[e.wordWrap=149]="wordWrap",e[e.wordWrapBreakAfterCharacters=150]="wordWrapBreakAfterCharacters",e[e.wordWrapBreakBeforeCharacters=151]="wordWrapBreakBeforeCharacters",e[e.wordWrapColumn=152]="wordWrapColumn",e[e.wordWrapOverride1=153]="wordWrapOverride1",e[e.wordWrapOverride2=154]="wordWrapOverride2",e[e.wrappingIndent=155]="wrappingIndent",e[e.wrappingStrategy=156]="wrappingStrategy",e[e.showDeprecated=157]="showDeprecated",e[e.inertialScroll=158]="inertialScroll",e[e.inlayHints=159]="inlayHints",e[e.wrapOnEscapedLineFeeds=160]="wrapOnEscapedLineFeeds",e[e.effectiveCursorStyle=161]="effectiveCursorStyle",e[e.editorClassName=162]="editorClassName",e[e.pixelRatio=163]="pixelRatio",e[e.tabFocusMode=164]="tabFocusMode",e[e.layoutInfo=165]="layoutInfo",e[e.wrappingInfo=166]="wrappingInfo",e[e.defaultColorDecorators=167]="defaultColorDecorators",e[e.colorDecoratorsActivatedOn=168]="colorDecoratorsActivatedOn",e[e.inlineCompletionsAccessibilityVerbose=169]="inlineCompletionsAccessibilityVerbose",e[e.effectiveEditContext=170]="effectiveEditContext",e[e.scrollOnMiddleClick=171]="scrollOnMiddleClick",e[e.effectiveAllowVariableFonts=172]="effectiveAllowVariableFonts"}(Ghe||(Ghe={})),function(e){e[e.TextDefined=0]="TextDefined",e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(Zhe||(Zhe={})),function(e){e[e.LF=0]="LF",e[e.CRLF=1]="CRLF"}(Yhe||(Yhe={})),function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=3]="Right"}(Qhe||(Qhe={})),function(e){e[e.Increase=0]="Increase",e[e.Decrease=1]="Decrease"}(Xhe||(Xhe={})),function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(Jhe||(Jhe={})),function(e){e[e.Both=0]="Both",e[e.Right=1]="Right",e[e.Left=2]="Left",e[e.None=3]="None"}(ece||(ece={})),function(e){e[e.Type=1]="Type",e[e.Parameter=2]="Parameter"}(tce||(tce={})),function(e){e[e.Code=1]="Code",e[e.Label=2]="Label"}(ice||(ice={})),function(e){e[e.Accepted=0]="Accepted",e[e.Rejected=1]="Rejected",e[e.Ignored=2]="Ignored"}(nce||(nce={})),function(e){e[e.Automatic=0]="Automatic",e[e.Explicit=1]="Explicit"}(oce||(oce={})),function(e){e[e.DependsOnKbLayout=-1]="DependsOnKbLayout",e[e.Unknown=0]="Unknown",e[e.Backspace=1]="Backspace",e[e.Tab=2]="Tab",e[e.Enter=3]="Enter",e[e.Shift=4]="Shift",e[e.Ctrl=5]="Ctrl",e[e.Alt=6]="Alt",e[e.PauseBreak=7]="PauseBreak",e[e.CapsLock=8]="CapsLock",e[e.Escape=9]="Escape",e[e.Space=10]="Space",e[e.PageUp=11]="PageUp",e[e.PageDown=12]="PageDown",e[e.End=13]="End",e[e.Home=14]="Home",e[e.LeftArrow=15]="LeftArrow",e[e.UpArrow=16]="UpArrow",e[e.RightArrow=17]="RightArrow",e[e.DownArrow=18]="DownArrow",e[e.Insert=19]="Insert",e[e.Delete=20]="Delete",e[e.Digit0=21]="Digit0",e[e.Digit1=22]="Digit1",e[e.Digit2=23]="Digit2",e[e.Digit3=24]="Digit3",e[e.Digit4=25]="Digit4",e[e.Digit5=26]="Digit5",e[e.Digit6=27]="Digit6",e[e.Digit7=28]="Digit7",e[e.Digit8=29]="Digit8",e[e.Digit9=30]="Digit9",e[e.KeyA=31]="KeyA",e[e.KeyB=32]="KeyB",e[e.KeyC=33]="KeyC",e[e.KeyD=34]="KeyD",e[e.KeyE=35]="KeyE",e[e.KeyF=36]="KeyF",e[e.KeyG=37]="KeyG",e[e.KeyH=38]="KeyH",e[e.KeyI=39]="KeyI",e[e.KeyJ=40]="KeyJ",e[e.KeyK=41]="KeyK",e[e.KeyL=42]="KeyL",e[e.KeyM=43]="KeyM",e[e.KeyN=44]="KeyN",e[e.KeyO=45]="KeyO",e[e.KeyP=46]="KeyP",e[e.KeyQ=47]="KeyQ",e[e.KeyR=48]="KeyR",e[e.KeyS=49]="KeyS",e[e.KeyT=50]="KeyT",e[e.KeyU=51]="KeyU",e[e.KeyV=52]="KeyV",e[e.KeyW=53]="KeyW",e[e.KeyX=54]="KeyX",e[e.KeyY=55]="KeyY",e[e.KeyZ=56]="KeyZ",e[e.Meta=57]="Meta",e[e.ContextMenu=58]="ContextMenu",e[e.F1=59]="F1",e[e.F2=60]="F2",e[e.F3=61]="F3",e[e.F4=62]="F4",e[e.F5=63]="F5",e[e.F6=64]="F6",e[e.F7=65]="F7",e[e.F8=66]="F8",e[e.F9=67]="F9",e[e.F10=68]="F10",e[e.F11=69]="F11",e[e.F12=70]="F12",e[e.F13=71]="F13",e[e.F14=72]="F14",e[e.F15=73]="F15",e[e.F16=74]="F16",e[e.F17=75]="F17",e[e.F18=76]="F18",e[e.F19=77]="F19",e[e.F20=78]="F20",e[e.F21=79]="F21",e[e.F22=80]="F22",e[e.F23=81]="F23",e[e.F24=82]="F24",e[e.NumLock=83]="NumLock",e[e.ScrollLock=84]="ScrollLock",e[e.Semicolon=85]="Semicolon",e[e.Equal=86]="Equal",e[e.Comma=87]="Comma",e[e.Minus=88]="Minus",e[e.Period=89]="Period",e[e.Slash=90]="Slash",e[e.Backquote=91]="Backquote",e[e.BracketLeft=92]="BracketLeft",e[e.Backslash=93]="Backslash",e[e.BracketRight=94]="BracketRight",e[e.Quote=95]="Quote",e[e.OEM_8=96]="OEM_8",e[e.IntlBackslash=97]="IntlBackslash",e[e.Numpad0=98]="Numpad0",e[e.Numpad1=99]="Numpad1",e[e.Numpad2=100]="Numpad2",e[e.Numpad3=101]="Numpad3",e[e.Numpad4=102]="Numpad4",e[e.Numpad5=103]="Numpad5",e[e.Numpad6=104]="Numpad6",e[e.Numpad7=105]="Numpad7",e[e.Numpad8=106]="Numpad8",e[e.Numpad9=107]="Numpad9",e[e.NumpadMultiply=108]="NumpadMultiply",e[e.NumpadAdd=109]="NumpadAdd",e[e.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",e[e.NumpadSubtract=111]="NumpadSubtract",e[e.NumpadDecimal=112]="NumpadDecimal",e[e.NumpadDivide=113]="NumpadDivide",e[e.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",e[e.ABNT_C1=115]="ABNT_C1",e[e.ABNT_C2=116]="ABNT_C2",e[e.AudioVolumeMute=117]="AudioVolumeMute",e[e.AudioVolumeUp=118]="AudioVolumeUp",e[e.AudioVolumeDown=119]="AudioVolumeDown",e[e.BrowserSearch=120]="BrowserSearch",e[e.BrowserHome=121]="BrowserHome",e[e.BrowserBack=122]="BrowserBack",e[e.BrowserForward=123]="BrowserForward",e[e.MediaTrackNext=124]="MediaTrackNext",e[e.MediaTrackPrevious=125]="MediaTrackPrevious",e[e.MediaStop=126]="MediaStop",e[e.MediaPlayPause=127]="MediaPlayPause",e[e.LaunchMediaPlayer=128]="LaunchMediaPlayer",e[e.LaunchMail=129]="LaunchMail",e[e.LaunchApp2=130]="LaunchApp2",e[e.Clear=131]="Clear",e[e.MAX_VALUE=132]="MAX_VALUE"}(sce||(sce={})),function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"}(rce||(rce={})),function(e){e[e.Unnecessary=1]="Unnecessary",e[e.Deprecated=2]="Deprecated"}(ace||(ace={})),function(e){e[e.Inline=1]="Inline",e[e.Gutter=2]="Gutter"}(lce||(lce={})),function(e){e[e.Normal=1]="Normal",e[e.Underlined=2]="Underlined"}(dce||(dce={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.TEXTAREA=1]="TEXTAREA",e[e.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",e[e.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",e[e.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",e[e.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",e[e.CONTENT_TEXT=6]="CONTENT_TEXT",e[e.CONTENT_EMPTY=7]="CONTENT_EMPTY",e[e.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",e[e.CONTENT_WIDGET=9]="CONTENT_WIDGET",e[e.OVERVIEW_RULER=10]="OVERVIEW_RULER",e[e.SCROLLBAR=11]="SCROLLBAR",e[e.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",e[e.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"}(hce||(hce={})),function(e){e[e.AIGenerated=1]="AIGenerated"}(cce||(cce={})),function(e){e[e.Invoke=0]="Invoke",e[e.Automatic=1]="Automatic"}(uce||(uce={})),function(e){e[e.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",e[e.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",e[e.TOP_CENTER=2]="TOP_CENTER"}(gce||(gce={})),function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"}(pce||(pce={})),function(e){e[e.Word=0]="Word",e[e.Line=1]="Line",e[e.Suggest=2]="Suggest"}(mce||(mce={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.None=2]="None",e[e.LeftOfInjectedText=3]="LeftOfInjectedText",e[e.RightOfInjectedText=4]="RightOfInjectedText"}(fce||(fce={})),function(e){e[e.Off=0]="Off",e[e.On=1]="On",e[e.Relative=2]="Relative",e[e.Interval=3]="Interval",e[e.Custom=4]="Custom"}(_ce||(_ce={})),function(e){e[e.None=0]="None",e[e.Text=1]="Text",e[e.Blocks=2]="Blocks"}(vce||(vce={})),function(e){e[e.Smooth=0]="Smooth",e[e.Immediate=1]="Immediate"}(bce||(bce={})),function(e){e[e.Auto=1]="Auto",e[e.Hidden=2]="Hidden",e[e.Visible=3]="Visible"}(wce||(wce={})),function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"}(Cce||(Cce={})),function(e){e.Off="off",e.OnCode="onCode",e.On="on"}(yce||(yce={})),function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(Sce||(Sce={})),function(e){e[e.File=0]="File",e[e.Module=1]="Module",e[e.Namespace=2]="Namespace",e[e.Package=3]="Package",e[e.Class=4]="Class",e[e.Method=5]="Method",e[e.Property=6]="Property",e[e.Field=7]="Field",e[e.Constructor=8]="Constructor",e[e.Enum=9]="Enum",e[e.Interface=10]="Interface",e[e.Function=11]="Function",e[e.Variable=12]="Variable",e[e.Constant=13]="Constant",e[e.String=14]="String",e[e.Number=15]="Number",e[e.Boolean=16]="Boolean",e[e.Array=17]="Array",e[e.Object=18]="Object",e[e.Key=19]="Key",e[e.Null=20]="Null",e[e.EnumMember=21]="EnumMember",e[e.Struct=22]="Struct",e[e.Event=23]="Event",e[e.Operator=24]="Operator",e[e.TypeParameter=25]="TypeParameter"}(xce||(xce={})),function(e){e[e.Deprecated=1]="Deprecated"}(kce||(kce={})),function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"}(Lce||(Lce={})),function(e){e[e.Hidden=0]="Hidden",e[e.Blink=1]="Blink",e[e.Smooth=2]="Smooth",e[e.Phase=3]="Phase",e[e.Expand=4]="Expand",e[e.Solid=5]="Solid"}(Dce||(Dce={})),function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin"}(Ece||(Ece={})),function(e){e[e.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",e[e.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",e[e.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",e[e.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"}(Nce||(Nce={})),function(e){e[e.None=0]="None",e[e.Same=1]="Same",e[e.Indent=2]="Indent",e[e.DeepIndent=3]="DeepIndent"}(Ice||(Ice={}));class Tce{static{this.CtrlCmd=2048}static{this.Shift=1024}static{this.Alt=512}static{this.WinCtrl=256}static chord(e,t){return De(e,t)}}function Mce(){return{editor:void 0,languages:void 0,CancellationTokenSource:ri,Emitter:Zt,KeyCode:sce,KeyMod:Tce,Position:rc,Range:Yu,Selection:Qu,SelectionDirection:Cce,MarkerSeverity:rce,MarkerTag:ace,Uri:uo,Token:MS}}var Ace=i(3614),Rce={};Rce.styleTagTransform=zl(),Rce.setAttributes=Bl(),Rce.insert=Pl().bind(null,"head"),Rce.domAPI=Rl(),Rce.insertStyleElement=Vl(),Ml()(Ace.A,Rce),Ace.A&&Ace.A.locals&&Ace.A.locals;const Oce="default";let Pce,Fce=!1;function Bce(e){Y&&(Fce||(Fce=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(e.message))}class Wce{constructor(e,t,i,n,o){this.vsWorker=e,this.req=t,this.channel=i,this.method=n,this.args=o,this.type=0}}class Vce{constructor(e,t,i,n){this.vsWorker=e,this.seq=t,this.res=i,this.err=n,this.type=1}}class Hce{constructor(e,t,i,n,o){this.vsWorker=e,this.req=t,this.channel=i,this.eventName=n,this.arg=o,this.type=2}}class zce{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class Uce{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class Kce{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t,i){const n=String(++this._lastSentReq);return new Promise(((o,s)=>{this._pendingReplies[n]={resolve:o,reject:s},this._send(new Wce(this._workerId,n,e,t,i))}))}listen(e,t,i){let n=null;const o=new Zt({onWillAddFirstListener:()=>{n=String(++this._lastSentReq),this._pendingEmitters.set(n,o),this._send(new Hce(this._workerId,n,e,t,i))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(n),this._send(new Uce(this._workerId,n)),n=null}});return o.event}handleMessage(e){e&&e.vsWorker&&(-1!==this._workerId&&e.vsWorker!==this._workerId||this._handleMessage(e))}createProxyToRemoteChannel(e,t){const i={get:(i,n)=>("string"!=typeof n||i[n]||($ce(n)?i[n]=t=>this.listen(e,n,t):qce(n)?i[n]=this.listen(e,n,void 0):36===n.charCodeAt(0)&&(i[n]=async(...i)=>(await(t?.()),this.sendMessage(e,n,i)))),i[n])};return new Proxy(Object.create(null),i)}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq])return void console.warn("Got reply to unknown seq");const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;return e.err.$isError&&(i=new Error,i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack),void t.reject(i)}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.channel,e.method,e.args).then((e=>{this._send(new Vce(this._workerId,t,e,void 0))}),(e=>{e.detail instanceof Error&&(e.detail=Me(e.detail)),this._send(new Vce(this._workerId,t,void 0,Me(e)))}))}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.channel,e.eventName,e.arg)((e=>{this._send(new zce(this._workerId,t,e))}));this._pendingEvents.set(t,i)}_handleEventMessage(e){this._pendingEmitters.has(e.req)?this._pendingEmitters.get(e.req).fire(e.event):console.warn("Got event for unknown req")}_handleUnsubscribeEventMessage(e){this._pendingEvents.has(e.req)?(this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)):console.warn("Got unsubscribe for unknown req")}_send(e){const t=[];if(0===e.type)for(let i=0;i<e.args.length;i++)e.args[i]instanceof ArrayBuffer&&t.push(e.args[i]);else 1===e.type&&e.res instanceof ArrayBuffer&&t.push(e.res);this._handler.sendMessage(e,t)}}class jce extends At{constructor(e){super(),this._localChannels=new Map,this._worker=this._register(e),this._register(this._worker.onMessage((e=>{this._protocol.handleMessage(e)}))),this._register(this._worker.onError((e=>{Bce(e),Ie(e)}))),this._protocol=new Kce({sendMessage:(e,t)=>{this._worker.postMessage(e,t)},handleMessage:(e,t,i)=>this._handleMessage(e,t,i),handleEvent:(e,t,i)=>this._handleEvent(e,t,i)}),this._protocol.setWorkerId(this._worker.getId()),this._onModuleLoaded=this._protocol.sendMessage(Oce,"$initialize",[this._worker.getId()]),this.proxy=this._protocol.createProxyToRemoteChannel(Oce,(async()=>{await this._onModuleLoaded})),this._onModuleLoaded.catch((e=>{this._onError("Worker failed to load ",e)}))}_handleMessage(e,t,i){const n=this._localChannels.get(e);if(!n)return Promise.reject(new Error(`Missing channel ${e} on main thread`));if("function"!=typeof n[t])return Promise.reject(new Error(`Missing method ${t} on main thread channel ${e}`));try{return Promise.resolve(n[t].apply(n,i))}catch(e){return Promise.reject(e)}}_handleEvent(e,t,i){const n=this._localChannels.get(e);if(!n)throw new Error(`Missing channel ${e} on main thread`);if($ce(t)){const o=n[t].call(n,i);if("function"!=typeof o)throw new Error(`Missing dynamic event ${t} on main thread channel ${e}.`);return o}if(qce(t)){const i=n[t];if("function"!=typeof i)throw new Error(`Missing event ${t} on main thread channel ${e}.`);return i}throw new Error(`Malformed event name ${t}`)}setChannel(e,t){this._localChannels.set(e,t)}_onError(e,t){console.error(e),console.info(t)}}function qce(e){return"o"===e[0]&&"n"===e[1]&&nn(e.charCodeAt(2))}function $ce(e){return/^onDynamic/.test(e)&&nn(e.charCodeAt(9))}Pce="object"==typeof self&&self.constructor&&"DedicatedWorkerGlobalScope"===self.constructor.name&&void 0!==globalThis.workerttPolicy?globalThis.workerttPolicy:GI("defaultWorkerFactory",{createScriptURL:e=>e});class Gce extends At{static{this.LAST_WORKER_ID=0}constructor(e){super(),this._onMessage=this._register(new Zt),this.onMessage=this._onMessage.event,this._onError=this._register(new Zt),this.onError=this._onError.event,this.id=++Gce.LAST_WORKER_ID;const t=e instanceof Worker||"then"in e?e:function(e,t){const i=e.label||"anonymous"+t,n=globalThis.MonacoEnvironment;if(n){if("function"==typeof n.getWorker)return n.getWorker("workerMain.js",i);if("function"==typeof n.getWorkerUrl){const e=n.getWorkerUrl("workerMain.js",i);return new Worker(Pce?Pce.createScriptURL(e):e,{name:i,type:"module"})}}const o=e.esmModuleLocation;if(o){const e=function(e,t){if(/^((http:)|(https:)|(file:))/.test(t)&&t.substring(0,globalThis.origin.length)!==globalThis.origin);else{const i=t.lastIndexOf("?"),n=t.lastIndexOf("#",i),o=i>0?new URLSearchParams(t.substring(i+1,~n?n:void 0)):new URLSearchParams;No.addSearchParam(o,!0,!0),t=o.toString()?`${t}?${o.toString()}#${e}`:`${t}#${e}`}const i=new Blob([as([`/*${e}*/`,`globalThis._VSCODE_NLS_MESSAGES = ${JSON.stringify(v())};`,`globalThis._VSCODE_NLS_LANGUAGE = ${JSON.stringify(b())};`,`globalThis._VSCODE_FILE_ROOT = ${JSON.stringify(globalThis._VSCODE_FILE_ROOT)};`,"const ttPolicy = globalThis.trustedTypes?.createPolicy('defaultWorkerFactory', { createScriptURL: value => value });","globalThis.workerttPolicy = ttPolicy;",`await import(ttPolicy?.createScriptURL(${JSON.stringify(t)}) ?? ${JSON.stringify(t)});`,"globalThis.postMessage({ type: 'vscode-worker-ready' });",`/*${e}*/`]).join("")],{type:"application/javascript"});return URL.createObjectURL(i)}(i,o.toString(!0));return s=new Worker(Pce?Pce.createScriptURL(e):e,{name:i,type:"module"}),new Promise(((e,t)=>{s.onmessage=function(t){"vscode-worker-ready"===t.data.type&&(s.onmessage=null,e(s))},s.onerror=t}))}var s;throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}(e,this.id);var i;(i=t)&&"function"==typeof i.then?this.worker=t:this.worker=Promise.resolve(t),this.postMessage("-please-ignore-",[]);const n=e=>{this._onError.fire(e)};this.worker.then((e=>{e.onmessage=e=>{this._onMessage.fire(e.data)},e.onmessageerror=e=>{this._onError.fire(e)},"function"==typeof e.addEventListener&&e.addEventListener("error",n)})),this._register(Tt((()=>{this.worker?.then((e=>{e.onmessage=null,e.onmessageerror=null,e.removeEventListener("error",n),e.terminate()})),this.worker=null})))}getId(){return this.id}postMessage(e,t){this.worker?.then((i=>{try{i.postMessage(e,t)}catch(e){Ie(e),Ie(new Error("FAILED to post message to worker",{cause:e}))}}))}}class Zce{constructor(e,t){this.esmModuleLocation=e,this.label=t}}class Yce{constructor(e,t,i){const n=new Uint8Array(e*t);for(let o=0,s=e*t;o<s;o++)n[o]=i;this._data=n,this.rows=e,this.cols=t}get(e,t){return this._data[e*this.cols+t]}set(e,t,i){this._data[e*this.cols+t]=i}}class Qce{constructor(e){let t=0,i=0;for(let n=0,o=e.length;n<o;n++){const[o,s,r]=e[n];s>t&&(t=s),o>i&&(i=o),r>i&&(i=r)}t++,i++;const n=new Yce(i,t,0);for(let t=0,i=e.length;t<i;t++){const[i,o,s]=e[t];n.set(i,o,s)}this._states=n,this._maxCharCode=t}nextState(e,t){return t<0||t>=this._maxCharCode?0:this._states.get(e,t)}}let Xce=null,Jce=null;class eue{static _createLink(e,t,i,n,o){let s=o-1;do{const i=t.charCodeAt(s);if(2!==e.get(i))break;s--}while(s>n);if(n>0){const e=t.charCodeAt(n-1),i=t.charCodeAt(s);(40===e&&41===i||91===e&&93===i||123===e&&125===i)&&s--}return{range:{startLineNumber:i,startColumn:n+1,endLineNumber:i,endColumn:s+2},url:t.substring(n,s+1)}}static computeLinks(e,t=function(){return null===Xce&&(Xce=new Qce([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),Xce}()){const i=function(){if(null===Jce){Jce=new zy(0);const e=" \t<>'\"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…|";for(let t=0;t<e.length;t++)Jce.set(e.charCodeAt(t),1);const t=".,;:";for(let e=0;e<t.length;e++)Jce.set(t.charCodeAt(e),2)}return Jce}(),n=[];for(let o=1,s=e.getLineCount();o<=s;o++){const s=e.getLineContent(o),r=s.length;let a=0,l=0,d=0,h=1,c=!1,u=!1,g=!1,p=!1;for(;a<r;){let e=!1;const r=s.charCodeAt(a);if(13===h){let t;switch(r){case 40:c=!0,t=0;break;case 41:t=c?0:1;break;case 91:g=!0,u=!0,t=0;break;case 93:g=!1,t=u?0:1;break;case 123:p=!0,t=0;break;case 125:t=p?0:1;break;case 39:case 34:case 96:t=d===r?1:39===d||34===d||96===d?0:1;break;case 42:t=42===d?1:0;break;case 32:t=g?0:1;break;default:t=i.get(r)}1===t&&(n.push(eue._createLink(i,s,o,l,a)),e=!0)}else if(12===h){let t;91===r?(u=!0,t=0):t=i.get(r),1===t?e=!0:h=13}else h=t.nextState(h,r),0===h&&(e=!0);e&&(h=1,c=!1,u=!1,p=!1,l=a+1,d=r),a++}13===h&&n.push(eue._createLink(i,s,o,l,r))}return n}}class tue{constructor(){this._defaultValueSet=[["true","false"],["True","False"],["Private","Public","Friend","ReadOnly","Partial","Protected","WriteOnly"],["public","protected","private"]]}static{this.INSTANCE=new tue}navigateValueSet(e,t,i,n,o){if(e&&t){const i=this.doNavigateValueSet(t,o);if(i)return{range:e,value:i}}if(i&&n){const e=this.doNavigateValueSet(n,o);if(e)return{range:i,value:e}}return null}doNavigateValueSet(e,t){const i=this.numberReplace(e,t);return null!==i?i:this.textReplace(e,t)}numberReplace(e,t){const i=Math.pow(10,e.length-(e.lastIndexOf(".")+1));let n=Number(e);const o=parseFloat(e);return isNaN(n)||isNaN(o)||n!==o?null:0!==n||t?(n=Math.floor(n*i),n+=t?i:-i,String(n/i)):null}textReplace(e,t){return this.valueSetsReplace(this._defaultValueSet,e,t)}valueSetsReplace(e,t,i){let n=null;for(let o=0,s=e.length;null===n&&o<s;o++)n=this.valueSetReplace(e[o],t,i);return n}valueSetReplace(e,t,i){let n=e.indexOf(t);return n>=0?(n+=i?1:-1,n<0?n=e.length-1:n%=e.length,e[n]):null}}function iue(e){const t=[];for(const i of e){const e=Number(i);(e||0===e&&""!==i.replace(/\s/g,""))&&t.push(e)}return t}function nue(e,t,i,n){return{red:e/255,blue:i/255,green:t/255,alpha:n}}function oue(e,t){const i=t.index,n=t[0].length;if(void 0===i)return;const o=e.positionAt(i);return{startLineNumber:o.lineNumber,startColumn:o.column,endLineNumber:o.lineNumber,endColumn:o.column+n}}function sue(e,t){if(!e)return;const i=Lg.Format.CSS.parseHex(t);return i?{range:e,color:nue(i.rgba.r,i.rgba.g,i.rgba.b,i.rgba.a)}:void 0}function rue(e,t,i){if(!e||1!==t.length)return;const n=iue(t[0].values());return{range:e,color:nue(n[0],n[1],n[2],i?n[3]:1)}}function aue(e,t,i){if(!e||1!==t.length)return;const n=iue(t[0].values()),o=new Lg(new xg(n[0],n[1]/100,n[2]/100,i?n[3]:1));return{range:e,color:nue(o.rgba.r,o.rgba.g,o.rgba.b,o.rgba.a)}}function lue(e,t){return"string"==typeof e?[...e.matchAll(t)]:e.findMatches(t)}const due=/^-+|-+$/g;function hue(e){const t=(e=e.trim()).startsWith("-");return{text:e=e.replace(due,""),hasSeparatorLine:t}}class cue{constructor(e,t,i,n){this._uri=e,this._lines=t,this._eol=i,this._versionId=n,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}get version(){return this._versionId}getText(){return null===this._cachedTextValue&&(this._cachedTextValue=this._lines.join(this._eol)),this._cachedTextValue}onEvents(e){e.eol&&e.eol!==this._eol&&(this._eol=e.eol,this._lineStarts=null);const t=e.changes;for(const e of t)this._acceptDeleteRange(e.range),this._acceptInsertText(new rc(e.range.startLineNumber,e.range.startColumn),e.text);this._versionId=e.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){const e=this._eol.length,t=this._lines.length,i=new Uint32Array(t);for(let n=0;n<t;n++)i[n]=this._lines[n].length+e;this._lineStarts=new Oj(i)}}_setLineText(e,t){this._lines[e]=t,this._lineStarts&&this._lineStarts.setValue(e,this._lines[e].length+this._eol.length)}_acceptDeleteRange(e){if(e.startLineNumber!==e.endLineNumber)this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.endLineNumber-1].substring(e.endColumn-1)),this._lines.splice(e.startLineNumber,e.endLineNumber-e.startLineNumber),this._lineStarts&&this._lineStarts.removeValues(e.startLineNumber,e.endLineNumber-e.startLineNumber);else{if(e.startColumn===e.endColumn)return;this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.startLineNumber-1].substring(e.endColumn-1))}}_acceptInsertText(e,t){if(0===t.length)return;const i=qi(t);if(1===i.length)return void this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+i[0]+this._lines[e.lineNumber-1].substring(e.column-1));i[i.length-1]+=this._lines[e.lineNumber-1].substring(e.column-1),this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+i[0]);const n=new Uint32Array(i.length-1);for(let t=1;t<i.length;t++)this._lines.splice(e.lineNumber+t-1,0,i[t]),n[t-1]=i[t].length+this._eol.length;this._lineStarts&&this._lineStarts.insertValues(e.lineNumber,n)}}class uue extends At{constructor(e,t,i=!1){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const e=new wi;e.cancelAndSet((()=>this._checkStopModelSync()),Math.round(3e4)),this._register(e)}}dispose(){for(const e in this._syncedModels)Et(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t=!1){for(const i of e){const e=i.toString();this._syncedModels[e]||this._beginModelSync(i,t),this._syncedModels[e]&&(this._syncedModelsLastUsedTime[e]=(new Date).getTime())}}_checkStopModelSync(){const e=(new Date).getTime(),t=[];for(const i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>6e4&&t.push(i);for(const e of t)this._stopModelSync(e)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i)return;if(!t&&i.isTooLargeForSyncing())return;const n=e.toString();this._proxy.$acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const o=new Mt;o.add(i.onDidChangeContent((e=>{this._proxy.$acceptModelChanged(n.toString(),e)}))),o.add(i.onWillDispose((()=>{this._stopModelSync(n)}))),o.add(Tt((()=>{this._proxy.$acceptRemovedModel(n)}))),this._syncedModels[n]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],Et(t)}}class gue{constructor(){this._models=Object.create(null)}getModel(e){return this._models[e]}getModels(){const e=[];return Object.keys(this._models).forEach((t=>e.push(this._models[t]))),e}$acceptNewModel(e){this._models[e.url]=new pue(uo.parse(e.url),e.lines,e.EOL,e.versionId)}$acceptModelChanged(e,t){this._models[e]&&this._models[e].onEvents(t)}$acceptRemovedModel(e){this._models[e]&&delete this._models[e]}}class pue extends cue{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let i=0;i<this._lines.length;i++){const n=this._lines[i],o=this.offsetAt(new rc(i+1,1)),s=n.matchAll(e);for(const e of s)(e.index||0===e.index)&&(e.index=e.index+o),t.push(e)}return t}getLinesContent(){return this._lines.slice(0)}getLineCount(){return this._lines.length}getLineContent(e){return this._lines[e-1]}getWordAtPosition(e,t){const i=Pg(e.column,Rg(t),this._lines[e.lineNumber-1],0);return i?new Yu(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn):null}words(e){const t=this._lines,i=this._wordenize.bind(this);let n=0,o="",s=0,r=[];return{*[Symbol.iterator](){for(;;)if(s<r.length){const e=o.substring(r[s].start,r[s].end);s+=1,yield e}else{if(!(n<t.length))break;o=t[n],r=i(o,e),s=0,n+=1}}}}getLineWords(e,t){const i=this._lines[e-1],n=this._wordenize(i,t),o=[];for(const e of n)o.push({word:i.substring(e.start,e.end),startColumn:e.start+1,endColumn:e.end+1});return o}_wordenize(e,t){const i=[];let n;for(t.lastIndex=0;(n=t.exec(e))&&0!==n[0].length;)i.push({start:n.index,end:n.index+n[0].length});return i}getValueInRange(e){if((e=this._validateRange(e)).startLineNumber===e.endLineNumber)return this._lines[e.startLineNumber-1].substring(e.startColumn-1,e.endColumn-1);const t=this._eol,i=e.startLineNumber-1,n=e.endLineNumber-1,o=[];o.push(this._lines[i].substring(e.startColumn-1));for(let e=i+1;e<n;e++)o.push(this._lines[e]);return o.push(this._lines[n].substring(0,e.endColumn-1)),o.join(t)}offsetAt(e){return e=this._validatePosition(e),this._ensureLineStarts(),this._lineStarts.getPrefixSum(e.lineNumber-2)+(e.column-1)}positionAt(e){e=Math.floor(e),e=Math.max(0,e),this._ensureLineStarts();const t=this._lineStarts.getIndexOf(e),i=this._lines[t.index].length;return{lineNumber:1+t.index,column:1+Math.min(t.remainder,i)}}_validateRange(e){const t=this._validatePosition({lineNumber:e.startLineNumber,column:e.startColumn}),i=this._validatePosition({lineNumber:e.endLineNumber,column:e.endColumn});return t.lineNumber!==e.startLineNumber||t.column!==e.startColumn||i.lineNumber!==e.endLineNumber||i.column!==e.endColumn?{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:i.lineNumber,endColumn:i.column}:e}_validatePosition(e){if(!rc.isIPosition(e))throw new Error("bad position");let{lineNumber:t,column:i}=e,n=!1;if(t<1)t=1,i=1,n=!0;else if(t>this._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,n=!0;else{const e=this._lines[t-1].length+1;i<1?(i=1,n=!0):i>e&&(i=e,n=!0)}return n?{lineNumber:t,column:i}:e}}class mue{constructor(e=null){this._foreignModule=e,this._workerTextModelSyncServer=new gue}dispose(){}async $ping(){return"pong"}_getModel(e){return this._workerTextModelSyncServer.getModel(e)}getModels(){return this._workerTextModelSyncServer.getModels()}$acceptNewModel(e){this._workerTextModelSyncServer.$acceptNewModel(e)}$acceptModelChanged(e,t){this._workerTextModelSyncServer.$acceptModelChanged(e,t)}$acceptRemovedModel(e){this._workerTextModelSyncServer.$acceptRemovedModel(e)}async $computeUnicodeHighlights(e,t,i){const n=this._getModel(e);return n?cde.computeUnicodeHighlights(n,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async $findSectionHeaders(e,t){const i=this._getModel(e);return i?function(e,t){let i=[];if(t.findRegionSectionHeaders&&t.foldingRules?.markers){const n=function(e,t){const i=[],n=e.getLineCount();for(let o=1;o<=n;o++){const n=e.getLineContent(o),s=n.match(t.foldingRules.markers.start);if(s){const e={startLineNumber:o,startColumn:s[0].length+1,endLineNumber:o,endColumn:n.length+1};if(e.endColumn>e.startColumn){const t={range:e,...hue(n.substring(s[0].length)),shouldBeInComments:!1};(t.text||t.hasSeparatorLine)&&i.push(t)}}}return i}(e,t);i=i.concat(n)}if(t.findMarkSectionHeaders){const n=function(e,t){const i=[],n=e.getLineCount();if(!t.markSectionHeaderRegex||""===t.markSectionHeaderRegex.trim())return i;const o=Gy(t.markSectionHeaderRegex),s=new RegExp(t.markSectionHeaderRegex,"gdm"+(o?"s":""));if(ji(s))return i;for(let t=1;t<=n;t+=95){const o=Math.min(t+100-1,n),r=[];for(let i=t;i<=o;i++)r.push(e.getLineContent(i));const a=r.join("\n");let l;for(s.lastIndex=0;null!==(l=s.exec(a));){const e=a.substring(0,l.index),n=t+(e.match(/\n/g)||[]).length,o=l[0].split("\n"),r=o.length,d=n+r-1,h=e.lastIndexOf("\n")+1,c=l.index-h+1,u=o[o.length-1],g={range:{startLineNumber:n,startColumn:c,endLineNumber:d,endColumn:1===r?c+l[0].length:u.length+1},text:(l.groups??{}).label??"",hasSeparatorLine:""!==((l.groups??{}).separator??""),shouldBeInComments:!0};(g.text||g.hasSeparatorLine)&&(0===i.length||i[i.length-1].range.endLineNumber<g.range.startLineNumber)&&i.push(g),s.lastIndex=l.index+l[0].length}}return i}(e,t);i=i.concat(n)}return i}(i,t):[]}async $computeDiff(e,t,i,n){const o=this._getModel(e),s=this._getModel(t);return o&&s?mue.computeDiff(o,s,i,n):null}static computeDiff(e,t,i,n){const o="advanced"===n?ate():new Qee,s=e.getLinesContent(),r=t.getLinesContent(),a=o.computeDiff(s,r,i);function l(e){return e.map((e=>[e.original.startLineNumber,e.original.endLineNumberExclusive,e.modified.startLineNumber,e.modified.endLineNumberExclusive,e.innerChanges?.map((e=>[e.originalRange.startLineNumber,e.originalRange.startColumn,e.originalRange.endLineNumber,e.originalRange.endColumn,e.modifiedRange.startLineNumber,e.modifiedRange.startColumn,e.modifiedRange.endLineNumber,e.modifiedRange.endColumn]))]))}return{identical:!(a.changes.length>0)&&this._modelsAreIdentical(e,t),quitEarly:a.hitTimeout,changes:l(a.changes),moves:a.moves.map((e=>[e.lineRangeMapping.original.startLineNumber,e.lineRangeMapping.original.endLineNumberExclusive,e.lineRangeMapping.modified.startLineNumber,e.lineRangeMapping.modified.endLineNumberExclusive,l(e.changes)]))}}static _modelsAreIdentical(e,t){const i=e.getLineCount();if(i!==t.getLineCount())return!1;for(let n=1;n<=i;n++)if(e.getLineContent(n)!==t.getLineContent(n))return!1;return!0}static{this._diffLimit=1e5}async $computeMoreMinimalEdits(e,t,i){const n=this._getModel(e);if(!n)return t;const o=[];let s;t=t.slice(0).sort(((e,t)=>e.range&&t.range?Yu.compareRangesUsingStarts(e.range,t.range):(e.range?0:1)-(t.range?0:1)));let r=0;for(let e=1;e<t.length;e++)Yu.getEndPosition(t[r].range).equals(Yu.getStartPosition(t[e].range))?(t[r].range=Yu.fromPositions(Yu.getStartPosition(t[r].range),Yu.getEndPosition(t[e].range)),t[r].text+=t[e].text):(r++,t[r]=t[e]);t.length=r+1;for(let{range:e,text:r,eol:a}of t){if("number"==typeof a&&(s=a),Yu.isEmpty(e)&&!r)continue;const t=n.getValueInRange(e);if(r=r.replace(/\r\n|\n|\r/g,n.eol),t===r)continue;if(Math.max(r.length,t.length)>mue._diffLimit){o.push({range:e,text:r});continue}const l=TQ(t,r,i),d=n.offsetAt(Yu.lift(e).getStartPosition());for(const e of l){const t=n.positionAt(d+e.originalStart),i=n.positionAt(d+e.originalStart+e.originalLength),s={text:r.substr(e.modifiedStart,e.modifiedLength),range:{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:i.lineNumber,endColumn:i.column}};n.getValueInRange(s.range)!==s.text&&o.push(s)}}return"number"==typeof s&&o.push({eol:s,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o}async $computeLinks(e){const t=this._getModel(e);return t?function(e){return e&&"function"==typeof e.getLineCount&&"function"==typeof e.getLineContent?eue.computeLinks(e):[]}(t):null}async $computeDefaultDocumentColors(e){const t=this._getModel(e);return t?function(e){return e&&"function"==typeof e.getValue&&"function"==typeof e.positionAt?function(e){const t=[],i=lue(e,/\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%]*\))|^(#)([A-Fa-f0-9]{3})\b|^(#)([A-Fa-f0-9]{4})\b|^(#)([A-Fa-f0-9]{6})\b|^(#)([A-Fa-f0-9]{8})\b|(?<=['"\s])(#)([A-Fa-f0-9]{3})\b|(?<=['"\s])(#)([A-Fa-f0-9]{4})\b|(?<=['"\s])(#)([A-Fa-f0-9]{6})\b|(?<=['"\s])(#)([A-Fa-f0-9]{8})\b/gm);if(i.length>0)for(const n of i){const i=n.filter((e=>void 0!==e)),o=i[1],s=i[2];if(!s)continue;let r;if("rgb"===o){const t=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;r=rue(oue(e,n),lue(s,t),!1)}else if("rgba"===o){const t=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;r=rue(oue(e,n),lue(s,t),!0)}else if("hsl"===o){const t=/^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;r=aue(oue(e,n),lue(s,t),!1)}else if("hsla"===o){const t=/^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(0[.][0-9]+|[.][0-9]+|[01][.]0*|[01])\s*\)$/gm;r=aue(oue(e,n),lue(s,t),!0)}else"#"===o&&(r=sue(oue(e,n),o+s));r&&t.push(r)}return t}(e):[]}(t):null}static{this._suggestionsLimit=1e4}async $textualSuggest(e,t,i,n){const o=new Ht,s=new RegExp(i,n),r=new Set;e:for(const i of e){const e=this._getModel(i);if(e)for(const i of e.words(s))if(i!==t&&isNaN(Number(i))&&(r.add(i),r.size>mue._suggestionsLimit))break e}return{words:Array.from(r),duration:o.elapsed()}}async $computeWordRanges(e,t,i,n){const o=this._getModel(e);if(!o)return Object.create(null);const s=new RegExp(i,n),r=Object.create(null);for(let e=t.startLineNumber;e<t.endLineNumber;e++){const t=o.getLineWords(e,s);for(const i of t){if(!isNaN(Number(i.word)))continue;let t=r[i.word];t||(t=[],r[i.word]=t),t.push({startLineNumber:e,startColumn:i.startColumn,endLineNumber:e,endColumn:i.endColumn})}}return r}async $navigateValueSet(e,t,i,n,o){const s=this._getModel(e);if(!s)return null;const r=new RegExp(n,o);t.startColumn===t.endColumn&&(t={startLineNumber:t.startLineNumber,startColumn:t.startColumn,endLineNumber:t.endLineNumber,endColumn:t.endColumn+1});const a=s.getValueInRange(t),l=s.getWordAtPosition({lineNumber:t.startLineNumber,column:t.startColumn},r);if(!l)return null;const d=s.getValueInRange(l);return tue.INSTANCE.navigateValueSet(t,a,l,d,i)}$fmr(e,t){if(!this._foreignModule||"function"!=typeof this._foreignModule[e])return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(e){return Promise.reject(e)}}}"function"==typeof importScripts&&(globalThis.monaco=Mce());class fue{static{this.CHANNEL_NAME="editorWorkerHost"}static getChannel(e){return e.getChannel(fue.CHANNEL_NAME)}static setChannel(e,t){e.setChannel(fue.CHANNEL_NAME,t)}}var _ue=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},vue=function(e,t){return function(i,n){t(i,n,e)}};function bue(e,t){const i=e.getModel(t);return!!i&&!i.isTooLargeForSyncing()}let wue=class extends At{constructor(e,t,i,n,o,s){super(),this._languageConfigurationService=o,this._modelService=t,this._workerManager=this._register(new yue(e,this._modelService)),this._logService=n,this._register(s.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:async(e,t)=>{if(!bue(this._modelService,e.uri))return Promise.resolve({links:[]});const i=await this._workerWithResources([e.uri]),n=await i.$computeLinks(e.uri.toString());return n&&{links:n}}})),this._register(s.completionProvider.register("*",new Cue(this._workerManager,i,this._modelService,this._languageConfigurationService,this._logService)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return bue(this._modelService,e)}async computedUnicodeHighlights(e,t,i){return(await this._workerWithResources([e])).$computeUnicodeHighlights(e.toString(),t,i)}async computeDiff(e,t,i,n){const o=await this._workerWithResources([e,t],!0),s=await o.$computeDiff(e.toString(),t.toString(),i,n);if(!s)return null;const r={identical:s.identical,quitEarly:s.quitEarly,changes:a(s.changes),moves:s.moves.map((e=>new u4(new S2(new ym(e[0],e[1]),new ym(e[2],e[3])),a(e[4]))))};return r;function a(e){return e.map((e=>new L2(new ym(e[0],e[1]),new ym(e[2],e[3]),e[4]?.map((e=>new D2(new Yu(e[0],e[1],e[2],e[3]),new Yu(e[4],e[5],e[6],e[7])))))))}}async computeMoreMinimalEdits(e,t,i=!1){if(hs(t)){if(!bue(this._modelService,e))return Promise.resolve(t);const n=Ht.create(),o=this._workerWithResources([e]).then((n=>n.$computeMoreMinimalEdits(e.toString(),t,i)));return o.finally((()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),n.elapsed()))),Promise.race([o,mi(1e3).then((()=>t))])}return Promise.resolve(void 0)}canNavigateValueSet(e){return bue(this._modelService,e)}async navigateValueSet(e,t,i){const n=this._modelService.getModel(e);if(!n)return null;const o=this._languageConfigurationService.getLanguageConfiguration(n.getLanguageId()).getWordDefinition(),s=o.source,r=o.flags;return(await this._workerWithResources([e])).$navigateValueSet(e.toString(),t,i,s,r)}canComputeWordRanges(e){return bue(this._modelService,e)}async computeWordRanges(e,t){const i=this._modelService.getModel(e);if(!i)return Promise.resolve(null);const n=this._languageConfigurationService.getLanguageConfiguration(i.getLanguageId()).getWordDefinition(),o=n.source,s=n.flags;return(await this._workerWithResources([e])).$computeWordRanges(e.toString(),t,o,s)}async findSectionHeaders(e,t){return(await this._workerWithResources([e])).$findSectionHeaders(e.toString(),t)}async computeDefaultDocumentColors(e){return(await this._workerWithResources([e])).$computeDefaultDocumentColors(e.toString())}async _workerWithResources(e,t=!1){const i=await this._workerManager.withWorker();return await i.workerWithSyncedResources(e,t)}};wue=_ue([vue(1,ac),vue(2,Oae),vue(3,yu),vue(4,Qp),vue(5,BD)],wue);class Cue{constructor(e,t,i,n,o){this.languageConfigurationService=n,this.logService=o,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}async provideCompletionItems(e,t){const i=this._configurationService.getValue(e.uri,t,"editor");if("off"===i.wordBasedSuggestions)return;const n=[];if("currentDocument"===i.wordBasedSuggestions)bue(this._modelService,e.uri)&&n.push(e.uri);else for(const t of this._modelService.getModels())bue(this._modelService,t.uri)&&(t===e?n.unshift(t.uri):"allDocuments"!==i.wordBasedSuggestions&&t.getLanguageId()!==e.getLanguageId()||n.push(t.uri));if(0===n.length)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),s=e.getWordAtPosition(t),r=s?new Yu(t.lineNumber,s.startColumn,t.lineNumber,s.endColumn):Yu.fromPositions(t),a=r.setEndPosition(t.lineNumber,t.column);this.logService.trace("[WordBasedCompletionItemProvider]",`word: "${s?.word||""}", wordDef: "${o}", replace: [${r.toString()}], insert: [${a.toString()}]`);const l=await this._workerManager.withWorker(),d=await l.textualSuggest(n,s?.word,o);return d?{duration:d.duration,suggestions:d.words.map((e=>({kind:18,label:e,insertText:e,range:{insert:a,replace:r}})))}:void 0}}let yue=class extends At{constructor(e,t){super(),this._workerDescriptor=e,this._modelService=t,this._editorWorkerClient=null,this._lastWorkerUsedTime=(new Date).getTime(),this._register(new ya).cancelAndSet((()=>this._checkStopIdleWorker()),Math.round(15e4),r),this._register(this._modelService.onModelRemoved((e=>this._checkStopEmptyWorker())))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){this._editorWorkerClient&&0===this._modelService.getModels().length&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){this._editorWorkerClient&&(new Date).getTime()-this._lastWorkerUsedTime>3e5&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=(new Date).getTime(),this._editorWorkerClient||(this._editorWorkerClient=new xue(this._workerDescriptor,!1,this._modelService)),Promise.resolve(this._editorWorkerClient)}};yue=_ue([vue(1,ac)],yue);class Sue{constructor(e){this._instance=e,this.proxy=this._instance}dispose(){this._instance.dispose()}setChannel(e,t){throw new Error("Not supported")}}let xue=class extends At{constructor(e,t,i){super(),this._workerDescriptorOrWorker=e,this._disposed=!1,this._modelService=i,this._keepIdleModels=t,this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(function(e){const t=uo.isUri(e)?new Zce(e,void 0):e;return new jce(new Gce(t))}(this._workerDescriptorOrWorker)),fue.setChannel(this._worker,this._createEditorWorkerHost())}catch(e){Bce(e),this._worker=this._createFallbackLocalWorker()}return this._worker}async _getProxy(){try{const e=this._getOrCreateWorker().proxy;return await e.$ping(),e}catch(e){return Bce(e),this._worker=this._createFallbackLocalWorker(),this._worker.proxy}}_createFallbackLocalWorker(){return new Sue(new mue(null))}_createEditorWorkerHost(){return{$fhr:(e,t)=>this.fhr(e,t)}}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new uue(e,this._modelService,this._keepIdleModels))),this._modelManager}async workerWithSyncedResources(e,t=!1){if(this._disposed)return Promise.reject(function(){const e=new Error(Ae);return e.name=e.message,e}());const i=await this._getProxy();return this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i}async textualSuggest(e,t,i){const n=await this.workerWithSyncedResources(e),o=i.source,s=i.flags;return n.$textualSuggest(e.map((e=>e.toString())),t,o,s)}dispose(){super.dispose(),this._disposed=!0}};xue=_ue([vue(2,ac)],xue);class kue extends xue{constructor(e,t){super(t.worker,t.keepIdleModels||!1,e),this._foreignModuleHost=t.host||null,this._foreignProxy=this._getProxy().then((e=>new Proxy({},{get(t,i,n){if("then"!==i){if("string"!=typeof i)throw new Error("Not supported");return(...t)=>e.$fmr(i,t)}}})))}fhr(e,t){if(!this._foreignModuleHost||"function"!=typeof this._foreignModuleHost[e])return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(e){return Promise.reject(e)}}getProxy(){return this._foreignProxy}withSyncedResources(e){return this.workerWithSyncedResources(e).then((e=>this.getProxy()))}}function Lue(e){return"string"==typeof e}function Due(e){return!Lue(e)}function Eue(e){return!e}function Nue(e,t){return e.ignoreCase&&t?t.toLowerCase():t}function Iue(e){return e.replace(/[&<>'"_]/g,"-")}function Tue(e,t){console.log(`${e.languageId}: ${t}`)}function Mue(e,t){return new Error(`${e.languageId}: ${t}`)}function Aue(e,t,i,n,o){let s=null;return t.replace(/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g,(function(t,r,a,l,d,h,c,u,g){return Eue(a)?Eue(l)?!Eue(d)&&d<n.length?Nue(e,n[d]):!Eue(c)&&e&&"string"==typeof e[c]?e[c]:(null===s&&(s=o.split("."),s.unshift(o)),!Eue(h)&&h<s.length?Nue(e,s[h]):""):Nue(e,i):"$"}))}function Rue(e,t){let i=t;for(;i&&i.length>0;){const t=e.tokenizer[i];if(t)return t;const n=i.lastIndexOf(".");i=n<0?null:i.substr(0,n)}return null}var Oue;class Pue{static{this._INSTANCE=new Pue(5)}static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(null!==e&&e.depth>=this._maxCacheDepth)return new Fue(e,t);let i=Fue.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new Fue(e,t),this._entries[i]=n,n)}}class Fue{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;null!==e;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;null!==e&&null!==t;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return null===e&&null===t}equals(e){return Fue._equals(this,e)}push(e){return Pue.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return Pue.create(this.parent,e)}}class Bue{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new Bue(this.languageId,this.state)}}class Wue{static{this._INSTANCE=new Wue(5)}static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(null!==t)return new Vue(e,t);if(null!==e&&e.depth>=this._maxCacheDepth)return new Vue(e,t);const i=Fue.getStackElementId(e);let n=this._entries[i];return n||(n=new Vue(e,null),this._entries[i]=n,n)}}class Vue{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:Wue.create(this.stack,this.embeddedLanguageData)}equals(e){return e instanceof Vue&&!!this.stack.equals(e.stack)&&(null===this.embeddedLanguageData&&null===e.embeddedLanguageData||null!==this.embeddedLanguageData&&null!==e.embeddedLanguageData&&this.embeddedLanguageData.equals(e.embeddedLanguageData))}}class Hue{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(e){this._languageId=e}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new MS(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,n){const o=i.languageId,s=i.state,r=JS.get(o);if(!r)return this.enterLanguage(o),this.emit(n,""),s;const a=r.tokenize(e,t,s);if(0!==n)for(const e of a.tokens)this._tokens.push(new MS(e.offset+n,e.type,e.language));else this._tokens=this._tokens.concat(a.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,a.endState}finalize(e){return new AS(this._tokens,e)}}class zue{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=1024|this._theme.match(this._currentLanguageId,t);this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const n=null!==e?e.length:0,o=t.length,s=null!==i?i.length:0;if(0===n&&0===o&&0===s)return new Uint32Array(0);if(0===n&&0===o)return i;if(0===o&&0===s)return e;const r=new Uint32Array(n+o+s);null!==e&&r.set(e);for(let e=0;e<o;e++)r[n+e]=t[e];return null!==i&&r.set(i,n+o),r}nestedLanguageTokenize(e,t,i,n){const o=i.languageId,s=i.state,r=JS.get(o);if(!r)return this.enterLanguage(o),this.emit(n,""),s;const a=r.tokenizeEncoded(e,t,s);if(0!==n)for(let e=0,t=a.tokens.length;e<t;e+=2)a.tokens[e]+=n;return this._prependTokens=zue._merge(this._prependTokens,this._tokens,a.tokens),this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0,a.endState}finalize(e){return new RS(zue._merge(this._prependTokens,this._tokens,null),e)}}let Uue=Oue=class extends At{constructor(e,t,i,n,o){super(),this._configurationService=o,this._languageService=e,this._standaloneThemeService=t,this._languageId=i,this._lexer=n,this._embeddedLanguages=Object.create(null),this.embeddedLoaded=Promise.resolve(void 0);let s=!1;this._register(JS.onDidChange((e=>{if(s)return;let t=!1;for(let i=0,n=e.changedLanguages.length;i<n;i++){const n=e.changedLanguages[i];if(this._embeddedLanguages[n]){t=!0;break}}t&&(s=!0,JS.handleChange([this._languageId]),s=!1)}))),this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}),this._register(this._configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))})))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const i=JS.get(t);if(i){if(i instanceof Oue){const t=i.getLoadStatus();!1===t.loaded&&e.push(t.promise)}}else JS.isResolved(t)||e.push(JS.getOrCreate(t))}return 0===e.length?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then((e=>{}))}}getInitialState(){const e=Pue.create(null,this._lexer.start);return Wue.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return tx(this._languageId,i);const n=new Hue,o=this._tokenize(e,t,i,n);return n.finalize(o)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return ix(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const n=new zue(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,i,n);return n.finalize(o)}_tokenize(e,t,i,n){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,n):this._myTokenize(e,t,i,0,n)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=Rue(this._lexer,t.stack.state),!i))throw Mue(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,o=!1;for(const s of i){if(!Due(s.action)||"@pop"!==s.action.nextEmbedded&&!s.action.hasEmbeddedEndInCases)continue;o=!0;let i=s.resolveRegex(t.stack.state);const r=i.source;if("^(?:"===r.substr(0,4)&&")"===r.substr(r.length-1,1)){const e=(i.ignoreCase?"i":"")+(i.unicode?"u":"");i=new RegExp(r.substr(4,r.length-5),e)}const a=e.search(i);-1===a||0!==a&&s.matchOnlyAtLineStart||(-1===n||a<n)&&(n=a)}if(!o)throw Mue(this._lexer,'no rule containing nextEmbedded: "@pop" in tokenizer embedded state: '+t.stack.state);return n}_nestedTokenize(e,t,i,n,o){const s=this._findLeavingNestedLanguageOffset(e,i);if(-1===s){const s=o.nestedLanguageTokenize(e,t,i.embeddedLanguageData,n);return Wue.create(i.stack,new Bue(i.embeddedLanguageData.languageId,s))}const r=e.substring(0,s);r.length>0&&o.nestedLanguageTokenize(r,!1,i.embeddedLanguageData,n);const a=e.substring(s);return this._myTokenize(a,t,i,n+s,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,n,o){o.enterLanguage(this._languageId);const s=e.length,r=t&&this._lexer.includeLF?e+"\n":e,a=r.length;let l=i.embeddedLanguageData,d=i.stack,h=0,c=null,u=!0;for(;u||h<a;){const i=h,g=d.depth,p=c?c.groups.length:0,m=d.state;let f=null,_=null,v=null,b=null,w=null;if(c){f=c.matches;const e=c.groups.shift();_=e.matched,v=e.action,b=c.rule,0===c.groups.length&&(c=null)}else{if(!u&&h>=a)break;u=!1;let e=this._lexer.tokenizer[m];if(!e&&(e=Rue(this._lexer,m),!e))throw Mue(this._lexer,"tokenizer state is not defined: "+m);const t=r.substr(h);for(const i of e)if((0===h||!i.matchOnlyAtLineStart)&&(f=t.match(i.resolveRegex(m)),f)){_=f[0],v=i.action;break}}if(f||(f=[""],_=""),v||(h<a&&(f=[r.charAt(h)],_=f[0]),v=this._lexer.defaultToken),null===_)break;for(h+=_.length;!function(e){return Array.isArray(e)}(v)&&Due(v)&&v.test;)v=v.test(_,f,m,h===a);let C=null;if("string"==typeof v||Array.isArray(v))C=v;else if(v.group)C=v.group;else if(null!==v.token&&void 0!==v.token){if(C=v.tokenSubst?Aue(this._lexer,v.token,_,f,m):v.token,v.nextEmbedded)if("@pop"===v.nextEmbedded){if(!l)throw Mue(this._lexer,"cannot pop embedded language if not inside one");l=null}else{if(l)throw Mue(this._lexer,"cannot enter embedded language from within an embedded language");w=Aue(this._lexer,v.nextEmbedded,_,f,m)}if(v.goBack&&(h=Math.max(0,h-v.goBack)),v.switchTo&&"string"==typeof v.switchTo){let e=Aue(this._lexer,v.switchTo,_,f,m);if("@"===e[0]&&(e=e.substr(1)),!Rue(this._lexer,e))throw Mue(this._lexer,"trying to switch to a state '"+e+"' that is undefined in rule: "+this._safeRuleName(b));d=d.switchTo(e)}else{if(v.transform&&"function"==typeof v.transform)throw Mue(this._lexer,"action.transform not supported");if(v.next)if("@push"===v.next){if(d.depth>=this._lexer.maxStack)throw Mue(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(m)}else if("@pop"===v.next){if(d.depth<=1)throw Mue(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(b));d=d.pop()}else if("@popall"===v.next)d=d.popall();else{let e=Aue(this._lexer,v.next,_,f,m);if("@"===e[0]&&(e=e.substr(1)),!Rue(this._lexer,e))throw Mue(this._lexer,"trying to set a next state '"+e+"' that is undefined in rule: "+this._safeRuleName(b));d=d.push(e)}}v.log&&"string"==typeof v.log&&Tue(this._lexer,this._lexer.languageId+": "+Aue(this._lexer,v.log,_,f,m))}if(null===C)throw Mue(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(b));const y=i=>{const s=this._languageService.getLanguageIdByLanguageName(i)||this._languageService.getLanguageIdByMimeType(i)||i,r=this._getNestedEmbeddedLanguageData(s);if(h<a){const i=e.substr(h);return this._nestedTokenize(i,t,Wue.create(d,r),n+h,o)}return Wue.create(d,r)};if(Array.isArray(C)){if(c&&c.groups.length>0)throw Mue(this._lexer,"groups cannot be nested: "+this._safeRuleName(b));if(f.length!==C.length+1)throw Mue(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(b));let e=0;for(let t=1;t<f.length;t++)e+=f[t].length;if(e!==_.length)throw Mue(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(b));c={rule:b,matches:f,groups:[]};for(let e=0;e<C.length;e++)c.groups[e]={action:C[e],matched:f[e+1]};h-=_.length}else{{if("@rematch"===C&&(h-=_.length,_="",f=null,C="",null!==w))return y(w);if(0===_.length){if(0===a||g!==d.depth||m!==d.state||(c?c.groups.length:0)!==p)continue;throw Mue(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(b))}let e=null;if(Lue(C)&&0===C.indexOf("@brackets")){const t=C.substr(9),i=Kue(this._lexer,_);if(!i)throw Mue(this._lexer,"@brackets token returned but no bracket defined as: "+_);e=Iue(i.token+t)}else e=Iue(""===C?"":C+this._lexer.tokenPostfix);i<s&&o.emit(i+n,e)}if(null!==w)return y(w)}}return Wue.create(d,l)}_getNestedEmbeddedLanguageData(e){if(!this._languageService.isRegisteredLanguageId(e))return new Bue(e,ex);e!==this._languageId&&(this._languageService.requestBasicLanguageFeatures(e),JS.getOrCreate(e),this._embeddedLanguages[e]=!0);const t=JS.get(e);return new Bue(e,t?t.getInitialState():ex)}};function Kue(e,t){if(!t)return null;t=Nue(e,t);const i=e.brackets;for(const e of i){if(e.open===t)return{token:e.token,bracketType:1};if(e.close===t)return{token:e.token,bracketType:-1}}return null}Uue=Oue=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(4,up)],Uue);const jue=GI("standaloneColorizer",{createHTML:e=>e});class que{static colorizeElement(e,t,i,n){const o=(n=n||{}).theme||"vs",s=n.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!s)return console.error("Mode not detected"),Promise.resolve();const r=t.getLanguageIdByMimeType(s)||s;e.setTheme(o);const a=i.firstChild?i.firstChild.nodeValue:"";return i.className+=" "+o,this.colorize(t,a||"",r,n).then((e=>{const t=jue?.createHTML(e)??e;i.innerHTML=t}),(e=>console.error(e)))}static async colorize(e,t,i,n){const o=e.languageIdCodec;let s=4;n&&"number"==typeof n.tabSize&&(s=n.tabSize),kn(t)&&(t=t.substr(1));const r=qi(t);if(!e.isRegisteredLanguageId(i))return $ue(r,s,o);const a=await JS.getOrCreate(i);return a?function(e,t,i,n){return new Promise(((o,s)=>{const r=()=>{const a=function(e,t,i,n){let o=[],s=i.getInitialState();for(let r=0,a=e.length;r<a;r++){const a=e[r],l=i.tokenizeEncoded(a,!0,s);uS.convertToEndOffset(l.tokens,a.length);const d=new uS(l.tokens,a,n),h=DH.isBasicASCII(a,!0),c=DH.containsRTL(a,h,!0),u=YB(new KB(!1,!0,a,!1,h,c,0,d.inflate(),[],t,0,0,0,0,-1,"none",!1,!1,null,null,0));o=o.concat(u.html),o.push("<br/>"),s=l.endState}return o.join("")}(e,t,i,n);if(i instanceof Uue){const e=i.getLoadStatus();if(!1===e.loaded)return void e.promise.then(r,s)}o(a)};r()}))}(r,s,a,o):$ue(r,s,o)}static colorizeLine(e,t,i,n,o=4){const s=DH.isBasicASCII(e,t),r=DH.containsRTL(e,s,i);return YB(new KB(!1,!0,e,!1,s,r,0,n,[],o,0,0,0,0,-1,"none",!1,!1,null,null,0)).html}static colorizeModelLine(e,t,i=4){const n=e.getLineContent(t);e.tokenization.forceTokenization(t);const o=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),o,i)}}function $ue(e,t,i){let n=[];const o=new Uint32Array(2);o[0]=0,o[1]=33587200;for(let s=0,r=e.length;s<r;s++){const r=e[s];o[0]=r.length;const a=new uS(o,r,i),l=DH.isBasicASCII(r,!0),d=DH.containsRTL(r,l,!0),h=YB(new KB(!1,!0,r,!1,l,d,0,a,[],t,0,0,0,0,-1,"none",!1,!1,null,null,0));n=n.concat(h.html),n.push("<br/>")}return n.join("")}let Gue=class extends At{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new Zt),this._onCodeEditorAdd=this._register(new Zt),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new Zt),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new Zt),this._onDiffEditorAdd=this._register(new Zt),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new Zt),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new Wt,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map((e=>this._codeEditors[e]))}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map((e=>this._diffEditors[e]))}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach((t=>t.removeDecorationsByType(e)))))}setModelProperty(e,t,i){const n=e.toString();let o;this._modelProperties.has(n)?o=this._modelProperties.get(n):(o=new Map,this._modelProperties.set(n,o)),o.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}async openCodeEditor(e,t,i){for(const n of this._codeEditorOpenHandlers){const o=await n(e,t,i);if(null!==o)return o}return null}registerCodeEditorOpenHandler(e){return Tt(this._codeEditorOpenHandlers.unshift(e))}};Gue=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,sw)],Gue);var Zue=function(e,t){return function(i,n){t(i,n,e)}};let Yue=class extends Gue{constructor(e,t){super(t),this._register(this.onCodeEditorAdd((()=>this._checkContextKey()))),this._register(this.onCodeEditorRemove((()=>this._checkContextKey()))),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler((async(e,t,i)=>t?this.doOpenEditor(t,e):null)))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const i=t.resource.scheme;if(i===So.http||i===So.https)return ul(t.resource.toString()),e}return null}const i=t.options?t.options.selection:null;if(i)if("number"==typeof i.endLineNumber&&"number"==typeof i.endColumn)e.setSelection(i),e.revealRangeInCenter(i,1);else{const t={lineNumber:i.startLineNumber,column:i.startColumn};e.setPosition(t),e.revealPositionInCenter(t,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};Yue=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Zue(0,eu),Zue(1,sw)],Yue),wp(sc,Yue,0);var Que=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Xue=function(e,t){return function(i,n){t(i,n,e)}};let Jue=class{get mainContainer(){return this._codeEditorService.listCodeEditors().at(0)?.getContainerDomNode()??r.document.body}get activeContainer(){const e=this._codeEditorService.getFocusedCodeEditor()??this._codeEditorService.getActiveCodeEditor();return e?.getContainerDomNode()??this.mainContainer}get mainContainerDimension(){return ka(this.mainContainer)}get activeContainerDimension(){return ka(this.activeContainer)}get containers(){return as(this._codeEditorService.listCodeEditors().map((e=>e.getContainerDomNode())))}getContainer(){return this.activeContainer}whenContainerStylesLoaded(){}focus(){this._codeEditorService.getFocusedCodeEditor()?.focus()}constructor(e){this._codeEditorService=e,this.onDidLayoutMainContainer=zt.None,this.onDidLayoutActiveContainer=zt.None,this.onDidLayoutContainer=zt.None,this.onDidChangeActiveContainer=zt.None,this.onDidAddContainer=zt.None,this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0}}};Jue=Que([Xue(0,sc)],Jue);let ege=class extends Jue{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}};ege=Que([Xue(1,sc)],ege),wp(HR,Jue,1);var tge=function(e,t){return function(i,n){t(i,n,e)}};function ige(e){return e.scheme===So.file?e.fsPath:e.path}let nge=0;class oge{constructor(e,t,i,n,o,s,r){this.id=++nge,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=n,this.groupOrder=o,this.sourceId=s,this.sourceOrder=r,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class sge{constructor(e,t){this.resourceLabel=e,this.reason=t}}class rge{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,i]of this.elements)(0===i.reason?e:t).push(i.resourceLabel);const i=[];return e.length>0&&i.push(y(2012,"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(y(2013,"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join("\n")}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class age{constructor(e,t,i,n,o,s,r){this.id=++nge,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,this.groupOrder=o,this.sourceId=s,this.sourceOrder=r,this.removedResources=null,this.invalidatedResources=null}canSplit(){return"function"==typeof this.actual.split}removeResource(e,t,i){this.removedResources||(this.removedResources=new rge),this.removedResources.has(t)||this.removedResources.set(t,new sge(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),0===this.invalidatedResources.size&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new rge),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new sge(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class lge{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t<this._past.length;t++)e.push(` * [UNDO] ${this._past[t]}`);for(let t=this._future.length-1;t>=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join("\n")}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){1===e.type?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const e of this._future)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let e=0,i=this._past.length;e<i;e++)t.push(this._past[e].id);for(let e=this._future.length-1;e>=0;e--)t.push(this._future[e].id);return new Yx(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,o=-1;for(let s=0,r=this._past.length;s<r;s++,n++){const r=this._past[s];i&&(n>=t||r.id!==e.elements[n])&&(i=!1,o=0),i||1!==r.type||r.removeResource(this.resourceLabel,this.strResource,0)}let s=-1;for(let o=this._future.length-1;o>=0;o--,n++){const r=this._future[o];i&&(n>=t||r.id!==e.elements[n])&&(i=!1,s=o),i||1!==r.type||r.removeResource(this.resourceLabel,this.strResource,0)}-1!==o&&(this._past=this._past.slice(0,o)),-1!==s&&(this._future=this._future.slice(s+1)),this.versionId++}getElements(){const e=[],t=[];for(const t of this._past)e.push(t.actual);for(const e of this._future)t.push(e.actual);return{past:e,future:t}}getClosestPastElement(){return 0===this._past.length?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return 0===this._future.length?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class dge{constructor(e){this.editStacks=e,this._versionIds=[];for(let e=0,t=this.editStacks.length;e<t;e++)this._versionIds[e]=this.editStacks[e].versionId}isValid(){for(let e=0,t=this.editStacks.length;e<t;e++)if(this._versionIds[e]!==this.editStacks[e].versionId)return!1;return!0}}const hge=new lge("","");hge.locked=!0;let cge=class{constructor(e,t){this._dialogService=e,this._notificationService=t,this._editStacks=new Map,this._uriComparisonKeyComputers=[]}getUriComparisonKey(e){for(const t of this._uriComparisonKeyComputers)if(t[0]===e.scheme)return t[1].getComparisonKey(e);return e.toString()}_print(e){console.log("------------------------------------"),console.log(`AFTER ${e}: `);const t=[];for(const e of this._editStacks)t.push(e[1].toString());console.log(t.join("\n"))}pushElement(e,t=Qx.None,i=Xx.None){if(0===e.type){const n=ige(e.resource),o=this.getUriComparisonKey(e.resource);this._pushElement(new oge(e,n,o,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{const n=new Set,o=[],s=[];for(const t of e.resources){const e=ige(t),i=this.getUriComparisonKey(t);n.has(i)||(n.add(i),o.push(e),s.push(i))}1===o.length?this._pushElement(new oge(e,o[0],s[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new age(e,o,s,t.id,t.nextOrder(),i.id,i.nextOrder()))}}_pushElement(e){for(let t=0,i=e.strResources.length;t<i;t++){const i=e.resourceLabels[t],n=e.strResources[t];let o;this._editStacks.has(n)?o=this._editStacks.get(n):(o=new lge(i,n),this._editStacks.set(n,o)),o.pushElement(e)}}getLastElement(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const e=this._editStacks.get(t);if(e.hasFutureElements())return null;const i=e.getClosestPastElement();return i?i.actual:null}return null}_splitPastWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const e of i){const t=ige(e.resource),i=this.getUriComparisonKey(e.resource),o=new oge(e,t,i,0,0,0,0);n.set(o.strResource,o)}for(const i of e.strResources)t&&t.has(i)||this._editStacks.get(i).splitPastWorkspaceElement(e,n)}_splitFutureWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const e of i){const t=ige(e.resource),i=this.getUriComparisonKey(e.resource),o=new oge(e,t,i,0,0,0,0);n.set(o.strResource,o)}for(const i of e.strResources)t&&t.has(i)||this._editStacks.get(i).splitFutureWorkspaceElement(e,n)}removeElements(e){const t="string"==typeof e?e:this.getUriComparisonKey(e);this._editStacks.has(t)&&(this._editStacks.get(t).dispose(),this._editStacks.delete(t))}setElementsValidFlag(e,t,i){const n=this.getUriComparisonKey(e);this._editStacks.has(n)&&this._editStacks.get(n).setElementsValidFlag(t,i)}createSnapshot(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).createSnapshot(e):new Yx(e,[])}restoreSnapshot(e){const t=this.getUriComparisonKey(e.resource);if(this._editStacks.has(t)){const i=this._editStacks.get(t);i.restoreSnapshot(e),i.hasPastElements()||i.hasFutureElements()||(i.dispose(),this._editStacks.delete(t))}}getElements(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).getElements():{past:[],future:[]}}_findClosestUndoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestPastElement();s&&s.sourceId===e&&(!t||s.sourceOrder>t.sourceOrder)&&(t=s,i=n)}return[t,i]}canUndo(e){if(e instanceof Xx){const[,t]=this._findClosestUndoElementWithSource(e.id);return!!t}const t=this.getUriComparisonKey(e);return!!this._editStacks.has(t)&&this._editStacks.get(t).hasPastElements()}_onError(e,t){Ie(e);for(const e of t.strResources)this.removeElements(e);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,n,o){const s=this._acquireLocks(i);let r;try{r=t()}catch(t){return s(),n.dispose(),this._onError(t,e)}return r?r.then((()=>(s(),n.dispose(),o())),(t=>(s(),n.dispose(),this._onError(t,e)))):(s(),n.dispose(),o())}async _invokeWorkspacePrepare(e){if(void 0===e.actual.prepareUndoRedo)return At.None;const t=e.actual.prepareUndoRedo();return void 0===t?At.None:t}_invokeResourcePrepare(e,t){if(1!==e.actual.type||void 0===e.actual.prepareUndoRedo)return t(At.None);const i=e.actual.prepareUndoRedo();return i?Dt(i)?t(i):i.then((e=>t(e))):t(At.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||hge);return new dge(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new uge(this._undo(e,0,!0));for(const e of t.strResources)this.removeElements(e);return this._notificationService.warn(n),new uge}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,y(2014,"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,y(2015,"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const e of i.editStacks)e.getClosestPastElement()!==t&&o.push(e.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,y(2016,"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const e of i.editStacks)e.locked&&s.push(e.resourceLabel);return s.length>0?this._tryToSplitAndUndo(e,t,null,y(2017,"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,y(2018,"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const n=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,n,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,n,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const i=t.getSecondClosestPastElement();if(i&&i.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}async _confirmAndExecuteWorkspaceUndo(e,t,i,n){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let o;!function(e){e[e.All=0]="All",e[e.This=1]="This",e[e.Cancel=2]="Cancel"}(o||(o={}));const{result:s}=await this._dialogService.prompt({type:rO.Info,message:y(2019,"Would you like to undo '{0}' across all files?",t.label),buttons:[{label:y(2020,"&&Undo in {0} Files",i.editStacks.length),run:()=>o.All},{label:y(2021,"Undo this &&File"),run:()=>o.This}],cancelButton:{run:()=>o.Cancel}});if(s===o.Cancel)return;if(s===o.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const r=this._checkWorkspaceUndo(e,t,i,!1);if(r)return r.returnValue;n=!0}let o;try{o=await this._invokeWorkspacePrepare(t)}catch(e){return this._onError(e,t)}const s=this._checkWorkspaceUndo(e,t,i,!0);if(s)return o.dispose(),s.returnValue;for(const e of i.editStacks)e.moveBackward(t);return this._safeInvokeWithLocks(t,(()=>t.actual.undo()),i,o,(()=>this._continueUndoInGroup(t.groupId,n)))}_resourceUndo(e,t,i){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,(n=>(e.moveBackward(t),this._safeInvokeWithLocks(t,(()=>t.actual.undo()),new dge([e]),n,(()=>this._continueUndoInGroup(t.groupId,i))))));{const e=y(2022,"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(e)}}else e.flushAllElements()}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestPastElement();s&&s.groupId===e&&(!t||s.groupOrder>t.groupOrder)&&(t=s,i=n)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);return i?this._undo(i,0,t):void 0}undo(e){if(e instanceof Xx){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return"string"==typeof e?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const n=this._editStacks.get(e),o=n.getClosestPastElement();if(o){if(o.groupId){const[e,n]=this._findClosestUndoElementInGroup(o.groupId);if(o!==e&&n)return this._undo(n,t,i)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,o);try{return 1===o.type?this._workspaceUndo(e,o,i):this._resourceUndo(n,o,i)}finally{}}}async _confirmAndContinueUndo(e,t,i){if((await this._dialogService.confirm({message:y(2023,"Would you like to undo '{0}'?",i.label),primaryButton:y(2024,"&&Yes"),cancelButton:y(2025,"No")})).confirmed)return this._undo(e,t,!0)}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.sourceId===e&&(!t||s.sourceOrder<t.sourceOrder)&&(t=s,i=n)}return[t,i]}canRedo(e){if(e instanceof Xx){const[,t]=this._findClosestRedoElementWithSource(e.id);return!!t}const t=this.getUriComparisonKey(e);return!!this._editStacks.has(t)&&this._editStacks.get(t).hasFutureElements()}_tryToSplitAndRedo(e,t,i,n){if(t.canSplit())return this._splitFutureWorkspaceElement(t,i),this._notificationService.warn(n),new uge(this._redo(e));for(const e of t.strResources)this.removeElements(e);return this._notificationService.warn(n),new uge}_checkWorkspaceRedo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndRedo(e,t,t.removedResources,y(2026,"Could not redo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndRedo(e,t,t.invalidatedResources,y(2027,"Could not redo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const e of i.editStacks)e.getClosestFutureElement()!==t&&o.push(e.resourceLabel);if(o.length>0)return this._tryToSplitAndRedo(e,t,null,y(2028,"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const e of i.editStacks)e.locked&&s.push(e.resourceLabel);return s.length>0?this._tryToSplitAndRedo(e,t,null,y(2029,"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,y(2030,"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),n=this._checkWorkspaceRedo(e,t,i,!1);return n?n.returnValue:this._executeWorkspaceRedo(e,t,i)}async _executeWorkspaceRedo(e,t,i){let n;try{n=await this._invokeWorkspacePrepare(t)}catch(e){return this._onError(e,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return n.dispose(),o.returnValue;for(const e of i.editStacks)e.moveForward(t);return this._safeInvokeWithLocks(t,(()=>t.actual.redo()),i,n,(()=>this._continueRedoInGroup(t.groupId)))}_resourceRedo(e,t){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,(i=>(e.moveForward(t),this._safeInvokeWithLocks(t,(()=>t.actual.redo()),new dge([e]),i,(()=>this._continueRedoInGroup(t.groupId))))));{const e=y(2031,"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(e)}}else e.flushAllElements()}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.groupId===e&&(!t||s.groupOrder<t.groupOrder)&&(t=s,i=n)}return[t,i]}_continueRedoInGroup(e){if(!e)return;const[,t]=this._findClosestRedoElementInGroup(e);return t?this._redo(t):void 0}redo(e){if(e instanceof Xx){const[,t]=this._findClosestRedoElementWithSource(e.id);return t?this._redo(t):void 0}return"string"==typeof e?this._redo(e):this._redo(this.getUriComparisonKey(e))}_redo(e){if(!this._editStacks.has(e))return;const t=this._editStacks.get(e),i=t.getClosestFutureElement();if(i){if(i.groupId){const[e,t]=this._findClosestRedoElementInGroup(i.groupId);if(i!==e&&t)return this._redo(t)}try{return 1===i.type?this._workspaceRedo(e,i):this._resourceRedo(t,i)}finally{}}}};cge=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([tge(0,Xre),tge(1,lO)],cge);class uge{constructor(e){this.returnValue=e}}wp(Zx,cge,1);var gge=function(e,t){return function(i,n){t(i,n,e)}};let pge=class extends At{constructor(e,t,i){super(),this._themeService=e,this._logService=t,this._languageService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange((()=>{this._caches=new WeakMap})))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new nle(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};function mge(e){return"string"!=typeof e&&(Array.isArray(e)?e.every(mge):!!e.exclusive)}pge=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([gge(0,sw),gge(1,yu),gge(2,Tg)],pge),wp(ale,pge,1);class fge{constructor(e,t,i,n,o){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=n,this.recursive=o}equals(e){return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&this.notebookUri?.toString()===e.notebookUri?.toString()&&this.recursive===e.recursive}}class _ge{get onDidChange(){return this._onDidChange.event}constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new Zt}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),Tt((()=>{if(i){const e=this._entries.indexOf(i);e>=0&&(this._entries.splice(e,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}}))}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e,!1);const t=[];for(const e of this._entries)e._score>0&&t.push(e.provider);return t}ordered(e,t=!1){const i=[];return this._orderedForEach(e,t,(e=>i.push(e.provider))),i}orderedGroups(e){const t=[];let i,n;return this._orderedForEach(e,!1,(e=>{i&&n===e._score?i.push(e.provider):(n=e._score,i=[e.provider],t.push(i))})),t}_orderedForEach(e,t,i){this._updateScores(e,t);for(const e of this._entries)e._score>0&&i(e)}_updateScores(e,t){const i=this._notebookInfoResolver?.(e.uri),n=i?new fge(e.uri,e.getLanguageId(),i.uri,i.type,t):new fge(e.uri,e.getLanguageId(),void 0,void 0,t);if(!this._lastCandidate?.equals(n)){this._lastCandidate=n;for(const i of this._entries)if(i._score=phe(i.selector,n.uri,n.languageId,Cg(e),n.notebookUri,n.notebookType),mge(i.selector)&&i._score>0){if(!t){for(const e of this._entries)e._score=0;i._score=1e3;break}i._score=0}this._entries.sort(_ge._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._score<t._score?1:e._score>t._score?-1:vge(e.selector)&&!vge(t.selector)?1:!vge(e.selector)&&vge(t.selector)?-1:e._time<t._time?1:e._time>t._time?-1:0}}function vge(e){return"string"!=typeof e&&(Array.isArray(e)?e.some(vge):Boolean(e.isBuiltin))}wp(BD,class{constructor(){this.referenceProvider=new _ge(this._score.bind(this)),this.renameProvider=new _ge(this._score.bind(this)),this.newSymbolNamesProvider=new _ge(this._score.bind(this)),this.codeActionProvider=new _ge(this._score.bind(this)),this.definitionProvider=new _ge(this._score.bind(this)),this.typeDefinitionProvider=new _ge(this._score.bind(this)),this.declarationProvider=new _ge(this._score.bind(this)),this.implementationProvider=new _ge(this._score.bind(this)),this.documentSymbolProvider=new _ge(this._score.bind(this)),this.inlayHintsProvider=new _ge(this._score.bind(this)),this.colorProvider=new _ge(this._score.bind(this)),this.codeLensProvider=new _ge(this._score.bind(this)),this.documentFormattingEditProvider=new _ge(this._score.bind(this)),this.documentRangeFormattingEditProvider=new _ge(this._score.bind(this)),this.onTypeFormattingEditProvider=new _ge(this._score.bind(this)),this.signatureHelpProvider=new _ge(this._score.bind(this)),this.hoverProvider=new _ge(this._score.bind(this)),this.documentHighlightProvider=new _ge(this._score.bind(this)),this.multiDocumentHighlightProvider=new _ge(this._score.bind(this)),this.selectionRangeProvider=new _ge(this._score.bind(this)),this.foldingRangeProvider=new _ge(this._score.bind(this)),this.linkProvider=new _ge(this._score.bind(this)),this.inlineCompletionsProvider=new _ge(this._score.bind(this)),this.completionProvider=new _ge(this._score.bind(this)),this.linkedEditingRangeProvider=new _ge(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new _ge(this._score.bind(this)),this.documentSemanticTokensProvider=new _ge(this._score.bind(this)),this.documentDropEditProvider=new _ge(this._score.bind(this)),this.documentPasteEditProvider=new _ge(this._score.bind(this))}_score(e){return this._notebookTypeResolver?.(e)}},1);var bge=i(3377),wge={};wge.styleTagTransform=zl(),wge.setAttributes=Bl(),wge.insert=Pl().bind(null,"head"),wge.domAPI=Rl(),wge.insertStyleElement=Vl(),Ml()(bge.A,wge),bge.A&&bge.A.locals&&bge.A.locals;var Cge=function(e,t){return function(i,n){t(i,n,e)}};const yge=ll;let Sge=class extends mM{get _targetWindow(){return ta(this._target.targetElements[0])}get _targetDocumentElement(){return ta(this._target.targetElements[0]).document.documentElement}get isDisposed(){return this._isDisposed}get isMouseIn(){return this._lockMouseTracker.isMouseIn}get domNode(){return this._hover.containerDomNode}get onDispose(){return this._onDispose.event}get onRequestLayout(){return this._onRequestLayout.event}get anchor(){return 2===this._hoverPosition?0:1}get x(){return this._x}get y(){return this._y}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this._hoverContainer.classList.toggle("locked",this._isLocked))}constructor(e,t,i,n,o,s){super(),this._keybindingService=t,this._configurationService=i,this._openerService=n,this._instantiationService=o,this._accessibilityService=s,this._messageListeners=new Mt,this._isDisposed=!1,this._forcePosition=!1,this._x=0,this._y=0,this._isLocked=!1,this._enableFocusTraps=!1,this._addedFocusTrap=!1,this._maxHeightRatioRelativeToWindow=.5,this._onDispose=this._register(new Zt),this._onRequestLayout=this._register(new Zt),this._linkHandler=e.linkHandler||(t=>lT(this._openerService,t,Yh(e.content)?e.content.isTrusted:void 0)),this._target="targetElements"in e.target?e.target:new kge(e.target),this._hoverPointer=e.appearance?.showPointer?yge("div.workbench-hover-pointer"):void 0,this._hover=this._register(new jG(!e.appearance?.skipFadeInAnimation)),this._hover.containerDomNode.classList.add("workbench-hover"),e.appearance?.compact&&this._hover.containerDomNode.classList.add("workbench-hover","compact"),e.additionalClasses&&this._hover.containerDomNode.classList.add(...e.additionalClasses),e.position?.forcePosition&&(this._forcePosition=!0),e.trapFocus&&(this._enableFocusTraps=!0);const r=e.appearance?.maxHeightRatio;void 0!==r&&r>0&&r<=1&&(this._maxHeightRatioRelativeToWindow=r),this._hoverPosition=void 0===e.position?.hoverPosition?3:ct(e.position.hoverPosition)?e.position.hoverPosition:2,this.onmousedown(this._hover.containerDomNode,(e=>e.stopPropagation())),this.onkeydown(this._hover.containerDomNode,(e=>{e.equals(9)&&this.dispose()})),this._register(ga(this._targetWindow,"blur",(()=>this.dispose())));const a=yge("div.hover-row.markdown-hover"),l=yge("div.hover-contents");if("string"==typeof e.content)l.textContent=e.content,l.style.whiteSpace="pre-wrap";else if(qa(e.content))l.appendChild(e.content),l.classList.add("html-hover-contents");else{const t=e.content,i=this._instantiationService.createInstance(aT,{codeBlockFontFamily:this._configurationService.getValue("editor").fontFamily||fP.fontFamily}),{element:n,dispose:o}=i.render(t,{actionHandler:e=>this._linkHandler(e),asyncRenderCallback:()=>{l.classList.add("code-hover-contents"),this.layout(),this._onRequestLayout.fire()}});l.appendChild(n),this._register(Tt(o))}if(a.appendChild(l),this._hover.contentsDomNode.appendChild(a),e.actions&&e.actions.length>0){const t=yge("div.hover-row.status-bar"),i=yge("div.actions");e.actions.forEach((e=>{const t=this._keybindingService.lookupKeybinding(e.commandId),n=t?t.getLabel():null;this._register(qG.render(i,{label:e.label,commandId:e.commandId,run:t=>{e.run(t),this.dispose()},iconClass:e.iconClass},n))})),t.appendChild(i),this._hover.containerDomNode.appendChild(t)}let d;if(this._hoverContainer=yge("div.workbench-hover-container"),this._hoverPointer&&this._hoverContainer.appendChild(this._hoverPointer),this._hoverContainer.appendChild(this._hover.containerDomNode),d=!(e.actions&&e.actions.length>0)&&(void 0===e.persistence?.hideOnHover?"string"==typeof e.content||Yh(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes("</a>"):e.persistence.hideOnHover),e.appearance?.showHoverHint){const e=yge("div.hover-row.status-bar"),t=yge("div.info");t.textContent=y(74,"Hold {0} key to mouse over",$?"Option":"Alt"),e.appendChild(t),this._hover.containerDomNode.appendChild(e)}const h=[...this._target.targetElements];d||h.push(this._hoverContainer);const c=this._register(new xge(h));if(this._register(c.onMouseOut((()=>{this._isLocked||this.dispose()}))),d){const e=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new xge(e)),this._register(this._lockMouseTracker.onMouseOut((()=>{this._isLocked||this.dispose()})))}else this._lockMouseTracker=c}addFocusTrap(){if(!this._enableFocusTraps||this._addedFocusTrap)return;this._addedFocusTrap=!0;const e=this._hover.containerDomNode,t=this.findLastFocusableChild(this._hover.containerDomNode);if(t){const i=nl(this._hoverContainer,yge("div")),n=il(this._hoverContainer,yge("div"));i.tabIndex=0,n.tabIndex=0,this._register(ga(n,"focus",(t=>{e.focus(),t.preventDefault()}))),this._register(ga(i,"focus",(e=>{t.focus(),e.preventDefault()})))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t<e.childNodes.length;t++){const i=e.childNodes.item(e.childNodes.length-t-1);if(i.nodeType===i.ELEMENT_NODE){const e=i;if("number"==typeof e.tabIndex&&e.tabIndex>=0)return e}const n=this.findLastFocusableChild(i);if(n)return n}}render(e){e.appendChild(this._hoverContainer);const t=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&$G(!0===this._configurationService.getValue("accessibility.verbosity.hover")&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel());t&&Ql(t),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const e=this._target.targetElements.map((e=>(e=>{const t=Ia(e),i=e.getBoundingClientRect();return{top:i.top*t,bottom:i.bottom*t,right:i.right*t,left:i.left*t}})(e))),{top:t,right:i,bottom:n,left:o}=e[0],s=i-o,r=n-t,a={top:t,right:i,bottom:n,left:o,width:s,height:r,center:{x:o+s/2,y:t+r/2}};if(this.adjustHorizontalHoverPosition(a),this.adjustVerticalHoverPosition(a),this.adjustHoverMaxHeight(a),this._hoverContainer.style.padding="",this._hoverContainer.style.margin="",this._hoverPointer){switch(this._hoverPosition){case 1:a.left+=3,a.right+=3,this._hoverContainer.style.paddingLeft="3px",this._hoverContainer.style.marginLeft="-3px";break;case 0:a.left-=3,a.right-=3,this._hoverContainer.style.paddingRight="3px",this._hoverContainer.style.marginRight="-3px";break;case 2:a.top+=3,a.bottom+=3,this._hoverContainer.style.paddingTop="3px",this._hoverContainer.style.marginTop="-3px";break;case 3:a.top-=3,a.bottom-=3,this._hoverContainer.style.paddingBottom="3px",this._hoverContainer.style.marginBottom="-3px"}a.center.x=a.left+s/2,a.center.y=a.top+r/2}this.computeXCordinate(a),this.computeYCordinate(a),this._hoverPointer&&(this._hoverPointer.classList.remove("top"),this._hoverPointer.classList.remove("left"),this._hoverPointer.classList.remove("right"),this._hoverPointer.classList.remove("bottom"),this.setHoverPointerPosition(a)),this._hover.onContentsChanged()}computeXCordinate(e){const t=this._hover.containerDomNode.clientWidth+2;void 0!==this._target.x?this._x=this._target.x:1===this._hoverPosition?this._x=e.right:0===this._hoverPosition?this._x=e.left-t:(this._hoverPointer?this._x=e.center.x-this._hover.containerDomNode.clientWidth/2:this._x=e.left,this._x+t>=this._targetDocumentElement.clientWidth&&(this._hover.containerDomNode.classList.add("right-aligned"),this._x=Math.max(this._targetDocumentElement.clientWidth-t-2,this._targetDocumentElement.clientLeft))),this._x<this._targetDocumentElement.clientLeft&&(this._x=e.left+2)}computeYCordinate(e){void 0!==this._target.y?this._y=this._target.y:3===this._hoverPosition?this._y=e.top:2===this._hoverPosition?this._y=e.bottom-2:this._hoverPointer?this._y=e.center.y+this._hover.containerDomNode.clientHeight/2:this._y=e.bottom,this._y>this._targetWindow.innerHeight&&(this._y=e.bottom)}adjustHorizontalHoverPosition(e){if(void 0!==this._target.x)return;const t=this._hoverPointer?3:0;if(this._forcePosition){const i=t+2;1===this._hoverPosition?this._hover.containerDomNode.style.maxWidth=this._targetDocumentElement.clientWidth-e.right-i+"px":0===this._hoverPosition&&(this._hover.containerDomNode.style.maxWidth=e.left-i+"px")}else 1===this._hoverPosition?this._targetDocumentElement.clientWidth-e.right<this._hover.containerDomNode.clientWidth+t&&(e.left>=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=0:this._hoverPosition=2):0===this._hoverPosition&&(e.left<this._hover.containerDomNode.clientWidth+t&&(this._targetDocumentElement.clientWidth-e.right>=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=1:this._hoverPosition=2),e.left-this._hover.containerDomNode.clientWidth-t<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=1))}adjustVerticalHoverPosition(e){if(void 0!==this._target.y||this._forcePosition)return;const t=this._hoverPointer?3:0;3===this._hoverPosition?e.top-this._hover.containerDomNode.clientHeight-t<0&&(this._hoverPosition=2):2===this._hoverPosition&&e.bottom+this._hover.containerDomNode.clientHeight+t>this._targetWindow.innerHeight&&(this._hoverPosition=3)}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight*this._maxHeightRatioRelativeToWindow;if(this._forcePosition){const i=2+(this._hoverPointer?3:0);3===this._hoverPosition?t=Math.min(t,e.top-i):2===this._hoverPosition&&(t=Math.min(t,this._targetWindow.innerHeight-e.bottom-i))}if(this._hover.containerDomNode.style.maxHeight=`${t}px`,this._hover.contentsDomNode.clientHeight<this._hover.contentsDomNode.scrollHeight){const e=`${this._hover.scrollbar.options.verticalScrollbarSize}px`;this._hover.contentsDomNode.style.paddingRight!==e&&(this._hover.contentsDomNode.style.paddingRight=e)}}setHoverPointerPosition(e){if(this._hoverPointer)switch(this._hoverPosition){case 0:case 1:{this._hoverPointer.classList.add(0===this._hoverPosition?"right":"left");const t=this._hover.containerDomNode.clientHeight;t>e.height?this._hoverPointer.style.top=e.center.y-(this._y-t)-3+"px":this._hoverPointer.style.top=Math.round(t/2)-3+"px";break}case 3:case 2:{this._hoverPointer.classList.add(3===this._hoverPosition?"bottom":"top");const t=this._hover.containerDomNode.clientWidth;let i=Math.round(t/2)-3;const n=this._x+i;(n<e.left||n>e.right)&&(i=e.center.x-this._x-3),this._hoverPointer.style.left=`${i}px`;break}}}focus(){this._hover.containerDomNode.focus()}dispose(){this._isDisposed||(this._onDispose.fire(),this._target.dispose?.(),this._hoverContainer.remove(),this._messageListeners.dispose(),super.dispose()),this._isDisposed=!0}};Sge=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Cge(1,ER),Cge(2,up),Cge(3,ZI),Cge(4,nc),Cge(5,rB)],Sge);class xge extends mM{get onMouseOut(){return this._onMouseOut.event}get isMouseIn(){return this._isMouseIn}constructor(e,t=200){super(),this._elements=e,this._eventDebounceDelay=t,this._isMouseIn=!0,this._mouseTimer=this._register(new Rt),this._onMouseOut=this._register(new Zt);for(const e of this._elements)this.onmouseover(e,(()=>this._onTargetMouseOver())),this.onmouseleave(e,(()=>this._onTargetMouseLeave()))}_onTargetMouseOver(){this._isMouseIn=!0,this._mouseTimer.clear()}_onTargetMouseLeave(){this._isMouseIn=!1,this._mouseTimer.value=new bi((()=>this._fireIfMouseOutside()),this._eventDebounceDelay)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class kge{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}}var Lge,Dge=i(8970),Ege={};function Nge(e,t,i){const n=i.mode===Lge.ALIGN?i.offset:i.offset+i.size,o=i.mode===Lge.ALIGN?i.offset+i.size:i.offset;return 0===i.position?t<=e-n?n:t<=o?o-t:Math.max(e-t,0):t<=o?o-t:t<=e-n?n:0}Ege.styleTagTransform=zl(),Ege.setAttributes=Bl(),Ege.insert=Pl().bind(null,"head"),Ege.domAPI=Rl(),Ege.insertStyleElement=Vl(),Ml()(Dge.A,Ege),Dge.A&&Dge.A.locals&&Dge.A.locals,function(e){e[e.AVOID=0]="AVOID",e[e.ALIGN=1]="ALIGN"}(Lge||(Lge={}));class Ige extends At{static{this.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"]}static{this.BUBBLE_DOWN_EVENTS=["click"]}constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=At.None,this.toDisposeOnSetContainer=At.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=ll(".context-view"),hl(this.view),this.setContainer(e,t),this._register(Tt((()=>this.setContainer(null,1))))}setContainer(e,t){this.useFixedPosition=1!==t;const i=this.useShadowDOM;if(this.useShadowDOM=3===t,(e!==this.container||i!==this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.view.remove(),this.shadowRoot&&(this.shadowRoot=null,this.shadowRootHostElement?.remove(),this.shadowRootHostElement=null),this.container=null),e)){if(this.container=e,this.useShadowDOM){this.shadowRootHostElement=ll(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=Tge,this.shadowRoot.appendChild(e),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(ll("slot"))}else this.container.appendChild(this.view);const t=new Mt;Ige.BUBBLE_UP_EVENTS.forEach((e=>{t.add(ma(this.container,e,(e=>{this.onDOMEvent(e,!1)})))})),Ige.BUBBLE_DOWN_EVENTS.forEach((e=>{t.add(ma(this.container,e,(e=>{this.onDOMEvent(e,!0)}),!0))})),this.toDisposeOnSetContainer=t}}show(e){this.isVisible()&&this.hide(),ca(this.view),this.view.className="context-view monaco-component",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex=`${2575+(e.layer??0)}`,this.view.style.position=this.useFixedPosition?"fixed":"absolute",dl(this.view),this.toDisposeOnClean=e.render(this.view)||At.None,this.delegate=e,this.doLayout(),this.delegate.focus?.()}getViewElement(){return this.view}layout(){this.isVisible()&&(!1!==this.delegate.canRelayout||X&&pe?(this.delegate?.layout?.(),this.doLayout()):this.hide())}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(qa(e)){const i=Na(e),n=Ia(e);t={top:i.top*n,left:i.left*n,width:i.width*n,height:i.height*n}}else t=function(e){const t=e;return!!t&&"number"==typeof t.x&&"number"==typeof t.y}(e)?{top:e.y,left:e.x,width:e.width||1,height:e.height||2}:{top:e.posy,left:e.posx,width:2,height:2};const i=Ta(this.view),n=Ra(this.view),o=this.delegate.anchorPosition??0,s=this.delegate.anchorAlignment??0,r=this.delegate.anchorAxisAlignment??0;let a,l;const d=Ka();if(0===r){const e={offset:t.top-d.pageYOffset,size:t.height,position:0===o?0:1},r={offset:t.left,size:t.width,position:0===s?0:1,mode:Lge.ALIGN};a=Nge(d.innerHeight,n,e)+d.pageYOffset,tA.intersects({start:a,end:a+n},{start:e.offset,end:e.offset+e.size})&&(r.mode=Lge.AVOID),l=Nge(d.innerWidth,i,r)}else{const e={offset:t.left,size:t.width,position:0===s?0:1},r={offset:t.top,size:t.height,position:0===o?0:1,mode:Lge.ALIGN};l=Nge(d.innerWidth,i,e),tA.intersects({start:l,end:l+i},{start:e.offset,end:e.offset+e.size})&&(r.mode=Lge.AVOID),a=Nge(d.innerHeight,n,r)+d.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(0===o?"bottom":"top"),this.view.classList.add(0===s?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const h=Na(this.container),c=this.container.scrollTop||0,u=this.container.scrollLeft||0;this.view.style.top=`${a-(this.useFixedPosition?Na(this.view).top:h.top)+c}px`,this.view.style.left=`${l-(this.useFixedPosition?Na(this.view).left:h.left)+u}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t?.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),hl(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,ta(e).document.activeElement):t&&!Oa(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}const Tge='\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t.codicon[class*=\'codicon-\'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Nanum Gothic", "AppleGothic", sans-serif; }\n\n\t:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }\n';let Mge=class extends At{constructor(e){super(),this.layoutService=e,this.contextView=this._register(new Ige(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer((()=>this.layout())))}showContextView(e,t,i){let n;n=t?t===this.layoutService.getContainer(ta(t))?1:i?3:2:1,this.contextView.setContainer(t??this.layoutService.activeContainer,n),this.contextView.show(e);const o={close:()=>{this.openContextView===o&&this.hideContextView()}};return this.openContextView=o,o}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}};Mge=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,HR)],Mge);class Age extends Mge{getContextViewElement(){return this.contextView.getViewElement()}}function Rge(e){return"object"==typeof e&&"markdown"in e&&"markdownNotSupportedFallback"in e}class Oge{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}async update(e,t,i){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let n;if(lt(e)||qa(e)||void 0===e)n=e;else{this._cancellationTokenSource=new ri;const o=this._cancellationTokenSource.token;let s;if(s=Rge(e)?bt(e.markdown)?e.markdown(o).then((t=>t??e.markdownNotSupportedFallback)):e.markdown??e.markdownNotSupportedFallback:e.element(o),s instanceof Promise?(this._hoverWidget||this.show(y(75,"Loading..."),t,i),n=await s):n=s,this.isDisposed||o.isCancellationRequested)return}this.show(n,t,i)}show(e,t,i){const n=this._hoverWidget;if(this.hasContent(e)){const o={content:e,target:this.target,actions:i?.actions,linkHandler:i?.linkHandler,trapFocus:i?.trapFocus,appearance:{showPointer:"element"===this.hoverDelegate.placement,skipFadeInAnimation:!this.fadeInAnimation||!!n,showHoverHint:i?.appearance?.showHoverHint},position:{hoverPosition:2}};this._hoverWidget=this.hoverDelegate.showHover(o,t)}n?.dispose()}hasContent(e){return!(!e||Yh(e)&&!e.value)}get isDisposed(){return this._hoverWidget?.isDisposed}dispose(){this._hoverWidget?.dispose(),this._cancellationTokenSource?.dispose(!0),this._cancellationTokenSource=void 0}}var Pge=function(e,t){return function(i,n){t(i,n,e)}};let Fge=class extends At{constructor(e,t,i,n,o,s){super(),this._instantiationService=e,this._configurationService=t,this._keybindingService=n,this._layoutService=o,this._accessibilityService=s,this._currentDelayedHoverWasShown=!1,this._delayedHovers=new Map,this._managedHovers=new Map,this._register(i.onDidShowContextMenu((()=>this.hideHover()))),this._contextViewHandler=this._register(new Mge(this._layoutService)),this._register(lu.registerCommandAndKeybindingRule({id:"workbench.action.showHover",weight:199,when:Xu.editorTextFocus.negate(),primary:De(2089,2087),handler:()=>{this._showAndFocusHoverForActiveElement()}}))}showInstantHover(e,t,i,n){const o=this._createHover(e,i);if(o)return this._showHover(o,e,t),o}showDelayedHover(e,t){if(void 0===e.id&&(e.id=Wge(e.content)),!this._currentDelayedHover||this._currentDelayedHoverWasShown){if(this._currentHover?.isLocked)return;if(Bge(this._currentHoverOptions)===Bge(e))return this._currentHover;if(this._currentHover&&!this._currentHover.isDisposed&&void 0!==this._currentDelayedHoverGroupId&&this._currentDelayedHoverGroupId===t?.groupId)return this.showInstantHover({...e,appearance:{...e.appearance,skipFadeInAnimation:!0}})}else if(this._currentDelayedHover&&Bge(this._currentHoverOptions)===Bge(e))return this._currentDelayedHover;const i=this._createHover(e,void 0);return i?(this._currentDelayedHover=i,this._currentDelayedHoverWasShown=!1,this._currentDelayedHoverGroupId=t?.groupId,mi(this._configurationService.getValue("workbench.hover.delay")).then((()=>{i&&!i.isDisposed&&(this._currentDelayedHoverWasShown=!0,this._showHover(i,e))})),i):(this._currentDelayedHover=void 0,this._currentDelayedHoverWasShown=!1,void(this._currentDelayedHoverGroupId=void 0))}setupDelayedHover(e,t,i){return this._setupDelayedHover(e,(()=>({..."function"==typeof t?t():t,target:e})),i)}setupDelayedHoverAtMouse(e,t,i){return this._setupDelayedHover(e,(i=>({..."function"==typeof t?t():t,target:{targetElements:[e],x:void 0!==i?i.x+10:void 0}})),i)}_setupDelayedHover(e,t,i){const n=new Mt;return n.add(ga(e,Qa.MOUSE_OVER,(e=>{this.showDelayedHover(t(e),{groupId:i?.groupId})}))),i?.setupKeyboardEvents&&n.add(ga(e,Qa.KEY_DOWN,(e=>{const i=new Ze(e);(i.equals(10)||i.equals(3))&&this.showInstantHover(t(),!0)}))),this._delayedHovers.set(e,{show:e=>{this.showInstantHover(t(),e)}}),n.add(Tt((()=>this._delayedHovers.delete(e)))),n}_createHover(e,t){if(this._currentDelayedHover=void 0,this._currentHover?.isLocked)return;if(void 0===e.id&&(e.id=Wge(e.content)),Bge(this._currentHoverOptions)===Bge(e))return;this._currentHoverOptions=e,this._lastHoverOptions=e;const i=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),n=Va();t||(i&&n?n.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=n):this._lastFocusedElementBeforeOpen=void 0);const o=new Mt,s=this._instantiationService.createInstance(Sge,e);if(e.persistence?.sticky&&(s.isLocked=!0),e.position?.hoverPosition&&!ct(e.position.hoverPosition)&&(e.target={targetElements:qa(e.target)?[e.target]:e.target.targetElements,x:e.position.hoverPosition.x+10}),s.onDispose((()=>{this._currentHover?.domNode&&za(this._currentHover.domNode)&&this._lastFocusedElementBeforeOpen?.focus(),Bge(this._currentHoverOptions)===Bge(e)&&this.doHideHover(),o.dispose()}),void 0,o),!e.container){const t=qa(e.target)?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(ta(t))}if(s.onRequestLayout((()=>this._contextViewHandler.layout()),void 0,o),e.persistence?.sticky)o.add(ga(ta(e.container).document,Qa.MOUSE_DOWN,(e=>{Oa(e.target,s.domNode)||this.doHideHover()})));else{if("targetElements"in e.target)for(const t of e.target.targetElements)o.add(ga(t,Qa.CLICK,(()=>this.hideHover())));else o.add(ga(e.target,Qa.CLICK,(()=>this.hideHover())));const t=Va();if(t){const i=ta(t).document;o.add(ga(t,Qa.KEY_DOWN,(t=>this._keyDown(t,s,!!e.persistence?.hideOnKeyDown)))),o.add(ga(i,Qa.KEY_DOWN,(t=>this._keyDown(t,s,!!e.persistence?.hideOnKeyDown)))),o.add(ga(t,Qa.KEY_UP,(e=>this._keyUp(e,s)))),o.add(ga(i,Qa.KEY_UP,(e=>this._keyUp(e,s))))}}if("IntersectionObserver"in r){const t=new IntersectionObserver((e=>this._intersectionChange(e,s)),{threshold:0}),i="targetElements"in e.target?e.target.targetElements[0]:e.target;t.observe(i),o.add(Tt((()=>t.disconnect())))}return this._currentHover=s,s}_showHover(e,t,i){this._contextViewHandler.showContextView(new Hge(e,i),t.container)}hideHover(e){!e&&this._currentHover?.isLocked||!this._currentHoverOptions||this.doHideHover()}doHideHover(){this._currentHover=void 0,this._currentHoverOptions=void 0,this._contextViewHandler.hideContextView()}_intersectionChange(e,t){e[e.length-1].isIntersecting||t.dispose()}showAndFocusLastHover(){this._lastHoverOptions&&this.showInstantHover(this._lastHoverOptions,!0,!0)}_showAndFocusHoverForActiveElement(){let e=Va();for(;e;){const t=this._delayedHovers.get(e)??this._managedHovers.get(e);if(t)return void t.show(!0);e=e.parentElement}}_keyDown(e,t,i){if("Alt"===e.key)return void(t.isLocked=!0);const n=new Ze(e);this._keybindingService.resolveKeyboardEvent(n).getSingleModifierDispatchChords().some((e=>!!e))||0!==this._keybindingService.softDispatch(n,n.target).kind||!i||this._currentHoverOptions?.trapFocus&&"Tab"===e.key||(this.hideHover(),this._lastFocusedElementBeforeOpen?.focus())}_keyUp(e,t){"Alt"===e.key&&(t.isLocked=!1,t.isMouseIn||(this.hideHover(),this._lastFocusedElementBeforeOpen?.focus()))}setupManagedHover(e,t,i,n){if(e.showNativeHover)return function(e,t){function i(t){t?e.setAttribute("title",t):e.removeAttribute("title")}return i(Vge(t)),{update:e=>i(Vge(e)),show:()=>{},hide:()=>{},dispose:()=>i(void 0)}}(t,i);let o,s;t.setAttribute("custom-hover","true"),""!==t.title&&(console.warn("HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute."),console.trace("Stack trace:",t.title),t.title="");const r=(t,i)=>{const n=void 0!==s;t&&(s?.dispose(),s=void 0),i&&(o?.dispose(),o=void 0),n&&(e.onDidHideHover?.(),s=void 0)},a=(o,r,a,l)=>new bi((async()=>{s&&!s.isDisposed||(s=new Oge(e,a||t,o>0),await s.update("function"==typeof i?i():i,r,{...n,trapFocus:l}))}),o),l=new Mt;let d=!1;l.add(ga(t,Qa.MOUSE_DOWN,(()=>{d=!0,r(!0,!0)}),!0)),l.add(ga(t,Qa.MOUSE_UP,(()=>{d=!1}),!0)),l.add(ga(t,Qa.MOUSE_LEAVE,(e=>{d=!1,r(!1,e.fromElement===t)}),!0)),l.add(ga(t,Qa.MOUSE_OVER,(n=>{if(o)return;const s=new Mt,l={targetElements:[t],dispose:()=>{}};if(void 0===e.placement||"mouse"===e.placement){const e=e=>{l.x=e.x+10,qa(e.target)&&zge(e.target,t)!==t&&r(!0,!0)};s.add(ga(t,Qa.MOUSE_MOVE,e,!0))}o=s,qa(n.target)&&zge(n.target,t)!==t||s.add(a("function"==typeof e.delay?e.delay(i):e.delay,!1,l))}),!0));vl(t)||l.add(ga(t,Qa.FOCUS,(()=>{if(d||o)return;const n={targetElements:[t],dispose:()=>{}},s=new Mt;s.add(ga(t,Qa.BLUR,(()=>r(!0,!0)),!0)),s.add(a("function"==typeof e.delay?e.delay(i):e.delay,!1,n)),o=s}),!0));const h={show:e=>{r(!1,!0),a(0,e,void 0,e)},hide:()=>{r(!0,!0)},update:async(e,t)=>{i=e,await(s?.update(i,void 0,t))},dispose:()=>{this._managedHovers.delete(t),l.dispose(),r(!0,!0)}};return this._managedHovers.set(t,h),h}showManagedHover(e){const t=this._managedHovers.get(e);t&&t.show(!0)}dispose(){this._managedHovers.forEach((e=>e.dispose())),super.dispose()}};function Bge(e){if(void 0!==e)return e?.id??e}function Wge(e){if(!qa(e))return"string"==typeof e?e.toString():e.value}function Vge(e){const t="function"==typeof e?e():e;return lt(t)?Sh(t):Rge(t)?t.markdownNotSupportedFallback:void 0}Fge=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Pge(0,nc),Pge(1,up),Pge(2,DR),Pge(3,ER),Pge(4,HR),Pge(5,rB)],Fge);class Hge{get anchorPosition(){return this._hover.anchor}constructor(e,t=!1){this._hover=e,this._focus=t,this.layer=1}render(e){return this._hover.render(e),this._focus&&this._hover.focus(),this._hover}getAnchor(){return{x:this._hover.x,y:this._hover.y}}layout(){this._hover.layout()}}function zge(e,t){for(t=t??ta(e).document.body;!e.hasAttribute("custom-hover")&&e!==t;)e=e.parentElement;return e}function Uge(e){return Object.isFrozen(e)?e:function(e){if(!e||"object"!=typeof e)return e;const t=[e];for(;t.length>0;){const e=t.shift();Object.freeze(e);for(const i in e)if(ag.call(e,i)){const n=e[i];"object"!=typeof n||Object.isFrozen(n)||ht(n)||t.push(n)}}return e}(e)}wp(oZ,Fge,1),hw(((e,t)=>{const i=e.getColor(M_);i&&(t.addRule(`.monaco-workbench .workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${i.transparent(.5)}; }`),t.addRule(`.monaco-workbench .workbench-hover hr { border-top: 1px solid ${i.transparent(.5)}; }`))}));class Kge{static createEmptyModel(e){return new Kge({},[],[],void 0,e)}constructor(e,t,i,n,o){this._contents=e,this._keys=t,this._overrides=i,this.raw=n,this.logService=o,this.overrideConfigurations=new Map}get rawConfiguration(){if(!this._rawConfiguration)if(this.raw){const e=(Array.isArray(this.raw)?this.raw:[this.raw]).map((e=>{if(e instanceof Kge)return e;const t=new jge("",this.logService);return t.parseRaw(e),t.configurationModel}));this._rawConfiguration=e.reduce(((e,t)=>t===e?t:e.merge(t)),e[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return 0===this._keys.length&&0===Object.keys(this._contents).length&&0===this._overrides.length}getValue(e){return e?_p(this.contents,e):this.contents}inspect(e,t){const i=this;return{get value(){return Uge(i.rawConfiguration.getValue(e))},get override(){return t?Uge(i.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return Uge(t?i.rawConfiguration.override(t).getValue(e):i.rawConfiguration.getValue(e))},get overrides(){const t=[];for(const{contents:n,identifiers:o,keys:s}of i.rawConfiguration.overrides){const r=new Kge(n,s,[],void 0,i.logService).getValue(e);void 0!==r&&t.push({identifiers:o,value:r})}return t.length?Uge(t):void 0}}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?_p(i,e):i:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){const t=rg(this.contents),i=rg(this.overrides),n=[...this.keys],o=this.raw?Array.isArray(this.raw)?[...this.raw]:[this.raw]:[this];for(const s of e)if(o.push(...s.raw?Array.isArray(s.raw)?s.raw:[s.raw]:[s]),!s.isEmpty()){this.mergeContents(t,s.contents);for(const e of s.overrides){const[t]=i.filter((t=>es(t.identifiers,e.identifiers)));t?(this.mergeContents(t.contents,e.contents),t.keys.push(...e.keys),t.keys=cs(t.keys)):i.push(rg(e))}for(const e of s.keys)-1===n.indexOf(e)&&n.push(e)}return new Kge(t,n,i,!o.length||o.every((e=>e instanceof Kge))?void 0:o,this.logService)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||"object"!=typeof t||!Object.keys(t).length)return this;const i={};for(const e of cs([...Object.keys(this.contents),...Object.keys(t)])){let n=this.contents[e];const o=t[e];o&&("object"==typeof n&&"object"==typeof o?(n=rg(n),this.mergeContents(n,o)):n=o),i[e]=n}return new Kge(i,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(const i of Object.keys(t))i in e&&dt(e[i])&&dt(t[i])?this.mergeContents(e[i],t[i]):e[i]=rg(t[i])}getContentsForOverrideIdentifer(e){let t=null,i=null;const n=e=>{e&&(i?this.mergeContents(i,e):i=rg(e))};for(const i of this.overrides)1===i.identifiers.length&&i.identifiers[0]===e?t=i.contents:i.identifiers.includes(e)&&n(i.contents);return n(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);-1!==t&&(this.keys.splice(t,1),mp(this.contents,e),Bp.test(e)&&this.overrides.splice(this.overrides.findIndex((t=>es(t.identifiers,Wp(e)))),1))}updateValue(e,t,i){if(pp(this.contents,e,t,(e=>this.logService.error(e))),(i=i||-1===this.keys.indexOf(e))&&this.keys.push(e),Bp.test(e)){const t=Wp(e),i={identifiers:t,keys:Object.keys(this.contents[e]),contents:gp(this.contents[e],(e=>this.logService.error(e)))},n=this.overrides.findIndex((e=>es(e.identifiers,t)));-1!==n?this.overrides[n]=i:this.overrides.push(i)}}}class jge{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||Kge.createEmptyModel(this.logService)}parseRaw(e,t){this._raw=e;const{contents:i,keys:n,overrides:o,restricted:s,hasExcludedProperties:r}=this.doParseRaw(e,t);this._configurationModel=new Kge(i,n,o,r?[e]:void 0,this.logService),this._restrictedConfigurations=s||[]}doParseRaw(e,t){const i=ru.as(kp),n=i.getConfigurationProperties(),o=i.getExcludedConfigurationProperties(),s=this.filter(e,n,o,!0,t);return{contents:gp(e=s.raw,(e=>this.logService.error(`Conflict in settings file ${this._name}: ${e}`))),keys:Object.keys(e),overrides:this.toOverrides(e,(e=>this.logService.error(`Conflict in settings file ${this._name}: ${e}`))),restricted:s.restricted,hasExcludedProperties:s.hasExcludedProperties}}filter(e,t,i,n,o){let s=!1;if(!(o?.scopes||o?.skipRestricted||o?.skipUnregistered||o?.exclude?.length))return{raw:e,restricted:[],hasExcludedProperties:s};const r={},a=[];for(const l in e)if(Bp.test(l)&&n){const n=this.filter(e[l],t,i,!1,o);r[l]=n.raw,s=s||n.hasExcludedProperties,a.push(...n.restricted)}else{const n=t[l];n?.restricted&&a.push(l),this.shouldInclude(l,n,i,o)?r[l]=e[l]:s=!0}return{raw:r,restricted:a,hasExcludedProperties:s}}shouldInclude(e,t,i,n){if(n.exclude?.includes(e))return!1;if(n.include?.includes(e))return!0;if(n.skipRestricted&&t?.restricted)return!1;if(n.skipUnregistered&&!t)return!1;const o=t??i[e],s=o?void 0!==o.scope?o.scope:4:void 0;return void 0===s||void 0===n.scopes||n.scopes.includes(s)}toOverrides(e,t){const i=[];for(const n of Object.keys(e))if(Bp.test(n)){const o={};for(const t in e[n])o[t]=e[n][t];i.push({identifiers:Wp(n),keys:Object.keys(o),contents:gp(o,t)})}return i}}class qge{constructor(e,t,i,n,o,s,r,a,l,d,h,c,u){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=n,this.defaultConfiguration=o,this.policyConfiguration=s,this.applicationConfiguration=r,this.userConfiguration=a,this.localUserConfiguration=l,this.remoteUserConfiguration=d,this.workspaceConfiguration=h,this.folderConfigurationModel=c,this.memoryConfigurationModel=u}toInspectValue(e){return void 0!==e?.value||void 0!==e?.override||void 0!==e?.overrides?e:void 0}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.toInspectValue(this.userInspectValue)}}class $ge{constructor(e,t,i,n,o,s,r,a,l,d){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=n,this._remoteUserConfiguration=o,this._workspaceConfiguration=s,this._folderConfigurations=r,this._memoryConfiguration=a,this._memoryConfigurationByResource=l,this.logService=d,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new nd,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let n;i.resource?(n=this._memoryConfigurationByResource.get(i.resource),n||(n=Kge.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(i.resource,n))):n=this._memoryConfiguration,void 0===t?n.removeValue(e):n.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const n=this.getConsolidatedConfigurationModel(e,t,i),o=this.getFolderConfigurationModelForResource(t.resource,i),s=t.resource&&this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration,r=new Set;for(const t of n.overrides)for(const i of t.identifiers)void 0!==n.getOverrideValue(e,i)&&r.add(i);return new qge(e,t,n.getValue(e),r.size?[...r]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,o||void 0,s)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){if(!this._userConfiguration)if(this._remoteUserConfiguration.isEmpty())this._userConfiguration=this._localUserConfiguration;else{const e=this._localUserConfiguration.merge(this._remoteUserConfiguration);this._userConfiguration=new Kge(e.contents,e.keys,e.overrides,void 0,this.logService)}return this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,i){let n=this.getConsolidatedConfigurationModelForResource(t,i);if(t.overrideIdentifier&&(n=n.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&void 0!==this._policyConfiguration.getValue(e)){n=n.merge();for(const e of this._policyConfiguration.keys)n.setValue(e,this._policyConfiguration.getValue(e))}return n}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const n=t.getFolder(e);n&&(i=this.getFolderConsolidatedConfiguration(n.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),n=this._folderConfigurations.get(e);n?(t=i.merge(n),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys,raw:Array.isArray(this.applicationConfiguration.raw)?void 0:this.applicationConfiguration.raw},userLocal:{contents:this.localUserConfiguration.contents,overrides:this.localUserConfiguration.overrides,keys:this.localUserConfiguration.keys,raw:Array.isArray(this.localUserConfiguration.raw)?void 0:this.localUserConfiguration.raw},userRemote:{contents:this.remoteUserConfiguration.contents,overrides:this.remoteUserConfiguration.overrides,keys:this.remoteUserConfiguration.keys,raw:Array.isArray(this.remoteUserConfiguration.raw)?void 0:this.remoteUserConfiguration.raw},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce(((e,t)=>{const{contents:i,overrides:n,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:n,keys:o}]),e}),[])}}static parse(e,t){const i=this.parseConfigurationModel(e.defaults,t),n=this.parseConfigurationModel(e.policy,t),o=this.parseConfigurationModel(e.application,t),s=this.parseConfigurationModel(e.userLocal,t),r=this.parseConfigurationModel(e.userRemote,t),a=this.parseConfigurationModel(e.workspace,t),l=e.folders.reduce(((e,i)=>(e.set(uo.revive(i[0]),this.parseConfigurationModel(i[1],t)),e)),new nd);return new $ge(i,n,o,s,r,a,l,Kge.createEmptyModel(t),new nd,t)}static parseConfigurationModel(e,t){return new Kge(e.contents,e.keys,e.overrides,e.raw,t)}}class Gge{constructor(e,t,i,n,o){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=n,this.logService=o,this._marker="\n",this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const t of e.keys)this.affectedKeys.add(t);for(const[,t]of e.overrides)for(const e of t)this.affectedKeys.add(e);this._affectsConfigStr=this._marker;for(const e of this.affectedKeys)this._affectsConfigStr+=e+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=$ge.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){const i=this._marker+e,n=this._affectsConfigStr.indexOf(i);if(n<0)return!1;const o=n+i.length;if(o>=this._affectsConfigStr.length)return!1;const s=this._affectsConfigStr.charCodeAt(o);return(s===this._markerCode1||s===this._markerCode2)&&(!t||!cg(this.previousConfiguration?this.previousConfiguration.getValue(e,t,this.previous?.workspace):void 0,this.currentConfiguraiton.getValue(e,t,this.currentWorkspace)))}}const Zge={kind:0},Yge={kind:1};class Qge{constructor(e,t,i){this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const t of e){const e=t.command;e&&"-"!==e.charAt(0)&&this._defaultBoundCommands.set(e,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=Qge.handleRemovals([].concat(e).concat(t));for(let e=0,t=this._keybindings.length;e<t;e++){const t=this._keybindings[e];if(0===t.chords.length)continue;const i=t.when?.substituteConstants();i&&0===i.type||this._addKeyPress(t.chords[0],t)}}static _isTargetedForRemoval(e,t,i){if(t)for(let i=0;i<t.length;i++)if(t[i]!==e.chords[i])return!1;if(i&&1!==i.type){if(!e.when)return!1;if(!function(e,t){const i=e?e.substituteConstants():void 0,n=t?t.substituteConstants():void 0;return!i&&!n||!(!i||!n)&&i.equals(n)}(i,e.when))return!1}return!0}static handleRemovals(e){const t=new Map;for(let i=0,n=e.length;i<n;i++){const n=e[i];if(n.command&&"-"===n.command.charAt(0)){const e=n.command.substring(1);t.has(e)?t.get(e).push(n):t.set(e,[n])}}if(0===t.size)return e;const i=[];for(let n=0,o=e.length;n<o;n++){const o=e[n];if(!o.command||0===o.command.length){i.push(o);continue}if("-"===o.command.charAt(0))continue;const s=t.get(o.command);if(!s||!o.isDefault){i.push(o);continue}let r=!1;for(const e of s){const t=e.when;if(this._isTargetedForRemoval(o,e.chords,t)){r=!0;break}}r||i.push(o)}return i}_addKeyPress(e,t){const i=this._map.get(e);if(void 0===i)return this._map.set(e,[t]),void this._addToLookupMap(t);for(let e=i.length-1;e>=0;e--){const n=i[e];if(n.command===t.command)continue;let o=!0;for(let e=1;e<n.chords.length&&e<t.chords.length;e++)if(n.chords[e]!==t.chords[e]){o=!1;break}o&&Qge.whenIsEntirelyIncluded(n.when,t.when)&&this._removeFromLookupMap(n)}i.push(t),this._addToLookupMap(t)}_addToLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);void 0===t?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(void 0!==t)for(let i=0,n=t.length;i<n;i++)if(t[i]===e)return void t.splice(i,1)}static whenIsEntirelyIncluded(e,t){return!t||1===t.type||!(!e||1===e.type)&&nu(e,t)}getKeybindings(){return this._keybindings}lookupPrimaryKeybinding(e,t,i=!1){const n=this._lookupMap.get(e);if(void 0===n||0===n.length)return null;if(1===n.length&&!i)return n[0];for(let e=n.length-1;e>=0;e--){const i=n[e];if(t.contextMatchesRules(i.when))return i}return i?null:n[n.length-1]}resolve(e,t,i){const n=[...t,i];this._log(`| Resolving ${n}`);const o=this._map.get(n[0]);if(void 0===o)return this._log("\\ No keybinding entries."),Zge;let s=null;if(n.length<2)s=o;else{s=[];for(let e=0,t=o.length;e<t;e++){const t=o[e];if(n.length>t.chords.length)continue;let i=!0;for(let e=1;e<n.length;e++)if(t.chords[e]!==n[e]){i=!1;break}i&&s.push(t)}}const r=this._findCommand(e,s);return r?n.length<r.chords.length?(this._log(`\\ From ${s.length} keybinding entries, awaiting ${r.chords.length-n.length} more chord(s), when: ${Xge(r.when)}, source: ${Jge(r)}.`),Yge):(this._log(`\\ From ${s.length} keybinding entries, matched ${r.command}, when: ${Xge(r.when)}, source: ${Jge(r)}.`),{kind:2,commandId:r.command,commandArgs:r.commandArgs,isBubble:r.bubble}):(this._log(`\\ From ${s.length} keybinding entries, no when clauses matched the context.`),Zge)}_findCommand(e,t){for(let i=t.length-1;i>=0;i--){const n=t[i];if(Qge._contextMatchesRules(e,n.when))return n}return null}static _contextMatchesRules(e,t){return!t||t.evaluate(e)}}function Xge(e){return e?`${e.serialize()}`:"no when condition"}function Jge(e){return e.extensionId?e.isBuiltinExtension?`built-in extension ${e.extensionId}`:`user extension ${e.extensionId}`:e.isDefault?"built-in":"user"}const epe=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class tpe extends At{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:zt.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,n,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=n,this._logService=o,this._onDidUpdateKeybindings=this._register(new Zt),this._currentChords=[],this._currentChordChecker=new wi,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=ipe.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new bi,this._currentlyDispatchingCommandId=null,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t,i=!1){const n=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService,i);if(n)return n.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),Zge;const[n]=i.getDispatchChords();if(null===n)return this._log("\\ Keyboard event cannot be dispatched"),Zge;const o=this._contextKeyService.getContext(t),s=this._currentChords.map((({keypress:e})=>e));return this._getResolver().resolve(o,s,n)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet((()=>{this._documentHasFocus()?Date.now()-e>5e3&&this._leaveChordMode():this._leaveChordMode()}),500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw Fe("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(y(1684,"({0}) was pressed. Waiting for second key of chord...",t));break;default:{const e=this._currentChords.map((({label:e})=>e)).join(", ");this._currentChordStatusMessage=this._notificationService.status(y(1685,"({0}) was pressed. Waiting for next key of chord...",e))}}this._scheduleLeaveChordMode(),iU.enabled&&iU.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.close(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],iU.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[n]=i.getSingleModifierDispatchChords();if(n)return this._ignoreSingleModifiers.has(n)?(this._log(`+ Ignoring single modifier ${n} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=ipe.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=ipe.EMPTY,null===this._currentSingleModifier?(this._log(`+ Storing single modifier for possible chord ${n}.`),this._currentSingleModifier=n,this._currentSingleModifierClearTimeout.cancelAndSet((()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null}),300),!1):n===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${n} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getChords();return this._ignoreSingleModifiers=new ipe(o),null!==this._currentSingleModifier&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){let n=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let o=null,s=null;if(i){const[t]=e.getSingleModifierDispatchChords();o=t,s=t?[t]:[]}else[o]=e.getDispatchChords(),s=this._currentChords.map((({keypress:e})=>e));if(null===o)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),n;const r=this._contextKeyService.getContext(t),a=e.getLabel(),l=this._getResolver().resolve(r,s,o);switch(l.kind){case 0:if(this._logService.trace("KeybindingService#dispatch",a,"[ No matching keybinding ]"),this.inChordMode){const e=this._currentChords.map((({label:e})=>e)).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${e}, ${a}".`),this._notificationService.status(y(1686,"The key combination ({0}, {1}) is not a command.",e,a),{hideAfter:1e4}),this._leaveChordMode(),n=!0}return n;case 1:return this._logService.trace("KeybindingService#dispatch",a,"[ Several keybindings match - more chords needed ]"),n=!0,this._expectAnotherChord(o,a),this._log(1===this._currentChords.length?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),n;case 2:if(this._logService.trace("KeybindingService#dispatch",a,`[ Will dispatch command ${l.commandId} ]`),null===l.commandId||""===l.commandId){if(this.inChordMode){const e=this._currentChords.map((({label:e})=>e)).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${e}, ${a}".`),this._notificationService.status(y(1687,"The key combination ({0}, {1}) is not a command.",e,a),{hideAfter:1e4}),this._leaveChordMode(),n=!0}}else{this.inChordMode&&this._leaveChordMode(),l.isBubble||(n=!0),this._log(`+ Invoking command ${l.commandId}.`),this._currentlyDispatchingCommandId=l.commandId;try{void 0===l.commandArgs?this._commandService.executeCommand(l.commandId).then(void 0,(e=>this._notificationService.warn(e))):this._commandService.executeCommand(l.commandId,l.commandArgs).then(void 0,(e=>this._notificationService.warn(e)))}finally{this._currentlyDispatchingCommandId=null}epe.test(l.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:l.commandId,from:"keybinding",detail:e.getUserSettingsLabel()??void 0})}return n}}mightProducePrintableCharacter(e){return!e.ctrlKey&&!e.metaKey&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30)}}class ipe{static{this.EMPTY=new ipe(null)}constructor(e){this._ctrlKey=!!e&&e.ctrlKey,this._shiftKey=!!e&&e.shiftKey,this._altKey=!!e&&e.altKey,this._metaKey=!!e&&e.metaKey}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}class npe{constructor(e,t,i,n,o,s,r){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?ope(e.getDispatchChords()):[],e&&0===this.chords.length&&(this.chords=ope(e.getSingleModifierDispatchChords())),this.bubble=!!t&&94===t.charCodeAt(0),this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=n,this.isDefault=o,this.extensionId=s,this.isBuiltinExtension=r}}function ope(e){const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];if(!n)return[];t.push(n)}return t}class spe extends qe{constructor(e,t){if(super(),0===t.length)throw Pe("chords");this._os=e,this._chords=t}getLabel(){return fR.toLabel(this._os,this._chords,(e=>this._getLabel(e)))}getAriaLabel(){return _R.toLabel(this._os,this._chords,(e=>this._getAriaLabel(e)))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:vR.toLabel(this._os,this._chords,(e=>this._getElectronAccelerator(e)))}getUserSettingsLabel(){return bR.toLabel(this._os,this._chords,(e=>this._getUserSettingsLabel(e)))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map((e=>this._getChord(e)))}_getChord(e){return new je(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map((e=>this._getChordDispatch(e)))}getSingleModifierDispatchChords(){return this._chords.map((e=>this._getSingleModifierChordDispatch(e)))}}class rpe extends spe{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(2===this._os)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return Le.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Le.toString(e.keyCode)}_getElectronAccelerator(e){return Le.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=Le.toUserSettingsUS(e.keyCode);return t?t.toLowerCase():t}_getChordDispatch(e){return rpe.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=Le.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return 5!==e.keyCode||e.shiftKey||e.altKey||e.metaKey?4!==e.keyCode||e.ctrlKey||e.altKey||e.metaKey?6!==e.keyCode||e.ctrlKey||e.shiftKey||e.metaKey?57!==e.keyCode||e.ctrlKey||e.shiftKey||e.altKey?null:"meta":"alt":"shift":"ctrl"}static _scanCodeToKeyCode(e){const t=xe[e];if(-1!==t)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof Ue)return e;const t=this._scanCodeToKeyCode(e.scanCode);return 0===t?null:new Ue(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=ope(e.chords.map((e=>this._toKeyCodeChord(e))));return i.length>0?[new rpe(i,t)]:[]}}let ape=[],lpe=[],dpe=[];function hpe(e,t=!1){!function(e,t,i){const n=function(e){return{id:e.id,mime:e.mime,filename:e.filename,extension:e.extension,filepattern:e.filepattern,firstline:e.firstline,userConfigured:false,filenameLowercase:e.filename?e.filename.toLowerCase():void 0,extensionLowercase:e.extension?e.extension.toLowerCase():void 0,filepatternLowercase:e.filepattern?uhe(e.filepattern.toLowerCase()):void 0,filepatternOnPath:!!e.filepattern&&e.filepattern.indexOf(Qn.sep)>=0}}(e);ape.push(n),n.userConfigured?dpe.push(n):lpe.push(n),i&&!n.userConfigured&&ape.forEach((e=>{e.mime===n.mime||e.userConfigured||(n.extension&&e.extension===n.extension&&console.warn(`Overwriting extension <<${n.extension}>> to now point to mime <<${n.mime}>>`),n.filename&&e.filename===n.filename&&console.warn(`Overwriting filename <<${n.filename}>> to now point to mime <<${n.mime}>>`),n.filepattern&&e.filepattern===n.filepattern&&console.warn(`Overwriting filepattern <<${n.filepattern}>> to now point to mime <<${n.mime}>>`),n.firstline&&e.firstline===n.firstline&&console.warn(`Overwriting firstline <<${n.firstline}>> to now point to mime <<${n.mime}>>`))}))}(e,0,t)}function cpe(e,t,i){let n,o,s;for(let r=i.length-1;r>=0;r--){const a=i[r];if(t===a.filenameLowercase){n=a;break}if(a.filepattern&&(!o||a.filepattern.length>o.filepattern.length)){const i=a.filepatternOnPath?e:t;a.filepatternLowercase?.(i)&&(o=a)}a.extension&&(!s||a.extension.length>s.extension.length)&&t.endsWith(a.extensionLowercase)&&(s=a)}return n||o||s||void 0}const upe=Object.prototype.hasOwnProperty,gpe="vs.editor.nullLanguage";class ppe{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(gpe,0),this._register(Up,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||gpe}}class mpe extends At{static{this.instanceCount=0}constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new Zt),this.onDidChange=this._onDidChange.event,mpe.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new ppe,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(zp.onDidChangeLanguages((e=>{this._initializeFromRegistry()}))))}dispose(){mpe.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},ape=ape.filter((e=>e.userConfigured)),lpe=[];const e=[].concat(zp.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach((e=>{const t=this._languages[e];t.name&&(this._nameMap[t.name]=t.identifier),t.aliases.forEach((e=>{this._lowercaseNameMap[e.toLowerCase()]=t.identifier})),t.mimetypes.forEach((e=>{this._mimeTypesMap[e]=t.identifier}))})),ru.as(kp).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;upe.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let n=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),n=t.mimetypes[0]),n||(n=`text/x-${i}`,e.mimetypes.push(n)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const e of t.extensions)hpe({id:i,mime:n,extension:e},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const o of t.filenames)hpe({id:i,mime:n,filename:o},this._warnOnOverwrite),e.filenames.push(o);if(Array.isArray(t.filenamePatterns))for(const e of t.filenamePatterns)hpe({id:i,mime:n,filepattern:e},this._warnOnOverwrite);if("string"==typeof t.firstLine&&t.firstLine.length>0){let e=t.firstLine;"^"!==e.charAt(0)&&(e="^"+e);try{const t=new RegExp(e);ji(t)||hpe({id:i,mime:n,firstline:t},this._warnOnOverwrite)}catch(i){console.warn(`[${t.id}]: Invalid regular expression \`${e}\`: `,i)}}e.aliases.push(i);let o=null;if(void 0!==t.aliases&&Array.isArray(t.aliases)&&(o=0===t.aliases.length?[null]:t.aliases),null!==o)for(const t of o)t&&0!==t.length&&e.aliases.push(t);const s=null!==o&&o.length>0;if(s&&null===o[0]);else{const t=(s?o[0]:null)||i;!s&&e.name||(e.name=t)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return!!e&&upe.call(this._languages,e)}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return upe.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&upe.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return e||t?function(e,t){return function(e,t){let i;if(e)switch(e.scheme){case So.file:i=e.fsPath;break;case So.data:i=$h.parseMetaData(e).get($h.META_DATA_LABEL);break;case So.vscodeNotebookCell:i=void 0;break;default:i=e.path}if(!i)return[{id:"unknown",mime:yp.unknown}];i=i.toLowerCase();const n=io(i),o=cpe(i,n,dpe);if(o)return[o,{id:Up,mime:yp.text}];const s=cpe(i,n,lpe);if(s)return[s,{id:Up,mime:yp.text}];if(t){const e=function(e){if(kn(e)&&(e=e.substr(1)),e.length>0)for(let t=ape.length-1;t>=0;t--){const i=ape[t];if(!i.firstline)continue;const n=e.match(i.firstline);if(n&&n.length>0)return i}}(t);if(e)return[e,{id:Up,mime:yp.text}]}return[{id:"unknown",mime:yp.unknown}]}(e,t).map((e=>e.id))}(e,t):[]}}class fpe extends At{static{this.instanceCount=0}constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new Zt),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new Zt),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new Zt({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,fpe.instanceCount++,this._registry=this._register(new mpe(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange((()=>this._onDidChange.fire())))}dispose(){fpe.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){return this._registry.guessLanguageIdByFilepathOrFirstLine(e,t).at(0)??null}createById(e){return new _pe(this.onDidChange,(()=>this._createAndGetLanguageIdentifier(e)))}createByFilepathOrFirstLine(e,t){return new _pe(this.onDidChange,(()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)}))}_createAndGetLanguageIdentifier(e){return e&&this.isRegisteredLanguageId(e)||(e=Up),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),JS.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}class _pe{constructor(e,t){this._value=Sr(this,e,(()=>t())),this.onDidChange=zt.fromObservable(this._value)}get languageId(){return this._value.get()}}const vpe=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,bpe=/(&)?(&)([^\s&])/g;var wpe,Cpe;!function(e){e[e.Right=0]="Right",e[e.Left=1]="Left"}(wpe||(wpe={})),function(e){e[e.Above=0]="Above",e[e.Below=1]="Below"}(Cpe||(Cpe={}));class ype extends uR{constructor(e,t,i,n){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:1,actionViewItemProvider:e=>this.doGetActionViewItem(e,i,s),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...$||G?[10]:[]],keyDown:!0}}),this.menuStyles=n,this.menuElement=o,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,n),this._register(JT.addTarget(o)),this._register(ga(o,Qa.KEY_DOWN,(e=>{new Ze(e).equals(2)&&e.preventDefault()}))),i.enableMnemonics&&this._register(ga(o,Qa.KEY_DOWN,(e=>{const t=e.key.toLocaleLowerCase();if(this.mnemonics.has(t)){Ja(e,!0);const i=this.mnemonics.get(t);if(1===i.length&&(i[0]instanceof xpe&&i[0].container&&this.focusItemByElement(i[0].container),i[0].onClick(e)),i.length>1){const e=i.shift();e&&e.container&&(this.focusItemByElement(e.container),i.push(e)),this.mnemonics.set(t,i)}}}))),G&&this._register(ga(o,Qa.KEY_DOWN,(e=>{const t=new Ze(e);t.equals(14)||t.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),Ja(e,!0)):(t.equals(13)||t.equals(12))&&(this.focusedItem=0,this.focusPrevious(),Ja(e,!0))}))),this._register(ga(this.domNode,Qa.MOUSE_OUT,(e=>{Oa(e.relatedTarget,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),e.stopPropagation())}))),this._register(ga(this.actionsList,Qa.MOUSE_OVER,(e=>{let t=e.target;if(t&&Oa(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(t.classList.contains("action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}}))),this._register(JT.addTarget(this.actionsList)),this._register(ga(this.actionsList,XT.Tap,(e=>{let t=e.initialTarget;if(t&&Oa(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(t.classList.contains("action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}})));const s={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new dA(o,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const r=this.scrollableElement.getDomNode();r.style.position="",this.styleScrollElement(r,n),this._register(ga(o,XT.Change,(e=>{Ja(e,!0);const t=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:t-e.translationY})}))),this._register(ga(r,Qa.MOUSE_UP,(e=>{e.preventDefault()})));const a=ta(e);o.style.maxHeight=`${Math.max(10,a.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter(((e,n)=>{if(i.submenuIds?.has(e.id))return console.warn(`Found submenu cycle: ${e.id}`),!1;if(e instanceof cc){if(n===t.length-1||0===n)return!1;if(t[n-1]instanceof cc)return!1}return!0})),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter((e=>!(e instanceof kpe))).forEach(((e,t,i)=>{e.updatePositionInSet(t+1,i.length)}))}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(Ba(e)?this.styleSheet=DM(e):(ype.globalStyleSheet||(ype.globalStyleSheet=DM()),this.styleSheet=ype.globalStyleSheet)),this.styleSheet.textContent=function(e,t){let i=`\n.monaco-menu {\n\tfont-size: 13px;\n\tborder-radius: 5px;\n\tmin-width: 160px;\n}\n\n${Lpe(fh.menuSelection)}\n${Lpe(fh.menuSubmenu)}\n\n.monaco-menu .monaco-action-bar {\n\ttext-align: right;\n\toverflow: hidden;\n\twhite-space: nowrap;\n}\n\n.monaco-menu .monaco-action-bar .actions-container {\n\tdisplay: flex;\n\tmargin: 0 auto;\n\tpadding: 0;\n\twidth: 100%;\n\tjustify-content: flex-end;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar.reverse .actions-container {\n\tflex-direction: row-reverse;\n}\n\n.monaco-menu .monaco-action-bar .action-item {\n\tcursor: pointer;\n\tdisplay: inline-block;\n\ttransition: transform 50ms ease;\n\tposition: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled {\n\tcursor: default;\n}\n\n.monaco-menu .monaco-action-bar .action-item .icon,\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar .action-label {\n\tfont-size: 11px;\n\tmargin-right: 4px;\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label,\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {\n\tcolor: var(--vscode-disabledForeground);\n}\n\n/* Vertical actions */\n\n.monaco-menu .monaco-action-bar.vertical {\n\ttext-align: left;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tdisplay: block;\n\tborder-bottom: 1px solid var(--vscode-menu-separatorBackground);\n\tpadding-top: 1px;\n\tpadding: 30px;\n}\n\n.monaco-menu .secondary-actions .monaco-action-bar .action-label {\n\tmargin-left: 6px;\n}\n\n/* Action Items */\n.monaco-menu .monaco-action-bar .action-item.select-container {\n\toverflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */\n\tflex: 1;\n\tmax-width: 170px;\n\tmin-width: 60px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin-right: 10px;\n}\n\n.monaco-menu .monaco-action-bar.vertical {\n\tmargin-left: 0;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tpadding: 0;\n\ttransform: none;\n\tdisplay: flex;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.active {\n\ttransform: none;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\tflex: 1 1 auto;\n\tdisplay: flex;\n\theight: 2em;\n\talign-items: center;\n\tposition: relative;\n\tmargin: 0 4px;\n\tborder-radius: 4px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding {\n\topacity: unset;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label {\n\tflex: 1 1 auto;\n\ttext-decoration: none;\n\tpadding: 0 1em;\n\tbackground: none;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .keybinding,\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tdisplay: inline-block;\n\tflex: 2 1 auto;\n\tpadding: 0 1em;\n\ttext-align: right;\n\tfont-size: 12px;\n\tline-height: 1;\n\topacity: 0.7;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {\n\tfont-size: 16px !important;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {\n\tmargin-left: auto;\n\tmargin-right: -20px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {\n\topacity: 0.4;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n\tmargin: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tposition: static;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {\n\tposition: absolute;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\twidth: 100%;\n\theight: 0px !important;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {\n\tpadding: 0.7em 1em 0.1em 1em;\n\tfont-weight: bold;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:hover {\n\tcolor: inherit;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tposition: absolute;\n\tvisibility: hidden;\n\twidth: 1em;\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {\n\tvisibility: visible;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n/* Context Menu */\n\n.context-view.monaco-menu-container {\n\toutline: 0;\n\tborder: none;\n\tanimation: fadeIn 0.083s linear;\n\t-webkit-app-region: no-drag;\n}\n\n.context-view.monaco-menu-container :focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {\n\toutline: 0;\n}\n\n.hc-black .context-view.monaco-menu-container,\n.hc-light .context-view.monaco-menu-container,\n:host-context(.hc-black) .context-view.monaco-menu-container,\n:host-context(.hc-light) .context-view.monaco-menu-container {\n\tbox-shadow: none;\n}\n\n.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused {\n\tbackground: none;\n}\n\n/* Vertical Action Bar Styles */\n\n.monaco-menu .monaco-action-bar.vertical {\n\tpadding: 4px 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\theight: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),\n.monaco-menu .monaco-action-bar.vertical .keybinding {\n\tfont-size: inherit;\n\tpadding: 0 2em;\n\tmax-height: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tfont-size: inherit;\n\twidth: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tfont-size: inherit;\n\tmargin: 5px 0 !important;\n\tpadding: 0;\n\tborder-radius: 0;\n}\n\n.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator,\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tmargin-left: 0;\n\tmargin-right: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tfont-size: 60%;\n\tpadding: 0 1.8em;\n}\n\n.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator,\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n\tmask-size: 10px 10px;\n\t-webkit-mask-size: 10px 10px;\n}\n\n.monaco-menu .action-item {\n\tcursor: default;\n}`;if(t){i+="\n\t\t\t/* Arrows */\n\t\t\t.monaco-scrollable-element > .scrollbar > .scra {\n\t\t\t\tcursor: pointer;\n\t\t\t\tfont-size: 11px !important;\n\t\t\t}\n\n\t\t\t.monaco-scrollable-element > .visible {\n\t\t\t\topacity: 1;\n\n\t\t\t\t/* Background rule added for IE9 - to allow clicks on dom node */\n\t\t\t\tbackground:rgba(0,0,0,0);\n\n\t\t\t\ttransition: opacity 100ms linear;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible {\n\t\t\t\topacity: 0;\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible.fade {\n\t\t\t\ttransition: opacity 800ms linear;\n\t\t\t}\n\n\t\t\t/* Scrollable Content Inset Shadow */\n\t\t\t.monaco-scrollable-element > .shadow {\n\t\t\t\tposition: absolute;\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 3px;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 3px;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 100%;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top-left-corner {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t\t/* Fix for https://github.com/microsoft/vscode/issues/103170 */\n\t\t\t.monaco-menu .action-item .monaco-submenu {\n\t\t\t\tz-index: 1;\n\t\t\t}\n\t\t";const t=e.scrollbarShadow;t&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\t\tbox-shadow: ${t} 0 6px 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\t\tbox-shadow: ${t} 6px 0 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.top.left {\n\t\t\t\t\tbox-shadow: ${t} 6px 6px 6px -6px inset;\n\t\t\t\t}\n\t\t\t`);const n=e.scrollbarSliderBackground;n&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider {\n\t\t\t\t\tbackground: ${n};\n\t\t\t\t}\n\t\t\t`);const o=e.scrollbarSliderHoverBackground;o&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider:hover {\n\t\t\t\t\tbackground: ${o};\n\t\t\t\t}\n\t\t\t`);const s=e.scrollbarSliderActiveBackground;s&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider.active {\n\t\t\t\t\tbackground: ${s};\n\t\t\t\t}\n\t\t\t`)}return i}(t,Ba(e))}styleScrollElement(e,t){const i=t.foregroundColor??"",n=t.backgroundColor??"",o=t.borderColor?`1px solid ${t.borderColor}`:"",s=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=o,e.style.borderRadius="5px",e.style.color=i,e.style.backgroundColor=n,e.style.boxShadow=s}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t<this.actionsList.children.length;t++)if(e===this.actionsList.children[t]){this.focusedItem=t;break}}updateFocus(e){super.updateFocus(e,!0,!0),void 0!==this.focusedItem&&this.scrollableElement.setScrollPosition({scrollTop:Math.round(this.menuElement.scrollTop)})}doGetActionViewItem(e,t,i){if(e instanceof cc)return new kpe(t.context,e,{icon:!0},this.menuStyles);if(e instanceof uc){const n=new xpe(e,e.actions,i,{...t,submenuIds:new Set([...t.submenuIds||[],e.id])},this.menuStyles);if(t.enableMnemonics){const e=n.getMnemonic();if(e&&n.isEnabled()){let t=[];this.mnemonics.has(e)&&(t=this.mnemonics.get(e)),t.push(n),this.mnemonics.set(e,t)}}return n}{const i=t.getKeyBinding?.(e)?.getLabel(),n={enableMnemonics:t.enableMnemonics,useEventAsContext:t.useEventAsContext,keybinding:i},o=new Spe(t.context,e,n,this.menuStyles);if(t.enableMnemonics){const e=o.getMnemonic();if(e&&o.isEnabled()){let t=[];this.mnemonics.has(e)&&(t=this.mnemonics.get(e)),t.push(o),this.mnemonics.set(e,t)}}return o}}}class Spe extends dR{constructor(e,t,i,n){if(super(t,t,i={...i,isMenu:!0,icon:void 0!==i.icon&&i.icon,label:void 0===i.label||i.label}),this.menuStyle=n,this.options=i,this.cssClass="",this.options.label&&i.enableMnemonics){const e=this.action.label;if(e){const t=vpe.exec(e);t&&(this.mnemonic=(t[1]?t[1]:t[3]).toLocaleLowerCase())}}this.runOnceToEnableMouseUp=new Ci((()=>{this.element&&(this._register(ga(this.element,Qa.MOUSE_UP,(e=>{if(Ja(e,!0),c){if(new Je(ta(this.element),e).rightButton)return;this.onClick(e)}else setTimeout((()=>{this.onClick(e)}),0)}))),this._register(ga(this.element,Qa.CONTEXT_MENU,(e=>{Ja(e,!0)}))))}),100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=il(this.element,ll("a.action-menu-item")),this._action.id===cc.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=il(this.item,ll("span.menu-item-check"+vh.asCSSSelector(fh.menuSelection))),this.check.setAttribute("role","none"),this.label=il(this.item,ll("span.action-label")),this.options.label&&this.options.keybinding&&(il(this.item,ll("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){super.focus(),this.item?.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){if(this.label&&this.options.label){ca(this.label);let e=Sh(this.action.label);if(e){const t=function(e){const t=vpe,i=t.exec(e);if(!i)return e;const n=!i[1];return e.replace(t,n?"$2$3":"").trim()}(e);this.options.enableMnemonics||(e=t),this.label.setAttribute("aria-label",t.replace(/&&/g,"&"));const i=vpe.exec(e);if(i){e=Wi(e),bpe.lastIndex=0;let t=bpe.exec(e);for(;t&&t[1];)t=bpe.exec(e);const n=e=>e.replace(/&&/g,"&");t?this.label.append(zi(n(e.substr(0,t.index))," "),ll("u",{"aria-hidden":"true"},t[3]),Ui(n(e.substr(t.index+t[0].length))," ")):this.label.textContent=n(e).trim(),this.item?.setAttribute("aria-keyshortcuts",(i[1]?i[1]:i[3]).toLocaleLowerCase())}else this.label.textContent=e.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),void 0!==e?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,n=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=i??"",this.item.style.outline=n,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=t??"")}}class xpe extends Spe{constructor(e,t,i,n,o){super(e,e,n,o),this.submenuActions=t,this.parentData=i,this.submenuOptions=n,this.mysubmenu=null,this.submenuDisposables=this._register(new Mt),this.mouseOver=!1,this.expandDirection=n&&void 0!==n.expandDirection?n.expandDirection:{horizontal:wpe.Right,vertical:Cpe.Below},this.showScheduler=new Ci((()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))}),250),this.hideScheduler=new Ci((()=>{this.element&&!Oa(Va(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))}),750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=il(this.item,ll("span.submenu-indicator"+vh.asCSSSelector(fh.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(ga(this.element,Qa.KEY_UP,(e=>{const t=new Ze(e);(t.equals(17)||t.equals(3))&&(Ja(e,!0),this.createSubmenu(!0))}))),this._register(ga(this.element,Qa.KEY_DOWN,(e=>{const t=new Ze(e);Va()===this.item&&(t.equals(17)||t.equals(3))&&Ja(e,!0)}))),this._register(ga(this.element,Qa.MOUSE_OVER,(e=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())}))),this._register(ga(this.element,Qa.MOUSE_LEAVE,(e=>{this.mouseOver=!1}))),this._register(ga(this.element,Qa.FOCUS_OUT,(e=>{this.element&&!Oa(Va(),this.element)&&this.hideScheduler.schedule()}))),this._register(this.parentData.parent.onScroll((()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))}))))}updateEnabled(){}onClick(e){Ja(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,n){const o={top:0,left:0};return o.left=Nge(e.width,t.width,{position:n.horizontal===wpe.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left<i.left+i.width&&(i.left+10+t.width<=e.width&&(o.left=i.left+10),i.top+=10,i.height=0),o.top=Nge(e.height,t.height,{position:0,offset:i.top,size:0}),o.top+t.height===i.top&&o.top+i.height+t.height<=e.height&&(o.top+=i.height),o}createSubmenu(e=!0){if(this.element)if(this.parentData.submenu)this.parentData.submenu.focus(!1);else{this.updateAriaExpanded("true"),this.submenuContainer=il(this.element,ll("div.monaco-submenu")),this.submenuContainer.classList.add("menubar-menu-items-holder","context-view");const t=ta(this.parentData.parent.domNode).getComputedStyle(this.parentData.parent.domNode),i=parseFloat(t.paddingTop||"0")||0;this.submenuContainer.style.position="fixed",this.submenuContainer.style.top="0",this.submenuContainer.style.left="0",this.submenuContainer.style.zIndex="1",this.parentData.submenu=new ype(this.submenuContainer,this.submenuActions.length?this.submenuActions:[new gc],this.submenuOptions,this.menuStyle);const n=this.element.getBoundingClientRect(),o={top:n.top-i,left:n.left,height:n.height+2*i,width:n.width},s=this.submenuContainer.getBoundingClientRect(),r=ta(this.element),{top:a,left:l}=this.calculateSubmenuMenuLayout(new Da(r.innerWidth,r.innerHeight),Da.lift(s),o,this.expandDirection);this.submenuContainer.style.left=l-s.left+"px",this.submenuContainer.style.top=a-s.top+"px",this.submenuDisposables.add(ga(this.submenuContainer,Qa.KEY_UP,(e=>{new Ze(e).equals(15)&&(Ja(e,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))}))),this.submenuDisposables.add(ga(this.submenuContainer,Qa.KEY_DOWN,(e=>{new Ze(e).equals(15)&&Ja(e,!0)}))),this.submenuDisposables.add(this.parentData.submenu.onDidCancel((()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)}))),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){this.item&&this.item?.setAttribute("aria-expanded",e)}applyStyle(){super.applyStyle();const e=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=e??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class kpe extends hR{constructor(e,t,i,n){super(e,t,i),this.menuStyles=n}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function Lpe(e){const t=mh()[e.id];return`.codicon-${e.id}:before { content: '\\${t.toString(16)}'; }`}class Dpe{constructor(e,t,i,n){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;let i;this.focusToReturn=Va();const n=qa(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,layer:e.layer,render:n=>{this.lastContainer=n;const o=e.getMenuClassName?e.getMenuClassName():"";o&&(n.className+=" "+o),this.options.blockMouse&&(this.block=n.appendChild(ll(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",this.blockDisposable?.dispose(),this.blockDisposable=ga(this.block,Qa.MOUSE_DOWN,(e=>e.stopPropagation())));const s=new Mt,r=e.actionRunner||s.add(new hc);r.onWillRun((t=>this.onActionRun(t,!e.skipTelemetry)),this,s),r.onDidRun(this.onDidActionRun,this,s),i=new ype(n,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:r,getKeyBinding:e.getKeyBinding?e.getKeyBinding:e=>this.keybindingService.lookupKeybinding(e.id)},VR),i.onDidCancel((()=>this.contextViewService.hideContextView(!0)),null,s),i.onDidBlur((()=>this.contextViewService.hideContextView(!0)),null,s);const a=ta(n);return s.add(ga(a,Qa.BLUR,(()=>this.contextViewService.hideContextView(!0)))),s.add(ga(a,Qa.MOUSE_DOWN,(e=>{if(e.defaultPrevented)return;const t=new Je(a,e);let i=t.target;if(!t.rightButton){for(;i;){if(i===n)return;i=i.parentElement}this.contextViewService.hideContextView(!0)}}))),Nt(s,i)},focus:()=>{i?.focus(!!e.autoSelectFirstItem)},onHide:t=>{e.onHide?.(!!t),this.block&&(this.block.remove(),this.block=null),this.blockDisposable?.dispose(),this.blockDisposable=null,this.lastContainer&&(Va()===this.lastContainer||Oa(Va(),this.lastContainer))&&this.focusToReturn?.focus(),this.lastContainer=null}},n,!!n)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!Re(e.error)&&this.notificationService.error(e.error)}}var Epe=function(e,t){return function(i,n){t(i,n,e)}};let Npe=class extends At{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new Dpe(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,o,s){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=o,this.contextKeyService=s,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new Zt),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new Zt),this.onDidHideContextMenu=this._onDidHideContextMenu.event}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=Ipe.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{e.onHide?.(t),this._onDidHideContextMenu.fire()}}),gl.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};var Ipe,Tpe;Npe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Epe(0,Cu),Epe(1,lO),Epe(2,LR),Epe(3,ER),Epe(4,pu),Epe(5,eu)],Npe),function(e){e.transform=function(e,t,i){if(!((n=e)&&n.menuId instanceof gu))return e;var n;const{menuId:o,menuActionOptions:s,contextKeyService:r}=e;return{...e,getActions:()=>{let n=[];return o&&(n=function(e,t){const i=[];return function(e,t,i){const n=gl.getInstance();O$(e,t,n.keyStatus.altKey||(q||G)&&n.keyStatus.shiftKey,i?e=>e===i:e=>"navigation"===e)}(e,i,t),i}(t.getMenuActions(o,r??i,s))),e.getActions?cc.join(e.getActions(),n):n}}}}(Ipe||(Ipe={})),function(e){e[e.API=0]="API",e[e.USER=1]="USER"}(Tpe||(Tpe={}));var Mpe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Ape=function(e,t){return function(i,n){t(i,n,e)}};let Rpe=class{constructor(e){this._commandService=e}async open(e,t){if(!xo(e,So.command))return!1;if(!t?.allowCommands)return!0;if("string"==typeof e&&(e=uo.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path))return!0;let i=[];try{i=aN(decodeURIComponent(e.query))}catch{try{i=aN(e.query)}catch{}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}};Rpe=Mpe([Ape(0,mc)],Rpe);let Ope=class{constructor(e){this._editorService=e}async open(e,t){"string"==typeof e&&(e=uo.parse(e));const{selection:i,uri:n}=function(e){let t;const i=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(e.fragment);return i&&(t={startLineNumber:parseInt(i[1]),startColumn:i[2]?parseInt(i[2]):1,endLineNumber:i[4]?parseInt(i[4]):void 0,endColumn:i[4]?i[5]?parseInt(i[5]):1:void 0},e=e.with({fragment:""})),{selection:t,uri:e}}(e);return(e=n).scheme===So.file&&(e=zh(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:t?.fromUserGesture?Tpe.USER:Tpe.API,...t?.editorOptions}},this._editorService.getFocusedCodeEditor(),t?.openToSide),!0}};Ope=Mpe([Ape(0,sc)],Ope);let Ppe=class{constructor(e,t){this._openers=new Wt,this._validators=new Wt,this._resolvers=new Wt,this._resolvedUriTargets=new nd((e=>e.with({path:null,fragment:null,query:null}).toString())),this._externalOpeners=new Wt,this._defaultExternalOpener={openExternal:async e=>(ko(e,So.http,So.https)?ul(e):r.location.href=e,!0)},this._openers.push({open:async(e,t)=>!(!t?.openExternal&&!ko(e,So.mailto,So.http,So.https,So.vsls)||(await this._doOpenExternal(e,t),0))}),this._openers.push(new Rpe(t)),this._openers.push(new Ope(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}async open(e,t){if(!t?.skipValidation){const i="string"==typeof e?uo.parse(e):e,n=this._resolvedUriTargets.get(i)??e;for(const e of this._validators)if(!await e.shouldOpen(n,t))return!1}for(const i of this._openers)if(await i.open(e,t))return!0;return!1}async resolveExternalUri(e,t){for(const i of this._resolvers)try{const n=await i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.has(n.resolved)||this._resolvedUriTargets.set(n.resolved,e),n}catch{}throw new Error("Could not resolve external URI: "+e.toString())}async _doOpenExternal(e,t){const i="string"==typeof e?uo.parse(e):e;let n,o;try{n=(await this.resolveExternalUri(i,t)).resolved}catch{n=i}if(o="string"==typeof e&&i.toString()===n.toString()?e:encodeURI(n.toString(!0)),t?.allowContributedOpeners){const e="string"==typeof t?.allowContributedOpeners?t?.allowContributedOpeners:void 0;for(const t of this._externalOpeners)if(await t.openExternal(o,{sourceUri:i,preferredOpenerId:e},oi.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},oi.None)}dispose(){this._validators.clear()}};Ppe=Mpe([Ape(0,sc),Ape(1,mc)],Ppe);var Fpe=function(e,t){return function(i,n){t(i,n,e)}};let Bpe=class extends At{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new Zt),this._suppressedRanges=new nd,this._markerDecorations=new nd,e.getModels().forEach((e=>this._onModelAdded(e))),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach((e=>e.dispose())),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach((e=>{const t=this._markerDecorations.get(e);t&&this._updateDecorations(t)}))}_onModelAdded(e){const t=new Wpe(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){const t=this._markerDecorations.get(e.uri);t&&(t.dispose(),this._markerDecorations.delete(e.uri)),e.uri.scheme!==So.inMemory&&e.uri.scheme!==So.internal&&e.uri.scheme!==So.vscode||this._markerService?.read({resource:e.uri}).map((e=>e.owner)).forEach((t=>this._markerService.remove(t,[e.uri])))}_updateDecorations(e){let t=this._markerService.read({resource:e.model.uri,take:500});const i=this._suppressedRanges.get(e.model.uri);i&&(t=t.filter((e=>!Ct.some(i,(t=>Yu.areIntersectingOrTouching(t,e)))))),e.update(t)&&this._onDidChangeMarker.fire(e.model)}};Bpe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Fpe(0,ac),Fpe(1,ZP)],Bpe);class Wpe extends At{constructor(e){super(),this.model=e,this._map=new ld,this._register(Tt((()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()})))}update(e){const{added:t,removed:i}=function(e,t){const i=[],n=[];for(const n of e)t.has(n)||i.push(n);for(const i of t)e.has(i)||n.push(i);return{removed:i,added:n}}(new Set(this._map.keys()),new Set(e));if(0===t.length&&0===i.length)return!1;const n=i.map((e=>this._map.get(e))),o=t.map((e=>({range:this._createDecorationRange(this.model,e),options:this._createDecorationOption(e)}))),s=this.model.deltaDecorations(n,o);for(const e of i)this._map.delete(e);for(let e=0;e<s.length;e++)this._map.set(t[e],s[e]);return!0}getMarker(e){return this._map.getKey(e.id)}_createDecorationRange(e,t){let i=Yu.lift(t);if(t.severity!==qP.Hint||this._hasMarkerTag(t,1)||this._hasMarkerTag(t,2)||(i=i.setEndPosition(i.startLineNumber,i.startColumn+2)),i=e.validateRange(i),i.isEmpty()){const t=e.getLineLastNonWhitespaceColumn(i.startLineNumber)||e.getLineMaxColumn(i.startLineNumber);if(1===t||i.endColumn>=t)return i;const n=e.getWordAtPosition(i.getStartPosition());n&&(i=new Yu(i.startLineNumber,n.startColumn,i.endLineNumber,n.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&1===t.startColumn&&i.startLineNumber===i.endLineNumber){const n=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);n<i.endColumn&&(i=new Yu(i.startLineNumber,n,i.endLineNumber,i.endColumn),t.startColumn=n)}return i}_createDecorationOption(e){let t,i,n,o,s;switch(e.severity){case qP.Hint:t=this._hasMarkerTag(e,2)?void 0:this._hasMarkerTag(e,1)?"squiggly-unnecessary":"squiggly-hint",n=0;break;case qP.Info:t="squiggly-info",i=rw(qw),n=10,s={color:rw(mv),position:1};break;case qP.Warning:t="squiggly-warning",i=rw(jw),n=20,s={color:rw(fv),position:1};break;case qP.Error:default:t="squiggly-error",i=rw(Kw),n=30,s={color:rw(_v),position:1}}return e.tags&&(-1!==e.tags.indexOf(1)&&(o="squiggly-inline-unnecessary"),-1!==e.tags.indexOf(2)&&(o="squiggly-inline-deprecated")),{description:"marker-decoration",stickiness:1,className:t,showIfCollapsed:!0,overviewRuler:{color:i,position:ug.Right},minimap:s,zIndex:n,inlineClassName:o}}_hasMarkerTag(e,t){return!!e.tags&&e.tags.indexOf(t)>=0}}var Vpe,Hpe=function(e,t){return function(i,n){t(i,n,e)}};function zpe(e){return e.toString()}class Upe{constructor(e,t,i){this.model=e,this._modelEventListeners=new Mt,this.model=e,this._modelEventListeners.add(e.onWillDispose((()=>t(e)))),this._modelEventListeners.add(e.onDidChangeLanguage((t=>i(e,t))))}dispose(){this._modelEventListeners.dispose()}}const Kpe=G||$?1:2;class jpe{constructor(e,t,i,n,o,s,r,a){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=n,this.heapSize=o,this.sha1=s,this.versionId=r,this.alternativeVersionId=a}}let qpe=class extends At{static{Vpe=this}static{this.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20971520}constructor(e,t,i,n){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._instantiationService=n,this._onModelAdded=this._register(new Zt),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new Zt),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new Zt),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration((e=>this._updateModelOptions(e)))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){let i=Ig.tabSize;if(e.editor&&void 0!==e.editor.tabSize){const t=parseInt(e.editor.tabSize,10);isNaN(t)||(i=t),i<1&&(i=1)}let n="tabSize";if(e.editor&&void 0!==e.editor.indentSize&&"tabSize"!==e.editor.indentSize){const t=parseInt(e.editor.indentSize,10);isNaN(t)||(n=Math.max(t,1))}let o=Ig.insertSpaces;e.editor&&void 0!==e.editor.insertSpaces&&(o="false"!==e.editor.insertSpaces&&Boolean(e.editor.insertSpaces));let s=Kpe;const r=e.eol;"\r\n"===r?s=2:"\n"===r&&(s=1);let a=Ig.trimAutoWhitespace;e.editor&&void 0!==e.editor.trimAutoWhitespace&&(a="false"!==e.editor.trimAutoWhitespace&&Boolean(e.editor.trimAutoWhitespace));let l=Ig.detectIndentation;e.editor&&void 0!==e.editor.detectIndentation&&(l="false"!==e.editor.detectIndentation&&Boolean(e.editor.detectIndentation));let d=Ig.largeFileOptimizations;e.editor&&void 0!==e.editor.largeFileOptimizations&&(d="false"!==e.editor.largeFileOptimizations&&Boolean(e.editor.largeFileOptimizations));let h=Ig.bracketPairColorizationOptions;return e.editor?.bracketPairColorization&&"object"==typeof e.editor.bracketPairColorization&&(h={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:i,indentSize:n,insertSpaces:o,detectIndentation:l,defaultEOL:s,trimAutoWhitespace:a,largeFileOptimizations:d,bracketPairColorizationOptions:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&"string"==typeof i&&"auto"!==i?i:3===se||2===se?"\n":"\r\n"}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return"boolean"!=typeof e||e}getCreationOptions(e,t,i){const n="string"==typeof e?e:e.languageId;let o=this._modelCreationOptionsByLanguageAndResource[n+t];if(!o){const e=this._configurationService.getValue("editor",{overrideIdentifier:n,resource:t}),s=this._getEOL(t,n);o=Vpe._readModelOptions({editor:e,eol:s},i),this._modelCreationOptionsByLanguageAndResource[n+t]=o}return o}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let n=0,o=i.length;n<o;n++){const o=i[n],s=this._models[o],r=s.model.getLanguageId(),a=s.model.uri;if(e&&!e.affectsConfiguration("editor",{overrideIdentifier:r,resource:a})&&!e.affectsConfiguration("files.eol",{overrideIdentifier:r,resource:a}))continue;const l=t[r+a],d=this.getCreationOptions(r,a,s.model.isForSimpleWidget);Vpe._setModelOptionsForModel(s.model,d,l)}}static _setModelOptionsForModel(e,t,i){i&&i.defaultEOL!==t.defaultEOL&&1===e.getLineCount()&&e.setEOL(1===t.defaultEOL?0:1),i&&i.detectIndentation===t.detectIndentation&&i.insertSpaces===t.insertSpaces&&i.tabSize===t.tabSize&&i.indentSize===t.indentSize&&i.trimAutoWhitespace===t.trimAutoWhitespace&&cg(i.bracketPairColorizationOptions,t.bracketPairColorizationOptions)||(t.detectIndentation?(e.detectIndentation(t.insertSpaces,t.tabSize),e.updateOptions({trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions})):e.updateOptions({insertSpaces:t.insertSpaces,tabSize:t.tabSize,indentSize:t.indentSize,trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions}))}_insertDisposedModel(e){this._disposedModels.set(zpe(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(zpe(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(zpe(e)),t}_ensureDisposedModelsHeapSize(e){if(this._disposedModelsHeapSize>e){const t=[];for(this._disposedModels.forEach((e=>{e.sharesUndoRedoStack||t.push(e)})),t.sort(((e,t)=>e.time-t.time));t.length>0&&this._disposedModelsHeapSize>e;){const e=t.shift();this._removeDisposedModel(e.uri),null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,n){const o=this.getCreationOptions(t,i,n),s=this._instantiationService.createInstance(lk,e,t,o,i);if(i&&this._disposedModels.has(zpe(i))){const e=this._removeDisposedModel(i),t=this._undoRedoService.getElements(i),n=this._getSHA1Computer(),o=!!n.canComputeSHA1(s)&&n.computeSHA1(s)===e.sha1;if(o||e.sharesUndoRedoStack){for(const e of t.past)zC(e)&&e.matchesResource(i)&&e.setModel(s);for(const e of t.future)zC(e)&&e.matchesResource(i)&&e.setModel(s);this._undoRedoService.setElementsValidFlag(i,!0,(e=>zC(e)&&e.matchesResource(i))),o&&(s._overwriteVersionId(e.versionId),s._overwriteAlternativeVersionId(e.alternativeVersionId),s._overwriteInitialUndoRedoSnapshot(e.initialUndoRedoSnapshot))}else null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}const r=zpe(s.uri);if(this._models[r])throw new Error("ModelService: Cannot add model because it already exists!");const a=new Upe(s,(e=>this._onWillDispose(e)),((e,t)=>this._onDidChangeLanguage(e,t)));return this._models[r]=a,a}createModel(e,t,i,n=!1){let o;return o=t?this._createModelData(e,t,i,n):this._createModelData(e,Up,i,n),this._onModelAdded.fire(o.model),o.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i<n;i++){const n=t[i];e.push(this._models[n].model)}return e}getModel(e){const t=zpe(e),i=this._models[t];return i?i.model:null}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===So.file||e.scheme===So.vscodeRemote||e.scheme===So.vscodeUserData||e.scheme===So.vscodeNotebookCell||"fake-fs"===e.scheme}_onWillDispose(e){const t=zpe(e.uri),i=this._models[t],n=this._undoRedoService.getUriComparisonKey(e.uri)!==e.uri.toString();let o=!1,s=0;if(n||this._shouldRestoreUndoStack()&&this._schemaShouldMaintainUndoRedoElements(e.uri)){const t=this._undoRedoService.getElements(e.uri);if(t.past.length>0||t.future.length>0){for(const i of t.past)zC(i)&&i.matchesResource(e.uri)&&(o=!0,s+=i.heapSize(e.uri),i.setModel(e.uri));for(const i of t.future)zC(i)&&i.matchesResource(e.uri)&&(o=!0,s+=i.heapSize(e.uri),i.setModel(e.uri))}}const r=Vpe.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,a=this._getSHA1Computer();if(o)if(n||!(s>r)&&a.canComputeSHA1(e))this._ensureDisposedModelsHeapSize(r-s),this._undoRedoService.setElementsValidFlag(e.uri,!1,(t=>zC(t)&&t.matchesResource(e.uri))),this._insertDisposedModel(new jpe(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),n,s,a.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else{const e=i.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}else if(!n){const e=i.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const i=t.oldLanguage,n=e.getLanguageId(),o=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),s=this.getCreationOptions(n,e.uri,e.isForSimpleWidget);Vpe._setModelOptionsForModel(e,s,o),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new $pe}};qpe=Vpe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Hpe(0,up),Hpe(1,Pae),Hpe(2,Zx),Hpe(3,nc)],qpe);class $pe{static{this.MAX_MODEL_SIZE=10485760}canComputeSHA1(e){return e.getValueLength()<=$pe.MAX_MODEL_SIZE}computeSHA1(e){const t=new qo,i=e.createSnapshot();let n;for(;n=i.read();)t.update(n);return t.digest()}}var Gpe=i(1446),Zpe={};Zpe.styleTagTransform=zl(),Zpe.setAttributes=Bl(),Zpe.insert=Pl().bind(null,"head"),Zpe.domAPI=Rl(),Zpe.insertStyleElement=Vl(),Ml()(Gpe.A,Zpe),Gpe.A&&Gpe.A.locals&&Gpe.A.locals;var Ype=function(e,t){return function(i,n){t(i,n,e)}};let Qpe=class extends At{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=ru.as(V7),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0,this._register(Tt((()=>{for(const e of this.mapProviderToDescriptor.values())Dt(e)&&e.dispose();this.visibleQuickAccess?.picker.dispose()})))}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){const[n,o]=this.getOrInstantiateProvider(e,i?.enabledProviderPrefixes),s=this.visibleQuickAccess,r=s?.descriptor;if(s&&o&&r===o)return e===o.prefix||i?.preserveValue||(s.picker.value=e),void this.adjustValueSelection(s.picker,o,i);if(o&&!i?.preserveValue){let t;if(s&&r&&r!==o){const e=s.value.substr(r.prefix.length);e&&(t=`${o.prefix}${e}`)}if(!t){const e=n?.defaultFilterValue;e===W7.LAST?t=this.lastAcceptedPickerValues.get(o):"string"==typeof e&&(t=`${o.prefix}${e}`)}"string"==typeof t&&(e=t)}const a=s?.picker?.valueSelection,l=s?.picker?.value,d=new Mt,h=d.add(this.quickInputService.createQuickPick({useSeparators:!0}));let c;h.value=e,this.adjustValueSelection(h,o,i),h.placeholder=i?.placeholder??o?.placeholder,h.quickNavigate=i?.quickNavigateConfiguration,h.hideInput=!!h.quickNavigate&&!s,("number"==typeof i?.itemActivation||i?.quickNavigateConfiguration)&&(h.itemActivation=i?.itemActivation??SD.SECOND),h.contextKey=o?.contextKey,h.filterValue=e=>e.substring(o?o.prefix.length:0),t&&(c=new Li,d.add(zt.once(h.onWillAccept)((e=>{e.veto(),h.hide()})))),d.add(this.registerPickerListeners(h,n,o,e,i));const u=d.add(new ri);return n&&d.add(n.provide(h,u.token,i?.providerOptions)),zt.once(h.onDidHide)((()=>{0===h.selectedItems.length&&u.cancel(),d.dispose(),c?.complete(h.selectedItems.slice(0))})),h.show(),a&&l===e&&(h.valueSelection=a),t?c?.p:void 0}adjustValueSelection(e,t,i){let n;n=i?.preserveValue?[e.value.length,e.value.length]:[t?.prefix.length??0,e.value.length],e.valueSelection=n}registerPickerListeners(e,t,i,n,o){const s=new Mt,r=this.visibleQuickAccess={picker:e,descriptor:i,value:n};return s.add(Tt((()=>{r===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)}))),s.add(e.onDidChangeValue((e=>{const[i]=this.getOrInstantiateProvider(e,o?.enabledProviderPrefixes);i!==t?this.show(e,{enabledProviderPrefixes:o?.enabledProviderPrefixes,preserveValue:!0,providerOptions:o?.providerOptions}):r.value=e}))),i&&s.add(e.onDidAccept((()=>{this.lastAcceptedPickerValues.set(i,e.value)}))),s}getOrInstantiateProvider(e,t){const i=this.registry.getQuickAccessProvider(e);if(!i||t&&!t?.includes(i.prefix))return[void 0,void 0];let n=this.mapProviderToDescriptor.get(i);return n||(n=this.instantiationService.createInstance(i.ctor),this.mapProviderToDescriptor.set(i,n)),[n,i]}};Qpe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Ype(0,LD),Ype(1,nc)],Qpe);var Xpe=i(7492),Jpe={};Jpe.styleTagTransform=zl(),Jpe.setAttributes=Bl(),Jpe.insert=Pl().bind(null,"head"),Jpe.domAPI=Rl(),Jpe.insertStyleElement=Vl(),Ml()(Xpe.A,Jpe),Xpe.A&&Xpe.A.locals&&Xpe.A.locals;class eme{constructor(e){this.nodes=e}toString(){return this.nodes.map((e=>"string"==typeof e?e:e.label)).join("")}}!function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);s>3&&r&&Object.defineProperty(t,i,r)}([QT],eme.prototype,"toString",null);const tme=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi,ime={},nme=new YD("quick-input-button-icon-");function ome(e,t,i){let n=e.iconClass||function(e){if(!e)return;let t;const i=e.dark.toString();return ime[i]?t=ime[i]:(t=nme.nextId(),MM(`.${t}, .hc-light .${t}`,`background-image: ${CM(e.light||e.dark)}`),MM(`.vs-dark .${t}, .hc-black .${t}`,`background-image: ${CM(e.dark)}`),ime[i]=t),t}(e.iconPath);return e.alwaysVisible&&(n=n?`${n} always-visible`:"always-visible"),{id:t,label:"",tooltip:e.tooltip||"",class:n,enabled:!0,run:i}}var sme=function(e,t){return function(i,n){t(i,n,e)}};const rme="inQuickInput",ame=new Jc(rme,!1,y(1731,"Whether keyboard focus is inside the quick input control")),lme=Ac.has(rme),dme=new Jc("quickInputAlignment","top",y(1732,"The alignment of the quick input")),hme="quickInputType",cme=new Jc(hme,void 0,y(1733,"The type of the currently visible quick input")),ume="cursorAtEndOfQuickInputBox",gme=new Jc(ume,!1,y(1734,"Whether the cursor in the quick input is at the end of the input box")),pme=Ac.has(ume),mme={iconClass:vh.asClassName(fh.quickInputBack),tooltip:y(1735,"Back"),handle:-1};class fme extends At{static{this.noPromptMessage=y(1736,"Press 'Enter' to confirm your input or 'Escape' to cancel")}constructor(e){super(),this.ui=e,this._visible=Js("visible",!1),this._widgetUpdated=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._leftButtons=[],this._rightButtons=[],this._inlineButtons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=fme.noPromptMessage,this._severity=rO.Ignore,this.onDidTriggerButtonEmitter=this._register(new Zt),this.onDidHideEmitter=this._register(new Zt),this.onWillHideEmitter=this._register(new Zt),this.onDisposeEmitter=this._register(new Zt),this.visibleDisposables=this._register(new Mt),this.onDidHide=this.onDidHideEmitter.event}get visible(){return this._visible.get()}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!X;this._ignoreFocusOut=e&&!X,t&&this.update()}get titleButtons(){return this._leftButtons.length?[...this._leftButtons,this._rightButtons]:this._rightButtons}get buttons(){return[...this._leftButtons,...this._rightButtons,...this._inlineButtons]}set buttons(e){this._leftButtons=e.filter((e=>e===mme)),this._rightButtons=e.filter((e=>e!==mme&&e.location!==kD.Inline)),this._inlineButtons=e.filter((e=>e.location===kD.Inline)),this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton((e=>{-1!==this.buttons.indexOf(e)&&this.onDidTriggerButtonEmitter.fire(e)}))),this.ui.show(this),this._visible.set(!0,void 0),this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=yD.Other){this._visible.set(!1,void 0),this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}willHide(e=yD.Other){this.onWillHideEmitter.fire({reason:e})}update(){if(!this.visible)return;const e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:e||" "===this.ui.title.innerHTML||(this.ui.title.innerText=" ");const t=this.getDescription();if(this.ui.description1.textContent!==t&&(this.ui.description1.textContent=t),this.ui.description2.textContent!==t&&(this.ui.description2.textContent=t),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?ol(this.ui.widget,this._widget):ol(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new bi,this.busyDelay.setIfNotSet((()=>{this.visible&&this.ui.progressBar.infinite()}),800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const e=this._leftButtons.map(((e,t)=>ome(e,`id-${t}`,(async()=>this.onDidTriggerButtonEmitter.fire(e)))));this.ui.leftActionBar.push(e,{icon:!0,label:!1}),this.ui.rightActionBar.clear();const t=this._rightButtons.map(((e,t)=>ome(e,`id-${t}`,(async()=>this.onDidTriggerButtonEmitter.fire(e)))));this.ui.rightActionBar.push(t,{icon:!0,label:!1}),this.ui.inlineActionBar.clear();const i=this._inlineButtons.map(((e,t)=>ome(e,`id-${t}`,(async()=>this.onDidTriggerButtonEmitter.fire(e)))));this.ui.inlineActionBar.push(i,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const e=this.toggles?.filter((e=>e instanceof eQ))??[];this.ui.inputBox.toggles=e}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const i=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==i&&(this._lastValidationMessage=i,ol(this.ui.message),function(e,t,i){ol(t);const n=function(e){const t=[];let i,n=0;for(;i=tme.exec(e);){i.index-n>0&&t.push(e.substring(n,i.index));const[,o,s,,r]=i;r?t.push({label:o,href:s,title:r}):t.push({label:o,href:s}),n=i.index+i[0].length}return n<e.length&&t.push(e.substring(n)),new eme(t)}(e);let o=0;for(const e of n.nodes)if("string"==typeof e)t.append(...bI(e));else{let n=e.title;!n&&e.href.startsWith("command:")?n=y(1754,"Click to execute command '{0}'",e.href.substring(8)):n||(n=e.href);const s=ll("a",{href:e.href,title:n,tabIndex:o++},e.label);s.style.textDecoration="underline";const r=t=>{Xa(t)&&Ja(t,!0),i.callback(e.href)},a=i.disposables.add(new OM(s,Qa.CLICK)).event,l=i.disposables.add(new OM(s,Qa.KEY_DOWN)).event,d=zt.chain(l,(e=>e.filter((e=>{const t=new Ze(e);return t.equals(10)||t.equals(3)}))));i.disposables.add(JT.addTarget(s));const h=i.disposables.add(new OM(s,XT.Tap)).event;zt.any(a,h,d)(r,null,i.disposables),t.appendChild(s)}}(i,this.ui.message,{callback:e=>{this.ui.linkOpenerDelegate(e)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?y(1737,"{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==rO.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}class _me extends fme{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new Zt),this.onWillAcceptEmitter=this._register(new Zt),this.onDidAcceptEmitter=this._register(new Zt),this.onDidCustomEmitter=this._register(new Zt),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._keepScrollPosition=!1,this._itemActivation=SD.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new Zt),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new Zt),this.onDidTriggerItemButtonEmitter=this._register(new Zt),this.onDidTriggerSeparatorButtonEmitter=this._register(new Zt),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this._focusEventBufferer=new ti,this.type="quickPick",this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event}static{this.DEFAULT_ARIA_LABEL=y(1738,"Type to narrow down results.")}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?CD:this.ui.keyMods}get valueSelection(){const e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get okLabel(){return this._okLabel??y(1739,"OK")}set okLabel(e){this._okLabel=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.canSelectMany||this.ui.list.focus(xD.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange((e=>{this.doSetValue(e,!0)}))),this.visibleDisposables.add(this.ui.onDidAccept((()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)}))),this.visibleDisposables.add(this.ui.onDidCustom((()=>{this.onDidCustomEmitter.fire()}))),this.visibleDisposables.add(this._focusEventBufferer.wrapEvent(this.ui.list.onDidChangeFocus,((e,t)=>t))((e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&es(e,this._activeItems,((e,t)=>e===t))||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))}))),this.visibleDisposables.add(this.ui.list.onDidChangeSelection((({items:e,event:t})=>{!this.canSelectMany||e.some((e=>!1===e.pickable))?this.selectedItemsToConfirm!==this._selectedItems&&es(e,this._selectedItems,((e,t)=>e===t))||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(Za(t)&&1===t.button)):e.length&&this.ui.list.setSelectedElements([])}))),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements((e=>{this.canSelectMany&&this.visible&&(this.selectedItemsToConfirm!==this._selectedItems&&es(e,this._selectedItems,((e,t)=>e===t))||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))}))),this.visibleDisposables.add(this.ui.list.onButtonTriggered((e=>this.onDidTriggerItemButtonEmitter.fire(e)))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered((e=>this.onDidTriggerSeparatorButtonEmitter.fire(e)))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return ga(this.ui.container,Qa.KEY_UP,(e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Ze(e),i=t.keyCode,n=this._quickNavigate.keybindings.some((e=>{const n=e.getChords();return!(n.length>1||(n[0].shiftKey&&4===i?t.ctrlKey||t.altKey||t.metaKey:!(n[0].altKey&&6===i||n[0].ctrlKey&&5===i||n[0].metaKey&&57===i)))}));n&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)}))}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.titleButtons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:"default"===this.ok?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(i),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let n=this.ariaLabel;!n&&i.inputBox&&(n=this.placeholder,this.title&&(n=n?`${n} - ${this.title}`:this.title),n||(n=_me.DEFAULT_ARIA_LABEL)),this.ui.list.ariaLabel!==n&&(this.ui.list.ariaLabel=n??null),this.ui.inputBox.ariaLabel!==n&&(this.ui.inputBox.ariaLabel=n??"input"),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated&&(this.itemsUpdated=!1,this._focusEventBufferer.bufferEvents((()=>{switch(this.ui.list.setElements(this.items),this.ui.list.shouldLoop=!this.canSelectMany,this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this._itemActivation){case SD.NONE:this._itemActivation=SD.FIRST;break;case SD.SECOND:this.ui.list.focus(xD.Second),this._itemActivation=SD.FIRST;break;case SD.LAST:this.ui.list.focus(xD.Last),this._itemActivation=SD.FIRST;break;default:this.trySelectFirst()}}))),this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.ok.label=this.okLabel||"",this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(xD.First)),this.keepScrollPosition&&(this.scrollTop=e)}focus(e){this.ui.list.focus(e),this.canSelectMany&&this.ui.list.domFocus()}accept(e){e&&!this._canAcceptInBackground||(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(e??!1))}}class vme extends fme{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new Zt),this.onDidAcceptEmitter=this._register(new Zt),this.type="inputBox",this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get valueSelection(){const e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}get prompt(){return this._prompt}set prompt(e){this._prompt=e,this.noValidationMessage=e?y(1740,"{0} (Press 'Enter' to confirm or 'Escape' to cancel)",e):fme.noPromptMessage,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange((e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))}))),this.visibleDisposables.add(this.ui.onDidAccept((()=>this.onDidAcceptEmitter.fire()))),this.valueSelectionUpdated=!0),super.show()}accept(){this.onDidAcceptEmitter.fire()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.titleButtons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password);let t=this.ariaLabel;!t&&e.inputBox&&(t=this.placeholder?this.title?`${this.placeholder} - ${this.title}`:this.placeholder:this.title?this.title:"input"),this.ui.inputBox.ariaLabel!==t&&(this.ui.inputBox.ariaLabel=t||"input")}}let bme=class extends sZ{constructor(e,t){super("mouse",void 0,(e=>this.getOverrideOptions(e)),e,t)}getOverrideOptions(e){return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:(qa(e.content)?e.content.textContent??"":"string"==typeof e.content?e.content:e.content.value).includes("\n"),skipFadeInAnimation:!0}}}};bme=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([sme(0,up),sme(1,oZ)],bme);var wme=i(4978),Cme={};Cme.styleTagTransform=zl(),Cme.setAttributes=Bl(),Cme.insert=Pl().bind(null,"head"),Cme.domAPI=Rl(),Cme.insertStyleElement=Vl(),Ml()(wme.A,Cme),wme.A&&wme.A.locals&&wme.A.locals;const yme="done",Sme="active",xme="infinite",kme="infinite-long-running",Lme="discrete";class Dme extends At{static{this.LONG_RUNNING_INFINITE_THRESHOLD=1e4}constructor(e,t){super(),this.progressSignal=this._register(new Rt),this.workedVal=0,this.showDelayedScheduler=this._register(new Ci((()=>dl(this.element)),0)),this.longRunningScheduler=this._register(new Ci((()=>this.infiniteLongRunning()),Dme.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=t?.progressBarBackground||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(Sme,xme,kme,Lme),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel(),this.progressSignal.clear()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(yme),this.element.classList.contains(xme)?(this.bit.style.opacity="0",e?setTimeout((()=>this.off()),200):this.off()):(this.bit.style.width="inherit",e?setTimeout((()=>this.off()),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(Lme,yme,kme),this.element.classList.add(Sme,xme),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(kme)}getContainer(){return this.element}}const Eme=ll;class Nme extends At{constructor(e,t,i){super(),this.parent=e,this.onDidChange=e=>this.findInput.onDidChange(e),this.container=il(this.parent,Eme(".quick-input-box")),this.findInput=this._register(new xQ(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const n=this.findInput.inputBox.inputElement;n.role="textbox",n.ariaHasPopup="menu",n.ariaAutoComplete="list"}get onKeyDown(){return this.findInput.onKeyDown}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}getSelection(){return this.findInput.inputBox.getSelection()}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return"password"===this.findInput.inputBox.inputElement.type}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}get ariaLabel(){return this.findInput.inputBox.inputElement.getAttribute("aria-label")||""}set ariaLabel(e){this.findInput.inputBox.inputElement.setAttribute("aria-label",e)}hasFocus(){return this.findInput.inputBox.hasFocus()}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.findInput.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===rO.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===rO.Info?1:e===rO.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===rO.Info?1:e===rO.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}const Ime=new Oi((()=>{const e=Fy(void 0,{numeric:!0,sensitivity:"base"}).value;return{collator:e,collatorIsNumeric:e.resolvedOptions().numeric}}));new Oi((()=>({collator:Fy(void 0,{numeric:!0}).value}))),new Oi((()=>({collator:Fy(void 0,{numeric:!0,sensitivity:"accent"}).value})));var Tme,Mme=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Ame=function(e,t){return function(i,n){t(i,n,e)}};const Rme=ll;class Ome{constructor(e,t,i){this.index=e,this.hasCheckbox=t,this._hidden=!1,this._init=new Oi((()=>{const e=i.label??"",t=Lh(e).text.trim(),n=i.ariaLabel||[e,this.saneDescription,this.saneDetail].map((e=>xh(e))).filter((e=>!!e)).join(", ");return{saneLabel:e,saneSortLabel:t,saneAriaLabel:n}})),this._saneDescription=i.description,this._saneTooltip=i.tooltip}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get saneDescription(){return this._saneDescription}set saneDescription(e){this._saneDescription=e}get saneDetail(){return this._saneDetail}set saneDetail(e){this._saneDetail=e}get saneTooltip(){return this._saneTooltip}set saneTooltip(e){this._saneTooltip=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class Pme extends Ome{constructor(e,t,i,n,o,s,r){super(e,i,s),this.childIndex=t,this.fireButtonTriggered=n,this._onChecked=o,this.item=s,this._separator=r,this._checked=!1,this.onChecked=i?zt.map(zt.filter(this._onChecked.event,(e=>e.element===this)),(e=>e.checked)):zt.None,this._saneDetail=s.detail,this._labelHighlights=s.highlights?.label,this._descriptionHighlights=s.highlights?.description,this._detailHighlights=s.highlights?.detail}get separator(){return this._separator}set separator(e){this._separator=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({element:this,checked:e}))}get checkboxDisabled(){return!!this.item.disabled}}var Fme;!function(e){e[e.NONE=0]="NONE",e[e.MOUSE_HOVER=1]="MOUSE_HOVER",e[e.ACTIVE_ITEM=2]="ACTIVE_ITEM"}(Fme||(Fme={}));class Bme extends Ome{constructor(e,t,i){super(e,!1,i),this.fireSeparatorButtonTriggered=t,this.separator=i,this.children=new Array,this.focusInsideSeparator=Fme.NONE}}class Wme{getHeight(e){return e instanceof Bme?30:e.saneDetail?44:22}getTemplateId(e){return e instanceof Pme?zme.ID:Ume.ID}}class Vme{getWidgetAriaLabel(){return y(1753,"Quick Input")}getAriaLabel(e){return e.separator?.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(e.hasCheckbox&&e instanceof Pme)return{get value(){return e.checked},onDidChange:t=>e.onChecked((()=>t()))}}}class Hme{constructor(e){this.hoverDelegate=e}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=new Mt,t.toDisposeTemplate=new Mt,t.entry=il(e,Rme(".quick-input-list-entry"));const i=il(t.entry,Rme("label.quick-input-list-label"));t.outerLabel=i,t.checkbox=t.toDisposeTemplate.add(new Rt),t.toDisposeTemplate.add(ma(i,Qa.CLICK,(e=>{if(t.checkbox.value&&!e.defaultPrevented&&t.checkbox.value.enabled){const e=!t.checkbox.value.checked;t.checkbox.value.checked=e,t.element.checked=e}})));const n=il(i,Rme(".quick-input-list-rows")),o=il(n,Rme(".quick-input-list-row")),s=il(n,Rme(".quick-input-list-row"));t.label=new v0(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.label),t.icon=nl(t.label.element,Rme(".quick-input-list-icon"));const r=il(o,Rme(".quick-input-list-entry-keybinding"));t.keybinding=new kR(r,se),t.toDisposeTemplate.add(t.keybinding);const a=il(s,Rme(".quick-input-list-label-meta"));return t.detail=new v0(a,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.detail),t.separator=il(t.entry,Rme(".quick-input-list-separator")),t.actionBar=new uR(t.entry,this.hoverDelegate?{hoverDelegate:this.hoverDelegate}:void 0),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.add(t.actionBar),t}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}disposeElement(e,t,i){i.toDisposeElement.clear(),i.actionBar.clear()}}let zme=class extends Hme{static{Tme=this}static{this.ID="quickpickitem"}constructor(e,t){super(e),this.themeService=t,this._itemsWithSeparatorsFrequency=new Map}get templateId(){return Tme.ID}ensureCheckbox(e,t){if(!e.hasCheckbox)return t.checkbox.value?.domNode.remove(),void t.checkbox.clear();let i=t.checkbox.value;i?i.setTitle(e.saneLabel):(i=new iQ(e.saneLabel,e.checked,{...AR,size:15}),t.checkbox.value=i,t.outerLabel.prepend(i.domNode)),e.checkboxDisabled?i.disable():i.enable(),i.checked=e.checked,t.toDisposeElement.add(e.onChecked((e=>i.checked=e))),t.toDisposeElement.add(i.onChange((()=>e.checked=i.checked)))}renderElement(e,t,i){const n=e.element;i.element=n,n.element=i.entry??void 0;const o=n.item;n.element.classList.toggle("not-pickable",!1===n.item.pickable),this.ensureCheckbox(n,i);const{labelHighlights:s,descriptionHighlights:r,detailHighlights:a}=n;if(o.iconPath){const e=ow(this.themeService.getColorTheme().type)?o.iconPath.dark:o.iconPath.light??o.iconPath.dark,t=uo.revive(e);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=CM(t)}else i.icon.style.backgroundImage="",i.icon.className=o.iconClass?`quick-input-list-icon ${o.iconClass}`:"";let l;!n.saneTooltip&&n.saneDescription&&(l={markdown:{value:Wi(n.saneDescription),supportThemeIcons:!0},markdownNotSupportedFallback:n.saneDescription});const d={matches:s||[],descriptionTitle:l,descriptionMatches:r||[],labelEscapeNewLines:!0};if(d.extraClasses=o.iconClasses,d.italic=o.italic,d.strikethrough=o.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item"),i.label.setLabel(n.saneLabel,n.saneDescription,d),i.keybinding.set(o.keybinding),n.saneDetail){let e;n.saneTooltip||(e={markdown:{value:Wi(n.saneDetail),supportThemeIcons:!0},markdownNotSupportedFallback:n.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(n.saneDetail,void 0,{matches:a,title:e,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";n.separator?.label?(i.separator.textContent=n.separator.label,i.separator.style.display="",this.addItemWithSeparator(n)):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!n.separator&&0!==n.childIndex);const h=o.buttons;h&&h.length?(i.actionBar.push(h.map(((e,t)=>ome(e,`id-${t}`,(()=>n.fireButtonTriggered({button:e,item:n.item}))))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){this.removeItemWithSeparator(e.element),super.disposeElement(e,t,i)}isItemWithSeparatorVisible(e){return this._itemsWithSeparatorsFrequency.has(e)}addItemWithSeparator(e){this._itemsWithSeparatorsFrequency.set(e,(this._itemsWithSeparatorsFrequency.get(e)||0)+1)}removeItemWithSeparator(e){const t=this._itemsWithSeparatorsFrequency.get(e)||0;t>1?this._itemsWithSeparatorsFrequency.set(e,t-1):this._itemsWithSeparatorsFrequency.delete(e)}};zme=Tme=Mme([Ame(1,sw)],zme);class Ume extends Hme{constructor(){super(...arguments),this._visibleSeparatorsFrequency=new Map}static{this.ID="quickpickseparator"}get templateId(){return Ume.ID}get visibleSeparators(){return[...this._visibleSeparatorsFrequency.keys()]}isSeparatorVisible(e){return this._visibleSeparatorsFrequency.has(e)}renderElement(e,t,i){const n=e.element;i.element=n,n.element=i.entry??void 0,n.element.classList.toggle("focus-inside",!!n.focusInsideSeparator);const o=n.separator,{labelHighlights:s,descriptionHighlights:r}=n;let a;i.icon.style.backgroundImage="",i.icon.className="",!n.saneTooltip&&n.saneDescription&&(a={markdown:{value:Wi(n.saneDescription),supportThemeIcons:!0},markdownNotSupportedFallback:n.saneDescription});const l={matches:s||[],descriptionTitle:a,descriptionMatches:r||[],labelEscapeNewLines:!0};i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(n.saneLabel,n.saneDescription,l),i.separator.style.display="none",i.entry.classList.add("quick-input-list-separator-border");const d=o.buttons;d&&d.length?(i.actionBar.push(d.map(((e,t)=>ome(e,`id-${t}`,(()=>n.fireSeparatorButtonTriggered({button:e,separator:n.separator}))))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions"),this.addSeparator(n)}disposeElement(e,t,i){this.removeSeparator(e.element),this.isSeparatorVisible(e.element)||e.element.element?.classList.remove("focus-inside"),super.disposeElement(e,t,i)}addSeparator(e){this._visibleSeparatorsFrequency.set(e,(this._visibleSeparatorsFrequency.get(e)||0)+1)}removeSeparator(e){const t=this._visibleSeparatorsFrequency.get(e)||0;t>1?this._visibleSeparatorsFrequency.set(e,t-1):this._visibleSeparatorsFrequency.delete(e)}}let Kme=class extends At{constructor(e,t,i,n,o,s){super(),this.parent=e,this.hoverDelegate=t,this.linkOpenerDelegate=i,this.accessibilityService=s,this._onKeyDown=new Zt,this._onLeave=new Zt,this.onLeave=this._onLeave.event,this._visibleCountObservable=Js("VisibleCount",0),this.onChangedVisibleCount=zt.fromObservable(this._visibleCountObservable,this._store),this._allVisibleCheckedObservable=Js("AllVisibleChecked",!1),this.onChangedAllVisibleChecked=zt.fromObservable(this._allVisibleCheckedObservable,this._store),this._checkedCountObservable=Js("CheckedCount",0),this.onChangedCheckedCount=zt.fromObservable(this._checkedCountObservable,this._store),this._checkedElementsObservable=or({equalsFn:es},new Array),this.onChangedCheckedElements=zt.fromObservable(this._checkedElementsObservable,this._store),this._onButtonTriggered=new Zt,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new Zt,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._elementChecked=new Zt,this._elementCheckedEventBufferer=new ti,this._hasCheckboxes=!1,this._inputElements=new Array,this._elementTree=new Array,this._itemElements=new Array,this._elementDisposable=this._register(new Mt),this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._shouldLoop=!0,this._container=il(this.parent,Rme(".quick-input-list")),this._separatorRenderer=new Ume(t),this._itemRenderer=o.createInstance(zme,t),this._tree=this._register(o.createInstance(YJ,"QuickInput",this._container,new Wme,[this._itemRenderer,this._separatorRenderer],{filter:{filter:e=>e.hidden?0:e instanceof Bme?2:1},sorter:{compare:(e,t)=>this.sortByLabel&&this._lastQueryString?function(e,t,i){const n=e.labelHighlights||[],o=t.labelHighlights||[];return n.length&&!o.length?-1:!n.length&&o.length?1:0===n.length&&0===o.length?0:function(e,t,i){const n=e.toLowerCase(),o=t.toLowerCase(),s=function(e,t,i){const n=e.toLowerCase(),o=t.toLowerCase(),s=n.startsWith(i),r=o.startsWith(i);if(s!==r)return s?-1:1;if(s&&r){if(n.length<o.length)return-1;if(n.length>o.length)return 1}return 0}(e,t,i);if(s)return s;const r=n.endsWith(i);if(r!==o.endsWith(i))return r?-1:1;const a=function(e,t){const i=e||"",n=t||"",o=Ime.value.collator.compare(i,n);return Ime.value.collatorIsNumeric&&0===o&&i!==n?i<n?-1:1:o}(n,o);return 0!==a?a:n.localeCompare(o)}(e.saneSortLabel,t.saneSortLabel,i)}(e,t,this._lastQueryString.toLowerCase()):0},accessibilityProvider:new Vme,setRowLineHeight:!1,multipleSelectionSupport:!1,hideTwistiesOfChildlessElements:!0,renderIndentGuides:VQ.None,findWidgetEnabled:!1,indent:0,horizontalScrolling:!1,allowNonCollapsibleParents:!0,alwaysConsumeMouseWheel:!0})),this._tree.getHTMLElement().id=n,this._registerListeners()}get onDidChangeFocus(){return zt.map(this._tree.onDidChangeFocus,(e=>e.elements.filter((e=>e instanceof Pme)).map((e=>e.item))),this._store)}get onDidChangeSelection(){return zt.map(this._tree.onDidChangeSelection,(e=>({items:e.elements.filter((e=>e instanceof Pme)).map((e=>e.item)),event:e.browserEvent})),this._store)}get displayed(){return"none"!==this._container.style.display}set displayed(e){this._container.style.display=e?"":"none"}get scrollTop(){return this._tree.scrollTop}set scrollTop(e){this._tree.scrollTop=e}get ariaLabel(){return this._tree.ariaLabel}set ariaLabel(e){this._tree.ariaLabel=e??""}set enabled(e){this._tree.getHTMLElement().style.pointerEvents=e?"":"none"}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e}get shouldLoop(){return this._shouldLoop}set shouldLoop(e){this._shouldLoop=e}_registerListeners(){this._registerOnKeyDown(),this._registerOnContainerClick(),this._registerOnMouseMiddleClick(),this._registerOnTreeModelChanged(),this._registerOnElementChecked(),this._registerOnContextMenu(),this._registerHoverListeners(),this._registerSelectionChangeListener(),this._registerSeparatorActionShowingListeners()}_registerOnKeyDown(){this._register(this._tree.onKeyDown((e=>{const t=new Ze(e);10===t.keyCode&&this.toggleCheckbox(),this._onKeyDown.fire(t)})))}_registerOnContainerClick(){this._register(ga(this._container,Qa.CLICK,(e=>{(e.x||e.y)&&this._onLeave.fire()})))}_registerOnMouseMiddleClick(){this._register(ga(this._container,Qa.AUXCLICK,(e=>{1===e.button&&this._onLeave.fire()})))}_registerOnTreeModelChanged(){this._register(this._tree.onDidChangeModel((()=>{const e=this._itemElements.filter((e=>!e.hidden)).length;this._visibleCountObservable.set(e,void 0),this._hasCheckboxes&&this._updateCheckedObservables()})))}_registerOnElementChecked(){this._register(this._elementCheckedEventBufferer.wrapEvent(this._elementChecked.event,((e,t)=>t))((e=>this._updateCheckedObservables())))}_registerOnContextMenu(){this._register(this._tree.onContextMenu((e=>{e.element&&(e.browserEvent.preventDefault(),this._tree.setSelection([e.element]))})))}_registerHoverListeners(){const e=this._register(new pi("function"==typeof this.hoverDelegate.delay?this.hoverDelegate.delay():this.hoverDelegate.delay));this._register(this._tree.onMouseOver((async t=>{if($a(t.browserEvent.target))e.cancel();else if($a(t.browserEvent.relatedTarget)||!Oa(t.browserEvent.relatedTarget,t.element?.element))try{await e.trigger((async()=>{t.element instanceof Pme&&this.showHover(t.element)}))}catch(t){if(!Re(t))throw t}}))),this._register(this._tree.onMouseOut((t=>{Oa(t.browserEvent.relatedTarget,t.element?.element)||e.cancel()})))}_registerSeparatorActionShowingListeners(){this._register(this._tree.onDidChangeFocus((e=>{const t=e.elements[0]?this._tree.getParentElement(e.elements[0]):null;for(const e of this._separatorRenderer.visibleSeparators){const i=e===t;!!(e.focusInsideSeparator&Fme.ACTIVE_ITEM)!==i&&(i?e.focusInsideSeparator|=Fme.ACTIVE_ITEM:e.focusInsideSeparator&=~Fme.ACTIVE_ITEM,this._tree.rerender(e))}}))),this._register(this._tree.onMouseOver((e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const e of this._separatorRenderer.visibleSeparators)e===t&&(e.focusInsideSeparator&Fme.MOUSE_HOVER||(e.focusInsideSeparator|=Fme.MOUSE_HOVER,this._tree.rerender(e)))}))),this._register(this._tree.onMouseOut((e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const e of this._separatorRenderer.visibleSeparators)e===t&&e.focusInsideSeparator&Fme.MOUSE_HOVER&&(e.focusInsideSeparator&=~Fme.MOUSE_HOVER,this._tree.rerender(e))})))}_registerSelectionChangeListener(){this._register(this._tree.onDidChangeSelection((e=>{const t=e.elements.filter((e=>e instanceof Pme));t.length!==e.elements.length&&(1===e.elements.length&&e.elements[0]instanceof Bme&&(this._tree.setFocus([e.elements[0].children[0]]),this._tree.reveal(e.elements[0],0)),this._tree.setSelection(t))})))}setAllVisibleChecked(e){this._elementCheckedEventBufferer.bufferEvents((()=>{this._itemElements.forEach((t=>{t.hidden||t.checkboxDisabled||!1===t.item.pickable||(t.checked=e)}))}))}setElements(e){let t;this._elementDisposable.clear(),this._lastQueryString=void 0,this._inputElements=e,this._hasCheckboxes=this.parent.classList.contains("show-checkboxes"),this._itemElements=new Array,this._elementTree=e.reduce(((i,n,o)=>{let s;if("separator"===n.type){if(!n.buttons)return i;t=new Bme(o,(e=>this._onSeparatorButtonTriggered.fire(e)),n),s=t}else{const r=o>0?e[o-1]:void 0;let a;r&&"separator"===r.type&&!r.buttons&&(a=r);const l=new Pme(o,t?.children?t.children.length:o,this._hasCheckboxes&&!1!==n.pickable,(e=>this._onButtonTriggered.fire(e)),this._elementChecked,n,a);if(this._itemElements.push(l),t)return t.children.push(l),i;s=l}return i.push(s),i}),new Array),this._setElementsToTree(this._elementTree),this.accessibilityService.isScreenReaderOptimized()&&setTimeout((()=>{const e=this._tree.getHTMLElement().querySelector(".monaco-list-row.focused"),t=e?.parentNode;if(e&&t){const i=e.nextSibling;e.remove(),t.insertBefore(e,i)}}),0)}setFocusedElements(e){const t=e.map((e=>this._itemElements.find((t=>t.item===e)))).filter((e=>!!e)).filter((e=>!e.hidden));if(this._tree.setFocus(t),e.length>0){const e=this._tree.getFocus()[0];e&&this._tree.reveal(e)}}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){const t=e.map((e=>this._itemElements.find((t=>t.item===e)))).filter((e=>!!e));this._tree.setSelection(t)}getCheckedElements(){return this._itemElements.filter((e=>e.checked)).map((e=>e.item))}setCheckedElements(e){this._elementCheckedEventBufferer.bufferEvents((()=>{const t=new Set;for(const i of e)t.add(i);for(const e of this._itemElements)e.checked=t.has(e.item)}))}focus(e){if(this._itemElements.length)switch(e===xD.Second&&this._itemElements.length<2&&(e=xD.First),e){case xD.First:this._tree.scrollTop=0,this._tree.focusFirst(void 0,(e=>e.element instanceof Pme));break;case xD.Second:{this._tree.scrollTop=0;let e=!1;this._tree.focusFirst(void 0,(t=>t.element instanceof Pme&&(!!e||(e=!e,!1))));break}case xD.Last:this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,(e=>e.element instanceof Pme));break;case xD.Next:{const e=this._tree.getFocus();this._tree.focusNext(void 0,this._shouldLoop,void 0,(e=>e.element instanceof Pme&&(this._tree.reveal(e.element),!0)));const t=this._tree.getFocus();e.length&&e[0]===t[0]&&this._onLeave.fire();break}case xD.Previous:{const e=this._tree.getFocus();this._tree.focusPrevious(void 0,this._shouldLoop,void 0,(e=>{if(!(e.element instanceof Pme))return!1;const t=this._tree.getParentElement(e.element);return null===t||t.children[0]!==e.element?this._tree.reveal(e.element):this._tree.reveal(t),!0}));const t=this._tree.getFocus();e.length&&e[0]===t[0]&&this._onLeave.fire();break}case xD.NextPage:this._tree.focusNextPage(void 0,(e=>e.element instanceof Pme&&(this._tree.reveal(e.element),!0)));break;case xD.PreviousPage:this._tree.focusPreviousPage(void 0,(e=>{if(!(e.element instanceof Pme))return!1;const t=this._tree.getParentElement(e.element);return null===t||t.children[0]!==e.element?this._tree.reveal(e.element):this._tree.reveal(t),!0}));break;case xD.NextSeparator:{let e=!1;const t=this._tree.getFocus()[0];this._tree.focusNext(void 0,!0,void 0,(t=>{if(e)return!0;if(t.element instanceof Bme)e=!0,this._separatorRenderer.isSeparatorVisible(t.element)?this._tree.reveal(t.element.children[0]):this._tree.reveal(t.element,0);else if(t.element instanceof Pme){if(t.element.separator)return this._itemRenderer.isItemWithSeparatorVisible(t.element)?this._tree.reveal(t.element):this._tree.reveal(t.element,0),!0;if(t.element===this._elementTree[0])return this._tree.reveal(t.element,0),!0}return!1})),t===this._tree.getFocus()[0]&&(this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,(e=>e.element instanceof Pme)));break}case xD.PreviousSeparator:{let e,t=!!this._tree.getFocus()[0]?.separator;this._tree.focusPrevious(void 0,!0,void 0,(i=>{if(i.element instanceof Bme)t?e||(this._separatorRenderer.isSeparatorVisible(i.element)?this._tree.reveal(i.element):this._tree.reveal(i.element,0),e=i.element.children[0]):t=!0;else if(i.element instanceof Pme&&!e)if(i.element.separator)this._itemRenderer.isItemWithSeparatorVisible(i.element)?this._tree.reveal(i.element):this._tree.reveal(i.element,0),e=i.element;else if(i.element===this._elementTree[0])return this._tree.reveal(i.element,0),!0;return!1})),e&&this._tree.setFocus([e]);break}}}clearFocus(){this._tree.setFocus([])}domFocus(){this._tree.domFocus()}layout(e){this._tree.getHTMLElement().style.maxHeight=e?44*Math.floor(e/44)+6+"px":"",this._tree.layout()}filter(e){if(this._lastQueryString=e,!(this._sortByLabel||this._matchOnLabel||this._matchOnDescription||this._matchOnDetail))return this._tree.layout(),!1;const t=e;if((e=e.trim())&&(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail)){let i;this._itemElements.forEach((n=>{let o;o="fuzzy"===this.matchOnLabelMode?this.matchOnLabel?Dh(e,Lh(n.saneLabel))??void 0:void 0:this.matchOnLabel?function(e,t){const{text:i,iconOffsets:n}=t;if(!n||0===n.length)return jme(e,i);const o=zi(i," "),s=i.length-o.length,r=jme(e,o);if(r)for(const e of r){const t=n[e.start+s]+s;e.start+=t,e.end+=t}return r}(t,Lh(n.saneLabel))??void 0:void 0;const s=this.matchOnDescription?Dh(e,Lh(n.saneDescription||""))??void 0:void 0,r=this.matchOnDetail?Dh(e,Lh(n.saneDetail||""))??void 0:void 0;if(o||s||r?(n.labelHighlights=o,n.descriptionHighlights=s,n.detailHighlights=r,n.hidden=!1):(n.labelHighlights=void 0,n.descriptionHighlights=void 0,n.detailHighlights=void 0,n.hidden=!n.item||!n.item.alwaysShow),n.item?n.separator=void 0:n.separator&&(n.hidden=!0),!this.sortByLabel){const e=n.index&&this._inputElements[n.index-1]||void 0;"separator"!==e?.type||e.buttons||(i=e),i&&!n.hidden&&(n.separator=i,i=void 0)}}))}else this._itemElements.forEach((e=>{e.labelHighlights=void 0,e.descriptionHighlights=void 0,e.detailHighlights=void 0,e.hidden=!1;const t=e.index&&this._inputElements[e.index-1];e.item&&(e.separator=t&&"separator"===t.type&&!t.buttons?t:void 0)}));return this._setElementsToTree(this._sortByLabel&&e?this._itemElements:this._elementTree),this._tree.layout(),!0}toggleCheckbox(){this._elementCheckedEventBufferer.bufferEvents((()=>{const e=this._tree.getFocus().filter((e=>e instanceof Pme)),t=this._allVisibleChecked(e);for(const i of e)i.checkboxDisabled||(i.checked=!t)}))}style(e){this._tree.style(e)}toggleHover(){const e=this._tree.getFocus()[0];if(!(e?.saneTooltip&&e instanceof Pme))return;if(this._lastHover&&!this._lastHover.isDisposed)return void this._lastHover.dispose();this.showHover(e);const t=new Mt;t.add(this._tree.onDidChangeFocus((e=>{e.elements[0]instanceof Pme&&this.showHover(e.elements[0])}))),this._lastHover&&t.add(this._lastHover),this._elementDisposable.add(t)}_setElementsToTree(e){const t=new Array;for(const i of e)i instanceof Bme?t.push({element:i,collapsible:!1,collapsed:!1,children:i.children.map((e=>({element:e,collapsible:!1,collapsed:!1})))}):t.push({element:i,collapsible:!1,collapsed:!1});this._tree.setChildren(null,t)}_allVisibleChecked(e,t=!0){for(let i=0,n=e.length;i<n;i++){const n=e[i];if(!n.hidden&&!1!==n.item.pickable){if(!n.checked)return!1;t=!0}}return t}_updateCheckedObservables(){Vs((e=>{this._allVisibleCheckedObservable.set(this._allVisibleChecked(this._itemElements,!1),e);const t=this._itemElements.filter((e=>e.checked)).length;this._checkedCountObservable.set(t,e),this._checkedElementsObservable.set(this.getCheckedElements(),e)}))}showHover(e){this._lastHover&&!this._lastHover.isDisposed&&(this.hoverDelegate.onDidHideHover?.(),this._lastHover?.dispose()),e.element&&e.saneTooltip&&(this._lastHover=this.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:e=>{this.linkOpenerDelegate(e)},appearance:{showPointer:!0},container:this._container,position:{hoverPosition:1}},!1))}};function jme(e,t){const i=t.toLowerCase().indexOf(e.toLowerCase());return-1!==i?[{start:i,end:i+e.length}]:null}function qme(e,t={}){lu.registerCommandAndKeybindingRule({weight:200,when:Ac.and(Ac.or(Ac.equals(hme,"quickPick"),Ac.equals(hme,"quickTree")),lme),metadata:{description:y(1742,"Used while in the context of the quick pick. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},...e,secondary:Gme(e.primary,e.secondary??[],t)})}Mme([QT],Kme.prototype,"onDidChangeFocus",null),Mme([QT],Kme.prototype,"onDidChangeSelection",null),Kme=Mme([Ame(4,nc),Ame(5,rB)],Kme);const $me=$?256:2048;function Gme(e,t,i={}){return i.withAltMod&&t.push(512+e),i.withCtrlMod&&(t.push($me+e),i.withAltMod&&t.push(512+$me+e)),i.withCmdMod&&$&&(t.push(2048+e),i.withCtrlMod&&t.push(2304+e),i.withAltMod&&(t.push(2560+e),i.withCtrlMod&&t.push(2816+e))),t}function Zme(e,t){return i=>{const n=i.get(LD).currentQuickInput;if(n)return t&&n.quickNavigate?n.focus(t):n.focus(e)}}qme({id:"quickInput.pageNext",primary:12,handler:Zme(xD.NextPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0}),qme({id:"quickInput.pagePrevious",primary:11,handler:Zme(xD.PreviousPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0}),qme({id:"quickInput.first",primary:$me+14,handler:Zme(xD.First)},{withAltMod:!0,withCmdMod:!0}),qme({id:"quickInput.last",primary:$me+13,handler:Zme(xD.Last)},{withAltMod:!0,withCmdMod:!0}),qme({id:"quickInput.next",primary:18,handler:Zme(xD.Next)},{withCtrlMod:!0}),qme({id:"quickInput.previous",primary:16,handler:Zme(xD.Previous)},{withCtrlMod:!0});const Yme=y(1743,"If we're in quick access mode, this will navigate to the next item. If we are not in quick access mode, this will navigate to the next separator."),Qme=y(1744,"If we're in quick access mode, this will navigate to the previous item. If we are not in quick access mode, this will navigate to the previous separator.");$?(qme({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:2066,handler:Zme(xD.NextSeparator,xD.Next),metadata:{description:Yme}}),qme({id:"quickInput.nextSeparator",primary:2578,secondary:[2322],handler:Zme(xD.NextSeparator)},{withCtrlMod:!0}),qme({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:2064,handler:Zme(xD.PreviousSeparator,xD.Previous),metadata:{description:Qme}}),qme({id:"quickInput.previousSeparator",primary:2576,secondary:[2320],handler:Zme(xD.PreviousSeparator)},{withCtrlMod:!0})):(qme({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:530,handler:Zme(xD.NextSeparator,xD.Next),metadata:{description:Yme}}),qme({id:"quickInput.nextSeparator",primary:2578,handler:Zme(xD.NextSeparator)}),qme({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:528,handler:Zme(xD.PreviousSeparator,xD.Previous),metadata:{description:Qme}}),qme({id:"quickInput.previousSeparator",primary:2576,handler:Zme(xD.PreviousSeparator)})),lu.registerCommandAndKeybindingRule({id:"quickInput.accept",primary:3,weight:200,when:Ac.and(Ac.notEquals(hme,"quickWidget"),lme),metadata:{description:y(1745,"Used while in the context of some quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},handler:e=>{const t=e.get(LD).currentQuickInput;t?.accept()},secondary:Gme(3,[],{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0})}),qme({id:"quickInput.acceptInBackground",when:Ac.and(lme,Ac.equals(hme,"quickPick"),Ac.or(eJ.negate(),pme)),primary:17,weight:250,handler:e=>{const t=e.get(LD).currentQuickInput;t?.accept(!0)}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0}),function(e,t={}){lu.registerCommandAndKeybindingRule({weight:200,when:lme,metadata:{description:y(1741,"Used while in the context of any kind of quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},...e,secondary:Gme(e.primary,e.secondary??[],t)})}({id:"quickInput.hide",primary:9,handler:e=>{const t=e.get(LD).currentQuickInput;t?.hide()}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0}),qme({id:"quickInput.toggleHover",primary:10|$me,handler:e=>{e.get(LD).toggleHover()}});var Xme;const Jme=ll;let efe=class extends At{static{Xme=this}static{this.ID="quickInputTreeElement"}constructor(e,t,i,n){super(),this._hoverDelegate=e,this._buttonTriggeredEmitter=t,this.onCheckedEvent=i,this._themeService=n,this.templateId=Xme.ID}renderTemplate(e){const t=new Mt,i=il(e,Jme(".quick-input-tree-entry")),n=t.add(new nQ("",!1,{...AR,size:15}));i.appendChild(n.domNode);const o=il(i,Jme("label.quick-input-tree-label")),s=il(o,Jme(".quick-input-tree-rows")),r=il(s,Jme(".quick-input-tree-row")),a=nl(r,Jme(".quick-input-tree-icon")),l=t.add(new v0(r,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this._hoverDelegate})),d=t.add(new uR(i,this._hoverDelegate?{hoverDelegate:this._hoverDelegate}:void 0));return d.domNode.classList.add("quick-input-tree-entry-action-bar"),{toDisposeTemplate:t,entry:i,checkbox:n,icon:a,label:l,actionBar:d,toDisposeElement:new Mt}}renderElement(e,t,i,n){const o=i.toDisposeElement,s=e.element;if(!1===s.pickable?i.checkbox.domNode.style.display="none":(i.checkbox.domNode.style.display="",i.checkbox.checked=s.checked??!1,o.add(zt.filter(this.onCheckedEvent,(e=>e.item===s))((e=>i.checkbox.checked=e.checked))),s.disabled&&i.checkbox.disable()),s.iconPath){const e=ow(this._themeService.getColorTheme().type)?s.iconPath.dark:s.iconPath.light??s.iconPath.dark,t=uo.revive(e);i.icon.className="quick-input-tree-icon",i.icon.style.backgroundImage=CM(t)}else i.icon.style.backgroundImage="",i.icon.className=s.iconClass?`quick-input-tree-icon ${s.iconClass}`:"";const{labelHighlights:r,descriptionHighlights:a}=e.filterData||{};let l;s.description&&(l={markdown:{value:Wi(s.description),supportThemeIcons:!0},markdownNotSupportedFallback:s.description}),i.label.setLabel(s.label,s.description,{matches:r,descriptionMatches:a,extraClasses:s.iconClasses,italic:s.italic,strikethrough:s.strikethrough,labelEscapeNewLines:!0,descriptionTitle:l});const d=s.buttons;d&&d.length?(i.actionBar.push(d.map(((e,t)=>ome(e,`tree-${t}`,(()=>this._buttonTriggeredEmitter.fire({item:s,button:e}))))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i,n){i.toDisposeElement.clear(),i.actionBar.clear()}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}};efe=Xme=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(3,sw)],efe);class tfe{getHeight(e){return 22}getTemplateId(e){return efe.ID}}function ife(e){let t=!1,i=!1,n=!1;for(const o of e){switch(o.element?.checked){case"partial":n=!0;break;case!0:t=!0;break;default:i=!0}if(t&&i&&n)break}return i?(n||!!t)&&"partial":n?"partial":t}class nfe{constructor(e){this.onCheckedEvent=e}getWidgetAriaLabel(){return y(1755,"Quick Tree")}getAriaLabel(e){return e.ariaLabel||[e.label,e.description].map((e=>xh(e))).filter((e=>!!e)).join(", ")}getWidgetRole(){return"tree"}getRole(e){return"checkbox"}isChecked(e){return{get value(){return!0===e.checked},onDidChange:t=>zt.filter(this.onCheckedEvent,(t=>t.item===e))((e=>t()))}}}class ofe{constructor(){this.filterValue="",this.matchOnLabel=!0,this.matchOnDescription=!1}filter(e,t){if(!this.filterValue||!this.matchOnLabel&&!this.matchOnDescription)return e.children?{visibility:2,data:{}}:{visibility:1,data:{}};const i=this.matchOnLabel?Dh(this.filterValue,Lh(e.label))??void 0:void 0,n=this.matchOnDescription?Dh(this.filterValue,Lh(e.description||""))??void 0:void 0;return{visibility:1===t||i||n?1:e.children?2:0,data:{labelHighlights:i,descriptionHighlights:n}}}}const sfe=ll;let rfe=class extends At{constructor(e,t,i){super(),this.instantiationService=i,this._onDidTriggerButton=this._register(new Zt),this._onDidChangeCheckboxState=this._register(new Zt),this.onDidChangeCheckboxState=this._onDidChangeCheckboxState.event,this._onDidCheckedLeafItemsChange=this._register(new Zt),this._onLeave=new Zt,this.onLeave=this._onLeave.event,this._onDidAccept=this._register(new Zt),this.onDidAccept=this._onDidAccept.event,this._container=il(e,sfe(".quick-input-tree")),this._renderer=this._register(this.instantiationService.createInstance(efe,t,this._onDidTriggerButton,this.onDidChangeCheckboxState)),this._filter=this.instantiationService.createInstance(ofe),this._tree=this._register(this.instantiationService.createInstance(YJ,"QuickInputTree",this._container,new tfe,[this._renderer],{accessibilityProvider:new nfe(this.onDidChangeCheckboxState),horizontalScrolling:!1,multipleSelectionSupport:!1,findWidgetEnabled:!1,alwaysConsumeMouseWheel:!0,hideTwistiesOfChildlessElements:!0,renderIndentGuides:VQ.None,expandOnDoubleClick:!0,expandOnlyOnTwistieClick:!0,disableExpandOnSpacebar:!0,sorter:{compare:(e,t)=>{if(e.label<t.label)return-1;if(e.label>t.label)return 1;if(e.description&&t.description){if(e.description<t.description)return-1;if(e.description>t.description)return 1}else{if(e.description)return-1;if(t.description)return 1}return 0}},filter:this._filter})),this.registerOnOpenListener()}get tree(){return this._tree}get displayed(){return"none"!==this._container.style.display}set displayed(e){this._container.style.display=e?"":"none"}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}layout(e){this._tree.getHTMLElement().style.maxHeight=e?44*Math.floor(e/44)+6+"px":"",this._tree.layout()}registerOnOpenListener(){this._register(this._tree.onDidOpen((e=>{const t=e.element;if(!t)return;if(t.disabled)return;if(!1===t.pickable)return this._tree.setFocus([t]),void this._onDidAccept.fire();const i=!0!==t.checked;if((t.checked??!1)===i)return;t.checked=i,this._tree.rerender(t);const n=new Set,o=[...this._tree.getNode(t).children];for(;o.length;){const e=o.shift();e?.element&&!n.has(e.element)&&(n.add(e.element),(e.element.checked??!1)!==t.checked&&(e.element.checked=t.checked,this._tree.rerender(e.element)),o.push(...e.children))}let s=this._tree.getParentElement(t);for(;s;){const e=ife([...this._tree.getNode(s).children]);(s.checked??!1)!==e&&(s.checked=e,this._tree.rerender(s)),s=this._tree.getParentElement(s)}this._onDidChangeCheckboxState.fire({item:t,checked:t.checked??!1}),this._onDidCheckedLeafItemsChange.fire(this.getCheckedLeafItems())})))}getCheckedLeafItems(){const e=new Set,t=[...this._tree.getNode().children],i=new Array;for(;t.length;){const n=t.shift();n?.element&&!e.has(n.element)&&n.element.checked&&(e.add(n.element),t.push(...n.children),n.element.children||i.push(n.element))}return i}};rfe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(2,nc)],rfe);var afe,lfe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},dfe=function(e,t){return function(i,n){t(i,n,e)}};const hfe=ll,cfe="workbench.quickInput.viewState";let ufe=class extends At{static{afe=this}static{this.MAX_WIDTH=600}get currentQuickInput(){return this.controller??void 0}get container(){return this._container}constructor(e,t,i,n,o){super(),this.options=e,this.layoutService=t,this.instantiationService=i,this.storageService=o,this.enabled=!0,this.onDidAcceptEmitter=this._register(new Zt),this.onDidCustomEmitter=this._register(new Zt),this.onDidTriggerButtonEmitter=this._register(new Zt),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new Zt),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new Zt),this.onHide=this.onHideEmitter.event,this.inQuickInputContext=ame.bindTo(n),this.quickInputTypeContext=cme.bindTo(n),this.endOfQuickInputBoxContext=gme.bindTo(n),this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(zt.runAndSubscribe(la,(({window:e,disposables:t})=>this.registerKeyModsListeners(e,t)),{window:r,disposables:this._store})),this._register(da((e=>{this.ui&&ta(this.ui.container)===e&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))}))),this.viewState=this.loadViewState()}registerKeyModsListeners(e,t){const i=e=>{this.keyMods.ctrlCmd=e.ctrlKey||e.metaKey,this.keyMods.alt=e.altKey};for(const n of[Qa.KEY_DOWN,Qa.KEY_UP,Qa.MOUSE_DOWN])t.add(ga(e,n,i,!0))}getUI(e){if(this.ui)return e&&ta(this._container)!==ta(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;const t=il(this._container,hfe(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";const i=DM(t),n=il(t,hfe(".quick-input-titlebar")),o=this._register(new uR(n,{hoverDelegate:this.options.hoverDelegate}));o.domNode.classList.add("quick-input-left-action-bar");const s=il(n,hfe(".quick-input-title")),r=this._register(new uR(n,{hoverDelegate:this.options.hoverDelegate}));r.domNode.classList.add("quick-input-right-action-bar");const a=il(t,hfe(".quick-input-header")),l=this._register(new nQ(y(1746,"Toggle all checkboxes"),!1,{...AR,size:15}));il(a,l.domNode),this._register(l.onChange((()=>{const e=l.checked;E.setAllVisibleChecked(!0===e)}))),this._register(ga(l.domNode,Qa.CLICK,(e=>{(e.x||e.y)&&u.setFocus()})));const d=il(a,hfe(".quick-input-description")),h=il(a,hfe(".quick-input-and-message")),c=il(h,hfe(".quick-input-filter")),u=this._register(new Nme(c,this.styles.inputBox,this.styles.toggle));u.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=il(c,hfe(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=this._register(new g0(g,{countFormat:y(1747,"{0} Results")},this.styles.countBadge)),m=il(c,hfe(".quick-input-count"));m.setAttribute("aria-live","polite");const f=this._register(new g0(m,{countFormat:y(1748,"{0} Selected")},this.styles.countBadge)),_=this._register(new uR(a,{hoverDelegate:this.options.hoverDelegate}));_.domNode.classList.add("quick-input-inline-action-bar");const v=il(a,hfe(".quick-input-action")),b=this._register(new hM(v,this.styles.button));b.label=y(1749,"OK"),this._register(b.onDidClick((e=>{this.onDidAcceptEmitter.fire()})));const w=il(a,hfe(".quick-input-action")),C=this._register(new hM(w,{...this.styles.button,supportIcons:!0}));C.label=y(1750,"Custom"),this._register(C.onDidClick((e=>{this.onDidCustomEmitter.fire()})));const S=il(h,hfe(`#${this.idPrefix}message.quick-input-message`)),x=this._register(new Dme(t,this.styles.progressBar));x.getContainer().classList.add("quick-input-progress");const k=il(t,hfe(".quick-input-html-widget"));k.tabIndex=-1;const L=il(t,hfe(".quick-input-description")),D=this.idPrefix+"list",E=this._register(this.instantiationService.createInstance(Kme,t,this.options.hoverDelegate,this.options.linkOpenerDelegate,D));u.setAttribute("aria-controls",D),this._register(E.onDidChangeFocus((()=>{u.hasFocus()&&u.setAttribute("aria-activedescendant",E.getActiveDescendant()??"")}))),this._register(E.onChangedAllVisibleChecked((e=>{l.checked=e}))),this._register(E.onChangedVisibleCount((e=>{p.setCount(e)}))),this._register(E.onChangedCheckedCount((e=>{f.setCount(e)}))),this._register(E.onLeave((()=>{setTimeout((()=>{this.controller&&(u.setFocus(),this.controller instanceof _me&&this.controller.canSelectMany&&E.clearFocus())}),0)})));const N=this._register(this.instantiationService.createInstance(rfe,t,this.options.hoverDelegate));this._register(N.tree.onDidChangeFocus((()=>{u.hasFocus()&&u.setAttribute("aria-activedescendant",N.getActiveDescendant()??"")}))),this._register(N.onLeave((()=>{setTimeout((()=>{this.controller&&(u.setFocus(),N.tree.setFocus([]))}),0)}))),this._register(N.onDidAccept((()=>{this.onDidAcceptEmitter.fire()}))),this._register(N.tree.onDidChangeContentHeight((()=>this.updateLayout())));const I=tl(t);return this._register(I),this._register(ga(t,Qa.FOCUS,(e=>{const t=this.getUI();if(Oa(e.relatedTarget,t.inputContainer)){const e=t.inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==e&&this.endOfQuickInputBoxContext.set(e)}Oa(e.relatedTarget,t.container)||(this.inQuickInputContext.set(!0),this.previousFocusElement=qa(e.relatedTarget)?e.relatedTarget:void 0)}),!0)),this._register(I.onDidBlur((()=>{this.getUI().ignoreFocusOut||this.options.ignoreFocusOut()||this.hide(yD.Blur),this.inQuickInputContext.set(!1),this.endOfQuickInputBoxContext.set(!1),this.previousFocusElement=void 0}))),this._register(u.onKeyDown((e=>{const t=this.getUI().inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==t&&this.endOfQuickInputBoxContext.set(t),u.removeAttribute("aria-activedescendant")}))),this._register(ga(t,Qa.FOCUS,(e=>{u.setFocus()}))),this.dndController=this._register(this.instantiationService.createInstance(gfe,this._container,t,[{node:n,includeChildren:!0},{node:a,includeChildren:!1}],this.viewState)),this._register(ar((e=>{const t=this.dndController?.dndViewState.read(e);t&&(void 0!==t.top&&void 0!==t.left?this.viewState={...this.viewState,top:t.top,left:t.left}:this.viewState=void 0,this.updateLayout(),t.done&&this.saveViewState(this.viewState))}))),this.ui={container:t,styleSheet:i,leftActionBar:o,titleBar:n,title:s,description1:L,description2:d,widget:k,rightActionBar:r,inlineActionBar:_,checkAll:l,inputContainer:h,filterContainer:c,inputBox:u,visibleCountContainer:g,visibleCount:p,countContainer:m,count:f,okContainer:v,ok:b,message:S,customButtonContainer:w,customButton:C,list:E,tree:N,progressBar:x,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:e=>this.show(e),hide:()=>this.hide(),setVisibilities:e=>this.setVisibilities(e),setEnabled:e=>this.setEnabled(e),setContextKey:e=>this.options.setContextKey(e),linkOpenerDelegate:e=>this.options.linkOpenerDelegate(e)},this.updateStyles(),this.ui}reparentUI(e){this.ui&&(this._container=e,il(this._container,this.ui.container),this.dndController?.reparentUI(this._container))}pick(e,t={},i=oi.None){return new Promise(((n,o)=>{let s=e=>{s=n,t.onKeyMods?.(r.keyMods),n(e)};if(i.isCancellationRequested)return void s(void 0);const r=this.createQuickPick({useSeparators:!0});let a;const l=[r,r.onDidAccept((()=>{if(r.canSelectMany)s(r.selectedItems.slice()),r.hide();else{const e=r.activeItems[0];e&&(s(e),r.hide())}})),r.onDidChangeActive((e=>{const i=e[0];i&&t.onDidFocus&&t.onDidFocus(i)})),r.onDidChangeSelection((e=>{if(!r.canSelectMany){const t=e[0];t&&(s(t),r.hide())}})),r.onDidTriggerItemButton((e=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton({...e,removeItem:()=>{const t=r.items.indexOf(e.item);if(-1!==t){const e=r.items.slice(),i=e.splice(t,1),n=r.activeItems.filter((e=>e!==i[0])),o=r.keepScrollPosition;r.keepScrollPosition=!0,r.items=e,n&&(r.activeItems=n),r.keepScrollPosition=o}}}))),r.onDidTriggerSeparatorButton((e=>t.onDidTriggerSeparatorButton?.(e))),r.onDidChangeValue((e=>{!a||e||1===r.activeItems.length&&r.activeItems[0]===a||(r.activeItems=[a])})),i.onCancellationRequested((()=>{r.hide()})),r.onDidHide((()=>{Et(l),s(void 0)}))];r.title=t.title,t.value&&(r.value=t.value),r.canSelectMany=!!t.canPickMany,r.placeholder=t.placeHolder,r.ignoreFocusOut=!!t.ignoreFocusLost,r.matchOnDescription=!!t.matchOnDescription,r.matchOnDetail=!!t.matchOnDetail,void 0!==t.sortByLabel&&(r.sortByLabel=t.sortByLabel),r.matchOnLabel=void 0===t.matchOnLabel||t.matchOnLabel,r.quickNavigate=t.quickNavigate,r.hideInput=!!t.hideInput,r.contextKey=t.contextKey,r.busy=!0,Promise.all([e,t.activeItem]).then((([e,t])=>{a=t,r.busy=!1,r.items=e,r.canSelectMany&&(r.selectedItems=e.filter((e=>"separator"!==e.type&&e.picked))),a&&(r.activeItems=[a])})),r.show(),Promise.resolve(e).then(void 0,(e=>{o(e),r.hide()}))}))}setValidationOnInput(e,t){t&<(t)?(e.severity=rO.Error,e.validationMessage=t):t&&!lt(t)?(e.severity=t.severity,e.validationMessage=t.content):(e.severity=rO.Ignore,e.validationMessage=void 0)}input(e={},t=oi.None){return new Promise((i=>{if(t.isCancellationRequested)return void i(void 0);const n=this.createInputBox(),o=e.validateInput||(()=>Promise.resolve(void 0)),s=zt.debounce(n.onDidChangeValue,((e,t)=>t),100);let r=e.value||"",a=Promise.resolve(o(r));const l=[n,s((e=>{e!==r&&(a=Promise.resolve(o(e)),r=e),a.then((t=>{e===r&&this.setValidationOnInput(n,t)}))})),n.onDidAccept((()=>{const e=n.value;e!==r&&(a=Promise.resolve(o(e)),r=e),a.then((t=>{!t||!lt(t)&&t.severity!==rO.Error?(i(e),n.hide()):e===r&&this.setValidationOnInput(n,t)}))})),t.onCancellationRequested((()=>{n.hide()})),n.onDidHide((()=>{Et(l),i(void 0)}))];n.title=e.title,n.value=e.value||"",n.valueSelection=e.valueSelection,n.prompt=e.prompt,n.placeholder=e.placeHolder,n.password=!!e.password,n.ignoreFocusOut=!!e.ignoreFocusLost,n.show()}))}createQuickPick(e={useSeparators:!1}){const t=this.getUI(!0);return new _me(t)}createInputBox(){const e=this.getUI(!0);return new vme(e)}show(e){const t=this.getUI(!0);this.onShowEmitter.fire();const i=this.controller;this.controller=e,i?.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",ol(t.widget),t.rightActionBar.clear(),t.inlineActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(rO.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),ol(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;const n=this.options.backKeybindingLabel();mme.tooltip=n?y(1751,"Back ({0})",n):y(1752,"Back"),t.container.style.display="",this.updateLayout(),this.dndController?.layoutContainer(),t.inputBox.setFocus(),this.quickInputTypeContext.set(e.type)}isVisible(){return!!this.ui&&"none"!==this.ui.container.style.display}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=!e.description||e.inputBox||e.checkAll?"none":"",t.checkAll.domNode.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.displayed=!!e.list,t.tree.displayed=!!e.tree,t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;const t=this.getUI();for(const i of t.leftActionBar.viewItems)i.action.enabled=e;for(const i of t.rightActionBar.viewItems)i.action.enabled=e;e?t.checkAll.enable():t.checkAll.disable(),t.inputBox.enabled=e,t.ok.enabled=e,t.list.enabled=e}}hide(e){const t=this.controller;if(!t)return;t.willHide(e);const i=this.ui?.container,n=i&&!za(i);if(this.controller=null,this.onHideEmitter.fire(),i&&(i.style.display="none"),!n){let e=this.previousFocusElement;for(;e&&!e.offsetParent;)e=e.parentElement??void 0;e?.offsetParent?(e.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}t.didHide(e)}toggleHover(){this.isVisible()&&this.controller instanceof _me&&this.getUI().list.toggleHover()}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isVisible()){const e=this.ui.container.style,t=Math.min(.62*this.dimension.width,afe.MAX_WIDTH);e.width=t+"px",e.top=`${this.viewState?.top?Math.round(this.dimension.height*this.viewState.top):this.titleBarOffset}px`,e.left=`${Math.round(this.dimension.width*(this.viewState?.left??.5)-t/2)}px`,this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&.4*this.dimension.height),this.ui.tree.layout(this.dimension&&.4*this.dimension.height)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:n,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=i??"",this.ui.container.style.border=n?`1px solid ${n}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.list.style(this.styles.list),this.ui.tree.tree.style(this.styles.list);const s=[];this.styles.pickerGroup.pickerGroupBorder&&s.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(s.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&s.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&s.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&s.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&s.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&s.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),s.push("}"));const r=s.join("\n");r!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=r)}}loadViewState(){try{const e=JSON.parse(this.storageService.get(cfe,-1,"{}"));if(void 0!==e.top||void 0!==e.left)return e}catch{}}saveViewState(e){this.layoutService.activeContainer===this.layoutService.mainContainer&&(void 0!==e?this.storageService.store(cfe,JSON.stringify(e),-1,1):this.storageService.remove(cfe,-1))}};ufe=afe=lfe([dfe(1,HR),dfe(2,nc),dfe(3,eu),dfe(4,Sq)],ufe);let gfe=class extends At{constructor(e,t,i,n,o,s,r){super(),this._container=e,this._quickInputContainer=t,this._quickInputDragAreas=i,this._layoutService=o,this.configurationService=r,this.dndViewState=Js(this,void 0),this._snapThreshold=20,this._snapLineHorizontalRatio=.25,this._quickInputAlignmentContext=dme.bindTo(s);const a="custom"===function(e){if(Y||$||"native"===E$(e))return"native";const t=e.getValue("window"),i=t?.controlsStyle;return"custom"===i||"hidden"===i?i:"native"}(this.configurationService);this._controlsOnLeft=a&&1===ee,this._controlsOnRight=a&&(3===ee||2===ee),this._registerLayoutListener(),this.registerMouseListeners(),this.dndViewState.set({...n,done:!0},void 0)}reparentUI(e){this._container=e}layoutContainer(e=this._layoutService.activeContainerDimension){const t=this.dndViewState.get(),i=this._quickInputContainer.getBoundingClientRect();if(t?.top&&t?.left){const n=Math.round(100*t.left)/100*e.width-i.width/2;this._layout(t.top*e.height,n)}}_registerLayoutListener(){this._register(zt.filter(this._layoutService.onDidLayoutContainer,(e=>e.container===this._container))((e=>this.layoutContainer(e.dimension))))}registerMouseListeners(){const e=this._quickInputContainer;this._register(_a(e,(t=>{const i=new Je(ta(e),t);2===i.detail&&this._quickInputDragAreas.some((({node:e,includeChildren:t})=>t?Oa(i.target,e):i.target===e))&&this.dndViewState.set({top:void 0,left:void 0,done:!0},void 0)}))),this._register(fa(e,(e=>{const t=ta(this._layoutService.activeContainer),i=new Je(t,e);if(!this._quickInputDragAreas.some((({node:e,includeChildren:t})=>t?Oa(i.target,e):i.target===e)))return;const n=this._quickInputContainer.getBoundingClientRect(),o=i.browserEvent.clientX-n.left,s=i.browserEvent.clientY-n.top;let r=!1;const a=(l=e=>{new Je(t,e).preventDefault(),r||(r=!0),this._layout(e.clientY-s,e.clientX-o)},ga(t,X&&pe?Qa.POINTER_MOVE:Qa.MOUSE_MOVE,l,undefined));var l;const d=_a(t,(e=>{if(r){const e=this.dndViewState.get();this.dndViewState.set({top:e?.top,left:e?.left,done:!0},void 0)}a.dispose(),d.dispose()}))})))}_layout(e,t){const i=this._getTopSnapValue(),n=this._getCenterYSnapValue(),o=this._getCenterXSnapValue();(e=Math.max(0,Math.min(e,this._container.clientHeight-this._quickInputContainer.clientHeight)))<this._layoutService.activeContainerOffset.top&&(this._controlsOnLeft?t=Math.max(t,80/d(Ka())):this._controlsOnRight&&(t=Math.min(t,this._container.clientWidth-this._quickInputContainer.clientWidth-140/d(Ka()))));const s=Math.abs(e-i)<this._snapThreshold;e=s?i:e;const r=Math.abs(e-n)<this._snapThreshold,a=(e=r?n:e)/this._container.clientHeight;t=Math.max(0,Math.min(t,this._container.clientWidth-this._quickInputContainer.clientWidth));const l=Math.abs(t-o)<this._snapThreshold;t=l?o:t;const h=this._container.clientWidth,c=(t+this._quickInputContainer.clientWidth/2)/h;if(this.dndViewState.set({top:a,left:c,done:!1},void 0),l){if(s)return void this._quickInputAlignmentContext.set("top");if(r)return void this._quickInputAlignmentContext.set("center")}this._quickInputAlignmentContext.set(void 0)}_getTopSnapValue(){return this._layoutService.activeContainerOffset.quickPickTop}_getCenterYSnapValue(){return Math.round(this._container.clientHeight*this._snapLineHorizontalRatio)}_getCenterXSnapValue(){return Math.round(this._container.clientWidth/2)-Math.round(this._quickInputContainer.clientWidth/2)}};gfe=lfe([dfe(4,HR),dfe(5,eu),dfe(6,up)],gfe);var pfe=function(e,t){return function(i,n){t(i,n,e)}};let mfe=class extends cw{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get currentQuickInput(){return this.controller.currentQuickInput}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(Qpe))),this._quickAccess}constructor(e,t,i,n,o){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=n,this.configurationService=o,this._onShow=this._register(new Zt),this._onHide=this._register(new Zt),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:e=>this.setContextKey(e),linkOpenerDelegate:e=>{this.instantiationService.invokeFunction((t=>{t.get(ZI).open(e,{allowCommands:!0,fromUserGesture:!0})}))},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(bme))},n=this._register(this.instantiationService.createInstance(ufe,{...i,...t}));return n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer((t=>{ta(e.activeContainer)===ta(n.container)&&n.layout(t,e.activeContainerOffset.quickPickTop)}))),this._register(e.onDidChangeActiveContainer((()=>{n.isVisible()||n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)}))),this._register(n.onShow((()=>{this.resetContextKeys(),this._onShow.fire()}))),this._register(n.onHide((()=>{this.resetContextKeys(),this._onHide.fire()}))),n}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new Jc(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),t&&t.get()||(this.resetContextKeys(),t?.set(!0))}resetContextKeys(){this.contexts.forEach((e=>{e.get()&&e.reset()}))}pick(e,t,i=oi.None){return this.controller.pick(e,t,i)}input(e={},t=oi.None){return this.controller.input(e,t)}createQuickPick(e={useSeparators:!1}){return this.controller.createQuickPick(e)}createInputBox(){return this.controller.createInputBox()}toggleHover(){this.hasController&&this.controller.toggleHover()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:Af(qb),quickInputForeground:Af($b),quickInputTitleBackground:Af(Gb),widgetBorder:Af(G_),widgetShadow:Af($_)},inputBox:RR,toggle:MR,countBadge:PR,button:IR,progressBar:TR,keybindingLabel:NR,list:BR({listBackground:qb,listFocusBackground:ew,listFocusForeground:Xb,listInactiveFocusForeground:Xb,listInactiveSelectionIconForeground:Jb,listInactiveFocusBackground:ew,listFocusOutline:Xf,listInactiveFocusOutline:Xf,treeStickyScrollBackground:qb}),pickerGroup:{pickerGroupBorder:Af(Yb),pickerGroupForeground:Af(Zb)}}}};mfe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([pfe(0,nc),pfe(1,eu),pfe(2,sw),pfe(3,HR),pfe(4,up)],mfe);var ffe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},_fe=function(e,t){return function(i,n){t(i,n,e)}};let vfe=class extends mfe{constructor(e,t,i,n,o,s){super(t,i,n,new ege(e.getContainerDomNode(),o),s),this.host=void 0;const r=wfe.get(e);if(r){const t=r.widget;this.host={_serviceBrand:void 0,get mainContainer(){return t.getDomNode()},getContainer:()=>t.getDomNode(),whenContainerStylesLoaded(){},get containers(){return[t.getDomNode()]},get activeContainer(){return t.getDomNode()},get mainContainerDimension(){return e.getLayoutInfo()},get activeContainerDimension(){return e.getLayoutInfo()},get onDidLayoutMainContainer(){return e.onDidLayoutChange},get onDidLayoutActiveContainer(){return e.onDidLayoutChange},get onDidLayoutContainer(){return zt.map(e.onDidLayoutChange,(e=>({container:t.getDomNode(),dimension:e})))},get onDidChangeActiveContainer(){return zt.None},get onDidAddContainer(){return zt.None},get mainContainerOffset(){return{top:0,quickPickTop:0}},get activeContainerOffset(){return{top:0,quickPickTop:0}},focus:()=>e.focus()}}else this.host=void 0}createController(){return super.createController(this.host)}};vfe=ffe([_fe(1,nc),_fe(2,eu),_fe(3,sw),_fe(4,sc),_fe(5,up)],vfe);let bfe=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(vfe,e);this.mapEditorToService.set(e,t),tt(e.onDidDispose)((()=>{i.dispose(),this.mapEditorToService.delete(e)}))}return t}get currentQuickInput(){return this.activeService.currentQuickInput}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t,i=oi.None){return this.activeService.pick(e,t,i)}input(e,t){return this.activeService.input(e,t)}createQuickPick(e={useSeparators:!1}){return this.activeService.createQuickPick(e)}createInputBox(){return this.activeService.createInputBox()}toggleHover(){return this.activeService.toggleHover()}};bfe=ffe([_fe(0,nc),_fe(1,sc)],bfe);class wfe{static{this.ID="editor.controller.quickInput"}static get(e){return e.getContribution(wfe.ID)}constructor(e){this.editor=e,this.widget=new Cfe(this.editor)}dispose(){this.widget.dispose()}}class Cfe{static{this.ID="editor.contrib.quickInputWidget"}constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return Cfe.ID}getDomNode(){return this.domNode}getPosition(){return{preference:{top:0,left:0}}}dispose(){this.codeEditor.removeOverlayWidget(this)}}Uu(wfe.ID,wfe,4);var yfe=function(e,t){return function(i,n){t(i,n,e)}};let Sfe=class extends At{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new Zt,this._onDidChangeReducedMotion=new Zt,this._onDidChangeLinkUnderline=new Zt,this._accessibilityModeEnabledContext=aB.bindTo(this._contextKeyService);const n=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration("editor.accessibilitySupport")&&(n(),this._onDidChangeScreenReaderOptimized.fire()),e.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())}))),n(),this._register(this.onDidChangeScreenReaderOptimized((()=>n())));const o=r.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._linkUnderlinesEnabled=this._configurationService.getValue("accessibility.underlineLinks"),this.initReducedMotionListeners(o),this.initLinkUnderlineListeners()}initReducedMotionListeners(e){this._register(ga(e,"change",(()=>{this._systemMotionReduced=e.matches,"auto"===this._configMotionReduced&&this._onDidChangeReducedMotion.fire()})));const t=()=>{const e=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("reduce-motion",e),this._layoutService.mainContainer.classList.toggle("enable-motion",!e)};t(),this._register(this.onDidChangeReducedMotion((()=>t())))}initLinkUnderlineListeners(){this._register(this._configurationService.onDidChangeConfiguration((e=>{if(e.affectsConfiguration("accessibility.underlineLinks")){const e=this._configurationService.getValue("accessibility.underlineLinks");this._linkUnderlinesEnabled=e,this._onDidChangeLinkUnderline.fire()}})));const e=()=>{const e=this._linkUnderlinesEnabled;this._layoutService.mainContainer.classList.toggle("underline-links",e)};e(),this._register(this.onDidChangeLinkUnderlines((()=>e())))}onDidChangeLinkUnderlines(e){return this._onDidChangeLinkUnderline.event(e)}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return"on"===e||"auto"===e&&2===this._accessibilitySupport}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return"on"===e||"auto"===e&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};Sfe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([yfe(0,eu),yfe(1,HR),yfe(2,up)],Sfe);var xfe,kfe=function(e,t){return function(i,n){t(i,n,e)}};const Lfe="application/vnd.code.resources";let Dfe=class extends At{static{xfe=this}constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(p||m)&&this.installWebKitWriteTextWorkaround(),this._register(zt.runAndSubscribe(la,(({window:e,disposables:t})=>{t.add(ga(e.document,"copy",(()=>this.clearResourcesState())))}),{window:r,disposables:this._store}))}triggerPaste(){this.logService.trace("BrowserClipboardService#triggerPaste")}installWebKitWriteTextWorkaround(){const e=()=>{const e=new Li;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=e,Ka().navigator.clipboard.write([new ClipboardItem({"text/plain":e.p})]).catch((async t=>{t instanceof Error&&"NotAllowedError"===t.name&&e.isRejected||this.logService.error(t)}))};this._register(zt.runAndSubscribe(this.layoutService.onDidAddContainer,(({container:t,disposables:i})=>{i.add(ga(t,"click",e)),i.add(ga(t,"keydown",e))}),{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(e,t){if(this.logService.trace("BrowserClipboardService#writeText called with type:",t," text.length:",e.length),this.clearResourcesState(),t)return this.mapTextToType.set(t,e),void this.logService.trace("BrowserClipboardService#writeText");if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return this.logService.trace("before navigator.clipboard.writeText"),await Ka().navigator.clipboard.writeText(e)}catch(e){console.error(e)}this.fallbackWriteText(e)}fallbackWriteText(e){this.logService.trace("BrowserClipboardService#fallbackWriteText");const t=Ua(),i=t.activeElement,n=t.body.appendChild(ll("textarea",{"aria-hidden":!0}));n.style.height="1px",n.style.width="1px",n.style.position="absolute",n.value=e,n.focus(),n.select(),t.execCommand("copy"),qa(i)&&i.focus(),n.remove()}async readText(e){if(this.logService.trace("BrowserClipboardService#readText called with type:",e),e){const t=this.mapTextToType.get(e)||"";return this.logService.trace("BrowserClipboardService#readText text.length:",t.length),t}try{const e=await Ka().navigator.clipboard.readText();return this.logService.trace("BrowserClipboardService#readText text.length:",e.length),e}catch(e){console.error(e)}return""}async readFindText(){return this.findText}async writeFindText(e){this.findText=e}static{this.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3}async readResources(){try{const e=await Ka().navigator.clipboard.read();for(const t of e)if(t.types.includes(`web ${Lfe}`)){const e=await t.getType(`web ${Lfe}`),i=JSON.parse(await e.text()).map((e=>uo.from(e)));return i}}catch(e){}const e=await this.computeResourcesStateHash();return this.resourcesStateHash!==e&&this.clearResourcesState(),this.resources}async computeResourcesStateHash(){if(0!==this.resources.length)return Vo((await this.readText()).substring(0,xfe.MAX_RESOURCE_STATE_SOURCE_LENGTH))}clearInternalState(){this.clearResourcesState()}clearResourcesState(){this.resources=[],this.resourcesStateHash=void 0}};Dfe=xfe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([kfe(0,HR),kfe(1,yu)],Dfe);const Efe="data-keybinding-context";class Nfe{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return{...this._value}}setValue(e,t){return this._value[e]!==t&&(this._value[e]=t,!0)}removeValue(e){return e in this._value&&(delete this._value[e],!0)}getValue(e){const t=this._value[e];return void 0===t&&this._parent?this._parent.getValue(e):t}}class Ife extends Nfe{static{this.INSTANCE=new Ife}constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}class Tfe extends Nfe{static{this._keyPrefix="config."}constructor(e,t,i){super(e,null),this._configurationService=t,this._values=wT.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration((e=>{if(7===e.source){const e=Array.from(this._values,(([e])=>e));this._values.clear(),i.fire(new Rfe(e))}else{const t=[];for(const i of e.affectedKeys){const e=`config.${i}`,n=this._values.findSuperstr(e);void 0!==n&&(t.push(...Ct.map(n,(([e])=>e))),this._values.deleteSuperstr(e)),this._values.has(e)&&(t.push(e),this._values.delete(e))}i.fire(new Rfe(t))}}))}dispose(){this._listener.dispose()}getValue(e){if(0!==e.indexOf(Tfe._keyPrefix))return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(Tfe._keyPrefix.length),i=this._configurationService.getValue(t);let n;switch(typeof i){case"number":case"boolean":case"string":n=i;break;default:n=Array.isArray(i)?JSON.stringify(i):i}return this._values.set(e,n),n}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}class Mfe{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){void 0===this._defaultValue?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class Afe{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class Rfe{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every((t=>e.has(t)))}}class Ofe{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every((t=>t.allKeysContainedIn(e)))}}class Pfe extends At{get onDidChangeContext(){return this._onDidChangeContext.event}constructor(e){super(),this._onDidChangeContext=this._register(new Qt({merge:e=>new Ofe(e)})),this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new Mfe(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new Bfe(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return!e||e.evaluate(t)}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new Afe(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new Afe(e))}getContext(e){return this._isDisposed?Ife.INSTANCE:this.getContextValuesContainer(function(e){for(;e;){if(e.hasAttribute(Efe)){const t=e.getAttribute(Efe);return t?parseInt(t,10):NaN}e=e.parentElement}return 0}(e))}dispose(){super.dispose(),this._isDisposed=!0}}let Ffe=class extends Pfe{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0,this.inputFocusedContext=eJ.bindTo(this);const t=this._register(new Tfe(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t),this._register(zt.runAndSubscribe(la,(({window:e,disposables:t})=>{const i=t.add(new Rt);t.add(ga(e,Qa.FOCUS_IN,(()=>{i.value=new Mt,this.updateInputContextKeys(e.document,i.value)}),!0))}),{window:r,disposables:this._store}))}updateInputContextKeys(e,t){function i(){return!!e.activeElement&&vl(e.activeElement)}const n=i();if(this.inputFocusedContext.set(n),n){const n=t.add(tl(e.activeElement));zt.once(n.onDidBlur)((()=>{Ka().document===e&&this.inputFocusedContext.set(i()),n.dispose()}),void 0,t)}}getContextValuesContainer(e){return this._isDisposed?Ife.INSTANCE:this._contexts.get(e)||Ife.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new Nfe(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};Ffe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,up)],Ffe);class Bfe extends Pfe{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Rt),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(Efe)){let e="";this._domNode.classList&&(e=Array.from(this._domNode.classList.values()).join(", ")),console.error("Element already has context attribute"+(e?": "+e:""))}this._domNode.setAttribute(Efe,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext((e=>{var t;t=this._parent.getContextValuesContainer(this._myContextId).value,e.allKeysContainedIn(new Set(Object.keys(t)))||this._onDidChangeContext.fire(e)}))}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(Efe),super.dispose())}getContextValuesContainer(e){return this._isDisposed?Ife.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}fc.registerCommand("_setContext",(function(e,t,i){e.get(eu).createKey(String(t),function(e){return lg(e,(e=>"object"==typeof e&&1===e.$mid?uo.revive(e).toString():e instanceof uo?e.toString():void 0))}(i))})),fc.registerCommand({id:"getContextKeyInfo",handler:()=>[...Jc.all()].sort(((e,t)=>e.key.localeCompare(t.key))),metadata:{description:y(1659,"A command that returns information about context keys"),args:[]}}),fc.registerCommand("_generateContextKeyInfo",(function(){const e=[],t=new Set;for(const i of Jc.all())t.has(i.key)||(t.add(i.key),e.push(i));e.sort(((e,t)=>e.key.localeCompare(t.key))),console.log(JSON.stringify(e,void 0,2))}));class Wfe{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}}class Vfe{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())0===t.outgoing.size&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),n=this.lookupOrInsertNode(t);i.outgoing.set(n.key,n),n.incoming.set(i.key,i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const e of this._nodes.values())e.outgoing.delete(t),e.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new Wfe(t,e),this._nodes.set(t,i)),i}isEmpty(){return 0===this._nodes.size}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t}\n\t(-> incoming)[${[...i.incoming.keys()].join(", ")}]\n\t(outgoing ->)[${[...i.outgoing.keys()].join(",")}]\n`);return e.join("\n")}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(const[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const e=this._findCycle(n,t);if(e)return e;t.delete(i)}}}class Hfe extends Error{constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: \n${e.toString()}`}}class zfe{constructor(e=new Xj,t=!1,i,n=!1){this._services=e,this._strict=t,this._parent=i,this._enableTracing=n,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(nc,this),this._globalGraph=n?i?._globalGraph??new Vfe((e=>e)):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,Et(this._children),this._children.clear();for(const e of this._servicesToMaybeDispose)Dt(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,t){this._throwIfDisposed();const i=this,n=new class extends zfe{dispose(){i._children.delete(n),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(n),t?.add(n),n}invokeFunction(e,...t){this._throwIfDisposed();const i=Ufe.traceInvocation(this._enableTracing,e);let n=!1;try{const o={get:e=>{if(n)throw Fe("service accessor is only valid during the invocation of its target method");const t=this._getOrCreateServiceInstance(e,i);if(!t)throw new Error(`[invokeFunction] unknown service '${e}'`);return t},getIfExists:e=>{if(n)throw Fe("service accessor is only valid during the invocation of its target method");return this._getOrCreateServiceInstance(e,i)}};return e(o,...t)}finally{n=!0,i.stop()}}createInstance(e,...t){let i,n;return this._throwIfDisposed(),e instanceof vp?(i=Ufe.traceCreation(this._enableTracing,e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=Ufe.traceCreation(this._enableTracing,e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){const n=ec.getServiceDependencies(e).sort(((e,t)=>e.index-t.index)),o=[];for(const t of n){const n=this._getOrCreateServiceInstance(t.id,i);n||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id}.`,!1),o.push(n)}const s=n.length>0?n[0].index:t.length;if(t.length!==s){console.trace(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${t.length} static arguments`);const i=s-t.length;t=i>0?t.concat(new Array(i)):t.slice(0,s)}return Reflect.construct(e,t.concat(o))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof vp)this._services.set(e,t);else{if(!this._parent)throw new Error("illegalState - setting UNKNOWN service instance");this._parent._setCreatedServiceInstance(e,t)}}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof vp?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){const n=new Vfe((e=>e.id.toString()));let o=0;const s=[{id:e,desc:t,_trace:i}],r=new Set;for(;s.length;){const t=s.pop();if(!r.has(String(t.id))){if(r.add(String(t.id)),n.lookupOrInsertNode(t),o++>1e3)throw new Hfe(n);for(const i of ec.getServiceDependencies(t.desc.ctor)){const o=this._getServiceInstanceOrDescriptor(i.id);if(o||this._throwIfStrict(`[createInstance] ${e} depends on ${i.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(t.id),String(i.id)),o instanceof vp){const e={id:i.id,desc:o,_trace:t._trace.branch(i.id,!0)};n.insertEdge(t,e),s.push(e)}}}}for(;;){const e=n.roots();if(0===e.length){if(!n.isEmpty())throw new Hfe(n);break}for(const{data:t}of e){if(this._getServiceInstanceOrDescriptor(t.id)instanceof vp){const e=this._createServiceInstanceWithOwner(t.id,t.desc.ctor,t.desc.staticArguments,t.desc.supportsDelayedInstantiation,t._trace);this._setCreatedServiceInstance(t.id,e)}n.removeNode(t)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,o){if(this._services.get(e)instanceof vp)return this._createServiceInstance(e,t,i,n,o,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,n,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],n,o,s){if(n){const n=new zfe(void 0,this._strict,this,this._enableTracing);n._globalGraphImplicitDependency=String(e);const r=new Map,a=new ki((()=>{const e=n._createInstance(t,i,o);for(const[t,i]of r){const n=e[t];if("function"==typeof n)for(const t of i)t.disposable=n.apply(e,t.listener)}return r.clear(),s.add(e),e}));return new Proxy(Object.create(null),{get(e,t){if(!a.isInitialized&&"string"==typeof t&&(t.startsWith("onDid")||t.startsWith("onWill"))){let e=r.get(t);return e||(e=new Wt,r.set(t,e)),(i,n,o)=>{if(a.isInitialized)return a.value[t](i,n,o);{const t={listener:[i,n,o],disposable:void 0},s=e.push(t);return Tt((()=>{s(),t.disposable?.dispose()}))}}}if(t in e)return e[t];const i=a.value;let n=i[t];return"function"!=typeof n||(n=n.bind(i),e[t]=n),n},set:(e,t,i)=>(a.value[t]=i,!0),getPrototypeOf:e=>t.prototype})}{const e=this._createInstance(t,i,o);return s.add(e),e}}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}class Ufe{static{this.all=new Set}static{this._None=new class extends Ufe{constructor(){super(0,null)}stop(){}branch(){return this}}}static traceInvocation(e,t){return e?new Ufe(2,t.name||(new Error).stack.split("\n").slice(3,4).join("\n")):Ufe._None}static traceCreation(e,t){return e?new Ufe(1,t.name):Ufe._None}static{this._totals=0}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new Ufe(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;Ufe._totals+=e;let t=!1;const i=[`${1===this.type?"CREATE":"CALL"} ${this.name}`,`${function e(i,n){const o=[],s=new Array(i+1).join("\t");for(const[r,a,l]of n._dep)if(a&&l){t=!0,o.push(`${s}CREATES -> ${r}`);const n=e(i+1,l);n&&o.push(n)}else o.push(`${s}uses -> ${r}`);return o.join("\n")}(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Ufe._totals.toFixed(2)}ms)`];(e>2||t)&&Ufe.all.add(i.join("\n"))}}const Kfe=new Set([So.inMemory,So.vscodeSourceControl,So.walkThrough,So.walkThroughSnippet,So.vscodeChatCodeBlock,So.vscodeTerminal]);class jfe{constructor(){this._byResource=new nd,this._byOwner=new Map}set(e,t,i){let n=this._byResource.get(e);n||(n=new Map,this._byResource.set(e,n)),n.set(t,i);let o=this._byOwner.get(t);o||(o=new nd,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){const i=this._byResource.get(e);return i?.get(t)}delete(e,t){let i=!1,n=!1;const o=this._byResource.get(e);o&&(i=o.delete(t));const s=this._byOwner.get(t);if(s&&(n=s.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){return"string"==typeof e?this._byOwner.get(e)?.values()??Ct.empty():uo.isUri(e)?this._byResource.get(e)?.values()??Ct.empty():Ct.map(Ct.concat(...this._byOwner.values()),(e=>e[1]))}}class qfe{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new nd,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const e=this._data.get(t);e&&this._substract(e);const i=this._resourceStats(t);this._add(i),this._data.set(t,i)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(Kfe.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===qP.Error?t.errors+=1:i===qP.Warning?t.warnings+=1:i===qP.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class $fe{constructor(){this._onMarkerChanged=new Xt({delay:0,merge:$fe._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new jfe,this._stats=new qfe(this),this._filteredResources=new nd}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(ds(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const n=[];for(const o of i){const i=$fe._toMarker(e,t,o);i&&n.push(i)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:o,message:s,source:r,startLineNumber:a,startColumn:l,endLineNumber:d,endColumn:h,relatedInformation:c,tags:u,origin:g}=i;if(s)return a=a>0?a:1,l=l>0?l:1,d=d>=a?d:a,h=h>0?h:l,{resource:t,owner:e,code:n,severity:o,message:s,source:r,startLineNumber:a,startColumn:l,endLineNumber:d,endColumn:h,relatedInformation:c,tags:u,origin:g}}changeAll(e,t){const i=[],n=this._data.values(e);if(n)for(const t of n){const n=Ct.first(t);n&&(i.push(n.resource),this._data.delete(n.resource,e))}if(hs(t)){const n=new nd;for(const{resource:o,marker:s}of t){const t=$fe._toMarker(e,o,s);if(!t)continue;const r=n.get(o);r?r.push(t):(n.set(o,[t]),i.push(o))}for(const[t,i]of n)this._data.set(t,e,i)}i.length>0&&this._onMarkerChanged.fire(i)}_createFilteredMarker(e,t){const i=1===t.length?y(1721,'Problems are paused because: "{0}"',t[0]):y(1722,'Problems are paused because: "{0}" and {1} more',t[0],t.length-1);return{owner:"markersFilter",resource:e,severity:qP.Info,message:i,startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1}}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const s=e.ignoreResourceFilters?void 0:this._filteredResources.get(i);if(s?.length)return[this._createFilteredMarker(i,s)];const r=this._data.get(i,t);if(!r)return[];const a=[];for(const t of r){if(o>0&&a.length===o)break;const s=e.ignoreResourceFilters?void 0:this._filteredResources.get(i);s?.length?a.push(this._createFilteredMarker(i,s)):$fe._accept(t,n)&&a.push(t)}return a}{const s=t||i?this._data.values(i??t):this._data.values(),r=[],a=new od;for(const t of s)for(const i of t){if(a.has(i.resource))continue;if(o>0&&r.length===o)break;const t=e.ignoreResourceFilters?void 0:this._filteredResources.get(i.resource);t?.length?(r.push(this._createFilteredMarker(i.resource,t)),a.add(i.resource)):$fe._accept(i,n)&&r.push(i)}return r}}static _accept(e,t){return void 0===t||(t&e.severity)===e.severity}static _merge(e){const t=new nd;for(const i of e)for(const e of i)t.set(e,!0);return Array.from(t.keys())}}class Gfe extends At{get configurationModel(){return this._configurationModel}constructor(e){super(),this.logService=e,this._configurationModel=Kge.createEmptyModel(e)}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=Kge.createEmptyModel(this.logService);const e=ru.as(kp).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const n of e){const e=i[n],o=t[n];void 0!==e?this._configurationModel.setValue(n,e):o?this._configurationModel.setValue(n,rg(o.default)):this._configurationModel.removeValue(n)}}}class Zfe extends At{constructor(e,t=[]){super(),this.logger=new Nu([e,...t]),this._register(e.onDidChangeLogLevel((e=>this.setLevel(e))))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}}var Yfe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Qfe=function(e,t){return function(i,n){t(i,n,e)}};class Xfe{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new Zt}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let Jfe=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new Pt(new Xfe(t))):Promise.reject(new Error("Model not found"))}};Jfe=Yfe([Qfe(0,ac)],Jfe);class e_e{static{this.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}}}show(){return e_e.NULL_PROGRESS_RUNNER}async showWhile(e,t){await e}}class t_e{static{this.NO_OP=new dO}info(e){return this.notify({severity:rO.Info,message:e})}warn(e){return this.notify({severity:rO.Warning,message:e})}error(e){return this.notify({severity:rO.Error,message:e})}notify(e){switch(e.severity){case rO.Error:console.error(e.message);break;case rO.Warning:console.warn(e.message);break;default:console.log(e.message)}return t_e.NO_OP}prompt(e,t,i,n){return t_e.NO_OP}status(e,t){return{close:()=>{}}}}let i_e=class{constructor(e){this._onWillExecuteCommand=new Zt,this._onDidExecuteCommand=new Zt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=fc.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const n=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(e){return Promise.reject(e)}}};i_e=Yfe([Qfe(0,nc)],i_e);let n_e=class extends tpe{constructor(e,t,i,n,o,s){super(e,t,i,n,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const r=e=>{const t=new Mt;t.add(ga(e,Qa.KEY_DOWN,(e=>{const t=new Ze(e);this._dispatch(t,t.target)&&(t.preventDefault(),t.stopPropagation())}))),t.add(ga(e,Qa.KEY_UP,(e=>{const t=new Ze(e);this._singleModifierDispatch(t,t.target)&&t.preventDefault()}))),this._domNodeListeners.push(new o_e(e,t))},a=e=>{for(let t=0;t<this._domNodeListeners.length;t++){const i=this._domNodeListeners[t];i.domNode===e&&(this._domNodeListeners.splice(t,1),i.dispose())}},l=e=>{e.getOption(70)||r(e.getContainerDomNode())};this._register(s.onCodeEditorAdd(l)),this._register(s.onCodeEditorRemove((e=>{e.getOption(70)||a(e.getContainerDomNode())}))),s.listCodeEditors().forEach(l);const d=e=>{r(e.getContainerDomNode())};this._register(s.onDiffEditorAdd(d)),this._register(s.onDiffEditorRemove((e=>{a(e.getContainerDomNode())}))),s.listDiffEditors().forEach(d)}addDynamicKeybinding(e,t,i,n){return Nt(fc.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){const t=e.map((e=>({keybinding:He(e.keybinding,se),command:e.command??null,commandArgs:e.commandArgs,when:e.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1})));return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),Tt((()=>{for(let e=0;e<this._dynamicKeybindings.length;e++)if(this._dynamicKeybindings[e]===t[0])return this._dynamicKeybindings.splice(e,t.length),void this.updateResolver()}))}updateResolver(){this._cachedResolver=null,this._onDidUpdateKeybindings.fire()}_getResolver(){if(!this._cachedResolver){const e=this._toNormalizedKeybindingItems(lu.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new Qge(e,t,(e=>this._log(e)))}return this._cachedResolver}_documentHasFocus(){return r.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const o of e){const e=o.when||void 0,s=o.keybinding;if(s){const r=rpe.resolveKeybinding(s,se);for(const s of r)i[n++]=new npe(s,o.command,o.commandArgs,e,t,null,!1)}else i[n++]=new npe(void 0,o.command,o.commandArgs,e,t,null,!1)}return i}resolveKeyboardEvent(e){const t=new Ue(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new rpe([t],se)}};n_e=Yfe([Qfe(0,eu),Qfe(1,mc),Qfe(2,Cu),Qfe(3,lO),Qfe(4,yu),Qfe(5,sc)],n_e);class o_e extends At{constructor(e,t){super(),this.domNode=e,this._register(t)}}function s_e(e){return e&&"object"==typeof e&&(!e.overrideIdentifier||"string"==typeof e.overrideIdentifier)&&(!e.resource||e.resource instanceof uo)}let r_e=class{constructor(e){this.logService=e,this._onDidChangeConfiguration=new Zt,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const t=new Gfe(e);this._configuration=new $ge(t.reload(),Kge.createEmptyModel(e),Kge.createEmptyModel(e),Kge.createEmptyModel(e),Kge.createEmptyModel(e),Kge.createEmptyModel(e),new nd,Kge.createEmptyModel(e),new nd,e),t.dispose()}getValue(e,t){const i="string"==typeof e?e:void 0,n=s_e(e)?e:s_e(t)?t:{};return this._configuration.getValue(i,n,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const t of e){const[e,n]=t;this.getValue(e)!==n&&(this._configuration.updateValue(e,n),i.push(e))}if(i.length>0){const e=new Gge({keys:i,overrides:[]},t,this._configuration,void 0,this.logService);e.source=8,this._onDidChangeConfiguration.fire(e)}return Promise.resolve()}updateValue(e,t,i,n){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}};r_e=Yfe([Qfe(0,yu)],r_e);let a_e=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new Zt,this.configurationService.onDidChangeConfiguration((e=>{this._onDidChangeConfiguration.fire({affectedKeys:e.affectedKeys,affectsConfiguration:(t,i)=>e.affectsConfiguration(i)})}))}getValue(e,t,i){const n=rc.isIPosition(t)?t:null,o=n?"string"==typeof i?i:void 0:"string"==typeof t?t:void 0,s=e?this.getLanguage(e,n):void 0;return void 0===o?this.configurationService.getValue({resource:e,overrideIdentifier:s}):this.configurationService.getValue(o,{resource:e,overrideIdentifier:s})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};a_e=Yfe([Qfe(0,up),Qfe(1,ac),Qfe(2,Tg)],a_e);let l_e=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&"string"==typeof i&&"auto"!==i?i:G||$?"\n":"\r\n"}};l_e=Yfe([Qfe(0,up)],l_e);class d_e{static{this.SCHEME="inmemory"}constructor(){const e=uo.from({scheme:d_e.SCHEME,authority:"model",path:"/"});this.workspace={id:kT,folders:[new xT({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===d_e.SCHEME?this.workspace.folders[0]:null}}function h_e(e,t,i){if(!t)return;if(!(e instanceof r_e))return;const n=[];Object.keys(t).forEach((e=>{(function(e){return xP()[`editor.${e}`]||!1})(e)&&n.push([`editor.${e}`,t[e]]),i&&function(e){return xP()[`diffEditor.${e}`]||!1}(e)&&n.push([`diffEditor.${e}`,t[e]])})),n.length>0&&e.updateValues(n)}let c_e=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const i=Array.isArray(e)?e:OD.convert(e),n=new Map;for(const e of i){if(!(e instanceof PD))throw new Error("bad edit - only text edits are supported");const t=this._modelService.getModel(e.resource);if(!t)throw new Error("bad edit - model not found");if("number"==typeof e.versionId&&t.getVersionId()!==e.versionId)throw new Error("bad state - model changed in the meantime");let i=n.get(t);i||(i=[],n.set(t,i)),i.push(qZ.replaceMove(Yu.lift(e.textEdit.range),e.textEdit.text))}let o=0,s=0;for(const[e,t]of n)e.pushStackElement(),e.pushEditOperations([],t,(()=>[])),e.pushStackElement(),s+=1,o+=t.length;return{ariaSummary:Bi(G7.bulkEditServiceSummary,o,s),isApplied:o>0}}};c_e=Yfe([Qfe(0,ac)],c_e);let u_e=class extends Age{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const e=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();e&&(t=e.getContainerDomNode())}return super.showContextView(e,t,i)}};u_e=Yfe([Qfe(0,HR),Qfe(1,sc)],u_e);let g_e=class extends Npe{constructor(e,t,i,n,o,s){super(e,t,i,n,o,s),this.configure({blockMouse:!1})}};g_e=Yfe([Qfe(0,Cu),Qfe(1,lO),Qfe(2,LR),Qfe(3,ER),Qfe(4,pu),Qfe(5,eu)],g_e);const p_e={esmModuleLocation:void 0,label:"editorWorkerService"};let m_e=class extends wue{constructor(e,t,i,n,o){super(p_e,e,t,i,n,o)}};var f_e;m_e=Yfe([Qfe(0,ac),Qfe(1,Oae),Qfe(2,yu),Qfe(3,Qp),Qfe(4,BD)],m_e),wp(yu,class extends Zfe{constructor(){super(new Eu)}},0),wp(up,r_e,0),wp(Oae,a_e,0),wp(Pae,l_e,0),wp(CT,d_e,0),wp(C0,class{getUriLabel(e,t){return"file"===e.scheme?e.fsPath:e.path}getUriBasenameLabel(e){return Bh(e)}},0),wp(Cu,class{publicLog2(){}},0),wp(Xre,class{async confirm(e){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}}doConfirm(e,t){let i=e;return t&&(i=i+"\n\n"+t),r.confirm(i)}async prompt(e){let t;if(this.doConfirm(e.message,e.detail)){const i=[...e.buttons??[]];e.cancelButton&&"string"!=typeof e.cancelButton&&"boolean"!=typeof e.cancelButton&&i.push(e.cancelButton),t=await(i[0]?.run({checkboxChecked:!1}))}return{result:t}}async error(e,t){await this.prompt({type:rO.Error,message:e,detail:t})}},0),wp(Pq,class{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}},0),wp(lO,t_e,0),wp(ZP,$fe,0),wp(Tg,class extends fpe{constructor(){super()}},0),wp(fse,class extends At{constructor(){super(),this._onColorThemeChange=this._register(new Zt),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new Zt),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new Qle,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Xle,ade(Xle)),this._knownThemes.set(Jle,ade(Jle)),this._knownThemes.set(ede,ade(ede)),this._knownThemes.set(tde,ade(tde));const e=this._register(function(e){const t=new Mt,i=t.add(new Zt),n=wF();return t.add(n.onDidChange((()=>i.fire()))),e&&t.add(e.onDidProductIconThemeChange((()=>i.fire()))),{dispose:()=>t.dispose(),onDidChange:i.event,getCSS(){const t=e?e.getProductIconTheme():new Qle,i={},o=new xM,s=new xM;for(const e of n.getIcons()){const n=t.getIcon(e);if(!n)continue;const r=n.font,a=SM`--vscode-icon-${yM(e.id)}-font-family`,l=SM`--vscode-icon-${yM(e.id)}-content`;r?(i[r.id]=r.definition,s.push(SM`${a}: ${wM(r.id)};`,SM`${l}: ${wM(n.fontCharacter)};`),o.push(SM`.codicon-${yM(e.id)}:before { content: ${wM(n.fontCharacter)}; font-family: ${wM(r.id)}; }`)):(s.push(SM`${l}: ${wM(n.fontCharacter)}; ${a}: 'codicon';`),o.push(SM`.codicon-${yM(e.id)}:before { content: ${wM(n.fontCharacter)}; }`))}for(const e in i){const t=i[e],n=t.weight?SM`font-weight: ${bM(t.weight)};`:SM``,s=t.style?SM`font-style: ${bM(t.style)};`:SM``,r=new xM;for(const e of t.src)r.push(SM`${CM(e.location)} format(${wM(e.format)})`);o.push(SM`@font-face { src: ${r.join(", ")}; font-family: ${wM(e)};${n}${s} font-display: block; }`)}return o.push(SM`:root { ${s.join(" ")} }`),o.join("\n")}}}(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Xle),this._onOSSchemeChanged(),this._register(e.onDidChange((()=>{this._codiconCSS=e.getCSS(),this._updateCSS()}))),l(r,"(forced-colors: active)",(()=>{this._onOSSchemeChanged()}))}registerEditorContainer(e){return Ba(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=DM(void 0,(e=>{e.className="monaco-colors",e.textContent=this._allCSS})),this._styleElements.push(this._globalStyleElement)),At.None}_registerShadowDomContainer(e){const t=DM(e,(e=>{e.className="monaco-colors",e.textContent=this._allCSS}));return this._styleElements.push(t),{dispose:()=>{for(let e=0;e<this._styleElements.length;e++)if(this._styleElements[e]===t)return void this._styleElements.splice(e,1)}}}defineTheme(e,t){if(!/^[a-z0-9\-]+$/i.test(e))throw new Error("Illegal theme name!");if(!sde(t.base)&&!sde(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new ode(e,t)),sde(e)&&this._knownThemes.forEach((t=>{t.base===e&&t.notifyBaseUpdated()})),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;t=this._knownThemes.has(e)?this._knownThemes.get(e):this._knownThemes.get(Xle),this._updateActualTheme(t)}_updateActualTheme(e){e&&this._theme!==e&&(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=r.matchMedia("(forced-colors: active)").matches;if(e!==nw(this._theme.type)){let t;t=ow(this._theme.type)?e?ede:Jle:e?tde:Xle,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:i=>{t[i]||(e.push(i),t[i]=!0)}};nde.getThemingParticipants().forEach((e=>e(this._theme,i,this._environment)));const n=[];for(const e of ide.getColors()){const t=this._theme.getColor(e.id,!0);t&&n.push(`${Mf(e.id)}: ${t.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${n.join("\n")} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(function(e){const t=[];for(let i=1,n=e.length;i<n;i++){const n=e[i];t[i]=`.mtk${i} { color: ${n}; }`}return t.push(".mtki { font-style: italic; }"),t.push(".mtkb { font-weight: bold; }"),t.push(".mtku { text-decoration: underline; text-underline-position: under; }"),t.push(".mtks { text-decoration: line-through; }"),t.push(".mtks.mtku { text-decoration: underline line-through; text-underline-position: under; }"),t.join("\n")}(o)),i.addRule(".monaco-editor, .monaco-diff-editor, .monaco-component { forced-color-adjust: none; }"),this._themeCSS=e.join("\n"),this._updateCSS(),JS.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._styleElements.forEach((e=>e.textContent=this._allCSS))}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}},0),wp(ac,qpe,0),wp(WF,Bpe,0),wp(eu,Ffe,0),wp(vD,class{withProgress(e,t,i){return t({report:()=>{}})}},0),wp(wD,e_e,0),wp(Sq,class extends kq{constructor(){super(),this.applicationStorage=this._register(new wq(new Cq,{hint:vq.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new wq(new Cq,{hint:vq.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new wq(new Cq,{hint:vq.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage((e=>this.emitDidChangeValue(1,e)))),this._register(this.profileStorage.onDidChangeStorage((e=>this.emitDidChangeValue(0,e)))),this._register(this.applicationStorage.onDidChangeStorage((e=>this.emitDidChangeValue(-1,e))))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}shouldFlushWhenIdle(){return!1}},0),wp(Xq,m_e,0),wp(RD,c_e,0),wp(xde,class{constructor(){this._neverEmitter=new Zt,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}},0),wp(lc,Jfe,0),wp(rB,Sfe,0),wp(nJ,class{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new Mt,this.lists=[],this._lastFocusedWidget=void 0}setLastFocusedList(e){e!==this._lastFocusedWidget&&(this._lastFocusedWidget?.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,this._lastFocusedWidget?.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this.lists.some((t=>t.widget===e)))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),Ha(e.getHTMLElement())&&this.setLastFocusedList(e),Nt(e.onDidFocus((()=>this.setLastFocusedList(e))),Tt((()=>this.lists.splice(this.lists.indexOf(i),1))),e.onDidDispose((()=>{this.lists=this.lists.filter((e=>e!==i)),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)})))}dispose(){this.disposables.dispose()}},0),wp(mc,i_e,0),wp(ER,n_e,0),wp(LD,bfe,0),wp(LR,u_e,0),wp(ZI,Ppe,0),wp(oD,Dfe,0),wp(DR,g_e,0),wp(pu,Y$,0),wp(kP,class{async playSignal(e,t){}},0),wp(Sx,class{getParserClass(){throw new Error("getParserClass is not implemented in StandaloneTreeSitterLibraryService")}supportsLanguage(e,t){return!1}getLanguage(e,t){}getInjectionQueries(e,t){return null}getHighlightingQueries(e,t){return null}},0),wp(Su,class extends Iu{constructor(){super(xu.Off,uo.parse("log:///log"))}doCreateLogger(e,t,i){return new Tu}},0),wp(eee,class{getDataChannel(e){return{sendData:()=>{}}}},0),function(e){const t=new Xj;for(const[e,i]of Cp())t.set(e,i);const i=new zfe(t,!0);t.set(nc,i),e.get=function(e){n||s({});const o=t.get(e);if(!o)throw new Error("Missing service "+e);return o instanceof vp?i.invokeFunction((t=>t.get(e))):o};let n=!1;const o=new Zt;function s(e){if(n)return i;n=!0;for(const[e,i]of Cp())t.get(e)||t.set(e,i);for(const i in e)if(e.hasOwnProperty(i)){const n=oc(i);t.get(n)instanceof vp&&t.set(n,e[i])}const s=$q();for(const e of s)try{i.createInstance(e)}catch(e){Ie(e)}return o.fire(),i}e.initialize=s,e.withServices=function(e){if(n)return e();const t=new Mt,i=t.add(o.event((()=>{i.dispose(),t.add(e())})));return t}}(f_e||(f_e={}));var __e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},v_e=function(e,t){return function(i,n){t(i,n,e)}};let b_e=0,w_e=!1;let C_e=class extends tq{constructor(e,t,i,n,o,s,a,l,d,h,c,u,g){const p={...t};p.ariaLabel=p.ariaLabel||q7.editorViewAccessibleLabel,super(e,p,{},i,n,o,s,d,h,c,u,g),this._standaloneKeybindingService=l instanceof n_e?l:null,function(e){if(!e){if(w_e)return;w_e=!0}!function(e){jl=document.createElement("div"),jl.className="monaco-aria-container";const t=()=>{const e=document.createElement("div");return e.className="monaco-alert",e.setAttribute("role","alert"),e.setAttribute("aria-atomic","true"),jl.appendChild(e),e};ql=t(),$l=t();const i=()=>{const e=document.createElement("div");return e.className="monaco-status",e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true"),jl.appendChild(e),e};Gl=i(),Zl=i(),e.appendChild(jl)}(e||r.document.body)}(p.ariaContainerElement),eM=(e,t)=>i.createInstance(sZ,e,{instantHover:t},{}),aM=a}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const n="DYNAMIC_"+ ++b_e,o=Ac.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,o),n}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),At.None;const t=e.id,i=e.label,n=Ac.and(Ac.equals("editorId",this.getId()),Ac.deserialize(e.precondition)),o=e.keybindings,s=Ac.and(n,Ac.deserialize(e.keybindingContext)),r=e.contextMenuGroupId||null,a=e.contextMenuOrder||0,l=(t,...i)=>Promise.resolve(e.run(this,...i)),d=new Mt,h=this.getId()+":"+t;if(d.add(fc.registerCommand(h,l)),r){const e={command:{id:h,title:i},when:n,group:r,order:a};d.add(fu.appendMenuItem(gu.EditorContext,e))}if(Array.isArray(o))for(const e of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(h,e,l,s));const c=new uK(h,i,i,void 0,n,((...t)=>Promise.resolve(e.run(this,...t))),this._contextKeyService);return this._actions.set(t,c),d.add(Tt((()=>{this._actions.delete(t)}))),d}_triggerCommand(e,t){if(this._codeEditorService instanceof Yue)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};C_e=__e([v_e(2,nc),v_e(3,sc),v_e(4,mc),v_e(5,eu),v_e(6,oZ),v_e(7,ER),v_e(8,sw),v_e(9,lO),v_e(10,rB),v_e(11,Qp),v_e(12,BD)],C_e);let y_e=class extends C_e{constructor(e,t,i,n,o,s,r,a,l,d,h,c,u,g,p,m){const f={...t};h_e(h,f,!1);const _=l.registerEditorContainer(e);"string"==typeof f.theme&&l.setTheme(f.theme),void 0!==f.autoDetectHighContrast&&l.setAutoDetectHighContrast(Boolean(f.autoDetectHighContrast));const v=f.model;let b;if(delete f.model,super(e,f,i,n,o,s,r,a,l,d,c,p,m),this._configurationService=h,this._standaloneThemeService=l,this._register(_),void 0===v){const e=g.getLanguageIdByMimeType(f.language)||f.language||Up;b=x_e(u,g,f.value||"",e,void 0),this._ownsModel=!0}else b=v,this._ownsModel=!1;if(this._attachModel(b),b){const e={oldModelUrl:null,newModelUrl:b.uri};this._onDidChangeModel.fire(e)}}dispose(){super.dispose()}updateOptions(e){h_e(this._configurationService,e,!1),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};y_e=__e([v_e(2,nc),v_e(3,sc),v_e(4,mc),v_e(5,eu),v_e(6,oZ),v_e(7,ER),v_e(8,fse),v_e(9,lO),v_e(10,up),v_e(11,rB),v_e(12,ac),v_e(13,Tg),v_e(14,Qp),v_e(15,BD)],y_e);let S_e=class extends O5{constructor(e,t,i,n,o,s,r,a,l,d,h,c){const u={...t};h_e(a,u,!0);const g=s.registerEditorContainer(e);"string"==typeof u.theme&&s.setTheme(u.theme),void 0!==u.autoDetectHighContrast&&s.setAutoDetectHighContrast(Boolean(u.autoDetectHighContrast)),super(e,u,{},n,i,o,c,d),this._configurationService=a,this._standaloneThemeService=s,this._register(g)}dispose(){super.dispose()}updateOptions(e){h_e(this._configurationService,e,!0),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(C_e,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};function x_e(e,t,i,n,o){if(i=i||"",!n){const n=i.indexOf("\n");let s=i;return-1!==n&&(s=i.substring(0,n)),k_e(e,i,t.createByFilepathOrFirstLine(o||null,s),o)}return k_e(e,i,t.createById(n),o)}function k_e(e,t,i,n){return e.createModel(t,i,n)}S_e=__e([v_e(2,nc),v_e(3,eu),v_e(4,sc),v_e(5,fse),v_e(6,lO),v_e(7,up),v_e(8,DR),v_e(9,wD),v_e(10,oD),v_e(11,kP)],S_e),Ff("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},y(139,"The background color of the diff editor's header")),Ff("multiDiffEditor.background",a_,y(140,"The background color of the multi file diff editor")),Ff("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},y(141,"The border color of the multi file diff editor"));var L_e=function(e,t){return function(i,n){t(i,n,e)}};class D_e{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let E_e=class extends At{constructor(e,t,i,n,o){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=Js(this,void 0),this._collapsed=pr(this,(e=>this._viewModel.read(e)?.collapsed.read(e))),this._editorContentHeight=Js(this,500),this.contentHeight=pr(this,(e=>(this._collapsed.read(e)?0:this._editorContentHeight.read(e))+this._outerEditorHeight)),this._modifiedContentWidth=Js(this,0),this._modifiedWidth=Js(this,0),this._originalContentWidth=Js(this,0),this._originalWidth=Js(this,0),this.maxScroll=pr(this,(e=>{const t=this._modifiedContentWidth.read(e)-this._modifiedWidth.read(e),i=this._originalContentWidth.read(e)-this._originalWidth.read(e);return t>i?{maxScroll:t,width:this._modifiedWidth.read(e)}:{maxScroll:i,width:this._originalWidth.read(e)}})),this._elements=fl("div.multiDiffEntry",[fl("div.header@header",[fl("div.header-content",[fl("div.collapse-button@collapseButton"),fl("div.file-path",[fl("div.title.modified.show-file-icons@primaryPath",[]),fl("div.status.deleted@status",["R"]),fl("div.title.original.show-file-icons@secondaryPath",[])]),fl("div.actions@actions")])]),fl("div.editorParent",[fl("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(O5,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=bY(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=bY(this.editor.getOriginalEditor()).isFocused,this.isFocused=pr(this,(e=>this.isModifedFocused.read(e)||this.isOriginalFocused.read(e))),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=this._register(new Mt),this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const s=new hM(this._elements.collapseButton,{});this._register(ar((e=>{s.element.className="",s.icon=this._collapsed.read(e)?fh.chevronRight:fh.chevronDown}))),this._register(s.onDidClick((()=>{this._viewModel.get()?.collapsed.set(!this._collapsed.get(),void 0)}))),this._register(ar((e=>{this._elements.editor.style.display=this._collapsed.read(e)?"none":"block"}))),this._register(this.editor.getModifiedEditor().onDidLayoutChange((e=>{const t=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(t,void 0)}))),this._register(this.editor.getOriginalEditor().onDidLayoutChange((e=>{const t=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(t,void 0)}))),this._register(this.editor.onDidContentSizeChange((e=>{Hs((t=>{this._editorContentHeight.set(e.contentHeight,t),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),t),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),t)}))}))),this._register(this.editor.getOriginalEditor().onDidScrollChange((e=>{if(this._isSettingScrollTop)return;if(!e.scrollTopChanged||!this._data)return;const t=e.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(t)}))),this._register(ar((e=>{const t=this._viewModel.read(e)?.isActive.read(e);this._elements.root.classList.toggle("active",t)}))),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._contextKeyService=this._register(o.createScoped(this._elements.actions));const r=this._register(this._instantiationService.createChild(new Xj([eu,this._contextKeyService])));this._register(r.createInstance(aG,this._elements.actions,gu.MultiDiffEditorFileToolbar,{actionRunner:this._register(new f5((()=>this._viewModel.get()?.modifiedUri))),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:e=>e.startsWith("navigation")},actionViewItemProvider:(e,t)=>H$(r,e,t)}))}setScrollLeft(e){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(e):this.editor.getOriginalEditor().setScrollLeft(e)}setData(e){function t(e){return{...e,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}if(this._data=e,!e)return void Hs((e=>{this._viewModel.set(void 0,e),this.editor.setDiffModel(null,e),this._dataStore.clear()}));const i=e.viewModel.documentDiffItem;if(Hs((n=>{this._resourceLabel?.setUri(e.viewModel.modifiedUri??e.viewModel.originalUri,{strikethrough:void 0===e.viewModel.modifiedUri});let o=!1,s=!1,r=!1,a="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(a="R",o=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(a="A",r=!0):(a="D",s=!0),this._elements.status.classList.toggle("renamed",o),this._elements.status.classList.toggle("deleted",s),this._elements.status.classList.toggle("added",r),this._elements.status.innerText=a,this._resourceLabel2?.setUri(o?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,n),this.editor.setDiffModel(e.viewModel.diffEditorViewModelRef,n),this.editor.updateOptions(t(i.options??{}))})),i.onOptionsDidChange&&this._dataStore.add(i.onOptionsDidChange((()=>{this.editor.updateOptions(t(i.options??{}))}))),e.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore,(e=>{e||this.setData(void 0)})),e.viewModel.documentDiffItem.contextKeys)for(const[t,i]of Object.entries(e.viewModel.documentDiffItem.contextKeys))this._contextKeyService.createKey(t,i)}render(e,t,i,n){this._elements.root.style.visibility="visible",this._elements.root.style.top=`${e.start}px`,this._elements.root.style.height=`${e.length}px`,this._elements.root.style.width=`${t}px`,this._elements.root.style.position="absolute";const o=e.length-this._headerHeight,s=Math.max(0,Math.min(n.start-e.start,o));this._elements.header.style.transform=`translateY(${s}px)`,Hs((i=>{this.editor.layout({width:t-16-2,height:e.length-this._outerEditorHeight})}));try{this._isSettingScrollTop=!0,this._lastScrollTop=i,this.editor.getOriginalEditor().setScrollTop(i)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",s>0||i>0),this._elements.header.classList.toggle("collapsed",s===o)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};E_e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([L_e(3,nc),L_e(4,eu)],E_e);class N_e{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){let t;if(0===this._unused.size)t=this._create(e),this._itemData.set(t,e);else{const i=[...this._unused.values()];t=i.find((t=>this._itemData.get(t).getId()===e.getId()))??i[0],this._unused.delete(t),this._itemData.set(t,e),t.setData(e)}return this._used.add(t),{object:t,dispose:()=>{this._used.delete(t),this._unused.size>5?t.dispose():this._unused.add(t)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}var I_e=i(6514),T_e={};T_e.styleTagTransform=zl(),T_e.setAttributes=Bl(),T_e.insert=Pl().bind(null,"head"),T_e.domAPI=Rl(),T_e.insertStyleElement=Vl(),Ml()(I_e.A,T_e),I_e.A&&I_e.A.locals&&I_e.A.locals;var M_e=function(e,t){return function(i,n){t(i,n,e)}};let A_e=class extends At{constructor(e,t,i,n,o,s){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=n,this._parentContextKeyService=o,this._parentInstantiationService=s,this._scrollableElements=fl("div.scrollContent",[fl("div@content",{style:{overflow:"hidden"}}),fl("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new QM({forceIntegerValues:!1,scheduleAtNextAnimationFrame:e=>Ca(ta(this._element),e),smoothScrollDuration:100})),this._scrollableElement=this._register(new lA(this._scrollableElements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this._elements=fl("div.monaco-component.multiDiffEditor",{},[fl("div",{},[this._scrollableElement.getDomNode()]),fl("div.placeholder@placeholder",{},[fl("div")])]),this._sizeObserver=this._register(new c2(this._element,void 0)),this._objectPool=this._register(new N_e((e=>{const t=this._instantiationService.createInstance(E_e,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return t.setData(e),t}))),this.scrollTop=Sr(this,this._scrollableElement.onScroll,(()=>this._scrollableElement.getScrollPosition().scrollTop)),this.scrollLeft=Sr(this,this._scrollableElement.onScroll,(()=>this._scrollableElement.getScrollPosition().scrollLeft)),this._viewItemsInfo=pr(this,(e=>{const t=this._viewModel.read(e);if(!t)return{items:[],getItem:e=>{throw new Ve}};const i=t.items.read(e),n=new Map,o=i.map((t=>{const i=e.store.add(new R_e(t,this._objectPool,this.scrollLeft,(e=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+e})}))),o=this._lastDocStates?.[i.getKey()];return o&&Vs((e=>{i.setViewState(o,e)})),n.set(t,i),i}));return{items:o,getItem:e=>n.get(e)}})),this._viewItems=this._viewItemsInfo.map(this,(e=>e.items)),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,((e,t)=>e.reduce(((e,i)=>e+i.contentHeight.read(t)+this._spaceBetweenPx),0))),this.activeControl=pr(this,(e=>{const t=this._viewModel.read(e)?.activeDiffItem.read(e);if(!t)return;const i=this._viewItemsInfo.read(e).getItem(t);return i.template.read(e)?.editor})),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new Xj([eu,this._contextKeyService]))),this._lastDocStates={},this._register(hr(((e,t)=>{const i=this._viewModel.read(e);if(i&&i.contextKeys)for(const[e,n]of Object.entries(i.contextKeys)){const i=this._contextKeyService.createKey(e,void 0);i.set(n),t.add(Tt((()=>i.reset())))}})));const r=this._parentContextKeyService.createKey(Xu.multiDiffEditorAllCollapsed.key,!1);this._register(ar((e=>{const t=this._viewModel.read(e);if(t){const i=t.items.read(e).every((t=>t.collapsed.read(e)));r.set(i)}}))),this._register(ar((e=>{const t=this._dimension.read(e);this._sizeObserver.observe(t)})));const a=pr((e=>{if(this._viewItems.read(e).length>0)return;const t=this._viewModel.read(e);return!t||t.isLoading.read(e)?y(142,"Loading..."):y(143,"No Changed Files")}));this._register(ar((e=>{const t=a.read(e);this._elements.placeholder.innerText=t??"",this._elements.placeholder.classList.toggle("visible",!!t)}))),this._scrollableElements.content.style.position="relative",this._register(ar((e=>{const t=this._sizeObserver.height.read(e);this._scrollableElements.root.style.height=`${t}px`;const i=this._totalHeight.read(e);this._scrollableElements.content.style.height=`${i}px`;const n=this._sizeObserver.width.read(e);let o=n;const s=vm(this._viewItems.read(e),Cs((t=>t.maxScroll.read(e).maxScroll),ys));s&&(o=n+s.maxScroll.read(e).maxScroll),this._scrollableElement.setScrollDimensions({width:n,height:t,scrollHeight:i,scrollWidth:o})}))),e.replaceChildren(this._elements.root),this._register(Tt((()=>{e.replaceChildren()}))),this._register(this._register(ar((e=>{Hs((t=>{this.render(e)}))}))))}render(e){const t=this.scrollTop.read(e);let i=0,n=0,o=0;const s=this._sizeObserver.height.read(e),r=cm.ofStartAndLength(t,s),a=this._sizeObserver.width.read(e);for(const l of this._viewItems.read(e)){const d=l.contentHeight.read(e),h=Math.min(d,s),c=cm.ofStartAndLength(n,h),u=cm.ofStartAndLength(o,d);if(u.isBefore(r))i-=d-h,l.hide();else if(u.isAfter(r))l.hide();else{const e=Math.max(0,Math.min(r.start-u.start,d-h));i-=e;const n=cm.ofStartAndLength(t+i,s);l.render(c,e,a,n)}n+=h+this._spaceBetweenPx,o+=d+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(t+i)}px)`}};A_e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([M_e(4,eu),M_e(5,nc)],A_e);class R_e extends At{constructor(e,t,i,n){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=n,this._templateRef=this._register(tr(this,void 0)),this.contentHeight=pr(this,(e=>this._templateRef.read(e)?.object.contentHeight?.read(e)??this.viewModel.lastTemplateData.read(e).contentHeight)),this.maxScroll=pr(this,(e=>this._templateRef.read(e)?.object.maxScroll.read(e)??{maxScroll:0,scrollWidth:0})),this.template=pr(this,(e=>this._templateRef.read(e)?.object)),this._isHidden=Js(this,!1),this._isFocused=pr(this,(e=>this.template.read(e)?.isFocused.read(e)??!1)),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(ar((e=>{const t=this._scrollLeft.read(e);this._templateRef.read(e)?.object.setScrollLeft(t)}))),this._register(ar((e=>{const t=this._templateRef.read(e);t&&this._isHidden.read(e)&&(t.object.isFocused.read(e)||this._clear())})))}dispose(){this._clear(),super.dispose()}toString(){return`VirtualViewItem(${this.viewModel.documentDiffItem.modified?.uri.toString()})`}getKey(){return this.viewModel.getKey()}setViewState(e,t){this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);const i=this.viewModel.lastTemplateData.get(),n=e.selections?.map(Qu.liftSelection);this.viewModel.lastTemplateData.set({...i,selections:n},t);const o=this._templateRef.get();o&&n&&o.object.editor.setSelections(n)}_updateTemplateData(e){const t=this._templateRef.get();t&&this.viewModel.lastTemplateData.set({contentHeight:t.object.contentHeight.get(),selections:t.object.editor.getSelections()??void 0},e)}_clear(){const e=this._templateRef.get();e&&Vs((t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)}))}hide(){this._isHidden.set(!0,void 0)}render(e,t,i,n){this._isHidden.set(!1,void 0);let o=this._templateRef.get();if(!o){o=this._objectPool.getUnusedObj(new D_e(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(o,void 0);const e=this.viewModel.lastTemplateData.get().selections;e&&o.object.editor.setSelections(e)}o.object.render(e,i,t,n)}}let O_e=class extends At{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=Js(this,void 0),this._viewModel=Js(this,void 0),this._widgetImpl=pr(this,(e=>(w$(E_e),e.store.add(this._instantiationService.createInstance(w$(A_e),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory))))),this._register(Nr(this._widgetImpl))}};function P_e(e){const t=f_e.get(ER);return t instanceof n_e?t.addDynamicKeybindings(e.map((e=>({keybinding:e.keybinding,command:e.command,commandArgs:e.commandArgs,when:Ac.deserialize(e.when)})))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),At.None)}function F_e(e,t){return"boolean"==typeof e?e:t}function B_e(e,t){return"string"==typeof e?e:t}function W_e(e,t=!1){t&&(e=e.map((function(e){return e.toLowerCase()})));const i=function(e){const t={};for(const i of e)t[i]=!0;return t}(e);return t?function(e){return void 0!==i[e.toLowerCase()]&&i.hasOwnProperty(e.toLowerCase())}:function(e){return void 0!==i[e]&&i.hasOwnProperty(e)}}function V_e(e,t,i){t=t.replace(/@@/g,"");let n,o=0;do{n=!1,t=t.replace(/@(\w+)/g,(function(i,o){n=!0;let s="";if("string"==typeof e[o])s=e[o];else{if(!(e[o]&&e[o]instanceof RegExp))throw void 0===e[o]?Mue(e,"language definition does not contain attribute '"+o+"', used at: "+t):Mue(e,"attribute reference '"+o+"' must be a string, used at: "+t);s=e[o].source}return Eue(s)?"":"(?:"+s+")"})),o++}while(n&&o<5);t=t.replace(/\x01/g,"@");const s=(e.ignoreCase?"i":"")+(e.unicode?"u":"");if(i&&t.match(/\$[sS](\d\d?)/g)){let i=null,n=null;return o=>(n&&i===o||(i=o,n=new RegExp(function(e,t,i){let n=null;return t.replace(/\$[sS](\d\d?)/g,(function(t,o){return null===n&&(n=i.split("."),n.unshift(i)),!Eue(o)&&o<n.length?Vi(Nue(e,n[o])):""}))}(e,t,o),s)),n)}return new RegExp(t,s)}function H_e(e,t,i,n){let o=-1,s=i,r=i.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);r&&(r[3]&&(o=parseInt(r[3]),r[2]&&(o+=100)),s=r[4]);let a,l="~",d=s;if(s&&0!==s.length?/^\w*$/.test(d)?l="==":(r=s.match(/^(@|!@|~|!~|==|!=)(.*)$/),r&&(l=r[1],d=r[2])):(l="!=",d=""),"~"!==l&&"!~"!==l||!/^(\w|\|)*$/.test(d))if("@"===l||"!@"===l){const i=e[d];if(!i)throw Mue(e,"the @ match target '"+d+"' is not defined, in rule: "+t);if(!function(e,t){if(!t)return!1;if(!Array.isArray(t))return!1;for(const e of t)if("string"!=typeof e)return!1;return!0}(0,i))throw Mue(e,"the @ match target '"+d+"' must be an array of strings, in rule: "+t);const n=W_e(i,e.ignoreCase);a=function(e){return"@"===l?n(e):!n(e)}}else if("~"===l||"!~"===l)if(d.indexOf("$")<0){const t=V_e(e,"^"+d+"$",!1);a=function(e){return"~"===l?t.test(e):!t.test(e)}}else a=function(t,i,n,o){return V_e(e,"^"+Aue(e,d,i,n,o)+"$",!1).test(t)};else if(d.indexOf("$")<0){const t=Nue(e,d);a=function(e){return"=="===l?e===t:e!==t}}else{const t=Nue(e,d);a=function(i,n,o,s,r){const a=Aue(e,t,n,o,s);return"=="===l?i===a:i!==a}}else{const t=W_e(d.split("|"),e.ignoreCase);a=function(e){return"~"===l?t(e):!t(e)}}return-1===o?{name:i,value:n,test:function(e,t,i,n){return a(e,e,t,i,n)}}:{name:i,value:n,test:function(e,t,i,n){const s=function(e,t,i,n){if(n<0)return e;if(n<t.length)return t[n];if(n>=100){n-=100;const e=i.split(".");if(e.unshift(i),n<e.length)return e[n]}return null}(e,t,i,o);return a(s||"",e,t,i,n)}}}function z_e(e,t,i){if(i){if("string"==typeof i)return i;if(i.token||""===i.token){if("string"!=typeof i.token)throw Mue(e,"a 'token' attribute must be of type string, in rule: "+t);{const n={token:i.token};if(i.token.indexOf("$")>=0&&(n.tokenSubst=!0),"string"==typeof i.bracket)if("@open"===i.bracket)n.bracket=1;else{if("@close"!==i.bracket)throw Mue(e,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+t);n.bracket=-1}if(i.next){if("string"!=typeof i.next)throw Mue(e,"the next state must be a string value in rule: "+t);{let o=i.next;if(!/^(@pop|@push|@popall)$/.test(o)&&("@"===o[0]&&(o=o.substr(1)),o.indexOf("$")<0&&!function(e,t){let i=t;for(;i&&i.length>0;){if(e.stateNames[i])return!0;const t=i.lastIndexOf(".");i=t<0?null:i.substr(0,t)}return!1}(e,Aue(e,o,"",[],""))))throw Mue(e,"the next state '"+i.next+"' is not defined in rule: "+t);n.next=o}}return"number"==typeof i.goBack&&(n.goBack=i.goBack),"string"==typeof i.switchTo&&(n.switchTo=i.switchTo),"string"==typeof i.log&&(n.log=i.log),"string"==typeof i.nextEmbedded&&(n.nextEmbedded=i.nextEmbedded,e.usesEmbedded=!0),n}}if(Array.isArray(i)){const n=[];for(let o=0,s=i.length;o<s;o++)n[o]=z_e(e,t,i[o]);return{group:n}}if(i.cases){const n=[];let o=!1;for(const s in i.cases)if(i.cases.hasOwnProperty(s)){const r=z_e(e,t,i.cases[s]);"@default"===s||"@"===s||""===s?n.push({test:void 0,value:r,name:s}):"@eos"===s?n.push({test:function(e,t,i,n){return n},value:r,name:s}):n.push(H_e(e,t,s,r)),o||(o=!lt(r)&&(r.hasEmbeddedEndInCases||["@pop","@popall"].includes(r.nextEmbedded||"")))}const s=e.defaultToken;return{hasEmbeddedEndInCases:o,test:function(e,t,i,o){for(const s of n)if(!s.test||s.test(e,t,i,o))return s.value;return s}}}throw Mue(e,"an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: "+t)}return{token:""}}O_e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(2,nc)],O_e);class U_e{constructor(e){this.regex=new RegExp(""),this.action={token:""},this.matchOnlyAtLineStart=!1,this.name="",this.name=e}setRegex(e,t){let i;if("string"==typeof t)i=t;else{if(!(t instanceof RegExp))throw Mue(e,"rules must start with a match string or regular expression: "+this.name);i=t.source}this.matchOnlyAtLineStart=i.length>0&&"^"===i[0],this.name=this.name+": "+i,this.regex=V_e(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=z_e(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}}function K_e(e,t){if(!t||"object"!=typeof t)throw new Error("Monarch: expecting a language definition object");const i={languageId:e,includeLF:F_e(t.includeLF,!1),noThrow:!1,maxStack:100,start:"string"==typeof t.start?t.start:null,ignoreCase:F_e(t.ignoreCase,!1),unicode:F_e(t.unicode,!1),tokenPostfix:B_e(t.tokenPostfix,"."+e),defaultToken:B_e(t.defaultToken,"source"),usesEmbedded:!1,stateNames:{},tokenizer:{},brackets:[]},n=t;function o(e,s,r){for(const a of r){let r=a.include;if(r){if("string"!=typeof r)throw Mue(i,"an 'include' attribute must be a string at: "+e);if("@"===r[0]&&(r=r.substr(1)),!t.tokenizer[r])throw Mue(i,"include target '"+r+"' is not defined at: "+e);o(e+"."+r,s,t.tokenizer[r])}else{const t=new U_e(e);if(Array.isArray(a)&&a.length>=1&&a.length<=3)if(t.setRegex(n,a[0]),a.length>=3)if("string"==typeof a[1])t.setAction(n,{token:a[1],next:a[2]});else{if("object"!=typeof a[1])throw Mue(i,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+e);{const e=a[1];e.next=a[2],t.setAction(n,e)}}else t.setAction(n,a[1]);else{if(!a.regex)throw Mue(i,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+e);a.name&&"string"==typeof a.name&&(t.name=a.name),a.matchOnlyAtStart&&(t.matchOnlyAtLineStart=F_e(a.matchOnlyAtLineStart,!1)),t.setRegex(n,a.regex),t.setAction(n,a.action)}s.push(t)}}}if(n.languageId=e,n.includeLF=i.includeLF,n.ignoreCase=i.ignoreCase,n.unicode=i.unicode,n.noThrow=i.noThrow,n.usesEmbedded=i.usesEmbedded,n.stateNames=t.tokenizer,n.defaultToken=i.defaultToken,!t.tokenizer||"object"!=typeof t.tokenizer)throw Mue(i,"a language definition must define the 'tokenizer' attribute as an object");i.tokenizer=[];for(const e in t.tokenizer)if(t.tokenizer.hasOwnProperty(e)){i.start||(i.start=e);const n=t.tokenizer[e];i.tokenizer[e]=new Array,o("tokenizer."+e,i.tokenizer[e],n)}if(i.usesEmbedded=n.usesEmbedded,t.brackets){if(!Array.isArray(t.brackets))throw Mue(i,"the 'brackets' attribute must be defined as an array")}else t.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const s=[];for(const e of t.brackets){let t=e;if(t&&Array.isArray(t)&&3===t.length&&(t={token:t[2],open:t[0],close:t[1]}),t.open===t.close)throw Mue(i,"open and close brackets in a 'brackets' attribute must be different: "+t.open+"\n hint: use the 'bracket' attribute if matching on equal brackets is required.");if("string"!=typeof t.open||"string"!=typeof t.token||"string"!=typeof t.close)throw Mue(i,"every element in the 'brackets' array must be a '{open,close,token}' object or array");s.push({token:t.token+i.tokenPostfix,open:Nue(i,t.open),close:Nue(i,t.close)})}return i.brackets=s,i.noThrow=!0,i}class j_e{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if("function"==typeof this._actual.tokenize)return q_e.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new RS(n.tokens,n.endState)}}class q_e{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let o=0,s=e.length;o<s;o++){const s=e[o];let r=s.startIndex;0===o?r=0:r<n&&(r=n),i[o]=new MS(r,s.scopes,t),n=r}return i}static adaptTokenize(e,t,i,n){const o=t.tokenize(i,n),s=q_e._toClassicTokens(o.tokens,e);let r;return r=o.endState.equals(n)?n:o.endState,new AS(s,r)}tokenize(e,t,i){return q_e.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),n=this._standaloneThemeService.getColorTheme().tokenTheme,o=[];let s=0,r=0;for(let e=0,a=t.length;e<a;e++){const a=t[e],l=1024|n.match(i,a.scopes);if(s>0&&o[s-1]===l)continue;let d=a.startIndex;0===e?d=0:d<r&&(d=r),o[s++]=d,o[s++]=l,r=d}const a=new Uint32Array(s);for(let e=0;e<s;e++)a[e]=o[e];return a}tokenizeEncoded(e,t,i){const n=this._actual.tokenize(e,i),o=this._toBinaryTokens(this._languageService.languageIdCodec,n.tokens);let s;return s=n.endState.equals(i)?i:n.endState,new RS(o,s)}}function $_e(e){return e&&"function"==typeof e.then}function G_e(e,t){return function(e){return"tokenizeEncoded"in e}(t)?new j_e(e,t):new q_e(e,t,f_e.get(Tg),f_e.get(fse))}function Z_e(e,t){const i=new XS((async()=>{const i=await Promise.resolve(t.create());return i?function(e){return"function"==typeof e.getInitialState}(i)?G_e(e,i):new Uue(f_e.get(Tg),f_e.get(fse),e,K_e(e,i),f_e.get(up)):null}));return JS.registerFactory(e,i)}bP.wrappingIndent.defaultValue=0,bP.glyphMargin.defaultValue=!1,bP.autoIndent.defaultValue=3,bP.overviewRulerLanes.defaultValue=2,Z9.setFormatterSelector(((e,t,i)=>Promise.resolve(e[0])));const Y_e=Mce();Y_e.editor={create:function(e,t,i){return f_e.initialize(i||{}).createInstance(y_e,e,t)},getEditors:function(){return f_e.get(sc).listCodeEditors()},getDiffEditors:function(){return f_e.get(sc).listDiffEditors()},onDidCreateEditor:function(e){return f_e.get(sc).onCodeEditorAdd((t=>{e(t)}))},onDidCreateDiffEditor:function(e){return f_e.get(sc).onDiffEditorAdd((t=>{e(t)}))},createDiffEditor:function(e,t,i){return f_e.initialize(i||{}).createInstance(S_e,e,t)},addCommand:function(e){if("string"!=typeof e.id||"function"!=typeof e.run)throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return fc.registerCommand(e.id,e.run)},addEditorAction:function(e){if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const t=Ac.deserialize(e.precondition),i=new Mt;if(i.add(fc.registerCommand(e.id,((i,...n)=>Ou.runEditorCommand(i,n,t,((t,i,n)=>Promise.resolve(e.run(i,...n))))))),e.contextMenuGroupId){const n={command:{id:e.id,title:e.label},when:t,group:e.contextMenuGroupId,order:e.contextMenuOrder||0};i.add(fu.appendMenuItem(gu.EditorContext,n))}if(Array.isArray(e.keybindings)){const n=f_e.get(ER);if(n instanceof n_e){const o=Ac.and(t,Ac.deserialize(e.keybindingContext));i.add(n.addDynamicKeybindings(e.keybindings.map((t=>({keybinding:t,command:e.id,when:o})))))}else console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService")}return i},addKeybindingRule:function(e){return P_e([e])},addKeybindingRules:P_e,createModel:function(e,t,i){const n=f_e.get(Tg),o=n.getLanguageIdByMimeType(t)||t;return x_e(f_e.get(ac),n,e,o,i)},setModelLanguage:function(e,t){const i=f_e.get(Tg),n=i.getLanguageIdByMimeType(t)||t||Up;e.setLanguage(i.createById(n))},setModelMarkers:function(e,t,i){e&&f_e.get(ZP).changeOne(t,e.uri,i)},getModelMarkers:function(e){return f_e.get(ZP).read(e)},removeAllMarkers:function(e){f_e.get(ZP).changeAll(e,[])},onDidChangeMarkers:function(e){return f_e.get(ZP).onMarkerChanged(e)},getModels:function(){return f_e.get(ac).getModels()},getModel:function(e){return f_e.get(ac).getModel(e)},onDidCreateModel:function(e){return f_e.get(ac).onModelAdded(e)},onWillDisposeModel:function(e){return f_e.get(ac).onModelRemoved(e)},onDidChangeModelLanguage:function(e){return f_e.get(ac).onModelLanguageChanged((t=>{e({model:t.model,oldLanguage:t.oldLanguageId})}))},createWebWorker:function(e){return function(e,t){return new kue(e,t)}(f_e.get(ac),e)},colorizeElement:function(e,t){const i=f_e.get(Tg),n=f_e.get(fse);return que.colorizeElement(n,i,e,t).then((()=>{n.registerEditorContainer(e)}))},colorize:function(e,t,i){const n=f_e.get(Tg);return f_e.get(fse).registerEditorContainer(r.document.body),que.colorize(n,e,t,i)},colorizeModelLine:function(e,t,i=4){return f_e.get(fse).registerEditorContainer(r.document.body),que.colorizeModelLine(e,t,i)},tokenize:function(e,t){JS.getOrCreate(t);const i=function(e){return JS.get(e)||{getInitialState:()=>ex,tokenize:(t,i,n)=>tx(e,n)}}(t),n=qi(e),o=[];let s=i.getInitialState();for(let e=0,t=n.length;e<t;e++){const t=n[e],r=i.tokenize(t,!0,s);o[e]=r.tokens,s=r.endState}return o},defineTheme:function(e,t){f_e.get(fse).defineTheme(e,t)},setTheme:function(e){f_e.get(fse).setTheme(e)},remeasureFonts:function(){eB.clearAllFontInfos()},registerCommand:function(e,t){return fc.registerCommand({id:e,handler:t})},registerLinkOpener:function(e){return f_e.get(ZI).registerOpener({open:async t=>("string"==typeof t&&(t=uo.parse(t)),e.open(t))})},registerEditorOpener:function(e){return f_e.get(sc).registerCodeEditorOpenHandler((async(t,i,n)=>{if(!i)return null;const o=t.options?.selection;let s;return o&&"number"==typeof o.endLineNumber&&"number"==typeof o.endColumn?s=o:o&&(s={lineNumber:o.startLineNumber,column:o.startColumn}),await e.openCodeEditor(i,t.resource,s)?i:null}))},AccessibilitySupport:Fhe,ContentWidgetPositionPreference:Uhe,CursorChangeReason:Khe,DefaultEndOfLine:jhe,EditorAutoIndentStrategy:$he,EditorOption:Ghe,EndOfLinePreference:Zhe,EndOfLineSequence:Yhe,MinimapPosition:lce,MinimapSectionHeaderStyle:dce,MouseTargetType:hce,OverlayWidgetPositionPreference:gce,OverviewRulerLane:pce,GlyphMarginLane:Qhe,RenderLineNumbersType:_ce,RenderMinimap:vce,ScrollbarVisibility:wce,ScrollType:bce,TextEditorCursorBlinkingStyle:Dce,TextEditorCursorStyle:Ece,TrackedRangeStickiness:Nce,WrappingIndent:Ice,InjectedTextCursorStops:ece,PositionAffinity:fce,ShowLightbulbIconMode:yce,TextDirection:Lce,ConfigurationChangedEvent:RO,BareFontInfo:QF,FontInfo:XF,TextModelResolvedOptions:fg,FindMatch:_g,ApplyUpdateResult:FO,EditorZoom:ZF,createMultiFileDiffEditor:function(e,t){const i=f_e.initialize(t||{});return new O_e(e,{},i)},EditorType:gK,EditorOptions:bP},Y_e.languages={register:function(e){zp.registerLanguage(e)},getLanguages:function(){let e=[];return e=e.concat(zp.getLanguages()),e},onLanguage:function(e,t){return f_e.withServices((()=>{const i=f_e.get(Tg).onDidRequestRichLanguageFeatures((n=>{n===e&&(i.dispose(),t())}));return i}))},onLanguageEncountered:function(e,t){return f_e.withServices((()=>{const i=f_e.get(Tg).onDidRequestBasicLanguageFeatures((n=>{n===e&&(i.dispose(),t())}));return i}))},getEncodedLanguageId:function(e){return f_e.get(Tg).languageIdCodec.encodeLanguageId(e)},setLanguageConfiguration:function(e,t){if(!f_e.get(Tg).isRegisteredLanguageId(e))throw new Error(`Cannot set configuration for unknown language ${e}`);return f_e.get(Qp).register(e,t,100)},setColorMap:function(e){const t=f_e.get(fse);if(e){const i=[null];for(let t=1,n=e.length;t<n;t++)i[t]=Lg.fromHex(e[t]);t.setColorMapOverride(i)}else t.setColorMapOverride(null)},registerTokensProviderFactory:Z_e,setTokensProvider:function(e,t){if(!f_e.get(Tg).isRegisteredLanguageId(e))throw new Error(`Cannot set tokens provider for unknown language ${e}`);return $_e(t)?Z_e(e,{create:()=>t}):JS.register(e,G_e(e,t))},setMonarchTokensProvider:function(e,t){return $_e(t)?Z_e(e,{create:()=>t}):JS.register(e,(t=>new Uue(f_e.get(Tg),f_e.get(fse),e,K_e(e,t),f_e.get(up)))(t))},registerReferenceProvider:function(e,t){return f_e.get(BD).referenceProvider.register(e,t)},registerRenameProvider:function(e,t){return f_e.get(BD).renameProvider.register(e,t)},registerNewSymbolNameProvider:function(e,t){return f_e.get(BD).newSymbolNamesProvider.register(e,t)},registerCompletionItemProvider:function(e,t){return f_e.get(BD).completionProvider.register(e,t)},registerSignatureHelpProvider:function(e,t){return f_e.get(BD).signatureHelpProvider.register(e,t)},registerHoverProvider:function(e,t){return f_e.get(BD).hoverProvider.register(e,{provideHover:async(e,i,n,o)=>{const s=e.getWordAtPosition(i);return Promise.resolve(t.provideHover(e,i,n,o)).then((e=>{if(e)return!e.range&&s&&(e.range=new Yu(i.lineNumber,s.startColumn,i.lineNumber,s.endColumn)),e.range||(e.range=new Yu(i.lineNumber,i.column,i.lineNumber,i.column)),e}))}})},registerDocumentSymbolProvider:function(e,t){return f_e.get(BD).documentSymbolProvider.register(e,t)},registerDocumentHighlightProvider:function(e,t){return f_e.get(BD).documentHighlightProvider.register(e,t)},registerLinkedEditingRangeProvider:function(e,t){return f_e.get(BD).linkedEditingRangeProvider.register(e,t)},registerDefinitionProvider:function(e,t){return f_e.get(BD).definitionProvider.register(e,t)},registerImplementationProvider:function(e,t){return f_e.get(BD).implementationProvider.register(e,t)},registerTypeDefinitionProvider:function(e,t){return f_e.get(BD).typeDefinitionProvider.register(e,t)},registerCodeLensProvider:function(e,t){return f_e.get(BD).codeLensProvider.register(e,t)},registerCodeActionProvider:function(e,t,i){return f_e.get(BD).codeActionProvider.register(e,{providedCodeActionKinds:i?.providedCodeActionKinds,documentation:i?.documentation,provideCodeActions:(e,i,n,o)=>{const s=f_e.get(ZP).read({resource:e.uri}).filter((e=>Yu.areIntersectingOrTouching(e,i)));return t.provideCodeActions(e,i,{markers:s,only:n.only,trigger:n.trigger},o)},resolveCodeAction:t.resolveCodeAction})},registerDocumentFormattingEditProvider:function(e,t){return f_e.get(BD).documentFormattingEditProvider.register(e,t)},registerDocumentRangeFormattingEditProvider:function(e,t){return f_e.get(BD).documentRangeFormattingEditProvider.register(e,t)},registerOnTypeFormattingEditProvider:function(e,t){return f_e.get(BD).onTypeFormattingEditProvider.register(e,t)},registerLinkProvider:function(e,t){return f_e.get(BD).linkProvider.register(e,t)},registerColorProvider:function(e,t){return f_e.get(BD).colorProvider.register(e,t)},registerFoldingRangeProvider:function(e,t){return f_e.get(BD).foldingRangeProvider.register(e,t)},registerDeclarationProvider:function(e,t){return f_e.get(BD).declarationProvider.register(e,t)},registerSelectionRangeProvider:function(e,t){return f_e.get(BD).selectionRangeProvider.register(e,t)},registerDocumentSemanticTokensProvider:function(e,t){return f_e.get(BD).documentSemanticTokensProvider.register(e,t)},registerDocumentRangeSemanticTokensProvider:function(e,t){return f_e.get(BD).documentRangeSemanticTokensProvider.register(e,t)},registerInlineCompletionsProvider:function(e,t){return f_e.get(BD).inlineCompletionsProvider.register(e,t)},registerInlayHintsProvider:function(e,t){return f_e.get(BD).inlayHintsProvider.register(e,t)},DocumentHighlightKind:qhe,CompletionItemKind:Vhe,CompletionItemTag:Hhe,CompletionItemInsertTextRule:Whe,SymbolKind:xce,SymbolTag:kce,IndentAction:Jhe,CompletionTriggerKind:zhe,SignatureHelpTriggerKind:Sce,InlayHintKind:tce,InlineCompletionTriggerKind:oce,CodeActionTriggerType:Bhe,NewSymbolNameTag:cce,NewSymbolNameTriggerKind:uce,PartialAcceptTriggerKind:mce,HoverVerbosityAction:Xhe,InlineCompletionEndOfLifeReasonKind:nce,InlineCompletionDisplayLocationKind:ice,FoldingRangeKind:QS,SelectedSuggestionInfo:US,EditDeltaInfo:RC},Y_e.CancellationTokenSource,Y_e.Emitter;const Q_e=Y_e.KeyCode,X_e=Y_e.KeyMod,J_e=(Y_e.Position,Y_e.Range,Y_e.Selection,Y_e.SelectionDirection,Y_e.MarkerSeverity,Y_e.MarkerTag,Y_e.Uri,Y_e.Token,Y_e.editor),eve=Y_e.languages,tve=globalThis.MonacoEnvironment;var ive;(tve?.globalAPI||"function"==typeof globalThis.define&&globalThis.define.amd)&&(globalThis.monaco=Y_e),void 0!==globalThis.require&&"function"==typeof globalThis.require.config&&globalThis.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]}),self.MonacoEnvironment=(ive={editorWorkerService:"editor.worker.js"},{globalAPI:!1,getWorkerUrl:function(e,t){var n=i.p,o=(n?n.replace(/\/$/,"")+"/":"")+ive[t];if(/^((http:)|(https:)|(file:)|(\/\/))/.test(o)){var s=String(window.location),r=s.substr(0,s.length-window.location.hash.length-window.location.search.length-window.location.pathname.length);if(o.substring(0,r.length)!==r){/^(\/\/)/.test(o)&&(o=window.location.protocol+o);var a="/*"+t+"*/",l=new Blob([a+=void 0!==import.meta?'import "'+o+'";':'importScripts("'+o+'");'],{type:"application/javascript"});return URL.createObjectURL(l)}}return o}});let nve="undefined"!=typeof document&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function ove(e,t,...i){return function(e,t){let i;return i=0===t.length?e:e.replace(/\{(\d+)\}/g,((e,i)=>{const n=i[0],o=t[n];let s=e;return"string"==typeof o?s=o:"number"!=typeof o&&"boolean"!=typeof o&&null!=o||(s=String(o)),s})),nve&&(i="["+i.replace(/[aouei]/g,"$&$&")+"]"),i}(t,i)}var sve;const rve="en";let ave,lve,dve=!1,hve=!1,cve=!1,uve=!1,gve=!1,pve=!1,mve=!1,fve=!1,_ve=!1,vve=!1,bve=null,wve=null;const Cve="object"==typeof self?self:"object"==typeof i.g?i.g:{};let yve;void 0!==Cve.vscode&&void 0!==Cve.vscode.process?yve=Cve.vscode.process:"undefined"!=typeof process&&(yve=process);const Sve="string"==typeof(null===(sve=null==yve?void 0:yve.versions)||void 0===sve?void 0:sve.electron),xve=Sve&&"renderer"===(null==yve?void 0:yve.type);if("object"!=typeof navigator||xve)if("object"==typeof yve){dve="win32"===yve.platform,hve="darwin"===yve.platform,cve="linux"===yve.platform,uve=cve&&!!yve.env.SNAP&&!!yve.env.SNAP_REVISION,mve=Sve,_ve=!!yve.env.CI||!!yve.env.BUILD_ARTIFACTSTAGINGDIRECTORY,ave=rve,bve=rve;const e=yve.env.VSCODE_NLS_CONFIG;if(e)try{const t=JSON.parse(e),i=t.availableLanguages["*"];ave=t.locale,bve=i||rve,wve=t._translationsConfigFile}catch(e){}gve=!0}else console.error("Unable to resolve platform.");else lve=navigator.userAgent,dve=lve.indexOf("Windows")>=0,hve=lve.indexOf("Macintosh")>=0,fve=(lve.indexOf("Macintosh")>=0||lve.indexOf("iPad")>=0||lve.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,cve=lve.indexOf("Linux")>=0,vve=(null==lve?void 0:lve.indexOf("Mobi"))>=0,pve=!0,ave=void ove(0,"_")||rve,bve=ave;let kve=0;hve?kve=1:dve?kve=3:cve&&(kve=2);const Lve=dve,Dve=hve,Eve=cve,Nve=gve,Ive=pve,Tve=pve&&"function"==typeof Cve.importScripts,Mve=fve,Ave=vve,Rve=lve,Ove="function"==typeof Cve.postMessage&&!Cve.importScripts,Pve=(()=>{if(Ove){const e=[];Cve.addEventListener("message",(t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,n=e.length;i<n;i++){const n=e[i];if(n.id===t.data.vscodeScheduleAsyncWork)return e.splice(i,1),void n.callback()}}));let t=0;return i=>{const n=++t;e.push({id:n,callback:i}),Cve.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})(),Fve=hve||fve?2:dve?1:3;let Bve=!0,Wve=!1;function Vve(){if(!Wve){Wve=!0;const e=new Uint8Array(2);e[0]=1,e[1]=2;const t=new Uint16Array(e.buffer);Bve=513===t[0]}return Bve}const Hve=!!(Rve&&Rve.indexOf("Chrome")>=0),zve=!!(Rve&&Rve.indexOf("Firefox")>=0),Uve=!!(!Hve&&Rve&&Rve.indexOf("Safari")>=0),Kve=!!(Rve&&Rve.indexOf("Edg/")>=0);var jve;Rve&&Rve.indexOf("Android"),function(e){function t(e){return e&&"object"==typeof e&&"function"==typeof e[Symbol.iterator]}e.is=t;const i=Object.freeze([]);function*n(e){yield e}e.empty=function(){return i},e.single=n,e.wrap=function(e){return t(e)?e:n(e)},e.from=function(e){return e||i},e.isEmpty=function(e){return!e||!0===e[Symbol.iterator]().next().done},e.first=function(e){return e[Symbol.iterator]().next().value},e.some=function(e,t){for(const i of e)if(t(i))return!0;return!1},e.find=function(e,t){for(const i of e)if(t(i))return i},e.filter=function*(e,t){for(const i of e)t(i)&&(yield i)},e.map=function*(e,t){let i=0;for(const n of e)yield t(n,i++)},e.concat=function*(...e){for(const t of e)for(const e of t)yield e},e.reduce=function(e,t,i){let n=i;for(const i of e)n=t(n,i);return n},e.slice=function*(e,t,i=e.length){for(t<0&&(t+=e.length),i<0?i+=e.length:i>e.length&&(i=e.length);t<i;t++)yield e[t]},e.consume=function(t,i=Number.POSITIVE_INFINITY){const n=[];if(0===i)return[n,t];const o=t[Symbol.iterator]();for(let t=0;t<i;t++){const t=o.next();if(t.done)return[n,e.empty()];n.push(t.value)}return[n,{[Symbol.iterator]:()=>o}]}}(jve||(jve={}));class qve{constructor(e){this.element=e,this.next=qve.Undefined,this.prev=qve.Undefined}}qve.Undefined=new qve(void 0);class $ve{constructor(){this._first=qve.Undefined,this._last=qve.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===qve.Undefined}clear(){let e=this._first;for(;e!==qve.Undefined;){const t=e.next;e.prev=qve.Undefined,e.next=qve.Undefined,e=t}this._first=qve.Undefined,this._last=qve.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new qve(e);if(this._first===qve.Undefined)this._first=i,this._last=i;else if(t){const e=this._last;this._last=i,i.prev=e,e.next=i}else{const e=this._first;this._first=i,i.next=e,e.prev=i}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(i))}}shift(){if(this._first!==qve.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==qve.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==qve.Undefined&&e.next!==qve.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===qve.Undefined&&e.next===qve.Undefined?(this._first=qve.Undefined,this._last=qve.Undefined):e.next===qve.Undefined?(this._last=this._last.prev,this._last.next=qve.Undefined):e.prev===qve.Undefined&&(this._first=this._first.next,this._first.prev=qve.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==qve.Undefined;)yield e.element,e=e.next}}const Gve="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?",Zve=function(e=""){let t="(-?\\d*\\.\\d\\w*)|([^";for(const i of Gve)e.indexOf(i)>=0||(t+="\\"+i);return t+="\\s]+)",new RegExp(t,"g")}();function Yve(e){let t=Zve;if(e&&e instanceof RegExp)if(e.global)t=e;else{let i="g";e.ignoreCase&&(i+="i"),e.multiline&&(i+="m"),e.unicode&&(i+="u"),t=new RegExp(e.source,i)}return t.lastIndex=0,t}const Qve=new $ve;function Xve(e,t,i,n,o){if(o||(o=jve.first(Qve)),i.length>o.maxLen){let s=e-o.maxLen/2;return s<0?s=0:n+=s,Xve(e,t,i=i.substring(s,e+o.maxLen/2),n,o)}const s=Date.now(),r=e-1-n;let a=-1,l=null;for(let e=1;!(Date.now()-s>=o.timeBudget);e++){const n=r-o.windowSize*e;t.lastIndex=Math.max(0,n);const s=Jve(t,i,r,a);if(!s&&l)break;if(l=s,n<=0)break;a=n}if(l){const e={word:l[0],startColumn:n+1+l.index,endColumn:n+1+l.index+l[0].length};return t.lastIndex=0,e}return null}function Jve(e,t,i,n){let o;for(;o=e.exec(t);){const t=o.index||0;if(t<=i&&e.lastIndex>=i)return o;if(n>0&&t>n)return null}return null}function ebe(e,t=0){return e[e.length-(1+t)]}function tbe(e,t,i=(e,t)=>e===t){if(e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(let n=0,o=e.length;n<o;n++)if(!i(e[n],t[n]))return!1;return!0}function ibe(e){return Array.isArray(e)&&e.length>0}function nbe(e,t=e=>e){const i=new Set;return e.filter((e=>{const n=t(e);return!i.has(n)&&(i.add(n),!0)}))}function obe(e,t){return e.length>0?e[0]:t}function sbe(e,t){let i="number"==typeof t?e:0;"number"==typeof t?i=e:(i=0,t=e);const n=[];if(i<=t)for(let e=i;e<t;e++)n.push(e);else for(let e=i;e>t;e--)n.push(e);return n}function rbe(e,t,i){const n=e.slice(0,t),o=e.slice(t);return n.concat(i,o)}function abe(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.unshift(t))}function lbe(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.push(t))}function dbe(e,t){for(const i of t)e.push(i)}function hbe(e,t,i,n){const o=cbe(e,t),s=e.splice(o,i);return function(e,t,i){const n=cbe(e,t),o=e.length,s=i.length;e.length=o+s;for(let t=o-1;t>=n;t--)e[t+s]=e[t];for(let t=0;t<s;t++)e[t+n]=i[t]}(e,o,n),s}function cbe(e,t){return t<0?Math.max(t+e.length,0):Math.min(t,e.length)}var ube;function gbe(e,t){return(i,n)=>t(e(i),e(n))}Qve.unshift({maxLen:1e3,windowSize:15,timeBudget:150}),function(e){e.isLessThan=function(e){return e<0},e.isGreaterThan=function(e){return e>0},e.isNeitherLessOrGreaterThan=function(e){return 0===e},e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0}(ube||(ube={}));class pbe{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t<this.items.length&&e(this.items[t]);)t++;const i=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,i}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(0!==this.length)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class mbe{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate((t=>(e.push(t),!0))),e}filter(e){return new mbe((t=>this.iterate((i=>!e(i)||t(i)))))}map(e){return new mbe((t=>this.iterate((i=>t(e(i))))))}findLast(e){let t;return this.iterate((i=>(e(i)&&(t=i),!0))),t}findLastMaxBy(e){let t,i=!0;return this.iterate((n=>((i||ube.isGreaterThan(e(n,t)))&&(i=!1,t=n),!0))),t}}function fbe(e){return"string"==typeof e}function _be(e){return!("object"!=typeof e||null===e||Array.isArray(e)||e instanceof RegExp||e instanceof Date)}function vbe(e){const t=Object.getPrototypeOf(Uint8Array);return"object"==typeof e&&e instanceof t}function bbe(e){return"number"==typeof e&&!isNaN(e)}function wbe(e){return!!e&&"function"==typeof e[Symbol.iterator]}function Cbe(e){return!0===e||!1===e}function ybe(e){return void 0===e}function Sbe(e){return!xbe(e)}function xbe(e){return ybe(e)||null===e}function kbe(e,t){if(!e)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function Lbe(e){return"function"==typeof e}function Dbe(e,t){if(fbe(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Lbe(t)){try{if(e instanceof t)return}catch(e){}if(!xbe(e)&&e.constructor===t)return;if(1===t.length&&!0===t.call(void 0,e))return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function Ebe(e){return null===e?void 0:e}function Nbe(e){if(!e||"object"!=typeof e)return e;if(e instanceof RegExp)return e;const t=Array.isArray(e)?[]:{};return Object.entries(e).forEach((([e,i])=>{t[e]=i&&"object"==typeof i?Nbe(i):i})),t}mbe.empty=new mbe((e=>{}));const Ibe=Object.prototype.hasOwnProperty;function Tbe(e,t){return Mbe(e,t,new Set)}function Mbe(e,t,i){if(xbe(e))return e;const n=t(e);if(void 0!==n)return n;if(Array.isArray(e)){const n=[];for(const o of e)n.push(Mbe(o,t,i));return n}if(_be(e)){if(i.has(e))throw new Error("Cannot clone recursive data-structure");i.add(e);const n={};for(const o in e)Ibe.call(e,o)&&(n[o]=Mbe(e[o],t,i));return i.delete(e),n}return e}function Abe(e,t,i=!0){return _be(e)?(_be(t)&&Object.keys(t).forEach((n=>{n in e?i&&(_be(e[n])&&_be(t[n])?Abe(e[n],t[n],i):e[n]=t[n]):e[n]=t[n]})),e):t}function Rbe(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;let i,n;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(!Rbe(e[i],t[i]))return!1}else{const o=[];for(n in e)o.push(n);o.sort();const s=[];for(n in t)s.push(n);if(s.sort(),!Rbe(o,s))return!1;for(i=0;i<o.length;i++)if(!Rbe(e[o[i]],t[o[i]]))return!1}return!0}function Obe(e){const t=[];for(const i of function(e){let t=[],i=Object.getPrototypeOf(e);for(;Object.prototype!==i;)t=t.concat(Object.getOwnPropertyNames(i)),i=Object.getPrototypeOf(i);return t}(e))"function"==typeof e[i]&&t.push(i);return t}const Pbe={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};class Fbe{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class Bbe{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class Wbe{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return Hbe(e,t)}compute(e,t,i){return i}}class Vbe{constructor(e,t){this.newValue=e,this.didChange=t}}function Hbe(e,t){if("object"!=typeof e||"object"!=typeof t||!e||!t)return new Vbe(t,e!==t);if(Array.isArray(e)||Array.isArray(t)){const i=Array.isArray(e)&&Array.isArray(t)&&tbe(e,t);return new Vbe(t,!i)}let i=!1;for(const n in t)if(t.hasOwnProperty(n)){const o=Hbe(e[n],t[n]);o.didChange&&(e[n]=o.newValue,i=!0)}return new Vbe(e,i)}class zbe{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return Hbe(e,t)}validate(e){return this.defaultValue}}class Ube{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return Hbe(e,t)}validate(e){return void 0===e?this.defaultValue:e}compute(e,t,i){return i}}function Kbe(e,t){return void 0===e?t:"false"!==e&&Boolean(e)}class jbe extends Ube{constructor(e,t,i,n=void 0){void 0!==n&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return Kbe(e,this.defaultValue)}}function qbe(e,t,i,n){if(void 0===e)return t;let o=parseInt(e,10);return isNaN(o)?t:(o=Math.max(i,o),o=Math.min(n,o),0|o)}class $be extends Ube{static clampedInt(e,t,i,n){return qbe(e,t,i,n)}constructor(e,t,i,n,o,s=void 0){void 0!==s&&(s.type="integer",s.default=i,s.minimum=n,s.maximum=o),super(e,t,i,s),this.minimum=n,this.maximum=o}validate(e){return $be.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}class Gbe extends Ube{static clamp(e,t,i){return e<t?t:e>i?i:e}static float(e,t){if("number"==typeof e)return e;if(void 0===e)return t;const i=parseFloat(e);return isNaN(i)?t:i}constructor(e,t,i,n,o){void 0!==o&&(o.type="number",o.default=i),super(e,t,i,o),this.validationFn=n}validate(e){return this.validationFn(Gbe.float(e,this.defaultValue))}}class Zbe extends Ube{static string(e,t){return"string"!=typeof e?t:e}constructor(e,t,i,n=void 0){void 0!==n&&(n.type="string",n.default=i),super(e,t,i,n)}validate(e){return Zbe.string(e,this.defaultValue)}}function Ybe(e,t,i){return"string"!=typeof e||-1===i.indexOf(e)?t:e}class Qbe extends Ube{constructor(e,t,i,n,o=void 0){void 0!==o&&(o.type="string",o.enum=n,o.default=i),super(e,t,i,o),this._allowedValues=n}validate(e){return Ybe(e,this.defaultValue,this._allowedValues)}}class Xbe extends Wbe{constructor(e,t,i,n,o,s,r=void 0){void 0!==r&&(r.type="string",r.enum=o,r.default=n),super(e,t,i,r),this._allowedValues=o,this._convert=s}validate(e){return"string"!=typeof e||-1===this._allowedValues.indexOf(e)?this.defaultValue:this._convert(e)}}var Jbe;!function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin"}(Jbe||(Jbe={}));class ewe extends Wbe{constructor(){super(48,"fontLigatures",ewe.OFF,{anyOf:[{type:"boolean",description:ove(0,"Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:ove(0,"Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:ove(0,"Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return void 0===e?this.defaultValue:"string"==typeof e?"false"===e?ewe.OFF:"true"===e?ewe.ON:e:Boolean(e)?ewe.ON:ewe.OFF}}ewe.OFF='"liga" off, "calt" off',ewe.ON='"liga" on, "calt" on';class twe extends Wbe{constructor(){super(51,"fontVariations",twe.OFF,{anyOf:[{type:"boolean",description:ove(0,"Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:ove(0,"Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:ove(0,"Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return void 0===e?this.defaultValue:"string"==typeof e?"false"===e?twe.OFF:"true"===e?twe.TRANSLATE:e:Boolean(e)?twe.TRANSLATE:twe.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}twe.OFF="normal",twe.TRANSLATE="translate";class iwe extends Wbe{constructor(){super(50,"fontWeight",mwe.fontWeight,{anyOf:[{type:"number",minimum:iwe.MINIMUM_VALUE,maximum:iwe.MAXIMUM_VALUE,errorMessage:ove(0,'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:iwe.SUGGESTION_VALUES}],default:mwe.fontWeight,description:ove(0,'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return"normal"===e||"bold"===e?e:String($be.clampedInt(e,mwe.fontWeight,iwe.MINIMUM_VALUE,iwe.MAXIMUM_VALUE))}}iwe.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],iwe.MINIMUM_VALUE=1,iwe.MAXIMUM_VALUE=1e3;class nwe extends zbe{constructor(){super(138)}compute(e,t,i){return nwe.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let n=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(n=Math.max(n,t-1));const o=(i+e.viewLineCount+n)/(e.pixelRatio*e.height);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:n,desiredRatio:o,minimapLineCount:Math.floor(e.viewLineCount/o)}}static _computeMinimapLayout(e,t){const i=e.outerWidth,n=e.outerHeight,o=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(o*n),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:n};const s=t.stableMinimapLayoutInput,r=s&&e.outerHeight===s.outerHeight&&e.lineHeight===s.lineHeight&&e.typicalHalfwidthCharacterWidth===s.typicalHalfwidthCharacterWidth&&e.pixelRatio===s.pixelRatio&&e.scrollBeyondLastLine===s.scrollBeyondLastLine&&e.paddingTop===s.paddingTop&&e.paddingBottom===s.paddingBottom&&e.minimap.enabled===s.minimap.enabled&&e.minimap.side===s.minimap.side&&e.minimap.size===s.minimap.size&&e.minimap.showSlider===s.minimap.showSlider&&e.minimap.renderCharacters===s.minimap.renderCharacters&&e.minimap.maxColumn===s.minimap.maxColumn&&e.minimap.scale===s.minimap.scale&&e.verticalScrollbarWidth===s.verticalScrollbarWidth&&e.isViewportWrapping===s.isViewportWrapping,a=e.lineHeight,l=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,h=e.minimap.renderCharacters;let c=o>=2?Math.round(2*e.minimap.scale):e.minimap.scale;const u=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,m=e.verticalScrollbarWidth,f=e.viewLineCount,_=e.remainingWidth,v=e.isViewportWrapping,b=h?2:3;let w=Math.floor(o*n);const C=w/o;let y=!1,S=!1,x=b*c,k=c/o,L=1;if("fill"===g||"fit"===g){const{typicalViewportLineCount:i,extraLinesBeforeFirstLine:s,extraLinesBeyondLastLine:l,desiredRatio:h,minimapLineCount:u}=nwe.computeContainedMinimapLineCount({viewLineCount:f,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:n,lineHeight:a,pixelRatio:o});if(f/u>1)y=!0,S=!0,c=1,x=1,k=c/o;else{let n=!1,d=c+1;if("fit"===g){const e=Math.ceil((s+f+l)*x);v&&r&&_<=t.stableFitRemainingWidth?(n=!0,d=t.stableFitMaxMinimapScale):n=e>w}if("fill"===g||n){y=!0;const n=c;x=Math.min(a*o,Math.max(1,Math.floor(1/h))),v&&r&&_<=t.stableFitRemainingWidth&&(d=t.stableFitMaxMinimapScale),c=Math.min(d,Math.max(1,Math.floor(x/b))),c>n&&(L=Math.min(2,c/n)),k=c/o/L,w=Math.ceil(Math.max(i,s+f+l)*x),v?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=_,t.stableFitMaxMinimapScale=c):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const D=Math.floor(u*k),E=Math.min(D,Math.max(0,Math.floor((_-m-2)*k/(l+k)))+8);let N=Math.floor(o*E);const I=N/o;return N=Math.floor(N*L),{renderMinimap:h?1:2,minimapLeft:"left"===p?0:i-E-m,minimapWidth:E,minimapHeightIsEditorHeight:y,minimapIsSampling:S,minimapScale:c,minimapLineHeight:x,minimapCanvasInnerWidth:N,minimapCanvasInnerHeight:w,minimapCanvasOuterWidth:I,minimapCanvasOuterHeight:C}}static computeLayout(e,t){const i=0|t.outerWidth,n=0|t.outerHeight,o=0|t.lineHeight,s=0|t.lineNumbersDigitCount,r=t.typicalHalfwidthCharacterWidth,a=t.maxDigitWidth,l=t.pixelRatio,d=t.viewLineCount,h=e.get(130),c="inherit"===h?e.get(129):h,u="inherit"===c?e.get(125):c,g=e.get(128),p=t.isDominatedByLongLines,m=e.get(54),f=0!==e.get(64).renderType,_=e.get(65),v=e.get(99),b=e.get(80),w=e.get(69),C=e.get(97),y=C.verticalScrollbarSize,S=C.verticalHasArrows,x=C.arrowSize,k=C.horizontalScrollbarSize,L=e.get(40),D="never"!==e.get(104);let E=e.get(62);L&&D&&(E+=16);let N=0;if(f){const e=Math.max(s,_);N=Math.round(e*a)}let I=0;m&&(I=o);let T=0,M=T+I,A=M+N,R=A+E;const O=i-I-N-E;let P=!1,F=!1,B=-1;"inherit"===c&&p?(P=!0,F=!0):"on"===u||"bounded"===u?F=!0:"wordWrapColumn"===u&&(B=g);const W=nwe._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:o,typicalHalfwidthCharacterWidth:r,pixelRatio:l,scrollBeyondLastLine:v,paddingTop:b.top,paddingBottom:b.bottom,minimap:w,verticalScrollbarWidth:y,viewLineCount:d,remainingWidth:O,isViewportWrapping:F},t.memory||new Bbe);0!==W.renderMinimap&&0===W.minimapLeft&&(T+=W.minimapWidth,M+=W.minimapWidth,A+=W.minimapWidth,R+=W.minimapWidth);const V=O-W.minimapWidth,H=Math.max(1,Math.floor((V-y-2)/r)),z=S?x:0;return F&&(B=Math.max(1,H),"bounded"===u&&(B=Math.min(B,g))),{width:i,height:n,glyphMarginLeft:T,glyphMarginWidth:I,lineNumbersLeft:M,lineNumbersWidth:N,decorationsLeft:A,decorationsWidth:E,contentLeft:R,contentWidth:V,minimap:W,viewportColumn:H,isWordWrapMinified:P,isViewportWrapping:F,wrappingColumn:B,verticalScrollbarWidth:y,horizontalScrollbarHeight:k,overviewRuler:{top:z,width:y,height:n-2*z,right:0}}}}function owe(e){const t=e.get(92);return"editable"===t?e.get(86):"on"!==t}function swe(e,t){if("string"!=typeof e)return t;switch(e){case"hidden":return 2;case"visible":return 3;default:return 1}}const rwe="inUntrustedWorkspace",awe="editor.unicodeHighlight.allowedCharacters",lwe="editor.unicodeHighlight.invisibleCharacters",dwe="editor.unicodeHighlight.nonBasicASCII",hwe="editor.unicodeHighlight.ambiguousCharacters",cwe="editor.unicodeHighlight.includeComments",uwe="editor.unicodeHighlight.includeStrings",gwe="editor.unicodeHighlight.allowedLocales";function pwe(e,t,i){const n=i.indexOf(e);return-1===n?t:i[n]}const mwe={fontFamily:Dve?"Menlo, Monaco, 'Courier New', monospace":Eve?"'Droid Sans Mono', 'monospace', monospace":"Consolas, 'Courier New', monospace",fontWeight:"normal",fontSize:Dve?12:14,lineHeight:0,letterSpacing:0},fwe=[];function _we(e){return fwe[e.id]=e,e}const vwe={acceptSuggestionOnCommitCharacter:_we(new jbe(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:ove(0,"Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:_we(new Qbe(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",ove(0,"Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:ove(0,"Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:_we(new class extends Wbe{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[ove(0,"Use platform APIs to detect when a Screen Reader is attached"),ove(0,"Optimize for usage with a Screen Reader"),ove(0,"Assume a screen reader is not attached")],default:"auto",tags:["accessibility"],description:ove(0,"Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return 0===i?e.accessibilitySupport:i}}),accessibilityPageSize:_we(new $be(3,"accessibilityPageSize",10,1,1073741824,{description:ove(0,"Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),tags:["accessibility"]})),ariaLabel:_we(new Zbe(4,"ariaLabel",ove(0,"Editor content"))),autoClosingBrackets:_we(new Qbe(5,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",ove(0,"Use language configurations to determine when to autoclose brackets."),ove(0,"Autoclose brackets only when the cursor is to the left of whitespace."),""],description:ove(0,"Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingDelete:_we(new Qbe(6,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",ove(0,"Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:ove(0,"Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:_we(new Qbe(7,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",ove(0,"Type over closing quotes or brackets only if they were automatically inserted."),""],description:ove(0,"Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:_we(new Qbe(8,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",ove(0,"Use language configurations to determine when to autoclose quotes."),ove(0,"Autoclose quotes only when the cursor is to the left of whitespace."),""],description:ove(0,"Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:_we(new Xbe(9,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],(function(e){switch(e){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}),{enumDescriptions:[ove(0,"The editor will not insert indentation automatically."),ove(0,"The editor will keep the current line's indentation."),ove(0,"The editor will keep the current line's indentation and honor language defined brackets."),ove(0,"The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),ove(0,"The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:ove(0,"Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:_we(new jbe(10,"automaticLayout",!1)),autoSurround:_we(new Qbe(11,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[ove(0,"Use language configurations to determine when to automatically surround selections."),ove(0,"Surround with quotes but not brackets."),ove(0,"Surround with brackets but not quotes."),""],description:ove(0,"Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:_we(new class extends Wbe{constructor(){const e={enabled:Pbe.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:Pbe.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(12,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:ove(0,"Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:ove(0,"Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:Kbe(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:Kbe(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}),bracketPairGuides:_we(new class extends Wbe{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(13,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[ove(0,"Enables bracket pair guides."),ove(0,"Enables bracket pair guides only for the active bracket pair."),ove(0,"Disables bracket pair guides.")],default:e.bracketPairs,description:ove(0,"Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[ove(0,"Enables horizontal guides as addition to vertical bracket pair guides."),ove(0,"Enables horizontal guides only for the active bracket pair."),ove(0,"Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:ove(0,"Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:ove(0,"Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:ove(0,"Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[ove(0,"Highlights the active indent guide."),ove(0,"Highlights the active indent guide even if bracket guides are highlighted."),ove(0,"Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:ove(0,"Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{bracketPairs:pwe(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:pwe(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:Kbe(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:Kbe(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:pwe(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}),stickyTabStops:_we(new jbe(110,"stickyTabStops",!1,{description:ove(0,"Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:_we(new jbe(14,"codeLens",!0,{description:ove(0,"Controls whether the editor shows CodeLens.")})),codeLensFontFamily:_we(new Zbe(15,"codeLensFontFamily","",{description:ove(0,"Controls the font family for CodeLens.")})),codeLensFontSize:_we(new $be(16,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:ove(0,"Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:_we(new jbe(17,"colorDecorators",!0,{description:ove(0,"Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorsLimit:_we(new $be(18,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:ove(0,"Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:_we(new jbe(19,"columnSelection",!1,{description:ove(0,"Enable that the selection with the mouse and keys is doing column selection.")})),comments:_we(new class extends Wbe{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(20,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:ove(0,"Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:ove(0,"Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertSpace:Kbe(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:Kbe(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}),contextmenu:_we(new jbe(21,"contextmenu",!0)),copyWithSyntaxHighlighting:_we(new jbe(22,"copyWithSyntaxHighlighting",!0,{description:ove(0,"Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:_we(new Xbe(23,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],(function(e){switch(e){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}),{description:ove(0,"Control the cursor animation style.")})),cursorSmoothCaretAnimation:_we(new Qbe(24,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[ove(0,"Smooth caret animation is disabled."),ove(0,"Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),ove(0,"Smooth caret animation is always enabled.")],description:ove(0,"Controls whether the smooth caret animation should be enabled.")})),cursorStyle:_we(new Xbe(25,"cursorStyle",Jbe.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],(function(e){switch(e){case"line":return Jbe.Line;case"block":return Jbe.Block;case"underline":return Jbe.Underline;case"line-thin":return Jbe.LineThin;case"block-outline":return Jbe.BlockOutline;case"underline-thin":return Jbe.UnderlineThin}}),{description:ove(0,"Controls the cursor style.")})),cursorSurroundingLines:_we(new $be(26,"cursorSurroundingLines",0,0,1073741824,{description:ove(0,"Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:_we(new Qbe(27,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[ove(0,"`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),ove(0,"`cursorSurroundingLines` is enforced always.")],description:ove(0,"Controls when `cursorSurroundingLines` should be enforced.")})),cursorWidth:_we(new $be(28,"cursorWidth",0,0,1073741824,{markdownDescription:ove(0,"Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:_we(new jbe(29,"disableLayerHinting",!1)),disableMonospaceOptimizations:_we(new jbe(30,"disableMonospaceOptimizations",!1)),domReadOnly:_we(new jbe(31,"domReadOnly",!1)),dragAndDrop:_we(new jbe(32,"dragAndDrop",!0,{description:ove(0,"Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:_we(new class extends jbe{constructor(){super(34,"emptySelectionClipboard",!0,{description:ove(0,"Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}),dropIntoEditor:_we(new class extends Wbe{constructor(){const e={enabled:!0};super(33,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:ove(0,"Controls whether you can drag and drop a file into a text editor by holding down `shift` (instead of opening the file in an editor).")}})}validate(e){return e&&"object"==typeof e?{enabled:Kbe(e.enabled,this.defaultValue.enabled)}:this.defaultValue}}),stickyScroll:_we(new class extends Wbe{constructor(){const e={enabled:!1,maxLineCount:5};super(109,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:ove(0,"Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:10,description:ove(0,"Defines the maximum number of sticky lines to show.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:Kbe(t.enabled,this.defaultValue.enabled),maxLineCount:$be.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,10)}}}),experimentalWhitespaceRendering:_we(new Qbe(35,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[ove(0,"Use a new rendering method with svgs."),ove(0,"Use a new rendering method with font characters."),ove(0,"Use the stable rendering method.")],description:ove(0,"Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:_we(new Zbe(36,"extraEditorClassName","")),fastScrollSensitivity:_we(new Gbe(37,"fastScrollSensitivity",5,(e=>e<=0?5:e),{markdownDescription:ove(0,"Scrolling speed multiplier when pressing `Alt`.")})),find:_we(new class extends Wbe{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(38,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:ove(0,"Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[ove(0,"Never seed search string from the editor selection."),ove(0,"Always seed search string from the editor selection, including word at cursor position."),ove(0,"Only seed search string from the editor selection.")],description:ove(0,"Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[ove(0,"Never turn on Find in Selection automatically (default)."),ove(0,"Always turn on Find in Selection automatically."),ove(0,"Turn on Find in Selection automatically when multiple lines of content are selected.")],description:ove(0,"Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:ove(0,"Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:Dve},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:ove(0,"Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:ove(0,"Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{cursorMoveOnType:Kbe(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:"boolean"==typeof e.seedSearchStringFromSelection?e.seedSearchStringFromSelection?"always":"never":Ybe(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:"boolean"==typeof e.autoFindInSelection?e.autoFindInSelection?"always":"never":Ybe(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:Kbe(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:Kbe(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:Kbe(t.loop,this.defaultValue.loop)}}}),fixedOverflowWidgets:_we(new jbe(39,"fixedOverflowWidgets",!1)),folding:_we(new jbe(40,"folding",!0,{description:ove(0,"Controls whether the editor has code folding enabled.")})),foldingStrategy:_we(new Qbe(41,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[ove(0,"Use a language-specific folding strategy if available, else the indentation-based one."),ove(0,"Use the indentation-based folding strategy.")],description:ove(0,"Controls the strategy for computing folding ranges.")})),foldingHighlight:_we(new jbe(42,"foldingHighlight",!0,{description:ove(0,"Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:_we(new jbe(43,"foldingImportsByDefault",!1,{description:ove(0,"Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:_we(new $be(44,"foldingMaximumRegions",5e3,10,65e3,{description:ove(0,"The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:_we(new jbe(45,"unfoldOnClickAfterEndOfLine",!1,{description:ove(0,"Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:_we(new Zbe(46,"fontFamily",mwe.fontFamily,{description:ove(0,"Controls the font family.")})),fontInfo:_we(new class extends zbe{constructor(){super(47)}compute(e,t,i){return e.fontInfo}}),fontLigatures2:_we(new ewe),fontSize:_we(new class extends Ube{constructor(){super(49,"fontSize",mwe.fontSize,{type:"number",minimum:6,maximum:100,default:mwe.fontSize,description:ove(0,"Controls the font size in pixels.")})}validate(e){const t=Gbe.float(e,this.defaultValue);return 0===t?mwe.fontSize:Gbe.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}),fontWeight:_we(new iwe),fontVariations:_we(new twe),formatOnPaste:_we(new jbe(52,"formatOnPaste",!1,{description:ove(0,"Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:_we(new jbe(53,"formatOnType",!1,{description:ove(0,"Controls whether the editor should automatically format the line after typing.")})),glyphMargin:_we(new jbe(54,"glyphMargin",!0,{description:ove(0,"Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:_we(new class extends Wbe{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[ove(0,"Show Peek view of the results (default)"),ove(0,"Go to the primary result and show a Peek view"),ove(0,"Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(55,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:ove(0,"This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":Object.assign({description:ove(0,"Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:ove(0,"Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleDeclarations":Object.assign({description:ove(0,"Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:ove(0,"Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:ove(0,"Controls the behavior the 'Go to References'-command when multiple target locations exist.")},t),"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:ove(0,"Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:ove(0,"Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:ove(0,"Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:ove(0,"Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:ove(0,"Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,n,o,s;if(!e||"object"!=typeof e)return this.defaultValue;const r=e;return{multiple:Ybe(r.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:null!==(t=r.multipleDefinitions)&&void 0!==t?t:Ybe(r.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:null!==(i=r.multipleTypeDefinitions)&&void 0!==i?i:Ybe(r.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:null!==(n=r.multipleDeclarations)&&void 0!==n?n:Ybe(r.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:null!==(o=r.multipleImplementations)&&void 0!==o?o:Ybe(r.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:null!==(s=r.multipleReferences)&&void 0!==s?s:Ybe(r.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Zbe.string(r.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Zbe.string(r.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Zbe.string(r.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Zbe.string(r.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Zbe.string(r.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}),hideCursorInOverviewRuler:_we(new jbe(56,"hideCursorInOverviewRuler",!1,{description:ove(0,"Controls whether the cursor should be hidden in the overview ruler.")})),hover:_we(new class extends Wbe{constructor(){const e={enabled:!0,delay:300,sticky:!0,above:!0};super(57,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:ove(0,"Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:ove(0,"Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:ove(0,"Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.above":{type:"boolean",default:e.above,description:ove(0,"Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:Kbe(t.enabled,this.defaultValue.enabled),delay:$be.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:Kbe(t.sticky,this.defaultValue.sticky),above:Kbe(t.above,this.defaultValue.above)}}}),inDiffEditor:_we(new jbe(58,"inDiffEditor",!1)),letterSpacing:_we(new Gbe(60,"letterSpacing",mwe.letterSpacing,(e=>Gbe.clamp(e,-5,20)),{description:ove(0,"Controls the letter spacing in pixels.")})),lightbulb:_we(new class extends Wbe{constructor(){const e={enabled:!0};super(61,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:ove(0,"Enables the Code Action lightbulb in the editor.")}})}validate(e){return e&&"object"==typeof e?{enabled:Kbe(e.enabled,this.defaultValue.enabled)}:this.defaultValue}}),lineDecorationsWidth:_we(new class extends Wbe{constructor(){super(62,"lineDecorationsWidth",10)}validate(e){return"string"==typeof e&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):$be.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?$be.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}),lineHeight:_we(new class extends Gbe{constructor(){super(63,"lineHeight",mwe.lineHeight,(e=>Gbe.clamp(e,0,150)),{markdownDescription:ove(0,"Controls the line height. \n - Use 0 to automatically compute the line height from the font size.\n - Values between 0 and 8 will be used as a multiplier with the font size.\n - Values greater than or equal to 8 will be used as effective values.")})}compute(e,t,i){return e.fontInfo.lineHeight}}),lineNumbers:_we(new class extends Wbe{constructor(){super(64,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[ove(0,"Line numbers are not rendered."),ove(0,"Line numbers are rendered as absolute number."),ove(0,"Line numbers are rendered as distance in lines to cursor position."),ove(0,"Line numbers are rendered every 10 lines.")],default:"on",description:ove(0,"Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return void 0!==e&&("function"==typeof e?(t=4,i=e):t="interval"===e?3:"relative"===e?2:"on"===e?1:0),{renderType:t,renderFn:i}}}),lineNumbersMinChars:_we(new $be(65,"lineNumbersMinChars",5,1,300)),linkedEditing:_we(new jbe(66,"linkedEditing",!1,{description:ove(0,"Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:_we(new jbe(67,"links",!0,{description:ove(0,"Controls whether the editor should detect links and make them clickable.")})),matchBrackets:_we(new Qbe(68,"matchBrackets","always",["always","near","never"],{description:ove(0,"Highlight matching brackets.")})),minimap:_we(new class extends Wbe{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1};super(69,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:ove(0,"Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:ove(0,"Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[ove(0,"The minimap has the same size as the editor contents (and might scroll)."),ove(0,"The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),ove(0,"The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:ove(0,"Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:ove(0,"Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:ove(0,"Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:ove(0,"Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:ove(0,"Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:ove(0,"Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:Kbe(t.enabled,this.defaultValue.enabled),autohide:Kbe(t.autohide,this.defaultValue.autohide),size:Ybe(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:Ybe(t.side,this.defaultValue.side,["right","left"]),showSlider:Ybe(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:Kbe(t.renderCharacters,this.defaultValue.renderCharacters),scale:$be.clampedInt(t.scale,1,1,3),maxColumn:$be.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}),mouseStyle:_we(new Qbe(70,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:_we(new Gbe(71,"mouseWheelScrollSensitivity",1,(e=>0===e?1:e),{markdownDescription:ove(0,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:_we(new jbe(72,"mouseWheelZoom",!1,{markdownDescription:ove(0,"Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:_we(new jbe(73,"multiCursorMergeOverlapping",!0,{description:ove(0,"Merge multiple cursors when they are overlapping.")})),multiCursorModifier:_we(new Xbe(74,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],(function(e){return"ctrlCmd"===e?Dve?"metaKey":"ctrlKey":"altKey"}),{markdownEnumDescriptions:[ove(0,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),ove(0,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:ove(0,"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:_we(new Qbe(75,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[ove(0,"Each cursor pastes a single line of the text."),ove(0,"Each cursor pastes the full text.")],markdownDescription:ove(0,"Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:_we(new $be(76,"multiCursorLimit",1e4,1,1e5,{markdownDescription:ove(0,"Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:_we(new jbe(77,"occurrencesHighlight",!0,{description:ove(0,"Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:_we(new jbe(78,"overviewRulerBorder",!0,{description:ove(0,"Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:_we(new $be(79,"overviewRulerLanes",3,0,3)),padding:_we(new class extends Wbe{constructor(){super(80,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:ove(0,"Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:ove(0,"Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{top:$be.clampedInt(t.top,0,0,1e3),bottom:$be.clampedInt(t.bottom,0,0,1e3)}}}),parameterHints:_we(new class extends Wbe{constructor(){const e={enabled:!0,cycle:!0};super(81,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:ove(0,"Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:ove(0,"Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:Kbe(t.enabled,this.defaultValue.enabled),cycle:Kbe(t.cycle,this.defaultValue.cycle)}}}),peekWidgetDefaultFocus:_we(new Qbe(82,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[ove(0,"Focus the tree when opening peek"),ove(0,"Focus the editor when opening peek")],description:ove(0,"Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:_we(new jbe(83,"definitionLinkOpensInPeek",!1,{description:ove(0,"Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:_we(new class extends Wbe{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[ove(0,"Quick suggestions show inside the suggest widget"),ove(0,"Quick suggestions show as ghost text"),ove(0,"Quick suggestions are disabled")]}];super(84,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:ove(0,"Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:ove(0,"Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:ove(0,"Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:ove(0,"Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the '{0}'-setting which controls if suggestions are triggered by special characters.","#editor.suggestOnTriggerCharacters#")}),this.defaultValue=e}validate(e){if("boolean"==typeof e){const t=e?"on":"off";return{comments:t,strings:t,other:t}}if(!e||"object"!=typeof e)return this.defaultValue;const{other:t,comments:i,strings:n}=e,o=["on","inline","off"];let s,r,a;return s="boolean"==typeof t?t?"on":"off":Ybe(t,this.defaultValue.other,o),r="boolean"==typeof i?i?"on":"off":Ybe(i,this.defaultValue.comments,o),a="boolean"==typeof n?n?"on":"off":Ybe(n,this.defaultValue.strings,o),{other:s,comments:r,strings:a}}}),quickSuggestionsDelay:_we(new $be(85,"quickSuggestionsDelay",10,0,1073741824,{description:ove(0,"Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:_we(new jbe(86,"readOnly",!1)),renameOnType:_we(new jbe(87,"renameOnType",!1,{description:ove(0,"Controls whether the editor auto renames on type."),markdownDeprecationMessage:ove(0,"Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:_we(new jbe(88,"renderControlCharacters",!0,{description:ove(0,"Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:_we(new Qbe(89,"renderFinalNewline",Eve?"dimmed":"on",["off","on","dimmed"],{description:ove(0,"Render last line number when the file ends with a newline.")})),renderLineHighlight:_we(new Qbe(90,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",ove(0,"Highlights both the gutter and the current line.")],description:ove(0,"Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:_we(new jbe(91,"renderLineHighlightOnlyWhenFocus",!1,{description:ove(0,"Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:_we(new Qbe(92,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:_we(new Qbe(93,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",ove(0,"Render whitespace characters except for single spaces between words."),ove(0,"Render whitespace characters only on selected text."),ove(0,"Render only trailing whitespace characters."),""],description:ove(0,"Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:_we(new $be(94,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:_we(new jbe(95,"roundedSelection",!0,{description:ove(0,"Controls whether selections should have rounded corners.")})),rulers:_we(new class extends Wbe{constructor(){const e=[],t={type:"number",description:ove(0,"Number of monospace characters at which this editor ruler will render.")};super(96,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:ove(0,"Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:ove(0,"Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){const t=[];for(const i of e)if("number"==typeof i)t.push({column:$be.clampedInt(i,0,0,1e4),color:null});else if(i&&"object"==typeof i){const e=i;t.push({column:$be.clampedInt(e.column,0,0,1e4),color:e.color})}return t.sort(((e,t)=>e.column-t.column)),t}return this.defaultValue}}),scrollbar:_we(new class extends Wbe{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1};super(97,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[ove(0,"The vertical scrollbar will be visible only when necessary."),ove(0,"The vertical scrollbar will always be visible."),ove(0,"The vertical scrollbar will always be hidden.")],default:"auto",description:ove(0,"Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[ove(0,"The horizontal scrollbar will be visible only when necessary."),ove(0,"The horizontal scrollbar will always be visible."),ove(0,"The horizontal scrollbar will always be hidden.")],default:"auto",description:ove(0,"Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:ove(0,"The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:ove(0,"The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:ove(0,"Controls whether clicks scroll by page or jump to click position.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e,i=$be.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=$be.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:$be.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:swe(t.vertical,this.defaultValue.vertical),horizontal:swe(t.horizontal,this.defaultValue.horizontal),useShadows:Kbe(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:Kbe(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:Kbe(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:Kbe(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:Kbe(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:$be.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:$be.clampedInt(t.verticalSliderSize,n,0,1e3),scrollByPage:Kbe(t.scrollByPage,this.defaultValue.scrollByPage)}}}),scrollBeyondLastColumn:_we(new $be(98,"scrollBeyondLastColumn",4,0,1073741824,{description:ove(0,"Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:_we(new jbe(99,"scrollBeyondLastLine",!0,{description:ove(0,"Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:_we(new jbe(100,"scrollPredominantAxis",!0,{description:ove(0,"Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:_we(new jbe(101,"selectionClipboard",!0,{description:ove(0,"Controls whether the Linux primary clipboard should be supported."),included:Eve})),selectionHighlight:_we(new jbe(102,"selectionHighlight",!0,{description:ove(0,"Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:_we(new jbe(103,"selectOnLineNumbers",!0)),showFoldingControls:_we(new Qbe(104,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[ove(0,"Always show the folding controls."),ove(0,"Never show the folding controls and reduce the gutter size."),ove(0,"Only show the folding controls when the mouse is over the gutter.")],description:ove(0,"Controls when the folding controls on the gutter are shown.")})),showUnused:_we(new jbe(105,"showUnused",!0,{description:ove(0,"Controls fading out of unused code.")})),showDeprecated:_we(new jbe(133,"showDeprecated",!0,{description:ove(0,"Controls strikethrough deprecated variables.")})),inlayHints:_we(new class extends Wbe{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(134,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:ove(0,"Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[ove(0,"Inlay hints are enabled"),ove(0,"Inlay hints are showing by default and hide when holding {0}",Dve?"Ctrl+Option":"Ctrl+Alt"),ove(0,"Inlay hints are hidden by default and show when holding {0}",Dve?"Ctrl+Option":"Ctrl+Alt"),ove(0,"Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:ove(0,"Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:ove(0,"Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:ove(0,"Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return"boolean"==typeof t.enabled&&(t.enabled=t.enabled?"on":"off"),{enabled:Ybe(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:$be.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Zbe.string(t.fontFamily,this.defaultValue.fontFamily),padding:Kbe(t.padding,this.defaultValue.padding)}}}),snippetSuggestions:_we(new Qbe(106,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[ove(0,"Show snippet suggestions on top of other suggestions."),ove(0,"Show snippet suggestions below other suggestions."),ove(0,"Show snippets suggestions with other suggestions."),ove(0,"Do not show snippet suggestions.")],description:ove(0,"Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:_we(new class extends Wbe{constructor(){super(107,"smartSelect",{selectLeadingAndTrailingWhitespace:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:ove(0,"Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"}})}validate(e){return e&&"object"==typeof e?{selectLeadingAndTrailingWhitespace:Kbe(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace)}:this.defaultValue}}),smoothScrolling:_we(new jbe(108,"smoothScrolling",!1,{description:ove(0,"Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:_we(new $be(111,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:_we(new class extends Wbe{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!0,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(112,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[ove(0,"Insert suggestion without overwriting text right of the cursor."),ove(0,"Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:ove(0,"Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:ove(0,"Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:ove(0,"Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:ove(0,"Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[ove(0,"Always select a suggestion when automatically triggering IntelliSense."),ove(0,"Never select a suggestion when automatically triggering IntelliSense."),ove(0,"Select a suggestion only when triggering IntelliSense from a trigger character."),ove(0,"Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:ove(0,"Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:ove(0,"Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:ove(0,"Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:ove(0,"Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:ove(0,"Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:ove(0,"Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:ove(0,"This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:ove(0,"This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:ove(0,"When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertMode:Ybe(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:Kbe(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:Kbe(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:Kbe(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:Kbe(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:Ybe(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:Kbe(t.showIcons,this.defaultValue.showIcons),showStatusBar:Kbe(t.showStatusBar,this.defaultValue.showStatusBar),preview:Kbe(t.preview,this.defaultValue.preview),previewMode:Ybe(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:Kbe(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:Kbe(t.showMethods,this.defaultValue.showMethods),showFunctions:Kbe(t.showFunctions,this.defaultValue.showFunctions),showConstructors:Kbe(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:Kbe(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:Kbe(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:Kbe(t.showFields,this.defaultValue.showFields),showVariables:Kbe(t.showVariables,this.defaultValue.showVariables),showClasses:Kbe(t.showClasses,this.defaultValue.showClasses),showStructs:Kbe(t.showStructs,this.defaultValue.showStructs),showInterfaces:Kbe(t.showInterfaces,this.defaultValue.showInterfaces),showModules:Kbe(t.showModules,this.defaultValue.showModules),showProperties:Kbe(t.showProperties,this.defaultValue.showProperties),showEvents:Kbe(t.showEvents,this.defaultValue.showEvents),showOperators:Kbe(t.showOperators,this.defaultValue.showOperators),showUnits:Kbe(t.showUnits,this.defaultValue.showUnits),showValues:Kbe(t.showValues,this.defaultValue.showValues),showConstants:Kbe(t.showConstants,this.defaultValue.showConstants),showEnums:Kbe(t.showEnums,this.defaultValue.showEnums),showEnumMembers:Kbe(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:Kbe(t.showKeywords,this.defaultValue.showKeywords),showWords:Kbe(t.showWords,this.defaultValue.showWords),showColors:Kbe(t.showColors,this.defaultValue.showColors),showFiles:Kbe(t.showFiles,this.defaultValue.showFiles),showReferences:Kbe(t.showReferences,this.defaultValue.showReferences),showFolders:Kbe(t.showFolders,this.defaultValue.showFolders),showTypeParameters:Kbe(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:Kbe(t.showSnippets,this.defaultValue.showSnippets),showUsers:Kbe(t.showUsers,this.defaultValue.showUsers),showIssues:Kbe(t.showIssues,this.defaultValue.showIssues)}}}),inlineSuggest:_we(new class extends Wbe{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover"};super(59,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:ove(0,"Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover"],enumDescriptions:[ove(0,"Show the inline suggestion toolbar whenever an inline suggestion is shown."),ove(0,"Show the inline suggestion toolbar when hovering over an inline suggestion.")],description:ove(0,"Controls when to show the inline suggestion toolbar.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:Kbe(t.enabled,this.defaultValue.enabled),mode:Ybe(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:Ybe(t.showToolbar,this.defaultValue.showToolbar,["always","onHover"])}}}),suggestFontSize:_we(new $be(113,"suggestFontSize",0,0,1e3,{markdownDescription:ove(0,"Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:_we(new $be(114,"suggestLineHeight",0,0,1e3,{markdownDescription:ove(0,"Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:_we(new jbe(115,"suggestOnTriggerCharacters",!0,{description:ove(0,"Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:_we(new Qbe(116,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[ove(0,"Always select the first suggestion."),ove(0,"Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),ove(0,"Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:ove(0,"Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:_we(new Qbe(117,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[ove(0,"Tab complete will insert the best matching suggestion when pressing tab."),ove(0,"Disable tab completions."),ove(0,"Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:ove(0,"Enables tab completions.")})),tabIndex:_we(new $be(118,"tabIndex",0,-1,1073741824)),unicodeHighlight:_we(new class extends Wbe{constructor(){const e={nonBasicASCII:rwe,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:rwe,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(119,"unicodeHighlight",e,{[dwe]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,rwe],default:e.nonBasicASCII,description:ove(0,"Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[lwe]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:ove(0,"Controls whether characters that just reserve space or have no width at all are highlighted.")},[hwe]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:ove(0,"Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[cwe]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,rwe],default:e.includeComments,description:ove(0,"Controls whether characters in comments should also be subject to Unicode highlighting.")},[uwe]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,rwe],default:e.includeStrings,description:ove(0,"Controls whether characters in strings should also be subject to Unicode highlighting.")},[awe]:{restricted:!0,type:"object",default:e.allowedCharacters,description:ove(0,"Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[gwe]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:ove(0,"Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(Rbe(e.allowedCharacters,t.allowedCharacters)||(e=Object.assign(Object.assign({},e),{allowedCharacters:t.allowedCharacters}),i=!0)),t.allowedLocales&&e&&(Rbe(e.allowedLocales,t.allowedLocales)||(e=Object.assign(Object.assign({},e),{allowedLocales:t.allowedLocales}),i=!0));const n=super.applyUpdate(e,t);return i?new Vbe(n.newValue,!0):n}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{nonBasicASCII:pwe(t.nonBasicASCII,rwe,[!0,!1,rwe]),invisibleCharacters:Kbe(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:Kbe(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:pwe(t.includeComments,rwe,[!0,!1,rwe]),includeStrings:pwe(t.includeStrings,rwe,[!0,!1,rwe]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if("object"!=typeof e||!e)return t;const i={};for(const[t,n]of Object.entries(e))!0===n&&(i[t]=!0);return i}}),unusualLineTerminators:_we(new Qbe(120,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[ove(0,"Unusual line terminators are automatically removed."),ove(0,"Unusual line terminators are ignored."),ove(0,"Unusual line terminators prompt to be removed.")],description:ove(0,"Remove unusual line terminators that might cause problems.")})),useShadowDOM:_we(new jbe(121,"useShadowDOM",!0)),useTabStops:_we(new jbe(122,"useTabStops",!0,{description:ove(0,"Inserting and deleting whitespace follows tab stops.")})),wordBreak:_we(new Qbe(123,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[ove(0,"Use the default line break rule."),ove(0,"Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:ove(0,"Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSeparators:_we(new Zbe(124,"wordSeparators",Gve,{description:ove(0,"Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:_we(new Qbe(125,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[ove(0,"Lines will never wrap."),ove(0,"Lines will wrap at the viewport width."),ove(0,"Lines will wrap at `#editor.wordWrapColumn#`."),ove(0,"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:ove(0,"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:_we(new Zbe(126,"wordWrapBreakAfterCharacters"," \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:_we(new Zbe(127,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:_we(new $be(128,"wordWrapColumn",80,1,1073741824,{markdownDescription:ove(0,"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:_we(new Qbe(129,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:_we(new Qbe(130,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:_we(new class extends zbe{constructor(){super(135)}compute(e,t,i){const n=["monaco-editor"];return t.get(36)&&n.push(t.get(36)),e.extraEditorClassName&&n.push(e.extraEditorClassName),"default"===t.get(70)?n.push("mouse-default"):"copy"===t.get(70)&&n.push("mouse-copy"),t.get(105)&&n.push("showUnused"),t.get(133)&&n.push("showDeprecated"),n.join(" ")}}),pixelRatio:_we(new class extends zbe{constructor(){super(136)}compute(e,t,i){return e.pixelRatio}}),tabFocusMode:_we(new class extends zbe{constructor(){super(137)}compute(e,t,i){return!!t.get(86)||e.tabFocusMode}}),layoutInfo:_we(new nwe),wrappingInfo:_we(new class extends zbe{constructor(){super(139)}compute(e,t,i){const n=t.get(138);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}}),wrappingIndent:_we(new class extends Wbe{constructor(){super(131,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[ove(0,"No indentation. Wrapped lines begin at column 1."),ove(0,"Wrapped lines get the same indentation as the parent."),ove(0,"Wrapped lines get +1 indentation toward the parent."),ove(0,"Wrapped lines get +2 indentation toward the parent.")],description:ove(0,"Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,i){return 2===t.get(2)?0:i}}),wrappingStrategy:_we(new class extends Wbe{constructor(){super(132,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[ove(0,"Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),ove(0,"Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:ove(0,"Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return Ybe(e,"simple",["simple","advanced"])}compute(e,t,i){return 2===t.get(2)?"advanced":i}})},bwe=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout((()=>{if(e.stack){if(Ewe.isErrorNoTelemetry(e))throw new Ewe(e.message+"\n\n"+e.stack);throw new Error(e.message+"\n\n"+e.stack)}throw e}),0)}}emit(e){this.listeners.forEach((t=>{t(e)}))}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function wwe(e){xwe(e)||bwe.onUnexpectedError(e)}function Cwe(e){xwe(e)||bwe.onUnexpectedExternalError(e)}function ywe(e){if(e instanceof Error){const{name:t,message:i}=e;return{$isError:!0,name:t,message:i,stack:e.stacktrace||e.stack,noTelemetry:Ewe.isErrorNoTelemetry(e)}}return e}const Swe="Canceled";function xwe(e){return e instanceof kwe||e instanceof Error&&e.name===Swe&&e.message===Swe}class kwe extends Error{constructor(){super(Swe),this.name=this.message}}function Lwe(e){return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")}class Dwe extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class Ewe extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof Ewe)return e;const t=new Ewe;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return"CodeExpectedError"===e.name}}class Nwe extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Nwe.prototype)}}function Iwe(e){const t=this;let i,n=!1;return function(){return n||(n=!0,i=e.apply(t,arguments)),i}}function Twe(e){if(jve.is(e)){const t=[];for(const i of e)if(i)try{i.dispose()}catch(e){t.push(e)}if(1===t.length)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function Mwe(...e){const t=Awe((()=>Twe(e)));return t}function Awe(e){const t={dispose:Iwe((()=>{e()}))};return t}class Rwe{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(0!==this._toDispose.size)try{Twe(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Rwe.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}}Rwe.DISABLE_DISPOSED_WARNING=!1;class Owe{constructor(){this._store=new Rwe,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}Owe.None=Object.freeze({dispose(){}});class Pwe{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||(null===(t=this._value)||void 0===t||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,null===(e=this._value)||void 0===e||e.dispose(),this._value=void 0}clearAndLeak(){const e=this._value;return this._value=void 0,e}}class Fwe{constructor(){this.dispose=()=>{},this.unset=()=>{},this.isset=()=>!1}set(e){let t=e;return this.unset=()=>t=void 0,this.isset=()=>void 0!==t,this.dispose=()=>{t&&(t(),t=void 0)},this}}class Bwe{constructor(e){this.object=e}dispose(){}}class Wwe{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{Twe(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){var n;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||null===(n=this._store.get(e))||void 0===n||n.dispose(),this._store.set(e,t)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const Vwe=Cve.performance&&"function"==typeof Cve.performance.now;class Hwe{static create(e=!0){return new Hwe(e)}constructor(e){this._highResolution=Vwe&&e,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}elapsed(){return-1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?Cve.performance.now():Date.now()}}var zwe;!function(e){function t(e){return(t,i=null,n)=>{let o,s=!1;return o=e((e=>{if(!s)return o?o.dispose():s=!0,t.call(i,e)}),null,n),s&&o.dispose(),o}}function i(e,t,i){return r(((i,n=null,o)=>e((e=>i.call(n,t(e))),null,o)),i)}function n(e,t,i){return r(((i,n=null,o)=>e((e=>{t(e),i.call(n,e)}),null,o)),i)}function o(e,t,i){return r(((i,n=null,o)=>e((e=>t(e)&&i.call(n,e)),null,o)),i)}function s(e,t,n,o){let s=n;return i(e,(e=>(s=t(s,e),s)),o)}function r(e,t){let i;const n=new $we({onWillAddFirstListener(){i=e(n.fire,n)},onDidRemoveLastListener(){null==i||i.dispose()}});return null==t||t.add(n),n.event}function a(e,t,i=100,n=!1,o,s){let r,a,l,d=0;const h=new $we({leakWarningThreshold:o,onWillAddFirstListener(){r=e((e=>{d++,a=t(a,e),n&&!l&&(h.fire(a),a=void 0);const o=()=>{const e=a;a=void 0,l=void 0,(!n||d>1)&&h.fire(e),d=0};"number"==typeof i?(clearTimeout(l),l=setTimeout(o,i)):void 0===l&&(l=0,queueMicrotask(o))}))},onDidRemoveLastListener(){r.dispose()}});return null==s||s.add(h),h.event}function l(e,t=(e,t)=>e===t,i){let n,s=!0;return o(e,(e=>{const i=s||!t(e,n);return s=!1,n=e,i}),i)}e.None=()=>Owe.None,e.defer=function(e,t){return a(e,(()=>{}),0,void 0,void 0,t)},e.once=t,e.map=i,e.forEach=n,e.filter=o,e.signal=function(e){return e},e.any=function(...e){return(t,i=null,n)=>Mwe(...e.map((e=>e((e=>t.call(i,e)),null,n))))},e.reduce=s,e.debounce=a,e.accumulate=function(t,i=0,n){return e.debounce(t,((e,t)=>e?(e.push(t),e):[t]),i,void 0,void 0,n)},e.latch=l,e.split=function(t,i,n){return[e.filter(t,i,n),e.filter(t,(e=>!i(e)),n)]},e.buffer=function(e,t=!1,i=[]){let n=i.slice(),o=e((e=>{n?n.push(e):r.fire(e)}));const s=()=>{null==n||n.forEach((e=>r.fire(e))),n=null},r=new $we({onWillAddFirstListener(){o||(o=e((e=>r.fire(e))))},onDidAddFirstListener(){n&&(t?setTimeout(s):s())},onDidRemoveLastListener(){o&&o.dispose(),o=null}});return r.event};class d{constructor(e){this.event=e,this.disposables=new Rwe}map(e){return new d(i(this.event,e,this.disposables))}forEach(e){return new d(n(this.event,e,this.disposables))}filter(e){return new d(o(this.event,e,this.disposables))}reduce(e,t){return new d(s(this.event,e,t,this.disposables))}latch(){return new d(l(this.event,void 0,this.disposables))}debounce(e,t=100,i=!1,n){return new d(a(this.event,e,t,i,n,this.disposables))}on(e,t,i){return this.event(e,t,i)}once(e,i,n){return t(this.event)(e,i,n)}dispose(){this.disposables.dispose()}}e.chain=function(e){return new d(e)},e.fromNodeEventEmitter=function(e,t,i=e=>e){const n=(...e)=>o.fire(i(...e)),o=new $we({onWillAddFirstListener:()=>e.on(t,n),onDidRemoveLastListener:()=>e.removeListener(t,n)});return o.event},e.fromDOMEventEmitter=function(e,t,i=e=>e){const n=(...e)=>o.fire(i(...e)),o=new $we({onWillAddFirstListener:()=>e.addEventListener(t,n),onDidRemoveLastListener:()=>e.removeEventListener(t,n)});return o.event},e.toPromise=function(e){return new Promise((i=>t(e)(i)))},e.runAndSubscribe=function(e,t){return t(void 0),e((e=>t(e)))},e.runAndSubscribeWithStore=function(e,t){let i=null;function n(e){null==i||i.dispose(),i=new Rwe,t(e,i)}n(void 0);const o=e((e=>n(e)));return Awe((()=>{o.dispose(),null==i||i.dispose()}))};class h{constructor(e,t){this.obs=e,this._counter=0,this._hasChanged=!1;const i={onWillAddFirstListener:()=>{e.addObserver(this)},onDidRemoveLastListener:()=>{e.removeObserver(this)}};this.emitter=new $we(i),t&&t.add(this.emitter)}beginUpdate(e){this._counter++}handleChange(e,t){this._hasChanged=!0}endUpdate(e){0==--this._counter&&this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this.obs.get()))}}e.fromObservable=function(e,t){return new h(e,t).emitter.event}}(zwe||(zwe={}));class Uwe{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${Uwe._idPool++}`,Uwe.all.add(this)}start(e){this._stopWatch=new Hwe(!0),this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}Uwe.all=new Set,Uwe._idPool=0;class Kwe{constructor(e,t=Math.random().toString(18).slice(2,5)){this.threshold=e,this.name=t,this._warnCountdown=0}dispose(){var e;null===(e=this._stacks)||void 0===e||e.clear()}check(e,t){const i=this.threshold;if(i<=0||t<i)return;this._stacks||(this._stacks=new Map);const n=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,n+1),this._warnCountdown-=1,this._warnCountdown<=0){let e;this._warnCountdown=.5*i;let n=0;for(const[t,i]of this._stacks)(!e||n<i)&&(e=t,n=i);console.warn(`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${n}):`),console.warn(e)}return()=>{const t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}}class jwe{static create(){var e;return new jwe(null!==(e=(new Error).stack)&&void 0!==e?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split("\n").slice(2).join("\n"))}}class qwe{constructor(e,t,i){this.callback=e,this.callbackThis=t,this.stack=i,this.subscription=new Fwe}invoke(e){this.callback.call(this.callbackThis,e)}}class $we{constructor(e){var t,i,n,o,s;this._disposed=!1,this._options=e,this._leakageMon=(null===(t=this._options)||void 0===t?void 0:t.leakWarningThreshold)?new Kwe(null!==(n=null===(i=this._options)||void 0===i?void 0:i.leakWarningThreshold)&&void 0!==n?n:-1):void 0,this._perfMon=(null===(o=this._options)||void 0===o?void 0:o._profName)?new Uwe(this._options._profName):void 0,this._deliveryQueue=null===(s=this._options)||void 0===s?void 0:s.deliveryQueue}dispose(){var e,t,i,n;this._disposed||(this._disposed=!0,this._listeners&&this._listeners.clear(),null===(e=this._deliveryQueue)||void 0===e||e.clear(this),null===(i=null===(t=this._options)||void 0===t?void 0:t.onDidRemoveLastListener)||void 0===i||i.call(t),null===(n=this._leakageMon)||void 0===n||n.dispose())}get event(){return this._event||(this._event=(e,t,i)=>{var n,o,s;if(this._listeners||(this._listeners=new $ve),this._leakageMon&&this._listeners.size>3*this._leakageMon.threshold)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),Owe.None;const r=this._listeners.isEmpty();let a,l;r&&(null===(n=this._options)||void 0===n?void 0:n.onWillAddFirstListener)&&this._options.onWillAddFirstListener(this),this._leakageMon&&this._listeners.size>=Math.ceil(.2*this._leakageMon.threshold)&&(l=jwe.create(),a=this._leakageMon.check(l,this._listeners.size+1));const d=new qwe(e,t,l),h=this._listeners.push(d);r&&(null===(o=this._options)||void 0===o?void 0:o.onDidAddFirstListener)&&this._options.onDidAddFirstListener(this),(null===(s=this._options)||void 0===s?void 0:s.onDidAddListener)&&this._options.onDidAddListener(this,e,t);const c=d.subscription.set((()=>{null==a||a(),!this._disposed&&(h(),this._options&&this._options.onDidRemoveLastListener)&&(this._listeners&&!this._listeners.isEmpty()||this._options.onDidRemoveLastListener(this))}));return i instanceof Rwe?i.add(c):Array.isArray(i)&&i.push(c),c}),this._event}fire(e){var t,i;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new Zwe);for(const t of this._listeners)this._deliveryQueue.push(this,t,e);null===(t=this._perfMon)||void 0===t||t.start(this._deliveryQueue.size),this._deliveryQueue.deliver(),null===(i=this._perfMon)||void 0===i||i.stop()}}hasListeners(){return!!this._listeners&&!this._listeners.isEmpty()}}class Gwe{constructor(){this._queue=new $ve}get size(){return this._queue.size}push(e,t,i){this._queue.push(new Ywe(e,t,i))}clear(e){const t=new $ve;for(const i of this._queue)i.emitter!==e&&t.push(i);this._queue=t}deliver(){for(;this._queue.size>0;){const e=this._queue.shift();try{e.listener.invoke(e.event)}catch(e){wwe(e)}}}}class Zwe extends Gwe{clear(e){this._queue.clear()}}class Ywe{constructor(e,t,i){this.emitter=e,this.listener=t,this.event=i}}class Qwe extends $we{constructor(e){super(e),this._isPaused=0,this._eventQueue=new $ve,this._mergeFn=null==e?void 0:e.merge}pause(){this._isPaused++}resume(){if(0!==this._isPaused&&0==--this._isPaused)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&0!==this._eventQueue.size;)super.fire(this._eventQueue.shift())}fire(e){this._listeners&&(0!==this._isPaused?this._eventQueue.push(e):super.fire(e))}}class Xwe extends Qwe{constructor(e){var t;super(e),this._delay=null!==(t=e.delay)&&void 0!==t?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout((()=>{this._handle=void 0,this.resume()}),this._delay)),super.fire(e)}}class Jwe extends $we{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=null==e?void 0:e.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),1===this._queuedEvents.length&&queueMicrotask((()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach((e=>super.fire(e))),this._queuedEvents=[]})))}}class eCe{constructor(){this.buffers=[]}wrapEvent(e){return(t,i,n)=>e((e=>{const n=this.buffers[this.buffers.length-1];n?n.push((()=>t.call(i,e))):t.call(i,e)}),void 0,n)}bufferEvents(e){const t=[];this.buffers.push(t);const i=e();return this.buffers.pop(),t.forEach((e=>e())),i}}class tCe{constructor(){this.listening=!1,this.inputEvent=zwe.None,this.inputEventListener=Owe.None,this.emitter=new $we({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const iCe=Object.freeze((function(e,t){const i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}));var nCe;!function(e){e.isCancellationToken=function(t){return t===e.None||t===e.Cancelled||t instanceof oCe||!(!t||"object"!=typeof t)&&"boolean"==typeof t.isCancellationRequested&&"function"==typeof t.onCancellationRequested},e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:zwe.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:iCe})}(nCe||(nCe={}));class oCe{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?iCe:(this._emitter||(this._emitter=new $we),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class sCe{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new oCe),this._token}cancel(){this._token?this._token instanceof oCe&&this._token.cancel():this._token=nCe.Cancelled}dispose(e=!1){var t;e&&this.cancel(),null===(t=this._parentListener)||void 0===t||t.dispose(),this._token?this._token instanceof oCe&&this._token.dispose():this._token=nCe.None}}class rCe{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const aCe=new rCe,lCe=new rCe,dCe=new rCe,hCe=new Array(230),cCe={},uCe=[],gCe=Object.create(null),pCe=Object.create(null),mCe=[],fCe=[];for(let e=0;e<=193;e++)mCe[e]=-1;for(let e=0;e<=127;e++)fCe[e]=-1;var _Ce;let vCe;if(function(){const e="",t=[[0,1,0,"None",0,"unknown",0,"VK_UNKNOWN",e,e],[0,1,1,"Hyper",0,e,0,e,e,e],[0,1,2,"Super",0,e,0,e,e,e],[0,1,3,"Fn",0,e,0,e,e,e],[0,1,4,"FnLock",0,e,0,e,e,e],[0,1,5,"Suspend",0,e,0,e,e,e],[0,1,6,"Resume",0,e,0,e,e,e],[0,1,7,"Turbo",0,e,0,e,e,e],[0,1,8,"Sleep",0,e,0,"VK_SLEEP",e,e],[0,1,9,"WakeUp",0,e,0,e,e,e],[31,0,10,"KeyA",31,"A",65,"VK_A",e,e],[32,0,11,"KeyB",32,"B",66,"VK_B",e,e],[33,0,12,"KeyC",33,"C",67,"VK_C",e,e],[34,0,13,"KeyD",34,"D",68,"VK_D",e,e],[35,0,14,"KeyE",35,"E",69,"VK_E",e,e],[36,0,15,"KeyF",36,"F",70,"VK_F",e,e],[37,0,16,"KeyG",37,"G",71,"VK_G",e,e],[38,0,17,"KeyH",38,"H",72,"VK_H",e,e],[39,0,18,"KeyI",39,"I",73,"VK_I",e,e],[40,0,19,"KeyJ",40,"J",74,"VK_J",e,e],[41,0,20,"KeyK",41,"K",75,"VK_K",e,e],[42,0,21,"KeyL",42,"L",76,"VK_L",e,e],[43,0,22,"KeyM",43,"M",77,"VK_M",e,e],[44,0,23,"KeyN",44,"N",78,"VK_N",e,e],[45,0,24,"KeyO",45,"O",79,"VK_O",e,e],[46,0,25,"KeyP",46,"P",80,"VK_P",e,e],[47,0,26,"KeyQ",47,"Q",81,"VK_Q",e,e],[48,0,27,"KeyR",48,"R",82,"VK_R",e,e],[49,0,28,"KeyS",49,"S",83,"VK_S",e,e],[50,0,29,"KeyT",50,"T",84,"VK_T",e,e],[51,0,30,"KeyU",51,"U",85,"VK_U",e,e],[52,0,31,"KeyV",52,"V",86,"VK_V",e,e],[53,0,32,"KeyW",53,"W",87,"VK_W",e,e],[54,0,33,"KeyX",54,"X",88,"VK_X",e,e],[55,0,34,"KeyY",55,"Y",89,"VK_Y",e,e],[56,0,35,"KeyZ",56,"Z",90,"VK_Z",e,e],[22,0,36,"Digit1",22,"1",49,"VK_1",e,e],[23,0,37,"Digit2",23,"2",50,"VK_2",e,e],[24,0,38,"Digit3",24,"3",51,"VK_3",e,e],[25,0,39,"Digit4",25,"4",52,"VK_4",e,e],[26,0,40,"Digit5",26,"5",53,"VK_5",e,e],[27,0,41,"Digit6",27,"6",54,"VK_6",e,e],[28,0,42,"Digit7",28,"7",55,"VK_7",e,e],[29,0,43,"Digit8",29,"8",56,"VK_8",e,e],[30,0,44,"Digit9",30,"9",57,"VK_9",e,e],[21,0,45,"Digit0",21,"0",48,"VK_0",e,e],[3,1,46,"Enter",3,"Enter",13,"VK_RETURN",e,e],[9,1,47,"Escape",9,"Escape",27,"VK_ESCAPE",e,e],[1,1,48,"Backspace",1,"Backspace",8,"VK_BACK",e,e],[2,1,49,"Tab",2,"Tab",9,"VK_TAB",e,e],[10,1,50,"Space",10,"Space",32,"VK_SPACE",e,e],[83,0,51,"Minus",83,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[81,0,52,"Equal",81,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[87,0,53,"BracketLeft",87,"[",219,"VK_OEM_4","[","OEM_4"],[89,0,54,"BracketRight",89,"]",221,"VK_OEM_6","]","OEM_6"],[88,0,55,"Backslash",88,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,0,56,"IntlHash",0,e,0,e,e,e],[80,0,57,"Semicolon",80,";",186,"VK_OEM_1",";","OEM_1"],[90,0,58,"Quote",90,"'",222,"VK_OEM_7","'","OEM_7"],[86,0,59,"Backquote",86,"`",192,"VK_OEM_3","`","OEM_3"],[82,0,60,"Comma",82,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[84,0,61,"Period",84,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[85,0,62,"Slash",85,"/",191,"VK_OEM_2","/","OEM_2"],[8,1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL",e,e],[59,1,64,"F1",59,"F1",112,"VK_F1",e,e],[60,1,65,"F2",60,"F2",113,"VK_F2",e,e],[61,1,66,"F3",61,"F3",114,"VK_F3",e,e],[62,1,67,"F4",62,"F4",115,"VK_F4",e,e],[63,1,68,"F5",63,"F5",116,"VK_F5",e,e],[64,1,69,"F6",64,"F6",117,"VK_F6",e,e],[65,1,70,"F7",65,"F7",118,"VK_F7",e,e],[66,1,71,"F8",66,"F8",119,"VK_F8",e,e],[67,1,72,"F9",67,"F9",120,"VK_F9",e,e],[68,1,73,"F10",68,"F10",121,"VK_F10",e,e],[69,1,74,"F11",69,"F11",122,"VK_F11",e,e],[70,1,75,"F12",70,"F12",123,"VK_F12",e,e],[0,1,76,"PrintScreen",0,e,0,e,e,e],[79,1,77,"ScrollLock",79,"ScrollLock",145,"VK_SCROLL",e,e],[7,1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",e,e],[19,1,79,"Insert",19,"Insert",45,"VK_INSERT",e,e],[14,1,80,"Home",14,"Home",36,"VK_HOME",e,e],[11,1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",e,e],[20,1,82,"Delete",20,"Delete",46,"VK_DELETE",e,e],[13,1,83,"End",13,"End",35,"VK_END",e,e],[12,1,84,"PageDown",12,"PageDown",34,"VK_NEXT",e,e],[17,1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",e],[15,1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",e],[18,1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",e],[16,1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",e],[78,1,89,"NumLock",78,"NumLock",144,"VK_NUMLOCK",e,e],[108,1,90,"NumpadDivide",108,"NumPad_Divide",111,"VK_DIVIDE",e,e],[103,1,91,"NumpadMultiply",103,"NumPad_Multiply",106,"VK_MULTIPLY",e,e],[106,1,92,"NumpadSubtract",106,"NumPad_Subtract",109,"VK_SUBTRACT",e,e],[104,1,93,"NumpadAdd",104,"NumPad_Add",107,"VK_ADD",e,e],[3,1,94,"NumpadEnter",3,e,0,e,e,e],[94,1,95,"Numpad1",94,"NumPad1",97,"VK_NUMPAD1",e,e],[95,1,96,"Numpad2",95,"NumPad2",98,"VK_NUMPAD2",e,e],[96,1,97,"Numpad3",96,"NumPad3",99,"VK_NUMPAD3",e,e],[97,1,98,"Numpad4",97,"NumPad4",100,"VK_NUMPAD4",e,e],[98,1,99,"Numpad5",98,"NumPad5",101,"VK_NUMPAD5",e,e],[99,1,100,"Numpad6",99,"NumPad6",102,"VK_NUMPAD6",e,e],[100,1,101,"Numpad7",100,"NumPad7",103,"VK_NUMPAD7",e,e],[101,1,102,"Numpad8",101,"NumPad8",104,"VK_NUMPAD8",e,e],[102,1,103,"Numpad9",102,"NumPad9",105,"VK_NUMPAD9",e,e],[93,1,104,"Numpad0",93,"NumPad0",96,"VK_NUMPAD0",e,e],[107,1,105,"NumpadDecimal",107,"NumPad_Decimal",110,"VK_DECIMAL",e,e],[92,0,106,"IntlBackslash",92,"OEM_102",226,"VK_OEM_102",e,e],[58,1,107,"ContextMenu",58,"ContextMenu",93,e,e,e],[0,1,108,"Power",0,e,0,e,e,e],[0,1,109,"NumpadEqual",0,e,0,e,e,e],[71,1,110,"F13",71,"F13",124,"VK_F13",e,e],[72,1,111,"F14",72,"F14",125,"VK_F14",e,e],[73,1,112,"F15",73,"F15",126,"VK_F15",e,e],[74,1,113,"F16",74,"F16",127,"VK_F16",e,e],[75,1,114,"F17",75,"F17",128,"VK_F17",e,e],[76,1,115,"F18",76,"F18",129,"VK_F18",e,e],[77,1,116,"F19",77,"F19",130,"VK_F19",e,e],[0,1,117,"F20",0,e,0,"VK_F20",e,e],[0,1,118,"F21",0,e,0,"VK_F21",e,e],[0,1,119,"F22",0,e,0,"VK_F22",e,e],[0,1,120,"F23",0,e,0,"VK_F23",e,e],[0,1,121,"F24",0,e,0,"VK_F24",e,e],[0,1,122,"Open",0,e,0,e,e,e],[0,1,123,"Help",0,e,0,e,e,e],[0,1,124,"Select",0,e,0,e,e,e],[0,1,125,"Again",0,e,0,e,e,e],[0,1,126,"Undo",0,e,0,e,e,e],[0,1,127,"Cut",0,e,0,e,e,e],[0,1,128,"Copy",0,e,0,e,e,e],[0,1,129,"Paste",0,e,0,e,e,e],[0,1,130,"Find",0,e,0,e,e,e],[0,1,131,"AudioVolumeMute",112,"AudioVolumeMute",173,"VK_VOLUME_MUTE",e,e],[0,1,132,"AudioVolumeUp",113,"AudioVolumeUp",175,"VK_VOLUME_UP",e,e],[0,1,133,"AudioVolumeDown",114,"AudioVolumeDown",174,"VK_VOLUME_DOWN",e,e],[105,1,134,"NumpadComma",105,"NumPad_Separator",108,"VK_SEPARATOR",e,e],[110,0,135,"IntlRo",110,"ABNT_C1",193,"VK_ABNT_C1",e,e],[0,1,136,"KanaMode",0,e,0,e,e,e],[0,0,137,"IntlYen",0,e,0,e,e,e],[0,1,138,"Convert",0,e,0,e,e,e],[0,1,139,"NonConvert",0,e,0,e,e,e],[0,1,140,"Lang1",0,e,0,e,e,e],[0,1,141,"Lang2",0,e,0,e,e,e],[0,1,142,"Lang3",0,e,0,e,e,e],[0,1,143,"Lang4",0,e,0,e,e,e],[0,1,144,"Lang5",0,e,0,e,e,e],[0,1,145,"Abort",0,e,0,e,e,e],[0,1,146,"Props",0,e,0,e,e,e],[0,1,147,"NumpadParenLeft",0,e,0,e,e,e],[0,1,148,"NumpadParenRight",0,e,0,e,e,e],[0,1,149,"NumpadBackspace",0,e,0,e,e,e],[0,1,150,"NumpadMemoryStore",0,e,0,e,e,e],[0,1,151,"NumpadMemoryRecall",0,e,0,e,e,e],[0,1,152,"NumpadMemoryClear",0,e,0,e,e,e],[0,1,153,"NumpadMemoryAdd",0,e,0,e,e,e],[0,1,154,"NumpadMemorySubtract",0,e,0,e,e,e],[0,1,155,"NumpadClear",126,"Clear",12,"VK_CLEAR",e,e],[0,1,156,"NumpadClearEntry",0,e,0,e,e,e],[5,1,0,e,5,"Ctrl",17,"VK_CONTROL",e,e],[4,1,0,e,4,"Shift",16,"VK_SHIFT",e,e],[6,1,0,e,6,"Alt",18,"VK_MENU",e,e],[57,1,0,e,57,"Meta",0,"VK_COMMAND",e,e],[5,1,157,"ControlLeft",5,e,0,"VK_LCONTROL",e,e],[4,1,158,"ShiftLeft",4,e,0,"VK_LSHIFT",e,e],[6,1,159,"AltLeft",6,e,0,"VK_LMENU",e,e],[57,1,160,"MetaLeft",57,e,0,"VK_LWIN",e,e],[5,1,161,"ControlRight",5,e,0,"VK_RCONTROL",e,e],[4,1,162,"ShiftRight",4,e,0,"VK_RSHIFT",e,e],[6,1,163,"AltRight",6,e,0,"VK_RMENU",e,e],[57,1,164,"MetaRight",57,e,0,"VK_RWIN",e,e],[0,1,165,"BrightnessUp",0,e,0,e,e,e],[0,1,166,"BrightnessDown",0,e,0,e,e,e],[0,1,167,"MediaPlay",0,e,0,e,e,e],[0,1,168,"MediaRecord",0,e,0,e,e,e],[0,1,169,"MediaFastForward",0,e,0,e,e,e],[0,1,170,"MediaRewind",0,e,0,e,e,e],[114,1,171,"MediaTrackNext",119,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",e,e],[115,1,172,"MediaTrackPrevious",120,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",e,e],[116,1,173,"MediaStop",121,"MediaStop",178,"VK_MEDIA_STOP",e,e],[0,1,174,"Eject",0,e,0,e,e,e],[117,1,175,"MediaPlayPause",122,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",e,e],[0,1,176,"MediaSelect",123,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",e,e],[0,1,177,"LaunchMail",124,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",e,e],[0,1,178,"LaunchApp2",125,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",e,e],[0,1,179,"LaunchApp1",0,e,0,"VK_MEDIA_LAUNCH_APP1",e,e],[0,1,180,"SelectTask",0,e,0,e,e,e],[0,1,181,"LaunchScreenSaver",0,e,0,e,e,e],[0,1,182,"BrowserSearch",115,"BrowserSearch",170,"VK_BROWSER_SEARCH",e,e],[0,1,183,"BrowserHome",116,"BrowserHome",172,"VK_BROWSER_HOME",e,e],[112,1,184,"BrowserBack",117,"BrowserBack",166,"VK_BROWSER_BACK",e,e],[113,1,185,"BrowserForward",118,"BrowserForward",167,"VK_BROWSER_FORWARD",e,e],[0,1,186,"BrowserStop",0,e,0,"VK_BROWSER_STOP",e,e],[0,1,187,"BrowserRefresh",0,e,0,"VK_BROWSER_REFRESH",e,e],[0,1,188,"BrowserFavorites",0,e,0,"VK_BROWSER_FAVORITES",e,e],[0,1,189,"ZoomToggle",0,e,0,e,e,e],[0,1,190,"MailReply",0,e,0,e,e,e],[0,1,191,"MailForward",0,e,0,e,e,e],[0,1,192,"MailSend",0,e,0,e,e,e],[109,1,0,e,109,"KeyInComposition",229,e,e,e],[111,1,0,e,111,"ABNT_C2",194,"VK_ABNT_C2",e,e],[91,1,0,e,91,"OEM_8",223,"VK_OEM_8",e,e],[0,1,0,e,0,e,0,"VK_KANA",e,e],[0,1,0,e,0,e,0,"VK_HANGUL",e,e],[0,1,0,e,0,e,0,"VK_JUNJA",e,e],[0,1,0,e,0,e,0,"VK_FINAL",e,e],[0,1,0,e,0,e,0,"VK_HANJA",e,e],[0,1,0,e,0,e,0,"VK_KANJI",e,e],[0,1,0,e,0,e,0,"VK_CONVERT",e,e],[0,1,0,e,0,e,0,"VK_NONCONVERT",e,e],[0,1,0,e,0,e,0,"VK_ACCEPT",e,e],[0,1,0,e,0,e,0,"VK_MODECHANGE",e,e],[0,1,0,e,0,e,0,"VK_SELECT",e,e],[0,1,0,e,0,e,0,"VK_PRINT",e,e],[0,1,0,e,0,e,0,"VK_EXECUTE",e,e],[0,1,0,e,0,e,0,"VK_SNAPSHOT",e,e],[0,1,0,e,0,e,0,"VK_HELP",e,e],[0,1,0,e,0,e,0,"VK_APPS",e,e],[0,1,0,e,0,e,0,"VK_PROCESSKEY",e,e],[0,1,0,e,0,e,0,"VK_PACKET",e,e],[0,1,0,e,0,e,0,"VK_DBE_SBCSCHAR",e,e],[0,1,0,e,0,e,0,"VK_DBE_DBCSCHAR",e,e],[0,1,0,e,0,e,0,"VK_ATTN",e,e],[0,1,0,e,0,e,0,"VK_CRSEL",e,e],[0,1,0,e,0,e,0,"VK_EXSEL",e,e],[0,1,0,e,0,e,0,"VK_EREOF",e,e],[0,1,0,e,0,e,0,"VK_PLAY",e,e],[0,1,0,e,0,e,0,"VK_ZOOM",e,e],[0,1,0,e,0,e,0,"VK_NONAME",e,e],[0,1,0,e,0,e,0,"VK_PA1",e,e],[0,1,0,e,0,e,0,"VK_OEM_CLEAR",e,e]],i=[],n=[];for(const e of t){const[t,o,s,r,a,l,d,h,c,u]=e;if(n[s]||(n[s]=!0,uCe[s]=r,gCe[r]=s,pCe[r.toLowerCase()]=s,o&&(mCe[s]=a,0!==a&&3!==a&&5!==a&&4!==a&&6!==a&&57!==a&&(fCe[a]=s))),!i[a]){if(i[a]=!0,!l)throw new Error(`String representation missing for key code ${a} around scan code ${r}`);aCe.define(a,l),lCe.define(a,c||l),dCe.define(a,u||c||l)}d&&(hCe[d]=a),h&&(cCe[h]=a)}fCe[3]=46}(),function(e){e.toString=function(e){return aCe.keyCodeToStr(e)},e.fromString=function(e){return aCe.strToKeyCode(e)},e.toUserSettingsUS=function(e){return lCe.keyCodeToStr(e)},e.toUserSettingsGeneral=function(e){return dCe.keyCodeToStr(e)},e.fromUserSettings=function(e){return lCe.strToKeyCode(e)||dCe.strToKeyCode(e)},e.toElectronAccelerator=function(e){if(e>=93&&e<=108)return null;switch(e){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return aCe.keyCodeToStr(e)}}(_Ce||(_Ce={})),void 0!==Cve.vscode&&void 0!==Cve.vscode.process){const e=Cve.vscode.process;vCe={get platform(){return e.platform},get arch(){return e.arch},get env(){return e.env},cwd:()=>e.cwd()}}else vCe="undefined"!=typeof process?{get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd:()=>process.env.VSCODE_CWD||process.cwd()}:{get platform(){return Lve?"win32":Dve?"darwin":"linux"},get arch(){},get env(){return{}},cwd:()=>"/"};const bCe=vCe.cwd,wCe=vCe.env,CCe=vCe.platform,yCe=46,SCe=47,xCe=92,kCe=58;class LCe extends Error{constructor(e,t,i){let n;"string"==typeof t&&0===t.indexOf("not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";const o=-1!==e.indexOf(".")?"property":"argument";let s=`The "${e}" ${o} ${n} of type ${t}`;s+=". Received type "+typeof i,super(s),this.code="ERR_INVALID_ARG_TYPE"}}function DCe(e,t){if("string"!=typeof e)throw new LCe(t,"string",e)}const ECe="win32"===CCe;function NCe(e){return e===SCe||e===xCe}function ICe(e){return e===SCe}function TCe(e){return e>=65&&e<=90||e>=97&&e<=122}function MCe(e,t,i,n){let o="",s=0,r=-1,a=0,l=0;for(let d=0;d<=e.length;++d){if(d<e.length)l=e.charCodeAt(d);else{if(n(l))break;l=SCe}if(n(l)){if(r===d-1||1===a);else if(2===a){if(o.length<2||2!==s||o.charCodeAt(o.length-1)!==yCe||o.charCodeAt(o.length-2)!==yCe){if(o.length>2){const e=o.lastIndexOf(i);-1===e?(o="",s=0):(o=o.slice(0,e),s=o.length-1-o.lastIndexOf(i)),r=d,a=0;continue}if(0!==o.length){o="",s=0,r=d,a=0;continue}}t&&(o+=o.length>0?`${i}..`:"..",s=2)}else o.length>0?o+=`${i}${e.slice(r+1,d)}`:o=e.slice(r+1,d),s=d-r-1;r=d,a=0}else l===yCe&&-1!==a?++a:a=-1}return o}function ACe(e,t){!function(e){if(null===e||"object"!=typeof e)throw new LCe("pathObject","Object",e)}(t);const i=t.dir||t.root,n=t.base||`${t.name||""}${t.ext||""}`;return i?i===t.root?`${i}${n}`:`${i}${e}${n}`:n}const RCe={resolve(...e){let t="",i="",n=!1;for(let o=e.length-1;o>=-1;o--){let s;if(o>=0){if(s=e[o],DCe(s,"path"),0===s.length)continue}else 0===t.length?s=bCe():(s=wCe[`=${t}`]||bCe(),(void 0===s||s.slice(0,2).toLowerCase()!==t.toLowerCase()&&s.charCodeAt(2)===xCe)&&(s=`${t}\\`));const r=s.length;let a=0,l="",d=!1;const h=s.charCodeAt(0);if(1===r)NCe(h)&&(a=1,d=!0);else if(NCe(h))if(d=!0,NCe(s.charCodeAt(1))){let e=2,t=e;for(;e<r&&!NCe(s.charCodeAt(e));)e++;if(e<r&&e!==t){const i=s.slice(t,e);for(t=e;e<r&&NCe(s.charCodeAt(e));)e++;if(e<r&&e!==t){for(t=e;e<r&&!NCe(s.charCodeAt(e));)e++;e!==r&&e===t||(l=`\\\\${i}\\${s.slice(t,e)}`,a=e)}}}else a=1;else TCe(h)&&s.charCodeAt(1)===kCe&&(l=s.slice(0,2),a=2,r>2&&NCe(s.charCodeAt(2))&&(d=!0,a=3));if(l.length>0)if(t.length>0){if(l.toLowerCase()!==t.toLowerCase())continue}else t=l;if(n){if(t.length>0)break}else if(i=`${s.slice(a)}\\${i}`,n=d,d&&t.length>0)break}return i=MCe(i,!n,"\\",NCe),n?`${t}\\${i}`:`${t}${i}`||"."},normalize(e){DCe(e,"path");const t=e.length;if(0===t)return".";let i,n=0,o=!1;const s=e.charCodeAt(0);if(1===t)return ICe(s)?"\\":e;if(NCe(s))if(o=!0,NCe(e.charCodeAt(1))){let o=2,s=o;for(;o<t&&!NCe(e.charCodeAt(o));)o++;if(o<t&&o!==s){const r=e.slice(s,o);for(s=o;o<t&&NCe(e.charCodeAt(o));)o++;if(o<t&&o!==s){for(s=o;o<t&&!NCe(e.charCodeAt(o));)o++;if(o===t)return`\\\\${r}\\${e.slice(s)}\\`;o!==s&&(i=`\\\\${r}\\${e.slice(s,o)}`,n=o)}}}else n=1;else TCe(s)&&e.charCodeAt(1)===kCe&&(i=e.slice(0,2),n=2,t>2&&NCe(e.charCodeAt(2))&&(o=!0,n=3));let r=n<t?MCe(e.slice(n),!o,"\\",NCe):"";return 0!==r.length||o||(r="."),r.length>0&&NCe(e.charCodeAt(t-1))&&(r+="\\"),void 0===i?o?`\\${r}`:r:o?`${i}\\${r}`:`${i}${r}`},isAbsolute(e){DCe(e,"path");const t=e.length;if(0===t)return!1;const i=e.charCodeAt(0);return NCe(i)||t>2&&TCe(i)&&e.charCodeAt(1)===kCe&&NCe(e.charCodeAt(2))},join(...e){if(0===e.length)return".";let t,i;for(let n=0;n<e.length;++n){const o=e[n];DCe(o,"path"),o.length>0&&(void 0===t?t=i=o:t+=`\\${o}`)}if(void 0===t)return".";let n=!0,o=0;if("string"==typeof i&&NCe(i.charCodeAt(0))){++o;const e=i.length;e>1&&NCe(i.charCodeAt(1))&&(++o,e>2&&(NCe(i.charCodeAt(2))?++o:n=!1))}if(n){for(;o<t.length&&NCe(t.charCodeAt(o));)o++;o>=2&&(t=`\\${t.slice(o)}`)}return RCe.normalize(t)},relative(e,t){if(DCe(e,"from"),DCe(t,"to"),e===t)return"";const i=RCe.resolve(e),n=RCe.resolve(t);if(i===n)return"";if((e=i.toLowerCase())===(t=n.toLowerCase()))return"";let o=0;for(;o<e.length&&e.charCodeAt(o)===xCe;)o++;let s=e.length;for(;s-1>o&&e.charCodeAt(s-1)===xCe;)s--;const r=s-o;let a=0;for(;a<t.length&&t.charCodeAt(a)===xCe;)a++;let l=t.length;for(;l-1>a&&t.charCodeAt(l-1)===xCe;)l--;const d=l-a,h=r<d?r:d;let c=-1,u=0;for(;u<h;u++){const i=e.charCodeAt(o+u);if(i!==t.charCodeAt(a+u))break;i===xCe&&(c=u)}if(u!==h){if(-1===c)return n}else{if(d>h){if(t.charCodeAt(a+u)===xCe)return n.slice(a+u+1);if(2===u)return n.slice(a+u)}r>h&&(e.charCodeAt(o+u)===xCe?c=u:2===u&&(c=3)),-1===c&&(c=0)}let g="";for(u=o+c+1;u<=s;++u)u!==s&&e.charCodeAt(u)!==xCe||(g+=0===g.length?"..":"\\..");return a+=c,g.length>0?`${g}${n.slice(a,l)}`:(n.charCodeAt(a)===xCe&&++a,n.slice(a,l))},toNamespacedPath(e){if("string"!=typeof e||0===e.length)return e;const t=RCe.resolve(e);if(t.length<=2)return e;if(t.charCodeAt(0)===xCe){if(t.charCodeAt(1)===xCe){const e=t.charCodeAt(2);if(63!==e&&e!==yCe)return`\\\\?\\UNC\\${t.slice(2)}`}}else if(TCe(t.charCodeAt(0))&&t.charCodeAt(1)===kCe&&t.charCodeAt(2)===xCe)return`\\\\?\\${t}`;return e},dirname(e){DCe(e,"path");const t=e.length;if(0===t)return".";let i=-1,n=0;const o=e.charCodeAt(0);if(1===t)return NCe(o)?e:".";if(NCe(o)){if(i=n=1,NCe(e.charCodeAt(1))){let o=2,s=o;for(;o<t&&!NCe(e.charCodeAt(o));)o++;if(o<t&&o!==s){for(s=o;o<t&&NCe(e.charCodeAt(o));)o++;if(o<t&&o!==s){for(s=o;o<t&&!NCe(e.charCodeAt(o));)o++;if(o===t)return e;o!==s&&(i=n=o+1)}}}}else TCe(o)&&e.charCodeAt(1)===kCe&&(i=t>2&&NCe(e.charCodeAt(2))?3:2,n=i);let s=-1,r=!0;for(let i=t-1;i>=n;--i)if(NCe(e.charCodeAt(i))){if(!r){s=i;break}}else r=!1;if(-1===s){if(-1===i)return".";s=i}return e.slice(0,s)},basename(e,t){void 0!==t&&DCe(t,"ext"),DCe(e,"path");let i,n=0,o=-1,s=!0;if(e.length>=2&&TCe(e.charCodeAt(0))&&e.charCodeAt(1)===kCe&&(n=2),void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let r=t.length-1,a=-1;for(i=e.length-1;i>=n;--i){const l=e.charCodeAt(i);if(NCe(l)){if(!s){n=i+1;break}}else-1===a&&(s=!1,a=i+1),r>=0&&(l===t.charCodeAt(r)?-1==--r&&(o=i):(r=-1,o=a))}return n===o?o=a:-1===o&&(o=e.length),e.slice(n,o)}for(i=e.length-1;i>=n;--i)if(NCe(e.charCodeAt(i))){if(!s){n=i+1;break}}else-1===o&&(s=!1,o=i+1);return-1===o?"":e.slice(n,o)},extname(e){DCe(e,"path");let t=0,i=-1,n=0,o=-1,s=!0,r=0;e.length>=2&&e.charCodeAt(1)===kCe&&TCe(e.charCodeAt(0))&&(t=n=2);for(let a=e.length-1;a>=t;--a){const t=e.charCodeAt(a);if(NCe(t)){if(!s){n=a+1;break}}else-1===o&&(s=!1,o=a+1),t===yCe?-1===i?i=a:1!==r&&(r=1):-1!==i&&(r=-1)}return-1===i||-1===o||0===r||1===r&&i===o-1&&i===n+1?"":e.slice(i,o)},format:ACe.bind(null,"\\"),parse(e){DCe(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.length;let n=0,o=e.charCodeAt(0);if(1===i)return NCe(o)?(t.root=t.dir=e,t):(t.base=t.name=e,t);if(NCe(o)){if(n=1,NCe(e.charCodeAt(1))){let t=2,o=t;for(;t<i&&!NCe(e.charCodeAt(t));)t++;if(t<i&&t!==o){for(o=t;t<i&&NCe(e.charCodeAt(t));)t++;if(t<i&&t!==o){for(o=t;t<i&&!NCe(e.charCodeAt(t));)t++;t===i?n=t:t!==o&&(n=t+1)}}}}else if(TCe(o)&&e.charCodeAt(1)===kCe){if(i<=2)return t.root=t.dir=e,t;if(n=2,NCe(e.charCodeAt(2))){if(3===i)return t.root=t.dir=e,t;n=3}}n>0&&(t.root=e.slice(0,n));let s=-1,r=n,a=-1,l=!0,d=e.length-1,h=0;for(;d>=n;--d)if(o=e.charCodeAt(d),NCe(o)){if(!l){r=d+1;break}}else-1===a&&(l=!1,a=d+1),o===yCe?-1===s?s=d:1!==h&&(h=1):-1!==s&&(h=-1);return-1!==a&&(-1===s||0===h||1===h&&s===a-1&&s===r+1?t.base=t.name=e.slice(r,a):(t.name=e.slice(r,s),t.base=e.slice(r,a),t.ext=e.slice(s,a))),t.dir=r>0&&r!==n?e.slice(0,r-1):t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},OCe=(()=>{if(ECe){const e=/\\/g;return()=>{const t=bCe().replace(e,"/");return t.slice(t.indexOf("/"))}}return()=>bCe()})(),PCe={resolve(...e){let t="",i=!1;for(let n=e.length-1;n>=-1&&!i;n--){const o=n>=0?e[n]:OCe();DCe(o,"path"),0!==o.length&&(t=`${o}/${t}`,i=o.charCodeAt(0)===SCe)}return t=MCe(t,!i,"/",ICe),i?`/${t}`:t.length>0?t:"."},normalize(e){if(DCe(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===SCe,i=e.charCodeAt(e.length-1)===SCe;return 0===(e=MCe(e,!t,"/",ICe)).length?t?"/":i?"./":".":(i&&(e+="/"),t?`/${e}`:e)},isAbsolute:e=>(DCe(e,"path"),e.length>0&&e.charCodeAt(0)===SCe),join(...e){if(0===e.length)return".";let t;for(let i=0;i<e.length;++i){const n=e[i];DCe(n,"path"),n.length>0&&(void 0===t?t=n:t+=`/${n}`)}return void 0===t?".":PCe.normalize(t)},relative(e,t){if(DCe(e,"from"),DCe(t,"to"),e===t)return"";if((e=PCe.resolve(e))===(t=PCe.resolve(t)))return"";const i=e.length,n=i-1,o=t.length-1,s=n<o?n:o;let r=-1,a=0;for(;a<s;a++){const i=e.charCodeAt(1+a);if(i!==t.charCodeAt(1+a))break;i===SCe&&(r=a)}if(a===s)if(o>s){if(t.charCodeAt(1+a)===SCe)return t.slice(1+a+1);if(0===a)return t.slice(1+a)}else n>s&&(e.charCodeAt(1+a)===SCe?r=a:0===a&&(r=0));let l="";for(a=1+r+1;a<=i;++a)a!==i&&e.charCodeAt(a)!==SCe||(l+=0===l.length?"..":"/..");return`${l}${t.slice(1+r)}`},toNamespacedPath:e=>e,dirname(e){if(DCe(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===SCe;let i=-1,n=!0;for(let t=e.length-1;t>=1;--t)if(e.charCodeAt(t)===SCe){if(!n){i=t;break}}else n=!1;return-1===i?t?"/":".":t&&1===i?"//":e.slice(0,i)},basename(e,t){void 0!==t&&DCe(t,"ext"),DCe(e,"path");let i,n=0,o=-1,s=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let r=t.length-1,a=-1;for(i=e.length-1;i>=0;--i){const l=e.charCodeAt(i);if(l===SCe){if(!s){n=i+1;break}}else-1===a&&(s=!1,a=i+1),r>=0&&(l===t.charCodeAt(r)?-1==--r&&(o=i):(r=-1,o=a))}return n===o?o=a:-1===o&&(o=e.length),e.slice(n,o)}for(i=e.length-1;i>=0;--i)if(e.charCodeAt(i)===SCe){if(!s){n=i+1;break}}else-1===o&&(s=!1,o=i+1);return-1===o?"":e.slice(n,o)},extname(e){DCe(e,"path");let t=-1,i=0,n=-1,o=!0,s=0;for(let r=e.length-1;r>=0;--r){const a=e.charCodeAt(r);if(a!==SCe)-1===n&&(o=!1,n=r+1),a===yCe?-1===t?t=r:1!==s&&(s=1):-1!==t&&(s=-1);else if(!o){i=r+1;break}}return-1===t||-1===n||0===s||1===s&&t===n-1&&t===i+1?"":e.slice(t,n)},format:ACe.bind(null,"/"),parse(e){DCe(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.charCodeAt(0)===SCe;let n;i?(t.root="/",n=1):n=0;let o=-1,s=0,r=-1,a=!0,l=e.length-1,d=0;for(;l>=n;--l){const t=e.charCodeAt(l);if(t!==SCe)-1===r&&(a=!1,r=l+1),t===yCe?-1===o?o=l:1!==d&&(d=1):-1!==o&&(d=-1);else if(!a){s=l+1;break}}if(-1!==r){const n=0===s&&i?1:s;-1===o||0===d||1===d&&o===r-1&&o===s+1?t.base=t.name=e.slice(n,r):(t.name=e.slice(n,o),t.base=e.slice(n,r),t.ext=e.slice(o,r))}return s>0?t.dir=e.slice(0,s-1):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};PCe.win32=RCe.win32=RCe,PCe.posix=RCe.posix=PCe;const FCe=ECe?RCe.normalize:PCe.normalize,BCe=ECe?RCe.resolve:PCe.resolve,WCe=ECe?RCe.relative:PCe.relative,VCe=ECe?RCe.dirname:PCe.dirname,HCe=ECe?RCe.basename:PCe.basename,zCe=ECe?RCe.extname:PCe.extname,UCe=ECe?RCe.sep:PCe.sep,KCe=/^\w[\w\d+.-]*$/,jCe=/^\//,qCe=/^\/\//;function $Ce(e,t){if(!e.scheme&&t)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!KCe.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!jCe.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(qCe.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}const GCe="",ZCe="/",YCe=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class QCe{static isUri(e){return e instanceof QCe||!!e&&"string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString}constructor(e,t,i,n,o,s=!1){"object"==typeof e?(this.scheme=e.scheme||GCe,this.authority=e.authority||GCe,this.path=e.path||GCe,this.query=e.query||GCe,this.fragment=e.fragment||GCe):(this.scheme=function(e,t){return e||t?e:"file"}(e,s),this.authority=t||GCe,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==ZCe&&(t=ZCe+t):t=ZCe}return t}(this.scheme,i||GCe),this.query=n||GCe,this.fragment=o||GCe,$Ce(this,s))}get fsPath(){return nye(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:n,query:o,fragment:s}=e;return void 0===t?t=this.scheme:null===t&&(t=GCe),void 0===i?i=this.authority:null===i&&(i=GCe),void 0===n?n=this.path:null===n&&(n=GCe),void 0===o?o=this.query:null===o&&(o=GCe),void 0===s?s=this.fragment:null===s&&(s=GCe),t===this.scheme&&i===this.authority&&n===this.path&&o===this.query&&s===this.fragment?this:new JCe(t,i,n,o,s)}static parse(e,t=!1){const i=YCe.exec(e);return i?new JCe(i[2]||GCe,aye(i[4]||GCe),aye(i[5]||GCe),aye(i[7]||GCe),aye(i[9]||GCe),t):new JCe(GCe,GCe,GCe,GCe,GCe)}static file(e){let t=GCe;if(Lve&&(e=e.replace(/\\/g,ZCe)),e[0]===ZCe&&e[1]===ZCe){const i=e.indexOf(ZCe,2);-1===i?(t=e.substring(2),e=ZCe):(t=e.substring(2,i),e=e.substring(i)||ZCe)}return new JCe("file",t,e,GCe,GCe)}static from(e){const t=new JCe(e.scheme,e.authority,e.path,e.query,e.fragment);return $Ce(t,!0),t}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return i=Lve&&"file"===e.scheme?QCe.file(RCe.join(nye(e,!0),...t)).path:PCe.join(e.path,...t),e.with({path:i})}toString(e=!1){return oye(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof QCe)return e;{const t=new JCe(e);return t._formatted=e.external,t._fsPath=e._sep===XCe?e.fsPath:null,t}}return e}}const XCe=Lve?1:void 0;class JCe extends QCe{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=nye(this,!1)),this._fsPath}toString(e=!1){return e?oye(this,!0):(this._formatted||(this._formatted=oye(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=XCe),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}const eye={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function tye(e,t,i){let n,o=-1;for(let s=0;s<e.length;s++){const r=e.charCodeAt(s);if(r>=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||45===r||46===r||95===r||126===r||t&&47===r||i&&91===r||i&&93===r||i&&58===r)-1!==o&&(n+=encodeURIComponent(e.substring(o,s)),o=-1),void 0!==n&&(n+=e.charAt(s));else{void 0===n&&(n=e.substr(0,s));const t=eye[r];void 0!==t?(-1!==o&&(n+=encodeURIComponent(e.substring(o,s)),o=-1),n+=t):-1===o&&(o=s)}}return-1!==o&&(n+=encodeURIComponent(e.substring(o))),void 0!==n?n:e}function iye(e){let t;for(let i=0;i<e.length;i++){const n=e.charCodeAt(i);35===n||63===n?(void 0===t&&(t=e.substr(0,i)),t+=eye[n]):void 0!==t&&(t+=e[i])}return void 0!==t?t:e}function nye(e,t){let i;return i=e.authority&&e.path.length>1&&"file"===e.scheme?`//${e.authority}${e.path}`:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,Lve&&(i=i.replace(/\//g,"\\")),i}function oye(e,t){const i=t?iye:tye;let n="",{scheme:o,authority:s,path:r,query:a,fragment:l}=e;if(o&&(n+=o,n+=":"),(s||"file"===o)&&(n+=ZCe,n+=ZCe),s){let e=s.indexOf("@");if(-1!==e){const t=s.substr(0,e);s=s.substr(e+1),e=t.lastIndexOf(":"),-1===e?n+=i(t,!1,!1):(n+=i(t.substr(0,e),!1,!1),n+=":",n+=i(t.substr(e+1),!1,!0)),n+="@"}s=s.toLowerCase(),e=s.lastIndexOf(":"),-1===e?n+=i(s,!1,!0):(n+=i(s.substr(0,e),!1,!0),n+=s.substr(e))}if(r){if(r.length>=3&&47===r.charCodeAt(0)&&58===r.charCodeAt(2)){const e=r.charCodeAt(1);e>=65&&e<=90&&(r=`/${String.fromCharCode(e+32)}:${r.substr(3)}`)}else if(r.length>=2&&58===r.charCodeAt(1)){const e=r.charCodeAt(0);e>=65&&e<=90&&(r=`${String.fromCharCode(e+32)}:${r.substr(2)}`)}n+=i(r,!0,!1)}return a&&(n+="?",n+=i(a,!1,!1)),l&&(n+="#",n+=t?l:tye(l,!1,!1)),n}function sye(e){try{return decodeURIComponent(e)}catch(t){return e.length>3?e.substr(0,3)+sye(e.substr(3)):e}}const rye=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function aye(e){return e.match(rye)?e.replace(rye,(e=>sye(e))):e}class lye{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new lye(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return lye.equals(this,e)}static equals(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return lye.isBefore(this,e)}static isBefore(e,t){return e.lineNumber<t.lineNumber||!(t.lineNumber<e.lineNumber)&&e.column<t.column}isBeforeOrEqual(e){return lye.isBeforeOrEqual(this,e)}static isBeforeOrEqual(e,t){return e.lineNumber<t.lineNumber||!(t.lineNumber<e.lineNumber)&&e.column<=t.column}static compare(e,t){const i=0|e.lineNumber,n=0|t.lineNumber;return i===n?(0|e.column)-(0|t.column):i-n}clone(){return new lye(this.lineNumber,this.column)}toString(){return"("+this.lineNumber+","+this.column+")"}static lift(e){return new lye(e.lineNumber,e.column)}static isIPosition(e){return e&&"number"==typeof e.lineNumber&&"number"==typeof e.column}}class dye{constructor(e,t,i,n){e>i||e===i&&t>n?(this.startLineNumber=i,this.startColumn=n,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=n)}isEmpty(){return dye.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return dye.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<e.startColumn||t.lineNumber===e.endLineNumber&&t.column>e.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return dye.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>e.endColumn)}strictContainsRange(e){return dye.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return dye.plusRange(this,e)}static plusRange(e,t){let i,n,o,s;return t.startLineNumber<e.startLineNumber?(i=t.startLineNumber,n=t.startColumn):t.startLineNumber===e.startLineNumber?(i=t.startLineNumber,n=Math.min(t.startColumn,e.startColumn)):(i=e.startLineNumber,n=e.startColumn),t.endLineNumber>e.endLineNumber?(o=t.endLineNumber,s=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,s=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,s=e.endColumn),new dye(i,n,o,s)}intersectRanges(e){return dye.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,s=e.endColumn;const r=t.startLineNumber,a=t.startColumn,l=t.endLineNumber,d=t.endColumn;return i<r?(i=r,n=a):i===r&&(n=Math.max(n,a)),o>l?(o=l,s=d):o===l&&(s=Math.min(s,d)),i>o||i===o&&n>s?null:new dye(i,n,o,s)}equalsRange(e){return dye.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t||!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return dye.getEndPosition(this)}static getEndPosition(e){return new lye(e.endLineNumber,e.endColumn)}getStartPosition(){return dye.getStartPosition(this)}static getStartPosition(e){return new lye(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new dye(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new dye(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return dye.collapseToStart(this)}static collapseToStart(e){return new dye(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return dye.collapseToEnd(this)}static collapseToEnd(e){return new dye(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new dye(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new dye(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new dye(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&"number"==typeof e.startLineNumber&&"number"==typeof e.startColumn&&"number"==typeof e.endLineNumber&&"number"==typeof e.endColumn}static areIntersectingOrTouching(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn)}static areIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<=t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<=e.startColumn)}static compareRangesUsingStarts(e,t){if(e&&t){const i=0|e.startLineNumber,n=0|t.startLineNumber;if(i===n){const i=0|e.startColumn,n=0|t.startColumn;if(i===n){const i=0|e.endLineNumber,n=0|t.endLineNumber;return i===n?(0|e.endColumn)-(0|t.endColumn):i-n}return i-n}return i-n}return(e?1:0)-(t?1:0)}static compareRangesUsingEnds(e,t){return e.endLineNumber===t.endLineNumber?e.endColumn===t.endColumn?e.startLineNumber===t.startLineNumber?e.startColumn-t.startColumn:e.startLineNumber-t.startLineNumber:e.endColumn-t.endColumn:e.endLineNumber-t.endLineNumber}static spansMultipleLines(e){return e.endLineNumber>e.startLineNumber}toJSON(){return this}}class hye extends dye{constructor(e,t,i,n){super(e,t,i,n),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=n}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return hye.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return 0===this.getDirection()?new hye(this.startLineNumber,this.startColumn,e,t):new hye(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new lye(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new lye(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return 0===this.getDirection()?new hye(e,t,this.endLineNumber,this.endColumn):new hye(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new hye(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return 0===t?new hye(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new hye(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new hye(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let i=0,n=e.length;i<n;i++)if(!this.selectionsEqual(e[i],t[i]))return!1;return!0}static isISelection(e){return e&&"number"==typeof e.selectionStartLineNumber&&"number"==typeof e.selectionStartColumn&&"number"==typeof e.positionLineNumber&&"number"==typeof e.positionColumn}static createWithDirection(e,t,i,n,o){return 0===o?new hye(e,t,i,n):new hye(i,n,e,t)}}const cye=Object.create(null);function uye(e,t){if(fbe(t)){const i=cye[t];if(void 0===i)throw new Error(`${e} references an unknown codicon: ${t}`);t=i}return cye[e]=t,{id:e}}function gye(){return cye}const pye={add:uye("add",6e4),plus:uye("plus",6e4),gistNew:uye("gist-new",6e4),repoCreate:uye("repo-create",6e4),lightbulb:uye("lightbulb",60001),lightBulb:uye("light-bulb",60001),repo:uye("repo",60002),repoDelete:uye("repo-delete",60002),gistFork:uye("gist-fork",60003),repoForked:uye("repo-forked",60003),gitPullRequest:uye("git-pull-request",60004),gitPullRequestAbandoned:uye("git-pull-request-abandoned",60004),recordKeys:uye("record-keys",60005),keyboard:uye("keyboard",60005),tag:uye("tag",60006),tagAdd:uye("tag-add",60006),tagRemove:uye("tag-remove",60006),person:uye("person",60007),personFollow:uye("person-follow",60007),personOutline:uye("person-outline",60007),personFilled:uye("person-filled",60007),gitBranch:uye("git-branch",60008),gitBranchCreate:uye("git-branch-create",60008),gitBranchDelete:uye("git-branch-delete",60008),sourceControl:uye("source-control",60008),mirror:uye("mirror",60009),mirrorPublic:uye("mirror-public",60009),star:uye("star",60010),starAdd:uye("star-add",60010),starDelete:uye("star-delete",60010),starEmpty:uye("star-empty",60010),comment:uye("comment",60011),commentAdd:uye("comment-add",60011),alert:uye("alert",60012),warning:uye("warning",60012),search:uye("search",60013),searchSave:uye("search-save",60013),logOut:uye("log-out",60014),signOut:uye("sign-out",60014),logIn:uye("log-in",60015),signIn:uye("sign-in",60015),eye:uye("eye",60016),eyeUnwatch:uye("eye-unwatch",60016),eyeWatch:uye("eye-watch",60016),circleFilled:uye("circle-filled",60017),primitiveDot:uye("primitive-dot",60017),closeDirty:uye("close-dirty",60017),debugBreakpoint:uye("debug-breakpoint",60017),debugBreakpointDisabled:uye("debug-breakpoint-disabled",60017),debugHint:uye("debug-hint",60017),primitiveSquare:uye("primitive-square",60018),edit:uye("edit",60019),pencil:uye("pencil",60019),info:uye("info",60020),issueOpened:uye("issue-opened",60020),gistPrivate:uye("gist-private",60021),gitForkPrivate:uye("git-fork-private",60021),lock:uye("lock",60021),mirrorPrivate:uye("mirror-private",60021),close:uye("close",60022),removeClose:uye("remove-close",60022),x:uye("x",60022),repoSync:uye("repo-sync",60023),sync:uye("sync",60023),clone:uye("clone",60024),desktopDownload:uye("desktop-download",60024),beaker:uye("beaker",60025),microscope:uye("microscope",60025),vm:uye("vm",60026),deviceDesktop:uye("device-desktop",60026),file:uye("file",60027),fileText:uye("file-text",60027),more:uye("more",60028),ellipsis:uye("ellipsis",60028),kebabHorizontal:uye("kebab-horizontal",60028),mailReply:uye("mail-reply",60029),reply:uye("reply",60029),organization:uye("organization",60030),organizationFilled:uye("organization-filled",60030),organizationOutline:uye("organization-outline",60030),newFile:uye("new-file",60031),fileAdd:uye("file-add",60031),newFolder:uye("new-folder",60032),fileDirectoryCreate:uye("file-directory-create",60032),trash:uye("trash",60033),trashcan:uye("trashcan",60033),history:uye("history",60034),clock:uye("clock",60034),folder:uye("folder",60035),fileDirectory:uye("file-directory",60035),symbolFolder:uye("symbol-folder",60035),logoGithub:uye("logo-github",60036),markGithub:uye("mark-github",60036),github:uye("github",60036),terminal:uye("terminal",60037),console:uye("console",60037),repl:uye("repl",60037),zap:uye("zap",60038),symbolEvent:uye("symbol-event",60038),error:uye("error",60039),stop:uye("stop",60039),variable:uye("variable",60040),symbolVariable:uye("symbol-variable",60040),array:uye("array",60042),symbolArray:uye("symbol-array",60042),symbolModule:uye("symbol-module",60043),symbolPackage:uye("symbol-package",60043),symbolNamespace:uye("symbol-namespace",60043),symbolObject:uye("symbol-object",60043),symbolMethod:uye("symbol-method",60044),symbolFunction:uye("symbol-function",60044),symbolConstructor:uye("symbol-constructor",60044),symbolBoolean:uye("symbol-boolean",60047),symbolNull:uye("symbol-null",60047),symbolNumeric:uye("symbol-numeric",60048),symbolNumber:uye("symbol-number",60048),symbolStructure:uye("symbol-structure",60049),symbolStruct:uye("symbol-struct",60049),symbolParameter:uye("symbol-parameter",60050),symbolTypeParameter:uye("symbol-type-parameter",60050),symbolKey:uye("symbol-key",60051),symbolText:uye("symbol-text",60051),symbolReference:uye("symbol-reference",60052),goToFile:uye("go-to-file",60052),symbolEnum:uye("symbol-enum",60053),symbolValue:uye("symbol-value",60053),symbolRuler:uye("symbol-ruler",60054),symbolUnit:uye("symbol-unit",60054),activateBreakpoints:uye("activate-breakpoints",60055),archive:uye("archive",60056),arrowBoth:uye("arrow-both",60057),arrowDown:uye("arrow-down",60058),arrowLeft:uye("arrow-left",60059),arrowRight:uye("arrow-right",60060),arrowSmallDown:uye("arrow-small-down",60061),arrowSmallLeft:uye("arrow-small-left",60062),arrowSmallRight:uye("arrow-small-right",60063),arrowSmallUp:uye("arrow-small-up",60064),arrowUp:uye("arrow-up",60065),bell:uye("bell",60066),bold:uye("bold",60067),book:uye("book",60068),bookmark:uye("bookmark",60069),debugBreakpointConditionalUnverified:uye("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:uye("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:uye("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:uye("debug-breakpoint-data-unverified",60072),debugBreakpointData:uye("debug-breakpoint-data",60073),debugBreakpointDataDisabled:uye("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:uye("debug-breakpoint-log-unverified",60074),debugBreakpointLog:uye("debug-breakpoint-log",60075),debugBreakpointLogDisabled:uye("debug-breakpoint-log-disabled",60075),briefcase:uye("briefcase",60076),broadcast:uye("broadcast",60077),browser:uye("browser",60078),bug:uye("bug",60079),calendar:uye("calendar",60080),caseSensitive:uye("case-sensitive",60081),check:uye("check",60082),checklist:uye("checklist",60083),chevronDown:uye("chevron-down",60084),dropDownButton:uye("drop-down-button",60084),chevronLeft:uye("chevron-left",60085),chevronRight:uye("chevron-right",60086),chevronUp:uye("chevron-up",60087),chromeClose:uye("chrome-close",60088),chromeMaximize:uye("chrome-maximize",60089),chromeMinimize:uye("chrome-minimize",60090),chromeRestore:uye("chrome-restore",60091),circle:uye("circle",60092),circleOutline:uye("circle-outline",60092),debugBreakpointUnverified:uye("debug-breakpoint-unverified",60092),circleSlash:uye("circle-slash",60093),circuitBoard:uye("circuit-board",60094),clearAll:uye("clear-all",60095),clippy:uye("clippy",60096),closeAll:uye("close-all",60097),cloudDownload:uye("cloud-download",60098),cloudUpload:uye("cloud-upload",60099),code:uye("code",60100),collapseAll:uye("collapse-all",60101),colorMode:uye("color-mode",60102),commentDiscussion:uye("comment-discussion",60103),compareChanges:uye("compare-changes",60157),creditCard:uye("credit-card",60105),dash:uye("dash",60108),dashboard:uye("dashboard",60109),database:uye("database",60110),debugContinue:uye("debug-continue",60111),debugDisconnect:uye("debug-disconnect",60112),debugPause:uye("debug-pause",60113),debugRestart:uye("debug-restart",60114),debugStart:uye("debug-start",60115),debugStepInto:uye("debug-step-into",60116),debugStepOut:uye("debug-step-out",60117),debugStepOver:uye("debug-step-over",60118),debugStop:uye("debug-stop",60119),debug:uye("debug",60120),deviceCameraVideo:uye("device-camera-video",60121),deviceCamera:uye("device-camera",60122),deviceMobile:uye("device-mobile",60123),diffAdded:uye("diff-added",60124),diffIgnored:uye("diff-ignored",60125),diffModified:uye("diff-modified",60126),diffRemoved:uye("diff-removed",60127),diffRenamed:uye("diff-renamed",60128),diff:uye("diff",60129),discard:uye("discard",60130),editorLayout:uye("editor-layout",60131),emptyWindow:uye("empty-window",60132),exclude:uye("exclude",60133),extensions:uye("extensions",60134),eyeClosed:uye("eye-closed",60135),fileBinary:uye("file-binary",60136),fileCode:uye("file-code",60137),fileMedia:uye("file-media",60138),filePdf:uye("file-pdf",60139),fileSubmodule:uye("file-submodule",60140),fileSymlinkDirectory:uye("file-symlink-directory",60141),fileSymlinkFile:uye("file-symlink-file",60142),fileZip:uye("file-zip",60143),files:uye("files",60144),filter:uye("filter",60145),flame:uye("flame",60146),foldDown:uye("fold-down",60147),foldUp:uye("fold-up",60148),fold:uye("fold",60149),folderActive:uye("folder-active",60150),folderOpened:uye("folder-opened",60151),gear:uye("gear",60152),gift:uye("gift",60153),gistSecret:uye("gist-secret",60154),gist:uye("gist",60155),gitCommit:uye("git-commit",60156),gitCompare:uye("git-compare",60157),gitMerge:uye("git-merge",60158),githubAction:uye("github-action",60159),githubAlt:uye("github-alt",60160),globe:uye("globe",60161),grabber:uye("grabber",60162),graph:uye("graph",60163),gripper:uye("gripper",60164),heart:uye("heart",60165),home:uye("home",60166),horizontalRule:uye("horizontal-rule",60167),hubot:uye("hubot",60168),inbox:uye("inbox",60169),issueClosed:uye("issue-closed",60324),issueReopened:uye("issue-reopened",60171),issues:uye("issues",60172),italic:uye("italic",60173),jersey:uye("jersey",60174),json:uye("json",60175),bracket:uye("bracket",60175),kebabVertical:uye("kebab-vertical",60176),key:uye("key",60177),law:uye("law",60178),lightbulbAutofix:uye("lightbulb-autofix",60179),linkExternal:uye("link-external",60180),link:uye("link",60181),listOrdered:uye("list-ordered",60182),listUnordered:uye("list-unordered",60183),liveShare:uye("live-share",60184),loading:uye("loading",60185),location:uye("location",60186),mailRead:uye("mail-read",60187),mail:uye("mail",60188),markdown:uye("markdown",60189),megaphone:uye("megaphone",60190),mention:uye("mention",60191),milestone:uye("milestone",60192),mortarBoard:uye("mortar-board",60193),move:uye("move",60194),multipleWindows:uye("multiple-windows",60195),mute:uye("mute",60196),noNewline:uye("no-newline",60197),note:uye("note",60198),octoface:uye("octoface",60199),openPreview:uye("open-preview",60200),package_:uye("package",60201),paintcan:uye("paintcan",60202),pin:uye("pin",60203),play:uye("play",60204),run:uye("run",60204),plug:uye("plug",60205),preserveCase:uye("preserve-case",60206),preview:uye("preview",60207),project:uye("project",60208),pulse:uye("pulse",60209),question:uye("question",60210),quote:uye("quote",60211),radioTower:uye("radio-tower",60212),reactions:uye("reactions",60213),references:uye("references",60214),refresh:uye("refresh",60215),regex:uye("regex",60216),remoteExplorer:uye("remote-explorer",60217),remote:uye("remote",60218),remove:uye("remove",60219),replaceAll:uye("replace-all",60220),replace:uye("replace",60221),repoClone:uye("repo-clone",60222),repoForcePush:uye("repo-force-push",60223),repoPull:uye("repo-pull",60224),repoPush:uye("repo-push",60225),report:uye("report",60226),requestChanges:uye("request-changes",60227),rocket:uye("rocket",60228),rootFolderOpened:uye("root-folder-opened",60229),rootFolder:uye("root-folder",60230),rss:uye("rss",60231),ruby:uye("ruby",60232),saveAll:uye("save-all",60233),saveAs:uye("save-as",60234),save:uye("save",60235),screenFull:uye("screen-full",60236),screenNormal:uye("screen-normal",60237),searchStop:uye("search-stop",60238),server:uye("server",60240),settingsGear:uye("settings-gear",60241),settings:uye("settings",60242),shield:uye("shield",60243),smiley:uye("smiley",60244),sortPrecedence:uye("sort-precedence",60245),splitHorizontal:uye("split-horizontal",60246),splitVertical:uye("split-vertical",60247),squirrel:uye("squirrel",60248),starFull:uye("star-full",60249),starHalf:uye("star-half",60250),symbolClass:uye("symbol-class",60251),symbolColor:uye("symbol-color",60252),symbolCustomColor:uye("symbol-customcolor",60252),symbolConstant:uye("symbol-constant",60253),symbolEnumMember:uye("symbol-enum-member",60254),symbolField:uye("symbol-field",60255),symbolFile:uye("symbol-file",60256),symbolInterface:uye("symbol-interface",60257),symbolKeyword:uye("symbol-keyword",60258),symbolMisc:uye("symbol-misc",60259),symbolOperator:uye("symbol-operator",60260),symbolProperty:uye("symbol-property",60261),wrench:uye("wrench",60261),wrenchSubaction:uye("wrench-subaction",60261),symbolSnippet:uye("symbol-snippet",60262),tasklist:uye("tasklist",60263),telescope:uye("telescope",60264),textSize:uye("text-size",60265),threeBars:uye("three-bars",60266),thumbsdown:uye("thumbsdown",60267),thumbsup:uye("thumbsup",60268),tools:uye("tools",60269),triangleDown:uye("triangle-down",60270),triangleLeft:uye("triangle-left",60271),triangleRight:uye("triangle-right",60272),triangleUp:uye("triangle-up",60273),twitter:uye("twitter",60274),unfold:uye("unfold",60275),unlock:uye("unlock",60276),unmute:uye("unmute",60277),unverified:uye("unverified",60278),verified:uye("verified",60279),versions:uye("versions",60280),vmActive:uye("vm-active",60281),vmOutline:uye("vm-outline",60282),vmRunning:uye("vm-running",60283),watch:uye("watch",60284),whitespace:uye("whitespace",60285),wholeWord:uye("whole-word",60286),window:uye("window",60287),wordWrap:uye("word-wrap",60288),zoomIn:uye("zoom-in",60289),zoomOut:uye("zoom-out",60290),listFilter:uye("list-filter",60291),listFlat:uye("list-flat",60292),listSelection:uye("list-selection",60293),selection:uye("selection",60293),listTree:uye("list-tree",60294),debugBreakpointFunctionUnverified:uye("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:uye("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:uye("debug-breakpoint-function-disabled",60296),debugStackframeActive:uye("debug-stackframe-active",60297),circleSmallFilled:uye("circle-small-filled",60298),debugStackframeDot:uye("debug-stackframe-dot",60298),debugStackframe:uye("debug-stackframe",60299),debugStackframeFocused:uye("debug-stackframe-focused",60299),debugBreakpointUnsupported:uye("debug-breakpoint-unsupported",60300),symbolString:uye("symbol-string",60301),debugReverseContinue:uye("debug-reverse-continue",60302),debugStepBack:uye("debug-step-back",60303),debugRestartFrame:uye("debug-restart-frame",60304),callIncoming:uye("call-incoming",60306),callOutgoing:uye("call-outgoing",60307),menu:uye("menu",60308),expandAll:uye("expand-all",60309),feedback:uye("feedback",60310),groupByRefType:uye("group-by-ref-type",60311),ungroupByRefType:uye("ungroup-by-ref-type",60312),account:uye("account",60313),bellDot:uye("bell-dot",60314),debugConsole:uye("debug-console",60315),library:uye("library",60316),output:uye("output",60317),runAll:uye("run-all",60318),syncIgnored:uye("sync-ignored",60319),pinned:uye("pinned",60320),githubInverted:uye("github-inverted",60321),debugAlt:uye("debug-alt",60305),serverProcess:uye("server-process",60322),serverEnvironment:uye("server-environment",60323),pass:uye("pass",60324),stopCircle:uye("stop-circle",60325),playCircle:uye("play-circle",60326),record:uye("record",60327),debugAltSmall:uye("debug-alt-small",60328),vmConnect:uye("vm-connect",60329),cloud:uye("cloud",60330),merge:uye("merge",60331),exportIcon:uye("export",60332),graphLeft:uye("graph-left",60333),magnet:uye("magnet",60334),notebook:uye("notebook",60335),redo:uye("redo",60336),checkAll:uye("check-all",60337),pinnedDirty:uye("pinned-dirty",60338),passFilled:uye("pass-filled",60339),circleLargeFilled:uye("circle-large-filled",60340),circleLarge:uye("circle-large",60341),circleLargeOutline:uye("circle-large-outline",60341),combine:uye("combine",60342),gather:uye("gather",60342),table:uye("table",60343),variableGroup:uye("variable-group",60344),typeHierarchy:uye("type-hierarchy",60345),typeHierarchySub:uye("type-hierarchy-sub",60346),typeHierarchySuper:uye("type-hierarchy-super",60347),gitPullRequestCreate:uye("git-pull-request-create",60348),runAbove:uye("run-above",60349),runBelow:uye("run-below",60350),notebookTemplate:uye("notebook-template",60351),debugRerun:uye("debug-rerun",60352),workspaceTrusted:uye("workspace-trusted",60353),workspaceUntrusted:uye("workspace-untrusted",60354),workspaceUnspecified:uye("workspace-unspecified",60355),terminalCmd:uye("terminal-cmd",60356),terminalDebian:uye("terminal-debian",60357),terminalLinux:uye("terminal-linux",60358),terminalPowershell:uye("terminal-powershell",60359),terminalTmux:uye("terminal-tmux",60360),terminalUbuntu:uye("terminal-ubuntu",60361),terminalBash:uye("terminal-bash",60362),arrowSwap:uye("arrow-swap",60363),copy:uye("copy",60364),personAdd:uye("person-add",60365),filterFilled:uye("filter-filled",60366),wand:uye("wand",60367),debugLineByLine:uye("debug-line-by-line",60368),inspect:uye("inspect",60369),layers:uye("layers",60370),layersDot:uye("layers-dot",60371),layersActive:uye("layers-active",60372),compass:uye("compass",60373),compassDot:uye("compass-dot",60374),compassActive:uye("compass-active",60375),azure:uye("azure",60376),issueDraft:uye("issue-draft",60377),gitPullRequestClosed:uye("git-pull-request-closed",60378),gitPullRequestDraft:uye("git-pull-request-draft",60379),debugAll:uye("debug-all",60380),debugCoverage:uye("debug-coverage",60381),runErrors:uye("run-errors",60382),folderLibrary:uye("folder-library",60383),debugContinueSmall:uye("debug-continue-small",60384),beakerStop:uye("beaker-stop",60385),graphLine:uye("graph-line",60386),graphScatter:uye("graph-scatter",60387),pieChart:uye("pie-chart",60388),bracketDot:uye("bracket-dot",60389),bracketError:uye("bracket-error",60390),lockSmall:uye("lock-small",60391),azureDevops:uye("azure-devops",60392),verifiedFilled:uye("verified-filled",60393),newLine:uye("newline",60394),layout:uye("layout",60395),layoutActivitybarLeft:uye("layout-activitybar-left",60396),layoutActivitybarRight:uye("layout-activitybar-right",60397),layoutPanelLeft:uye("layout-panel-left",60398),layoutPanelCenter:uye("layout-panel-center",60399),layoutPanelJustify:uye("layout-panel-justify",60400),layoutPanelRight:uye("layout-panel-right",60401),layoutPanel:uye("layout-panel",60402),layoutSidebarLeft:uye("layout-sidebar-left",60403),layoutSidebarRight:uye("layout-sidebar-right",60404),layoutStatusbar:uye("layout-statusbar",60405),layoutMenubar:uye("layout-menubar",60406),layoutCentered:uye("layout-centered",60407),layoutSidebarRightOff:uye("layout-sidebar-right-off",60416),layoutPanelOff:uye("layout-panel-off",60417),layoutSidebarLeftOff:uye("layout-sidebar-left-off",60418),target:uye("target",60408),indent:uye("indent",60409),recordSmall:uye("record-small",60410),errorSmall:uye("error-small",60411),arrowCircleDown:uye("arrow-circle-down",60412),arrowCircleLeft:uye("arrow-circle-left",60413),arrowCircleRight:uye("arrow-circle-right",60414),arrowCircleUp:uye("arrow-circle-up",60415),heartFilled:uye("heart-filled",60420),map:uye("map",60421),mapFilled:uye("map-filled",60422),circleSmall:uye("circle-small",60423),bellSlash:uye("bell-slash",60424),bellSlashDot:uye("bell-slash-dot",60425),commentUnresolved:uye("comment-unresolved",60426),gitPullRequestGoToChanges:uye("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:uye("git-pull-request-new-changes",60428),searchFuzzy:uye("search-fuzzy",60429),commentDraft:uye("comment-draft",60430),dialogError:uye("dialog-error","error"),dialogWarning:uye("dialog-warning","warning"),dialogInfo:uye("dialog-info","info"),dialogClose:uye("dialog-close","close"),treeItemExpanded:uye("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:uye("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:uye("tree-filter-on-type-off","list-selection"),treeFilterClear:uye("tree-filter-clear","close"),treeItemLoading:uye("tree-item-loading","loading"),menuSelection:uye("menu-selection","check"),menuSubmenu:uye("menu-submenu","chevron-right"),menuBarMore:uye("menubar-more","more"),scrollbarButtonLeft:uye("scrollbar-button-left","triangle-left"),scrollbarButtonRight:uye("scrollbar-button-right","triangle-right"),scrollbarButtonUp:uye("scrollbar-button-up","triangle-up"),scrollbarButtonDown:uye("scrollbar-button-down","triangle-down"),toolBarMore:uye("toolbar-more","more"),quickInputBack:uye("quick-input-back","arrow-left")};var mye,fye,_ye,vye,bye,wye,Cye,yye=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Sye extends Owe{get isResolved(){return this._isResolved}constructor(e,t,i){super(),this._registry=e,this._languageId=t,this._factory=i,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}resolve(){return yye(this,void 0,void 0,(function*(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}))}_create(){return yye(this,void 0,void 0,(function*(){const e=yield Promise.resolve(this._factory.createTokenizationSupport());this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}))}}class xye{constructor(e,t,i){this._tokenBrand=void 0,this.offset=e,this.type=t,this.language=i}toString(){return"("+this.offset+", "+this.type+")"}}class kye{constructor(e,t){this._tokenizationResultBrand=void 0,this.tokens=e,this.endState=t}}class Lye{constructor(e,t){this._encodedTokenizationResultBrand=void 0,this.tokens=e,this.endState=t}}!function(e){const t=new Map;t.set(0,pye.symbolMethod),t.set(1,pye.symbolFunction),t.set(2,pye.symbolConstructor),t.set(3,pye.symbolField),t.set(4,pye.symbolVariable),t.set(5,pye.symbolClass),t.set(6,pye.symbolStruct),t.set(7,pye.symbolInterface),t.set(8,pye.symbolModule),t.set(9,pye.symbolProperty),t.set(10,pye.symbolEvent),t.set(11,pye.symbolOperator),t.set(12,pye.symbolUnit),t.set(13,pye.symbolValue),t.set(15,pye.symbolEnum),t.set(14,pye.symbolConstant),t.set(15,pye.symbolEnum),t.set(16,pye.symbolEnumMember),t.set(17,pye.symbolKeyword),t.set(27,pye.symbolSnippet),t.set(18,pye.symbolText),t.set(19,pye.symbolColor),t.set(20,pye.symbolFile),t.set(21,pye.symbolReference),t.set(22,pye.symbolCustomColor),t.set(23,pye.symbolFolder),t.set(24,pye.symbolTypeParameter),t.set(25,pye.account),t.set(26,pye.issues),e.toIcon=function(e){let i=t.get(e);return i||(console.info("No codicon found for CompletionItemKind "+e),i=pye.symbolProperty),i};const i=new Map;i.set("method",0),i.set("function",1),i.set("constructor",2),i.set("field",3),i.set("variable",4),i.set("class",5),i.set("struct",6),i.set("interface",7),i.set("module",8),i.set("property",9),i.set("event",10),i.set("operator",11),i.set("unit",12),i.set("value",13),i.set("constant",14),i.set("enum",15),i.set("enum-member",16),i.set("enumMember",16),i.set("keyword",17),i.set("snippet",27),i.set("text",18),i.set("color",19),i.set("file",20),i.set("reference",21),i.set("customcolor",22),i.set("folder",23),i.set("type-parameter",24),i.set("typeParameter",24),i.set("account",25),i.set("issue",26),e.fromString=function(e,t){let n=i.get(e);return void 0!==n||t||(n=9),n}}(mye||(mye={})),function(e){e[e.Automatic=0]="Automatic",e[e.Explicit=1]="Explicit"}(fye||(fye={})),function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(_ye||(_ye={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(vye||(vye={})),function(e){const t=new Map;t.set(0,pye.symbolFile),t.set(1,pye.symbolModule),t.set(2,pye.symbolNamespace),t.set(3,pye.symbolPackage),t.set(4,pye.symbolClass),t.set(5,pye.symbolMethod),t.set(6,pye.symbolProperty),t.set(7,pye.symbolField),t.set(8,pye.symbolConstructor),t.set(9,pye.symbolEnum),t.set(10,pye.symbolInterface),t.set(11,pye.symbolFunction),t.set(12,pye.symbolVariable),t.set(13,pye.symbolConstant),t.set(14,pye.symbolString),t.set(15,pye.symbolNumber),t.set(16,pye.symbolBoolean),t.set(17,pye.symbolArray),t.set(18,pye.symbolObject),t.set(19,pye.symbolKey),t.set(20,pye.symbolNull),t.set(21,pye.symbolEnumMember),t.set(22,pye.symbolStruct),t.set(23,pye.symbolEvent),t.set(24,pye.symbolOperator),t.set(25,pye.symbolTypeParameter),e.toIcon=function(e){let i=t.get(e);return i||(console.info("No codicon found for SymbolKind "+e),i=pye.symbolProperty),i}}(bye||(bye={}));class Dye{constructor(e){this.value=e}}Dye.Comment=new Dye("comment"),Dye.Imports=new Dye("imports"),Dye.Region=new Dye("region"),function(e){e.is=function(e){return!(!e||"object"!=typeof e)&&"string"==typeof e.id&&"string"==typeof e.title}}(wye||(wye={})),function(e){e[e.Type=1]="Type",e[e.Parameter=2]="Parameter"}(Cye||(Cye={}));const Eye=new class{constructor(){this._map=new Map,this._factories=new Map,this._onDidChange=new $we,this.onDidChange=this._onDidChange.event,this._colorMap=null}fire(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,t){return this._map.set(e,t),this.fire([e]),Awe((()=>{this._map.get(e)===t&&(this._map.delete(e),this.fire([e]))}))}registerFactory(e,t){var i;null===(i=this._factories.get(e))||void 0===i||i.dispose();const n=new Sye(this,e,t);return this._factories.set(e,n),Awe((()=>{const t=this._factories.get(e);t&&t===n&&(this._factories.delete(e),t.dispose())}))}getOrCreate(e){return yye(this,void 0,void 0,(function*(){const t=this.get(e);if(t)return t;const i=this._factories.get(e);return!i||i.isResolved?null:(yield i.resolve(),this.get(e))}))}get(e){return this._map.get(e)||null}isResolved(e){if(this.get(e))return!0;const t=this._factories.get(e);return!(t&&!t.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._map.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}};var Nye,Iye,Tye,Mye,Aye,Rye,Oye,Pye,Fye,Bye,Wye,Vye,Hye,zye,Uye,Kye,jye,qye,$ye,Gye,Zye,Yye,Qye,Xye,Jye,eSe,tSe,iSe,nSe,oSe,sSe,rSe,aSe,lSe,dSe,hSe,cSe,uSe;!function(e){e[e.Unknown=0]="Unknown",e[e.Disabled=1]="Disabled",e[e.Enabled=2]="Enabled"}(Nye||(Nye={})),function(e){e[e.Invoke=1]="Invoke",e[e.Auto=2]="Auto"}(Iye||(Iye={})),function(e){e[e.None=0]="None",e[e.KeepWhitespace=1]="KeepWhitespace",e[e.InsertAsSnippet=4]="InsertAsSnippet"}(Tye||(Tye={})),function(e){e[e.Method=0]="Method",e[e.Function=1]="Function",e[e.Constructor=2]="Constructor",e[e.Field=3]="Field",e[e.Variable=4]="Variable",e[e.Class=5]="Class",e[e.Struct=6]="Struct",e[e.Interface=7]="Interface",e[e.Module=8]="Module",e[e.Property=9]="Property",e[e.Event=10]="Event",e[e.Operator=11]="Operator",e[e.Unit=12]="Unit",e[e.Value=13]="Value",e[e.Constant=14]="Constant",e[e.Enum=15]="Enum",e[e.EnumMember=16]="EnumMember",e[e.Keyword=17]="Keyword",e[e.Text=18]="Text",e[e.Color=19]="Color",e[e.File=20]="File",e[e.Reference=21]="Reference",e[e.Customcolor=22]="Customcolor",e[e.Folder=23]="Folder",e[e.TypeParameter=24]="TypeParameter",e[e.User=25]="User",e[e.Issue=26]="Issue",e[e.Snippet=27]="Snippet"}(Mye||(Mye={})),function(e){e[e.Deprecated=1]="Deprecated"}(Aye||(Aye={})),function(e){e[e.Invoke=0]="Invoke",e[e.TriggerCharacter=1]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"}(Rye||(Rye={})),function(e){e[e.EXACT=0]="EXACT",e[e.ABOVE=1]="ABOVE",e[e.BELOW=2]="BELOW"}(Oye||(Oye={})),function(e){e[e.NotSet=0]="NotSet",e[e.ContentFlush=1]="ContentFlush",e[e.RecoverFromMarkers=2]="RecoverFromMarkers",e[e.Explicit=3]="Explicit",e[e.Paste=4]="Paste",e[e.Undo=5]="Undo",e[e.Redo=6]="Redo"}(Pye||(Pye={})),function(e){e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(Fye||(Fye={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(Bye||(Bye={})),function(e){e[e.None=0]="None",e[e.Keep=1]="Keep",e[e.Brackets=2]="Brackets",e[e.Advanced=3]="Advanced",e[e.Full=4]="Full"}(Wye||(Wye={})),function(e){e[e.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",e[e.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",e[e.accessibilitySupport=2]="accessibilitySupport",e[e.accessibilityPageSize=3]="accessibilityPageSize",e[e.ariaLabel=4]="ariaLabel",e[e.autoClosingBrackets=5]="autoClosingBrackets",e[e.autoClosingDelete=6]="autoClosingDelete",e[e.autoClosingOvertype=7]="autoClosingOvertype",e[e.autoClosingQuotes=8]="autoClosingQuotes",e[e.autoIndent=9]="autoIndent",e[e.automaticLayout=10]="automaticLayout",e[e.autoSurround=11]="autoSurround",e[e.bracketPairColorization=12]="bracketPairColorization",e[e.guides=13]="guides",e[e.codeLens=14]="codeLens",e[e.codeLensFontFamily=15]="codeLensFontFamily",e[e.codeLensFontSize=16]="codeLensFontSize",e[e.colorDecorators=17]="colorDecorators",e[e.colorDecoratorsLimit=18]="colorDecoratorsLimit",e[e.columnSelection=19]="columnSelection",e[e.comments=20]="comments",e[e.contextmenu=21]="contextmenu",e[e.copyWithSyntaxHighlighting=22]="copyWithSyntaxHighlighting",e[e.cursorBlinking=23]="cursorBlinking",e[e.cursorSmoothCaretAnimation=24]="cursorSmoothCaretAnimation",e[e.cursorStyle=25]="cursorStyle",e[e.cursorSurroundingLines=26]="cursorSurroundingLines",e[e.cursorSurroundingLinesStyle=27]="cursorSurroundingLinesStyle",e[e.cursorWidth=28]="cursorWidth",e[e.disableLayerHinting=29]="disableLayerHinting",e[e.disableMonospaceOptimizations=30]="disableMonospaceOptimizations",e[e.domReadOnly=31]="domReadOnly",e[e.dragAndDrop=32]="dragAndDrop",e[e.dropIntoEditor=33]="dropIntoEditor",e[e.emptySelectionClipboard=34]="emptySelectionClipboard",e[e.experimentalWhitespaceRendering=35]="experimentalWhitespaceRendering",e[e.extraEditorClassName=36]="extraEditorClassName",e[e.fastScrollSensitivity=37]="fastScrollSensitivity",e[e.find=38]="find",e[e.fixedOverflowWidgets=39]="fixedOverflowWidgets",e[e.folding=40]="folding",e[e.foldingStrategy=41]="foldingStrategy",e[e.foldingHighlight=42]="foldingHighlight",e[e.foldingImportsByDefault=43]="foldingImportsByDefault",e[e.foldingMaximumRegions=44]="foldingMaximumRegions",e[e.unfoldOnClickAfterEndOfLine=45]="unfoldOnClickAfterEndOfLine",e[e.fontFamily=46]="fontFamily",e[e.fontInfo=47]="fontInfo",e[e.fontLigatures=48]="fontLigatures",e[e.fontSize=49]="fontSize",e[e.fontWeight=50]="fontWeight",e[e.fontVariations=51]="fontVariations",e[e.formatOnPaste=52]="formatOnPaste",e[e.formatOnType=53]="formatOnType",e[e.glyphMargin=54]="glyphMargin",e[e.gotoLocation=55]="gotoLocation",e[e.hideCursorInOverviewRuler=56]="hideCursorInOverviewRuler",e[e.hover=57]="hover",e[e.inDiffEditor=58]="inDiffEditor",e[e.inlineSuggest=59]="inlineSuggest",e[e.letterSpacing=60]="letterSpacing",e[e.lightbulb=61]="lightbulb",e[e.lineDecorationsWidth=62]="lineDecorationsWidth",e[e.lineHeight=63]="lineHeight",e[e.lineNumbers=64]="lineNumbers",e[e.lineNumbersMinChars=65]="lineNumbersMinChars",e[e.linkedEditing=66]="linkedEditing",e[e.links=67]="links",e[e.matchBrackets=68]="matchBrackets",e[e.minimap=69]="minimap",e[e.mouseStyle=70]="mouseStyle",e[e.mouseWheelScrollSensitivity=71]="mouseWheelScrollSensitivity",e[e.mouseWheelZoom=72]="mouseWheelZoom",e[e.multiCursorMergeOverlapping=73]="multiCursorMergeOverlapping",e[e.multiCursorModifier=74]="multiCursorModifier",e[e.multiCursorPaste=75]="multiCursorPaste",e[e.multiCursorLimit=76]="multiCursorLimit",e[e.occurrencesHighlight=77]="occurrencesHighlight",e[e.overviewRulerBorder=78]="overviewRulerBorder",e[e.overviewRulerLanes=79]="overviewRulerLanes",e[e.padding=80]="padding",e[e.parameterHints=81]="parameterHints",e[e.peekWidgetDefaultFocus=82]="peekWidgetDefaultFocus",e[e.definitionLinkOpensInPeek=83]="definitionLinkOpensInPeek",e[e.quickSuggestions=84]="quickSuggestions",e[e.quickSuggestionsDelay=85]="quickSuggestionsDelay",e[e.readOnly=86]="readOnly",e[e.renameOnType=87]="renameOnType",e[e.renderControlCharacters=88]="renderControlCharacters",e[e.renderFinalNewline=89]="renderFinalNewline",e[e.renderLineHighlight=90]="renderLineHighlight",e[e.renderLineHighlightOnlyWhenFocus=91]="renderLineHighlightOnlyWhenFocus",e[e.renderValidationDecorations=92]="renderValidationDecorations",e[e.renderWhitespace=93]="renderWhitespace",e[e.revealHorizontalRightPadding=94]="revealHorizontalRightPadding",e[e.roundedSelection=95]="roundedSelection",e[e.rulers=96]="rulers",e[e.scrollbar=97]="scrollbar",e[e.scrollBeyondLastColumn=98]="scrollBeyondLastColumn",e[e.scrollBeyondLastLine=99]="scrollBeyondLastLine",e[e.scrollPredominantAxis=100]="scrollPredominantAxis",e[e.selectionClipboard=101]="selectionClipboard",e[e.selectionHighlight=102]="selectionHighlight",e[e.selectOnLineNumbers=103]="selectOnLineNumbers",e[e.showFoldingControls=104]="showFoldingControls",e[e.showUnused=105]="showUnused",e[e.snippetSuggestions=106]="snippetSuggestions",e[e.smartSelect=107]="smartSelect",e[e.smoothScrolling=108]="smoothScrolling",e[e.stickyScroll=109]="stickyScroll",e[e.stickyTabStops=110]="stickyTabStops",e[e.stopRenderingLineAfter=111]="stopRenderingLineAfter",e[e.suggest=112]="suggest",e[e.suggestFontSize=113]="suggestFontSize",e[e.suggestLineHeight=114]="suggestLineHeight",e[e.suggestOnTriggerCharacters=115]="suggestOnTriggerCharacters",e[e.suggestSelection=116]="suggestSelection",e[e.tabCompletion=117]="tabCompletion",e[e.tabIndex=118]="tabIndex",e[e.unicodeHighlighting=119]="unicodeHighlighting",e[e.unusualLineTerminators=120]="unusualLineTerminators",e[e.useShadowDOM=121]="useShadowDOM",e[e.useTabStops=122]="useTabStops",e[e.wordBreak=123]="wordBreak",e[e.wordSeparators=124]="wordSeparators",e[e.wordWrap=125]="wordWrap",e[e.wordWrapBreakAfterCharacters=126]="wordWrapBreakAfterCharacters",e[e.wordWrapBreakBeforeCharacters=127]="wordWrapBreakBeforeCharacters",e[e.wordWrapColumn=128]="wordWrapColumn",e[e.wordWrapOverride1=129]="wordWrapOverride1",e[e.wordWrapOverride2=130]="wordWrapOverride2",e[e.wrappingIndent=131]="wrappingIndent",e[e.wrappingStrategy=132]="wrappingStrategy",e[e.showDeprecated=133]="showDeprecated",e[e.inlayHints=134]="inlayHints",e[e.editorClassName=135]="editorClassName",e[e.pixelRatio=136]="pixelRatio",e[e.tabFocusMode=137]="tabFocusMode",e[e.layoutInfo=138]="layoutInfo",e[e.wrappingInfo=139]="wrappingInfo"}(Vye||(Vye={})),function(e){e[e.TextDefined=0]="TextDefined",e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(Hye||(Hye={})),function(e){e[e.LF=0]="LF",e[e.CRLF=1]="CRLF"}(zye||(zye={})),function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(Uye||(Uye={})),function(e){e[e.Both=0]="Both",e[e.Right=1]="Right",e[e.Left=2]="Left",e[e.None=3]="None"}(Kye||(Kye={})),function(e){e[e.Type=1]="Type",e[e.Parameter=2]="Parameter"}(jye||(jye={})),function(e){e[e.Automatic=0]="Automatic",e[e.Explicit=1]="Explicit"}(qye||(qye={})),function(e){e[e.DependsOnKbLayout=-1]="DependsOnKbLayout",e[e.Unknown=0]="Unknown",e[e.Backspace=1]="Backspace",e[e.Tab=2]="Tab",e[e.Enter=3]="Enter",e[e.Shift=4]="Shift",e[e.Ctrl=5]="Ctrl",e[e.Alt=6]="Alt",e[e.PauseBreak=7]="PauseBreak",e[e.CapsLock=8]="CapsLock",e[e.Escape=9]="Escape",e[e.Space=10]="Space",e[e.PageUp=11]="PageUp",e[e.PageDown=12]="PageDown",e[e.End=13]="End",e[e.Home=14]="Home",e[e.LeftArrow=15]="LeftArrow",e[e.UpArrow=16]="UpArrow",e[e.RightArrow=17]="RightArrow",e[e.DownArrow=18]="DownArrow",e[e.Insert=19]="Insert",e[e.Delete=20]="Delete",e[e.Digit0=21]="Digit0",e[e.Digit1=22]="Digit1",e[e.Digit2=23]="Digit2",e[e.Digit3=24]="Digit3",e[e.Digit4=25]="Digit4",e[e.Digit5=26]="Digit5",e[e.Digit6=27]="Digit6",e[e.Digit7=28]="Digit7",e[e.Digit8=29]="Digit8",e[e.Digit9=30]="Digit9",e[e.KeyA=31]="KeyA",e[e.KeyB=32]="KeyB",e[e.KeyC=33]="KeyC",e[e.KeyD=34]="KeyD",e[e.KeyE=35]="KeyE",e[e.KeyF=36]="KeyF",e[e.KeyG=37]="KeyG",e[e.KeyH=38]="KeyH",e[e.KeyI=39]="KeyI",e[e.KeyJ=40]="KeyJ",e[e.KeyK=41]="KeyK",e[e.KeyL=42]="KeyL",e[e.KeyM=43]="KeyM",e[e.KeyN=44]="KeyN",e[e.KeyO=45]="KeyO",e[e.KeyP=46]="KeyP",e[e.KeyQ=47]="KeyQ",e[e.KeyR=48]="KeyR",e[e.KeyS=49]="KeyS",e[e.KeyT=50]="KeyT",e[e.KeyU=51]="KeyU",e[e.KeyV=52]="KeyV",e[e.KeyW=53]="KeyW",e[e.KeyX=54]="KeyX",e[e.KeyY=55]="KeyY",e[e.KeyZ=56]="KeyZ",e[e.Meta=57]="Meta",e[e.ContextMenu=58]="ContextMenu",e[e.F1=59]="F1",e[e.F2=60]="F2",e[e.F3=61]="F3",e[e.F4=62]="F4",e[e.F5=63]="F5",e[e.F6=64]="F6",e[e.F7=65]="F7",e[e.F8=66]="F8",e[e.F9=67]="F9",e[e.F10=68]="F10",e[e.F11=69]="F11",e[e.F12=70]="F12",e[e.F13=71]="F13",e[e.F14=72]="F14",e[e.F15=73]="F15",e[e.F16=74]="F16",e[e.F17=75]="F17",e[e.F18=76]="F18",e[e.F19=77]="F19",e[e.NumLock=78]="NumLock",e[e.ScrollLock=79]="ScrollLock",e[e.Semicolon=80]="Semicolon",e[e.Equal=81]="Equal",e[e.Comma=82]="Comma",e[e.Minus=83]="Minus",e[e.Period=84]="Period",e[e.Slash=85]="Slash",e[e.Backquote=86]="Backquote",e[e.BracketLeft=87]="BracketLeft",e[e.Backslash=88]="Backslash",e[e.BracketRight=89]="BracketRight",e[e.Quote=90]="Quote",e[e.OEM_8=91]="OEM_8",e[e.IntlBackslash=92]="IntlBackslash",e[e.Numpad0=93]="Numpad0",e[e.Numpad1=94]="Numpad1",e[e.Numpad2=95]="Numpad2",e[e.Numpad3=96]="Numpad3",e[e.Numpad4=97]="Numpad4",e[e.Numpad5=98]="Numpad5",e[e.Numpad6=99]="Numpad6",e[e.Numpad7=100]="Numpad7",e[e.Numpad8=101]="Numpad8",e[e.Numpad9=102]="Numpad9",e[e.NumpadMultiply=103]="NumpadMultiply",e[e.NumpadAdd=104]="NumpadAdd",e[e.NUMPAD_SEPARATOR=105]="NUMPAD_SEPARATOR",e[e.NumpadSubtract=106]="NumpadSubtract",e[e.NumpadDecimal=107]="NumpadDecimal",e[e.NumpadDivide=108]="NumpadDivide",e[e.KEY_IN_COMPOSITION=109]="KEY_IN_COMPOSITION",e[e.ABNT_C1=110]="ABNT_C1",e[e.ABNT_C2=111]="ABNT_C2",e[e.AudioVolumeMute=112]="AudioVolumeMute",e[e.AudioVolumeUp=113]="AudioVolumeUp",e[e.AudioVolumeDown=114]="AudioVolumeDown",e[e.BrowserSearch=115]="BrowserSearch",e[e.BrowserHome=116]="BrowserHome",e[e.BrowserBack=117]="BrowserBack",e[e.BrowserForward=118]="BrowserForward",e[e.MediaTrackNext=119]="MediaTrackNext",e[e.MediaTrackPrevious=120]="MediaTrackPrevious",e[e.MediaStop=121]="MediaStop",e[e.MediaPlayPause=122]="MediaPlayPause",e[e.LaunchMediaPlayer=123]="LaunchMediaPlayer",e[e.LaunchMail=124]="LaunchMail",e[e.LaunchApp2=125]="LaunchApp2",e[e.Clear=126]="Clear",e[e.MAX_VALUE=127]="MAX_VALUE"}($ye||($ye={})),function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"}(Gye||(Gye={})),function(e){e[e.Unnecessary=1]="Unnecessary",e[e.Deprecated=2]="Deprecated"}(Zye||(Zye={})),function(e){e[e.Inline=1]="Inline",e[e.Gutter=2]="Gutter"}(Yye||(Yye={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.TEXTAREA=1]="TEXTAREA",e[e.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",e[e.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",e[e.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",e[e.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",e[e.CONTENT_TEXT=6]="CONTENT_TEXT",e[e.CONTENT_EMPTY=7]="CONTENT_EMPTY",e[e.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",e[e.CONTENT_WIDGET=9]="CONTENT_WIDGET",e[e.OVERVIEW_RULER=10]="OVERVIEW_RULER",e[e.SCROLLBAR=11]="SCROLLBAR",e[e.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",e[e.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"}(Qye||(Qye={})),function(e){e[e.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",e[e.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",e[e.TOP_CENTER=2]="TOP_CENTER"}(Xye||(Xye={})),function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"}(Jye||(Jye={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.None=2]="None",e[e.LeftOfInjectedText=3]="LeftOfInjectedText",e[e.RightOfInjectedText=4]="RightOfInjectedText"}(eSe||(eSe={})),function(e){e[e.Off=0]="Off",e[e.On=1]="On",e[e.Relative=2]="Relative",e[e.Interval=3]="Interval",e[e.Custom=4]="Custom"}(tSe||(tSe={})),function(e){e[e.None=0]="None",e[e.Text=1]="Text",e[e.Blocks=2]="Blocks"}(iSe||(iSe={})),function(e){e[e.Smooth=0]="Smooth",e[e.Immediate=1]="Immediate"}(nSe||(nSe={})),function(e){e[e.Auto=1]="Auto",e[e.Hidden=2]="Hidden",e[e.Visible=3]="Visible"}(oSe||(oSe={})),function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"}(sSe||(sSe={})),function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(rSe||(rSe={})),function(e){e[e.File=0]="File",e[e.Module=1]="Module",e[e.Namespace=2]="Namespace",e[e.Package=3]="Package",e[e.Class=4]="Class",e[e.Method=5]="Method",e[e.Property=6]="Property",e[e.Field=7]="Field",e[e.Constructor=8]="Constructor",e[e.Enum=9]="Enum",e[e.Interface=10]="Interface",e[e.Function=11]="Function",e[e.Variable=12]="Variable",e[e.Constant=13]="Constant",e[e.String=14]="String",e[e.Number=15]="Number",e[e.Boolean=16]="Boolean",e[e.Array=17]="Array",e[e.Object=18]="Object",e[e.Key=19]="Key",e[e.Null=20]="Null",e[e.EnumMember=21]="EnumMember",e[e.Struct=22]="Struct",e[e.Event=23]="Event",e[e.Operator=24]="Operator",e[e.TypeParameter=25]="TypeParameter"}(aSe||(aSe={})),function(e){e[e.Deprecated=1]="Deprecated"}(lSe||(lSe={})),function(e){e[e.Hidden=0]="Hidden",e[e.Blink=1]="Blink",e[e.Smooth=2]="Smooth",e[e.Phase=3]="Phase",e[e.Expand=4]="Expand",e[e.Solid=5]="Solid"}(dSe||(dSe={})),function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin"}(hSe||(hSe={})),function(e){e[e.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",e[e.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",e[e.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",e[e.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"}(cSe||(cSe={})),function(e){e[e.None=0]="None",e[e.Same=1]="Same",e[e.Indent=2]="Indent",e[e.DeepIndent=3]="DeepIndent"}(uSe||(uSe={}));class gSe{static chord(e,t){return function(e,t){return(e|(65535&t)<<16>>>0)>>>0}(e,t)}}function pSe(){return{editor:void 0,languages:void 0,CancellationTokenSource:sCe,Emitter:$we,KeyCode:$ye,KeyMod:gSe,Position:lye,Range:dye,Selection:hye,SelectionDirection:sSe,MarkerSeverity:Gye,MarkerTag:Zye,Uri:QCe,Token:xye}}gSe.CtrlCmd=2048,gSe.Shift=1024,gSe.Alt=512,gSe.WinCtrl=256;var mSe,fSe=i(3452),_Se={};_Se.styleTagTransform=zl(),_Se.setAttributes=Bl(),_Se.insert=Pl().bind(null,"head"),_Se.domAPI=Rl(),_Se.insertStyleElement=Vl(),Ml()(fSe.A,_Se),fSe.A&&fSe.A.locals&&fSe.A.locals;class vSe{get cachedValues(){return this._map}constructor(e){this.fn=e,this._map=new Map}get(e){if(this._map.has(e))return this._map.get(e);const t=this.fn(e);return this._map.set(e,t),t}}class bSe{constructor(e){this.executor=e,this._didRun=!1}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}const wSe=/{(\d+)}/g;function CSe(e,...t){return 0===t.length?e:e.replace(wSe,(function(e,i){const n=parseInt(i,10);return isNaN(n)||n<0||n>=t.length?e:t[n]}))}function ySe(e){return e.replace(/[<>&]/g,(function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}}))}function SSe(e){return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function xSe(e,t){if(!e||!t)return e;const i=t.length;if(0===i||0===e.length)return e;let n=0;for(;e.indexOf(t,n)===n;)n+=i;return e.substring(n)}function kSe(e,t,i={}){if(!e)throw new Error("Cannot create regex from empty string");t||(e=SSe(e)),i.wholeWord&&(/\B/.test(e.charAt(0))||(e="\\b"+e),/\B/.test(e.charAt(e.length-1))||(e+="\\b"));let n="";return i.global&&(n+="g"),i.matchCase||(n+="i"),i.multiline&&(n+="m"),i.unicode&&(n+="u"),new RegExp(e,n)}function LSe(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")}function DSe(e){return e.split(/\r\n|\r|\n/)}function ESe(e){for(let t=0,i=e.length;t<i;t++){const i=e.charCodeAt(t);if(32!==i&&9!==i)return t}return-1}function NSe(e,t=0,i=e.length){for(let n=t;n<i;n++){const i=e.charCodeAt(n);if(32!==i&&9!==i)return e.substring(t,n)}return e.substring(t,i)}function ISe(e,t=e.length-1){for(let i=t;i>=0;i--){const t=e.charCodeAt(i);if(32!==t&&9!==t)return i}return-1}function TSe(e,t){return e<t?-1:e>t?1:0}function MSe(e,t,i=0,n=e.length,o=0,s=t.length){for(;i<n&&o<s;i++,o++){const n=e.charCodeAt(i),s=t.charCodeAt(o);if(n<s)return-1;if(n>s)return 1}const r=n-i,a=s-o;return r<a?-1:r>a?1:0}function ASe(e,t){return RSe(e,t,0,e.length,0,t.length)}function RSe(e,t,i=0,n=e.length,o=0,s=t.length){for(;i<n&&o<s;i++,o++){let r=e.charCodeAt(i),a=t.charCodeAt(o);if(r===a)continue;if(r>=128||a>=128)return MSe(e.toLowerCase(),t.toLowerCase(),i,n,o,s);PSe(r)&&(r-=32),PSe(a)&&(a-=32);const l=r-a;if(0!==l)return l}const r=n-i,a=s-o;return r<a?-1:r>a?1:0}function OSe(e){return e>=48&&e<=57}function PSe(e){return e>=97&&e<=122}function FSe(e){return e>=65&&e<=90}function BSe(e,t){return e.length===t.length&&0===RSe(e,t)}function WSe(e,t){const i=t.length;return!(t.length>e.length)&&0===RSe(e,t,0,i)}function VSe(e,t){const i=Math.min(e.length,t.length);let n;for(n=0;n<i;n++)if(e.charCodeAt(n)!==t.charCodeAt(n))return n;return i}function HSe(e,t){const i=Math.min(e.length,t.length);let n;const o=e.length-1,s=t.length-1;for(n=0;n<i;n++)if(e.charCodeAt(o-n)!==t.charCodeAt(s-n))return n;return i}function zSe(e){return 55296<=e&&e<=56319}function USe(e){return 56320<=e&&e<=57343}function KSe(e,t){return t-56320+(e-55296<<10)+65536}function jSe(e,t,i){const n=e.charCodeAt(i);if(zSe(n)&&i+1<t){const t=e.charCodeAt(i+1);if(USe(t))return KSe(n,t)}return n}class qSe{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){const e=function(e,t){const i=e.charCodeAt(t-1);if(USe(i)&&t>1){const n=e.charCodeAt(t-2);if(zSe(n))return KSe(n,i)}return i}(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=jSe(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class $Se{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new qSe(e,t)}nextGraphemeLength(){const e=lxe.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const i=t.offset,o=e.getGraphemeBreakType(t.nextCodePoint());if(axe(n,o)){t.setOffset(i);break}n=o}return t.offset-i}prevGraphemeLength(){const e=lxe.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const i=t.offset,o=e.getGraphemeBreakType(t.prevCodePoint());if(axe(o,n)){t.setOffset(i);break}n=o}return i-t.offset}eol(){return this._iterator.eol()}}function GSe(e,t){return new $Se(e,t).nextGraphemeLength()}function ZSe(e,t){return new $Se(e,t).prevGraphemeLength()}let YSe;function QSe(e){return YSe||(YSe=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/),YSe.test(e)}const XSe=/^[\t\n\r\x20-\x7E]*$/;function JSe(e){return XSe.test(e)}const exe=/[\u2028\u2029]/;function txe(e){return exe.test(e)}function ixe(e){return e>=11904&&e<=55215||e>=63744&&e<=64255||e>=65281&&e<=65374}function nxe(e){return e>=127462&&e<=127487||8986===e||8987===e||9200===e||9203===e||e>=9728&&e<=10175||11088===e||11093===e||e>=127744&&e<=128591||e>=128640&&e<=128764||e>=128992&&e<=129008||e>=129280&&e<=129535||e>=129648&&e<=129782}const oxe=String.fromCharCode(65279);function sxe(e){return!!(e&&e.length>0&&65279===e.charCodeAt(0))}function rxe(e){return(e%=52)<26?String.fromCharCode(97+e):String.fromCharCode(65+e-26)}function axe(e,t){return 0===e?5!==t&&7!==t:!(2===e&&3===t||4!==e&&2!==e&&3!==e&&4!==t&&2!==t&&3!==t&&(8===e&&(8===t||9===t||11===t||12===t)||!(11!==e&&9!==e||9!==t&&10!==t)||(12===e||10===e)&&10===t||5===t||13===t||7===t||1===e||13===e&&14===t||6===e&&6===t))}class lxe{static getInstance(){return lxe._INSTANCE||(lxe._INSTANCE=new lxe),lxe._INSTANCE}constructor(){this._data=JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}getGraphemeBreakType(e){if(e<32)return 10===e?3:13===e?2:4;if(e<127)return 0;const t=this._data,i=t.length/3;let n=1;for(;n<=i;)if(e<t[3*n])n*=2;else{if(!(e>t[3*n+1]))return t[3*n+2];n=2*n+1}return 0}}function dxe(e){return 127995<=e&&e<=127999}lxe._INSTANCE=null;class hxe{static getInstance(e){return hxe.cache.get(Array.from(e))}static getLocales(){return hxe._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}mSe=hxe,hxe.ambiguousCharacterData=new bSe((()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'))),hxe.cache=new class{constructor(e){this.fn=e,this.lastCache=void 0,this.lastArgKey=void 0}get(e){const t=JSON.stringify(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this.fn(e)),this.lastCache}}((e=>{function t(e){const t=new Map;for(let i=0;i<e.length;i+=2)t.set(e[i],e[i+1]);return t}function i(e,t){if(!e)return t;const i=new Map;for(const[n,o]of e)t.has(n)&&i.set(n,o);return i}const n=mSe.ambiguousCharacterData.value;let o,s=e.filter((e=>!e.startsWith("_")&&e in n));0===s.length&&(s=["_default"]);for(const e of s)o=i(o,t(n[e]));const r=function(e,t){const i=new Map(e);for(const[e,n]of t)i.set(e,n);return i}(t(n._common),o);return new hxe(r)})),hxe._locales=new bSe((()=>Object.keys(hxe.ambiguousCharacterData.value).filter((e=>!e.startsWith("_")))));class cxe{static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]")}static getData(){return this._data||(this._data=new Set(cxe.getRawData())),this._data}static isInvisibleCharacter(e){return cxe.getData().has(e)}static get codePoints(){return cxe.getData()}}cxe._data=void 0;class uxe{constructor(){this._zoomFactor=1}getZoomFactor(){return this._zoomFactor}}uxe.INSTANCE=new uxe;class gxe extends Owe{constructor(){super(),this._onDidChange=this._register(new $we),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(!0),this._mediaQueryList=null,this._handleChange(!1)}_handleChange(e){var t;null===(t=this._mediaQueryList)||void 0===t||t.removeEventListener("change",this._listener),this._mediaQueryList=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),e&&this._onDidChange.fire()}}class pxe extends Owe{get value(){return this._value}constructor(){super(),this._onDidChange=this._register(new $we),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio();const e=this._register(new gxe);this._register(e.onDidChange((()=>{this._value=this._getPixelRatio(),this._onDidChange.fire(this._value)})))}_getPixelRatio(){const e=document.createElement("canvas").getContext("2d");return(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}}function mxe(e,t){"string"==typeof e&&(e=window.matchMedia(e)),e.addEventListener("change",t)}const fxe=new class{constructor(){this._pixelRatioMonitor=null}_getOrCreatePixelRatioMonitor(){return this._pixelRatioMonitor||(this._pixelRatioMonitor=new pxe),this._pixelRatioMonitor}get value(){return this._getOrCreatePixelRatioMonitor().value}get onDidChange(){return this._getOrCreatePixelRatioMonitor().onDidChange}};function _xe(){return uxe.INSTANCE.getZoomFactor()}const vxe=navigator.userAgent,bxe=vxe.indexOf("Firefox")>=0,wxe=vxe.indexOf("AppleWebKit")>=0,Cxe=vxe.indexOf("Chrome")>=0,yxe=!Cxe&&vxe.indexOf("Safari")>=0,Sxe=!Cxe&&!yxe&&wxe,xxe=vxe.indexOf("Electron/")>=0,kxe=vxe.indexOf("Android")>=0;let Lxe=!1;if(window.matchMedia){const e=window.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=window.matchMedia("(display-mode: fullscreen)");Lxe=e.matches,mxe(e,(({matches:e})=>{Lxe&&t.matches||(Lxe=e)}))}function Dxe(){return Lxe}class Exe{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){const t=Nxe(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=Nxe(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=Nxe(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=Nxe(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=Nxe(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=Nxe(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=Nxe(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=Nxe(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){const t=Nxe(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const t=Nxe(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=Nxe(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function Nxe(e){return"number"==typeof e?`${e}px`:e}function Ixe(e){return new Exe(e)}function Txe(e,t){e instanceof Exe?(e.setFontFamily(t.getMassagedFontFamily()),e.setFontWeight(t.fontWeight),e.setFontSize(t.fontSize),e.setFontFeatureSettings(t.fontFeatureSettings),e.setFontVariationSettings(t.fontVariationSettings),e.setLineHeight(t.lineHeight),e.setLetterSpacing(t.letterSpacing)):(e.style.fontFamily=t.getMassagedFontFamily(),e.style.fontWeight=t.fontWeight,e.style.fontSize=t.fontSize+"px",e.style.fontFeatureSettings=t.fontFeatureSettings,e.style.fontVariationSettings=t.fontVariationSettings,e.style.lineHeight=t.lineHeight+"px",e.style.letterSpacing=t.letterSpacing+"px")}class Mxe{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class Axe{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(){this._createDomElements(),document.body.appendChild(this._container),this._readFromDomElements(),document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");Txe(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");Txe(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const n=document.createElement("div");Txe(n,this._bareFontInfo),n.style.fontStyle="italic",e.appendChild(n);const o=[];for(const e of this._requests){let s;0===e.type&&(s=t),2===e.type&&(s=i),1===e.type&&(s=n),s.appendChild(document.createElement("br"));const r=document.createElement("span");Axe._render(r,e),s.appendChild(r),o.push(r)}this._container=e,this._testElements=o}static _render(e,t){if(" "===t.chr){let t=" ";for(let e=0;e<8;e++)t+=t;e.innerText=t}else{let i=t.chr;for(let e=0;e<8;e++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e<t;e++){const t=this._requests[e],i=this._testElements[e];t.fulfill(i.offsetWidth/256)}}}const Rxe=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new $we,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(e){e=Math.min(Math.max(-5,e),20),this._zoomLevel!==e&&(this._zoomLevel=e,this._onDidChangeZoomLevel.fire(this._zoomLevel))}},Oxe=Dve?1.5:1.35;class Pxe{static createFromValidatedSettings(e,t,i){const n=e.get(46),o=e.get(50),s=e.get(49),r=e.get(48),a=e.get(51),l=e.get(63),d=e.get(60);return Pxe._create(n,o,s,r,a,l,d,t,i)}static _create(e,t,i,n,o,s,r,a,l){0===s?s=Oxe*i:s<8&&(s*=i),(s=Math.round(s))<8&&(s=8);const d=1+(l?0:.1*Rxe.getZoomLevel());return i*=d,s*=d,o===twe.TRANSLATE&&("normal"===t||"bold"===t?o=twe.OFF:(o=`'wght' ${parseInt(t,10)}`,t="normal")),new Pxe({pixelRatio:a,fontFamily:e,fontWeight:t,fontSize:i,fontFeatureSettings:n,fontVariationSettings:o,lineHeight:s,letterSpacing:r})}constructor(e){this._bareFontInfoBrand=void 0,this.pixelRatio=e.pixelRatio,this.fontFamily=String(e.fontFamily),this.fontWeight=String(e.fontWeight),this.fontSize=e.fontSize,this.fontFeatureSettings=e.fontFeatureSettings,this.fontVariationSettings=e.fontVariationSettings,this.lineHeight=0|e.lineHeight,this.letterSpacing=e.letterSpacing}getId(){return`${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`}getMassagedFontFamily(){const e=mwe.fontFamily,t=Pxe._wrapInQuotes(this.fontFamily);return e&&this.fontFamily!==e?`${t}, ${e}`:t}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}}class Fxe extends Pxe{constructor(e,t){super(e),this._editorStylingBrand=void 0,this.version=2,this.isTrusted=t,this.isMonospace=e.isMonospace,this.typicalHalfwidthCharacterWidth=e.typicalHalfwidthCharacterWidth,this.typicalFullwidthCharacterWidth=e.typicalFullwidthCharacterWidth,this.canUseHalfwidthRightwardsArrow=e.canUseHalfwidthRightwardsArrow,this.spaceWidth=e.spaceWidth,this.middotWidth=e.middotWidth,this.wsmiddotWidth=e.wsmiddotWidth,this.maxDigitWidth=e.maxDigitWidth}equals(e){return this.fontFamily===e.fontFamily&&this.fontWeight===e.fontWeight&&this.fontSize===e.fontSize&&this.fontFeatureSettings===e.fontFeatureSettings&&this.fontVariationSettings===e.fontVariationSettings&&this.lineHeight===e.lineHeight&&this.letterSpacing===e.letterSpacing&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.typicalFullwidthCharacterWidth===e.typicalFullwidthCharacterWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.maxDigitWidth===e.maxDigitWidth}}class Bxe{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map((e=>this._values[e]))}}const Wxe=new class extends Owe{constructor(){super(),this._onDidChange=this._register(new $we),this.onDidChange=this._onDidChange.event,this._cache=new Bxe,this._evictUntrustedReadingsTimeout=-1}dispose(){-1!==this._evictUntrustedReadingsTimeout&&(window.clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearAllFontInfos(){this._cache=new Bxe,this._onDidChange.fire()}_writeToCache(e,t){this._cache.put(e,t),t.isTrusted||-1!==this._evictUntrustedReadingsTimeout||(this._evictUntrustedReadingsTimeout=window.setTimeout((()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings()}),5e3))}_evictUntrustedReadings(){const e=this._cache.getValues();let t=!1;for(const i of e)i.isTrusted||(t=!0,this._cache.remove(i));t&&this._onDidChange.fire()}readFontInfo(e){if(!this._cache.has(e)){let t=this._actualReadFontInfo(e);(t.typicalHalfwidthCharacterWidth<=2||t.typicalFullwidthCharacterWidth<=2||t.spaceWidth<=2||t.maxDigitWidth<=2)&&(t=new Fxe({pixelRatio:fxe.value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:t.isMonospace,typicalHalfwidthCharacterWidth:Math.max(t.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(t.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:t.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(t.spaceWidth,5),middotWidth:Math.max(t.middotWidth,5),wsmiddotWidth:Math.max(t.wsmiddotWidth,5),maxDigitWidth:Math.max(t.maxDigitWidth,5)},!1)),this._writeToCache(e,t)}return this._cache.get(e)}_createRequest(e,t,i,n){const o=new Mxe(e,t);return i.push(o),null==n||n.push(o),o}_actualReadFontInfo(e){const t=[],i=[],n=this._createRequest("n",0,t,i),o=this._createRequest("m",0,t,null),s=this._createRequest(" ",0,t,i),r=this._createRequest("0",0,t,i),a=this._createRequest("1",0,t,i),l=this._createRequest("2",0,t,i),d=this._createRequest("3",0,t,i),h=this._createRequest("4",0,t,i),c=this._createRequest("5",0,t,i),u=this._createRequest("6",0,t,i),g=this._createRequest("7",0,t,i),p=this._createRequest("8",0,t,i),m=this._createRequest("9",0,t,i),f=this._createRequest("→",0,t,i),_=this._createRequest("→",0,t,null),v=this._createRequest("·",0,t,i),b=this._createRequest(String.fromCharCode(11825),0,t,null),w="|/-_ilm%";for(let e=0,n=8;e<n;e++)this._createRequest(w.charAt(e),0,t,i),this._createRequest(w.charAt(e),1,t,i),this._createRequest(w.charAt(e),2,t,i);!function(e,t){new Axe(e,t).read()}(e,t);const C=Math.max(r.width,a.width,l.width,d.width,h.width,c.width,u.width,g.width,p.width,m.width);let y=e.fontFeatureSettings===ewe.OFF;const S=i[0].width;for(let e=1,t=i.length;y&&e<t;e++){const t=S-i[e].width;if(t<-.001||t>.001){y=!1;break}}let x=!0;return y&&_.width!==S&&(x=!1),_.width>f.width&&(x=!1),new Fxe({pixelRatio:fxe.value,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,fontVariationSettings:e.fontVariationSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:y,typicalHalfwidthCharacterWidth:n.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:x,spaceWidth:s.width,middotWidth:v.width,wsmiddotWidth:b.width,maxDigitWidth:C},!0)}};var Vxe;!function(e){e.serviceIds=new Map,e.DI_TARGET="$di$target",e.DI_DEPENDENCIES="$di$dependencies",e.getServiceDependencies=function(t){return t[e.DI_DEPENDENCIES]||[]}}(Vxe||(Vxe={}));const Hxe=zxe("instantiationService");function zxe(e){if(Vxe.serviceIds.has(e))return Vxe.serviceIds.get(e);const t=function(e,i,n){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");!function(e,t,i){t[Vxe.DI_TARGET]===t?t[Vxe.DI_DEPENDENCIES].push({id:e,index:i}):(t[Vxe.DI_DEPENDENCIES]=[{id:e,index:i}],t[Vxe.DI_TARGET]=t)}(t,e,n)};return t.toString=()=>e,Vxe.serviceIds.set(e,t),t}const Uxe=zxe("codeEditorService");function Kxe(e,t){if(!e)throw new Error(t?`Assertion failed (${t})`:"Assertion Failed")}function jxe(e,t="Unreachable"){throw new Error(t)}function qxe(e){e()||(e(),wwe(new Nwe("Assertion Failed")))}function $xe(e,t){let i=0;for(;i<e.length-1;){if(!t(e[i],e[i+1]))return!1;i++}return!0}const Gxe=zxe("audioCue");class Zxe{static register(e){return new Zxe(e.fileName)}constructor(e){this.fileName=e}}Zxe.error=Zxe.register({fileName:"error.mp3"}),Zxe.warning=Zxe.register({fileName:"warning.mp3"}),Zxe.foldedArea=Zxe.register({fileName:"foldedAreas.mp3"}),Zxe.break=Zxe.register({fileName:"break.mp3"}),Zxe.quickFixes=Zxe.register({fileName:"quickFixes.mp3"}),Zxe.taskCompleted=Zxe.register({fileName:"taskCompleted.mp3"}),Zxe.taskFailed=Zxe.register({fileName:"taskFailed.mp3"}),Zxe.terminalBell=Zxe.register({fileName:"terminalBell.mp3"}),Zxe.diffLineInserted=Zxe.register({fileName:"diffLineInserted.mp3"}),Zxe.diffLineDeleted=Zxe.register({fileName:"diffLineDeleted.mp3"}),Zxe.diffLineModified=Zxe.register({fileName:"diffLineModified.mp3"});class Yxe{static register(e){const t=new Yxe(e.sound,e.name,e.settingsKey);return Yxe._audioCues.add(t),t}constructor(e,t,i){this.sound=e,this.name=t,this.settingsKey=i}}Yxe._audioCues=new Set,Yxe.error=Yxe.register({name:ove(0,"Error on Line"),sound:Zxe.error,settingsKey:"audioCues.lineHasError"}),Yxe.warning=Yxe.register({name:ove(0,"Warning on Line"),sound:Zxe.warning,settingsKey:"audioCues.lineHasWarning"}),Yxe.foldedArea=Yxe.register({name:ove(0,"Folded Area on Line"),sound:Zxe.foldedArea,settingsKey:"audioCues.lineHasFoldedArea"}),Yxe.break=Yxe.register({name:ove(0,"Breakpoint on Line"),sound:Zxe.break,settingsKey:"audioCues.lineHasBreakpoint"}),Yxe.inlineSuggestion=Yxe.register({name:ove(0,"Inline Suggestion on Line"),sound:Zxe.quickFixes,settingsKey:"audioCues.lineHasInlineSuggestion"}),Yxe.terminalQuickFix=Yxe.register({name:ove(0,"Terminal Quick Fix"),sound:Zxe.quickFixes,settingsKey:"audioCues.terminalQuickFix"}),Yxe.onDebugBreak=Yxe.register({name:ove(0,"Debugger Stopped on Breakpoint"),sound:Zxe.break,settingsKey:"audioCues.onDebugBreak"}),Yxe.noInlayHints=Yxe.register({name:ove(0,"No Inlay Hints on Line"),sound:Zxe.error,settingsKey:"audioCues.noInlayHints"}),Yxe.taskCompleted=Yxe.register({name:ove(0,"Task Completed"),sound:Zxe.taskCompleted,settingsKey:"audioCues.taskCompleted"}),Yxe.taskFailed=Yxe.register({name:ove(0,"Task Failed"),sound:Zxe.taskFailed,settingsKey:"audioCues.taskFailed"}),Yxe.terminalBell=Yxe.register({name:ove(0,"Terminal Bell"),sound:Zxe.terminalBell,settingsKey:"audioCues.terminalBell"}),Yxe.notebookCellCompleted=Yxe.register({name:ove(0,"Notebook Cell Completed"),sound:Zxe.taskCompleted,settingsKey:"audioCues.notebookCellCompleted"}),Yxe.notebookCellFailed=Yxe.register({name:ove(0,"Notebook Cell Failed"),sound:Zxe.taskFailed,settingsKey:"audioCues.notebookCellFailed"}),Yxe.diffLineInserted=Yxe.register({name:ove(0,"Diff Line Inserted"),sound:Zxe.diffLineInserted,settingsKey:"audioCues.diffLineInserted"}),Yxe.diffLineDeleted=Yxe.register({name:ove(0,"Diff Line Deleted"),sound:Zxe.diffLineDeleted,settingsKey:"audioCues.diffLineDeleted"}),Yxe.diffLineModified=Yxe.register({name:ove(0,"Diff Line Modified"),sound:Zxe.diffLineModified,settingsKey:"audioCues.diffLineModified"});const Qxe=new Map;Qxe.set("false",!1),Qxe.set("true",!0),Qxe.set("isMac",Dve),Qxe.set("isLinux",Eve),Qxe.set("isWindows",Lve),Qxe.set("isWeb",Ive),Qxe.set("isMacNative",Dve&&!Ive),Qxe.set("isEdge",Kve),Qxe.set("isFirefox",zve),Qxe.set("isChrome",Hve),Qxe.set("isSafari",Uve);const Xxe=Object.prototype.hasOwnProperty;class Jxe{static has(e){return nke.create(e)}static equals(e,t){return oke.create(e,t)}static regex(e,t){return pke.create(e,t)}static not(e){return lke.create(e)}static and(...e){return _ke.create(e,null,!0)}static or(...e){return vke.create(e,null,!0)}static deserialize(e,t=!1){if(e)return this._deserializeOrExpression(e,t)}static _deserializeOrExpression(e,t){const i=e.split("||");return vke.create(i.map((e=>this._deserializeAndExpression(e,t))),null,!0)}static _deserializeAndExpression(e,t){const i=e.split("&&");return _ke.create(i.map((e=>this._deserializeOne(e,t))),null,!0)}static _deserializeOne(e,t){if((e=e.trim()).indexOf("!=")>=0){const i=e.split("!=");return ake.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("==")>=0){const i=e.split("==");return oke.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("=~")>=0){const i=e.split("=~");return pke.create(i[0].trim(),this._deserializeRegexValue(i[1],t))}if(e.indexOf(" not in ")>=0){const i=e.split(" not in ");return rke.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf(" in ")>=0){const i=e.split(" in ");return ske.create(i[0].trim(),this._deserializeValue(i[1],t))}if(/^[^<=>]+>=[^<=>]+$/.test(e)){const t=e.split(">=");return cke.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(e)){const t=e.split(">");return hke.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(e)){const t=e.split("<=");return gke.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(e)){const t=e.split("<");return uke.create(t[0].trim(),t[1].trim())}return/^\!\s*/.test(e)?lke.create(e.substr(1).trim()):nke.create(e)}static _deserializeValue(e,t){if("true"===(e=e.trim()))return!0;if("false"===e)return!1;const i=/^'([^']*)'$/.exec(e);return i?i[1].trim():e}static _deserializeRegexValue(e,t){if(!(i=e)||"string"!=typeof i||0===i.trim().length){if(t)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}var i;const n=e.indexOf("/"),o=e.lastIndexOf("/");if(n===o||n<0){if(t)throw new Error(`bad regexp-value '${e}', missing /-enclosure`);return console.warn(`bad regexp-value '${e}', missing /-enclosure`),null}const s=e.slice(n+1,o),r="i"===e[o+1]?"i":"";try{return new RegExp(s,r)}catch(i){if(t)throw new Error(`bad regexp-value '${e}', parse error: ${i}`);return console.warn(`bad regexp-value '${e}', parse error: ${i}`),null}}}function eke(e,t){return e.cmp(t)}class tke{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return ike.INSTANCE}}tke.INSTANCE=new tke;class ike{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return tke.INSTANCE}}ike.INSTANCE=new ike;class nke{static create(e,t=null){const i=Qxe.get(e);return"boolean"==typeof i?i?ike.INSTANCE:tke.INSTANCE:new nke(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:Cke(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=Qxe.get(this.key);return"boolean"==typeof e?e?ike.INSTANCE:tke.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=lke.create(this.key,this)),this.negated}}class oke{static create(e,t,i=null){if("boolean"==typeof t)return t?nke.create(e,i):lke.create(e,i);const n=Qxe.get(e);return"boolean"==typeof n?t===(n?"true":"false")?ike.INSTANCE:tke.INSTANCE:new oke(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:yke(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){const e=Qxe.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?ike.INSTANCE:tke.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ake.create(this.key,this.value,this)),this.negated}}class ske{static create(e,t){return new ske(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:yke(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type&&this.key===e.key&&this.valueKey===e.valueKey}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.includes(i):"string"==typeof i&&"object"==typeof t&&null!==t&&Xxe.call(t,i)}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=rke.create(this.key,this.valueKey)),this.negated}}class rke{static create(e,t){return new rke(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=ske.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type&&this._negated.equals(e._negated)}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}class ake{static create(e,t,i=null){if("boolean"==typeof t)return t?lke.create(e,i):nke.create(e,i);const n=Qxe.get(e);return"boolean"==typeof n?t===(n?"true":"false")?tke.INSTANCE:ike.INSTANCE:new ake(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:yke(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){const e=Qxe.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?tke.INSTANCE:ike.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=oke.create(this.key,this.value,this)),this.negated}}class lke{static create(e,t=null){const i=Qxe.get(e);return"boolean"==typeof i?i?tke.INSTANCE:ike.INSTANCE:new lke(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:Cke(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=Qxe.get(this.key);return"boolean"==typeof e?e?tke.INSTANCE:ike.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=nke.create(this.key,this)),this.negated}}function dke(e,t){if("string"==typeof e){const t=parseFloat(e);isNaN(t)||(e=t)}return"string"==typeof e||"number"==typeof e?t(e):tke.INSTANCE}class hke{static create(e,t,i=null){return dke(t,(t=>new hke(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:yke(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=gke.create(this.key,this.value,this)),this.negated}}class cke{static create(e,t,i=null){return dke(t,(t=>new cke(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:yke(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=uke.create(this.key,this.value,this)),this.negated}}class uke{static create(e,t,i=null){return dke(t,(t=>new uke(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:yke(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=cke.create(this.key,this.value,this)),this.negated}}class gke{static create(e,t,i=null){return dke(t,(t=>new gke(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:yke(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=hke.create(this.key,this.value,this)),this.negated}}class pke{static create(e,t){return new pke(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.key<e.key)return-1;if(this.key>e.key)return 1;const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return t<i?-1:t>i?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return!!this.regexp&&this.regexp.test(t)}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=mke.create(this)),this.negated}}class mke{static create(e){return new mke(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type&&this._actual.equals(e._actual)}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function fke(e){let t=null;for(let i=0,n=e.length;i<n;i++){const n=e[i].substituteConstants();if(e[i]!==n&&null===t){t=[];for(let n=0;n<i;n++)t[n]=e[n]}null!==t&&(t[i]=n)}return null===t?e:t}class _ke{static create(e,t,i){return _ke._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=6}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,i=this.expr.length;t<i;t++){const i=eke(this.expr[t],e.expr[t]);if(0!==i)return i}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const e=fke(this.expr);return e===this.expr?this:_ke.create(e,this.negated,!1)}evaluate(e){for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].evaluate(e))return!1;return!0}static _normalizeArr(e,t,i){const n=[];let o=!1;for(const t of e)if(t)if(1!==t.type){if(0===t.type)return tke.INSTANCE;6!==t.type?n.push(t):n.push(...t.expr)}else o=!0;if(0===n.length&&o)return ike.INSTANCE;if(0!==n.length){if(1===n.length)return n[0];n.sort(eke);for(let e=1;e<n.length;e++)n[e-1].equals(n[e])&&(n.splice(e,1),e--);if(1===n.length)return n[0];for(;n.length>1;){const e=n[n.length-1];if(9!==e.type)break;n.pop();const t=n.pop(),o=0===n.length,s=vke.create(e.expr.map((e=>_ke.create([e,t],null,i))),null,o);s&&(n.push(s),n.sort(eke))}if(1===n.length)return n[0];if(i){for(let e=0;e<n.length;e++)for(let t=e+1;t<n.length;t++)if(n[e].negate().equals(n[t]))return tke.INSTANCE;if(1===n.length)return n[0]}return new _ke(n,t)}}serialize(){return this.expr.map((e=>e.serialize())).join(" && ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());this.negated=vke.create(e,this,!0)}return this.negated}}class vke{static create(e,t,i){return vke._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,i=this.expr.length;t<i;t++){const i=eke(this.expr[t],e.expr[t]);if(0!==i)return i}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const e=fke(this.expr);return e===this.expr?this:vke.create(e,this.negated,!1)}evaluate(e){for(let t=0,i=this.expr.length;t<i;t++)if(this.expr[t].evaluate(e))return!0;return!1}static _normalizeArr(e,t,i){let n=[],o=!1;if(e){for(let t=0,i=e.length;t<i;t++){const i=e[t];if(i)if(0!==i.type){if(1===i.type)return ike.INSTANCE;9!==i.type?n.push(i):n=n.concat(i.expr)}else o=!0}if(0===n.length&&o)return tke.INSTANCE;n.sort(eke)}if(0!==n.length){if(1===n.length)return n[0];for(let e=1;e<n.length;e++)n[e-1].equals(n[e])&&(n.splice(e,1),e--);if(1===n.length)return n[0];if(i){for(let e=0;e<n.length;e++)for(let t=e+1;t<n.length;t++)if(n[e].negate().equals(n[t]))return ike.INSTANCE;if(1===n.length)return n[0]}return new vke(n,t)}}serialize(){return this.expr.map((e=>e.serialize())).join(" || ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),i=e.shift(),n=[];for(const e of kke(t))for(const t of kke(i))n.push(_ke.create([e,t],null,!1));e.unshift(vke.create(n,null,!1))}this.negated=vke.create(e,this,!0)}return this.negated}}class bke extends nke{static all(){return bke._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,"object"==typeof i?bke._info.push(Object.assign(Object.assign({},i),{key:e})):!0!==i&&bke._info.push({key:e,description:i,type:null!=t?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return oke.create(this.key,e)}}bke._info=[];const wke=zxe("contextKeyService");function Cke(e,t){return e<t?-1:e>t?1:0}function yke(e,t,i,n){return e<i?-1:e>i?1:t<n?-1:t>n?1:0}function Ske(e,t){if(0===e.type||1===t.type)return!0;if(9===e.type)return 9===t.type&&xke(e.expr,t.expr);if(9===t.type){for(const i of t.expr)if(Ske(e,i))return!0;return!1}if(6===e.type){if(6===t.type)return xke(t.expr,e.expr);for(const i of e.expr)if(Ske(i,t))return!0;return!1}return e.equals(t)}function xke(e,t){let i=0,n=0;for(;i<e.length&&n<t.length;){const o=e[i].cmp(t[n]);if(o<0)return!1;0===o?(i++,n++):n++}return i===e.length}function kke(e){return 9===e.type?e.expr:[e]}const Lke=zxe("accessibilityService"),Dke=new bke("accessibilityModeEnabled",!1);var Eke=function(e,t){return function(i,n){t(i,n,e)}};const Nke={followsCaret:!0,ignoreCharChanges:!0,alwaysRevealFirst:!0,findResultLoop:!0};let Ike=class extends Owe{constructor(e,t={},i,n,o){super(),this._audioCueService=i,this._codeEditorService=n,this._accessibilityService=o,this._onDidUpdate=this._register(new $we),this._editor=e,this._options=Abe(t,Nke,!1),this.disposed=!1,this.nextIdx=-1,this.ranges=[],this.ignoreSelectionChange=!1,this.revealFirst=Boolean(this._options.alwaysRevealFirst),this._register(this._editor.onDidDispose((()=>this.dispose()))),this._register(this._editor.onDidUpdateDiff((()=>this._onDiffUpdated()))),this._options.followsCaret&&this._register(this._editor.getModifiedEditor().onDidChangeCursorPosition((e=>{this.ignoreSelectionChange||(this._updateAccessibilityState(e.position.lineNumber),this.nextIdx=-1)}))),this._options.alwaysRevealFirst&&this._register(this._editor.getModifiedEditor().onDidChangeModel((e=>{this.revealFirst=!0}))),this._init()}_init(){this._editor.getLineChanges()}_onDiffUpdated(){this._init(),this._compute(this._editor.getLineChanges()),this.revealFirst&&null!==this._editor.getLineChanges()&&(this.revealFirst=!1,this.nextIdx=-1,this.next(1))}_compute(e){this.ranges=[],e&&e.forEach((e=>{!this._options.ignoreCharChanges&&e.charChanges?e.charChanges.forEach((e=>{this.ranges.push({rhs:!0,range:new dye(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn)})})):0===e.modifiedEndLineNumber?this.ranges.push({rhs:!0,range:new dye(e.modifiedStartLineNumber,1,e.modifiedStartLineNumber+1,1)}):this.ranges.push({rhs:!0,range:new dye(e.modifiedStartLineNumber,1,e.modifiedEndLineNumber+1,1)})})),this.ranges.sort(((e,t)=>dye.compareRangesUsingStarts(e.range,t.range))),this._onDidUpdate.fire(this)}_initIdx(e){let t=!1;const i=this._editor.getPosition();if(i){for(let n=0,o=this.ranges.length;n<o&&!t;n++){const o=this.ranges[n].range;i.isBeforeOrEqual(o.getStartPosition())&&(this.nextIdx=n+(e?0:-1),t=!0)}t||(this.nextIdx=e?0:this.ranges.length-1),this.nextIdx<0&&(this.nextIdx=this.ranges.length-1)}else this.nextIdx=0}_move(e,t){if(Kxe(!this.disposed,"Illegal State - diff navigator has been disposed"),!this.canNavigate())return;-1===this.nextIdx?this._initIdx(e):e?(this.nextIdx+=1,this.nextIdx>=this.ranges.length&&(this.nextIdx=0)):(this.nextIdx-=1,this.nextIdx<0&&(this.nextIdx=this.ranges.length-1));const i=this.ranges[this.nextIdx];this.ignoreSelectionChange=!0;try{const e=i.range.getStartPosition();this._editor.setPosition(e),this._editor.revealRangeInCenter(i.range,t),this._updateAccessibilityState(e.lineNumber,!0)}finally{this.ignoreSelectionChange=!1}}_updateAccessibilityState(e,t){var i;const n=null===(i=this._editor.getModel())||void 0===i?void 0:i.modified;if(!n)return;const o=n.getLineDecorations(e).find((e=>"line-insert"===e.options.className));if(o)this._audioCueService.playAudioCue(Yxe.diffLineModified,!0);else{if(!t)return;this._audioCueService.playAudioCue(Yxe.diffLineDeleted,!0)}const s=this._codeEditorService.getActiveCodeEditor();t&&s&&o&&this._accessibilityService.isScreenReaderOptimized()&&(s.setSelection({startLineNumber:e,startColumn:0,endLineNumber:e,endColumn:Number.MAX_VALUE}),s.writeScreenReaderContent("diff-navigation"))}canNavigate(){return this.ranges&&this.ranges.length>0}next(e=0){this.canNavigateNext()&&this._move(!0,e)}previous(e=0){this.canNavigatePrevious()&&this._move(!1,e)}canNavigateNext(){return this.canNavigateLoop()||this.nextIdx<this.ranges.length-1}canNavigatePrevious(){return this.canNavigateLoop()||0!==this.nextIdx}canNavigateLoop(){return Boolean(this._options.findResultLoop)}dispose(){super.dispose(),this.ranges=[],this.disposed=!0}};Ike=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Eke(2,Gxe),Eke(3,Uxe),Eke(4,Lke)],Ike);const Tke={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"};var Mke,Ake,Rke,Oke;!function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"}(Mke||(Mke={})),function(e){e[e.Inline=1]="Inline",e[e.Gutter=2]="Gutter"}(Ake||(Ake={})),function(e){e[e.Both=0]="Both",e[e.Right=1]="Right",e[e.Left=2]="Left",e[e.None=3]="None"}(Rke||(Rke={}));class Pke{get originalIndentSize(){return this._indentSizeIsTabSize?"tabSize":this.indentSize}constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,0|e.tabSize),"tabSize"===e.indentSize?(this.indentSize=this.tabSize,this._indentSizeIsTabSize=!0):(this.indentSize=Math.max(1,0|e.indentSize),this._indentSizeIsTabSize=!1),this.insertSpaces=Boolean(e.insertSpaces),this.defaultEOL=0|e.defaultEOL,this.trimAutoWhitespace=Boolean(e.trimAutoWhitespace),this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this._indentSizeIsTabSize===e._indentSizeIsTabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&Rbe(this.bracketPairColorizationOptions,e.bracketPairColorizationOptions)}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}}class Fke{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}class Bke{constructor(e,t,i,n,o,s){this.identifier=e,this.range=t,this.text=i,this.forceMoveMarkers=n,this.isAutoWhitespaceEdit=o,this._isTracked=s}}class Wke{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}class Vke{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}}function Hke(e){return!e.isTooLargeForSyncing()&&!e.isForSimpleWidget}!function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(Oke||(Oke={}));class zke{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;t<i;t++)switch(e.notIn[t]){case"string":this._inString=!1;break;case"comment":this._inComment=!1;break;case"regex":this._inRegEx=!1}}isOK(e){switch(e){case 0:return!0;case 1:return this._inComment;case 2:return this._inString;case 3:return this._inRegEx}}shouldAutoClose(e,t){if(0===e.getTokenCount())return!0;const i=e.findTokenIndexAtOffset(t-2),n=e.getStandardTokenType(i);return this.isOK(n)}_findNeutralCharacterInRange(e,t){for(let i=e;i<=t;i++){const e=String.fromCharCode(i);if(!this.open.includes(e)&&!this.close.includes(e))return e}return null}findNeutralCharacter(){return this._neutralCharacterSearched||(this._neutralCharacterSearched=!0,this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(48,57)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(97,122)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(65,90))),this._neutralCharacter}}class Uke{constructor(e){this.autoClosingPairsOpenByStart=new Map,this.autoClosingPairsOpenByEnd=new Map,this.autoClosingPairsCloseByStart=new Map,this.autoClosingPairsCloseByEnd=new Map,this.autoClosingPairsCloseSingleChar=new Map;for(const t of e)Kke(this.autoClosingPairsOpenByStart,t.open.charAt(0),t),Kke(this.autoClosingPairsOpenByEnd,t.open.charAt(t.open.length-1),t),Kke(this.autoClosingPairsCloseByStart,t.close.charAt(0),t),Kke(this.autoClosingPairsCloseByEnd,t.close.charAt(t.close.length-1),t),1===t.close.length&&1===t.open.length&&Kke(this.autoClosingPairsCloseSingleChar,t.close,t)}}function Kke(e,t,i){e.has(t)?e.get(t).push(i):e.set(t,[i])}function jke(e,t){const i=e.getCount(),n=e.findTokenIndexAtOffset(t),o=e.getLanguageId(n);let s=n;for(;s+1<i&&e.getLanguageId(s+1)===o;)s++;let r=n;for(;r>0&&e.getLanguageId(r-1)===o;)r--;return new qke(e,o,r,s+1,e.getStartOffset(r),e.getEndOffset(s))}class qke{constructor(e,t,i,n,o,s){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=o,this._lastCharOffset=s}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}}function $ke(e){return!!(3&e)}class Gke{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map((e=>new zke(e))):e.brackets?this._autoClosingPairs=e.brackets.map((e=>new zke({open:e[0],close:e[1]}))):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new zke({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes="string"==typeof e.autoCloseBefore?e.autoCloseBefore:Gke.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets="string"==typeof e.autoCloseBefore?e.autoCloseBefore:Gke.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}}Gke.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=";:.,=}])> \n\t",Gke.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS="'\"`;:.,=}])> \n\t";const Zke="undefined"!=typeof Buffer;let Yke,Qke,Xke,Jke;class eLe{static wrap(e){return Zke&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new eLe(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return Zke?this.buffer.toString():(Yke||(Yke=new TextDecoder),Yke.decode(this.buffer))}}function tLe(e,t){return(0|e[t+0])>>>0|e[t+1]<<8>>>0}function iLe(e,t,i){e[i+0]=255&t,t>>>=8,e[i+1]=255&t}function nLe(e,t){return e[t]*Math.pow(2,24)+e[t+1]*Math.pow(2,16)+e[t+2]*Math.pow(2,8)+e[t+3]}function oLe(e,t,i){e[i+3]=t,t>>>=8,e[i+2]=t,t>>>=8,e[i+1]=t,t>>>=8,e[i]=t}function sLe(e,t){return e[t]}function rLe(e,t,i){e[i]=t}function aLe(){return Qke||(Qke=new TextDecoder("UTF-16LE")),Qke}function lLe(){return Jke||(Jke=Vve()?aLe():(Xke||(Xke=new TextDecoder("UTF-16BE")),Xke)),Jke}class dLe{constructor(e){this._capacity=0|e,this._buffer=new Uint16Array(this._capacity),this._completedStrings=null,this._bufferLength=0}reset(){this._completedStrings=null,this._bufferLength=0}build(){return null!==this._completedStrings?(this._flushBuffer(),this._completedStrings.join("")):this._buildBuffer()}_buildBuffer(){if(0===this._bufferLength)return"";const e=new Uint16Array(this._buffer.buffer,0,this._bufferLength);return lLe().decode(e)}_flushBuffer(){const e=this._buildBuffer();this._bufferLength=0,null===this._completedStrings?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}appendCharCode(e){const t=this._capacity-this._bufferLength;t<=1&&(0===t||zSe(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIICharCode(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendString(e){const t=e.length;if(this._bufferLength+t>=this._capacity)return this._flushBuffer(),void(this._completedStrings[this._completedStrings.length]=e);for(let i=0;i<t;i++)this._buffer[this._bufferLength++]=e.charCodeAt(i)}}class hLe{constructor(e,t,i,n,o,s){this._richEditBracketBrand=void 0,this.languageId=e,this.index=t,this.open=i,this.close=n,this.forwardRegex=o,this.reversedRegex=s,this._openSet=hLe._toSet(this.open),this._closeSet=hLe._toSet(this.close)}isOpen(e){return this._openSet.has(e)}isClose(e){return this._closeSet.has(e)}static _toSet(e){const t=new Set;for(const i of e)t.add(i);return t}}class cLe{constructor(e,t){this._richEditBracketsBrand=void 0;const i=function(e){const t=e.length;e=e.map((e=>[e[0].toLowerCase(),e[1].toLowerCase()]));const i=[];for(let e=0;e<t;e++)i[e]=e;const n=(e,t)=>{const[i,n]=e,[o,s]=t;return i===o||i===s||n===o||n===s},o=(e,n)=>{const o=Math.min(e,n),s=Math.max(e,n);for(let e=0;e<t;e++)i[e]===s&&(i[e]=o)};for(let s=0;s<t;s++){const r=e[s];for(let a=s+1;a<t;a++)n(r,e[a])&&o(i[s],i[a])}const s=[];for(let n=0;n<t;n++){const o=[],r=[];for(let s=0;s<t;s++)if(i[s]===n){const[t,i]=e[s];o.push(t),r.push(i)}o.length>0&&s.push({open:o,close:r})}return s}(t);this.brackets=i.map(((t,n)=>new hLe(e,n,t.open,t.close,function(e,t,i,n){let o=[];o=o.concat(e),o=o.concat(t);for(let e=0,t=o.length;e<t;e++)uLe(o[e],i,n,o);return o=pLe(o),o.sort(gLe),o.reverse(),fLe(o)}(t.open,t.close,i,n),function(e,t,i,n){let o=[];o=o.concat(e),o=o.concat(t);for(let e=0,t=o.length;e<t;e++)uLe(o[e],i,n,o);return o=pLe(o),o.sort(gLe),o.reverse(),fLe(o.map(_Le))}(t.open,t.close,i,n)))),this.forwardRegex=function(e){let t=[];for(const i of e){for(const e of i.open)t.push(e);for(const e of i.close)t.push(e)}return t=pLe(t),fLe(t)}(this.brackets),this.reversedRegex=function(e){let t=[];for(const i of e){for(const e of i.open)t.push(e);for(const e of i.close)t.push(e)}return t=pLe(t),fLe(t.map(_Le))}(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const e of this.brackets){for(const t of e.open)this.textIsBracket[t]=e,this.textIsOpenBracket[t]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,t.length);for(const t of e.close)this.textIsBracket[t]=e,this.textIsOpenBracket[t]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,t.length)}}}function uLe(e,t,i,n){for(let o=0,s=t.length;o<s;o++){if(o===i)continue;const s=t[o];for(const t of s.open)t.indexOf(e)>=0&&n.push(t);for(const t of s.close)t.indexOf(e)>=0&&n.push(t)}}function gLe(e,t){return e.length-t.length}function pLe(e){if(e.length<=1)return e;const t=[],i=new Set;for(const n of e)i.has(n)||(t.push(n),i.add(n));return t}function mLe(e){const t=/^[\w ]+$/.test(e);return e=SSe(e),t?`\\b${e}\\b`:e}function fLe(e){return kSe(`(${e.map(mLe).join(")|(")})`,!0)}const _Le=function(){let e=null,t=null;return function(i){return e!==i&&(e=i,t=function(e){const t=new Uint16Array(e.length);let i=0;for(let n=e.length-1;n>=0;n--)t[i++]=e.charCodeAt(n);return lLe().decode(t)}(e)),t}}();class vLe{static _findPrevBracketInText(e,t,i,n){const o=i.match(e);if(!o)return null;const s=i.length-(o.index||0),r=o[0].length,a=n+s;return new dye(t,a-r+1,t,a+1)}static findPrevBracketInRange(e,t,i,n,o){const s=_Le(i).substring(i.length-o,i.length-n);return this._findPrevBracketInText(e,t,s,n)}static findNextBracketInText(e,t,i,n){const o=i.match(e);if(!o)return null;const s=o.index||0,r=o[0].length;if(0===r)return null;const a=n+s;return new dye(t,a+1,t,a+1+r)}static findNextBracketInRange(e,t,i,n,o){const s=i.substring(n,o);return this.findNextBracketInText(e,t,s,n)}}class bLe{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const t=i.charAt(i.length-1);e.push(t)}return nbe(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||0===this._richEditBrackets.brackets.length)return null;const n=t.findTokenIndexAtOffset(i-1);if($ke(t.getStandardTokenType(n)))return null;const o=this._richEditBrackets.reversedRegex,s=t.getLineContent().substring(0,i-1)+e,r=vLe.findPrevBracketInRange(o,1,s,0,s.length);if(!r)return null;const a=s.substring(r.startColumn-1,r.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[a])return null;const l=t.getActualLineContentBefore(r.startColumn-1);return/^\s*$/.test(l)?{matchOpenBracket:a}:null}}function wLe(e){return e.global&&(e.lastIndex=0),!0}class CLe{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&wLe(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&wLe(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&wLe(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&wLe(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}class yLe{constructor(e){(e=e||{}).brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach((e=>{const t=yLe._createOpenBracketRegExp(e[0]),i=yLe._createCloseBracketRegExp(e[1]);t&&i&&this._brackets.push({open:e[0],openRegExp:t,close:e[1],closeRegExp:i})})),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,n){if(e>=3)for(let e=0,o=this._regExpRules.length;e<o;e++){const o=this._regExpRules[e];if([{reg:o.beforeText,text:i},{reg:o.afterText,text:n},{reg:o.previousLineText,text:t}].every((e=>!e.reg||(e.reg.lastIndex=0,e.reg.test(e.text)))))return o.action}if(e>=2&&i.length>0&&n.length>0)for(let e=0,t=this._brackets.length;e<t;e++){const t=this._brackets[e];if(t.openRegExp.test(i)&&t.closeRegExp.test(n))return{indentAction:Oke.IndentOutdent}}if(e>=2&&i.length>0)for(let e=0,t=this._brackets.length;e<t;e++)if(this._brackets[e].openRegExp.test(i))return{indentAction:Oke.Indent};return null}static _createOpenBracketRegExp(e){let t=SSe(e);return/\B/.test(t.charAt(0))||(t="\\b"+t),t+="\\s*$",yLe._safeRegExp(t)}static _createCloseBracketRegExp(e){let t=SSe(e);return/\B/.test(t.charAt(t.length-1))||(t+="\\b"),t="^\\s*"+t,yLe._safeRegExp(t)}static _safeRegExp(e){try{return new RegExp(e)}catch(e){return wwe(e),null}}}const SLe=zxe("configurationService");function xLe(e,t){const i=Object.create(null);for(const n in e)kLe(i,n,e[n],t);return i}function kLe(e,t,i,n){const o=t.split("."),s=o.pop();let r=e;for(let e=0;e<o.length;e++){const i=o[e];let s=r[i];switch(typeof s){case"undefined":s=r[i]=Object.create(null);break;case"object":break;default:return void n(`Ignoring ${t} as ${o.slice(0,e+1).join(".")} is ${JSON.stringify(s)}`)}r=s}if("object"==typeof r&&null!==r)try{r[s]=i}catch(e){n(`Ignoring ${t} as ${o.join(".")} is ${JSON.stringify(r)}`)}else n(`Ignoring ${t} as ${o.join(".")} is ${JSON.stringify(r)}`)}function LLe(e,t){DLe(e,t.split("."))}function DLe(e,t){const i=t.shift();if(0!==t.length){if(-1!==Object.keys(e).indexOf(i)){const n=e[i];"object"!=typeof n||Array.isArray(n)||(DLe(n,t),0===Object.keys(n).length&&delete e[i])}}else delete e[i]}function ELe(e,t,i){const n=function(e,t){let i=e;for(const e of t){if("object"!=typeof i||null===i)return;i=i[e]}return i}(e,t.split("."));return void 0===n?i:n}const NLe=zxe("languageService");class ILe{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const TLe=[];function MLe(e,t,i){t instanceof ILe||(t=new ILe(t,[],Boolean(i))),TLe.push([e,t])}function ALe(){return TLe}const RLe=new class{constructor(){this.data=new Map}add(e,t){Kxe(fbe(e)),Kxe(_be(t)),Kxe(!this.data.has(e),"There is already an extension with this id"),this.data.set(e,t)}as(e){return this.data.get(e)||null}},OLe=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"}),PLe="base.contributions.json",FLe=new class{constructor(){this._onDidChangeSchema=new $we,this.schemasById={}}registerSchema(e,t){this.schemasById[function(e){return e.length>0&&"#"===e.charAt(e.length-1)?e.substring(0,e.length-1):e}(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}};RLe.add(PLe,FLe);const BLe="base.contributions.configuration",WLe={properties:{},patternProperties:{}},VLe={properties:{},patternProperties:{}},HLe={properties:{},patternProperties:{}},zLe={properties:{},patternProperties:{}},ULe={properties:{},patternProperties:{}},KLe={properties:{},patternProperties:{}},jLe="vscode://schemas/settings/resourceLanguage",qLe=RLe.as(PLe),$Le="\\[([^\\]]+)\\]",GLe=new RegExp($Le,"g"),ZLe=`^(${$Le})+$`,YLe=new RegExp(ZLe);function QLe(e){const t=[];if(YLe.test(e)){let i=GLe.exec(e);for(;null==i?void 0:i.length;){const n=i[1].trim();n&&t.push(n),i=GLe.exec(e)}}return nbe(t)}const XLe=new class{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new $we,this._onDidUpdateConfiguration=new $we,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:ove(0,"Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},qLe.registerSchema(jLe,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=new Set;this.doRegisterConfigurations(e,t,i),qLe.registerSchema(jLe,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){var i;const n=[];for(const{overrides:o,source:s}of e)for(const e in o)if(t.add(e),YLe.test(e)){const t=this.configurationDefaultsOverrides.get(e),r=null!==(i=null==t?void 0:t.valuesSources)&&void 0!==i?i:new Map;if(s)for(const t of Object.keys(o[e]))r.set(t,s);const a=Object.assign(Object.assign({},(null==t?void 0:t.value)||{}),o[e]);this.configurationDefaultsOverrides.set(e,{source:s,value:a,valuesSources:r});const l={type:"object",default:a,description:ove(0,"Configure settings to be overridden for the {0} language.",e.replace(/[\[\]]/g,"")),$ref:jLe,defaultDefaultValue:a,source:fbe(s)?void 0:s,defaultValueSource:s};n.push(...QLe(e)),this.configurationProperties[e]=l,this.defaultLanguageConfigurationOverridesNode.properties[e]=l}else{this.configurationDefaultsOverrides.set(e,{value:o[e],source:s});const t=this.configurationProperties[e];t&&(this.updatePropertyDefaultValue(e,t),this.updateSchema(e,t))}this.doRegisterOverrideIdentifiers(n)}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach((e=>{this.validateAndRegisterProperties(e,t,e.extensionInfo,e.restrictedProperties,void 0,i),this.configurationContributors.push(e),this.registerJSONConfiguration(e)}))}validateAndRegisterProperties(e,t=!0,i,n,o=3,s){var r;o=xbe(e.scope)?o:e.scope;const a=e.properties;if(a)for(const e in a){const l=a[e];t&&JLe(e,l)?delete a[e]:(l.source=i,l.defaultDefaultValue=a[e].default,this.updatePropertyDefaultValue(e,l),YLe.test(e)?l.scope=void 0:(l.scope=xbe(l.scope)?o:l.scope,l.restricted=xbe(l.restricted)?!!(null==n?void 0:n.includes(e)):l.restricted),!a[e].hasOwnProperty("included")||a[e].included?(this.configurationProperties[e]=a[e],(null===(r=a[e].policy)||void 0===r?void 0:r.name)&&this.policyConfigurations.set(a[e].policy.name,e),!a[e].deprecationMessage&&a[e].markdownDeprecationMessage&&(a[e].deprecationMessage=a[e].markdownDeprecationMessage),s.add(e)):(this.excludedConfigurationProperties[e]=a[e],delete a[e]))}const l=e.allOf;if(l)for(const e of l)this.validateAndRegisterProperties(e,t,i,n,o,s)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=e=>{const i=e.properties;if(i)for(const e in i)this.updateSchema(e,i[e]);const n=e.allOf;null==n||n.forEach(t)};t(e)}updateSchema(e,t){switch(WLe.properties[e]=t,t.scope){case 1:VLe.properties[e]=t;break;case 2:HLe.properties[e]=t;break;case 6:zLe.properties[e]=t;break;case 3:ULe.properties[e]=t;break;case 4:KLe.properties[e]=t;break;case 5:KLe.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:ove(0,"Configure editor settings to be overridden for a language."),errorMessage:ove(0,"This setting does not support per-language configuration."),$ref:jLe};this.updatePropertyDefaultValue(t,i),WLe.properties[t]=i,VLe.properties[t]=i,HLe.properties[t]=i,zLe.properties[t]=i,ULe.properties[t]=i,KLe.properties[t]=i}}registerOverridePropertyPatternKey(){const e={type:"object",description:ove(0,"Configure editor settings to be overridden for a language."),errorMessage:ove(0,"This setting does not support per-language configuration."),$ref:jLe};WLe.patternProperties[ZLe]=e,VLe.patternProperties[ZLe]=e,HLe.patternProperties[ZLe]=e,zLe.patternProperties[ZLe]=e,ULe.patternProperties[ZLe]=e,KLe.patternProperties[ZLe]=e,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e);let n=null==i?void 0:i.value,o=null==i?void 0:i.source;ybe(n)&&(n=t.defaultDefaultValue,o=void 0),ybe(n)&&(n=function(e){switch(Array.isArray(e)?e[0]:e){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}(t.type)),t.default=n,t.defaultValueSource=o}};function JLe(e,t){var i,n,o,s;return e.trim()?YLe.test(e)?ove(0,"Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",e):void 0!==XLe.getConfigurationProperties()[e]?ove(0,"Cannot register '{0}'. This property is already registered.",e):(null===(i=t.policy)||void 0===i?void 0:i.name)&&void 0!==XLe.getPolicyConfigurations().get(null===(n=t.policy)||void 0===n?void 0:n.name)?ove(0,"Cannot register '{0}'. The associated policy {1} is already registered with {2}.",e,null===(o=t.policy)||void 0===o?void 0:o.name,XLe.getPolicyConfigurations().get(null===(s=t.policy)||void 0===s?void 0:s.name)):null:ove(0,"Cannot register an empty property")}RLe.add(BLe,XLe);const eDe=new class{constructor(){this._onDidChangeLanguages=new $we,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t<i;t++)if(this._languages[t]===e)return void this._languages.splice(t,1)}}}getLanguages(){return this._languages}};RLe.add("editor.modesRegistry",eDe);const tDe="plaintext";eDe.registerLanguage({id:tDe,extensions:[".txt"],aliases:[ove(0,"Plain Text"),"text"],mimetypes:[OLe.text]}),RLe.as(BLe).registerDefaultConfigurations([{overrides:{"[plaintext]":{"editor.unicodeHighlight.ambiguousCharacters":!1,"editor.unicodeHighlight.invisibleCharacters":!1}}}]);class iDe{constructor(e,t){let i;this.languageId=e,i=t.colorizedBracketPairs?nDe(t.colorizedBracketPairs.map((e=>[e[0],e[1]]))):t.brackets?nDe(t.brackets.map((e=>[e[0],e[1]])).filter((e=>!("<"===e[0]&&">"===e[1])))):[];const n=new vSe((e=>{const t=new Set;return{info:new sDe(this,e,t),closing:t}})),o=new vSe((e=>{const t=new Set;return{info:new rDe(this,e,t),opening:t}}));for(const[e,t]of i){const i=n.get(e),s=o.get(t);i.closing.add(s.info),s.opening.add(i.info)}this._openingBrackets=new Map([...n.cachedValues].map((([e,t])=>[e,t.info]))),this._closingBrackets=new Map([...o.cachedValues].map((([e,t])=>[e,t.info])))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}}function nDe(e){return e.filter((([e,t])=>""!==e&&""!==t))}class oDe{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class sDe extends oDe{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class rDe extends oDe{constructor(e,t,i){super(e,t),this.closedBrackets=i,this.isOpeningBracket=!1}closes(e){if(e.languageId===this.languageId&&e.config!==this.config)throw new Nwe("Brackets from different language configuration cannot be used.");return this.closedBrackets.has(e)}getClosedBrackets(){return[...this.closedBrackets]}}var aDe=function(e,t){return function(i,n){t(i,n,e)}};class lDe{constructor(e){this.languageId=e}affects(e){return!this.languageId||this.languageId===e}}const dDe=zxe("languageConfigurationService");let hDe=class extends Owe{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new bDe),this.onDidChangeEmitter=this._register(new $we),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(cDe));this._register(this.configurationService.onDidChangeConfiguration((e=>{const t=e.change.keys.some((e=>i.has(e))),n=e.change.overrides.filter((([e,t])=>t.some((e=>i.has(e))))).map((([e])=>e));if(t)this.configurations.clear(),this.onDidChangeEmitter.fire(new lDe(void 0));else for(const e of n)this.languageService.isRegisteredLanguageId(e)&&(this.configurations.delete(e),this.onDidChangeEmitter.fire(new lDe(e)))}))),this._register(this._registry.onDidChange((e=>{this.configurations.delete(e.languageId),this.onDidChangeEmitter.fire(new lDe(e.languageId))})))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=function(e,t,i,n){let o=t.getLanguageConfiguration(e);if(!o){if(!n.isRegisteredLanguageId(e))return new wDe(e,{});o=new wDe(e,{})}const s=function(e,t){const i=t.getValue(cDe.brackets,{overrideIdentifier:e}),n=t.getValue(cDe.colorizedBracketPairs,{overrideIdentifier:e});return{brackets:uDe(i),colorizedBracketPairs:uDe(n)}}(o.languageId,i),r=fDe([o.underlyingConfig,s]);return new wDe(o.languageId,r)}(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};hDe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([aDe(0,SLe),aDe(1,NLe)],hDe);const cDe={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function uDe(e){if(Array.isArray(e))return e.map((e=>{if(Array.isArray(e)&&2===e.length)return[e[0],e[1]]})).filter((e=>!!e))}function gDe(e,t,i){let n=NSe(e.getLineContent(t));return n.length>i-1&&(n=n.substring(0,i-1)),n}function pDe(e,t,i){return e.tokenization.forceTokenization(t),jke(e.tokenization.getLineTokens(t),void 0===i?e.getLineMaxColumn(t)-1:i-1)}class mDe{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new _De(e,t,++this._order);return this._entries.push(i),this._resolved=null,Awe((()=>{for(let e=0;e<this._entries.length;e++)if(this._entries[e]===i){this._entries.splice(e,1),this._resolved=null;break}}))}getResolvedConfiguration(){if(!this._resolved){const e=this._resolve();e&&(this._resolved=new wDe(this.languageId,e))}return this._resolved}_resolve(){return 0===this._entries.length?null:(this._entries.sort(_De.cmp),fDe(this._entries.map((e=>e.configuration))))}}function fDe(e){let t={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const i of e)t={comments:i.comments||t.comments,brackets:i.brackets||t.brackets,wordPattern:i.wordPattern||t.wordPattern,indentationRules:i.indentationRules||t.indentationRules,onEnterRules:i.onEnterRules||t.onEnterRules,autoClosingPairs:i.autoClosingPairs||t.autoClosingPairs,surroundingPairs:i.surroundingPairs||t.surroundingPairs,autoCloseBefore:i.autoCloseBefore||t.autoCloseBefore,folding:i.folding||t.folding,colorizedBracketPairs:i.colorizedBracketPairs||t.colorizedBracketPairs,__electricCharacterSupport:i.__electricCharacterSupport||t.__electricCharacterSupport};return t}class _De{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class vDe{constructor(e){this.languageId=e}}class bDe extends Owe{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new $we),this.onDidChange=this._onDidChange.event,this._register(this.register(tDe,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let n=this._entries.get(e);n||(n=new mDe(e),this._entries.set(e,n));const o=n.register(t,i);return this._onDidChange.fire(new vDe(e)),Awe((()=>{o.dispose(),this._onDidChange.fire(new vDe(e))}))}getLanguageConfiguration(e){const t=this._entries.get(e);return(null==t?void 0:t.getResolvedConfiguration())||null}}class wDe{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new yLe(this.underlyingConfig):null,this.comments=wDe._handleComments(this.underlyingConfig),this.characterPair=new Gke(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||Zve,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new CLe(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new iDe(e,this.underlyingConfig)}getWordDefinition(){return Yve(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new cLe(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new bLe(this.brackets)),this._electricCharacter}onEnter(e,t,i,n){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,n):null}getAutoClosingPairs(){return new Uke(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const t=e.comments;if(!t)return null;const i={};if(t.lineComment&&(i.lineCommentToken=t.lineComment),t.blockComment){const[e,n]=t.blockComment;i.blockCommentStartToken=e,i.blockCommentEndToken=n}return i}}MLe(dDe,hDe,1);const CDe=new class{clone(){return this}equals(e){return this===e}};function yDe(e,t){return new kye([new xye(0,"",e)],t)}function SDe(e,t){const i=new Uint32Array(2);return i[0]=0,i[1]=(32768|e|2<<24)>>>0,new Lye(i,null===t?CDe:t)}const xDe=zxe("modelService"),kDe=Symbol("MicrotaskDelay");var LDe=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))},DDe=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=e[i]&&function(t){return new Promise((function(n,o){!function(e,t,i,n){Promise.resolve(n).then((function(t){e({value:t,done:i})}),t)}(n,o,(t=e[i](t)).done,t.value)}))}}};function EDe(e){return!!e&&"function"==typeof e.then}function NDe(e){const t=new sCe,i=e(t.token),n=new Promise(((e,n)=>{const o=t.token.onCancellationRequested((()=>{o.dispose(),t.dispose(),n(new kwe)}));Promise.resolve(i).then((i=>{o.dispose(),t.dispose(),e(i)}),(e=>{o.dispose(),t.dispose(),n(e)}))}));return new class{cancel(){t.cancel()}then(e,t){return n.then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return n.finally(e)}}}class IDe{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const e=()=>{this.queuedPromise=null;const e=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,e};this.queuedPromise=new Promise((t=>{this.activePromise.then(e,e).then(t)}))}return new Promise(((e,t)=>{this.queuedPromise.then(e,t)}))}return this.activePromise=e(),new Promise(((e,t)=>{this.activePromise.then((t=>{this.activePromise=null,e(t)}),(e=>{this.activePromise=null,t(e)}))}))}}class TDe{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise(((e,t)=>{this.doResolve=e,this.doReject=t})).then((()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const e=this.task;return this.task=null,e()}})));const i=()=>{var e;this.deferred=null,null===(e=this.doResolve)||void 0===e||e.call(this,null)};return this.deferred=t===kDe?(e=>{let t=!0;return queueMicrotask((()=>{t&&(t=!1,e())})),{isTriggered:()=>t,dispose:()=>{t=!1}}})(i):((e,t)=>{let i=!0;const n=setTimeout((()=>{i=!1,t()}),e);return{isTriggered:()=>i,dispose:()=>{clearTimeout(n),i=!1}}})(t,i),this.completionPromise}isTriggered(){var e;return!!(null===(e=this.deferred)||void 0===e?void 0:e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&(null===(e=this.doReject)||void 0===e||e.call(this,new kwe),this.completionPromise=null)}cancelTimeout(){var e;null===(e=this.deferred)||void 0===e||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class MDe{constructor(e){this.delayer=new TDe(e),this.throttler=new IDe}trigger(e,t){return this.delayer.trigger((()=>this.throttler.queue(e)),t)}dispose(){this.delayer.dispose()}}function ADe(e,t){return t?new Promise(((i,n)=>{const o=setTimeout((()=>{s.dispose(),i()}),e),s=t.onCancellationRequested((()=>{clearTimeout(o),s.dispose(),n(new kwe)}))})):NDe((t=>ADe(e,t)))}function RDe(e,t=0){const i=setTimeout(e,t);return Awe((()=>clearTimeout(i)))}class ODe{constructor(e,t){this._token=-1,"function"==typeof e&&"number"==typeof t&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){-1!==this._token&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout((()=>{this._token=-1,e()}),t)}setIfNotSet(e,t){-1===this._token&&(this._token=setTimeout((()=>{this._token=-1,e()}),t))}}class PDe{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){-1!==this._token&&(clearInterval(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setInterval((()=>{e()}),t)}}class FDe{constructor(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return-1!==this.timeoutToken}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){var e;null===(e=this.runner)||void 0===e||e.call(this)}}let BDe;BDe="function"!=typeof requestIdleCallback||"function"!=typeof cancelIdleCallback?e=>{Pve((()=>{if(t)return;const i=Date.now()+15;e(Object.freeze({didTimeout:!0,timeRemaining:()=>Math.max(0,i-Date.now())}))}));let t=!1;return{dispose(){t||(t=!0)}}}:(e,t)=>{const i=requestIdleCallback(e,"number"==typeof t?{timeout:t}:void 0);let n=!1;return{dispose(){n||(n=!0,cancelIdleCallback(i))}}};class WDe{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(e){this._error=e}finally{this._didRun=!0}},this._handle=BDe((()=>this._executor()))}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}class VDe{get isRejected(){return this.rejected}get isSettled(){return this.rejected||this.resolved}constructor(){this.rejected=!1,this.resolved=!1,this.p=new Promise(((e,t)=>{this.completeCallback=e,this.errorCallback=t}))}complete(e){return new Promise((t=>{this.completeCallback(e),this.resolved=!0,t()}))}cancel(){new Promise((e=>{this.errorCallback(new kwe),this.rejected=!0,e()}))}}var HDe;!function(e){e.settled=function(e){return LDe(this,void 0,void 0,(function*(){let t;const i=yield Promise.all(e.map((e=>e.then((e=>e),(e=>{t||(t=e)})))));if(void 0!==t)throw t;return i}))},e.withAsyncBody=function(e){return new Promise(((t,i)=>LDe(this,void 0,void 0,(function*(){try{yield e(t,i)}catch(e){i(e)}}))))}}(HDe||(HDe={}));class zDe{static fromArray(e){return new zDe((t=>{t.emitMany(e)}))}static fromPromise(e){return new zDe((t=>LDe(this,void 0,void 0,(function*(){t.emitMany(yield e)}))))}static fromPromises(e){return new zDe((t=>LDe(this,void 0,void 0,(function*(){yield Promise.all(e.map((e=>LDe(this,void 0,void 0,(function*(){return t.emitOne(yield e)})))))}))))}static merge(e){return new zDe((t=>LDe(this,void 0,void 0,(function*(){yield Promise.all(e.map((e=>{var i,n,o;return LDe(this,void 0,void 0,(function*(){var s,r,a,l;try{for(i=!0,n=DDe(e);!(s=(o=yield n.next()).done);){l=o.value,i=!1;try{const e=l;t.emitOne(e)}finally{i=!0}}}catch(e){r={error:e}}finally{try{i||s||!(a=n.return)||(yield a.call(n))}finally{if(r)throw r.error}}}))})))}))))}constructor(e){this._state=0,this._results=[],this._error=null,this._onStateChanged=new $we,queueMicrotask((()=>LDe(this,void 0,void 0,(function*(){const t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{yield Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}}))))}[Symbol.asyncIterator](){let e=0;return{next:()=>LDe(this,void 0,void 0,(function*(){for(;;){if(2===this._state)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(1===this._state)return{done:!0,value:void 0};yield zwe.toPromise(this._onStateChanged.event)}}))}}static map(e,t){return new zDe((i=>LDe(this,void 0,void 0,(function*(){var n,o,s,r;try{for(var a,l=!0,d=DDe(e);!(n=(a=yield d.next()).done);){r=a.value,l=!1;try{const e=r;i.emitOne(t(e))}finally{l=!0}}}catch(e){o={error:e}}finally{try{l||n||!(s=d.return)||(yield s.call(d))}finally{if(o)throw o.error}}}))))}map(e){return zDe.map(this,e)}static filter(e,t){return new zDe((i=>LDe(this,void 0,void 0,(function*(){var n,o,s,r;try{for(var a,l=!0,d=DDe(e);!(n=(a=yield d.next()).done);){r=a.value,l=!1;try{const e=r;t(e)&&i.emitOne(e)}finally{l=!0}}}catch(e){o={error:e}}finally{try{l||n||!(s=d.return)||(yield s.call(d))}finally{if(o)throw o.error}}}))))}filter(e){return zDe.filter(this,e)}static coalesce(e){return zDe.filter(e,(e=>!!e))}coalesce(){return zDe.coalesce(this)}static toPromise(e){var t,i,n,o,s,r,a;return LDe(this,void 0,void 0,(function*(){const l=[];try{for(t=!0,i=DDe(e);n=yield i.next(),!(o=n.done);){a=n.value,t=!1;try{const e=a;l.push(e)}finally{t=!0}}}catch(e){s={error:e}}finally{try{t||o||!(r=i.return)||(yield r.call(i))}finally{if(s)throw s.error}}return l}))}toPromise(){return zDe.toPromise(this)}emitOne(e){0===this._state&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){0===this._state&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){0===this._state&&(this._state=1,this._onStateChanged.fire())}reject(e){0===this._state&&(this._state=2,this._error=e,this._onStateChanged.fire())}}zDe.EMPTY=zDe.fromArray([]);let UDe=!1;function KDe(e){Ive&&(UDe||(UDe=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(e.message))}class jDe{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.method=i,this.args=n,this.type=0}}class qDe{constructor(e,t,i,n){this.vsWorker=e,this.seq=t,this.res=i,this.err=n,this.type=1}}class $De{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=n,this.type=2}}class GDe{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class ZDe{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class YDe{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t){const i=String(++this._lastSentReq);return new Promise(((n,o)=>{this._pendingReplies[i]={resolve:n,reject:o},this._send(new jDe(this._workerId,i,e,t))}))}listen(e,t){let i=null;const n=new $we({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,n),this._send(new $De(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new ZDe(this._workerId,i)),i=null}});return n.event}handleMessage(e){e&&e.vsWorker&&(-1!==this._workerId&&e.vsWorker!==this._workerId||this._handleMessage(e))}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq])return void console.warn("Got reply to unknown seq");const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;return e.err.$isError&&(i=new Error,i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack),void t.reject(i)}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then((e=>{this._send(new qDe(this._workerId,t,e,void 0))}),(e=>{e.detail instanceof Error&&(e.detail=ywe(e.detail)),this._send(new qDe(this._workerId,t,void 0,ywe(e)))}))}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)((e=>{this._send(new GDe(this._workerId,t,e))}));this._pendingEvents.set(t,i)}_handleEventMessage(e){this._pendingEmitters.has(e.req)?this._pendingEmitters.get(e.req).fire(e.event):console.warn("Got event for unknown req")}_handleUnsubscribeEventMessage(e){this._pendingEvents.has(e.req)?(this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)):console.warn("Got unsubscribe for unknown req")}_send(e){const t=[];if(0===e.type)for(let i=0;i<e.args.length;i++)e.args[i]instanceof ArrayBuffer&&t.push(e.args[i]);else 1===e.type&&e.res instanceof ArrayBuffer&&t.push(e.res);this._handler.sendMessage(e,t)}}class QDe extends Owe{constructor(e,t,i){super();let n=null;this._worker=this._register(e.create("vs/base/common/worker/simpleWorker",(e=>{this._protocol.handleMessage(e)}),(e=>{null==n||n(e)}))),this._protocol=new YDe({sendMessage:(e,t)=>{this._worker.postMessage(e,t)},handleMessage:(e,t)=>{if("function"!=typeof i[e])return Promise.reject(new Error("Missing method "+e+" on main thread host."));try{return Promise.resolve(i[e].apply(i,t))}catch(e){return Promise.reject(e)}},handleEvent:(e,t)=>{if(JDe(e)){const n=i[e].call(i,t);if("function"!=typeof n)throw new Error(`Missing dynamic event ${e} on main thread host.`);return n}if(XDe(e)){const t=i[e];if("function"!=typeof t)throw new Error(`Missing event ${e} on main thread host.`);return t}throw new Error(`Malformed event name ${e}`)}}),this._protocol.setWorkerId(this._worker.getId());let o=null;void 0!==Cve.require&&"function"==typeof Cve.require.getConfig?o=Cve.require.getConfig():void 0!==Cve.requirejs&&(o=Cve.requirejs.s.contexts._.config);const s=Obe(i);this._onModuleLoaded=this._protocol.sendMessage("$initialize",[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,s]);const r=(e,t)=>this._request(e,t),a=(e,t)=>this._protocol.listen(e,t);this._lazyProxy=new Promise(((e,i)=>{n=i,this._onModuleLoaded.then((t=>{e(function(e,t,i){const n=e=>function(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)},o=e=>function(t){return i(e,t)},s={};for(const t of e)JDe(t)?s[t]=o(t):XDe(t)?s[t]=i(t,void 0):s[t]=n(t);return s}(t,r,a))}),(e=>{i(e),this._onError("Worker failed to load "+t,e)}))}))}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise(((i,n)=>{this._onModuleLoaded.then((()=>{this._protocol.sendMessage(e,t).then(i,n)}),n)}))}_onError(e,t){console.error(e),console.info(t)}}function XDe(e){return"o"===e[0]&&"n"===e[1]&&FSe(e.charCodeAt(2))}function JDe(e){return/^onDynamic/.test(e)&&FSe(e.charCodeAt(9))}var eEe;const tEe=null===(eEe=window.trustedTypes)||void 0===eEe?void 0:eEe.createPolicy("defaultWorkerFactory",{createScriptURL:e=>e});class iEe{constructor(e,t,i,n,o){this.id=t;const s=function(e){if(Cve.MonacoEnvironment){if("function"==typeof Cve.MonacoEnvironment.getWorker)return Cve.MonacoEnvironment.getWorker("workerMain.js",e);if("function"==typeof Cve.MonacoEnvironment.getWorkerUrl){const t=Cve.MonacoEnvironment.getWorkerUrl("workerMain.js",e);return new Worker(tEe?tEe.createScriptURL(t):t,{name:e})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}(i);"function"==typeof s.then?this.worker=s:this.worker=Promise.resolve(s),this.postMessage(e,[]),this.worker.then((e=>{e.onmessage=function(e){n(e.data)},e.onmessageerror=o,"function"==typeof e.addEventListener&&e.addEventListener("error",o)}))}getId(){return this.id}postMessage(e,t){var i;null===(i=this.worker)||void 0===i||i.then((i=>i.postMessage(e,t)))}dispose(){var e;null===(e=this.worker)||void 0===e||e.then((e=>e.terminate())),this.worker=null}}class nEe{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const n=++nEe.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new iEe(e,n,this._label||"anonymous"+n,t,(e=>{KDe(e),this._webWorkerFailedBeforeError=e,i(e)}))}}nEe.LAST_WORKER_ID=0;class oEe{constructor(e,t,i,n){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=n}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}function sEe(e,t){switch(typeof e){case"object":return null===e?rEe(349,t):Array.isArray(e)?(i=e,n=rEe(104579,n=t),i.reduce(((e,t)=>sEe(t,e)),n)):function(e,t){return t=rEe(181387,t),Object.keys(e).sort().reduce(((t,i)=>(t=aEe(i,t),sEe(e[i],t))),t)}(e,t);case"string":return aEe(e,t);case"boolean":return function(e,t){return rEe(e?433:863,t)}(e,t);case"number":return rEe(e,t);case"undefined":return rEe(937,t);default:return rEe(617,t)}var i,n}function rEe(e,t){return(t<<5)-t+e|0}function aEe(e,t){t=rEe(149417,t);for(let i=0,n=e.length;i<n;i++)t=rEe(e.charCodeAt(i),t);return t}function lEe(e,t,i=32){const n=i-t;return(e<<t|(~((1<<n)-1)&e)>>>n)>>>0}function dEe(e,t=0,i=e.byteLength,n=0){for(let o=0;o<i;o++)e[t+o]=n}function hEe(e,t=32){return e instanceof ArrayBuffer?Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join(""):function(e,t,i="0"){for(;e.length<t;)e=i+e;return e}((e>>>0).toString(16),t/4)}class cEe{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(0===t)return;const i=this._buff;let n,o,s=this._buffLen,r=this._leftoverHighSurrogate;for(0!==r?(n=r,o=-1,r=0):(n=e.charCodeAt(0),o=0);;){let a=n;if(zSe(n)){if(!(o+1<t)){r=n;break}{const t=e.charCodeAt(o+1);USe(t)?(o++,a=KSe(n,t)):a=65533}}else USe(n)&&(a=65533);if(s=this._push(i,s,a),o++,!(o<t))break;n=e.charCodeAt(o)}this._buffLen=s,this._leftoverHighSurrogate=r}_push(e,t,i){return i<128?e[t++]=i:i<2048?(e[t++]=192|(1984&i)>>>6,e[t++]=128|(63&i)>>>0):i<65536?(e[t++]=224|(61440&i)>>>12,e[t++]=128|(4032&i)>>>6,e[t++]=128|(63&i)>>>0):(e[t++]=240|(1835008&i)>>>18,e[t++]=128|(258048&i)>>>12,e[t++]=128|(4032&i)>>>6,e[t++]=128|(63&i)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),hEe(this._h0)+hEe(this._h1)+hEe(this._h2)+hEe(this._h3)+hEe(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,dEe(this._buff,this._buffLen),this._buffLen>56&&(this._step(),dEe(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=cEe._bigBlock32,t=this._buffDV;for(let i=0;i<64;i+=4)e.setUint32(i,t.getUint32(i,!1),!1);for(let t=64;t<320;t+=4)e.setUint32(t,lEe(e.getUint32(t-12,!1)^e.getUint32(t-32,!1)^e.getUint32(t-56,!1)^e.getUint32(t-64,!1),1),!1);let i,n,o,s=this._h0,r=this._h1,a=this._h2,l=this._h3,d=this._h4;for(let t=0;t<80;t++)t<20?(i=r&a|~r&l,n=1518500249):t<40?(i=r^a^l,n=1859775393):t<60?(i=r&a|r&l|a&l,n=2400959708):(i=r^a^l,n=3395469782),o=lEe(s,5)+i+d+n+e.getUint32(4*t,!1)&4294967295,d=l,l=a,a=lEe(r,30),r=s,s=o;this._h0=this._h0+s&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+a&4294967295,this._h3=this._h3+l&4294967295,this._h4=this._h4+d&4294967295}}cEe._bigBlock32=new DataView(new ArrayBuffer(320));class uEe{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,n=e.length;i<n;i++)t[i]=e.charCodeAt(i);return t}}function gEe(e,t,i){return new _Ee(new uEe(e),new uEe(t)).ComputeDiff(i).changes}class pEe{static Assert(e,t){if(!e)throw new Error(t)}}class mEe{static Copy(e,t,i,n,o){for(let s=0;s<o;s++)i[n+s]=e[t+s]}static Copy2(e,t,i,n,o){for(let s=0;s<o;s++)i[n+s]=e[t+s]}}class fEe{constructor(){this.m_changes=[],this.m_originalStart=1073741824,this.m_modifiedStart=1073741824,this.m_originalCount=0,this.m_modifiedCount=0}MarkNextChange(){(this.m_originalCount>0||this.m_modifiedCount>0)&&this.m_changes.push(new oEe(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class _Ee{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[n,o,s]=_Ee._getElements(e),[r,a,l]=_Ee._getElements(t);this._hasStrings=s&&l,this._originalStringElements=n,this._originalElementsOrHash=o,this._modifiedStringElements=r,this._modifiedElementsOrHash=a,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&"string"==typeof e[0]}static _getElements(e){const t=e.getElements();if(_Ee._isStringArray(t)){const e=new Int32Array(t.length);for(let i=0,n=t.length;i<n;i++)e[i]=aEe(t[i],0);return[t,e,!0]}return t instanceof Int32Array?[[],t,!1]:[[],new Int32Array(t),!1]}ElementsAreEqual(e,t){return this._originalElementsOrHash[e]===this._modifiedElementsOrHash[t]&&(!this._hasStrings||this._originalStringElements[e]===this._modifiedStringElements[t])}ElementsAreStrictEqual(e,t){return!!this.ElementsAreEqual(e,t)&&_Ee._getStrictElement(this._originalSequence,e)===_Ee._getStrictElement(this._modifiedSequence,t)}static _getStrictElement(e,t){return"function"==typeof e.getStrictElement?e.getStrictElement(t):null}OriginalElementsAreEqual(e,t){return this._originalElementsOrHash[e]===this._originalElementsOrHash[t]&&(!this._hasStrings||this._originalStringElements[e]===this._originalStringElements[t])}ModifiedElementsAreEqual(e,t){return this._modifiedElementsOrHash[e]===this._modifiedElementsOrHash[t]&&(!this._hasStrings||this._modifiedStringElements[e]===this._modifiedStringElements[t])}ComputeDiff(e){return this._ComputeDiff(0,this._originalElementsOrHash.length-1,0,this._modifiedElementsOrHash.length-1,e)}_ComputeDiff(e,t,i,n,o){const s=[!1];let r=this.ComputeDiffRecursive(e,t,i,n,s);return o&&(r=this.PrettifyChanges(r)),{quitEarly:s[0],changes:r}}ComputeDiffRecursive(e,t,i,n,o){for(o[0]=!1;e<=t&&i<=n&&this.ElementsAreEqual(e,i);)e++,i++;for(;t>=e&&n>=i&&this.ElementsAreEqual(t,n);)t--,n--;if(e>t||i>n){let o;return i<=n?(pEe.Assert(e===t+1,"originalStart should only be one more than originalEnd"),o=[new oEe(e,0,i,n-i+1)]):e<=t?(pEe.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),o=[new oEe(e,t-e+1,i,0)]):(pEe.Assert(e===t+1,"originalStart should only be one more than originalEnd"),pEe.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),o=[]),o}const s=[0],r=[0],a=this.ComputeRecursionPoint(e,t,i,n,s,r,o),l=s[0],d=r[0];if(null!==a)return a;if(!o[0]){const s=this.ComputeDiffRecursive(e,l,i,d,o);let r=[];return r=o[0]?[new oEe(l+1,t-(l+1)+1,d+1,n-(d+1)+1)]:this.ComputeDiffRecursive(l+1,t,d+1,n,o),this.ConcatenateChanges(s,r)}return[new oEe(e,t-e+1,i,n-i+1)]}WALKTRACE(e,t,i,n,o,s,r,a,l,d,h,c,u,g,p,m,f,_){let v=null,b=null,w=new fEe,C=t,y=i,S=u[0]-m[0]-n,x=-1073741824,k=this.m_forwardHistory.length-1;do{const t=S+e;t===C||t<y&&l[t-1]<l[t+1]?(g=(h=l[t+1])-S-n,h<x&&w.MarkNextChange(),x=h,w.AddModifiedElement(h+1,g),S=t+1-e):(g=(h=l[t-1]+1)-S-n,h<x&&w.MarkNextChange(),x=h-1,w.AddOriginalElement(h,g+1),S=t-1-e),k>=0&&(e=(l=this.m_forwardHistory[k])[0],C=1,y=l.length-1)}while(--k>=-1);if(v=w.getReverseChanges(),_[0]){let e=u[0]+1,t=m[0]+1;if(null!==v&&v.length>0){const i=v[v.length-1];e=Math.max(e,i.getOriginalEnd()),t=Math.max(t,i.getModifiedEnd())}b=[new oEe(e,c-e+1,t,p-t+1)]}else{w=new fEe,C=s,y=r,S=u[0]-m[0]-a,x=1073741824,k=f?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const e=S+o;e===C||e<y&&d[e-1]>=d[e+1]?(g=(h=d[e+1]-1)-S-a,h>x&&w.MarkNextChange(),x=h+1,w.AddOriginalElement(h+1,g+1),S=e+1-o):(g=(h=d[e-1])-S-a,h>x&&w.MarkNextChange(),x=h,w.AddModifiedElement(h+1,g+1),S=e-1-o),k>=0&&(o=(d=this.m_reverseHistory[k])[0],C=1,y=d.length-1)}while(--k>=-1);b=w.getChanges()}return this.ConcatenateChanges(v,b)}ComputeRecursionPoint(e,t,i,n,o,s,r){let a=0,l=0,d=0,h=0,c=0,u=0;e--,i--,o[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(n-i),p=g+1,m=new Int32Array(p),f=new Int32Array(p),_=n-i,v=t-e,b=e-i,w=t-n,C=(v-_)%2==0;m[_]=e,f[v]=t,r[0]=!1;for(let y=1;y<=g/2+1;y++){let g=0,S=0;d=this.ClipDiagonalBound(_-y,y,_,p),h=this.ClipDiagonalBound(_+y,y,_,p);for(let e=d;e<=h;e+=2){a=e===d||e<h&&m[e-1]<m[e+1]?m[e+1]:m[e-1]+1,l=a-(e-_)-b;const i=a;for(;a<t&&l<n&&this.ElementsAreEqual(a+1,l+1);)a++,l++;if(m[e]=a,a+l>g+S&&(g=a,S=l),!C&&Math.abs(e-v)<=y-1&&a>=f[e])return o[0]=a,s[0]=l,i<=f[e]&&y<=1448?this.WALKTRACE(_,d,h,b,v,c,u,w,m,f,a,t,o,l,n,s,C,r):null}const x=(g-e+(S-i)-y)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(g,x))return r[0]=!0,o[0]=g,s[0]=S,x>0&&y<=1448?this.WALKTRACE(_,d,h,b,v,c,u,w,m,f,a,t,o,l,n,s,C,r):(e++,i++,[new oEe(e,t-e+1,i,n-i+1)]);c=this.ClipDiagonalBound(v-y,y,v,p),u=this.ClipDiagonalBound(v+y,y,v,p);for(let g=c;g<=u;g+=2){a=g===c||g<u&&f[g-1]>=f[g+1]?f[g+1]-1:f[g-1],l=a-(g-v)-w;const p=a;for(;a>e&&l>i&&this.ElementsAreEqual(a,l);)a--,l--;if(f[g]=a,C&&Math.abs(g-_)<=y&&a<=m[g])return o[0]=a,s[0]=l,p>=m[g]&&y<=1448?this.WALKTRACE(_,d,h,b,v,c,u,w,m,f,a,t,o,l,n,s,C,r):null}if(y<=1447){let e=new Int32Array(h-d+2);e[0]=_-d+1,mEe.Copy2(m,d,e,1,h-d+1),this.m_forwardHistory.push(e),e=new Int32Array(u-c+2),e[0]=v-c+1,mEe.Copy2(f,c,e,1,u-c+1),this.m_reverseHistory.push(e)}}return this.WALKTRACE(_,d,h,b,v,c,u,w,m,f,a,t,o,l,n,s,C,r)}PrettifyChanges(e){for(let t=0;t<e.length;t++){const i=e[t],n=t<e.length-1?e[t+1].originalStart:this._originalElementsOrHash.length,o=t<e.length-1?e[t+1].modifiedStart:this._modifiedElementsOrHash.length,s=i.originalLength>0,r=i.modifiedLength>0;for(;i.originalStart+i.originalLength<n&&i.modifiedStart+i.modifiedLength<o&&(!s||this.OriginalElementsAreEqual(i.originalStart,i.originalStart+i.originalLength))&&(!r||this.ModifiedElementsAreEqual(i.modifiedStart,i.modifiedStart+i.modifiedLength));){const e=this.ElementsAreStrictEqual(i.originalStart,i.modifiedStart);if(this.ElementsAreStrictEqual(i.originalStart+i.originalLength,i.modifiedStart+i.modifiedLength)&&!e)break;i.originalStart++,i.modifiedStart++}const a=[null];t<e.length-1&&this.ChangesOverlap(e[t],e[t+1],a)&&(e[t]=a[0],e.splice(t+1,1),t--)}for(let t=e.length-1;t>=0;t--){const i=e[t];let n=0,o=0;if(t>0){const i=e[t-1];n=i.originalStart+i.originalLength,o=i.modifiedStart+i.modifiedLength}const s=i.originalLength>0,r=i.modifiedLength>0;let a=0,l=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let e=1;;e++){const t=i.originalStart-e,d=i.modifiedStart-e;if(t<n||d<o)break;if(s&&!this.OriginalElementsAreEqual(t,t+i.originalLength))break;if(r&&!this.ModifiedElementsAreEqual(d,d+i.modifiedLength))break;const h=(t===n&&d===o?5:0)+this._boundaryScore(t,i.originalLength,d,i.modifiedLength);h>l&&(l=h,a=e)}i.originalStart-=a,i.modifiedStart-=a;const d=[null];t>0&&this.ChangesOverlap(e[t-1],e[t],d)&&(e[t-1]=d[0],e.splice(t,1),t++)}if(this._hasStrings)for(let t=1,i=e.length;t<i;t++){const i=e[t-1],n=e[t],o=n.originalStart-i.originalStart-i.originalLength,s=i.originalStart,r=n.originalStart+n.originalLength,a=r-s,l=i.modifiedStart,d=n.modifiedStart+n.modifiedLength,h=d-l;if(o<5&&a<20&&h<20){const e=this._findBetterContiguousSequence(s,a,l,h,o);if(e){const[t,s]=e;t===i.originalStart+i.originalLength&&s===i.modifiedStart+i.modifiedLength||(i.originalLength=t-i.originalStart,i.modifiedLength=s-i.modifiedStart,n.originalStart=t+o,n.modifiedStart=s+o,n.originalLength=r-n.originalStart,n.modifiedLength=d-n.modifiedStart)}}}return e}_findBetterContiguousSequence(e,t,i,n,o){if(t<o||n<o)return null;const s=e+t-o+1,r=i+n-o+1;let a=0,l=0,d=0;for(let t=e;t<s;t++)for(let e=i;e<r;e++){const i=this._contiguousSequenceScore(t,e,o);i>0&&i>a&&(a=i,l=t,d=e)}return a>0?[l,d]:null}_contiguousSequenceScore(e,t,i){let n=0;for(let o=0;o<i;o++){if(!this.ElementsAreEqual(e+o,t+o))return 0;n+=this._originalStringElements[e+o].length}return n}_OriginalIsBoundary(e){return e<=0||e>=this._originalElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,n){return(this._OriginalRegionIsBoundary(e,t)?1:0)+(this._ModifiedRegionIsBoundary(i,n)?1:0)}ConcatenateChanges(e,t){const i=[];if(0===e.length||0===t.length)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const n=new Array(e.length+t.length-1);return mEe.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],mEe.Copy(t,1,n,e.length,t.length-1),n}{const i=new Array(e.length+t.length);return mEe.Copy(e,0,i,0,e.length),mEe.Copy(t,0,i,e.length,t.length),i}}ChangesOverlap(e,t,i){if(pEe.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),pEe.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const n=e.originalStart;let o=e.originalLength;const s=e.modifiedStart;let r=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(r=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new oEe(n,o,s,r),!0}return i[0]=null,!1}ClipDiagonalBound(e,t,i,n){if(e>=0&&e<n)return e;const o=t%2==0;return e<0?o===(i%2==0)?0:1:o===((n-i-1)%2==0)?n-1:n-2}}function vEe(e){return e<0?0:e>255?255:0|e}function bEe(e){return e<0?0:e>4294967295?4294967295:0|e}class wEe{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=bEe(e);const i=this.values,n=this.prefixSum,o=t.length;return 0!==o&&(this.values=new Uint32Array(i.length+o),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+o),this.values.set(t,e),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSum=new Uint32Array(this.values.length),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=bEe(e),t=bEe(t),this.values[e]!==t&&(this.values[e]=t,e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),!0)}removeValues(e,t){e=bEe(e),t=bEe(t);const i=this.values,n=this.prefixSum;if(e>=i.length)return!1;const o=i.length-e;return t>=o&&(t=o),0!==t&&(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return 0===this.values.length?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=bEe(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;0===t&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,n=0,o=0,s=0;for(;t<=i;)if(n=t+(i-t)/2|0,o=this.prefixSum[n],s=o-this.values[n],e<s)i=n-1;else{if(!(e>=o))break;t=n+1}return new yEe(n,e-s)}}class CEe{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),0===e?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new yEe(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=rbe(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e<t;e++){const t=this._values[e],i=e>0?this._prefixSum[e-1]:0;this._prefixSum[e]=i+t;for(let n=0;n<t;n++)this._indexBySum[i+n]=e}this._prefixSum.length=this._values.length,this._indexBySum.length=this._prefixSum[this._prefixSum.length-1],this._isValid=!0,this._validEndIndex=this._values.length-1}}setValue(e,t){this._values[e]!==t&&(this._values[e]=t,this._invalidate(e))}}class yEe{constructor(e,t){this.index=e,this.remainder=t,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=t}}class SEe{constructor(e,t,i,n){this._uri=e,this._lines=t,this._eol=i,this._versionId=n,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}get version(){return this._versionId}getText(){return null===this._cachedTextValue&&(this._cachedTextValue=this._lines.join(this._eol)),this._cachedTextValue}onEvents(e){e.eol&&e.eol!==this._eol&&(this._eol=e.eol,this._lineStarts=null);const t=e.changes;for(const e of t)this._acceptDeleteRange(e.range),this._acceptInsertText(new lye(e.range.startLineNumber,e.range.startColumn),e.text);this._versionId=e.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){const e=this._eol.length,t=this._lines.length,i=new Uint32Array(t);for(let n=0;n<t;n++)i[n]=this._lines[n].length+e;this._lineStarts=new wEe(i)}}_setLineText(e,t){this._lines[e]=t,this._lineStarts&&this._lineStarts.setValue(e,this._lines[e].length+this._eol.length)}_acceptDeleteRange(e){if(e.startLineNumber!==e.endLineNumber)this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.endLineNumber-1].substring(e.endColumn-1)),this._lines.splice(e.startLineNumber,e.endLineNumber-e.startLineNumber),this._lineStarts&&this._lineStarts.removeValues(e.startLineNumber,e.endLineNumber-e.startLineNumber);else{if(e.startColumn===e.endColumn)return;this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.startLineNumber-1].substring(e.endColumn-1))}}_acceptInsertText(e,t){if(0===t.length)return;const i=DSe(t);if(1===i.length)return void this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+i[0]+this._lines[e.lineNumber-1].substring(e.column-1));i[i.length-1]+=this._lines[e.lineNumber-1].substring(e.column-1),this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+i[0]);const n=new Uint32Array(i.length-1);for(let t=1;t<i.length;t++)this._lines.splice(e.lineNumber+t-1,0,i[t]),n[t-1]=i[t].length+this._eol.length;this._lineStarts&&this._lineStarts.insertValues(e.lineNumber,n)}}class xEe{constructor(e){const t=vEe(e);this._defaultValue=t,this._asciiMap=xEe._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){const t=new Uint8Array(256);return t.fill(e),t}set(e,t){const i=vEe(t);e>=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}class kEe{constructor(e,t,i){const n=new Uint8Array(e*t);for(let o=0,s=e*t;o<s;o++)n[o]=i;this._data=n,this.rows=e,this.cols=t}get(e,t){return this._data[e*this.cols+t]}set(e,t,i){this._data[e*this.cols+t]=i}}class LEe{constructor(e){let t=0,i=0;for(let n=0,o=e.length;n<o;n++){const[o,s,r]=e[n];s>t&&(t=s),o>i&&(i=o),r>i&&(i=r)}t++,i++;const n=new kEe(i,t,0);for(let t=0,i=e.length;t<i;t++){const[i,o,s]=e[t];n.set(i,o,s)}this._states=n,this._maxCharCode=t}nextState(e,t){return t<0||t>=this._maxCharCode?0:this._states.get(e,t)}}let DEe=null,EEe=null;class NEe{static _createLink(e,t,i,n,o){let s=o-1;do{const i=t.charCodeAt(s);if(2!==e.get(i))break;s--}while(s>n);if(n>0){const e=t.charCodeAt(n-1),i=t.charCodeAt(s);(40===e&&41===i||91===e&&93===i||123===e&&125===i)&&s--}return{range:{startLineNumber:i,startColumn:n+1,endLineNumber:i,endColumn:s+2},url:t.substring(n,s+1)}}static computeLinks(e,t=function(){return null===DEe&&(DEe=new LEe([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),DEe}()){const i=function(){if(null===EEe){EEe=new xEe(0);const e=", \t<>'\"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…";for(let t=0;t<e.length;t++)EEe.set(e.charCodeAt(t),1);const t=".;:";for(let e=0;e<t.length;e++)EEe.set(t.charCodeAt(e),2)}return EEe}(),n=[];for(let o=1,s=e.getLineCount();o<=s;o++){const s=e.getLineContent(o),r=s.length;let a=0,l=0,d=0,h=1,c=!1,u=!1,g=!1,p=!1;for(;a<r;){let e=!1;const r=s.charCodeAt(a);if(13===h){let t;switch(r){case 40:c=!0,t=0;break;case 41:t=c?0:1;break;case 91:g=!0,u=!0,t=0;break;case 93:g=!1,t=u?0:1;break;case 123:p=!0,t=0;break;case 125:t=p?0:1;break;case 39:case 34:case 96:t=d===r?1:39===d||34===d||96===d?0:1;break;case 42:t=42===d?1:0;break;case 124:t=124===d?1:0;break;case 32:t=g?0:1;break;default:t=i.get(r)}1===t&&(n.push(NEe._createLink(i,s,o,l,a)),e=!0)}else if(12===h){let t;91===r?(u=!0,t=0):t=i.get(r),1===t?e=!0:h=13}else h=t.nextState(h,r),0===h&&(e=!0);e&&(h=1,c=!1,u=!1,p=!1,l=a+1,d=r),a++}13===h&&n.push(NEe._createLink(i,s,o,l,r))}return n}}class IEe{constructor(){this._defaultValueSet=[["true","false"],["True","False"],["Private","Public","Friend","ReadOnly","Partial","Protected","WriteOnly"],["public","protected","private"]]}navigateValueSet(e,t,i,n,o){if(e&&t){const i=this.doNavigateValueSet(t,o);if(i)return{range:e,value:i}}if(i&&n){const e=this.doNavigateValueSet(n,o);if(e)return{range:i,value:e}}return null}doNavigateValueSet(e,t){const i=this.numberReplace(e,t);return null!==i?i:this.textReplace(e,t)}numberReplace(e,t){const i=Math.pow(10,e.length-(e.lastIndexOf(".")+1));let n=Number(e);const o=parseFloat(e);return isNaN(n)||isNaN(o)||n!==o?null:0!==n||t?(n=Math.floor(n*i),n+=t?i:-i,String(n/i)):null}textReplace(e,t){return this.valueSetsReplace(this._defaultValueSet,e,t)}valueSetsReplace(e,t,i){let n=null;for(let o=0,s=e.length;null===n&&o<s;o++)n=this.valueSetReplace(e[o],t,i);return n}valueSetReplace(e,t,i){let n=e.indexOf(t);return n>=0?(n+=i?1:-1,n<0?n=e.length-1:n%=e.length,e[n]):null}}IEe.INSTANCE=new IEe;class TEe extends xEe{constructor(e){super(0);for(let t=0,i=e.length;t<i;t++)this.set(e.charCodeAt(t),2);this.set(32,1),this.set(9,1)}}const MEe=function(){const e={};return t=>(e.hasOwnProperty(t)||(e[t]=(e=>new TEe(e))(t)),e[t])}();class AEe{constructor(e,t,i,n){this.searchString=e,this.isRegex=t,this.matchCase=i,this.wordSeparators=n}parseSearchRequest(){if(""===this.searchString)return null;let e;e=this.isRegex?function(e){if(!e||0===e.length)return!1;for(let t=0,i=e.length;t<i;t++){const n=e.charCodeAt(t);if(10===n)return!0;if(92===n){if(t++,t>=i)break;const n=e.charCodeAt(t);if(110===n||114===n||87===n)return!0}}return!1}(this.searchString):this.searchString.indexOf("\n")>=0;let t=null;try{t=kSe(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch(e){return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new Wke(t,this.wordSeparators?MEe(this.wordSeparators):null,i?this.searchString:null)}}function REe(e,t,i){if(!i)return new Fke(e,null);const n=[];for(let e=0,i=t.length;e<i;e++)n[e]=t[e];return new Fke(e,n)}class OEe{constructor(e){const t=[];let i=0;for(let n=0,o=e.length;n<o;n++)10===e.charCodeAt(n)&&(t[i++]=n);this._lineFeedsOffsets=t}findLineFeedCountBeforeOffset(e){const t=this._lineFeedsOffsets;let i=0,n=t.length-1;if(-1===n)return 0;if(e<=t[0])return 0;for(;i<n;){const o=i+((n-i)/2|0);t[o]>=e?n=o-1:t[o+1]>=e?(i=o,n=o):i=o+1}return i+1}}class PEe{static findMatches(e,t,i,n,o){const s=t.parseSearchRequest();return s?s.regex.multiline?this._doFindMatchesMultiline(e,i,new BEe(s.wordSeparators,s.regex),n,o):this._doFindMatchesLineByLine(e,i,s,n,o):[]}static _getMultilineMatchRange(e,t,i,n,o,s){let r,a,l=0;if(n?(l=n.findLineFeedCountBeforeOffset(o),r=t+o+l):r=t+o,n){const e=n.findLineFeedCountBeforeOffset(o+s.length)-l;a=r+s.length+e}else a=r+s.length;const d=e.getPositionAt(r),h=e.getPositionAt(a);return new dye(d.lineNumber,d.column,h.lineNumber,h.column)}static _doFindMatchesMultiline(e,t,i,n,o){const s=e.getOffsetAt(t.getStartPosition()),r=e.getValueInRange(t,1),a="\r\n"===e.getEOL()?new OEe(r):null,l=[];let d,h=0;for(i.reset(0);d=i.next(r);)if(l[h++]=REe(this._getMultilineMatchRange(e,s,r,a,d.index,d[0]),d,n),h>=o)return l;return l}static _doFindMatchesLineByLine(e,t,i,n,o){const s=[];let r=0;if(t.startLineNumber===t.endLineNumber){const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return r=this._findMatchesInLine(i,a,t.startLineNumber,t.startColumn-1,r,s,n,o),s}const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);r=this._findMatchesInLine(i,a,t.startLineNumber,t.startColumn-1,r,s,n,o);for(let a=t.startLineNumber+1;a<t.endLineNumber&&r<o;a++)r=this._findMatchesInLine(i,e.getLineContent(a),a,0,r,s,n,o);if(r<o){const a=e.getLineContent(t.endLineNumber).substring(0,t.endColumn-1);r=this._findMatchesInLine(i,a,t.endLineNumber,0,r,s,n,o)}return s}static _findMatchesInLine(e,t,i,n,o,s,r,a){const l=e.wordSeparators;if(!r&&e.simpleSearch){const r=e.simpleSearch,d=r.length,h=t.length;let c=-d;for(;-1!==(c=t.indexOf(r,c+d));)if((!l||FEe(l,t,h,c,d))&&(s[o++]=new Fke(new dye(i,c+1+n,i,c+1+d+n),null),o>=a))return o;return o}const d=new BEe(e.wordSeparators,e.regex);let h;d.reset(0);do{if(h=d.next(t),h&&(s[o++]=REe(new dye(i,h.index+1+n,i,h.index+1+h[0].length+n),h,r),o>=a))return o}while(h);return o}static findNextMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const s=new BEe(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,s,n):this._doFindNextMatchLineByLine(e,i,s,n)}static _doFindNextMatchMultiline(e,t,i,n){const o=new lye(t.lineNumber,1),s=e.getOffsetAt(o),r=e.getLineCount(),a=e.getValueInRange(new dye(o.lineNumber,o.column,r,e.getLineMaxColumn(r)),1),l="\r\n"===e.getEOL()?new OEe(a):null;i.reset(t.column-1);const d=i.next(a);return d?REe(this._getMultilineMatchRange(e,s,a,l,d.index,d[0]),d,n):1!==t.lineNumber||1!==t.column?this._doFindNextMatchMultiline(e,new lye(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const o=e.getLineCount(),s=t.lineNumber,r=e.getLineContent(s),a=this._findFirstMatchInLine(i,r,s,t.column,n);if(a)return a;for(let t=1;t<=o;t++){const r=(s+t-1)%o,a=e.getLineContent(r+1),l=this._findFirstMatchInLine(i,a,r+1,1,n);if(l)return l}return null}static _findFirstMatchInLine(e,t,i,n,o){e.reset(n-1);const s=e.next(t);return s?REe(new dye(i,s.index+1,i,s.index+1+s[0].length),s,o):null}static findPreviousMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const s=new BEe(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,s,n):this._doFindPreviousMatchLineByLine(e,i,s,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const o=this._doFindMatchesMultiline(e,new dye(1,1,t.lineNumber,t.column),i,n,9990);if(o.length>0)return o[o.length-1];const s=e.getLineCount();return t.lineNumber!==s||t.column!==e.getLineMaxColumn(s)?this._doFindPreviousMatchMultiline(e,new lye(s,e.getLineMaxColumn(s)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const o=e.getLineCount(),s=t.lineNumber,r=e.getLineContent(s).substring(0,t.column-1),a=this._findLastMatchInLine(i,r,s,n);if(a)return a;for(let t=1;t<=o;t++){const r=(o+s-t-1)%o,a=e.getLineContent(r+1),l=this._findLastMatchInLine(i,a,r+1,n);if(l)return l}return null}static _findLastMatchInLine(e,t,i,n){let o,s=null;for(e.reset(0);o=e.next(t);)s=REe(new dye(i,o.index+1,i,o.index+1+o[0].length),o,n);return s}}function FEe(e,t,i,n,o){return function(e,t,i,n,o){if(0===n)return!0;const s=t.charCodeAt(n-1);if(0!==e.get(s))return!0;if(13===s||10===s)return!0;if(o>0){const i=t.charCodeAt(n);if(0!==e.get(i))return!0}return!1}(e,t,0,n,o)&&function(e,t,i,n,o){if(n+o===i)return!0;const s=t.charCodeAt(n+o);if(0!==e.get(s))return!0;if(13===s||10===s)return!0;if(o>0){const i=t.charCodeAt(n+o-1);if(0!==e.get(i))return!0}return!1}(e,t,i,n,o)}class BEe{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t)return null;if(i=this._searchRegex.exec(e),!i)return null;const n=i.index,o=i[0].length;if(n===this._prevMatchStartIndex&&o===this._prevMatchLength){if(0===o){jSe(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=o,!this._wordSeparators||FEe(this._wordSeparators,e,t,n,o))return i}while(i);return null}}class WEe{static computeUnicodeHighlights(e,t,i){const n=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),s=new VEe(t),r=s.getCandidateCodePoints();let a;a="allNonBasicAscii"===r?new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):new RegExp(`${function(e){const t=`[${SSe(e.map((e=>String.fromCodePoint(e))).join(""))}]`;return t}(Array.from(r))}`,"g");const l=new BEe(null,a),d=[];let h,c=!1,u=0,g=0,p=0;e:for(let t=n,i=o;t<=i;t++){const i=e.getLineContent(t),n=i.length;l.reset(0);do{if(h=l.next(i),h){let e=h.index,o=h.index+h[0].length;e>0&&zSe(i.charCodeAt(e-1))&&e--,o+1<n&&zSe(i.charCodeAt(o-1))&&o++;const r=i.substring(e,o);let a=Xve(e+1,Zve,i,0);a&&a.endColumn<=e+1&&(a=null);const l=s.shouldHighlightNonBasicASCII(r,a?a.word:null);if(0!==l){3===l?u++:2===l?g++:1===l?p++:jxe();const i=1e3;if(d.length>=i){c=!0;break e}d.push(new dye(t,e+1,t,o+1))}}}while(h)}return{ranges:d,hasMore:c,ambiguousCharacterCount:u,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const i=new VEe(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const n=e.codePointAt(0),o=i.ambiguousCharacters.getPrimaryConfusable(n),s=hxe.getLocales().filter((e=>!hxe.getInstance(new Set([...t.allowedLocales,e])).isAmbiguous(n)));return{kind:0,confusableWith:String.fromCodePoint(o),notAmbiguousInLocales:s}}case 1:return{kind:2}}}}class VEe{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=hxe.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of cxe.codePoints)HEe(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const i=e.codePointAt(0);if(this.allowedCodePoints.has(i))return 0;if(this.options.nonBasicASCII)return 1;let n=!1,o=!1;if(t)for(const e of t){const t=e.codePointAt(0),i=JSe(e);n=n||i,i||this.ambiguousCharacters.isAmbiguous(t)||cxe.isInvisibleCharacter(t)||(o=!0)}return!n&&o?0:this.options.invisibleCharacters&&!HEe(e)&&cxe.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function HEe(e){return" "===e||"\n"===e||"\t"===e}class zEe{constructor(e,t,i){this.originalRange=e,this.modifiedRange=t,this.innerChanges=i}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}}class UEe{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}}class KEe{constructor(e,t){this.startLineNumber=e,this.endLineNumberExclusive=t}get isEmpty(){return this.startLineNumber===this.endLineNumberExclusive}delta(e){return new KEe(this.startLineNumber+e,this.endLineNumberExclusive+e)}get length(){return this.endLineNumberExclusive-this.startLineNumber}join(e){return new KEe(Math.min(this.startLineNumber,e.startLineNumber),Math.max(this.endLineNumberExclusive,e.endLineNumberExclusive))}toString(){return`[${this.startLineNumber},${this.endLineNumberExclusive})`}}function jEe(e,t,i,n){return new _Ee(e,t,i).ComputeDiff(n)}class qEe{constructor(e){const t=[],i=[];for(let n=0,o=e.length;n<o;n++)t[n]=QEe(e[n],1),i[n]=XEe(e[n],1);this.lines=e,this._startColumns=t,this._endColumns=i}getElements(){const e=[];for(let t=0,i=this.lines.length;t<i;t++)e[t]=this.lines[t].substring(this._startColumns[t]-1,this._endColumns[t]-1);return e}getStrictElement(e){return this.lines[e]}getStartLineNumber(e){return e+1}getEndLineNumber(e){return e+1}createCharSequence(e,t,i){const n=[],o=[],s=[];let r=0;for(let a=t;a<=i;a++){const t=this.lines[a],l=e?this._startColumns[a]:1,d=e?this._endColumns[a]:t.length+1;for(let e=l;e<d;e++)n[r]=t.charCodeAt(e-1),o[r]=a+1,s[r]=e,r++;!e&&a<i&&(n[r]=10,o[r]=a+1,s[r]=t.length+1,r++)}return new $Ee(n,o,s)}}class $Ee{constructor(e,t,i){this._charCodes=e,this._lineNumbers=t,this._columns=i}toString(){return"["+this._charCodes.map(((e,t)=>(10===e?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`)).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return-1===e?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),10===this._charCodes[e]?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return-1===e?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),10===this._charCodes[e]?1:this._columns[e]+1)}}class GEe{constructor(e,t,i,n,o,s,r,a){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=n,this.modifiedStartLineNumber=o,this.modifiedStartColumn=s,this.modifiedEndLineNumber=r,this.modifiedEndColumn=a}static createFromDiffChange(e,t,i){const n=t.getStartLineNumber(e.originalStart),o=t.getStartColumn(e.originalStart),s=t.getEndLineNumber(e.originalStart+e.originalLength-1),r=t.getEndColumn(e.originalStart+e.originalLength-1),a=i.getStartLineNumber(e.modifiedStart),l=i.getStartColumn(e.modifiedStart),d=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),h=i.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new GEe(n,o,s,r,a,l,d,h)}}class ZEe{constructor(e,t,i,n,o){this.originalStartLineNumber=e,this.originalEndLineNumber=t,this.modifiedStartLineNumber=i,this.modifiedEndLineNumber=n,this.charChanges=o}static createFromDiffResult(e,t,i,n,o,s,r){let a,l,d,h,c;if(0===t.originalLength?(a=i.getStartLineNumber(t.originalStart)-1,l=0):(a=i.getStartLineNumber(t.originalStart),l=i.getEndLineNumber(t.originalStart+t.originalLength-1)),0===t.modifiedLength?(d=n.getStartLineNumber(t.modifiedStart)-1,h=0):(d=n.getStartLineNumber(t.modifiedStart),h=n.getEndLineNumber(t.modifiedStart+t.modifiedLength-1)),s&&t.originalLength>0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const s=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),a=n.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(s.getElements().length>0&&a.getElements().length>0){let e=jEe(s,a,o,!0).changes;r&&(e=function(e){if(e.length<=1)return e;const t=[e[0]];let i=t[0];for(let n=1,o=e.length;n<o;n++){const o=e[n],s=o.originalStart-(i.originalStart+i.originalLength),r=o.modifiedStart-(i.modifiedStart+i.modifiedLength);Math.min(s,r)<3?(i.originalLength=o.originalStart+o.originalLength-i.originalStart,i.modifiedLength=o.modifiedStart+o.modifiedLength-i.modifiedStart):(t.push(o),i=o)}return t}(e)),c=[];for(let t=0,i=e.length;t<i;t++)c.push(GEe.createFromDiffChange(e[t],s,a))}}return new ZEe(a,l,d,h,c)}}class YEe{constructor(e,t,i){this.shouldComputeCharChanges=i.shouldComputeCharChanges,this.shouldPostProcessCharChanges=i.shouldPostProcessCharChanges,this.shouldIgnoreTrimWhitespace=i.shouldIgnoreTrimWhitespace,this.shouldMakePrettyDiff=i.shouldMakePrettyDiff,this.originalLines=e,this.modifiedLines=t,this.original=new qEe(e),this.modified=new qEe(t),this.continueLineDiff=JEe(i.maxComputationTime),this.continueCharDiff=JEe(0===i.maxComputationTime?0:Math.min(i.maxComputationTime,5e3))}computeDiff(){if(1===this.original.lines.length&&0===this.original.lines[0].length)return 1===this.modified.lines.length&&0===this.modified.lines[0].length?{quitEarly:!1,changes:[]}:{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:1,modifiedStartLineNumber:1,modifiedEndLineNumber:this.modified.lines.length,charChanges:void 0}]};if(1===this.modified.lines.length&&0===this.modified.lines[0].length)return{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:this.original.lines.length,modifiedStartLineNumber:1,modifiedEndLineNumber:1,charChanges:void 0}]};const e=jEe(this.original,this.modified,this.continueLineDiff,this.shouldMakePrettyDiff),t=e.changes,i=e.quitEarly;if(this.shouldIgnoreTrimWhitespace){const e=[];for(let i=0,n=t.length;i<n;i++)e.push(ZEe.createFromDiffResult(this.shouldIgnoreTrimWhitespace,t[i],this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges));return{quitEarly:i,changes:e}}const n=[];let o=0,s=0;for(let e=-1,i=t.length;e<i;e++){const r=e+1<i?t[e+1]:null,a=r?r.originalStart:this.originalLines.length,l=r?r.modifiedStart:this.modifiedLines.length;for(;o<a&&s<l;){const e=this.originalLines[o],t=this.modifiedLines[s];if(e!==t){{let i=QEe(e,1),r=QEe(t,1);for(;i>1&&r>1&&e.charCodeAt(i-2)===t.charCodeAt(r-2);)i--,r--;(i>1||r>1)&&this._pushTrimWhitespaceCharChange(n,o+1,1,i,s+1,1,r)}{let i=XEe(e,1),r=XEe(t,1);const a=e.length+1,l=t.length+1;for(;i<a&&r<l&&e.charCodeAt(i-1)===e.charCodeAt(r-1);)i++,r++;(i<a||r<l)&&this._pushTrimWhitespaceCharChange(n,o+1,i,a,s+1,r,l)}}o++,s++}r&&(n.push(ZEe.createFromDiffResult(this.shouldIgnoreTrimWhitespace,r,this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges)),o+=r.originalLength,s+=r.modifiedLength)}return{quitEarly:i,changes:n}}_pushTrimWhitespaceCharChange(e,t,i,n,o,s,r){if(this._mergeTrimWhitespaceCharChange(e,t,i,n,o,s,r))return;let a;this.shouldComputeCharChanges&&(a=[new GEe(t,i,t,n,o,s,o,r)]),e.push(new ZEe(t,t,o,o,a))}_mergeTrimWhitespaceCharChange(e,t,i,n,o,s,r){const a=e.length;if(0===a)return!1;const l=e[a-1];return 0!==l.originalEndLineNumber&&0!==l.modifiedEndLineNumber&&(l.originalEndLineNumber===t&&l.modifiedEndLineNumber===o?(this.shouldComputeCharChanges&&l.charChanges&&l.charChanges.push(new GEe(t,i,t,n,o,s,o,r)),!0):l.originalEndLineNumber+1===t&&l.modifiedEndLineNumber+1===o&&(l.originalEndLineNumber=t,l.modifiedEndLineNumber=o,this.shouldComputeCharChanges&&l.charChanges&&l.charChanges.push(new GEe(t,i,t,n,o,s,o,r)),!0))}}function QEe(e,t){const i=ESe(e);return-1===i?t:i+1}function XEe(e,t){const i=ISe(e);return-1===i?t:i+2}function JEe(e){if(0===e)return()=>!0;const t=Date.now();return()=>Date.now()-t<e}class eNe{constructor(e,t){this.seq1Range=e,this.seq2Range=t}reverse(){return new eNe(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}}class tNe{constructor(e,t){this.start=e,this.endExclusive=t}get isEmpty(){return this.start===this.endExclusive}delta(e){return new tNe(this.start+e,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}join(e){return new tNe(Math.min(this.start,e.start),Math.max(this.endExclusive,e.endExclusive))}}class iNe{constructor(e,t){this.width=e,this.height=t,this.array=[],this.array=new Array(e*t)}get(e,t){return this.array[e+t*this.width]}set(e,t,i){this.array[e+t*this.width]=i}}class nNe{compute(e,t,i){const n=new iNe(e.length,t.length),o=new iNe(e.length,t.length),s=new iNe(e.length,t.length);for(let r=0;r<e.length;r++)for(let a=0;a<t.length;a++){const l=0===r?0:n.get(r-1,a),d=0===a?0:n.get(r,a-1);let h;e.getElement(r)===t.getElement(a)?(h=0===r||0===a?0:n.get(r-1,a-1),r>0&&a>0&&3===o.get(r-1,a-1)&&(h+=s.get(r-1,a-1)),h+=i?i(r,a):1):h=-1;const c=Math.max(l,d,h);if(c===h){const e=r>0&&a>0?s.get(r-1,a-1):0;s.set(r,a,e+1),o.set(r,a,3)}else c===l?(s.set(r,a,0),o.set(r,a,1)):c===d&&(s.set(r,a,0),o.set(r,a,2));n.set(r,a,c)}const r=[];let a=e.length,l=t.length;function d(e,t){e+1===a&&t+1===l||r.push(new eNe(new tNe(e+1,a),new tNe(t+1,l))),a=e,l=t}let h=e.length-1,c=t.length-1;for(;h>=0&&c>=0;)3===o.get(h,c)?(d(h,c),h--,c--):1===o.get(h,c)?h--:c--;return d(-1,-1),r.reverse(),r}}function oNe(e,t,i){let n=i;return n=function(e,t,i){const n=[];i.length>0&&n.push(i[0]);for(let e=1;e<i.length;e++){const o=n[n.length-1],s=i[e];if(s.seq1Range.isEmpty){let e=!0;const i=s.seq1Range.start-o.seq1Range.endExclusive;for(let n=1;n<=i;n++)if(t.getElement(s.seq2Range.start-n)!==t.getElement(s.seq2Range.endExclusive-n)){e=!1;break}if(e){n[n.length-1]=new eNe(o.seq1Range,new tNe(o.seq2Range.start,s.seq2Range.endExclusive-i));continue}}n.push(s)}return n}(0,t,n),n=function(e,t,i){if(!e.getBoundaryScore||!t.getBoundaryScore)return i;for(let n=0;n<i.length;n++){const o=i[n];if(o.seq1Range.isEmpty){const s=n>0?i[n-1].seq2Range.endExclusive:-1,r=n+1<i.length?i[n+1].seq2Range.start:t.length;i[n]=sNe(o,e,t,r,s)}else if(o.seq2Range.isEmpty){const s=n>0?i[n-1].seq1Range.endExclusive:-1,r=n+1<i.length?i[n+1].seq1Range.start:e.length;i[n]=sNe(o.reverse(),t,e,r,s).reverse()}}return i}(e,t,n),n}function sNe(e,t,i,n,o){let s=1;for(;e.seq2Range.start-s>o&&i.getElement(e.seq2Range.start-s)===i.getElement(e.seq2Range.endExclusive-s)&&s<20;)s++;s--;let r=0;for(;e.seq2Range.start+r<n&&i.getElement(e.seq2Range.start+r)===i.getElement(e.seq2Range.endExclusive+r)&&r<20;)r++;if(0===s&&0===r)return e;let a=0,l=-1;for(let n=-s;n<=r;n++){const o=e.seq2Range.start+n,s=e.seq2Range.endExclusive+n,r=e.seq1Range.start+n,d=t.getBoundaryScore(r)+i.getBoundaryScore(o)+i.getBoundaryScore(s);d>l&&(l=d,a=n)}return 0!==a?new eNe(e.seq1Range.delta(a),e.seq2Range.delta(a)):e}class rNe{compute(e,t){if(0===e.length)return[new eNe(new tNe(0,0),new tNe(0,t.length))];if(0===t.length)return[new eNe(new tNe(0,e.length),new tNe(0,0))];function i(i,n){for(;i<e.length&&n<t.length&&e.getElement(i)===t.getElement(n);)i++,n++;return i}let n=0;const o=new lNe;o.set(0,i(0,0));const s=new dNe;s.set(0,0===o.get(0)?null:new aNe(null,0,0,o.get(0)));let r=0;e:for(;;)for(n++,r=-n;r<=n;r+=2){const a=r===n?-1:o.get(r+1),l=r===-n?-1:o.get(r-1)+1,d=Math.min(Math.max(a,l),e.length),h=d-r,c=i(d,h);o.set(r,c);const u=d===a?s.get(r+1):s.get(r-1);if(s.set(r,c!==d?new aNe(u,d,h,c-d):u),o.get(r)===e.length&&o.get(r)-r===t.length)break e}let a=s.get(r);const l=[];let d=e.length,h=t.length;for(;;){const e=a?a.x+a.length:0,t=a?a.y+a.length:0;if(e===d&&t===h||l.push(new eNe(new tNe(e,d),new tNe(t,h))),!a)break;d=a.x,h=a.y,a=a.prev}return l.reverse(),l}}class aNe{constructor(e,t,i,n){this.prev=e,this.x=t,this.y=i,this.length=n}}class lNe{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if((e=-e-1)>=this.negativeArr.length){const e=this.negativeArr;this.negativeArr=new Int32Array(2*e.length),this.negativeArr.set(e)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const e=this.positiveArr;this.positiveArr=new Int32Array(2*e.length),this.positiveArr.set(e)}this.positiveArr[e]=t}}}class dNe{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}class hNe{constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){return 1e3-((0===e?0:cNe(this.lines[e-1]))+(e===this.lines.length?0:cNe(this.lines[e])))}}function cNe(e){let t=0;for(;t<e.length&&(32===e.charCodeAt(t)||9===e.charCodeAt(t));)t++;return t}class uNe{constructor(e,t){this.lines=e,this.lineRange=t;let i=0;this.firstCharOnLineOffsets=new Int32Array(t.length);for(let n=t.start;n<t.endExclusive;n++)i+=e[n].length,this.firstCharOnLineOffsets[n-t.start]=i+1,i++;this.elements=new Int32Array(i);let n=0;for(let i=t.start;i<t.endExclusive;i++){const t=e[i];for(let e=0;e<t.length;e++)this.elements[n+e]=t.charCodeAt(e);n+=t.length,i<e.length-1&&(this.elements[n]="\n".charCodeAt(0),n+=1)}}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=mNe(e>0?this.elements[e-1]:-1),i=mNe(e<this.elements.length?this.elements[e]:-1);if(6===t&&7===i)return 0;let n=0;return t!==i&&(n+=10,1===i&&(n+=1)),n+=pNe(t),n+=pNe(i),n}translateOffset(e){let t=0,i=this.firstCharOnLineOffsets.length;for(;t<i;){const n=Math.floor((t+i)/2);this.firstCharOnLineOffsets[n]>e?i=n:t=n+1}const n=0===t?0:this.firstCharOnLineOffsets[t-1];return new lye(t+1,e-n+1)}translateRange(e){return dye.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}}const gNe={0:0,1:0,2:0,3:10,4:2,5:3,6:10,7:10};function pNe(e){return gNe[e]}function mNe(e){return 10===e?7:13===e?6:function(e){return 32===e||9===e}(e)?5:e>=97&&e<=122?0:e>=65&&e<=90?1:e>=48&&e<=57?2:-1===e?3:4}const fNe={smart:new class{computeDiff(e,t,i){var n;const o=new YEe(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),s=[];let r=null;for(const e of o.changes){let t,i;t=0===e.originalEndLineNumber?new KEe(e.originalStartLineNumber+1,e.originalStartLineNumber+1):new KEe(e.originalStartLineNumber,e.originalEndLineNumber+1),i=0===e.modifiedEndLineNumber?new KEe(e.modifiedStartLineNumber+1,e.modifiedStartLineNumber+1):new KEe(e.modifiedStartLineNumber,e.modifiedEndLineNumber+1);let o=new zEe(t,i,null===(n=e.charChanges)||void 0===n?void 0:n.map((e=>new UEe(new dye(e.originalStartLineNumber,e.originalStartColumn,e.originalEndLineNumber,e.originalEndColumn),new dye(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn)))));r&&(r.modifiedRange.endLineNumberExclusive!==o.modifiedRange.startLineNumber&&r.originalRange.endLineNumberExclusive!==o.originalRange.startLineNumber||(o=new zEe(r.originalRange.join(o.originalRange),r.modifiedRange.join(o.modifiedRange),r.innerChanges&&o.innerChanges?r.innerChanges.concat(o.innerChanges):void 0),s.pop())),s.push(o),r=o}return qxe((()=>$xe(s,((e,t)=>t.originalRange.startLineNumber-e.originalRange.endLineNumberExclusive==t.modifiedRange.startLineNumber-e.modifiedRange.endLineNumberExclusive&&e.originalRange.endLineNumberExclusive<t.originalRange.startLineNumber&&e.modifiedRange.endLineNumberExclusive<t.modifiedRange.startLineNumber)))),{quitEarly:o.quitEarly,changes:s}}},experimental:new class{constructor(){this.dynamicProgrammingDiffing=new nNe,this.myersDiffingAlgorithm=new rNe}computeDiff(e,t,i){const n=new Map;function o(e){let t=n.get(e);return void 0===t&&(t=n.size,n.set(e,t)),t}const s=e.map((e=>o(e.trim()))),r=t.map((e=>o(e.trim()))),a=new hNe(s,e),l=new hNe(r,t);let d=(()=>a.length+l.length<1500?this.dynamicProgrammingDiffing.compute(a,l,((i,n)=>e[i]===t[n]?0===t[n].length?.1:1+Math.log(1+t[n].length):.99)):this.myersDiffingAlgorithm.compute(a,l))();d=oNe(a,l,d);const h=[],c=i=>{for(let n=0;n<i;n++){const i=u+n,o=g+n;if(e[i]!==t[o]){const n=this.refineDiff(e,t,new eNe(new tNe(i,i+1),new tNe(o,o+1)));for(const e of n)h.push(e)}}};let u=0,g=0;for(const i of d){qxe((()=>i.seq1Range.start-u==i.seq2Range.start-g)),c(i.seq1Range.start-u),u=i.seq1Range.endExclusive,g=i.seq2Range.endExclusive;const n=this.refineDiff(e,t,i);for(const e of n)h.push(e)}c(e.length-u);const p=function(e){const t=[];for(const i of function*(e){let t,i;for(const s of e)void 0!==i&&(n=i,(o=s).originalRange.startLineNumber-(n.originalRange.endLineNumber-(n.originalRange.endColumn>1?0:1))<=1||o.modifiedRange.startLineNumber-(n.modifiedRange.endLineNumber-(n.modifiedRange.endColumn>1?0:1))<=1)?t.push(s):(t&&(yield t),t=[s]),i=s;var n,o;t&&(yield t)}(e)){const e=i[0],n=i[i.length-1];t.push(new zEe(new KEe(e.originalRange.startLineNumber,n.originalRange.endLineNumber+(n.originalRange.endColumn>1||n.modifiedRange.endColumn>1?1:0)),new KEe(e.modifiedRange.startLineNumber,n.modifiedRange.endLineNumber+(n.originalRange.endColumn>1||n.modifiedRange.endColumn>1?1:0)),i))}return qxe((()=>$xe(t,((e,t)=>t.originalRange.startLineNumber-e.originalRange.endLineNumberExclusive==t.modifiedRange.startLineNumber-e.modifiedRange.endLineNumberExclusive&&e.originalRange.endLineNumberExclusive<t.originalRange.startLineNumber&&e.modifiedRange.endLineNumberExclusive<t.modifiedRange.startLineNumber)))),t}(h);return{quitEarly:!1,changes:p}}refineDiff(e,t,i){const n=new uNe(e,i.seq1Range),o=new uNe(t,i.seq2Range),s=n.length+o.length<500?this.dynamicProgrammingDiffing.compute(n,o):this.myersDiffingAlgorithm.compute(n,o);let r=oNe(n,o,s);return r=function(e,t,i){const n=[];for(const e of i){const t=n[n.length-1];t&&(e.seq1Range.start-t.seq1Range.endExclusive<=2||e.seq2Range.start-t.seq2Range.endExclusive<=2)?n[n.length-1]=new eNe(t.seq1Range.join(e.seq1Range),t.seq2Range.join(e.seq2Range)):n.push(e)}return n}(0,0,r),r.map((e=>new UEe(n.translateRange(e.seq1Range).delta(i.seq1Range.start),o.translateRange(e.seq2Range).delta(i.seq2Range.start))))}}};var _Ne=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class vNe extends SEe{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}getLinesContent(){return this._lines.slice(0)}getLineCount(){return this._lines.length}getLineContent(e){return this._lines[e-1]}getWordAtPosition(e,t){const i=Xve(e.column,Yve(t),this._lines[e.lineNumber-1],0);return i?new dye(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn):null}words(e){const t=this._lines,i=this._wordenize.bind(this);let n=0,o="",s=0,r=[];return{*[Symbol.iterator](){for(;;)if(s<r.length){const e=o.substring(r[s].start,r[s].end);s+=1,yield e}else{if(!(n<t.length))break;o=t[n],r=i(o,e),s=0,n+=1}}}}getLineWords(e,t){const i=this._lines[e-1],n=this._wordenize(i,t),o=[];for(const e of n)o.push({word:i.substring(e.start,e.end),startColumn:e.start+1,endColumn:e.end+1});return o}_wordenize(e,t){const i=[];let n;for(t.lastIndex=0;(n=t.exec(e))&&0!==n[0].length;)i.push({start:n.index,end:n.index+n[0].length});return i}getValueInRange(e){if((e=this._validateRange(e)).startLineNumber===e.endLineNumber)return this._lines[e.startLineNumber-1].substring(e.startColumn-1,e.endColumn-1);const t=this._eol,i=e.startLineNumber-1,n=e.endLineNumber-1,o=[];o.push(this._lines[i].substring(e.startColumn-1));for(let e=i+1;e<n;e++)o.push(this._lines[e]);return o.push(this._lines[n].substring(0,e.endColumn-1)),o.join(t)}offsetAt(e){return e=this._validatePosition(e),this._ensureLineStarts(),this._lineStarts.getPrefixSum(e.lineNumber-2)+(e.column-1)}positionAt(e){e=Math.floor(e),e=Math.max(0,e),this._ensureLineStarts();const t=this._lineStarts.getIndexOf(e),i=this._lines[t.index].length;return{lineNumber:1+t.index,column:1+Math.min(t.remainder,i)}}_validateRange(e){const t=this._validatePosition({lineNumber:e.startLineNumber,column:e.startColumn}),i=this._validatePosition({lineNumber:e.endLineNumber,column:e.endColumn});return t.lineNumber!==e.startLineNumber||t.column!==e.startColumn||i.lineNumber!==e.endLineNumber||i.column!==e.endColumn?{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:i.lineNumber,endColumn:i.column}:e}_validatePosition(e){if(!lye.isIPosition(e))throw new Error("bad position");let{lineNumber:t,column:i}=e,n=!1;if(t<1)t=1,i=1,n=!0;else if(t>this._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,n=!0;else{const e=this._lines[t-1].length+1;i<1?(i=1,n=!0):i>e&&(i=e,n=!0)}return n?{lineNumber:t,column:i}:e}}class bNe{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){const e=[];return Object.keys(this._models).forEach((t=>e.push(this._models[t]))),e}acceptNewModel(e){this._models[e.url]=new vNe(QCe.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){this._models[e]&&this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}computeUnicodeHighlights(e,t,i){return _Ne(this,void 0,void 0,(function*(){const n=this._getModel(e);return n?WEe.computeUnicodeHighlights(n,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}))}computeDiff(e,t,i,n){return _Ne(this,void 0,void 0,(function*(){const o=this._getModel(e),s=this._getModel(t);return o&&s?bNe.computeDiff(o,s,i,n):null}))}static computeDiff(e,t,i,n){const o="experimental"===n?fNe.experimental:fNe.smart,s=e.getLinesContent(),r=t.getLinesContent(),a=o.computeDiff(s,r,i);return{identical:!(a.changes.length>0)&&this._modelsAreIdentical(e,t),quitEarly:a.quitEarly,changes:a.changes.map((e=>{var t;return[e.originalRange.startLineNumber,e.originalRange.endLineNumberExclusive,e.modifiedRange.startLineNumber,e.modifiedRange.endLineNumberExclusive,null===(t=e.innerChanges)||void 0===t?void 0:t.map((e=>[e.originalRange.startLineNumber,e.originalRange.startColumn,e.originalRange.endLineNumber,e.originalRange.endColumn,e.modifiedRange.startLineNumber,e.modifiedRange.startColumn,e.modifiedRange.endLineNumber,e.modifiedRange.endColumn]))]}))}}static _modelsAreIdentical(e,t){const i=e.getLineCount();if(i!==t.getLineCount())return!1;for(let n=1;n<=i;n++)if(e.getLineContent(n)!==t.getLineContent(n))return!1;return!0}computeMoreMinimalEdits(e,t){return _Ne(this,void 0,void 0,(function*(){const i=this._getModel(e);if(!i)return t;const n=[];let o;t=t.slice(0).sort(((e,t)=>e.range&&t.range?dye.compareRangesUsingStarts(e.range,t.range):(e.range?0:1)-(t.range?0:1)));for(let{range:e,text:s,eol:r}of t){if("number"==typeof r&&(o=r),dye.isEmpty(e)&&!s)continue;const t=i.getValueInRange(e);if(s=s.replace(/\r\n|\n|\r/g,i.eol),t===s)continue;if(Math.max(s.length,t.length)>bNe._diffLimit){n.push({range:e,text:s});continue}const a=gEe(t,s,!1),l=i.offsetAt(dye.lift(e).getStartPosition());for(const e of a){const t=i.positionAt(l+e.originalStart),o=i.positionAt(l+e.originalStart+e.originalLength),r={text:s.substr(e.modifiedStart,e.modifiedLength),range:{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:o.lineNumber,endColumn:o.column}};i.getValueInRange(r.range)!==r.text&&n.push(r)}}return"number"==typeof o&&n.push({eol:o,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),n}))}computeLinks(e){return _Ne(this,void 0,void 0,(function*(){const t=this._getModel(e);return t?function(e){return e&&"function"==typeof e.getLineCount&&"function"==typeof e.getLineContent?NEe.computeLinks(e):[]}(t):null}))}textualSuggest(e,t,i,n){return _Ne(this,void 0,void 0,(function*(){const o=new Hwe(!0),s=new RegExp(i,n),r=new Set;e:for(const i of e){const e=this._getModel(i);if(e)for(const i of e.words(s))if(i!==t&&isNaN(Number(i))&&(r.add(i),r.size>bNe._suggestionsLimit))break e}return{words:Array.from(r),duration:o.elapsed()}}))}computeWordRanges(e,t,i,n){return _Ne(this,void 0,void 0,(function*(){const o=this._getModel(e);if(!o)return Object.create(null);const s=new RegExp(i,n),r=Object.create(null);for(let e=t.startLineNumber;e<t.endLineNumber;e++){const t=o.getLineWords(e,s);for(const i of t){if(!isNaN(Number(i.word)))continue;let t=r[i.word];t||(t=[],r[i.word]=t),t.push({startLineNumber:e,startColumn:i.startColumn,endLineNumber:e,endColumn:i.endColumn})}}return r}))}navigateValueSet(e,t,i,n,o){return _Ne(this,void 0,void 0,(function*(){const s=this._getModel(e);if(!s)return null;const r=new RegExp(n,o);t.startColumn===t.endColumn&&(t={startLineNumber:t.startLineNumber,startColumn:t.startColumn,endLineNumber:t.endLineNumber,endColumn:t.endColumn+1});const a=s.getValueInRange(t),l=s.getWordAtPosition({lineNumber:t.startLineNumber,column:t.startColumn},r);if(!l)return null;const d=s.getValueInRange(l);return IEe.INSTANCE.navigateValueSet(t,a,l,d,i)}))}loadForeignModule(e,t,i){const n=function(e,t){const i=e=>function(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)},n={};for(const t of e)n[t]=i(t);return n}(i,((e,t)=>this._host.fhr(e,t))),o={host:n,getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(o,t),Promise.resolve(Obe(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||"function"!=typeof this._foreignModule[e])return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(e){return Promise.reject(e)}}}bNe._diffLimit=1e5,bNe._suggestionsLimit=1e4,"function"==typeof importScripts&&(Cve.monaco=pSe());const wNe=zxe("textResourceConfigurationService"),CNe=zxe("textResourcePropertiesService"),yNe=zxe("logService");var SNe;!function(e){e[e.Off=0]="Off",e[e.Trace=1]="Trace",e[e.Debug=2]="Debug",e[e.Info=3]="Info",e[e.Warning=4]="Warning",e[e.Error=5]="Error"}(SNe||(SNe={}));const xNe=SNe.Info;class kNe extends Owe{constructor(){super(...arguments),this.level=xNe,this._onDidChangeLogLevel=this._register(new $we),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return this.level!==SNe.Off&&this.level<=e}}class LNe extends kNe{constructor(e=xNe){super(),this.setLevel(e)}trace(e,...t){this.checkLogLevel(SNe.Trace)&&console.log("%cTRACE","color: #888",e,...t)}debug(e,...t){this.checkLogLevel(SNe.Debug)&&console.log("%cDEBUG","background: #eee; color: #888",e,...t)}info(e,...t){this.checkLogLevel(SNe.Info)&&console.log("%c INFO","color: #33f",e,...t)}error(e,...t){this.checkLogLevel(SNe.Error)&&console.log("%c ERR","color: #f33",e,...t)}dispose(){}}class DNe extends kNe{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const i of this.loggers)i.trace(e,...t)}debug(e,...t){for(const i of this.loggers)i.debug(e,...t)}info(e,...t){for(const i of this.loggers)i.info(e,...t)}error(e,...t){for(const i of this.loggers)i.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose()}}const ENe=zxe("ILanguageFeaturesService");var NNe=function(e,t){return function(i,n){t(i,n,e)}},INe=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function TNe(e,t){const i=e.getModel(t);return!!i&&!i.isTooLargeForSyncing()}let MNe=class extends Owe{constructor(e,t,i,n,o){super(),this._modelService=e,this._workerManager=this._register(new RNe(this._modelService,n)),this._logService=i,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(e,t)=>TNe(this._modelService,e.uri)?this._workerManager.withWorker().then((t=>t.computeLinks(e.uri))).then((e=>e&&{links:e})):Promise.resolve({links:[]})})),this._register(o.completionProvider.register("*",new ANe(this._workerManager,t,this._modelService,n)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return TNe(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then((n=>n.computedUnicodeHighlights(e,t,i)))}computeDiff(e,t,i,n){return INe(this,void 0,void 0,(function*(){const o=yield this._workerManager.withWorker().then((o=>o.computeDiff(e,t,i,n)));if(!o)return null;const s={identical:o.identical,quitEarly:o.quitEarly,changes:o.changes.map((e=>{var t;return new zEe(new KEe(e[0],e[1]),new KEe(e[2],e[3]),null===(t=e[4])||void 0===t?void 0:t.map((e=>new UEe(new dye(e[0],e[1],e[2],e[3]),new dye(e[4],e[5],e[6],e[7])))))}))};return s}))}computeMoreMinimalEdits(e,t){if(ibe(t)){if(!TNe(this._modelService,e))return Promise.resolve(t);const i=Hwe.create(!0),n=this._workerManager.withWorker().then((i=>i.computeMoreMinimalEdits(e,t)));return n.finally((()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),i.elapsed()))),Promise.race([n,ADe(1e3).then((()=>t))])}return Promise.resolve(void 0)}canNavigateValueSet(e){return TNe(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then((n=>n.navigateValueSet(e,t,i)))}canComputeWordRanges(e){return TNe(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then((i=>i.computeWordRanges(e,t)))}};MNe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([NNe(0,xDe),NNe(1,wNe),NNe(2,yNe),NNe(3,dDe),NNe(4,ENe)],MNe);class ANe{constructor(e,t,i,n){this.languageConfigurationService=n,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}provideCompletionItems(e,t){return INe(this,void 0,void 0,(function*(){const i=this._configurationService.getValue(e.uri,t,"editor");if(!i.wordBasedSuggestions)return;const n=[];if("currentDocument"===i.wordBasedSuggestionsMode)TNe(this._modelService,e.uri)&&n.push(e.uri);else for(const t of this._modelService.getModels())TNe(this._modelService,t.uri)&&(t===e?n.unshift(t.uri):"allDocuments"!==i.wordBasedSuggestionsMode&&t.getLanguageId()!==e.getLanguageId()||n.push(t.uri));if(0===n.length)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),s=e.getWordAtPosition(t),r=s?new dye(t.lineNumber,s.startColumn,t.lineNumber,s.endColumn):dye.fromPositions(t),a=r.setEndPosition(t.lineNumber,t.column),l=yield this._workerManager.withWorker(),d=yield l.textualSuggest(n,null==s?void 0:s.word,o);return d?{duration:d.duration,suggestions:d.words.map((e=>({kind:18,label:e,insertText:e,range:{insert:a,replace:r}})))}:void 0}))}}class RNe extends Owe{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=(new Date).getTime(),this._register(new PDe).cancelAndSet((()=>this._checkStopIdleWorker()),Math.round(15e4)),this._register(this._modelService.onModelRemoved((e=>this._checkStopEmptyWorker())))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){this._editorWorkerClient&&0===this._modelService.getModels().length&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){this._editorWorkerClient&&(new Date).getTime()-this._lastWorkerUsedTime>3e5&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=(new Date).getTime(),this._editorWorkerClient||(this._editorWorkerClient=new BNe(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class ONe extends Owe{constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const e=new PDe;e.cancelAndSet((()=>this._checkStopModelSync()),Math.round(3e4)),this._register(e)}}dispose(){for(const e in this._syncedModels)Twe(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const i of e){const e=i.toString();this._syncedModels[e]||this._beginModelSync(i,t),this._syncedModels[e]&&(this._syncedModelsLastUsedTime[e]=(new Date).getTime())}}_checkStopModelSync(){const e=(new Date).getTime(),t=[];for(const i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>6e4&&t.push(i);for(const e of t)this._stopModelSync(e)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i)return;if(!t&&i.isTooLargeForSyncing())return;const n=e.toString();this._proxy.acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const o=new Rwe;o.add(i.onDidChangeContent((e=>{this._proxy.acceptModelChanged(n.toString(),e)}))),o.add(i.onWillDispose((()=>{this._stopModelSync(n)}))),o.add(Awe((()=>{this._proxy.acceptRemovedModel(n)}))),this._syncedModels[n]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],Twe(t)}}class PNe{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class FNe{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class BNe extends Owe{constructor(e,t,i,n){super(),this.languageConfigurationService=n,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new nEe(i),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new QDe(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new FNe(this)))}catch(e){KDe(e),this._worker=new PNe(new bNe(new FNe(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,(e=>(KDe(e),this._worker=new PNe(new bNe(new FNe(this),null)),this._getOrCreateWorker().getProxyObject())))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new ONe(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e,t=!1){return INe(this,void 0,void 0,(function*(){return this._disposed?Promise.reject(function(){const e=new Error(Swe);return e.name=e.message,e}()):this._getProxy().then((i=>(this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i)))}))}computedUnicodeHighlights(e,t,i){return this._withSyncedResources([e]).then((n=>n.computeUnicodeHighlights(e.toString(),t,i)))}computeDiff(e,t,i,n){return this._withSyncedResources([e,t],!0).then((o=>o.computeDiff(e.toString(),t.toString(),i,n)))}computeMoreMinimalEdits(e,t){return this._withSyncedResources([e]).then((i=>i.computeMoreMinimalEdits(e.toString(),t)))}computeLinks(e){return this._withSyncedResources([e]).then((t=>t.computeLinks(e.toString())))}textualSuggest(e,t,i){return INe(this,void 0,void 0,(function*(){const n=yield this._withSyncedResources(e),o=i.source,s=LSe(i);return n.textualSuggest(e.map((e=>e.toString())),t,o,s)}))}computeWordRanges(e,t){return this._withSyncedResources([e]).then((i=>{const n=this._modelService.getModel(e);if(!n)return Promise.resolve(null);const o=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId()).getWordDefinition(),s=o.source,r=LSe(o);return i.computeWordRanges(e.toString(),t,s,r)}))}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then((n=>{const o=this._modelService.getModel(e);if(!o)return null;const s=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),r=s.source,a=LSe(s);return n.navigateValueSet(e.toString(),t,i,r,a)}))}dispose(){super.dispose(),this._disposed=!0}}class WNe extends BNe{constructor(e,t,i){super(e,i.keepIdleModels||!1,i.label,t),this._foreignModuleId=i.moduleId,this._foreignModuleCreateData=i.createData||null,this._foreignModuleHost=i.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||"function"!=typeof this._foreignModuleHost[e])return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(e){return Promise.reject(e)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then((e=>{const t=this._foreignModuleHost?Obe(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then((t=>{this._foreignModuleCreateData=null;const i=(t,i)=>e.fmr(t,i),n=(e,t)=>function(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)},o={};for(const e of t)o[e]=n(e,i);return o}))}))),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then((e=>this.getProxy()))}}class VNe{static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(768&e)>>>8}static containsBalancedBrackets(e){return!!(1024&e)}static getFontStyle(e){return(30720&e)>>>11}static getForeground(e){return(16744448&e)>>>15}static getBackground(e){return(4278190080&e)>>>24}static getClassNameFromMetadata(e){let t="mtk"+this.getForeground(e);const i=this.getFontStyle(e);return 1&i&&(t+=" mtki"),2&i&&(t+=" mtkb"),4&i&&(t+=" mtku"),8&i&&(t+=" mtks"),t}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),n=this.getFontStyle(e);let o=`color: ${t[i]};`;1&n&&(o+="font-style: italic;"),2&n&&(o+="font-weight: bold;");let s="";return 4&n&&(s+=" underline"),8&n&&(s+=" line-through"),s&&(o+=`text-decoration:${s};`),o}static getPresentationFromMetadata(e){const t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:Boolean(1&i),bold:Boolean(2&i),underline:Boolean(4&i),strikethrough:Boolean(8&i)}}}class HNe{static createEmpty(e,t){const i=HNe.defaultTokenMetadata,n=new Uint32Array(2);return n[0]=e.length,n[1]=i,new HNe(n,e,t)}constructor(e,t,i){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=i}equals(e){return e instanceof HNe&&this.slicedEquals(e,0,this._tokensCount)}slicedEquals(e,t,i){if(this._text!==e._text)return!1;if(this._tokensCount!==e._tokensCount)return!1;const n=t<<1,o=n+(i<<1);for(let t=n;t<o;t++)if(this._tokens[t]!==e._tokens[t])return!1;return!0}getLineContent(){return this._text}getCount(){return this._tokensCount}getStartOffset(e){return e>0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[1+(e<<1)]}getLanguageId(e){const t=this._tokens[1+(e<<1)],i=VNe.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[1+(e<<1)];return VNe.getTokenType(t)}getForeground(e){const t=this._tokens[1+(e<<1)];return VNe.getForeground(t)}getClassName(e){const t=this._tokens[1+(e<<1)];return VNe.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[1+(e<<1)];return VNe.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[1+(e<<1)];return VNe.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return HNe.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new zNe(this,e,t,i)}static convertToEndOffset(e,t){const i=(e.length>>>1)-1;for(let t=0;t<i;t++)e[t<<1]=e[t+1<<1];e[i<<1]=t}static findIndexInTokensArray(e,t){if(e.length<=2)return 0;let i=0,n=(e.length>>>1)-1;for(;i<n;){const o=i+Math.floor((n-i)/2),s=e[o<<1];if(s===t)return o+1;s<t?i=o+1:s>t&&(n=o)}return i}withInserted(e){if(0===e.length)return this;let t=0,i=0,n="";const o=new Array;let s=0;for(;;){const r=t<this._tokensCount?this._tokens[t<<1]:-1,a=i<e.length?e[i]:null;if(-1!==r&&(null===a||r<=a.offset)){n+=this._text.substring(s,r);const e=this._tokens[1+(t<<1)];o.push(n.length,e),t++,s=r}else{if(!a)break;if(a.offset>s){n+=this._text.substring(s,a.offset);const e=this._tokens[1+(t<<1)];o.push(n.length,e),s=a.offset}n+=a.text,o.push(n.length,a.tokenMetadata),i++}}return new HNe(new Uint32Array(o),n,this._languageIdCodec)}}HNe.defaultTokenMetadata=33587200;class zNe{constructor(e,t,i,n){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=n,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let t=this._firstTokenIndex,n=e.getCount();t<n&&!(e.getStartOffset(t)>=i);t++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof zNe&&this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount)}getCount(){return this._tokensCount}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}class UNe{constructor(e,t,i,n){this.startColumn=e,this.endColumn=t,this.className=i,this.type=n,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(!UNe._equals(e[n],t[n]))return!1;return!0}static extractWrapped(e,t,i){if(0===e.length)return e;const n=t+1,o=i+1,s=i-t,r=[];let a=0;for(const t of e)t.endColumn<=n||t.startColumn>=o||(r[a++]=new UNe(Math.max(1,t.startColumn-n+1),Math.min(s+1,t.endColumn-n+1),t.className,t.type));return r}static filter(e,t,i,n){if(0===e.length)return[];const o=[];let s=0;for(let r=0,a=e.length;r<a;r++){const a=e[r],l=a.range;if(l.endLineNumber<t||l.startLineNumber>t)continue;if(l.isEmpty()&&(0===a.type||3===a.type))continue;const d=l.startLineNumber===t?l.startColumn:i,h=l.endLineNumber===t?l.endColumn:n;o[s++]=new UNe(d,h,a.inlineClassName,a.type)}return o}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;const i=UNe._typeCompare(e.type,t.type);return 0!==i?i:e.className!==t.className?e.className<t.className?-1:1:0}}class KNe{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.className=i,this.metadata=n}}class jNe{constructor(){this.stopOffsets=[],this.classNames=[],this.metadata=[],this.count=0}static _metadata(e){let t=0;for(let i=0,n=e.length;i<n;i++)t|=e[i];return t}consumeLowerThan(e,t,i){for(;this.count>0&&this.stopOffsets[0]<e;){let e=0;for(;e+1<this.count&&this.stopOffsets[e]===this.stopOffsets[e+1];)e++;i.push(new KNe(t,this.stopOffsets[e],this.classNames.join(" "),jNe._metadata(this.metadata))),t=this.stopOffsets[e]+1,this.stopOffsets.splice(0,e+1),this.classNames.splice(0,e+1),this.metadata.splice(0,e+1),this.count-=e+1}return this.count>0&&t<e&&(i.push(new KNe(t,e-1,this.classNames.join(" "),jNe._metadata(this.metadata))),t=e),t}insert(e,t,i){if(0===this.count||this.stopOffsets[this.count-1]<=e)this.stopOffsets.push(e),this.classNames.push(t),this.metadata.push(i);else for(let n=0;n<this.count;n++)if(this.stopOffsets[n]>=e){this.stopOffsets.splice(n,0,e),this.classNames.splice(n,0,t),this.metadata.splice(n,0,i);break}this.count++}}class qNe{static normalize(e,t){if(0===t.length)return[];const i=[],n=new jNe;let o=0;for(let s=0,r=t.length;s<r;s++){const r=t[s];let a=r.startColumn,l=r.endColumn;const d=r.className,h=1===r.type?2:2===r.type?4:0;a>1&&zSe(e.charCodeAt(a-2))&&a--,l>1&&zSe(e.charCodeAt(l-2))&&l--;const c=a-1,u=l-2;o=n.consumeLowerThan(c,o,i),0===n.count&&(o=c),n.insert(u,d,h)}return n.consumeLowerThan(1073741824,o,i),i}}class $Ne{constructor(e,t,i,n){this.endIndex=e,this.type=t,this.metadata=i,this.containsRTL=n,this._linePartBrand=void 0}isWhitespace(){return!!(1&this.metadata)}isPseudoAfter(){return!!(4&this.metadata)}}class GNe{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class ZNe{constructor(e,t,i,n,o,s,r,a,l,d,h,c,u,g,p,m,f,_,v){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=o,this.containsRTL=s,this.fauxIndentLength=r,this.lineTokens=a,this.lineDecorations=l.sort(UNe.compare),this.tabSize=d,this.startVisibleColumn=h,this.spaceWidth=c,this.stopRenderingLineAfter=p,this.renderWhitespace="all"===m?4:"boundary"===m?1:"selection"===m?2:"trailing"===m?3:0,this.renderControlCharacters=f,this.fontLigatures=_,this.selectionsOnLine=v&&v.sort(((e,t)=>e.startOffset<t.startOffset?-1:1)),Math.abs(g-c)<Math.abs(u-c)?(this.renderSpaceWidth=g,this.renderSpaceCharCode=11825):(this.renderSpaceWidth=u,this.renderSpaceCharCode=183)}sameSelection(e){if(null===this.selectionsOnLine)return null===e;if(null===e)return!1;if(e.length!==this.selectionsOnLine.length)return!1;for(let t=0;t<this.selectionsOnLine.length;t++)if(!this.selectionsOnLine[t].equals(e[t]))return!1;return!0}equals(e){return this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineContent===e.lineContent&&this.continuesWithWrappedLine===e.continuesWithWrappedLine&&this.isBasicASCII===e.isBasicASCII&&this.containsRTL===e.containsRTL&&this.fauxIndentLength===e.fauxIndentLength&&this.tabSize===e.tabSize&&this.startVisibleColumn===e.startVisibleColumn&&this.spaceWidth===e.spaceWidth&&this.renderSpaceWidth===e.renderSpaceWidth&&this.renderSpaceCharCode===e.renderSpaceCharCode&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.fontLigatures===e.fontLigatures&&UNe.equalsArr(this.lineDecorations,e.lineDecorations)&&this.lineTokens.equals(e.lineTokens)&&this.sameSelection(e.selectionsOnLine)}}class YNe{constructor(e,t){this.partIndex=e,this.charIndex=t}}class QNe{static getPartIndex(e){return(4294901760&e)>>>16}static getCharIndex(e){return(65535&e)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,n){const o=(t<<16|i)>>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=n}getHorizontalOffset(e){return 0===this._horizontalOffset.length?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return 0===this.length?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),i=QNe.getPartIndex(t),n=QNe.getCharIndex(t);return new YNe(i,n)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(0===this.length)return 0;const n=(e<<16|i)>>>0;let o=0,s=this.length-1;for(;o+1<s;){const e=o+s>>>1,t=this._data[e];if(t===n)return e;t>n?s=e:o=e}if(o===s)return o;const r=this._data[o],a=this._data[s];if(r===n)return o;if(a===n)return s;const l=QNe.getPartIndex(r),d=QNe.getCharIndex(r);let h;return h=l!==QNe.getPartIndex(a)?t:QNe.getCharIndex(a),i-d<=h-i?o:s}}class XNe{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function JNe(e,t){if(0===e.lineContent.length){if(e.lineDecorations.length>0){t.appendString("<span>");let i=0,n=0,o=0;for(const s of e.lineDecorations)1!==s.type&&2!==s.type||(t.appendString('<span class="'),t.appendString(s.className),t.appendString('"></span>'),1===s.type&&(o|=1,i++),2===s.type&&(o|=2,n++));t.appendString("</span>");const s=new QNe(1,i+n);return s.setColumnInfo(1,i,0,0),new XNe(s,!1,o)}return t.appendString("<span><span></span></span>"),new XNe(new QNe(0,0),!1,0)}return function(e,t){const i=e.fontIsMonospace,n=e.canUseHalfwidthRightwardsArrow,o=e.containsForeignElements,s=e.lineContent,r=e.len,a=e.isOverflowing,l=e.overflowingCharCount,d=e.parts,h=e.fauxIndentLength,c=e.tabSize,u=e.startVisibleColumn,g=e.containsRTL,p=e.spaceWidth,m=e.renderSpaceCharCode,f=e.renderWhitespace,_=e.renderControlCharacters,v=new QNe(r+1,d.length);let b=!1,w=0,C=u,y=0,S=0,x=0;g?t.appendString('<span dir="ltr">'):t.appendString("<span>");for(let e=0,a=d.length;e<a;e++){const a=d[e],l=a.endIndex,u=a.type,g=a.containsRTL,k=0!==f&&a.isWhitespace(),L=k&&!i&&("mtkw"===u||!o),D=w===l&&a.isPseudoAfter();if(y=0,t.appendString("<span "),g&&t.appendString('style="unicode-bidi:isolate" '),t.appendString('class="'),t.appendString(L?"mtkz":u),t.appendASCIICharCode(34),k){let i=0;{let e=w,t=C;for(;e<l;e++){const n=0|(9===s.charCodeAt(e)?c-t%c:1);i+=n,e>=h&&(t+=n)}}for(L&&(t.appendString(' style="width:'),t.appendString(String(p*i)),t.appendString('px"')),t.appendASCIICharCode(62);w<l;w++){let i,o;if(v.setColumnInfo(w+1,e-x,y,S),x=0,9===s.charCodeAt(w)){i=c-C%c|0,o=i,!n||o>1?t.appendCharCode(8594):t.appendCharCode(65515);for(let e=2;e<=o;e++)t.appendCharCode(160)}else i=2,o=1,t.appendCharCode(m),t.appendCharCode(8204);y+=i,S+=o,w>=h&&(C+=o)}}else for(t.appendASCIICharCode(62);w<l;w++){v.setColumnInfo(w+1,e-x,y,S),x=0;const i=s.charCodeAt(w);let n=1,o=1;switch(i){case 9:n=c-C%c,o=n;for(let e=1;e<=n;e++)t.appendCharCode(160);break;case 32:t.appendCharCode(160);break;case 60:t.appendString("<");break;case 62:t.appendString(">");break;case 38:t.appendString("&");break;case 0:_?t.appendCharCode(9216):t.appendString("�");break;case 65279:case 8232:case 8233:case 133:t.appendCharCode(65533);break;default:ixe(i)&&o++,_&&i<32?t.appendCharCode(9216+i):_&&127===i?t.appendCharCode(9249):_&&nIe(i)?(t.appendString("[U+"),t.appendString(oIe(i)),t.appendString("]"),n=8,o=n):t.appendCharCode(i)}y+=n,S+=o,w>=h&&(C+=o)}D?x++:x=0,w>=r&&!b&&a.isPseudoAfter()&&(b=!0,v.setColumnInfo(w+1,e,y,S)),t.appendString("</span>")}return b||v.setColumnInfo(r+1,d.length-1,y,S),a&&(t.appendString('<span class="mtkoverflow">'),t.appendString(ove(0,"Show more ({0})",function(e){return e<1024?ove(0,"{0} chars",e):e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}(l))),t.appendString("</span>")),t.appendString("</span>"),new XNe(v,g,o)}(function(e){const t=e.lineContent;let i,n,o;-1!==e.stopRenderingLineAfter&&e.stopRenderingLineAfter<t.length?(i=!0,n=t.length-e.stopRenderingLineAfter,o=e.stopRenderingLineAfter):(i=!1,n=0,o=t.length);let s=function(e,t,i,n,o){const s=[];let r=0;n>0&&(s[r++]=new $Ne(n,"",0,!1));let a=n;for(let l=0,d=i.getCount();l<d;l++){const d=i.getEndOffset(l);if(d<=n)continue;const h=i.getClassName(l);if(d>=o){const i=!!t&&QSe(e.substring(a,o));s[r++]=new $Ne(o,h,0,i);break}const c=!!t&&QSe(e.substring(a,d));s[r++]=new $Ne(d,h,0,c),a=d}return s}(t,e.containsRTL,e.lineTokens,e.fauxIndentLength,o);e.renderControlCharacters&&!e.isBasicASCII&&(s=function(e,t){const i=[];let n=new $Ne(0,"",0,!1),o=0;for(const s of t){const t=s.endIndex;for(;o<t;o++)nIe(e.charCodeAt(o))&&(o>n.endIndex&&(n=new $Ne(o,s.type,s.metadata,s.containsRTL),i.push(n)),n=new $Ne(o+1,"mtkcontrol",s.metadata,!1),i.push(n));o>n.endIndex&&(n=new $Ne(t,s.type,s.metadata,s.containsRTL),i.push(n))}return i}(t,s)),(4===e.renderWhitespace||1===e.renderWhitespace||2===e.renderWhitespace&&e.selectionsOnLine||3===e.renderWhitespace&&!e.continuesWithWrappedLine)&&(s=function(e,t,i,n){const o=e.continuesWithWrappedLine,s=e.fauxIndentLength,r=e.tabSize,a=e.startVisibleColumn,l=e.useMonospaceOptimizations,d=e.selectionsOnLine,h=1===e.renderWhitespace,c=3===e.renderWhitespace,u=e.renderSpaceWidth!==e.spaceWidth,g=[];let p=0,m=0,f=n[m].type,_=n[m].containsRTL,v=n[m].endIndex;const b=n.length;let w,C=!1,y=ESe(t);-1===y?(C=!0,y=i,w=i):w=ISe(t);let S=!1,x=0,k=d&&d[x],L=a%r;for(let e=s;e<i;e++){const o=t.charCodeAt(e);let a;if(k&&e>=k.endOffset&&(x++,k=d&&d[x]),e<y||e>w)a=!0;else if(9===o)a=!0;else if(32===o)if(h)if(S)a=!0;else{const n=e+1<i?t.charCodeAt(e+1):0;a=32===n||9===n}else a=!0;else a=!1;if(a&&d&&(a=!!k&&k.startOffset<=e&&k.endOffset>e),a&&c&&(a=C||e>w),a&&_&&e>=y&&e<=w&&(a=!1),S){if(!a||!l&&L>=r){if(u)for(let t=(p>0?g[p-1].endIndex:s)+1;t<=e;t++)g[p++]=new $Ne(t,"mtkw",1,!1);else g[p++]=new $Ne(e,"mtkw",1,!1);L%=r}}else(e===v||a&&e>s)&&(g[p++]=new $Ne(e,f,0,_),L%=r);for(9===o?L=r:ixe(o)?L+=2:L++,S=a;e===v&&(m++,m<b);)f=n[m].type,_=n[m].containsRTL,v=n[m].endIndex}let D=!1;if(S)if(o&&h){const e=i>0?t.charCodeAt(i-1):0,n=i>1?t.charCodeAt(i-2):0;32===e&&32!==n&&9!==n||(D=!0)}else D=!0;if(D)if(u)for(let e=(p>0?g[p-1].endIndex:s)+1;e<=i;e++)g[p++]=new $Ne(e,"mtkw",1,!1);else g[p++]=new $Ne(i,"mtkw",1,!1);else g[p++]=new $Ne(i,f,0,_);return g}(e,t,o,s));let r=0;if(e.lineDecorations.length>0){for(let t=0,i=e.lineDecorations.length;t<i;t++){const i=e.lineDecorations[t];3===i.type||1===i.type?r|=1:2===i.type&&(r|=2)}s=function(e,t,i,n){n.sort(UNe.compare);const o=qNe.normalize(e,n),s=o.length;let r=0;const a=[];let l=0,d=0;for(let e=0,t=i.length;e<t;e++){const t=i[e],n=t.endIndex,h=t.type,c=t.metadata,u=t.containsRTL;for(;r<s&&o[r].startOffset<n;){const e=o[r];if(e.startOffset>d&&(d=e.startOffset,a[l++]=new $Ne(d,h,c,u)),!(e.endOffset+1<=n)){d=n,a[l++]=new $Ne(d,h+" "+e.className,c|e.metadata,u);break}d=e.endOffset+1,a[l++]=new $Ne(d,h+" "+e.className,c|e.metadata,u),r++}n>d&&(d=n,a[l++]=new $Ne(d,h,c,u))}const h=i[i.length-1].endIndex;if(r<s&&o[r].startOffset===h)for(;r<s&&o[r].startOffset===h;){const e=o[r];a[l++]=new $Ne(d,e.className,e.metadata,!1),r++}return a}(t,0,s,e.lineDecorations)}return e.containsRTL||(s=function(e,t,i){let n=0;const o=[];let s=0;if(i)for(let i=0,r=t.length;i<r;i++){const r=t[i],a=r.endIndex;if(n+50<a){const t=r.type,i=r.metadata,l=r.containsRTL;let d=-1,h=n;for(let r=n;r<a;r++)32===e.charCodeAt(r)&&(d=r),-1!==d&&r-h>=50&&(o[s++]=new $Ne(d+1,t,i,l),h=d+1,d=-1);h!==a&&(o[s++]=new $Ne(a,t,i,l))}else o[s++]=r;n=a}else for(let e=0,i=t.length;e<i;e++){const i=t[e],r=i.endIndex,a=r-n;if(a>50){const e=i.type,t=i.metadata,l=i.containsRTL,d=Math.ceil(a/50);for(let i=1;i<d;i++){const r=n+50*i;o[s++]=new $Ne(r,e,t,l)}o[s++]=new $Ne(r,e,t,l)}else o[s++]=i;n=r}return o}(t,s,!e.isBasicASCII||e.fontLigatures)),new iIe(e.useMonospaceOptimizations,e.canUseHalfwidthRightwardsArrow,t,o,i,n,s,r,e.fauxIndentLength,e.tabSize,e.startVisibleColumn,e.containsRTL,e.spaceWidth,e.renderSpaceCharCode,e.renderWhitespace,e.renderControlCharacters)}(e),t)}class eIe{constructor(e,t,i,n){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=n}}function tIe(e){const t=new dLe(1e4),i=JNe(e,t);return new eIe(i.characterMapping,t.build(),i.containsRTL,i.containsForeignElements)}class iIe{constructor(e,t,i,n,o,s,r,a,l,d,h,c,u,g,p,m){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=n,this.isOverflowing=o,this.overflowingCharCount=s,this.parts=r,this.containsForeignElements=a,this.fauxIndentLength=l,this.tabSize=d,this.startVisibleColumn=h,this.containsRTL=c,this.spaceWidth=u,this.renderSpaceCharCode=g,this.renderWhitespace=p,this.renderControlCharacters=m}}function nIe(e){return e<32?9!==e:127===e||e>=8234&&e<=8238||e>=8294&&e<=8297||e>=8206&&e<=8207||1564===e}function oIe(e){return e.toString(16).toUpperCase().padStart(4,"0")}class sIe{constructor(e,t,i,n){this._viewportBrand=void 0,this.top=0|e,this.left=0|t,this.width=0|i,this.height=0|n}}class rIe{constructor(e,t){this.tabSize=e,this.data=t}}class aIe{constructor(e,t,i,n,o,s,r){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=n,this.startVisibleColumn=o,this.tokens=s,this.inlineDecorations=r}}class lIe{constructor(e,t,i,n,o,s,r,a,l,d){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=n,this.isBasicASCII=lIe.isBasicASCII(i,s),this.containsRTL=lIe.containsRTL(i,this.isBasicASCII,o),this.tokens=r,this.inlineDecorations=a,this.tabSize=l,this.startVisibleColumn=d}static isBasicASCII(e,t){return!t||JSe(e)}static containsRTL(e,t,i){return!(t||!i)&&QSe(e)}}class dIe{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class hIe{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=n}toInlineDecoration(e){return new dIe(new dye(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class cIe{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class uIe{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static cmp(e,t){return e.zIndex===t.zIndex?e.color<t.color?-1:e.color>t.color?1:0:e.zIndex-t.zIndex}}function gIe(e){return"string"==typeof e}function pIe(e){return!gIe(e)}function mIe(e){return!e}function fIe(e,t){return e.ignoreCase&&t?t.toLowerCase():t}function _Ie(e){return e.replace(/[&<>'"_]/g,"-")}function vIe(e,t){console.log(`${e.languageId}: ${t}`)}function bIe(e,t){return new Error(`${e.languageId}: ${t}`)}function wIe(e,t,i,n,o){let s=null;return t.replace(/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g,(function(t,r,a,l,d,h,c,u,g){return mIe(a)?mIe(l)?!mIe(d)&&d<n.length?fIe(e,n[d]):!mIe(c)&&e&&"string"==typeof e[c]?e[c]:(null===s&&(s=o.split("."),s.unshift(o)),!mIe(h)&&h<s.length?fIe(e,s[h]):""):fIe(e,i):"$"}))}function CIe(e,t){let i=t;for(;i&&i.length>0;){const t=e.tokenizer[i];if(t)return t;const n=i.lastIndexOf(".");i=n<0?null:i.substr(0,n)}return null}class yIe{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(null!==e&&e.depth>=this._maxCacheDepth)return new SIe(e,t);let i=SIe.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new SIe(e,t),this._entries[i]=n,n)}}yIe._INSTANCE=new yIe(5);class SIe{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;null!==e;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;null!==e&&null!==t;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return null===e&&null===t}equals(e){return SIe._equals(this,e)}push(e){return yIe.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return yIe.create(this.parent,e)}}class xIe{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new xIe(this.languageId,this.state)}}class kIe{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(null!==t)return new LIe(e,t);if(null!==e&&e.depth>=this._maxCacheDepth)return new LIe(e,t);const i=SIe.getStackElementId(e);let n=this._entries[i];return n||(n=new LIe(e,null),this._entries[i]=n,n)}}kIe._INSTANCE=new kIe(5);class LIe{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:kIe.create(this.stack,this.embeddedLanguageData)}equals(e){return e instanceof LIe&&!!this.stack.equals(e.stack)&&(null===this.embeddedLanguageData&&null===e.embeddedLanguageData||null!==this.embeddedLanguageData&&null!==e.embeddedLanguageData&&this.embeddedLanguageData.equals(e.embeddedLanguageData))}}class DIe{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(e){this._languageId=e}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new xye(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,n){const o=i.languageId,s=i.state,r=Eye.get(o);if(!r)return this.enterLanguage(o),this.emit(n,""),s;const a=r.tokenize(e,t,s);if(0!==n)for(const e of a.tokens)this._tokens.push(new xye(e.offset+n,e.type,e.language));else this._tokens=this._tokens.concat(a.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,a.endState}finalize(e){return new kye(this._tokens,e)}}class EIe{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=1024|this._theme.match(this._currentLanguageId,t);this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const n=null!==e?e.length:0,o=t.length,s=null!==i?i.length:0;if(0===n&&0===o&&0===s)return new Uint32Array(0);if(0===n&&0===o)return i;if(0===o&&0===s)return e;const r=new Uint32Array(n+o+s);null!==e&&r.set(e);for(let e=0;e<o;e++)r[n+e]=t[e];return null!==i&&r.set(i,n+o),r}nestedLanguageTokenize(e,t,i,n){const o=i.languageId,s=i.state,r=Eye.get(o);if(!r)return this.enterLanguage(o),this.emit(n,""),s;const a=r.tokenizeEncoded(e,t,s);if(0!==n)for(let e=0,t=a.tokens.length;e<t;e+=2)a.tokens[e]+=n;return this._prependTokens=EIe._merge(this._prependTokens,this._tokens,a.tokens),this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0,a.endState}finalize(e){return new Lye(EIe._merge(this._prependTokens,this._tokens,null),e)}}let NIe=class e{constructor(e,t,i,n,o){this._configurationService=o,this._languageService=e,this._standaloneThemeService=t,this._languageId=i,this._lexer=n,this._embeddedLanguages=Object.create(null),this.embeddedLoaded=Promise.resolve(void 0);let s=!1;this._tokenizationRegistryListener=Eye.onDidChange((e=>{if(s)return;let t=!1;for(let i=0,n=e.changedLanguages.length;i<n;i++){const n=e.changedLanguages[i];if(this._embeddedLanguages[n]){t=!0;break}}t&&(s=!0,Eye.fire([this._languageId]),s=!1)})),this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}),this._configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}dispose(){this._tokenizationRegistryListener.dispose()}getLoadStatus(){const t=[];for(const i in this._embeddedLanguages){const n=Eye.get(i);if(n){if(n instanceof e){const e=n.getLoadStatus();!1===e.loaded&&t.push(e.promise)}}else Eye.isResolved(i)||t.push(Eye.getOrCreate(i))}return 0===t.length?{loaded:!0}:{loaded:!1,promise:Promise.all(t).then((e=>{}))}}getInitialState(){const e=yIe.create(null,this._lexer.start);return kIe.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return yDe(this._languageId,i);const n=new DIe,o=this._tokenize(e,t,i,n);return n.finalize(o)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return SDe(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const n=new EIe(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,i,n);return n.finalize(o)}_tokenize(e,t,i,n){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,n):this._myTokenize(e,t,i,0,n)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=CIe(this._lexer,t.stack.state),!i))throw bIe(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,o=!1;for(const t of i){if(!pIe(t.action)||"@pop"!==t.action.nextEmbedded)continue;o=!0;let i=t.regex;const s=t.regex.source;if("^(?:"===s.substr(0,4)&&")"===s.substr(s.length-1,1)){const e=(i.ignoreCase?"i":"")+(i.unicode?"u":"");i=new RegExp(s.substr(4,s.length-5),e)}const r=e.search(i);-1===r||0!==r&&t.matchOnlyAtLineStart||(-1===n||r<n)&&(n=r)}if(!o)throw bIe(this._lexer,'no rule containing nextEmbedded: "@pop" in tokenizer embedded state: '+t.stack.state);return n}_nestedTokenize(e,t,i,n,o){const s=this._findLeavingNestedLanguageOffset(e,i);if(-1===s){const s=o.nestedLanguageTokenize(e,t,i.embeddedLanguageData,n);return kIe.create(i.stack,new xIe(i.embeddedLanguageData.languageId,s))}const r=e.substring(0,s);r.length>0&&o.nestedLanguageTokenize(r,!1,i.embeddedLanguageData,n);const a=e.substring(s);return this._myTokenize(a,t,i,n+s,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,n,o){o.enterLanguage(this._languageId);const s=e.length,r=t&&this._lexer.includeLF?e+"\n":e,a=r.length;let l=i.embeddedLanguageData,d=i.stack,h=0,c=null,u=!0;for(;u||h<a;){const i=h,g=d.depth,p=c?c.groups.length:0,m=d.state;let f=null,_=null,v=null,b=null,w=null;if(c){f=c.matches;const e=c.groups.shift();_=e.matched,v=e.action,b=c.rule,0===c.groups.length&&(c=null)}else{if(!u&&h>=a)break;u=!1;let e=this._lexer.tokenizer[m];if(!e&&(e=CIe(this._lexer,m),!e))throw bIe(this._lexer,"tokenizer state is not defined: "+m);const t=r.substr(h);for(const i of e)if((0===h||!i.matchOnlyAtLineStart)&&(f=t.match(i.regex),f)){_=f[0],v=i.action;break}}if(f||(f=[""],_=""),v||(h<a&&(f=[r.charAt(h)],_=f[0]),v=this._lexer.defaultToken),null===_)break;for(h+=_.length;!function(e){return Array.isArray(e)}(v)&&pIe(v)&&v.test;)v=v.test(_,f,m,h===a);let C=null;if("string"==typeof v||Array.isArray(v))C=v;else if(v.group)C=v.group;else if(null!==v.token&&void 0!==v.token){if(C=v.tokenSubst?wIe(this._lexer,v.token,_,f,m):v.token,v.nextEmbedded)if("@pop"===v.nextEmbedded){if(!l)throw bIe(this._lexer,"cannot pop embedded language if not inside one");l=null}else{if(l)throw bIe(this._lexer,"cannot enter embedded language from within an embedded language");w=wIe(this._lexer,v.nextEmbedded,_,f,m)}if(v.goBack&&(h=Math.max(0,h-v.goBack)),v.switchTo&&"string"==typeof v.switchTo){let e=wIe(this._lexer,v.switchTo,_,f,m);if("@"===e[0]&&(e=e.substr(1)),!CIe(this._lexer,e))throw bIe(this._lexer,"trying to switch to a state '"+e+"' that is undefined in rule: "+this._safeRuleName(b));d=d.switchTo(e)}else{if(v.transform&&"function"==typeof v.transform)throw bIe(this._lexer,"action.transform not supported");if(v.next)if("@push"===v.next){if(d.depth>=this._lexer.maxStack)throw bIe(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(m)}else if("@pop"===v.next){if(d.depth<=1)throw bIe(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(b));d=d.pop()}else if("@popall"===v.next)d=d.popall();else{let e=wIe(this._lexer,v.next,_,f,m);if("@"===e[0]&&(e=e.substr(1)),!CIe(this._lexer,e))throw bIe(this._lexer,"trying to set a next state '"+e+"' that is undefined in rule: "+this._safeRuleName(b));d=d.push(e)}}v.log&&"string"==typeof v.log&&vIe(this._lexer,this._lexer.languageId+": "+wIe(this._lexer,v.log,_,f,m))}if(null===C)throw bIe(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(b));const y=i=>{const s=this._languageService.getLanguageIdByLanguageName(i)||this._languageService.getLanguageIdByMimeType(i)||i,r=this._getNestedEmbeddedLanguageData(s);if(h<a){const i=e.substr(h);return this._nestedTokenize(i,t,kIe.create(d,r),n+h,o)}return kIe.create(d,r)};if(Array.isArray(C)){if(c&&c.groups.length>0)throw bIe(this._lexer,"groups cannot be nested: "+this._safeRuleName(b));if(f.length!==C.length+1)throw bIe(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(b));let e=0;for(let t=1;t<f.length;t++)e+=f[t].length;if(e!==_.length)throw bIe(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(b));c={rule:b,matches:f,groups:[]};for(let e=0;e<C.length;e++)c.groups[e]={action:C[e],matched:f[e+1]};h-=_.length}else{{if("@rematch"===C&&(h-=_.length,_="",f=null,C="",null!==w))return y(w);if(0===_.length){if(0===a||g!==d.depth||m!==d.state||(c?c.groups.length:0)!==p)continue;throw bIe(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(b))}let e=null;if(gIe(C)&&0===C.indexOf("@brackets")){const t=C.substr(9),i=IIe(this._lexer,_);if(!i)throw bIe(this._lexer,"@brackets token returned but no bracket defined as: "+_);e=_Ie(i.token+t)}else e=_Ie(""===C?"":C+this._lexer.tokenPostfix);i<s&&o.emit(i+n,e)}if(null!==w)return y(w)}}return kIe.create(d,l)}_getNestedEmbeddedLanguageData(e){if(!this._languageService.isRegisteredLanguageId(e))return new xIe(e,CDe);e!==this._languageId&&(Eye.getOrCreate(e),this._embeddedLanguages[e]=!0);const t=Eye.get(e);return new xIe(e,t?t.getInitialState():CDe)}};function IIe(e,t){if(!t)return null;t=fIe(e,t);const i=e.brackets;for(const e of i){if(e.open===t)return{token:e.token,bracketType:1};if(e.close===t)return{token:e.token,bracketType:-1}}return null}NIe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(4,SLe)],NIe);var TIe;const MIe=null===(TIe=window.trustedTypes)||void 0===TIe?void 0:TIe.createPolicy("standaloneColorizer",{createHTML:e=>e});class AIe{static colorizeElement(e,t,i,n){const o=(n=n||{}).theme||"vs",s=n.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!s)return console.error("Mode not detected"),Promise.resolve();const r=t.getLanguageIdByMimeType(s)||s;e.setTheme(o);const a=i.firstChild?i.firstChild.nodeValue:"";return i.className+=" "+o,this.colorize(t,a||"",r,n).then((e=>{var t;const n=null!==(t=null==MIe?void 0:MIe.createHTML(e))&&void 0!==t?t:e;i.innerHTML=n}),(e=>console.error(e)))}static colorize(e,t,i,n){return o=this,s=void 0,a=function*(){const o=e.languageIdCodec;let s=4;n&&"number"==typeof n.tabSize&&(s=n.tabSize),sxe(t)&&(t=t.substr(1));const r=DSe(t);if(!e.isRegisteredLanguageId(i))return RIe(r,s,o);const a=yield Eye.getOrCreate(i);return a?function(e,t,i,n){return new Promise(((o,s)=>{const r=()=>{const a=function(e,t,i,n){let o=[],s=i.getInitialState();for(let r=0,a=e.length;r<a;r++){const a=e[r],l=i.tokenizeEncoded(a,!0,s);HNe.convertToEndOffset(l.tokens,a.length);const d=new HNe(l.tokens,a,n),h=lIe.isBasicASCII(a,!0),c=lIe.containsRTL(a,h,!0),u=tIe(new ZNe(!1,!0,a,!1,h,c,0,d.inflate(),[],t,0,0,0,0,-1,"none",!1,!1,null));o=o.concat(u.html),o.push("<br/>"),s=l.endState}return o.join("")}(e,t,i,n);if(i instanceof NIe){const e=i.getLoadStatus();if(!1===e.loaded)return void e.promise.then(r,s)}o(a)};r()}))}(r,s,a,o):RIe(r,s,o)},new((r=void 0)||(r=Promise))((function(e,t){function i(e){try{l(a.next(e))}catch(e){t(e)}}function n(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var o;t.done?e(t.value):(o=t.value,o instanceof r?o:new r((function(e){e(o)}))).then(i,n)}l((a=a.apply(o,s||[])).next())}));var o,s,r,a}static colorizeLine(e,t,i,n,o=4){const s=lIe.isBasicASCII(e,t),r=lIe.containsRTL(e,s,i);return tIe(new ZNe(!1,!0,e,!1,s,r,0,n,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,i=4){const n=e.getLineContent(t);e.tokenization.forceTokenization(t);const o=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),o,i)}}function RIe(e,t,i){let n=[];const o=new Uint32Array(2);o[0]=0,o[1]=33587200;for(let s=0,r=e.length;s<r;s++){const r=e[s];o[0]=r.length;const a=new HNe(o,r,i),l=lIe.isBasicASCII(r,!0),d=lIe.containsRTL(r,l,!0),h=tIe(new ZNe(!1,!0,r,!1,l,d,0,a,[],t,0,0,0,0,-1,"none",!1,!1,null));n=n.concat(h.html),n.push("<br/>")}return n.join("")}Nve||document.queryCommandSupported&&document.queryCommandSupported("copy")||navigator&&navigator.clipboard&&navigator.clipboard.writeText,Nve||navigator&&navigator.clipboard&&navigator.clipboard.readText,Nve||Dxe()||navigator.keyboard,"ontouchstart"in window||navigator.maxTouchPoints;const OIe=window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0);function PIe(e,t){if(0===e)return null;const i=(65535&e)>>>0,n=(4294901760&e)>>>16;return new WIe(0!==n?[FIe(i,t),FIe(n,t)]:[FIe(i,t)])}function FIe(e,t){const i=!!(2048&e),n=!!(256&e);return new BIe(2===t?n:i,!!(1024&e),!!(512&e),2===t?i:n,255&e)}class BIe{constructor(e,t,i,n,o){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyCode=o}equals(e){return e instanceof BIe&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}isModifierKey(){return 0===this.keyCode||5===this.keyCode||57===this.keyCode||6===this.keyCode||4===this.keyCode}isDuplicateModifierCase(){return this.ctrlKey&&5===this.keyCode||this.shiftKey&&4===this.keyCode||this.altKey&&6===this.keyCode||this.metaKey&&57===this.keyCode}}class WIe{constructor(e){if(0===e.length)throw Lwe("chords");this.chords=e}}class VIe{constructor(e,t,i,n,o,s){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyLabel=o,this.keyAriaLabel=s}}class HIe{}const zIe=Dve?256:2048,UIe=Dve?2048:256;class KIe{constructor(e){this._standardKeyboardEventBrand=!0;const t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState("AltGraph"),this.keyCode=function(e){if(e.charCode){const t=String.fromCharCode(e.charCode).toUpperCase();return _Ce.fromString(t)}const t=e.keyCode;if(3===t)return 7;if(bxe){if(59===t)return 80;if(107===t)return 81;if(109===t)return 83;if(Dve&&224===t)return 57}else if(wxe){if(91===t)return 57;if(Dve&&93===t)return 57;if(!Dve&&92===t)return 57}return hCe[t]||0}(t),this.code=t.code,this.ctrlKey=this.ctrlKey||5===this.keyCode,this.altKey=this.altKey||6===this.keyCode,this.shiftKey=this.shiftKey||4===this.keyCode,this.metaKey=this.metaKey||57===this.keyCode,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=zIe),this.altKey&&(t|=512),this.shiftKey&&(t|=1024),this.metaKey&&(t|=UIe),t|=e,t}_computeKeyCodeChord(){let e=0;return 5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode),new BIe(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let jIe=!1,qIe=null;function $Ie(e){if(!e.parent||e.parent===e)return null;try{const t=e.location,i=e.parent.location;if("null"!==t.origin&&"null"!==i.origin&&t.origin!==i.origin)return jIe=!0,null}catch(e){return jIe=!0,null}return e.parent}class GIe{static getSameOriginWindowChain(){if(!qIe){qIe=[];let e,t=window;do{e=$Ie(t),e?qIe.push({window:t,iframeElement:t.frameElement||null}):qIe.push({window:t,iframeElement:null}),t=e}while(t)}return qIe.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,n=0;const o=this.getSameOriginWindowChain();for(const e of o){if(i+=e.window.scrollY,n+=e.window.scrollX,e.window===t)break;if(!e.iframeElement)break;const o=e.iframeElement.getBoundingClientRect();i+=o.top,n+=o.left}return{top:i,left:n}}}class ZIe{constructor(e){this.timestamp=Date.now(),this.browserEvent=e,this.leftButton=0===e.button,this.middleButton=1===e.button,this.rightButton=2===e.button,this.buttons=e.buttons,this.target=e.target,this.detail=e.detail||1,"dblclick"===e.type&&(this.detail=2),this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,"number"==typeof e.pageX?(this.posx=e.pageX,this.posy=e.pageY):(this.posx=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,this.posy=e.clientY+document.body.scrollTop+document.documentElement.scrollTop);const t=GIe.getPositionOfChildWindowRelativeToAncestorWindow(self,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class YIe{constructor(e,t=0,i=0){if(this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t,e){const t=e,i=e;if(void 0!==t.wheelDeltaY)this.deltaY=t.wheelDeltaY/120;else if(void 0!==i.VERTICAL_AXIS&&i.axis===i.VERTICAL_AXIS)this.deltaY=-i.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?this.deltaY=bxe&&!Dve?-e.deltaY/3:-e.deltaY:this.deltaY=-e.deltaY/40}if(void 0!==t.wheelDeltaX)this.deltaX=yxe&&Lve?-t.wheelDeltaX/120:t.wheelDeltaX/120;else if(void 0!==i.HORIZONTAL_AXIS&&i.axis===i.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?this.deltaX=bxe&&!Dve?-e.deltaX/3:-e.deltaX:this.deltaX=-e.deltaX/40}0===this.deltaY&&0===this.deltaX&&e.wheelDelta&&(this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;null===(e=this.browserEvent)||void 0===e||e.preventDefault()}stopPropagation(){var e;null===(e=this.browserEvent)||void 0===e||e.stopPropagation()}}var QIe=Object.hasOwnProperty,XIe=Object.setPrototypeOf,JIe=Object.isFrozen,eTe=Object.getPrototypeOf,tTe=Object.getOwnPropertyDescriptor,iTe=Object.freeze,nTe=Object.seal,oTe=Object.create,sTe="undefined"!=typeof Reflect&&Reflect,rTe=sTe.apply,aTe=sTe.construct;rTe||(rTe=function(e,t,i){return e.apply(t,i)}),iTe||(iTe=function(e){return e}),nTe||(nTe=function(e){return e}),aTe||(aTe=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}(t))))});var lTe=vTe(Array.prototype.forEach),dTe=vTe(Array.prototype.pop),hTe=vTe(Array.prototype.push),cTe=vTe(String.prototype.toLowerCase),uTe=vTe(String.prototype.match),gTe=vTe(String.prototype.replace),pTe=vTe(String.prototype.indexOf),mTe=vTe(String.prototype.trim),fTe=vTe(RegExp.prototype.test),_Te=function(e){return function(){for(var t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];return aTe(e,i)}}(TypeError);function vTe(e){return function(t){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];return rTe(e,t,n)}}function bTe(e,t){XIe&&XIe(e,null);for(var i=t.length;i--;){var n=t[i];if("string"==typeof n){var o=cTe(n);o!==n&&(JIe(t)||(t[i]=o),n=o)}e[n]=!0}return e}function wTe(e){var t=oTe(null),i=void 0;for(i in e)rTe(QIe,e,[i])&&(t[i]=e[i]);return t}function CTe(e,t){for(;null!==e;){var i=tTe(e,t);if(i){if(i.get)return vTe(i.get);if("function"==typeof i.value)return vTe(i.value)}e=eTe(e)}return function(e){return console.warn("fallback value for",e),null}}var yTe=iTe(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),STe=iTe(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),xTe=iTe(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),kTe=iTe(["animate","color-profile","cursor","discard","fedropshadow","feimage","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),LTe=iTe(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),DTe=iTe(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ETe=iTe(["#text"]),NTe=iTe(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),ITe=iTe(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),TTe=iTe(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),MTe=iTe(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ATe=nTe(/\{\{[\s\S]*|[\s\S]*\}\}/gm),RTe=nTe(/<%[\s\S]*|[\s\S]*%>/gm),OTe=nTe(/^data-[\-\w.\u00B7-\uFFFF]/),PTe=nTe(/^aria-[\-\w]+$/),FTe=nTe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),BTe=nTe(/^(?:\w+script|data):/i),WTe=nTe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),VTe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function HTe(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}var zTe=function(){return"undefined"==typeof window?null:window},UTe=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zTe(),i=function(t){return e(t)};if(i.version="2.3.1",i.removed=[],!t||!t.document||9!==t.document.nodeType)return i.isSupported=!1,i;var n=t.document,o=t.document,s=t.DocumentFragment,r=t.HTMLTemplateElement,a=t.Node,l=t.Element,d=t.NodeFilter,h=t.NamedNodeMap,c=void 0===h?t.NamedNodeMap||t.MozNamedAttrMap:h,u=t.Text,g=t.Comment,p=t.DOMParser,m=t.trustedTypes,f=l.prototype,_=CTe(f,"cloneNode"),v=CTe(f,"nextSibling"),b=CTe(f,"childNodes"),w=CTe(f,"parentNode");if("function"==typeof r){var C=o.createElement("template");C.content&&C.content.ownerDocument&&(o=C.content.ownerDocument)}var y=function(e,t){if("object"!==(void 0===e?"undefined":VTe(e))||"function"!=typeof e.createPolicy)return null;var i=null,n="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(n)&&(i=t.currentScript.getAttribute(n));var o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(m,n),S=y&&te?y.createHTML(""):"",x=o,k=x.implementation,L=x.createNodeIterator,D=x.createDocumentFragment,E=x.getElementsByTagName,N=n.importNode,I={};try{I=wTe(o).documentMode?o.documentMode:{}}catch(e){}var T={};i.isSupported="function"==typeof w&&k&&void 0!==k.createHTMLDocument&&9!==I;var M=ATe,A=RTe,R=OTe,O=PTe,P=BTe,F=WTe,B=FTe,W=null,V=bTe({},[].concat(HTe(yTe),HTe(STe),HTe(xTe),HTe(LTe),HTe(ETe))),H=null,z=bTe({},[].concat(HTe(NTe),HTe(ITe),HTe(TTe),HTe(MTe))),U=null,K=null,j=!0,q=!0,$=!1,G=!1,Z=!1,Y=!1,Q=!1,X=!1,J=!1,ee=!0,te=!1,ie=!0,ne=!0,oe=!1,se={},re=null,ae=bTe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),le=null,de=bTe({},["audio","video","img","source","image","track"]),he=null,ce=bTe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ue="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",pe="http://www.w3.org/1999/xhtml",me=pe,fe=!1,_e=null,ve=o.createElement("form"),be=function(e){_e&&_e===e||(e&&"object"===(void 0===e?"undefined":VTe(e))||(e={}),e=wTe(e),W="ALLOWED_TAGS"in e?bTe({},e.ALLOWED_TAGS):V,H="ALLOWED_ATTR"in e?bTe({},e.ALLOWED_ATTR):z,he="ADD_URI_SAFE_ATTR"in e?bTe(wTe(ce),e.ADD_URI_SAFE_ATTR):ce,le="ADD_DATA_URI_TAGS"in e?bTe(wTe(de),e.ADD_DATA_URI_TAGS):de,re="FORBID_CONTENTS"in e?bTe({},e.FORBID_CONTENTS):ae,U="FORBID_TAGS"in e?bTe({},e.FORBID_TAGS):{},K="FORBID_ATTR"in e?bTe({},e.FORBID_ATTR):{},se="USE_PROFILES"in e&&e.USE_PROFILES,j=!1!==e.ALLOW_ARIA_ATTR,q=!1!==e.ALLOW_DATA_ATTR,$=e.ALLOW_UNKNOWN_PROTOCOLS||!1,G=e.SAFE_FOR_TEMPLATES||!1,Z=e.WHOLE_DOCUMENT||!1,X=e.RETURN_DOM||!1,J=e.RETURN_DOM_FRAGMENT||!1,ee=!1!==e.RETURN_DOM_IMPORT,te=e.RETURN_TRUSTED_TYPE||!1,Q=e.FORCE_BODY||!1,ie=!1!==e.SANITIZE_DOM,ne=!1!==e.KEEP_CONTENT,oe=e.IN_PLACE||!1,B=e.ALLOWED_URI_REGEXP||B,me=e.NAMESPACE||pe,G&&(q=!1),J&&(X=!0),se&&(W=bTe({},[].concat(HTe(ETe))),H=[],!0===se.html&&(bTe(W,yTe),bTe(H,NTe)),!0===se.svg&&(bTe(W,STe),bTe(H,ITe),bTe(H,MTe)),!0===se.svgFilters&&(bTe(W,xTe),bTe(H,ITe),bTe(H,MTe)),!0===se.mathMl&&(bTe(W,LTe),bTe(H,TTe),bTe(H,MTe))),e.ADD_TAGS&&(W===V&&(W=wTe(W)),bTe(W,e.ADD_TAGS)),e.ADD_ATTR&&(H===z&&(H=wTe(H)),bTe(H,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&bTe(he,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(re===ae&&(re=wTe(re)),bTe(re,e.FORBID_CONTENTS)),ne&&(W["#text"]=!0),Z&&bTe(W,["html","head","body"]),W.table&&(bTe(W,["tbody"]),delete U.tbody),iTe&&iTe(e),_e=e)},we=bTe({},["mi","mo","mn","ms","mtext"]),Ce=bTe({},["foreignobject","desc","title","annotation-xml"]),ye=bTe({},STe);bTe(ye,xTe),bTe(ye,kTe);var Se=bTe({},LTe);bTe(Se,DTe);var xe=function(e){hTe(i.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=S}catch(t){e.remove()}}},ke=function(e,t){try{hTe(i.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){hTe(i.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!H[e])if(X||J)try{xe(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Le=function(e){var t=void 0,i=void 0;if(Q)e="<remove></remove>"+e;else{var n=uTe(e,/^[\r\n\t ]+/);i=n&&n[0]}var s=y?y.createHTML(e):e;if(me===pe)try{t=(new p).parseFromString(s,"text/html")}catch(e){}if(!t||!t.documentElement){t=k.createDocument(me,"template",null);try{t.documentElement.innerHTML=fe?"":s}catch(e){}}var r=t.body||t.documentElement;return e&&i&&r.insertBefore(o.createTextNode(i),r.childNodes[0]||null),me===pe?E.call(t,Z?"html":"body")[0]:Z?t.documentElement:r},De=function(e){return L.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT,null,!1)},Ee=function(e){return"object"===(void 0===a?"undefined":VTe(a))?e instanceof a:e&&"object"===(void 0===e?"undefined":VTe(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Ne=function(e,t,n){T[e]&&lTe(T[e],(function(e){e.call(i,t,n,_e)}))},Ie=function(e){var t,n=void 0;if(Ne("beforeSanitizeElements",e,null),!((t=e)instanceof u||t instanceof g||"string"==typeof t.nodeName&&"string"==typeof t.textContent&&"function"==typeof t.removeChild&&t.attributes instanceof c&&"function"==typeof t.removeAttribute&&"function"==typeof t.setAttribute&&"string"==typeof t.namespaceURI&&"function"==typeof t.insertBefore))return xe(e),!0;if(uTe(e.nodeName,/[\u0080-\uFFFF]/))return xe(e),!0;var o=cTe(e.nodeName);if(Ne("uponSanitizeElement",e,{tagName:o,allowedTags:W}),!Ee(e.firstElementChild)&&(!Ee(e.content)||!Ee(e.content.firstElementChild))&&fTe(/<[/\w]/g,e.innerHTML)&&fTe(/<[/\w]/g,e.textContent))return xe(e),!0;if("select"===o&&fTe(/<template/i,e.innerHTML))return xe(e),!0;if(!W[o]||U[o]){if(ne&&!re[o]){var s=w(e)||e.parentNode,r=b(e)||e.childNodes;if(r&&s)for(var a=r.length-1;a>=0;--a)s.insertBefore(_(r[a],!0),v(e))}return xe(e),!0}return e instanceof l&&!function(e){var t=w(e);t&&t.tagName||(t={namespaceURI:pe,tagName:"template"});var i=cTe(e.tagName),n=cTe(t.tagName);if(e.namespaceURI===ge)return t.namespaceURI===pe?"svg"===i:t.namespaceURI===ue?"svg"===i&&("annotation-xml"===n||we[n]):Boolean(ye[i]);if(e.namespaceURI===ue)return t.namespaceURI===pe?"math"===i:t.namespaceURI===ge?"math"===i&&Ce[n]:Boolean(Se[i]);if(e.namespaceURI===pe){if(t.namespaceURI===ge&&!Ce[n])return!1;if(t.namespaceURI===ue&&!we[n])return!1;var o=bTe({},["title","style","font","a","script"]);return!Se[i]&&(o[i]||!ye[i])}return!1}(e)?(xe(e),!0):"noscript"!==o&&"noembed"!==o||!fTe(/<\/no(script|embed)/i,e.innerHTML)?(G&&3===e.nodeType&&(n=e.textContent,n=gTe(n,M," "),n=gTe(n,A," "),e.textContent!==n&&(hTe(i.removed,{element:e.cloneNode()}),e.textContent=n)),Ne("afterSanitizeElements",e,null),!1):(xe(e),!0)},Te=function(e,t,i){if(ie&&("id"===t||"name"===t)&&(i in o||i in ve))return!1;if(q&&!K[t]&&fTe(R,t));else if(j&&fTe(O,t));else{if(!H[t]||K[t])return!1;if(he[t]);else if(fTe(B,gTe(i,F,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==pTe(i,"data:")||!le[e])if($&&!fTe(P,gTe(i,F,"")));else if(i)return!1}return!0},Me=function(e){var t=void 0,n=void 0,o=void 0,s=void 0;Ne("beforeSanitizeAttributes",e,null);var r=e.attributes;if(r){var a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:H};for(s=r.length;s--;){var l=t=r[s],d=l.name,h=l.namespaceURI;if(n=mTe(t.value),o=cTe(d),a.attrName=o,a.attrValue=n,a.keepAttr=!0,a.forceKeepAttr=void 0,Ne("uponSanitizeAttribute",e,a),n=a.attrValue,!a.forceKeepAttr&&(ke(d,e),a.keepAttr))if(fTe(/\/>/i,n))ke(d,e);else{G&&(n=gTe(n,M," "),n=gTe(n,A," "));var c=e.nodeName.toLowerCase();if(Te(c,o,n))try{h?e.setAttributeNS(h,d,n):e.setAttribute(d,n),dTe(i.removed)}catch(e){}}}Ne("afterSanitizeAttributes",e,null)}},Ae=function e(t){var i=void 0,n=De(t);for(Ne("beforeSanitizeShadowDOM",t,null);i=n.nextNode();)Ne("uponSanitizeShadowNode",i,null),Ie(i)||(i.content instanceof s&&e(i.content),Me(i));Ne("afterSanitizeShadowDOM",t,null)};return i.sanitize=function(e,o){var r=void 0,l=void 0,d=void 0,h=void 0,c=void 0;if((fe=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ee(e)){if("function"!=typeof e.toString)throw _Te("toString is not a function");if("string"!=typeof(e=e.toString()))throw _Te("dirty is not a string, aborting")}if(!i.isSupported){if("object"===VTe(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(Ee(e))return t.toStaticHTML(e.outerHTML)}return e}if(Y||be(o),i.removed=[],"string"==typeof e&&(oe=!1),oe);else if(e instanceof a)1===(l=(r=Le("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?r=l:r.appendChild(l);else{if(!X&&!G&&!Z&&-1===e.indexOf("<"))return y&&te?y.createHTML(e):e;if(!(r=Le(e)))return X?null:S}r&&Q&&xe(r.firstChild);for(var u=De(oe?e:r);d=u.nextNode();)3===d.nodeType&&d===h||Ie(d)||(d.content instanceof s&&Ae(d.content),Me(d),h=d);if(h=null,oe)return e;if(X){if(J)for(c=D.call(r.ownerDocument);r.firstChild;)c.appendChild(r.firstChild);else c=r;return ee&&(c=N.call(n,c,!0)),c}var g=Z?r.outerHTML:r.innerHTML;return G&&(g=gTe(g,M," "),g=gTe(g,A," ")),y&&te?y.createHTML(g):g},i.setConfig=function(e){be(e),Y=!0},i.clearConfig=function(){_e=null,Y=!1},i.isValidAttribute=function(e,t,i){_e||be({});var n=cTe(e),o=cTe(t);return Te(n,o,i)},i.addHook=function(e,t){"function"==typeof t&&(T[e]=T[e]||[],hTe(T[e],t))},i.removeHook=function(e){T[e]&&dTe(T[e])},i.removeHooks=function(e){T[e]&&(T[e]=[])},i.removeAllHooks=function(){T={}},i}();UTe.version,UTe.isSupported;const KTe=UTe.sanitize,jTe=(UTe.setConfig,UTe.clearConfig,UTe.isValidAttribute,UTe.addHook),qTe=UTe.removeHook;var $Te;UTe.removeHooks,UTe.removeAllHooks,function(e){e.inMemory="inmemory",e.vscode="vscode",e.internal="private",e.walkThrough="walkThrough",e.walkThroughSnippet="walkThroughSnippet",e.http="http",e.https="https",e.file="file",e.mailto="mailto",e.untitled="untitled",e.data="data",e.command="command",e.vscodeRemote="vscode-remote",e.vscodeRemoteResource="vscode-remote-resource",e.vscodeUserData="vscode-userdata",e.vscodeCustomEditor="vscode-custom-editor",e.vscodeNotebookCell="vscode-notebook-cell",e.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",e.vscodeNotebookCellOutput="vscode-notebook-cell-output",e.vscodeInteractive="vscode-interactive",e.vscodeInteractiveInput="vscode-interactive-input",e.vscodeSettings="vscode-settings",e.vscodeWorkspaceTrust="vscode-workspace-trust",e.vscodeTerminal="vscode-terminal",e.webviewPanel="webview-panel",e.vscodeWebview="vscode-webview",e.extension="extension",e.vscodeFileResource="vscode-file",e.tmp="tmp",e.vsls="vsls",e.vscodeSourceControl="vscode-scm"}($Te||($Te={}));const GTe=new class{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${$Te.vscodeRemoteResource}`}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(t){return wwe(t),e}const t=e.authority;let i=this._hosts[t];i&&-1!==i.indexOf(":")&&-1===i.indexOf("[")&&(i=`[${i}]`);const n=this._ports[t],o=this._connectionTokens[t];let s=`path=${encodeURIComponent(e.path)}`;return"string"==typeof o&&(s+=`&tkn=${encodeURIComponent(o)}`),QCe.from({scheme:Ive?this._preferredWebSchema:$Te.vscodeRemoteResource,authority:`${i}:${n}`,path:this._remoteResourcesPath,query:s})}};class ZTe{uriToBrowserUri(e){return e.scheme===$Te.vscodeRemote?GTe.rewrite(e):e.scheme===$Te.file&&(Nve||Tve&&Cve.origin===`${$Te.vscodeFileResource}://${ZTe.FALLBACK_AUTHORITY}`)?e.with({scheme:$Te.vscodeFileResource,authority:e.authority||ZTe.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}ZTe.FALLBACK_AUTHORITY="vscode-app";const YTe=new ZTe;var QTe;function XTe(e){for(;e.firstChild;)e.firstChild.remove()}function JTe(e){var t;return null!==(t=null==e?void 0:e.isConnected)&&void 0!==t&&t}!function(e){const t=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);e.CoopAndCoep=Object.freeze(t.get("3"));const i="vscode-coi";e.getHeadersFromQuery=function(e){let n;"string"==typeof e?n=new URL(e).searchParams:e instanceof URL?n=e.searchParams:QCe.isUri(e)&&(n=new URL(e.toString(!0)).searchParams);const o=null==n?void 0:n.get(i);if(o)return t.get(o)},e.addSearchParam=function(e,t,n){if(!globalThis.crossOriginIsolated)return;const o=t&&n?"3":n?"2":"1";e instanceof URLSearchParams?e.set(i,o):e[i]=o}}(QTe||(QTe={}));class eMe{constructor(e,t,i,n){this._node=e,this._type=t,this._handler=i,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function tMe(e,t,i,n){return new eMe(e,t,i,n)}const iMe=function(e,t,i,n){let o=i;return"click"===t||"mousedown"===t?o=function(e){return function(t){return e(new ZIe(t))}}(i):"keydown"!==t&&"keypress"!==t&&"keyup"!==t||(o=function(e){return function(t){return e(new KIe(t))}}(i)),tMe(e,t,o,n)};let nMe,oMe;class sMe{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){wwe(e)}}static sort(e,t){return t.priority-e.priority}}function rMe(e){return document.defaultView.getComputedStyle(e,null)}function aMe(e){if(e!==document.body)return new dMe(e.clientWidth,e.clientHeight);if(Mve&&window.visualViewport)return new dMe(window.visualViewport.width,window.visualViewport.height);if(window.innerWidth&&window.innerHeight)return new dMe(window.innerWidth,window.innerHeight);if(document.body&&document.body.clientWidth&&document.body.clientHeight)return new dMe(document.body.clientWidth,document.body.clientHeight);if(document.documentElement&&document.documentElement.clientWidth&&document.documentElement.clientHeight)return new dMe(document.documentElement.clientWidth,document.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}!function(){let e=[],t=null,i=!1,n=!1;const o=()=>{for(i=!1,t=e,e=[],n=!0;t.length>0;)t.sort(sMe.sort),t.shift().execute();n=!1};oMe=(t,n=0)=>{const s=new sMe(t,n);return e.push(s),i||(i=!0,requestAnimationFrame(o)),s},nMe=(e,i)=>{if(n){const n=new sMe(e,i);return t.push(n),n}return oMe(e,i)}}();class lMe{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const n=rMe(e),o=n?n.getPropertyValue(t):"0";return lMe.convertToPixels(e,o)}static getBorderLeftWidth(e){return lMe.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return lMe.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return lMe.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return lMe.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return lMe.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return lMe.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return lMe.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return lMe.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return lMe.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return lMe.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return lMe.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return lMe.getDimension(e,"margin-bottom","marginBottom")}}class dMe{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new dMe(e,t):this}static is(e){return"object"==typeof e&&"number"==typeof e.height&&"number"==typeof e.width}static lift(e){return e instanceof dMe?e:new dMe(e.width,e.height)}static equals(e,t){return e===t||!(!e||!t)&&e.width===t.width&&e.height===t.height}}function hMe(e){const t=e.getBoundingClientRect();return{left:t.left+window.scrollX,top:t.top+window.scrollY,width:t.width,height:t.height}}function cMe(e){const t=lMe.getMarginLeft(e)+lMe.getMarginRight(e);return e.offsetWidth+t}function uMe(e){const t=lMe.getBorderLeftWidth(e)+lMe.getBorderRightWidth(e),i=lMe.getPaddingLeft(e)+lMe.getPaddingRight(e);return e.offsetWidth-t-i}function gMe(e){const t=lMe.getBorderTopWidth(e)+lMe.getBorderBottomWidth(e),i=lMe.getPaddingTop(e)+lMe.getPaddingBottom(e);return e.offsetHeight-t-i}function pMe(e){const t=lMe.getMarginTop(e)+lMe.getMarginBottom(e);return e.offsetHeight+t}function mMe(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function fMe(e,t,i){for(;e&&e.nodeType===e.ELEMENT_NODE;){if(e.classList.contains(t))return e;if(i)if("string"==typeof i){if(e.classList.contains(i))return null}else if(e===i)return null;e=e.parentNode}return null}function _Me(e,t,i){return!!fMe(e,t,i)}function vMe(e){return e&&!!e.host&&!!e.mode}function bMe(e){return!!wMe(e)}function wMe(e){for(;e.parentNode;){if(e===document.body)return null;e=e.parentNode}return vMe(e)?e:null}function CMe(){let e=document.activeElement;for(;null==e?void 0:e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function yMe(e=document.getElementsByTagName("head")[0]){const t=document.createElement("style");return t.type="text/css",t.media="screen",e.appendChild(t),t}dMe.None=new dMe(0,0);let SMe=null;function xMe(e,t,i=function(){return SMe||(SMe=yMe()),SMe}()){i&&t&&i.sheet.insertRule(e+"{"+t+"}",0)}function kMe(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName}const LMe={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:wxe?"webkitAnimationStart":"animationstart",ANIMATION_END:wxe?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:wxe?"webkitAnimationIteration":"animationiteration"},DMe=(e,t)=>(e.preventDefault(),t&&e.stopPropagation(),e);class EMe extends Owe{static hasFocusWithin(e){const t=wMe(e);return mMe(t?t.activeElement:document.activeElement,e)}constructor(e){super(),this._onDidFocus=this._register(new $we),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new $we),this.onDidBlur=this._onDidBlur.event;let t=EMe.hasFocusWithin(e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,window.setTimeout((()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())}),0))};this._refreshStateHandler=()=>{EMe.hasFocusWithin(e)!==t&&(t?o():n())},this._register(tMe(e,LMe.FOCUS,n,!0)),this._register(tMe(e,LMe.BLUR,o,!0)),this._register(tMe(e,LMe.FOCUS_IN,(()=>this._refreshStateHandler()))),this._register(tMe(e,LMe.FOCUS_OUT,(()=>this._refreshStateHandler())))}}function NMe(e){return new EMe(e)}function IMe(e,...t){if(e.append(...t),1===t.length&&"string"!=typeof t[0])return t[0]}function TMe(e,...t){e.innerText="",IMe(e,...t)}const MMe=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var AMe;function RMe(e,t,i,...n){const o=MMe.exec(t);if(!o)throw new Error("Bad use of emmet");const s=o[1]||"div";let r;return r=e!==AMe.HTML?document.createElementNS(e,s):document.createElement(s),o[3]&&(r.id=o[3]),o[4]&&(r.className=o[4].replace(/\./g," ").trim()),i&&Object.entries(i).forEach((([e,t])=>{void 0!==t&&(/^on\w+$/.test(e)?r[e]=t:"selected"===e?t&&r.setAttribute(e,"true"):r.setAttribute(e,t))})),r.append(...n),r}function OMe(e,t,...i){return RMe(AMe.HTML,e,t,...i)}function PMe(...e){for(const t of e)t.style.display="",t.removeAttribute("aria-hidden")}function FMe(...e){for(const t of e)t.style.display="none",t.setAttribute("aria-hidden","true")}function BMe(e){const t=window.devicePixelRatio*e;return Math.max(1,Math.floor(t))/window.devicePixelRatio}function WMe(e){window.open(e,"_blank","noopener")}function VMe(e){return e?`url('${YTe.uriToBrowserUri(e).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function HMe(e){return`'${e.replace(/'/g,"%27")}'`}function zMe(e,t){if(void 0!==e){const i=e.match(/^\s*var\((.+)\)$/);if(i){const e=i[1].split(",",2);return 2===e.length&&(t=zMe(e[1].trim(),t)),`var(${e[0]}, ${t})`}return e}return t}!function(e){e.HTML="http://www.w3.org/1999/xhtml",e.SVG="http://www.w3.org/2000/svg"}(AMe||(AMe={})),OMe.SVG=function(e,t,...i){return RMe(AMe.SVG,e,t,...i)},GTe.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");const UMe=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]);Object.freeze({ALLOWED_TAGS:["a","button","blockquote","code","div","h1","h2","h3","h4","h5","h6","hr","input","label","li","p","pre","select","small","span","strong","textarea","ul","ol"],ALLOWED_ATTR:["href","data-href","data-command","target","title","name","src","alt","class","id","role","tabindex","style","data-code","width","height","align","x-dispatch","required","checked","placeholder","type"],RETURN_DOM:!1,RETURN_DOM_FRAGMENT:!1,RETURN_TRUSTED_TYPE:!0});class KMe extends $we{constructor(){super(),this._subscriptions=new Rwe,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(tMe(window,"keydown",(e=>{if(e.defaultPrevented)return;const t=new KIe(e);if(6!==t.keyCode||!e.repeat){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else{if(6===t.keyCode)return;this._keyStatus.lastKeyPressed=void 0}this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}}),!0)),this._subscriptions.add(tMe(window,"keyup",(e=>{e.defaultPrevented||(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))}),!0)),this._subscriptions.add(tMe(document.body,"mousedown",(()=>{this._keyStatus.lastKeyPressed=void 0}),!0)),this._subscriptions.add(tMe(document.body,"mouseup",(()=>{this._keyStatus.lastKeyPressed=void 0}),!0)),this._subscriptions.add(tMe(document.body,"mousemove",(e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)}),!0)),this._subscriptions.add(tMe(window,"blur",(()=>{this.resetKeyStatus()})))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return KMe.instance||(KMe.instance=new KMe),KMe.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class jMe extends Owe{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this._register(tMe(this.element,LMe.DRAG_ENTER,(e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter(e)}))),this._register(tMe(this.element,LMe.DRAG_OVER,(e=>{var t,i;e.preventDefault(),null===(i=(t=this.callbacks).onDragOver)||void 0===i||i.call(t,e,e.timeStamp-this.dragStartTime)}))),this._register(tMe(this.element,LMe.DRAG_LEAVE,(e=>{this.counter--,0===this.counter&&(this.dragStartTime=0,this.callbacks.onDragLeave(e))}))),this._register(tMe(this.element,LMe.DRAG_END,(e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd(e)}))),this._register(tMe(this.element,LMe.DROP,(e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop(e)})))}}var qMe=i(4072),$Me={};let GMe,ZMe,YMe,QMe,XMe;function JMe(e){GMe&&(ZMe.textContent!==e?(XTe(YMe),tAe(ZMe,e)):(XTe(ZMe),tAe(YMe,e)))}function eAe(e){GMe&&(Dve?JMe(e):QMe.textContent!==e?(XTe(XMe),tAe(QMe,e)):(XTe(QMe),tAe(XMe,e)))}function tAe(e,t){XTe(e),t.length>2e4&&(t=t.substr(0,2e4)),e.textContent=t,e.style.visibility="hidden",e.style.visibility="visible"}$Me.styleTagTransform=zl(),$Me.setAttributes=Bl(),$Me.insert=Pl().bind(null,"head"),$Me.domAPI=Rl(),$Me.insertStyleElement=Vl(),Ml()(qMe.A,$Me),qMe.A&&qMe.A.locals&&qMe.A.locals;const iAe=zxe("markerDecorationsService"),nAe=zxe("textModelService");var oAe,sAe,rAe=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class aAe extends Owe{constructor(e,t="",i="",n=!0,o){super(),this._onDidChange=this._register(new $we),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=n,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}run(e,t){return rAe(this,void 0,void 0,(function*(){this._actionCallback&&(yield this._actionCallback(e))}))}}class lAe extends Owe{constructor(){super(...arguments),this._onWillRun=this._register(new $we),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new $we),this.onDidRun=this._onDidRun.event}run(e,t){return rAe(this,void 0,void 0,(function*(){if(!e.enabled)return;let i;this._onWillRun.fire({action:e});try{yield this.runAction(e,t)}catch(e){i=e}this._onDidRun.fire({action:e,error:i})}))}runAction(e,t){return rAe(this,void 0,void 0,(function*(){yield e.run(t)}))}}class dAe{constructor(){this.id=dAe.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const i of e)i.length&&(t=t.length?[...t,new dAe,...i]:i);return t}run(){return rAe(this,void 0,void 0,(function*(){}))}}dAe.ID="vs.actions.separator";class hAe{get actions(){return this._actions}constructor(e,t,i,n){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=n,this._actions=i}run(){return rAe(this,void 0,void 0,(function*(){}))}}class cAe extends aAe{constructor(){super(cAe.ID,ove(0,"(empty)"),void 0,!1)}}function uAe(e){var t,i;return{id:e.id,label:e.label,class:void 0,enabled:null===(t=e.enabled)||void 0===t||t,checked:null!==(i=e.checked)&&void 0!==i&&i,run:()=>rAe(this,void 0,void 0,(function*(){return e.run()})),tooltip:e.label}}cAe.ID="vs.actions.empty",function(e){e.isThemeColor=function(e){return e&&"object"==typeof e&&"string"==typeof e.id}}(oAe||(oAe={})),function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9-]+",e.iconModifierExpression="~[A-Za-z]+",e.iconNameCharacter="[A-Za-z0-9~-]";const t=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function i(e){const n=t.exec(e.id);if(!n)return i(pye.error);const[,o,s]=n,r=["codicon","codicon-"+o];return s&&r.push("codicon-modifier-"+s.substring(1)),r}e.asClassNameArray=i,e.asClassName=function(e){return i(e).join(" ")},e.asCSSSelector=function(e){return"."+i(e).join(".")},e.isThemeIcon=function(e){return e&&"object"==typeof e&&"string"==typeof e.id&&(void 0===e.color||oAe.isThemeColor(e.color))};const n=new RegExp(`^\\$\\((${e.iconNameExpression}(?:${e.iconModifierExpression})?)\\)$`);e.fromString=function(e){const t=n.exec(e);if(!t)return;const[,i]=t;return{id:i}},e.fromId=function(e){return{id:e}},e.modify=function(e,t){let i=e.id;const n=i.lastIndexOf("~");return-1!==n&&(i=i.substring(0,n)),t&&(i=`${i}~${t}`),{id:i}},e.getModifier=function(e){const t=e.id.lastIndexOf("~");if(-1!==t)return e.id.substring(t+1)},e.isEqual=function(e,t){var i,n;return e.id===t.id&&(null===(i=e.color)||void 0===i?void 0:i.id)===(null===(n=t.color)||void 0===n?void 0:n.id)}}(sAe||(sAe={}));const gAe=zxe("commandService"),pAe=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new $we,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,t){if(!e)throw new Error("invalid command");if("string"==typeof e){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t})}if(e.description){const t=[];for(const i of e.description.args)t.push(i.constraint);const i=e.handler;e.handler=function(e,...n){return function(e,t){const i=Math.min(e.length,t.length);for(let n=0;n<i;n++)Dbe(e[n],t[n])}(n,t),i(e,...n)}}const{id:i}=e;let n=this._commands.get(i);n||(n=new $ve,this._commands.set(i,n));const o=n.unshift(e),s=Awe((()=>{o();const e=this._commands.get(i);(null==e?void 0:e.isEmpty())&&this._commands.delete(i)}));return this._onDidRegisterCommand.fire(i),s}registerCommandAlias(e,t){return pAe.registerCommand(e,((e,...i)=>e.get(gAe).executeCommand(t,...i)))}getCommand(e){const t=this._commands.get(e);if(t&&!t.isEmpty())return jve.first(t)}getCommands(){const e=new Map;for(const t of this._commands.keys()){const i=this.getCommand(t);i&&e.set(t,i)}return e}};pAe.registerCommand("noop",(()=>{}));class mAe{constructor(){this._coreKeybindings=new $ve,this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(1===Fve){if(e&&e.win)return e.win}else if(2===Fve){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=mAe.bindToCurrentPlatform(e),i=new Rwe;if(t&&t.primary){const n=PIe(t.primary,Fve);n&&i.add(this._registerDefaultKeybinding(n,e.id,e.args,e.weight,0,e.when))}if(t&&Array.isArray(t.secondary))for(let n=0,o=t.secondary.length;n<o;n++){const o=PIe(t.secondary[n],Fve);o&&i.add(this._registerDefaultKeybinding(o,e.id,e.args,e.weight,-n-1,e.when))}return i}registerCommandAndKeybindingRule(e){return Mwe(this.registerKeybindingRule(e),pAe.registerCommand(e))}_registerDefaultKeybinding(e,t,i,n,o,s){const r=this._coreKeybindings.push({keybinding:e,command:t,commandArgs:i,when:s,weight1:n,weight2:o,extensionId:null,isBuiltinExtension:!1});return this._cachedMergedKeybindings=null,Awe((()=>{r(),this._cachedMergedKeybindings=null}))}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(_Ae)),this._cachedMergedKeybindings.slice(0)}}const fAe=new mAe;function _Ae(e,t){if(e.weight1!==t.weight1)return e.weight1-t.weight1;if(e.command&&t.command){if(e.command<t.command)return-1;if(e.command>t.command)return 1}return e.weight2-t.weight2}RLe.add("platform.keybindingsRegistry",fAe);var vAe=function(e,t){return function(i,n){t(i,n,e)}};function bAe(e){return void 0!==e.command}class wAe{constructor(e){if(wAe._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);wAe._instances.set(e,this),this.id=e}}wAe._instances=new Map,wAe.CommandPalette=new wAe("CommandPalette"),wAe.DebugBreakpointsContext=new wAe("DebugBreakpointsContext"),wAe.DebugCallStackContext=new wAe("DebugCallStackContext"),wAe.DebugConsoleContext=new wAe("DebugConsoleContext"),wAe.DebugVariablesContext=new wAe("DebugVariablesContext"),wAe.DebugWatchContext=new wAe("DebugWatchContext"),wAe.DebugToolBar=new wAe("DebugToolBar"),wAe.DebugToolBarStop=new wAe("DebugToolBarStop"),wAe.EditorContext=new wAe("EditorContext"),wAe.SimpleEditorContext=new wAe("SimpleEditorContext"),wAe.EditorContent=new wAe("EditorContent"),wAe.EditorContextCopy=new wAe("EditorContextCopy"),wAe.EditorContextPeek=new wAe("EditorContextPeek"),wAe.EditorContextShare=new wAe("EditorContextShare"),wAe.EditorTitle=new wAe("EditorTitle"),wAe.EditorTitleRun=new wAe("EditorTitleRun"),wAe.EditorTitleContext=new wAe("EditorTitleContext"),wAe.EmptyEditorGroup=new wAe("EmptyEditorGroup"),wAe.EmptyEditorGroupContext=new wAe("EmptyEditorGroupContext"),wAe.ExplorerContext=new wAe("ExplorerContext"),wAe.ExtensionContext=new wAe("ExtensionContext"),wAe.GlobalActivity=new wAe("GlobalActivity"),wAe.CommandCenter=new wAe("CommandCenter"),wAe.LayoutControlMenuSubmenu=new wAe("LayoutControlMenuSubmenu"),wAe.LayoutControlMenu=new wAe("LayoutControlMenu"),wAe.MenubarMainMenu=new wAe("MenubarMainMenu"),wAe.MenubarAppearanceMenu=new wAe("MenubarAppearanceMenu"),wAe.MenubarDebugMenu=new wAe("MenubarDebugMenu"),wAe.MenubarEditMenu=new wAe("MenubarEditMenu"),wAe.MenubarCopy=new wAe("MenubarCopy"),wAe.MenubarFileMenu=new wAe("MenubarFileMenu"),wAe.MenubarGoMenu=new wAe("MenubarGoMenu"),wAe.MenubarHelpMenu=new wAe("MenubarHelpMenu"),wAe.MenubarLayoutMenu=new wAe("MenubarLayoutMenu"),wAe.MenubarNewBreakpointMenu=new wAe("MenubarNewBreakpointMenu"),wAe.PanelAlignmentMenu=new wAe("PanelAlignmentMenu"),wAe.PanelPositionMenu=new wAe("PanelPositionMenu"),wAe.MenubarPreferencesMenu=new wAe("MenubarPreferencesMenu"),wAe.MenubarRecentMenu=new wAe("MenubarRecentMenu"),wAe.MenubarSelectionMenu=new wAe("MenubarSelectionMenu"),wAe.MenubarShare=new wAe("MenubarShare"),wAe.MenubarSwitchEditorMenu=new wAe("MenubarSwitchEditorMenu"),wAe.MenubarSwitchGroupMenu=new wAe("MenubarSwitchGroupMenu"),wAe.MenubarTerminalMenu=new wAe("MenubarTerminalMenu"),wAe.MenubarViewMenu=new wAe("MenubarViewMenu"),wAe.MenubarHomeMenu=new wAe("MenubarHomeMenu"),wAe.OpenEditorsContext=new wAe("OpenEditorsContext"),wAe.ProblemsPanelContext=new wAe("ProblemsPanelContext"),wAe.SCMChangeContext=new wAe("SCMChangeContext"),wAe.SCMResourceContext=new wAe("SCMResourceContext"),wAe.SCMResourceFolderContext=new wAe("SCMResourceFolderContext"),wAe.SCMResourceGroupContext=new wAe("SCMResourceGroupContext"),wAe.SCMSourceControl=new wAe("SCMSourceControl"),wAe.SCMTitle=new wAe("SCMTitle"),wAe.SearchContext=new wAe("SearchContext"),wAe.SearchActionMenu=new wAe("SearchActionContext"),wAe.StatusBarWindowIndicatorMenu=new wAe("StatusBarWindowIndicatorMenu"),wAe.StatusBarRemoteIndicatorMenu=new wAe("StatusBarRemoteIndicatorMenu"),wAe.StickyScrollContext=new wAe("StickyScrollContext"),wAe.TestItem=new wAe("TestItem"),wAe.TestItemGutter=new wAe("TestItemGutter"),wAe.TestPeekElement=new wAe("TestPeekElement"),wAe.TestPeekTitle=new wAe("TestPeekTitle"),wAe.TouchBarContext=new wAe("TouchBarContext"),wAe.TitleBarContext=new wAe("TitleBarContext"),wAe.TitleBarTitleContext=new wAe("TitleBarTitleContext"),wAe.TunnelContext=new wAe("TunnelContext"),wAe.TunnelPrivacy=new wAe("TunnelPrivacy"),wAe.TunnelProtocol=new wAe("TunnelProtocol"),wAe.TunnelPortInline=new wAe("TunnelInline"),wAe.TunnelTitle=new wAe("TunnelTitle"),wAe.TunnelLocalAddressInline=new wAe("TunnelLocalAddressInline"),wAe.TunnelOriginInline=new wAe("TunnelOriginInline"),wAe.ViewItemContext=new wAe("ViewItemContext"),wAe.ViewContainerTitle=new wAe("ViewContainerTitle"),wAe.ViewContainerTitleContext=new wAe("ViewContainerTitleContext"),wAe.ViewTitle=new wAe("ViewTitle"),wAe.ViewTitleContext=new wAe("ViewTitleContext"),wAe.CommentEditorActions=new wAe("CommentEditorActions"),wAe.CommentThreadTitle=new wAe("CommentThreadTitle"),wAe.CommentThreadActions=new wAe("CommentThreadActions"),wAe.CommentThreadAdditionalActions=new wAe("CommentThreadAdditionalActions"),wAe.CommentThreadTitleContext=new wAe("CommentThreadTitleContext"),wAe.CommentThreadCommentContext=new wAe("CommentThreadCommentContext"),wAe.CommentTitle=new wAe("CommentTitle"),wAe.CommentActions=new wAe("CommentActions"),wAe.InteractiveToolbar=new wAe("InteractiveToolbar"),wAe.InteractiveCellTitle=new wAe("InteractiveCellTitle"),wAe.InteractiveCellDelete=new wAe("InteractiveCellDelete"),wAe.InteractiveCellExecute=new wAe("InteractiveCellExecute"),wAe.InteractiveInputExecute=new wAe("InteractiveInputExecute"),wAe.NotebookToolbar=new wAe("NotebookToolbar"),wAe.NotebookCellTitle=new wAe("NotebookCellTitle"),wAe.NotebookCellDelete=new wAe("NotebookCellDelete"),wAe.NotebookCellInsert=new wAe("NotebookCellInsert"),wAe.NotebookCellBetween=new wAe("NotebookCellBetween"),wAe.NotebookCellListTop=new wAe("NotebookCellTop"),wAe.NotebookCellExecute=new wAe("NotebookCellExecute"),wAe.NotebookCellExecutePrimary=new wAe("NotebookCellExecutePrimary"),wAe.NotebookDiffCellInputTitle=new wAe("NotebookDiffCellInputTitle"),wAe.NotebookDiffCellMetadataTitle=new wAe("NotebookDiffCellMetadataTitle"),wAe.NotebookDiffCellOutputsTitle=new wAe("NotebookDiffCellOutputsTitle"),wAe.NotebookOutputToolbar=new wAe("NotebookOutputToolbar"),wAe.NotebookEditorLayoutConfigure=new wAe("NotebookEditorLayoutConfigure"),wAe.NotebookKernelSource=new wAe("NotebookKernelSource"),wAe.BulkEditTitle=new wAe("BulkEditTitle"),wAe.BulkEditContext=new wAe("BulkEditContext"),wAe.TimelineItemContext=new wAe("TimelineItemContext"),wAe.TimelineTitle=new wAe("TimelineTitle"),wAe.TimelineTitleContext=new wAe("TimelineTitleContext"),wAe.TimelineFilterSubMenu=new wAe("TimelineFilterSubMenu"),wAe.AccountsContext=new wAe("AccountsContext"),wAe.PanelTitle=new wAe("PanelTitle"),wAe.AuxiliaryBarTitle=new wAe("AuxiliaryBarTitle"),wAe.TerminalInstanceContext=new wAe("TerminalInstanceContext"),wAe.TerminalEditorInstanceContext=new wAe("TerminalEditorInstanceContext"),wAe.TerminalNewDropdownContext=new wAe("TerminalNewDropdownContext"),wAe.TerminalTabContext=new wAe("TerminalTabContext"),wAe.TerminalTabEmptyAreaContext=new wAe("TerminalTabEmptyAreaContext"),wAe.TerminalInlineTabContext=new wAe("TerminalInlineTabContext"),wAe.WebviewContext=new wAe("WebviewContext"),wAe.InlineCompletionsActions=new wAe("InlineCompletionsActions"),wAe.NewFile=new wAe("NewFile"),wAe.MergeInput1Toolbar=new wAe("MergeToolbar1Toolbar"),wAe.MergeInput2Toolbar=new wAe("MergeToolbar2Toolbar"),wAe.MergeBaseToolbar=new wAe("MergeBaseToolbar"),wAe.MergeInputResultToolbar=new wAe("MergeToolbarResultToolbar"),wAe.InlineSuggestionToolbar=new wAe("InlineSuggestionToolbar");const CAe=zxe("menuService");class yAe{static for(e){let t=this._all.get(e);return t||(t=new yAe(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const i of e)i instanceof yAe&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}}yAe._all=new Map;const SAe=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Jwe({merge:yAe.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(e){return this._commands.set(e.id,e),this._onDidChangeMenu.fire(yAe.for(wAe.CommandPalette)),Awe((()=>{this._commands.delete(e.id)&&this._onDidChangeMenu.fire(yAe.for(wAe.CommandPalette))}))}getCommand(e){return this._commands.get(e)}getCommands(){const e=new Map;return this._commands.forEach(((t,i)=>e.set(i,t))),e}appendMenuItem(e,t){let i=this._menuItems.get(e);i||(i=new $ve,this._menuItems.set(e,i));const n=i.push(t);return this._onDidChangeMenu.fire(yAe.for(e)),Awe(n)}appendMenuItems(e){const t=new Rwe;for(const{id:i,item:n}of e)t.add(this.appendMenuItem(i,n));return t}getMenuItems(e){let t;return t=this._menuItems.has(e)?[...this._menuItems.get(e)]:[],e===wAe.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(e){const t=new Set;for(const i of e)bAe(i)&&(t.add(i.command.id),i.alt&&t.add(i.alt.id));this._commands.forEach(((i,n)=>{t.has(n)||e.push({command:i})}))}};class xAe extends hAe{constructor(e,t,i){super(`submenuitem.${e.submenu.id}`,"string"==typeof e.title?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let kAe=class e{static label(e,t){return(null==t?void 0:t.renderShortTitle)&&e.shortTitle?"string"==typeof e.shortTitle?e.shortTitle:e.shortTitle.value:"string"==typeof e.title?e.title:e.title.value}constructor(t,i,n,o,s,r){var a,l;if(this.hideActions=o,this._commandService=r,this.id=t.id,this.label=e.label(t,n),this.tooltip=null!==(l="string"==typeof t.tooltip?t.tooltip:null===(a=t.tooltip)||void 0===a?void 0:a.value)&&void 0!==l?l:"",this.enabled=!t.precondition||s.contextMatchesRules(t.precondition),this.checked=void 0,t.toggled){const e=t.toggled.condition?t.toggled:{condition:t.toggled};this.checked=s.contextMatchesRules(e.condition),this.checked&&e.tooltip&&(this.tooltip="string"==typeof e.tooltip?e.tooltip:e.tooltip.value),e.title&&(this.label="string"==typeof e.title?e.title:e.title.value)}this.item=t,this.alt=i?new e(i,void 0,n,o,s,r):void 0,this._options=n,sAe.isThemeIcon(t.icon)&&(this.class=sAe.asClassName(t.icon))}run(...e){var t,i;let n=[];return(null===(t=this._options)||void 0===t?void 0:t.arg)&&(n=[...n,this._options.arg]),(null===(i=this._options)||void 0===i?void 0:i.shouldForwardArgs)&&(n=[...n,...e]),this._commandService.executeCommand(this.id,...n)}};kAe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([vAe(4,wke),vAe(5,gAe)],kAe);const LAe=zxe("telemetryService");class DAe{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this._description=e.description}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let e=t.kbExpr;this.precondition&&(e=e?Jxe.and(e,this.precondition):this.precondition);const i={id:this.id,weight:t.weight,args:t.args,when:e,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};fAe.registerKeybindingRule(i)}}pAe.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){SAe.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}}class EAe extends DAe{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i){return this._implementations.push({priority:e,name:t,implementation:i}),this._implementations.sort(((e,t)=>t.priority-e.priority)),{dispose:()=>{for(let e=0;e<this._implementations.length;e++)if(this._implementations[e].implementation===i)return void this._implementations.splice(e,1)}}}runCommand(e,t){const i=e.get(yNe);i.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);for(const n of this._implementations){const o=n.implementation(e,t);if(o){if(i.trace(`Command '${this.id}' was handled by '${n.name}'.`),"boolean"==typeof o)return;return o}}i.trace(`The Command '${this.id}' was not handled by any implementation.`)}}class NAe extends DAe{constructor(e,t){super(t),this.command=e}runCommand(e,t){return this.command.runCommand(e,t)}}class IAe extends DAe{static bindToContribution(e){return class extends IAe{constructor(e){super(e),this._callback=e.handler}runEditorCommand(t,i,n){const o=e(i);o&&this._callback(o,n)}}}static runEditorCommand(e,t,i,n){const o=e.get(Uxe),s=o.getFocusedCodeEditor()||o.getActiveCodeEditor();if(s)return s.invokeWithinContext((e=>{if(e.get(wke).contextMatchesRules(Ebe(i)))return n(e,s,t)}))}runCommand(e,t){return IAe.runEditorCommand(e,t,this.precondition,((e,t,i)=>this.runEditorCommand(e,t,i)))}}class TAe extends IAe{static convertOptions(e){let t;function i(t){return t.menuId||(t.menuId=wAe.EditorContext),t.title||(t.title=e.label),t.when=Jxe.and(e.precondition,t.when),t}return t=Array.isArray(e.menuOpts)?e.menuOpts:e.menuOpts?[e.menuOpts]:[],Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(TAe.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(LAe).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}function MAe(e){return PAe.INSTANCE.registerEditorCommand(e),e}function AAe(e){const t=new e;return PAe.INSTANCE.registerEditorAction(t),t}function RAe(e,t,i){PAe.INSTANCE.registerEditorContribution(e,t,i)}var OAe;!function(e){e.getEditorCommand=function(e){return PAe.INSTANCE.getEditorCommand(e)},e.getEditorActions=function(){return PAe.INSTANCE.getEditorActions()},e.getEditorContributions=function(){return PAe.INSTANCE.getEditorContributions()},e.getSomeEditorContributions=function(e){return PAe.INSTANCE.getEditorContributions().filter((t=>e.indexOf(t.id)>=0))},e.getDiffEditorContributions=function(){return PAe.INSTANCE.getDiffEditorContributions()}}(OAe||(OAe={}));class PAe{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,i){this.editorContributions.push({id:e,ctor:t,instantiation:i})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}function FAe(e){return e.register(),e}PAe.INSTANCE=new PAe,RLe.add("editor.contributions",PAe.INSTANCE);const BAe=FAe(new EAe({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:wAe.MenubarEditMenu,group:"1_do",title:ove(0,"&&Undo"),order:1},{menuId:wAe.CommandPalette,group:"",title:ove(0,"Undo"),order:1}]}));FAe(new NAe(BAe,{id:"default:undo",precondition:void 0}));const WAe=FAe(new EAe({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:wAe.MenubarEditMenu,group:"1_do",title:ove(0,"&&Redo"),order:2},{menuId:wAe.CommandPalette,group:"",title:ove(0,"Redo"),order:1}]}));FAe(new NAe(WAe,{id:"default:redo",precondition:void 0}));const VAe=FAe(new EAe({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:wAe.MenubarSelectionMenu,group:"1_basic",title:ove(0,"&&Select All"),order:1},{menuId:wAe.CommandPalette,group:"",title:ove(0,"Select All"),order:1}]}));let HAe=class{constructor(e,t){}dispose(){}};HAe.ID="editor.contrib.markerDecorations",HAe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,iAe)],HAe),RAe(HAe.ID,HAe,0);var zAe=i(4335),UAe={};UAe.styleTagTransform=zl(),UAe.setAttributes=Bl(),UAe.insert=Pl().bind(null,"head"),UAe.domAPI=Rl(),UAe.insertStyleElement=Vl(),Ml()(zAe.A,UAe),zAe.A&&zAe.A.locals&&zAe.A.locals;class KAe extends Owe{constructor(e,t){super(),this._onDidChange=this._register(new $we),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){!this._resizeObserver&&this._referenceDomElement&&(this._resizeObserver=new ResizeObserver((e=>{e&&e[0]&&e[0].contentRect?this.observe({width:e[0].contentRect.width,height:e[0].contentRect.height}):this.observe()})),this._resizeObserver.observe(this._referenceDomElement))}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,n=0;t?(i=t.width,n=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,n=this._referenceDomElement.clientHeight),i=Math.max(5,i),n=Math.max(5,n),this._width===i&&this._height===n||(this._width=i,this._height=n,e&&this._onDidChange.fire())}}class jAe{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=jAe._read(e,this.key);this.migrate(t,(t=>jAe._read(e,t)),((t,i)=>jAe._write(e,t,i)))}static _read(e,t){if(void 0===e)return;const i=t.indexOf(".");if(i>=0){const n=t.substring(0,i);return this._read(e[n],t.substring(i+1))}return e[t]}static _write(e,t,i){const n=t.indexOf(".");if(n>=0){const o=t.substring(0,n);return e[o]=e[o]||{},void this._write(e[o],t.substring(n+1),i)}e[t]=i}}function qAe(e,t){jAe.items.push(new jAe(e,t))}function $Ae(e,t){qAe(e,((i,n,o)=>{if(void 0!==i)for(const[n,s]of t)if(i===n)return void o(e,s)}))}jAe.items=[],$Ae("wordWrap",[[!0,"on"],[!1,"off"]]),$Ae("lineNumbers",[[!0,"on"],[!1,"off"]]),$Ae("cursorBlinking",[["visible","solid"]]),$Ae("renderWhitespace",[[!0,"boundary"],[!1,"none"]]),$Ae("renderLineHighlight",[[!0,"line"],[!1,"none"]]),$Ae("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]),$Ae("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]),$Ae("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]),$Ae("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]),$Ae("autoIndent",[[!1,"advanced"],[!0,"full"]]),$Ae("matchBrackets",[[!0,"always"],[!1,"never"]]),$Ae("renderFinalNewline",[[!0,"on"],[!1,"off"]]),$Ae("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]),qAe("autoClosingBrackets",((e,t,i)=>{!1===e&&(i("autoClosingBrackets","never"),void 0===t("autoClosingQuotes")&&i("autoClosingQuotes","never"),void 0===t("autoSurround")&&i("autoSurround","never"))})),qAe("renderIndentGuides",((e,t,i)=>{void 0!==e&&(i("renderIndentGuides",void 0),void 0===t("guides.indentation")&&i("guides.indentation",!!e))})),qAe("highlightActiveIndentGuide",((e,t,i)=>{void 0!==e&&(i("highlightActiveIndentGuide",void 0),void 0===t("guides.highlightActiveIndentation")&&i("guides.highlightActiveIndentation",!!e))}));const GAe={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};qAe("suggest.filteredTypes",((e,t,i)=>{if(e&&"object"==typeof e){for(const n of Object.entries(GAe))!1===e[n[0]]&&void 0===t(`suggest.${n[1]}`)&&i(`suggest.${n[1]}`,!1);i("suggest.filteredTypes",void 0)}})),qAe("quickSuggestions",((e,t,i)=>{if("boolean"==typeof e){const t=e?"on":"off";i("quickSuggestions",{comments:t,strings:t,other:t})}})),qAe("experimental.stickyScroll.enabled",((e,t,i)=>{"boolean"==typeof e&&(i("experimental.stickyScroll.enabled",void 0),void 0===t("stickyScroll.enabled")&&i("stickyScroll.enabled",e))})),qAe("experimental.stickyScroll.maxLineCount",((e,t,i)=>{"number"==typeof e&&(i("experimental.stickyScroll.maxLineCount",void 0),void 0===t("stickyScroll.maxLineCount")&&i("stickyScroll.maxLineCount",e))}));const ZAe=new class{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new $we,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus!==e&&(this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus))}};let YAe=class extends Owe{constructor(e,t,i,n){super(),this._accessibilityService=n,this._onDidChange=this._register(new $we),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new $we),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._computeOptionsMemory=new Bbe,this.isSimpleWidget=e,this._containerObserver=this._register(new KAe(i,t.dimension)),this._rawOptions=tRe(t),this._validatedOptions=eRe.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(10)&&this._containerObserver.startObserving(),this._register(Rxe.onDidChangeZoomLevel((()=>this._recomputeOptions()))),this._register(ZAe.onDidChangeTabFocus((()=>this._recomputeOptions()))),this._register(this._containerObserver.onDidChange((()=>this._recomputeOptions()))),this._register(Wxe.onDidChange((()=>this._recomputeOptions()))),this._register(fxe.onDidChange((()=>this._recomputeOptions()))),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized((()=>this._recomputeOptions())))}_recomputeOptions(){const e=this._computeOptions(),t=eRe.checkEquals(this.options,e);null!==t&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=Pxe.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),n={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:ZAe.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport};return eRe.computeOptions(this._validatedOptions,n)}_readEnvConfiguration(){return{extraEditorClassName:QAe(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:wxe||bxe,pixelRatio:fxe.value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return Wxe.readFontInfo(e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=tRe(e);eRe.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=eRe.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){const t=function(e){let t=0;for(;e;)e=Math.floor(e/10),t++;return t||1}(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}};function QAe(){let e="";return yxe||Sxe||(e+="no-user-select "),yxe&&(e+="no-minimap-shadow ",e+="enable-user-select "),Dve&&(e+="mac "),e}YAe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(3,Lke)],YAe);class XAe{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class JAe{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw new Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}}class eRe{static validateOptions(e){const t=new XAe;for(const i of fwe){const n="_never_"===i.name?void 0:e[i.name];t._write(i.id,i.validate(n))}return t}static computeOptions(e,t){const i=new JAe;for(const n of fwe)i._write(n.id,n.compute(t,i,e._read(n.id)));return i}static _deepEquals(e,t){if("object"!=typeof e||"object"!=typeof t||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return!(!Array.isArray(e)||!Array.isArray(t))&&tbe(e,t);if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!eRe._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let n=!1;for(const o of fwe){const s=!eRe._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=s,s&&(n=!0)}return n?new Fbe(i):null}static applyUpdate(e,t){let i=!1;for(const n of fwe)if(t.hasOwnProperty(n.name)){const o=n.applyUpdate(e[n.name],t[n.name]);e[n.name]=o.newValue,i=i||o.didChange}return i}}function tRe(e){const t=Nbe(e);return function(e){jAe.items.forEach((t=>t.apply(e)))}(t),t}function iRe(e,t,i){let n=null,o=null;if("function"==typeof i.value?(n="value",o=i.value,0!==o.length&&console.warn("Memoize should only be used in functions with zero parameters")):"function"==typeof i.get&&(n="get",o=i.get),!o)throw new Error("not supported");const s=`$memoize$${t}`;i[n]=function(...e){return this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,e)}),this[s]}}var nRe;!function(e){e.Tap="-monaco-gesturetap",e.Change="-monaco-gesturechange",e.Start="-monaco-gesturestart",e.End="-monaco-gesturesend",e.Contextmenu="-monaco-gesturecontextmenu"}(nRe||(nRe={}));class oRe extends Owe{constructor(){super(),this.dispatched=!1,this.targets=new $ve,this.ignoreTargets=new $ve,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(tMe(document,"touchstart",(e=>this.onTouchStart(e)),{passive:!1})),this._register(tMe(document,"touchend",(e=>this.onTouchEnd(e)))),this._register(tMe(document,"touchmove",(e=>this.onTouchMove(e)),{passive:!1}))}static addTarget(e){return oRe.isTouchDevice()?(oRe.INSTANCE||(oRe.INSTANCE=new oRe),Awe(oRe.INSTANCE.targets.push(e))):Owe.None}static ignoreTarget(e){return oRe.isTouchDevice()?(oRe.INSTANCE||(oRe.INSTANCE=new oRe),Awe(oRe.INSTANCE.ignoreTargets.push(e))):Owe.None}static isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,n=e.targetTouches.length;i<n;i++){const n=e.targetTouches.item(i);this.activeTouches[n.identifier]={id:n.identifier,initialTarget:n.target,initialTimeStamp:t,initialPageX:n.pageX,initialPageY:n.pageY,rollingTimestamps:[t],rollingPageX:[n.pageX],rollingPageY:[n.pageY]};const o=this.newGestureEvent(nRe.Start,n.target);o.pageX=n.pageX,o.pageY=n.pageY,this.dispatchEvent(o)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e){const t=Date.now(),i=Object.keys(this.activeTouches).length;for(let n=0,o=e.changedTouches.length;n<o;n++){const o=e.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn("move of an UNKNOWN touch",o);continue}const s=this.activeTouches[o.identifier],r=Date.now()-s.initialTimeStamp;if(r<oRe.HOLD_DELAY&&Math.abs(s.initialPageX-ebe(s.rollingPageX))<30&&Math.abs(s.initialPageY-ebe(s.rollingPageY))<30){const e=this.newGestureEvent(nRe.Tap,s.initialTarget);e.pageX=ebe(s.rollingPageX),e.pageY=ebe(s.rollingPageY),this.dispatchEvent(e)}else if(r>=oRe.HOLD_DELAY&&Math.abs(s.initialPageX-ebe(s.rollingPageX))<30&&Math.abs(s.initialPageY-ebe(s.rollingPageY))<30){const e=this.newGestureEvent(nRe.Contextmenu,s.initialTarget);e.pageX=ebe(s.rollingPageX),e.pageY=ebe(s.rollingPageY),this.dispatchEvent(e)}else if(1===i){const e=ebe(s.rollingPageX),i=ebe(s.rollingPageY),n=ebe(s.rollingTimestamps)-s.rollingTimestamps[0],o=e-s.rollingPageX[0],r=i-s.rollingPageY[0],a=[...this.targets].filter((e=>s.initialTarget instanceof Node&&e.contains(s.initialTarget)));this.inertia(a,t,Math.abs(o)/n,o>0?1:-1,e,Math.abs(r)/n,r>0?1:-1,i)}this.dispatchEvent(this.newGestureEvent(nRe.End,s.initialTarget)),delete this.activeTouches[o.identifier]}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===nRe.Tap){const t=(new Date).getTime();let i=0;i=t-this._lastSetTapCountTime>oRe.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=t,e.tapCount=i}else e.type!==nRe.Change&&e.type!==nRe.Contextmenu||(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const t of this.ignoreTargets)if(t.contains(e.initialTarget))return;for(const t of this.targets)t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)}}inertia(e,t,i,n,o,s,r,a){this.handle=oMe((()=>{const l=Date.now(),d=l-t;let h=0,c=0,u=!0;i+=oRe.SCROLL_FRICTION*d,s+=oRe.SCROLL_FRICTION*d,i>0&&(u=!1,h=n*i*d),s>0&&(u=!1,c=r*s*d);const g=this.newGestureEvent(nRe.Change);g.translationX=h,g.translationY=c,e.forEach((e=>e.dispatchEvent(g))),u||this.inertia(e,l,i,n,o+h,s,r,a+c)}))}onTouchMove(e){const t=Date.now();for(let i=0,n=e.changedTouches.length;i<n;i++){const n=e.changedTouches.item(i);if(!this.activeTouches.hasOwnProperty(String(n.identifier))){console.warn("end of an UNKNOWN touch",n);continue}const o=this.activeTouches[n.identifier],s=this.newGestureEvent(nRe.Change,o.initialTarget);s.translationX=n.pageX-ebe(o.rollingPageX),s.translationY=n.pageY-ebe(o.rollingPageY),s.pageX=n.pageX,s.pageY=n.pageY,this.dispatchEvent(s),o.rollingPageX.length>3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(n.pageX),o.rollingPageY.push(n.pageY),o.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}oRe.SCROLL_FRICTION=-.005,oRe.HOLD_DELAY=700,oRe.CLEAR_TAP_COUNT_TIME=400,function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);s>3&&r&&Object.defineProperty(t,i,r)}([iRe],oRe,"isTouchDevice",null);class sRe{constructor(){this._hooks=new Rwe,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,n,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=o;let s=e;try{e.setPointerCapture(t),this._hooks.add(Awe((()=>{try{e.releasePointerCapture(t)}catch(e){}})))}catch(e){s=window}this._hooks.add(tMe(s,LMe.POINTER_MOVE,(e=>{e.buttons===i?(e.preventDefault(),this._pointerMoveCallback(e)):this.stopMonitoring(!0)}))),this._hooks.add(tMe(s,LMe.POINTER_UP,(e=>this.stopMonitoring(!0))))}}function rRe(e,t){const i=Math.pow(10,t);return Math.round(e*i)/i}class aRe{constructor(e,t,i,n=1){this._rgbaBrand=void 0,this.r=0|Math.min(255,Math.max(0,e)),this.g=0|Math.min(255,Math.max(0,t)),this.b=0|Math.min(255,Math.max(0,i)),this.a=rRe(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class lRe{constructor(e,t,i,n){this._hslaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=rRe(Math.max(Math.min(1,t),0),3),this.l=rRe(Math.max(Math.min(1,i),0),3),this.a=rRe(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,n=e.b/255,o=e.a,s=Math.max(t,i,n),r=Math.min(t,i,n);let a=0,l=0;const d=(r+s)/2,h=s-r;if(h>0){switch(l=Math.min(d<=.5?h/(2*d):h/(2-2*d),1),s){case t:a=(i-n)/h+(i<n?6:0);break;case i:a=(n-t)/h+2;break;case n:a=(t-i)/h+4}a*=60,a=Math.round(a)}return new lRe(a,l,d,o)}static _hue2rgb(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){const t=e.h/360,{s:i,l:n,a:o}=e;let s,r,a;if(0===i)s=r=a=n;else{const e=n<.5?n*(1+i):n+i-n*i,o=2*n-e;s=lRe._hue2rgb(o,e,t+1/3),r=lRe._hue2rgb(o,e,t),a=lRe._hue2rgb(o,e,t-1/3)}return new aRe(Math.round(255*s),Math.round(255*r),Math.round(255*a),o)}}class dRe{constructor(e,t,i,n){this._hsvaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=rRe(Math.max(Math.min(1,t),0),3),this.v=rRe(Math.max(Math.min(1,i),0),3),this.a=rRe(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,n=e.b/255,o=Math.max(t,i,n),s=o-Math.min(t,i,n),r=0===o?0:s/o;let a;return a=0===s?0:o===t?((i-n)/s%6+6)%6:o===i?(n-t)/s+2:(t-i)/s+4,new dRe(Math.round(60*a),r,o,e.a)}static toRGBA(e){const{h:t,s:i,v:n,a:o}=e,s=n*i,r=s*(1-Math.abs(t/60%2-1)),a=n-s;let[l,d,h]=[0,0,0];return t<60?(l=s,d=r):t<120?(l=r,d=s):t<180?(d=s,h=r):t<240?(d=r,h=s):t<300?(l=r,h=s):t<=360&&(l=s,h=r),l=Math.round(255*(l+a)),d=Math.round(255*(d+a)),h=Math.round(255*(h+a)),new aRe(l,d,h,o)}}class hRe{static fromHex(e){return hRe.Format.CSS.parseHex(e)||hRe.red}static equals(e,t){return!e&&!t||!(!e||!t)&&e.equals(t)}get hsla(){return this._hsla?this._hsla:lRe.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:dRe.fromRGBA(this.rgba)}constructor(e){if(!e)throw new Error("Color needs a value");if(e instanceof aRe)this.rgba=e;else if(e instanceof lRe)this._hsla=e,this.rgba=lRe.toRGBA(e);else{if(!(e instanceof dRe))throw new Error("Invalid color ctor argument");this._hsva=e,this.rgba=dRe.toRGBA(e)}}equals(e){return!!e&&aRe.equals(this.rgba,e.rgba)&&lRe.equals(this.hsla,e.hsla)&&dRe.equals(this.hsva,e.hsva)}getRelativeLuminance(){return rRe(.2126*hRe._relativeLuminanceForComponent(this.rgba.r)+.7152*hRe._relativeLuminanceForComponent(this.rgba.g)+.0722*hRe._relativeLuminanceForComponent(this.rgba.b),4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3>=128}isLighterThan(e){return this.getRelativeLuminance()>e.getRelativeLuminance()}isDarkerThan(e){return this.getRelativeLuminance()<e.getRelativeLuminance()}lighten(e){return new hRe(new lRe(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*e,this.hsla.a))}darken(e){return new hRe(new lRe(this.hsla.h,this.hsla.s,this.hsla.l-this.hsla.l*e,this.hsla.a))}transparent(e){const{r:t,g:i,b:n,a:o}=this.rgba;return new hRe(new aRe(t,i,n,o*e))}isTransparent(){return 0===this.rgba.a}isOpaque(){return 1===this.rgba.a}opposite(){return new hRe(new aRe(255-this.rgba.r,255-this.rgba.g,255-this.rgba.b,this.rgba.a))}toString(){return this._toString||(this._toString=hRe.Format.CSS.format(this)),this._toString}static getLighterColor(e,t,i){if(e.isLighterThan(t))return e;i=i||.5;const n=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(o-n)/o,e.lighten(i)}static getDarkerColor(e,t,i){if(e.isDarkerThan(t))return e;i=i||.5;const n=e.getRelativeLuminance();return i=i*(n-t.getRelativeLuminance())/n,e.darken(i)}}function cRe(e){return`--vscode-${e.replace(/\./g,"-")}`}function uRe(e){return`var(${cRe(e)})`}hRe.white=new hRe(new aRe(255,255,255,1)),hRe.black=new hRe(new aRe(0,0,0,1)),hRe.red=new hRe(new aRe(255,0,0,1)),hRe.blue=new hRe(new aRe(0,0,255,1)),hRe.green=new hRe(new aRe(0,255,0,1)),hRe.cyan=new hRe(new aRe(0,255,255,1)),hRe.lightgrey=new hRe(new aRe(211,211,211,1)),hRe.transparent=new hRe(new aRe(0,0,0,0)),function(e){let t;!function(t){let i;!function(t){function i(e){const t=e.toString(16);return 2!==t.length?"0"+t:t}function n(e){switch(e){case 48:return 0;case 49:return 1;case 50:return 2;case 51:return 3;case 52:return 4;case 53:return 5;case 54:return 6;case 55:return 7;case 56:return 8;case 57:return 9;case 97:case 65:return 10;case 98:case 66:return 11;case 99:case 67:return 12;case 100:case 68:return 13;case 101:case 69:return 14;case 102:case 70:return 15}return 0}t.formatRGB=function(t){return 1===t.rgba.a?`rgb(${t.rgba.r}, ${t.rgba.g}, ${t.rgba.b})`:e.Format.CSS.formatRGBA(t)},t.formatRGBA=function(e){return`rgba(${e.rgba.r}, ${e.rgba.g}, ${e.rgba.b}, ${+e.rgba.a.toFixed(2)})`},t.formatHSL=function(t){return 1===t.hsla.a?`hsl(${t.hsla.h}, ${(100*t.hsla.s).toFixed(2)}%, ${(100*t.hsla.l).toFixed(2)}%)`:e.Format.CSS.formatHSLA(t)},t.formatHSLA=function(e){return`hsla(${e.hsla.h}, ${(100*e.hsla.s).toFixed(2)}%, ${(100*e.hsla.l).toFixed(2)}%, ${e.hsla.a.toFixed(2)})`},t.formatHex=function(e){return`#${i(e.rgba.r)}${i(e.rgba.g)}${i(e.rgba.b)}`},t.formatHexA=function(t,n=!1){return n&&1===t.rgba.a?e.Format.CSS.formatHex(t):`#${i(t.rgba.r)}${i(t.rgba.g)}${i(t.rgba.b)}${i(Math.round(255*t.rgba.a))}`},t.format=function(t){return t.isOpaque()?e.Format.CSS.formatHex(t):e.Format.CSS.formatRGBA(t)},t.parseHex=function(t){const i=t.length;if(0===i)return null;if(35!==t.charCodeAt(0))return null;if(7===i){const i=16*n(t.charCodeAt(1))+n(t.charCodeAt(2)),o=16*n(t.charCodeAt(3))+n(t.charCodeAt(4)),s=16*n(t.charCodeAt(5))+n(t.charCodeAt(6));return new e(new aRe(i,o,s,1))}if(9===i){const i=16*n(t.charCodeAt(1))+n(t.charCodeAt(2)),o=16*n(t.charCodeAt(3))+n(t.charCodeAt(4)),s=16*n(t.charCodeAt(5))+n(t.charCodeAt(6)),r=16*n(t.charCodeAt(7))+n(t.charCodeAt(8));return new e(new aRe(i,o,s,r/255))}if(4===i){const i=n(t.charCodeAt(1)),o=n(t.charCodeAt(2)),s=n(t.charCodeAt(3));return new e(new aRe(16*i+i,16*o+o,16*s+s))}if(5===i){const i=n(t.charCodeAt(1)),o=n(t.charCodeAt(2)),s=n(t.charCodeAt(3)),r=n(t.charCodeAt(4));return new e(new aRe(16*i+i,16*o+o,16*s+s,(16*r+r)/255))}return null}}(i=t.CSS||(t.CSS={}))}(t=e.Format||(e.Format={}))}(hRe||(hRe={}));const gRe="base.contributions.colors",pRe=new class{constructor(){this._onDidChangeSchema=new $we,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,n=!1,o){const s={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:o};this.colorsById[e]=s;const r={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(r.deprecationMessage=o),this.colorSchema.properties[e]=r,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map((e=>this.colorsById[e]))}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i&&i.defaults)return YPe(i.defaults[t.type],t)}getColorSchema(){return this.colorSchema}toString(){return Object.keys(this.colorsById).sort(((e,t)=>{const i=-1===e.indexOf(".")?0:1,n=-1===t.indexOf(".")?0:1;return i!==n?i-n:e.localeCompare(t)})).map((e=>`- \`${e}\`: ${this.colorsById[e].description}`)).join("\n")}};function mRe(e,t,i,n,o){return pRe.registerColor(e,(null===(s=t)||void 0===s.hcLight&&(null===s.hcDark||"string"==typeof s.hcDark?s.hcLight=s.hcDark:s.hcLight=s.light),s),i,n,o);var s}RLe.add(gRe,pRe);const fRe=mRe("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},ove(0,"Overall foreground color. This color is only used if not overridden by a component.")),_Re=(mRe("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},ove(0,"Overall foreground for disabled elements. This color is only used if not overridden by a component.")),mRe("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},ove(0,"Overall foreground color for error messages. This color is only used if not overridden by a component.")),mRe("descriptionForeground",{light:"#717171",dark:$Pe(fRe,.7),hcDark:$Pe(fRe,.7),hcLight:$Pe(fRe,.7)},ove(0,"Foreground color for description text providing additional information, for example for a label.")),mRe("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},ove(0,"The default color for icons in the workbench.")),mRe("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},ove(0,"Overall border color for focused elements. This color is only used if not overridden by a component."))),vRe=mRe("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},ove(0,"An extra border around elements to separate them from others for greater contrast.")),bRe=mRe("contrastActiveBorder",{light:null,dark:null,hcDark:_Re,hcLight:_Re},ove(0,"An extra border around active elements to separate them from others for greater contrast.")),wRe=(mRe("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},ove(0,"The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor.")),mRe("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:hRe.black,hcLight:"#292929"},ove(0,"Color for text separators.")),mRe("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},ove(0,"Foreground color for links in text."))),CRe=(mRe("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},ove(0,"Foreground color for links in text when clicked on and on mouse hover.")),mRe("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#D7BA7D",hcLight:"#292929"},ove(0,"Foreground color for preformatted text segments.")),mRe("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hcDark:null,hcLight:"#F2F2F2"},ove(0,"Background color for block quotes in text.")),mRe("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:hRe.white,hcLight:"#292929"},ove(0,"Border color for block quotes in text.")),mRe("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:hRe.black,hcLight:"#F2F2F2"},ove(0,"Background color for code blocks in text.")),mRe("widget.shadow",{dark:$Pe(hRe.black,.36),light:$Pe(hRe.black,.16),hcDark:null,hcLight:null},ove(0,"Shadow color of widgets such as find/replace inside the editor."))),yRe=mRe("widget.border",{dark:null,light:null,hcDark:vRe,hcLight:vRe},ove(0,"Border color of widgets such as find/replace inside the editor.")),SRe=mRe("input.background",{dark:"#3C3C3C",light:hRe.white,hcDark:hRe.black,hcLight:hRe.white},ove(0,"Input box background.")),xRe=mRe("input.foreground",{dark:fRe,light:fRe,hcDark:fRe,hcLight:fRe},ove(0,"Input box foreground.")),kRe=mRe("input.border",{dark:null,light:null,hcDark:vRe,hcLight:vRe},ove(0,"Input box border.")),LRe=mRe("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:vRe,hcLight:vRe},ove(0,"Border color of activated options in input fields.")),DRe=(mRe("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},ove(0,"Background color of activated options in input fields.")),mRe("inputOption.activeBackground",{dark:$Pe(_Re,.4),light:$Pe(_Re,.2),hcDark:hRe.transparent,hcLight:hRe.transparent},ove(0,"Background hover color of options in input fields."))),ERe=mRe("inputOption.activeForeground",{dark:hRe.white,light:hRe.black,hcDark:fRe,hcLight:fRe},ove(0,"Foreground color of activated options in input fields.")),NRe=(mRe("input.placeholderForeground",{light:$Pe(fRe,.5),dark:$Pe(fRe,.5),hcDark:$Pe(fRe,.7),hcLight:$Pe(fRe,.7)},ove(0,"Input box foreground color for placeholder text.")),mRe("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:hRe.black,hcLight:hRe.white},ove(0,"Input validation background color for information severity."))),IRe=mRe("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:fRe},ove(0,"Input validation foreground color for information severity.")),TRe=mRe("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:vRe,hcLight:vRe},ove(0,"Input validation border color for information severity.")),MRe=mRe("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:hRe.black,hcLight:hRe.white},ove(0,"Input validation background color for warning severity.")),ARe=mRe("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:fRe},ove(0,"Input validation foreground color for warning severity.")),RRe=mRe("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:vRe,hcLight:vRe},ove(0,"Input validation border color for warning severity.")),ORe=mRe("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:hRe.black,hcLight:hRe.white},ove(0,"Input validation background color for error severity.")),PRe=mRe("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:fRe},ove(0,"Input validation foreground color for error severity.")),FRe=mRe("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:vRe,hcLight:vRe},ove(0,"Input validation border color for error severity.")),BRe=mRe("dropdown.background",{dark:"#3C3C3C",light:hRe.white,hcDark:hRe.black,hcLight:hRe.white},ove(0,"Dropdown background.")),WRe=mRe("dropdown.listBackground",{dark:null,light:null,hcDark:hRe.black,hcLight:hRe.white},ove(0,"Dropdown list background.")),VRe=mRe("dropdown.foreground",{dark:"#F0F0F0",light:fRe,hcDark:hRe.white,hcLight:fRe},ove(0,"Dropdown foreground.")),HRe=mRe("dropdown.border",{dark:BRe,light:"#CECECE",hcDark:vRe,hcLight:vRe},ove(0,"Dropdown border.")),zRe=mRe("button.foreground",{dark:hRe.white,light:hRe.white,hcDark:hRe.white,hcLight:hRe.white},ove(0,"Button foreground color.")),URe=mRe("button.separator",{dark:$Pe(zRe,.4),light:$Pe(zRe,.4),hcDark:$Pe(zRe,.4),hcLight:$Pe(zRe,.4)},ove(0,"Button separator color.")),KRe=mRe("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},ove(0,"Button background color.")),jRe=mRe("button.hoverBackground",{dark:qPe(KRe,.2),light:jPe(KRe,.2),hcDark:KRe,hcLight:KRe},ove(0,"Button background color when hovering.")),qRe=mRe("button.border",{dark:vRe,light:vRe,hcDark:vRe,hcLight:vRe},ove(0,"Button border color.")),$Re=mRe("button.secondaryForeground",{dark:hRe.white,light:hRe.white,hcDark:hRe.white,hcLight:fRe},ove(0,"Secondary button foreground color.")),GRe=mRe("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:hRe.white},ove(0,"Secondary button background color.")),ZRe=mRe("button.secondaryHoverBackground",{dark:qPe(GRe,.2),light:jPe(GRe,.2),hcDark:null,hcLight:null},ove(0,"Secondary button background color when hovering.")),YRe=mRe("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:hRe.black,hcLight:"#0F4A85"},ove(0,"Badge background color. Badges are small information labels, e.g. for search results count.")),QRe=mRe("badge.foreground",{dark:hRe.white,light:"#333",hcDark:hRe.white,hcLight:hRe.white},ove(0,"Badge foreground color. Badges are small information labels, e.g. for search results count.")),XRe=mRe("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},ove(0,"Scrollbar shadow to indicate that the view is scrolled.")),JRe=mRe("scrollbarSlider.background",{dark:hRe.fromHex("#797979").transparent(.4),light:hRe.fromHex("#646464").transparent(.4),hcDark:$Pe(vRe,.6),hcLight:$Pe(vRe,.4)},ove(0,"Scrollbar slider background color.")),eOe=mRe("scrollbarSlider.hoverBackground",{dark:hRe.fromHex("#646464").transparent(.7),light:hRe.fromHex("#646464").transparent(.7),hcDark:$Pe(vRe,.8),hcLight:$Pe(vRe,.8)},ove(0,"Scrollbar slider background color when hovering.")),tOe=mRe("scrollbarSlider.activeBackground",{dark:hRe.fromHex("#BFBFBF").transparent(.4),light:hRe.fromHex("#000000").transparent(.6),hcDark:vRe,hcLight:vRe},ove(0,"Scrollbar slider background color when clicked on.")),iOe=mRe("progressBar.background",{dark:hRe.fromHex("#0E70C0"),light:hRe.fromHex("#0E70C0"),hcDark:vRe,hcLight:vRe},ove(0,"Background color of the progress bar that can show for long running operations.")),nOe=(mRe("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},ove(0,"Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),mRe("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},ove(0,"Foreground color of error squigglies in the editor."))),oOe=(mRe("editorError.border",{dark:null,light:null,hcDark:hRe.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},ove(0,"Border color of error boxes in the editor.")),mRe("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},ove(0,"Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),mRe("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD37",hcLight:"#895503"},ove(0,"Foreground color of warning squigglies in the editor."))),sOe=mRe("editorWarning.border",{dark:null,light:null,hcDark:hRe.fromHex("#FFCC00").transparent(.8),hcLight:"#"},ove(0,"Border color of warning boxes in the editor.")),rOe=(mRe("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},ove(0,"Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),mRe("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},ove(0,"Foreground color of info squigglies in the editor."))),aOe=mRe("editorInfo.border",{dark:null,light:null,hcDark:hRe.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},ove(0,"Border color of info boxes in the editor.")),lOe=mRe("editorHint.foreground",{dark:hRe.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},ove(0,"Foreground color of hint squigglies in the editor.")),dOe=(mRe("editorHint.border",{dark:null,light:null,hcDark:hRe.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},ove(0,"Border color of hint boxes in the editor.")),mRe("sash.hoverBorder",{dark:_Re,light:_Re,hcDark:_Re,hcLight:_Re},ove(0,"Border color of active sashes.")),mRe("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:hRe.black,hcLight:hRe.white},ove(0,"Editor background color."))),hOe=mRe("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:hRe.white,hcLight:fRe},ove(0,"Editor default foreground color.")),cOe=(mRe("editorStickyScroll.background",{light:dOe,dark:dOe,hcDark:dOe,hcLight:dOe},ove(0,"Sticky scroll background color for the editor")),mRe("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:hRe.fromHex("#0F4A85").transparent(.1)},ove(0,"Sticky scroll on hover background color for the editor")),mRe("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:hRe.white},ove(0,"Background color of editor widgets, such as find/replace."))),uOe=mRe("editorWidget.foreground",{dark:fRe,light:fRe,hcDark:fRe,hcLight:fRe},ove(0,"Foreground color of editor widgets, such as find/replace.")),gOe=mRe("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:vRe,hcLight:vRe},ove(0,"Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.")),pOe=(mRe("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},ove(0,"Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")),mRe("quickInput.background",{dark:cOe,light:cOe,hcDark:cOe,hcLight:cOe},ove(0,"Quick picker background color. The quick picker widget is the container for pickers like the command palette."))),mOe=mRe("quickInput.foreground",{dark:uOe,light:uOe,hcDark:uOe,hcLight:uOe},ove(0,"Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),fOe=mRe("quickInputTitle.background",{dark:new hRe(new aRe(255,255,255,.105)),light:new hRe(new aRe(0,0,0,.06)),hcDark:"#000000",hcLight:hRe.white},ove(0,"Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),_Oe=mRe("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:hRe.white,hcLight:"#0F4A85"},ove(0,"Quick picker color for grouping labels.")),vOe=mRe("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:hRe.white,hcLight:"#0F4A85"},ove(0,"Quick picker color for grouping borders.")),bOe=mRe("keybindingLabel.background",{dark:new hRe(new aRe(128,128,128,.17)),light:new hRe(new aRe(221,221,221,.4)),hcDark:hRe.transparent,hcLight:hRe.transparent},ove(0,"Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),wOe=mRe("keybindingLabel.foreground",{dark:hRe.fromHex("#CCCCCC"),light:hRe.fromHex("#555555"),hcDark:hRe.white,hcLight:fRe},ove(0,"Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),COe=mRe("keybindingLabel.border",{dark:new hRe(new aRe(51,51,51,.6)),light:new hRe(new aRe(204,204,204,.4)),hcDark:new hRe(new aRe(111,195,223)),hcLight:vRe},ove(0,"Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),yOe=mRe("keybindingLabel.bottomBorder",{dark:new hRe(new aRe(68,68,68,.6)),light:new hRe(new aRe(187,187,187,.4)),hcDark:new hRe(new aRe(111,195,223)),hcLight:fRe},ove(0,"Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),SOe=mRe("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},ove(0,"Color of the editor selection.")),xOe=mRe("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:hRe.white},ove(0,"Color of the selected text for high contrast.")),kOe=mRe("editor.inactiveSelectionBackground",{light:$Pe(SOe,.5),dark:$Pe(SOe,.5),hcDark:$Pe(SOe,.7),hcLight:$Pe(SOe,.5)},ove(0,"Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),LOe=mRe("editor.selectionHighlightBackground",{light:ZPe(SOe,dOe,.3,.6),dark:ZPe(SOe,dOe,.3,.6),hcDark:null,hcLight:null},ove(0,"Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0),DOe=(mRe("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:bRe,hcLight:bRe},ove(0,"Border color for regions with the same content as the selection.")),mRe("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},ove(0,"Color of the current search match.")),mRe("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},ove(0,"Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0)),EOe=(mRe("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},ove(0,"Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),mRe("editor.findMatchBorder",{light:null,dark:null,hcDark:bRe,hcLight:bRe},ove(0,"Border color of the current search match.")),mRe("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:bRe,hcLight:bRe},ove(0,"Border color of the other search matches."))),NOe=(mRe("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:$Pe(bRe,.4),hcLight:$Pe(bRe,.4)},ove(0,"Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),mRe("searchEditor.findMatchBackground",{light:$Pe(DOe,.66),dark:$Pe(DOe,.66),hcDark:DOe,hcLight:DOe},ove(0,"Color of the Search Editor query matches.")),mRe("searchEditor.findMatchBorder",{light:$Pe(EOe,.66),dark:$Pe(EOe,.66),hcDark:EOe,hcLight:EOe},ove(0,"Border color of the Search Editor query matches.")),mRe("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},ove(0,"Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0),mRe("editorHoverWidget.background",{light:cOe,dark:cOe,hcDark:cOe,hcLight:cOe},ove(0,"Background color of the editor hover."))),IOe=(mRe("editorHoverWidget.foreground",{light:uOe,dark:uOe,hcDark:uOe,hcLight:uOe},ove(0,"Foreground color of the editor hover.")),mRe("editorHoverWidget.border",{light:gOe,dark:gOe,hcDark:gOe,hcLight:gOe},ove(0,"Border color of the editor hover.")),mRe("editorHoverWidget.statusBarBackground",{dark:qPe(NOe,.2),light:jPe(NOe,.05),hcDark:cOe,hcLight:cOe},ove(0,"Background color of the editor hover status bar.")),mRe("editorLink.activeForeground",{dark:"#4E94CE",light:hRe.blue,hcDark:hRe.cyan,hcLight:"#292929"},ove(0,"Color of active links.")),mRe("editorInlayHint.foreground",{dark:QRe,light:QRe,hcDark:hRe.black,hcLight:QRe},ove(0,"Foreground color of inline hints"))),TOe=mRe("editorInlayHint.background",{dark:$Pe(YRe,.8),light:$Pe(YRe,.6),hcDark:"#f38518",hcLight:YRe},ove(0,"Background color of inline hints")),MOe=(mRe("editorInlayHint.typeForeground",{dark:IOe,light:IOe,hcDark:IOe,hcLight:IOe},ove(0,"Foreground color of inline hints for types")),mRe("editorInlayHint.typeBackground",{dark:TOe,light:TOe,hcDark:TOe,hcLight:TOe},ove(0,"Background color of inline hints for types")),mRe("editorInlayHint.parameterForeground",{dark:IOe,light:IOe,hcDark:IOe,hcLight:IOe},ove(0,"Foreground color of inline hints for parameters")),mRe("editorInlayHint.parameterBackground",{dark:TOe,light:TOe,hcDark:TOe,hcLight:TOe},ove(0,"Background color of inline hints for parameters")),mRe("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},ove(0,"The color used for the lightbulb actions icon.")),mRe("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},ove(0,"The color used for the lightbulb auto fix actions icon.")),new hRe(new aRe(155,185,85,.2))),AOe=new hRe(new aRe(255,0,0,.2)),ROe=mRe("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},ove(0,"Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),OOe=mRe("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},ove(0,"Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),POe=(mRe("diffEditor.insertedLineBackground",{dark:MOe,light:MOe,hcDark:null,hcLight:null},ove(0,"Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),mRe("diffEditor.removedLineBackground",{dark:AOe,light:AOe,hcDark:null,hcLight:null},ove(0,"Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),mRe("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},ove(0,"Background color for the margin where lines got inserted.")),mRe("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},ove(0,"Background color for the margin where lines got removed.")),mRe("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},ove(0,"Diff overview ruler foreground for inserted content."))),FOe=mRe("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},ove(0,"Diff overview ruler foreground for removed content.")),BOe=(mRe("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},ove(0,"Outline color for the text that got inserted.")),mRe("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},ove(0,"Outline color for text that got removed.")),mRe("diffEditor.border",{dark:null,light:null,hcDark:vRe,hcLight:vRe},ove(0,"Border color between the two text editors.")),mRe("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},ove(0,"Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."))),WOe=mRe("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},ove(0,"List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),VOe=mRe("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},ove(0,"List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),HOe=mRe("list.focusOutline",{dark:_Re,light:_Re,hcDark:bRe,hcLight:bRe},ove(0,"List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),zOe=mRe("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},ove(0,"List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),UOe=mRe("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:hRe.fromHex("#0F4A85").transparent(.1)},ove(0,"List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),KOe=mRe("list.activeSelectionForeground",{dark:hRe.white,light:hRe.white,hcDark:null,hcLight:null},ove(0,"List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),jOe=mRe("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},ove(0,"List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),qOe=mRe("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:hRe.fromHex("#0F4A85").transparent(.1)},ove(0,"List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),$Oe=mRe("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},ove(0,"List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),GOe=mRe("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},ove(0,"List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),ZOe=mRe("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},ove(0,"List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),YOe=mRe("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},ove(0,"List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),QOe=mRe("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:hRe.fromHex("#0F4A85").transparent(.1)},ove(0,"List/Tree background when hovering over items using the mouse.")),XOe=mRe("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},ove(0,"List/Tree foreground when hovering over items using the mouse.")),JOe=mRe("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},ove(0,"List/Tree drag and drop background when moving items around using the mouse.")),ePe=mRe("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:_Re,hcLight:_Re},ove(0,"List/Tree foreground color of the match highlights when searching inside the list/tree.")),tPe=(mRe("list.focusHighlightForeground",{dark:ePe,light:function(e,t){return{op:5,if:e,then:t,else:"#BBE7FF"}}(UOe,ePe),hcDark:ePe,hcLight:ePe},ove(0,"List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.")),mRe("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},ove(0,"List/Tree foreground color for invalid items, for example an unresolved root in explorer.")),mRe("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},ove(0,"Foreground color of list items containing errors.")),mRe("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},ove(0,"Foreground color of list items containing warnings.")),mRe("listFilterWidget.background",{light:jPe(cOe,0),dark:qPe(cOe,0),hcDark:cOe,hcLight:cOe},ove(0,"Background color of the type filter widget in lists and trees."))),iPe=mRe("listFilterWidget.outline",{dark:hRe.transparent,light:hRe.transparent,hcDark:"#f38518",hcLight:"#007ACC"},ove(0,"Outline color of the type filter widget in lists and trees.")),nPe=mRe("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:vRe,hcLight:vRe},ove(0,"Outline color of the type filter widget in lists and trees, when there are no matches.")),oPe=mRe("listFilterWidget.shadow",{dark:CRe,light:CRe,hcDark:CRe,hcLight:CRe},ove(0,"Shadown color of the type filter widget in lists and trees.")),sPe=(mRe("list.filterMatchBackground",{dark:DOe,light:DOe,hcDark:null,hcLight:null},ove(0,"Background color of the filtered match.")),mRe("list.filterMatchBorder",{dark:EOe,light:EOe,hcDark:vRe,hcLight:bRe},ove(0,"Border color of the filtered match.")),mRe("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},ove(0,"Tree stroke color for the indentation guides."))),rPe=mRe("tree.inactiveIndentGuidesStroke",{dark:$Pe(sPe,.4),light:$Pe(sPe,.4),hcDark:$Pe(sPe,.4),hcLight:$Pe(sPe,.4)},ove(0,"Tree stroke color for the indentation guides that are not active.")),aPe=mRe("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},ove(0,"Table border color between columns.")),lPe=mRe("tree.tableOddRowsBackground",{dark:$Pe(fRe,.04),light:$Pe(fRe,.04),hcDark:null,hcLight:null},ove(0,"Background color for odd table rows.")),dPe=(mRe("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},ove(0,"List/Tree foreground color for items that are deemphasized. ")),mRe("checkbox.background",{dark:BRe,light:BRe,hcDark:BRe,hcLight:BRe},ove(0,"Background color of checkbox widget."))),hPe=(mRe("checkbox.selectBackground",{dark:cOe,light:cOe,hcDark:cOe,hcLight:cOe},ove(0,"Background color of checkbox widget when the element it's in is selected.")),mRe("checkbox.foreground",{dark:VRe,light:VRe,hcDark:VRe,hcLight:VRe},ove(0,"Foreground color of checkbox widget."))),cPe=mRe("checkbox.border",{dark:HRe,light:HRe,hcDark:HRe,hcLight:HRe},ove(0,"Border color of checkbox widget.")),uPe=(mRe("checkbox.selectBorder",{dark:cOe,light:cOe,hcDark:cOe,hcLight:cOe},ove(0,"Border color of checkbox widget when the element it's in is selected.")),mRe("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,ove(0,"Please use quickInputList.focusBackground instead"))),gPe=mRe("quickInputList.focusForeground",{dark:KOe,light:KOe,hcDark:KOe,hcLight:KOe},ove(0,"Quick picker foreground color for the focused item.")),pPe=mRe("quickInputList.focusIconForeground",{dark:jOe,light:jOe,hcDark:jOe,hcLight:jOe},ove(0,"Quick picker icon foreground color for the focused item.")),mPe=mRe("quickInputList.focusBackground",{dark:GPe(uPe,UOe),light:GPe(uPe,UOe),hcDark:null,hcLight:null},ove(0,"Quick picker background color for the focused item.")),fPe=mRe("menu.border",{dark:null,light:null,hcDark:vRe,hcLight:vRe},ove(0,"Border color of menus.")),_Pe=mRe("menu.foreground",{dark:VRe,light:VRe,hcDark:VRe,hcLight:VRe},ove(0,"Foreground color of menu items.")),vPe=mRe("menu.background",{dark:BRe,light:BRe,hcDark:BRe,hcLight:BRe},ove(0,"Background color of menu items.")),bPe=mRe("menu.selectionForeground",{dark:KOe,light:KOe,hcDark:KOe,hcLight:KOe},ove(0,"Foreground color of the selected menu item in menus.")),wPe=mRe("menu.selectionBackground",{dark:UOe,light:UOe,hcDark:UOe,hcLight:UOe},ove(0,"Background color of the selected menu item in menus.")),CPe=mRe("menu.selectionBorder",{dark:null,light:null,hcDark:bRe,hcLight:bRe},ove(0,"Border color of the selected menu item in menus.")),yPe=mRe("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:vRe,hcLight:vRe},ove(0,"Color of a separator menu item in menus.")),SPe=mRe("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},ove(0,"Toolbar background when hovering over actions using the mouse")),xPe=(mRe("toolbar.hoverOutline",{dark:null,light:null,hcDark:bRe,hcLight:bRe},ove(0,"Toolbar outline when hovering over actions using the mouse")),mRe("toolbar.activeBackground",{dark:qPe(SPe,.1),light:jPe(SPe,.1),hcDark:null,hcLight:null},ove(0,"Toolbar background when holding the mouse over actions")),mRe("editor.snippetTabstopHighlightBackground",{dark:new hRe(new aRe(124,124,124,.3)),light:new hRe(new aRe(10,50,100,.2)),hcDark:new hRe(new aRe(124,124,124,.3)),hcLight:new hRe(new aRe(10,50,100,.2))},ove(0,"Highlight background color of a snippet tabstop.")),mRe("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},ove(0,"Highlight border color of a snippet tabstop.")),mRe("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},ove(0,"Highlight background color of the final tabstop of a snippet.")),mRe("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new hRe(new aRe(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},ove(0,"Highlight border color of the final tabstop of a snippet.")),mRe("breadcrumb.foreground",{light:$Pe(fRe,.8),dark:$Pe(fRe,.8),hcDark:$Pe(fRe,.8),hcLight:$Pe(fRe,.8)},ove(0,"Color of focused breadcrumb items."))),kPe=mRe("breadcrumb.background",{light:dOe,dark:dOe,hcDark:dOe,hcLight:dOe},ove(0,"Background color of breadcrumb items.")),LPe=mRe("breadcrumb.focusForeground",{light:jPe(fRe,.2),dark:qPe(fRe,.1),hcDark:qPe(fRe,.1),hcLight:qPe(fRe,.1)},ove(0,"Color of focused breadcrumb items.")),DPe=mRe("breadcrumb.activeSelectionForeground",{light:jPe(fRe,.2),dark:qPe(fRe,.1),hcDark:qPe(fRe,.1),hcLight:qPe(fRe,.1)},ove(0,"Color of selected breadcrumb items.")),EPe=(mRe("breadcrumbPicker.background",{light:cOe,dark:cOe,hcDark:cOe,hcLight:cOe},ove(0,"Background color of breadcrumb item picker.")),hRe.fromHex("#40C8AE").transparent(.5)),NPe=hRe.fromHex("#40A6FF").transparent(.5),IPe=hRe.fromHex("#606060").transparent(.4),TPe=.4,MPe=mRe("merge.currentHeaderBackground",{dark:EPe,light:EPe,hcDark:null,hcLight:null},ove(0,"Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),APe=(mRe("merge.currentContentBackground",{dark:$Pe(MPe,TPe),light:$Pe(MPe,TPe),hcDark:$Pe(MPe,TPe),hcLight:$Pe(MPe,TPe)},ove(0,"Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),mRe("merge.incomingHeaderBackground",{dark:NPe,light:NPe,hcDark:null,hcLight:null},ove(0,"Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0)),RPe=(mRe("merge.incomingContentBackground",{dark:$Pe(APe,TPe),light:$Pe(APe,TPe),hcDark:$Pe(APe,TPe),hcLight:$Pe(APe,TPe)},ove(0,"Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),mRe("merge.commonHeaderBackground",{dark:IPe,light:IPe,hcDark:null,hcLight:null},ove(0,"Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0)),OPe=(mRe("merge.commonContentBackground",{dark:$Pe(RPe,TPe),light:$Pe(RPe,TPe),hcDark:$Pe(RPe,TPe),hcLight:$Pe(RPe,TPe)},ove(0,"Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),mRe("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},ove(0,"Border color on headers and the splitter in inline merge-conflicts."))),PPe=(mRe("editorOverviewRuler.currentContentForeground",{dark:$Pe(MPe,1),light:$Pe(MPe,1),hcDark:OPe,hcLight:OPe},ove(0,"Current overview ruler foreground for inline merge-conflicts.")),mRe("editorOverviewRuler.incomingContentForeground",{dark:$Pe(APe,1),light:$Pe(APe,1),hcDark:OPe,hcLight:OPe},ove(0,"Incoming overview ruler foreground for inline merge-conflicts.")),mRe("editorOverviewRuler.commonContentForeground",{dark:$Pe(RPe,1),light:$Pe(RPe,1),hcDark:OPe,hcLight:OPe},ove(0,"Common ancestor overview ruler foreground for inline merge-conflicts.")),mRe("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},ove(0,"Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),mRe("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},ove(0,"Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),mRe("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},ove(0,"Minimap marker color for find matches."),!0)),FPe=(mRe("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},ove(0,"Minimap marker color for repeating editor selections."),!0),mRe("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},ove(0,"Minimap marker color for the editor selection."),!0)),BPe=mRe("minimap.errorHighlight",{dark:new hRe(new aRe(255,18,18,.7)),light:new hRe(new aRe(255,18,18,.7)),hcDark:new hRe(new aRe(255,50,50,1)),hcLight:"#B5200D"},ove(0,"Minimap marker color for errors.")),WPe=mRe("minimap.warningHighlight",{dark:oOe,light:oOe,hcDark:sOe,hcLight:sOe},ove(0,"Minimap marker color for warnings.")),VPe=mRe("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},ove(0,"Minimap background color.")),HPe=mRe("minimap.foregroundOpacity",{dark:hRe.fromHex("#000f"),light:hRe.fromHex("#000f"),hcDark:hRe.fromHex("#000f"),hcLight:hRe.fromHex("#000f")},ove(0,'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.')),zPe=(mRe("minimapSlider.background",{light:$Pe(JRe,.5),dark:$Pe(JRe,.5),hcDark:$Pe(JRe,.5),hcLight:$Pe(JRe,.5)},ove(0,"Minimap slider background color.")),mRe("minimapSlider.hoverBackground",{light:$Pe(eOe,.5),dark:$Pe(eOe,.5),hcDark:$Pe(eOe,.5),hcLight:$Pe(eOe,.5)},ove(0,"Minimap slider background color when hovering.")),mRe("minimapSlider.activeBackground",{light:$Pe(tOe,.5),dark:$Pe(tOe,.5),hcDark:$Pe(tOe,.5),hcLight:$Pe(tOe,.5)},ove(0,"Minimap slider background color when clicked on.")),mRe("problemsErrorIcon.foreground",{dark:nOe,light:nOe,hcDark:nOe,hcLight:nOe},ove(0,"The color used for the problems error icon."))),UPe=mRe("problemsWarningIcon.foreground",{dark:oOe,light:oOe,hcDark:oOe,hcLight:oOe},ove(0,"The color used for the problems warning icon.")),KPe=mRe("problemsInfoIcon.foreground",{dark:rOe,light:rOe,hcDark:rOe,hcLight:rOe},ove(0,"The color used for the problems info icon."));function jPe(e,t){return{op:0,value:e,factor:t}}function qPe(e,t){return{op:1,value:e,factor:t}}function $Pe(e,t){return{op:2,value:e,factor:t}}function GPe(...e){return{op:3,values:e}}function ZPe(e,t,i,n){return{op:4,value:e,background:t,factor:i,transparency:n}}function YPe(e,t){if(null!==e)return"string"==typeof e?"#"===e[0]?hRe.fromHex(e):t.getColor(e):e instanceof hRe?e:"object"==typeof e?function(e,t){var i,n,o;switch(e.op){case 0:return null===(i=YPe(e.value,t))||void 0===i?void 0:i.darken(e.factor);case 1:return null===(n=YPe(e.value,t))||void 0===n?void 0:n.lighten(e.factor);case 2:return null===(o=YPe(e.value,t))||void 0===o?void 0:o.transparent(e.factor);case 3:for(const i of e.values){const e=YPe(i,t);if(e)return e}return;case 5:return YPe(t.defines(e.if)?e.then:e.else,t);case 4:{const i=YPe(e.value,t);if(!i)return;const n=YPe(e.background,t);return n?i.isDarkerThan(n)?hRe.getLighterColor(i,n,e.factor).transparent(e.transparency):hRe.getDarkerColor(i,n,e.factor).transparent(e.transparency):i.transparent(e.factor*e.transparency)}default:throw jxe()}}(e,t):void 0}mRe("charts.foreground",{dark:fRe,light:fRe,hcDark:fRe,hcLight:fRe},ove(0,"The foreground color used in charts.")),mRe("charts.lines",{dark:$Pe(fRe,.5),light:$Pe(fRe,.5),hcDark:$Pe(fRe,.5),hcLight:$Pe(fRe,.5)},ove(0,"The color used for horizontal lines in charts.")),mRe("charts.red",{dark:nOe,light:nOe,hcDark:nOe,hcLight:nOe},ove(0,"The red color used in chart visualizations.")),mRe("charts.blue",{dark:rOe,light:rOe,hcDark:rOe,hcLight:rOe},ove(0,"The blue color used in chart visualizations.")),mRe("charts.yellow",{dark:oOe,light:oOe,hcDark:oOe,hcLight:oOe},ove(0,"The yellow color used in chart visualizations.")),mRe("charts.orange",{dark:PPe,light:PPe,hcDark:PPe,hcLight:PPe},ove(0,"The orange color used in chart visualizations.")),mRe("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},ove(0,"The green color used in chart visualizations.")),mRe("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},ove(0,"The purple color used in chart visualizations."));const QPe="vscode://schemas/workbench-colors",XPe=RLe.as(PLe);XPe.registerSchema(QPe,pRe.getColorSchema());const JPe=new FDe((()=>XPe.notifySchemaChanged(QPe)),200);pRe.onDidChangeSchema((()=>{JPe.isScheduled()||JPe.schedule()}));class eFe{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new tFe(this.x-window.scrollX,this.y-window.scrollY)}}class tFe{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new eFe(this.clientX+window.scrollX,this.clientY+window.scrollY)}}class iFe{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}}class nFe{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function oFe(e){const t=hMe(e);return new iFe(t.left,t.top,t.width,t.height)}function sFe(e,t,i){const n=t.width/e.offsetWidth,o=t.height/e.offsetHeight,s=(i.x-t.x)/n,r=(i.y-t.y)/o;return new nFe(s,r)}class rFe extends ZIe{constructor(e,t,i){super(e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new eFe(this.posx,this.posy),this.editorPos=oFe(i),this.relativePos=sFe(i,this.editorPos,this.pos)}}class aFe{constructor(e){this._editorViewDomNode=e}_create(e){return new rFe(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return tMe(e,"contextmenu",(e=>{t(this._create(e))}))}onMouseUp(e,t){return tMe(e,"mouseup",(e=>{t(this._create(e))}))}onMouseDown(e,t){return tMe(e,LMe.MOUSE_DOWN,(e=>{t(this._create(e))}))}onPointerDown(e,t){return tMe(e,LMe.POINTER_DOWN,(e=>{t(this._create(e),e.pointerId)}))}onMouseLeave(e,t){return tMe(e,LMe.MOUSE_LEAVE,(e=>{t(this._create(e))}))}onMouseMove(e,t){return tMe(e,"mousemove",(e=>t(this._create(e))))}}class lFe{constructor(e){this._editorViewDomNode=e}_create(e){return new rFe(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return tMe(e,"pointerup",(e=>{t(this._create(e))}))}onPointerDown(e,t){return tMe(e,LMe.POINTER_DOWN,(e=>{t(this._create(e),e.pointerId)}))}onPointerLeave(e,t){return tMe(e,LMe.POINTER_LEAVE,(e=>{t(this._create(e))}))}onPointerMove(e,t){return tMe(e,"pointermove",(e=>t(this._create(e))))}}class dFe extends Owe{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new sRe),this._keydownListener=null}startMonitoring(e,t,i,n,o){this._keydownListener=iMe(document,"keydown",(e=>{e.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,e.browserEvent)}),!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,(e=>{n(new rFe(e,!0,this._editorViewDomNode))}),(e=>{this._keydownListener.dispose(),o(e)}))}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class hFe{constructor(e){this._editor=e,this._instanceId=++hFe._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new FDe((()=>this.garbageCollect()),1e3)}createClassNameRef(e){const t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){const t=this.computeUniqueKey(e);let i=this._rules.get(t);if(!i){const n=this._counter++;i=new cFe(t,`dyn-rule-${this._instanceId}-${n}`,bMe(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,i)}return i}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}}hFe._idPool=0;class cFe{constructor(e,t,i,n){this.key=e,this.className=t,this.properties=n,this._referenceCount=0,this._styleElement=yMe(i),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(const e in t){const n=t[e];let o;o="object"==typeof n?uRe(n.id):n,i+=`\n\t${uFe(e)}: ${o};`}return i+="\n}",i}dispose(){this._styleElement.remove()}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function uFe(e){return e.replace(/(^[A-Z])/,(([e])=>e.toLowerCase())).replace(/([A-Z])/g,(([e])=>`-${e.toLowerCase()}`))}class gFe extends Owe{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,n=e.length;i<n;i++){const n=e[i];switch(n.type){case 0:this.onCompositionStart(n)&&(t=!0);break;case 1:this.onCompositionEnd(n)&&(t=!0);break;case 2:this.onConfigurationChanged(n)&&(t=!0);break;case 3:this.onCursorStateChanged(n)&&(t=!0);break;case 4:this.onDecorationsChanged(n)&&(t=!0);break;case 5:this.onFlushed(n)&&(t=!0);break;case 6:this.onFocusChanged(n)&&(t=!0);break;case 7:this.onLanguageConfigurationChanged(n)&&(t=!0);break;case 8:this.onLineMappingChanged(n)&&(t=!0);break;case 9:this.onLinesChanged(n)&&(t=!0);break;case 10:this.onLinesDeleted(n)&&(t=!0);break;case 11:this.onLinesInserted(n)&&(t=!0);break;case 12:this.onRevealRangeRequest(n)&&(t=!0);break;case 13:this.onScrollChanged(n)&&(t=!0);break;case 15:this.onTokensChanged(n)&&(t=!0);break;case 14:this.onThemeChanged(n)&&(t=!0);break;case 16:this.onTokensColorsChanged(n)&&(t=!0);break;case 17:this.onZonesChanged(n)&&(t=!0);break;default:console.info("View received unknown event: "),console.info(n)}}t&&(this._shouldRender=!0)}}class pFe extends gFe{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class mFe{static write(e,t){e.setAttribute("data-mprt",String(t))}static read(e){const t=e.getAttribute("data-mprt");return null===t?0:parseInt(t,10)}static collect(e,t){const i=[];let n=0;for(;e&&e!==document.body&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(i[n++]=this.read(e)),e=e.parentElement;const o=new Uint8Array(n);for(let e=0;e<n;e++)o[e]=i[n-e-1];return o}}class fFe{constructor(e,t){this._restrictedRenderingContextBrand=void 0,this._viewLayout=e,this.viewportData=t,this.scrollWidth=this._viewLayout.getScrollWidth(),this.scrollHeight=this._viewLayout.getScrollHeight(),this.visibleRange=this.viewportData.visibleRange,this.bigNumbersDelta=this.viewportData.bigNumbersDelta;const i=this._viewLayout.getCurrentViewport();this.scrollTop=i.top,this.scrollLeft=i.left,this.viewportWidth=i.width,this.viewportHeight=i.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e,t){return this._viewLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t){return this._viewLayout.getVerticalOffsetAfterLineNumber(e,t)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}class _Fe extends fFe{constructor(e,t,i){super(e,t),this._renderingContextBrand=void 0,this._viewLines=i}linesVisibleRangesForRange(e,t){return this._viewLines.linesVisibleRangesForRange(e,t)}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)}}class vFe{constructor(e,t,i){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i}}class bFe{static from(e){const t=new Array(e.length);for(let i=0,n=e.length;i<n;i++){const n=e[i];t[i]=new bFe(n.left,n.width)}return t}constructor(e,t){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(t)}toString(){return`[${this.left},${this.width}]`}}class wFe{constructor(e,t){this._floatHorizontalRangeBrand=void 0,this.left=e,this.width=t}toString(){return`[${this.left},${this.width}]`}static compare(e,t){return e.left-t.left}}class CFe{constructor(e,t){this.outsideRenderedLine=e,this.originalLeft=t,this.left=Math.round(this.originalLeft)}}class yFe{constructor(e,t){this.outsideRenderedLine=e,this.ranges=t}}class SFe{static _createRange(){return this._handyReadyRange||(this._handyReadyRange=document.createRange()),this._handyReadyRange}static _detachRange(e,t){e.selectNodeContents(t)}static _readClientRects(e,t,i,n,o){const s=this._createRange();try{return s.setStart(e,t),s.setEnd(i,n),s.getClientRects()}catch(e){return null}finally{this._detachRange(s,o)}}static _mergeAdjacentRanges(e){if(1===e.length)return e;e.sort(wFe.compare);const t=[];let i=0,n=e[0];for(let o=1,s=e.length;o<s;o++){const s=e[o];n.left+n.width+.9>=s.left?n.width=Math.max(n.width,s.left+s.width-n.left):(t[i++]=n,n=s)}return t[i++]=n,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||0===e.length)return null;const n=[];for(let o=0,s=e.length;o<s;o++){const s=e[o];n[o]=new wFe(Math.max(0,(s.left-t)/i),s.width/i)}return this._mergeAdjacentRanges(n)}static readHorizontalRanges(e,t,i,n,o,s,r,a){const l=e.children.length-1;if(0>l)return null;if((t=Math.min(l,Math.max(0,t)))===(n=Math.min(l,Math.max(0,n)))&&i===o&&0===i&&!e.children[t].firstChild){const i=e.children[t].getClientRects();return this._createHorizontalRangesFromClientRects(i,s,r)}t!==n&&n>0&&0===o&&(n--,o=1073741824);let d=e.children[t].firstChild,h=e.children[n].firstChild;if(d&&h||(!d&&0===i&&t>0&&(d=e.children[t-1].firstChild,i=1073741824),!h&&0===o&&n>0&&(h=e.children[n-1].firstChild,o=1073741824)),!d||!h)return null;i=Math.min(d.textContent.length,Math.max(0,i)),o=Math.min(h.textContent.length,Math.max(0,o));const c=this._readClientRects(d,i,h,o,a);return this._createHorizontalRangesFromClientRects(c,s,r)}}var xFe;function kFe(e){return e===xFe.HIGH_CONTRAST_DARK||e===xFe.HIGH_CONTRAST_LIGHT}function LFe(e){return e===xFe.DARK||e===xFe.HIGH_CONTRAST_DARK}!function(e){e.DARK="dark",e.LIGHT="light",e.HIGH_CONTRAST_DARK="hcDark",e.HIGH_CONTRAST_LIGHT="hcLight"}(xFe||(xFe={}));const DFe=!!Nve||!(Eve||bxe||yxe);let EFe=!0;class NFe{readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1,this.endNode=t}}class IFe{constructor(e,t){this.themeType=t;const i=e.options,n=i.get(47),o=i.get(35);this.renderWhitespace="off"===o?i.get(93):"none",this.renderControlCharacters=i.get(88),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(30),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(63),this.stopRenderingLineAfter=i.get(111),this.fontLigatures=i.get(48)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}class TFe{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(!this._renderedViewLine)throw new Error("I have no rendered view line to set the dom node to...");this._renderedViewLine.domNode=Ixe(e)}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return!(!kFe(this._options.themeType)&&"selection"!==this._options.renderWhitespace||(this._isMaybeInvalid=!0,0))}renderLine(e,t,i,n){if(!1===this._isMaybeInvalid)return!1;this._isMaybeInvalid=!1;const o=i.getViewLineRenderingData(e),s=this._options,r=UNe.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let a=null;if(kFe(s.themeType)||"selection"===this._options.renderWhitespace){const t=i.selections;for(const i of t){if(i.endLineNumber<e||i.startLineNumber>e)continue;const t=i.startLineNumber===e?i.startColumn:o.minColumn,n=i.endLineNumber===e?i.endColumn:o.maxColumn;t<n&&(kFe(s.themeType)&&r.push(new UNe(t,n,"inline-selected-text",0)),"selection"===this._options.renderWhitespace&&(a||(a=[]),a.push(new GNe(t-1,n-1))))}}const l=new ZNe(s.useMonospaceOptimizations,s.canUseHalfwidthRightwardsArrow,o.content,o.continuesWithWrappedLine,o.isBasicASCII,o.containsRTL,o.minColumn-1,o.tokens,r,o.tabSize,o.startVisibleColumn,s.spaceWidth,s.middotWidth,s.wsmiddotWidth,s.stopRenderingLineAfter,s.renderWhitespace,s.renderControlCharacters,s.fontLigatures!==ewe.OFF,a);if(this._renderedViewLine&&this._renderedViewLine.input.equals(l))return!1;n.appendString('<div style="top:'),n.appendString(String(t)),n.appendString("px;height:"),n.appendString(String(this._options.lineHeight)),n.appendString('px;" class="'),n.appendString(TFe.CLASS_NAME),n.appendString('">');const d=JNe(l,n);n.appendString("</div>");let h=null;return EFe&&DFe&&o.isBasicASCII&&s.useMonospaceOptimizations&&0===d.containsForeignElements&&(h=new MFe(this._renderedViewLine?this._renderedViewLine.domNode:null,l,d.characterMapping)),h||(h=OFe(this._renderedViewLine?this._renderedViewLine.domNode:null,l,d.characterMapping,d.containsRTL,d.containsForeignElements)),this._renderedViewLine=h,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(){return this._renderedViewLine?this._renderedViewLine.getWidth():0}getWidthIsFast(){return!this._renderedViewLine||this._renderedViewLine.getWidthIsFast()}needsMonospaceFontCheck(){return!!this._renderedViewLine&&this._renderedViewLine instanceof MFe}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof MFe?this._renderedViewLine.monospaceAssumptionsAreValid():EFe}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof MFe&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,n){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));const o=this._renderedViewLine.input.stopRenderingLineAfter;if(-1!==o&&t>o+1&&i>o+1)return new yFe(!0,[new wFe(this.getWidth(),0)]);-1!==o&&t>o+1&&(t=o+1),-1!==o&&i>o+1&&(i=o+1);const s=this._renderedViewLine.getVisibleRangesForRange(e,t,i,n);return s&&s.length>0?new yFe(!1,s):null}getColumnOfNodeOffset(e,t,i){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t,i):1}}TFe.CLASS_NAME="view-line";class MFe{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const n=Math.floor(t.lineContent.length/300);if(n>0){this._keyColumnPixelOffsetCache=new Float32Array(n);for(let e=0;e<n;e++)this._keyColumnPixelOffsetCache[e]=-1}else this._keyColumnPixelOffsetCache=null;this._characterMapping=i,this._charWidth=t.spaceWidth}getWidth(){if(!this.domNode||this.input.lineContent.length<300){const e=this._characterMapping.getHorizontalOffset(this._characterMapping.length);return Math.round(this._charWidth*e)}return-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth),this._cachedWidth}getWidthIsFast(){return this.input.lineContent.length<300||-1!==this._cachedWidth}monospaceAssumptionsAreValid(){if(!this.domNode)return EFe;if(this.input.lineContent.length<300){const e=this.getWidth(),t=this.domNode.domNode.firstChild.offsetWidth;Math.abs(e-t)>=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),EFe=!1)}return EFe}toSlowRenderedLine(){return OFe(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i,n){const o=this._getColumnPixelOffset(e,t,n),s=this._getColumnPixelOffset(e,i,n);return[new wFe(o,s-o)]}_getColumnPixelOffset(e,t,i){if(t<=300){const e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}const n=Math.floor((t-1)/300)-1,o=300*(n+1)+1;let s=-1;if(this._keyColumnPixelOffsetCache&&(s=this._keyColumnPixelOffsetCache[n],-1===s&&(s=this._actualReadPixelOffset(e,o,i),this._keyColumnPixelOffsetCache[n]=s)),-1===s){const e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}const r=this._characterMapping.getHorizontalOffset(o),a=this._characterMapping.getHorizontalOffset(t);return s+this._charWidth*(a-r)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;const n=this._characterMapping.getDomPosition(t),o=SFe.readHorizontalRanges(this._getReadingTarget(this.domNode),n.partIndex,n.charIndex,n.partIndex,n.charIndex,i.clientRectDeltaLeft,i.clientRectScale,i.endNode);return o&&0!==o.length?o[0].left:-1}getColumnOfNodeOffset(e,t,i){const n=t.textContent.length;let o=-1;for(;t;)t=t.previousSibling,o++;return this._characterMapping.getColumn(new YNe(o,i),n)}}class AFe{constructor(e,t,i,n,o){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!n||0===this._characterMapping.length){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let e=0,t=this._characterMapping.length;e<=t;e++)this._pixelOffsetCache[e]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(){return this.domNode?(-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth),this._cachedWidth):0}getWidthIsFast(){return-1!==this._cachedWidth}getVisibleRangesForRange(e,t,i,n){if(!this.domNode)return null;if(null!==this._pixelOffsetCache){const o=this._readPixelOffset(this.domNode,e,t,n);if(-1===o)return null;const s=this._readPixelOffset(this.domNode,e,i,n);return-1===s?null:[new wFe(o,s-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,n)}_readVisibleRangesForRange(e,t,i,n,o){if(i===n){const n=this._readPixelOffset(e,t,i,o);return-1===n?null:[new wFe(n,0)]}return this._readRawVisibleRangesForRange(e,i,n,o)}_readPixelOffset(e,t,i,n){if(0===this._characterMapping.length){if(0===this._containsForeignElements)return 0;if(2===this._containsForeignElements)return 0;if(1===this._containsForeignElements)return this.getWidth();const t=this._getReadingTarget(e);return t.firstChild?t.firstChild.offsetWidth:0}if(null!==this._pixelOffsetCache){const o=this._pixelOffsetCache[i];if(-1!==o)return o;const s=this._actualReadPixelOffset(e,t,i,n);return this._pixelOffsetCache[i]=s,s}return this._actualReadPixelOffset(e,t,i,n)}_actualReadPixelOffset(e,t,i,n){if(0===this._characterMapping.length){const t=SFe.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,n.clientRectDeltaLeft,n.clientRectScale,n.endNode);return t&&0!==t.length?t[0].left:-1}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&0===this._containsForeignElements)return this.getWidth();const o=this._characterMapping.getDomPosition(i),s=SFe.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,n.clientRectDeltaLeft,n.clientRectScale,n.endNode);if(!s||0===s.length)return-1;const r=s[0].left;if(this.input.isBasicASCII){const e=this._characterMapping.getHorizontalOffset(i),t=Math.round(this.input.spaceWidth*e);if(Math.abs(t-r)<=1)return t}return r}_readRawVisibleRangesForRange(e,t,i,n){if(1===t&&i===this._characterMapping.length)return[new wFe(0,this.getWidth())];const o=this._characterMapping.getDomPosition(t),s=this._characterMapping.getDomPosition(i);return SFe.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,s.partIndex,s.charIndex,n.clientRectDeltaLeft,n.clientRectScale,n.endNode)}getColumnOfNodeOffset(e,t,i){const n=t.textContent.length;let o=-1;for(;t;)t=t.previousSibling,o++;return this._characterMapping.getColumn(new YNe(o,i),n)}}class RFe extends AFe{_readVisibleRangesForRange(e,t,i,n,o){const s=super._readVisibleRangesForRange(e,t,i,n,o);if(!s||0===s.length||i===n||1===i&&n===this._characterMapping.length)return s;if(!this.input.containsRTL){const i=this._readPixelOffset(e,t,n,o);if(-1!==i){const e=s[s.length-1];e.left<i&&(e.width=i-e.left)}}return s}}const OFe=wxe?function(e,t,i,n,o){return new RFe(e,t,i,n,o)}:function(e,t,i,n,o){return new AFe(e,t,i,n,o)};class PFe{static _nextVisibleColumn(e,t,i){return 9===e?PFe.nextRenderTabStop(t,i):ixe(e)||nxe(e)?t+2:t+1}static visibleColumnFromColumn(e,t,i){const n=Math.min(t-1,e.length),o=e.substring(0,n),s=new $Se(o);let r=0;for(;!s.eol();){const e=jSe(o,n,s.offset);s.nextGraphemeLength(),r=this._nextVisibleColumn(e,r,i)}return r}static columnFromVisibleColumn(e,t,i){if(t<=0)return 1;const n=e.length,o=new $Se(e);let s=0,r=1;for(;!o.eol();){const a=jSe(e,n,o.offset);o.nextGraphemeLength();const l=this._nextVisibleColumn(a,s,i),d=o.offset+1;if(l>=t)return l-t<t-s?d:r;s=l,r=d}return n+1}static nextRenderTabStop(e,t){return e+t-e%t}static nextIndentTabStop(e,t){return e+t-e%t}static prevRenderTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}static prevIndentTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}}class FFe{static whitespaceVisibleColumn(e,t,i){const n=e.length;let o=0,s=-1,r=-1;for(let a=0;a<n;a++){if(a===t)return[s,r,o];switch(o%i==0&&(s=a,r=o),e.charCodeAt(a)){case 32:o+=1;break;case 9:o=PFe.nextRenderTabStop(o,i);break;default:return[-1,-1,-1]}}return t===n?[s,r,o]:[-1,-1,-1]}static atomicPosition(e,t,i,n){const o=e.length,[s,r,a]=FFe.whitespaceVisibleColumn(e,t,i);if(-1===a)return-1;let l;switch(n){case 0:l=!0;break;case 1:l=!1;break;case 2:if(a%i==0)return t;l=a%i<=i/2}if(l){if(-1===s)return-1;let t=r;for(let n=s;n<o;++n){if(t===r+i)return s;switch(e.charCodeAt(n)){case 32:t+=1;break;case 9:t=PFe.nextRenderTabStop(t,i);break;default:return-1}}return t===r+i?s:-1}const d=PFe.nextRenderTabStop(a,i);let h=a;for(let n=t;n<o;n++){if(h===d)return n;switch(e.charCodeAt(n)){case 32:h+=1;break;case 9:h=PFe.nextRenderTabStop(h,i);break;default:return-1}}return h===d?o:-1}}class BFe{constructor(e=null){this.hitTarget=e,this.type=0}}class WFe{constructor(e,t,i){this.position=e,this.spanNode=t,this.injectedText=i,this.type=1}}var VFe;!function(e){e.createFromDOMInfo=function(e,t,i){const n=e.getPositionFromDOMInfo(t,i);return n?new WFe(n,t,null):new BFe(t)}}(VFe||(VFe={}));class HFe{constructor(e,t){this.lastViewCursorsRenderData=e,this.lastTextareaPosition=t}}class zFe{static _deduceRage(e,t=null){return!t&&e?new dye(e.lineNumber,e.column,e.lineNumber,e.column):null!=t?t:null}static createUnknown(e,t,i){return{type:0,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createTextarea(e,t){return{type:1,element:e,mouseColumn:t,position:null,range:null}}static createMargin(e,t,i,n,o,s){return{type:e,element:t,mouseColumn:i,position:n,range:o,detail:s}}static createViewZone(e,t,i,n,o){return{type:e,element:t,mouseColumn:i,position:n,range:this._deduceRage(n),detail:o}}static createContentText(e,t,i,n,o){return{type:6,element:e,mouseColumn:t,position:i,range:this._deduceRage(i,n),detail:o}}static createContentEmpty(e,t,i,n){return{type:7,element:e,mouseColumn:t,position:i,range:this._deduceRage(i),detail:n}}static createContentWidget(e,t,i){return{type:9,element:e,mouseColumn:t,position:null,range:null,detail:i}}static createScrollbar(e,t,i){return{type:11,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createOverlayWidget(e,t,i){return{type:12,element:e,mouseColumn:t,position:null,range:null,detail:i}}static createOutsideEditor(e,t,i,n){return{type:13,element:null,mouseColumn:e,position:t,range:this._deduceRage(t),outsidePosition:i,outsideDistance:n}}static _typeToString(e){return 1===e?"TEXTAREA":2===e?"GUTTER_GLYPH_MARGIN":3===e?"GUTTER_LINE_NUMBERS":4===e?"GUTTER_LINE_DECORATIONS":5===e?"GUTTER_VIEW_ZONE":6===e?"CONTENT_TEXT":7===e?"CONTENT_EMPTY":8===e?"CONTENT_VIEW_ZONE":9===e?"CONTENT_WIDGET":10===e?"OVERVIEW_RULER":11===e?"SCROLLBAR":12===e?"OVERLAY_WIDGET":"UNKNOWN"}static toString(e){return this._typeToString(e.type)+": "+e.position+" - "+e.range+" - "+JSON.stringify(e.detail)}}class UFe{static isTextArea(e){return 2===e.length&&3===e[0]&&6===e[1]}static isChildOfViewLines(e){return e.length>=4&&3===e[0]&&7===e[3]}static isStrictChildOfViewLines(e){return e.length>4&&3===e[0]&&7===e[3]}static isChildOfScrollableElement(e){return e.length>=2&&3===e[0]&&5===e[1]}static isChildOfMinimap(e){return e.length>=2&&3===e[0]&&8===e[1]}static isChildOfContentWidgets(e){return e.length>=4&&3===e[0]&&1===e[3]}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&2===e[0]}static isChildOfOverlayWidgets(e){return e.length>=2&&3===e[0]&&4===e[1]}}class KFe{constructor(e,t,i){this.viewModel=e.viewModel;const n=e.configuration.options;this.layoutInfo=n.get(138),this.viewDomNode=t.viewDomNode,this.lineHeight=n.get(63),this.stickyTabStops=n.get(110),this.typicalHalfwidthCharacterWidth=n.get(47).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return KFe.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const n=i.verticalOffset+i.height/2,o=e.viewModel.getLineCount();let s,r=null,a=null;return i.afterLineNumber!==o&&(a=new lye(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new lye(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),s=null===a?r:null===r?a:t<n?r:a,{viewZoneId:i.id,afterLineNumber:i.afterLineNumber,positionBefore:r,positionAfter:a,position:s}}return null}getFullLineRangeAtCoord(e){if(this._context.viewLayout.isAfterLines(e)){const e=this._context.viewModel.getLineCount(),t=this._context.viewModel.getLineMaxColumn(e);return{range:new dye(e,t,e,t),isAfterLines:!0}}const t=this._context.viewLayout.getLineNumberAtVerticalOffset(e),i=this._context.viewModel.getLineMaxColumn(t);return{range:new dye(t,1,t,i),isAfterLines:!1}}getLineNumberAtVerticalOffset(e){return this._context.viewLayout.getLineNumberAtVerticalOffset(e)}isAfterLines(e){return this._context.viewLayout.isAfterLines(e)}isInTopPadding(e){return this._context.viewLayout.isInTopPadding(e)}isInBottomPadding(e){return this._context.viewLayout.isInBottomPadding(e)}getVerticalOffsetForLineNumber(e){return this._context.viewLayout.getVerticalOffsetForLineNumber(e)}findAttribute(e,t){return KFe._findAttribute(e,t,this._viewHelper.viewDomNode)}static _findAttribute(e,t,i){for(;e&&e!==document.body;){if(e.hasAttribute&&e.hasAttribute(t))return e.getAttribute(t);if(e===i)return null;e=e.parentNode}return null}getLineWidth(e){return this._viewHelper.getLineWidth(e)}visibleRangeForPosition(e,t){return this._viewHelper.visibleRangeForPosition(e,t)}getPositionFromDOMInfo(e,t){return this._viewHelper.getPositionFromDOMInfo(e,t)}getCurrentScrollTop(){return this._context.viewLayout.getCurrentScrollTop()}getCurrentScrollLeft(){return this._context.viewLayout.getCurrentScrollLeft()}}class jFe{constructor(e,t,i,n){this.editorPos=t,this.pos=i,this.relativePos=n,this.mouseVerticalOffset=Math.max(0,e.getCurrentScrollTop()+this.relativePos.y),this.mouseContentHorizontalOffset=e.getCurrentScrollLeft()+this.relativePos.x-e.layoutInfo.contentLeft,this.isInMarginArea=this.relativePos.x<e.layoutInfo.contentLeft&&this.relativePos.x>=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,ZFe._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class qFe extends jFe{constructor(e,t,i,n,o){super(e,t,i,n),this._ctx=e,o?(this.target=o,this.targetPath=mFe.collect(o,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}\n\ttarget: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?PFe.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return zFe.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return zFe.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,i,n){return zFe.createMargin(e,this.target,this._getMouseColumn(t),t,i,n)}fulfillViewZone(e,t,i){return zFe.createViewZone(e,this.target,this._getMouseColumn(t),t,i)}fulfillContentText(e,t,i){return zFe.createContentText(this.target,this._getMouseColumn(e),e,t,i)}fulfillContentEmpty(e,t){return zFe.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return zFe.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return zFe.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return zFe.createOverlayWidget(this.target,this._getMouseColumn(),e)}withTarget(e){return new qFe(this._ctx,this.editorPos,this.pos,this.relativePos,e)}}const $Fe={isAfterLines:!0};function GFe(e){return{isAfterLines:!1,horizontalDistanceToText:e}}class ZFe{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=mFe.collect(t,this._viewHelper.viewDomNode);return!(!UFe.isChildOfContentWidgets(i)&&!UFe.isChildOfOverflowingContentWidgets(i)&&!UFe.isChildOfOverlayWidgets(i))}createMouseTarget(e,t,i,n,o){const s=new KFe(this._context,this._viewHelper,e),r=new qFe(s,t,i,n,o);try{const e=ZFe._createMouseTarget(s,r,!1);if(6===e.type&&s.stickyTabStops&&null!==e.position){const t=ZFe._snapToSoftTabBoundary(e.position,s.viewModel),i=dye.fromPositions(t,t).plusRange(e.range);return r.fulfillContentText(t,i,e.detail)}return e}catch(e){return r.fulfillUnknown()}}static _createMouseTarget(e,t,i){if(null===t.target){if(i)return t.fulfillUnknown();const n=ZFe._doHitTest(e,t);return 1===n.type?ZFe.createMouseTargetFromHitTestPosition(e,t,n.spanNode,n.position,n.injectedText):this._createMouseTarget(e,t.withTarget(n.hitTarget),!0)}const n=t;let o=null;return o=o||ZFe._hitTestContentWidget(e,n),o=o||ZFe._hitTestOverlayWidget(e,n),o=o||ZFe._hitTestMinimap(e,n),o=o||ZFe._hitTestScrollbarSlider(e,n),o=o||ZFe._hitTestViewZone(e,n),o=o||ZFe._hitTestMargin(e,n),o=o||ZFe._hitTestViewCursor(e,n),o=o||ZFe._hitTestTextArea(e,n),o=o||ZFe._hitTestViewLines(e,n,i),o=o||ZFe._hitTestScrollbar(e,n),o||t.fulfillUnknown()}static _hitTestContentWidget(e,t){if(UFe.isChildOfContentWidgets(t.targetPath)||UFe.isChildOfOverflowingContentWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillContentWidget(i):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(UFe.isChildOfOverlayWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillOverlayWidget(i):t.fulfillUnknown()}return null}static _hitTestViewCursor(e,t){if(t.target){const i=e.lastRenderData.lastViewCursorsRenderData;for(const e of i)if(t.target===e.domNode)return t.fulfillContentText(e.position,null,{mightBeForeignElement:!1,injectedText:null})}if(t.isInContentArea){const i=e.lastRenderData.lastViewCursorsRenderData,n=t.mouseContentHorizontalOffset,o=t.mouseVerticalOffset;for(const s of i){if(n<s.contentLeft)continue;if(n>s.contentLeft+s.width)continue;const i=e.getVerticalOffsetForLineNumber(s.position.lineNumber);if(i<=o&&o<=i+s.height)return t.fulfillContentText(s.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const e=t.isInContentArea?8:5;return t.fulfillViewZone(e,i.position,i)}return null}static _hitTestTextArea(e,t){return UFe.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),n=i.range.getStartPosition();let o=Math.abs(t.relativePos.x);const s={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};return o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth?t.fulfillMargin(2,n,i.range,s):(o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,n,i.range,s):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,n,i.range,s)))}return null}static _hitTestViewLines(e,t,i){if(!UFe.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new lye(1,1),$Fe);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const i=e.viewModel.getLineCount(),n=e.viewModel.getLineMaxColumn(i);return t.fulfillContentEmpty(new lye(i,n),$Fe)}if(i){if(UFe.isStrictChildOfViewLines(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(0===e.viewModel.getLineLength(i)){const n=e.getLineWidth(i),o=GFe(t.mouseContentHorizontalOffset-n);return t.fulfillContentEmpty(new lye(i,1),o)}const n=e.getLineWidth(i);if(t.mouseContentHorizontalOffset>=n){const o=GFe(t.mouseContentHorizontalOffset-n),s=new lye(i,e.viewModel.getLineMaxColumn(i));return t.fulfillContentEmpty(s,o)}}return t.fulfillUnknown()}const n=ZFe._doHitTest(e,t);return 1===n.type?ZFe.createMouseTargetFromHitTestPosition(e,t,n.spanNode,n.position,n.injectedText):this._createMouseTarget(e,t.withTarget(n.hitTarget),!0)}static _hitTestMinimap(e,t){if(UFe.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new lye(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(UFe.isChildOfScrollableElement(t.targetPath)&&t.target&&1===t.target.nodeType){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new lye(i,n))}}return null}static _hitTestScrollbar(e,t){if(UFe.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new lye(i,n))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(138),n=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return ZFe._getMouseColumn(n,t.get(47).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,n,o){const s=n.lineNumber,r=n.column,a=e.getLineWidth(s);if(t.mouseContentHorizontalOffset>a){const e=GFe(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(n,e)}const l=e.visibleRangeForPosition(s,r);if(!l)return t.fulfillUnknown(n);const d=l.left;if(Math.abs(t.mouseContentHorizontalOffset-d)<1)return t.fulfillContentText(n,null,{mightBeForeignElement:!!o,injectedText:o});const h=[];if(h.push({offset:l.left,column:r}),r>1){const t=e.visibleRangeForPosition(s,r-1);t&&h.push({offset:t.left,column:r-1})}if(r<e.viewModel.getLineMaxColumn(s)){const t=e.visibleRangeForPosition(s,r+1);t&&h.push({offset:t.left,column:r+1})}h.sort(((e,t)=>e.offset-t.offset));const c=t.pos.toClientCoordinates(),u=i.getBoundingClientRect(),g=u.left<=c.clientX&&c.clientX<=u.right;let p=null;for(let e=1;e<h.length;e++){const i=h[e-1],o=h[e];if(i.offset<=t.mouseContentHorizontalOffset&&t.mouseContentHorizontalOffset<=o.offset){p=new dye(s,i.column,s,o.column);const e=Math.abs(i.offset-t.mouseContentHorizontalOffset),r=Math.abs(o.offset-t.mouseContentHorizontalOffset);n=new lye(s,e<r?i.column:o.column);break}}return t.fulfillContentText(n,p,{mightBeForeignElement:!g||!!o,injectedText:o})}static _doHitTestWithCaretRangeFromPoint(e,t){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.getVerticalOffsetForLineNumber(i),o=n+e.lineHeight;if(!(i===e.viewModel.getLineCount()&&t.mouseVerticalOffset>o)){const i=Math.floor((n+o)/2);let s=t.pos.y+(i-t.mouseVerticalOffset);s<=t.editorPos.y&&(s=t.editorPos.y+1),s>=t.editorPos.y+t.editorPos.height&&(s=t.editorPos.y+t.editorPos.height-1);const r=new eFe(t.pos.x,s),a=this._actualDoHitTestWithCaretRangeFromPoint(e,r.toClientCoordinates());if(1===a.type)return a}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=wMe(e.viewDomNode);let n;if(n=i?void 0===i.caretRangeFromPoint?function(e,t,i){const n=document.createRange();let o=e.elementFromPoint(t,i);if(null!==o){for(;o&&o.firstChild&&o.firstChild.nodeType!==o.firstChild.TEXT_NODE&&o.lastChild&&o.lastChild.firstChild;)o=o.lastChild;const e=o.getBoundingClientRect(),i=window.getComputedStyle(o,null).getPropertyValue("font"),s=o.innerText;let r,a=e.left,l=0;if(t>e.left+e.width)l=s.length;else{const e=YFe.getInstance();for(let n=0;n<s.length+1;n++){if(r=e.getCharWidth(s.charAt(n),i)/2,a+=r,t<a){l=n;break}a+=r}}n.setStart(o.firstChild,l),n.setEnd(o.firstChild,l)}return n}(i,t.clientX,t.clientY):i.caretRangeFromPoint(t.clientX,t.clientY):document.caretRangeFromPoint(t.clientX,t.clientY),!n||!n.startContainer)return new BFe;const o=n.startContainer;if(o.nodeType===o.TEXT_NODE){const t=o.parentNode,i=t?t.parentNode:null,s=i?i.parentNode:null;return(s&&s.nodeType===s.ELEMENT_NODE?s.className:null)===TFe.CLASS_NAME?VFe.createFromDOMInfo(e,t,n.startOffset):new BFe(o.parentNode)}if(o.nodeType===o.ELEMENT_NODE){const t=o.parentNode,i=t?t.parentNode:null;return(i&&i.nodeType===i.ELEMENT_NODE?i.className:null)===TFe.CLASS_NAME?VFe.createFromDOMInfo(e,o,o.textContent.length):new BFe(o)}return new BFe}static _doHitTestWithCaretPositionFromPoint(e,t){const i=document.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const t=i.offsetNode.parentNode,n=t?t.parentNode:null,o=n?n.parentNode:null;return(o&&o.nodeType===o.ELEMENT_NODE?o.className:null)===TFe.CLASS_NAME?VFe.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new BFe(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const t=i.offsetNode.parentNode,n=t&&t.nodeType===t.ELEMENT_NODE?t.className:null,o=t?t.parentNode:null,s=o&&o.nodeType===o.ELEMENT_NODE?o.className:null;if(n===TFe.CLASS_NAME){const t=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(t)return VFe.createFromDOMInfo(e,t,0)}else if(s===TFe.CLASS_NAME)return VFe.createFromDOMInfo(e,i.offsetNode,0)}return new BFe(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:n}=t.model.getOptions(),o=FFe.atomicPosition(i,e.column-1,n,2);return-1!==o?new lye(e.lineNumber,o+1):e}static _doHitTest(e,t){let i=new BFe;if("function"==typeof document.caretRangeFromPoint?i=this._doHitTestWithCaretRangeFromPoint(e,t):document.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates())),1===i.type){const t=e.viewModel.getInjectedTextAt(i.position),n=e.viewModel.normalizePosition(i.position,2);!t&&n.equals(i.position)||(i=new WFe(n,i.spanNode,t))}return i}}class YFe{static getInstance(){return YFe._INSTANCE||(YFe._INSTANCE=new YFe),YFe._INSTANCE}constructor(){this._cache={},this._canvas=document.createElement("canvas")}getCharWidth(e,t){const i=e+t;if(this._cache[i])return this._cache[i];const n=this._canvas.getContext("2d");n.font=t;const o=n.measureText(e).width;return this._cache[i]=o,o}}YFe._INSTANCE=null;class QFe extends Owe{onclick(e,t){this._register(tMe(e,LMe.CLICK,(e=>t(new ZIe(e)))))}onmousedown(e,t){this._register(tMe(e,LMe.MOUSE_DOWN,(e=>t(new ZIe(e)))))}onmouseover(e,t){this._register(tMe(e,LMe.MOUSE_OVER,(e=>t(new ZIe(e)))))}onmouseleave(e,t){this._register(tMe(e,LMe.MOUSE_LEAVE,(e=>t(new ZIe(e)))))}onkeydown(e,t){this._register(tMe(e,LMe.KEY_DOWN,(e=>t(new KIe(e)))))}onkeyup(e,t){this._register(tMe(e,LMe.KEY_UP,(e=>t(new KIe(e)))))}oninput(e,t){this._register(tMe(e,LMe.INPUT,t))}onblur(e,t){this._register(tMe(e,LMe.BLUR,t))}onfocus(e,t){this._register(tMe(e,LMe.FOCUS,t))}ignoreGesture(e){return oRe.ignoreTarget(e)}}class XFe extends QFe{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",void 0!==e.top&&(this.bgDomNode.style.top="0px"),void 0!==e.left&&(this.bgDomNode.style.left="0px"),void 0!==e.bottom&&(this.bgDomNode.style.bottom="0px"),void 0!==e.right&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...sAe.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width="11px",this.domNode.style.height="11px",void 0!==e.top&&(this.domNode.style.top=e.top+"px"),void 0!==e.left&&(this.domNode.style.left=e.left+"px"),void 0!==e.bottom&&(this.domNode.style.bottom=e.bottom+"px"),void 0!==e.right&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new sRe),this._register(iMe(this.bgDomNode,LMe.POINTER_DOWN,(e=>this._arrowPointerDown(e)))),this._register(iMe(this.domNode,LMe.POINTER_DOWN,(e=>this._arrowPointerDown(e)))),this._pointerdownRepeatTimer=this._register(new PDe),this._pointerdownScheduleRepeatTimer=this._register(new ODe)}_arrowPointerDown(e){e.target&&e.target instanceof Element&&(this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet((()=>{this._pointerdownRepeatTimer.cancelAndSet((()=>this._onActivate()),1e3/24)}),200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,(e=>{}),(()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()})),e.preventDefault())}}class JFe extends Owe{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new ODe)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return 2!==this._visibility&&(3===this._visibility||this._rawShouldBeVisible)}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){this._isNeeded?this._shouldBeVisible?this._reveal():this._hide(!0):this._hide(!1)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet((()=>{var e;null===(e=this._domNode)||void 0===e||e.setClassName(this._visibleClassName)}),0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,null===(t=this._domNode)||void 0===t||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}class eBe extends QFe{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new JFe(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new sRe),this._shouldRender=!0,this.domNode=Ixe(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(tMe(this.domNode.domNode,LMe.POINTER_DOWN,(e=>this._domNodePointerDown(e))))}_createArrow(e){const t=this._register(new XFe(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=Ixe(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),"number"==typeof i&&this.slider.setWidth(i),"number"==typeof n&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(tMe(this.slider.domNode,LMe.POINTER_DOWN,(e=>{0===e.button&&(e.preventDefault(),this._sliderPointerDown(e))}))),this.onclick(this.slider.domNode,(e=>{e.leftButton&&e.stopPropagation()}))}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);i<=o&&o<=n?0===e.button&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&"number"==typeof e.offsetX&&"number"==typeof e.offsetY)t=e.offsetX,i=e.offsetY;else{const n=hMe(this.domNode.domNode);t=e.pageX-n.left,i=e.pageY-n.top}const n=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),0===e.button&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!(e.target&&e.target instanceof Element))return;const t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,(e=>{const o=this._sliderOrthogonalPointerPosition(e),s=Math.abs(o-i);if(Lve&&s>140)return void this._setDesiredScrollPositionNow(n.getScrollPosition());const r=this._sliderPointerPosition(e)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(r))}),(()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()})),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}class tBe{constructor(e,t,i,n,o,s){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,this._scrollSize=o,this._scrollPosition=s,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new tBe(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t&&(this._visibleSize=t,this._refreshComputedValues(),!0)}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t&&(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t&&(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,n,o){const s=Math.max(0,i-e),r=Math.max(0,s-2*t),a=n>0&&n>i;if(!a)return{computedAvailableSize:Math.round(s),computedIsNeeded:a,computedSliderSize:Math.round(r),computedSliderRatio:0,computedSliderPosition:0};const l=Math.round(Math.max(20,Math.floor(i*r/n))),d=(r-l)/(n-i),h=o*d;return{computedAvailableSize:Math.round(s),computedIsNeeded:a,computedSliderSize:Math.round(l),computedSliderRatio:d,computedSliderPosition:Math.round(h)}}_refreshComputedValues(){const e=tBe._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return t<this._computedSliderPosition?i-=this._visibleSize:i+=this._visibleSize,i}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;const t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}}class iBe extends eBe{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new tBe(t.horizontalHasArrows?t.arrowSize:0,2===t.horizontal?0:t.horizontalScrollbarSize,2===t.vertical?0:t.verticalScrollbarSize,n.width,n.scrollWidth,o.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows){const e=(t.arrowSize-11)/2,i=(t.horizontalScrollbarSize-11)/2;this._createArrow({className:"scra",icon:pye.scrollbarButtonLeft,top:i,left:e,bottom:void 0,right:void 0,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new YIe(null,1,0))}),this._createArrow({className:"scra",icon:pye.scrollbarButtonRight,top:i,left:void 0,bottom:void 0,right:e,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new YIe(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(2===e.horizontal?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(2===e.vertical?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class nBe extends eBe{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new tBe(t.verticalHasArrows?t.arrowSize:0,2===t.vertical?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const e=(t.arrowSize-11)/2,i=(t.verticalScrollbarSize-11)/2;this._createArrow({className:"scra",icon:pye.scrollbarButtonUp,top:e,left:i,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new YIe(null,0,1))}),this._createArrow({className:"scra",icon:pye.scrollbarButtonDown,top:void 0,left:i,bottom:e,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new YIe(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(2===e.vertical?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class oBe{constructor(e,t,i,n,o,s,r){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,i|=0,n|=0,o|=0,s|=0,r|=0),this.rawScrollLeft=n,this.rawScrollTop=r,t<0&&(t=0),n+t>i&&(n=i-t),n<0&&(n=0),o<0&&(o=0),r+o>s&&(r=s-o),r<0&&(r=0),this.width=t,this.scrollWidth=i,this.scrollLeft=n,this.height=o,this.scrollHeight=s,this.scrollTop=r}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new oBe(this._forceIntegerValues,void 0!==e.width?e.width:this.width,void 0!==e.scrollWidth?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,void 0!==e.height?e.height:this.height,void 0!==e.scrollHeight?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new oBe(this._forceIntegerValues,this.width,this.scrollWidth,void 0!==e.scrollLeft?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,void 0!==e.scrollTop?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,n=this.scrollWidth!==e.scrollWidth,o=this.scrollLeft!==e.scrollLeft,s=this.height!==e.height,r=this.scrollHeight!==e.scrollHeight,a=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:n,scrollLeftChanged:o,heightChanged:s,scrollHeightChanged:r,scrollTopChanged:a}}}class sBe extends Owe{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new $we),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new oBe(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var i;const n=this._state.withScrollDimensions(e,t);this._setState(n,Boolean(this._smoothScrolling)),null===(i=this._smoothScrolling)||void 0===i||i.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(0===this._smoothScrollDuration)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:void 0===e.scrollLeft?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:void 0===e.scrollTop?this._smoothScrolling.to.scrollTop:e.scrollTop};const i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let n;n=t?new lBe(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{const t=this._state.withScrollPosition(e);this._smoothScrolling=lBe.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())}))}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);return this._setState(t,!0),this._smoothScrolling?e.isDone?(this._smoothScrolling.dispose(),void(this._smoothScrolling=null)):void(this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())}))):void 0}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class rBe{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function aBe(e,t){const i=t-e;return function(t){return e+i*(1-(n=1-t,Math.pow(n,3)));var n}}class lBe{constructor(e,t,i,n){this.from=e,this.to=t,this.duration=n,this.startTime=i,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,i){if(Math.abs(e-t)>2.5*i){let n,o;return e<t?(n=e+.75*i,o=t-.75*i):(n=e-.75*i,o=t+.75*i),function(e,t,i){return function(n){return n<i?e(n/i):t((n-i)/(1-i))}}(aBe(e,n),aBe(o,t),.33)}return aBe(e,t)}dispose(){null!==this.animationFrameDisposable&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){const t=(e-this.startTime)/this.duration;if(t<1){const e=this.scrollLeft(t),i=this.scrollTop(t);return new rBe(e,i,!1)}return new rBe(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,t,i){return lBe.start(e,t,i)}static start(e,t,i){i+=10;const n=Date.now()-10;return new lBe(e,t,n,i)}}var dBe,hBe,cBe=i(1962),uBe={};uBe.styleTagTransform=zl(),uBe.setAttributes=Bl(),uBe.insert=Pl().bind(null,"head"),uBe.domAPI=Rl(),uBe.insertStyleElement=Vl(),Ml()(cBe.A,uBe),cBe.A&&cBe.A.locals&&cBe.A.locals;class gBe{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}class pBe{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(-1===this._front&&-1===this._rear)return!1;let e=1,t=0,i=1,n=this._rear;for(;;){const o=n===this._front?e:Math.pow(2,-i);if(e-=o,t+=this._memory[n].score*o,n===this._front)break;n=(this._capacity+n-1)%this._capacity,i++}return t<=.5}acceptStandardWheelEvent(e){const t=window.devicePixelRatio/_xe();Lve||Eve?this.accept(Date.now(),e.deltaX/t,e.deltaY/t):this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,i){const n=new gBe(e,t,i);n.score=this._computeScore(n),-1===this._front&&-1===this._rear?(this._memory[0]=n,this._front=0,this._rear=0):(this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=n)}_computeScore(e){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let t=.5;return-1===this._front&&-1===this._rear||this._memory[this._rear],this._isAlmostInt(e.deltaX)&&this._isAlmostInt(e.deltaY)||(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}pBe.INSTANCE=new pBe;class mBe extends QFe{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new $we),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new $we),e.style.overflow="hidden",this._options=function(e){const t={lazyRender:void 0!==e.lazyRender&&e.lazyRender,className:void 0!==e.className?e.className:"",useShadows:void 0===e.useShadows||e.useShadows,handleMouseWheel:void 0===e.handleMouseWheel||e.handleMouseWheel,flipAxes:void 0!==e.flipAxes&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:void 0!==e.consumeMouseWheelIfScrollbarIsNeeded&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:void 0!==e.alwaysConsumeMouseWheel&&e.alwaysConsumeMouseWheel,scrollYToX:void 0!==e.scrollYToX&&e.scrollYToX,mouseWheelScrollSensitivity:void 0!==e.mouseWheelScrollSensitivity?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:void 0!==e.fastScrollSensitivity?e.fastScrollSensitivity:5,scrollPredominantAxis:void 0===e.scrollPredominantAxis||e.scrollPredominantAxis,mouseWheelSmoothScroll:void 0===e.mouseWheelSmoothScroll||e.mouseWheelSmoothScroll,arrowSize:void 0!==e.arrowSize?e.arrowSize:11,listenOnDomNode:void 0!==e.listenOnDomNode?e.listenOnDomNode:null,horizontal:void 0!==e.horizontal?e.horizontal:1,horizontalScrollbarSize:void 0!==e.horizontalScrollbarSize?e.horizontalScrollbarSize:10,horizontalSliderSize:void 0!==e.horizontalSliderSize?e.horizontalSliderSize:0,horizontalHasArrows:void 0!==e.horizontalHasArrows&&e.horizontalHasArrows,vertical:void 0!==e.vertical?e.vertical:1,verticalScrollbarSize:void 0!==e.verticalScrollbarSize?e.verticalScrollbarSize:10,verticalHasArrows:void 0!==e.verticalHasArrows&&e.verticalHasArrows,verticalSliderSize:void 0!==e.verticalSliderSize?e.verticalSliderSize:0,scrollByPage:void 0!==e.scrollByPage&&e.scrollByPage};return t.horizontalSliderSize=void 0!==e.horizontalSliderSize?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=void 0!==e.verticalSliderSize?e.verticalSliderSize:t.verticalScrollbarSize,Dve&&(t.className+=" mac"),t}(t),this._scrollable=i,this._register(this._scrollable.onScroll((e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)})));const n={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new nBe(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new iBe(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Ixe(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Ixe(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Ixe(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,(e=>this._onMouseOver(e))),this.onmouseleave(this._listenOnDomNode,(e=>this._onMouseLeave(e))),this._hideTimeout=this._register(new ODe),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=Twe(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Dve&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){void 0!==e.handleMouseWheel&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),void 0!==e.mouseWheelScrollSensitivity&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),void 0!==e.fastScrollSensitivity&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),void 0!==e.scrollPredominantAxis&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),void 0!==e.horizontal&&(this._options.horizontal=e.horizontal),void 0!==e.vertical&&(this._options.vertical=e.vertical),void 0!==e.horizontalScrollbarSize&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),void 0!==e.verticalScrollbarSize&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),void 0!==e.scrollByPage&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new YIe(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Twe(this._mouseWheelToDispose),e)){const e=e=>{this._onMouseWheel(new YIe(e))};this._mouseWheelToDispose.push(tMe(this._listenOnDomNode,LMe.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(e){const t=pBe.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let n=e.deltaY*this._options.mouseWheelScrollSensitivity,o=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(Math.abs(n)>=Math.abs(o)?o=0:n=0),this._options.flipAxes&&([n,o]=[o,n]);const s=!Dve&&e.browserEvent&&e.browserEvent.shiftKey;!this._options.scrollYToX&&!s||o||(o=n,n=0),e.browserEvent&&e.browserEvent.altKey&&(o*=this._options.fastScrollSensitivity,n*=this._options.fastScrollSensitivity);const r=this._scrollable.getFutureScrollPosition();let a={};if(n){const e=50*n,t=r.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(a,t)}if(o){const e=50*o,t=r.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(a,t)}a=this._scrollable.validateScrollPosition(a),(r.scrollLeft!==a.scrollLeft||r.scrollTop!==a.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(a):this._scrollable.setScrollPositionNow(a),i=!0)}let n=i;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,n=i?" left":"",o=t?" top":"",s=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${o}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){this._mouseIsOver||this._isDragging||(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){this._mouseIsOver||this._isDragging||this._hideTimeout.cancelAndSet((()=>this._hide()),500)}}class fBe extends mBe{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const i=new sBe({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:e=>oMe(e)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class _Be extends mBe{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class vBe extends mBe{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const i=new sBe({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:e=>oMe(e)});super(e,t,i),this._register(i),this._element=e,this.onScroll((e=>{e.scrollTopChanged&&(this._element.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this._element.scrollLeft=e.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}class bBe extends gFe{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new ZFe(this._context,i),this._mouseDownOperation=this._register(new wBe(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,((e,t)=>this._createMouseTarget(e,t)),(e=>this._getMouseColumn(e)))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(138).height;const n=new aFe(this.viewHelper.viewDomNode);this._register(n.onContextMenu(this.viewHelper.viewDomNode,(e=>this._onContextMenu(e,!0)))),this._register(n.onMouseMove(this.viewHelper.viewDomNode,(e=>{this._onMouseMove(e),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=tMe(document,"mousemove",(e=>{this.viewHelper.viewDomNode.contains(e.target)||this._onMouseLeave(new rFe(e,!1,this.viewHelper.viewDomNode))})))}))),this._register(n.onMouseUp(this.viewHelper.viewDomNode,(e=>this._onMouseUp(e)))),this._register(n.onMouseLeave(this.viewHelper.viewDomNode,(e=>this._onMouseLeave(e))));let o=0;this._register(n.onPointerDown(this.viewHelper.viewDomNode,((e,t)=>{o=t}))),this._register(tMe(this.viewHelper.viewDomNode,LMe.POINTER_UP,(e=>{this._mouseDownOperation.onPointerUp()}))),this._register(n.onMouseDown(this.viewHelper.viewDomNode,(e=>this._onMouseDown(e,o)))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=pBe.INSTANCE;let t=0,i=Rxe.getZoomLevel(),n=!1,o=0;function s(e){return Dve?(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey:e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey}this._register(tMe(this.viewHelper.viewDomNode,LMe.MOUSE_WHEEL,(r=>{if(this.viewController.emitMouseWheel(r),!this._context.configuration.options.get(72))return;const a=new YIe(r);if(e.acceptStandardWheelEvent(a),e.isPhysicalMouseWheel()){if(s(r)){const e=Rxe.getZoomLevel(),t=a.deltaY>0?1:-1;Rxe.setZoomLevel(e+t),a.preventDefault(),a.stopPropagation()}}else Date.now()-t>50&&(i=Rxe.getZoomLevel(),n=s(r),o=0),t=Date.now(),o+=a.deltaY,n&&(Rxe.setZoomLevel(i+o/5),a.preventDefault(),a.stopPropagation())}),{capture:!0,passive:!1}))}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(138)){const e=this._context.configuration.options.get(138).height;this._height!==e&&(this._height=e,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const i=new tFe(e,t).toPageCoordinates(),n=oFe(this.viewHelper.viewDomNode);if(i.y<n.y||i.y>n.y+n.height||i.x<n.x||i.x>n.x+n.width)return null;const o=sFe(this.viewHelper.viewDomNode,n,i);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),n,i,o,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const t=wMe(this.viewHelper.viewDomNode);t&&(i=t.elementsFromPoint(e.posx,e.posy).find((e=>this.viewHelper.viewDomNode.contains(e))))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),this._mouseDownOperation.isActive()||e.timestamp<this.lastMouseLeaveTime||this.viewController.emitMouseMove({event:e,target:this._createMouseTarget(e,!0)})}_onMouseLeave(e){this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),this.lastMouseLeaveTime=(new Date).getTime(),this.viewController.emitMouseLeave({event:e,target:null})}_onMouseUp(e){this.viewController.emitMouseUp({event:e,target:this._createMouseTarget(e,!0)})}_onMouseDown(e,t){const i=this._createMouseTarget(e,!0),n=6===i.type||7===i.type,o=2===i.type||3===i.type||4===i.type,s=3===i.type,r=this._context.configuration.options.get(103),a=8===i.type||5===i.type,l=9===i.type;let d=e.leftButton||e.middleButton;Dve&&e.leftButton&&e.ctrlKey&&(d=!1);const h=()=>{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(n||s&&r))h(),this._mouseDownOperation.start(i.type,e,t);else if(o)e.preventDefault();else if(a){const n=i.detail;d&&this.viewHelper.shouldSuppressMouseDownOnViewZone(n.viewZoneId)&&(h(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else l&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(h(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}}class wBe extends Owe{constructor(e,t,i,n,o,s){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=n,this._createMouseTarget=o,this._getMouseColumn=s,this._mouseMoveMonitor=this._register(new dFe(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new CBe(this._context,this._viewHelper,this._mouseTargetFactory,((e,t,i)=>this._dispatchMouse(e,t,i)))),this._mouseState=new SBe,this._currentSelection=new hye(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):13!==t.type||"above"!==t.outsidePosition&&"below"!==t.outsidePosition?(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,1)):this._topBottomDragScrolling.start(t,e))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(3===e),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const n=this._findMousePosition(t,!0);if(!n||!n.position)return;this._mouseState.trySetCount(t.detail,n.position),t.detail=this._mouseState.count;const o=this._context.configuration.options;if(!o.get(86)&&o.get(32)&&!o.get(19)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&6===n.type&&n.position&&this._currentSelection.containsPosition(n.position))return this._mouseState.isDragAndDrop=!0,this._isActive=!0,void this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,(e=>this._onMouseDownThenMove(e)),(e=>{const t=this._findMousePosition(this._lastMouseEvent,!1);e&&e instanceof KeyboardEvent?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:t?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()}));this._mouseState.isDragAndDrop=!1,this._dispatchMouse(n,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,(e=>this._onMouseDownThenMove(e)),(()=>this._stop())))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.viewModel,n=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posy<t.y){const i=t.y-e.posy,s=Math.max(n.getCurrentScrollTop()-i,0),r=KFe.getZoneAtCoord(this._context,s);if(r){const e=this._helpPositionJumpOverViewZone(r);if(e)return zFe.createOutsideEditor(o,e,"above",i)}const a=n.getLineNumberAtVerticalOffset(s);return zFe.createOutsideEditor(o,new lye(a,1),"above",i)}if(e.posy>t.y+t.height){const s=e.posy-t.y-t.height,r=n.getCurrentScrollTop()+e.relativePos.y,a=KFe.getZoneAtCoord(this._context,r);if(a){const e=this._helpPositionJumpOverViewZone(a);if(e)return zFe.createOutsideEditor(o,e,"below",s)}const l=n.getLineNumberAtVerticalOffset(r);return zFe.createOutsideEditor(o,new lye(l,i.getLineMaxColumn(l)),"below",s)}const s=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+e.relativePos.y);if(e.posx<t.x){const i=t.x-e.posx;return zFe.createOutsideEditor(o,new lye(s,1),"left",i)}if(e.posx>t.x+t.width){const n=e.posx-t.x-t.width;return zFe.createOutsideEditor(o,new lye(s,i.getLineMaxColumn(s)),"right",n)}return null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const n=this._createMouseTarget(e,t);if(!n.position)return null;if(8===n.type||5===n.type){const e=this._helpPositionJumpOverViewZone(n.detail);if(e)return zFe.createViewZone(n.type,n.element,n.mouseColumn,e,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new lye(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,n=e.positionAfter;return i&&n?i.isBefore(t)?i:n:null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:6===e.type&&null!==e.detail.injectedText})}}class CBe extends Owe{constructor(e,t,i,n){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new yBe(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class yBe extends Owe{constructor(e,t,i,n,o,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._position=o,this._mouseEvent=s,this._lastTime=Date.now(),this._animationFrameDisposable=oMe((()=>this._execute()))}dispose(){this._animationFrameDisposable.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){const e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}_getScrollSpeed(){const e=this._context.configuration.options.get(63),t=this._context.configuration.options.get(138).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(63),t=this._getScrollSpeed()*(this._tick()/1e3)*e,i="above"===this._position.outsidePosition?-t:t;this._context.viewModel.viewLayout.deltaScrollNow(0,i),this._viewHelper.renderNow();const n=this._context.viewLayout.getLinesViewportData(),o="above"===this._position.outsidePosition?n.startLineNumber:n.endLineNumber;let s;{const e=oFe(this._viewHelper.viewDomNode),t=this._context.configuration.options.get(138).horizontalScrollbarHeight,i=new eFe(this._mouseEvent.pos.x,e.y+e.height-t-.1),n=sFe(this._viewHelper.viewDomNode,e,i);s=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),e,i,n,null)}s.position&&s.position.lineNumber===o||(s="above"===this._position.outsidePosition?zFe.createOutsideEditor(this._position.mouseColumn,new lye(o,1),"above",this._position.outsideDistance):zFe.createOutsideEditor(this._position.mouseColumn,new lye(o,this._context.viewModel.getLineMaxColumn(o)),"below",this._position.outsideDistance)),this._dispatchMouse(s,!0,2),this._animationFrameDisposable=oMe((()=>this._execute()))}}class SBe{get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const i=(new Date).getTime();i-this._lastSetMouseDownCountTime>SBe.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}SBe.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class xBe{get event(){return this.emitter.event}constructor(e,t,i){const n=e=>this.emitter.fire(e);this.emitter=new $we({onWillAddFirstListener:()=>e.addEventListener(t,n,i),onDidRemoveLastListener:()=>e.removeEventListener(t,n,i)})}dispose(){this.emitter.dispose()}}!function(e){const t={total:0,min:Number.MAX_VALUE,max:0},i=Object.assign({},t),n=Object.assign({},t),o=Object.assign({},t);let s=0;const r={keydown:0,input:0,render:0};function a(){1===r.keydown&&(performance.mark("keydown/end"),r.keydown=2)}function l(){performance.mark("input/start"),r.input=1,c()}function d(){1===r.input&&(performance.mark("input/end"),r.input=2)}function h(){1===r.render&&(performance.mark("render/end"),r.render=2)}function c(){setTimeout(u)}function u(){2===r.keydown&&2===r.input&&2===r.render&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),g("keydown",t),g("input",i),g("render",n),g("inputlatency",o),s++,performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),r.keydown=0,r.input=0,r.render=0)}function g(e,t){const i=performance.getEntriesByName(e)[0].duration;t.total+=i,t.min=Math.min(t.min,i),t.max=Math.max(t.max,i)}function p(e){return{average:e.total/s,max:e.max,min:e.min}}function m(e){e.total=0,e.min=Number.MAX_VALUE,e.max=0}e.onKeyDown=function(){u(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),r.keydown=1,queueMicrotask(a)},e.onBeforeInput=l,e.onInput=function(){0===r.input&&l(),queueMicrotask(d)},e.onKeyUp=function(){u()},e.onSelectionChange=function(){u()},e.onRenderStart=function(){2===r.keydown&&2===r.input&&0===r.render&&(performance.mark("render/start"),r.render=1,queueMicrotask(h),c())},e.getAndClearMeasurements=function(){if(0===s)return;const e={keydown:p(t),input:p(i),render:p(n),total:p(o),sampleCount:s};return m(t),m(i),m(n),m(o),s=0,e}}(dBe||(dBe={}));class kBe{constructor(e,t,i,n,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=n,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),n=e.getSelectionStart(),o=e.getSelectionEnd();let s;return t&&i.substring(0,n)===t.value.substring(0,t.selectionStart)&&(s=t.newlineCountBeforeSelection),new kBe(i,n,o,null,s)}collapseSelection(){return this.selectionStart===this.value.length?this:new kBe(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){var t,i,n,o,s,r,a,l;if(e<=this.selectionStart){const n=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(null!==(i=null===(t=this.selection)||void 0===t?void 0:t.getStartPosition())&&void 0!==i?i:null,n,-1)}if(e>=this.selectionEnd){const t=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(null!==(o=null===(n=this.selection)||void 0===n?void 0:n.getEndPosition())&&void 0!==o?o:null,t,1)}const d=this.value.substring(this.selectionStart,e);if(-1===d.indexOf(String.fromCharCode(8230)))return this._finishDeduceEditorPosition(null!==(r=null===(s=this.selection)||void 0===s?void 0:s.getStartPosition())&&void 0!==r?r:null,d,1);const h=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(null!==(l=null===(a=this.selection)||void 0===a?void 0:a.getEndPosition())&&void 0!==l?l:null,h,-1)}_finishDeduceEditorPosition(e,t,i){let n=0,o=-1;for(;-1!==(o=t.indexOf("\n",o+1));)n++;return[e,i*t.length,n]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const n=Math.min(VSe(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(HSe(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd),s=(e.value.substring(n,e.value.length-o),t.value.substring(n,t.value.length-o)),r=e.selectionStart-n,a=e.selectionEnd-n;if(t.selectionStart-n===t.selectionEnd-n){return{text:s,replacePrevCharCnt:e.selectionStart-n,replaceNextCharCnt:0,positionDelta:0}}return{text:s,replacePrevCharCnt:a-r,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(VSe(e.value,t.value),e.selectionEnd),n=Math.min(HSe(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-n),s=t.value.substring(i,t.value.length-n),r=(e.selectionStart,e.selectionEnd-i),a=(t.selectionStart,t.selectionEnd-i);return{text:s,replacePrevCharCnt:r,replaceNextCharCnt:o.length-r,positionDelta:a-s.length}}}kBe.EMPTY=new kBe("",0,0,null,void 0);class LBe{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t;return new dye(i+1,1,i+t+1,1)}static fromEditorSelection(e,t,i,n){const o=500,s=LBe._getPageOfLine(t.startLineNumber,i),r=LBe._getRangeForPage(s,i),a=LBe._getPageOfLine(t.endLineNumber,i),l=LBe._getRangeForPage(a,i);let d=r.intersectRanges(new dye(1,1,t.startLineNumber,t.startColumn));if(n&&e.getValueLengthInRange(d,1)>o){const t=e.modifyPosition(d.getEndPosition(),-500);d=dye.fromPositions(t,d.getEndPosition())}const h=e.getValueInRange(d,1),c=e.getLineCount(),u=e.getLineMaxColumn(c);let g=l.intersectRanges(new dye(t.endLineNumber,t.endColumn,c,u));if(n&&e.getValueLengthInRange(g,1)>o){const t=e.modifyPosition(g.getStartPosition(),o);g=dye.fromPositions(g.getStartPosition(),t)}const p=e.getValueInRange(g,1);let m;if(s===a||s+1===a)m=e.getValueInRange(t,1);else{const i=r.intersectRanges(t),n=l.intersectRanges(t);m=e.getValueInRange(i,1)+String.fromCharCode(8230)+e.getValueInRange(n,1)}return n&&m.length>1e3&&(m=m.substring(0,o)+String.fromCharCode(8230)+m.substring(m.length-o,m.length)),new kBe(h+m+p,h.length,h.length+m.length,t,d.endLineNumber-d.startLineNumber)}}!function(e){e.Tap="-monaco-textarea-synthetic-tap"}(hBe||(hBe={}));class DBe{constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}}DBe.INSTANCE=new DBe;class EBe{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){const t={text:e=e||"",replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}class NBe extends Owe{get textAreaState(){return this._textAreaState}constructor(e,t,i,n){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._onFocus=this._register(new $we),this.onFocus=this._onFocus.event,this._onBlur=this._register(new $we),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new $we),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new $we),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new $we),this.onCut=this._onCut.event,this._onPaste=this._register(new $we),this.onPaste=this._onPaste.event,this._onType=this._register(new $we),this.onType=this._onType.event,this._onCompositionStart=this._register(new $we),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new $we),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new $we),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new $we),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncTriggerCut=this._register(new FDe((()=>this._onCut.fire()),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new FDe((()=>this.writeScreenReaderContent("asyncFocusGain")),0)),this._textAreaState=kBe.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._currentComposition=null;let o=null;this._register(this._textArea.onKeyDown((e=>{const t=new KIe(e);(109===t.keyCode||this._currentComposition&&1===t.keyCode)&&t.stopPropagation(),t.equals(9)&&t.preventDefault(),o=t,this._onKeyDown.fire(t)}))),this._register(this._textArea.onKeyUp((e=>{const t=new KIe(e);this._onKeyUp.fire(t)}))),this._register(this._textArea.onCompositionStart((e=>{const t=new EBe;if(this._currentComposition)this._currentComposition=t;else{if(this._currentComposition=t,2===this._OS&&o&&o.equals(109)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===e.data&&("ArrowRight"===o.code||"ArrowLeft"===o.code))return t.handleCompositionUpdate("x"),void this._onCompositionStart.fire({data:e.data});this._browser.isAndroid,this._onCompositionStart.fire({data:e.data})}}))),this._register(this._textArea.onCompositionUpdate((e=>{const t=this._currentComposition;if(!t)return;if(this._browser.isAndroid){const t=kBe.readFromTextArea(this._textArea,this._textAreaState),i=kBe.deduceAndroidCompositionInput(this._textAreaState,t);return this._textAreaState=t,this._onType.fire(i),void this._onCompositionUpdate.fire(e)}const i=t.handleCompositionUpdate(e.data);this._textAreaState=kBe.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(i),this._onCompositionUpdate.fire(e)}))),this._register(this._textArea.onCompositionEnd((e=>{const t=this._currentComposition;if(!t)return;if(this._currentComposition=null,this._browser.isAndroid){const e=kBe.readFromTextArea(this._textArea,this._textAreaState),t=kBe.deduceAndroidCompositionInput(this._textAreaState,e);return this._textAreaState=e,this._onType.fire(t),void this._onCompositionEnd.fire()}const i=t.handleCompositionUpdate(e.data);this._textAreaState=kBe.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(i),this._onCompositionEnd.fire()}))),this._register(this._textArea.onInput((e=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const t=kBe.readFromTextArea(this._textArea,this._textAreaState),i=kBe.deduceInput(this._textAreaState,t,2===this._OS);(0!==i.replacePrevCharCnt||1!==i.text.length||!zSe(i.text.charCodeAt(0))&&127!==i.text.charCodeAt(0))&&(this._textAreaState=t,""===i.text&&0===i.replacePrevCharCnt&&0===i.replaceNextCharCnt&&0===i.positionDelta||this._onType.fire(i))}))),this._register(this._textArea.onCut((e=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(e),this._asyncTriggerCut.schedule()}))),this._register(this._textArea.onCopy((e=>{this._ensureClipboardGetsEditorSelection(e)}))),this._register(this._textArea.onPaste((e=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),e.preventDefault(),!e.clipboardData)return;let[t,i]=IBe.getTextData(e.clipboardData);t&&(i=i||DBe.INSTANCE.get(t),this._onPaste.fire({text:t,metadata:i}))}))),this._register(this._textArea.onFocus((()=>{const e=this._hasFocus;this._setHasFocus(!0),this._browser.isSafari&&!e&&this._hasFocus&&this._asyncFocusGainWriteScreenReaderContent.schedule()}))),this._register(this._textArea.onBlur((()=>{this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)}))),this._register(this._textArea.onSyntheticTap((()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())})))}_installSelectionChangeListener(){let e=0;return tMe(document,"selectionchange",(t=>{if(dBe.onSelectionChange(),!this._hasFocus)return;if(this._currentComposition)return;if(!this._browser.isChrome)return;const i=Date.now(),n=i-e;if(e=i,n<5)return;const o=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100)return;if(!this._textAreaState.selection)return;const s=this._textArea.getValue();if(this._textAreaState.value!==s)return;const r=this._textArea.getSelectionStart(),a=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===r&&this._textAreaState.selectionEnd===a)return;const l=this._textAreaState.deduceEditorPosition(r),d=this._host.deduceModelPosition(l[0],l[1],l[2]),h=this._textAreaState.deduceEditorPosition(a),c=this._host.deduceModelPosition(h[0],h[1],h[2]),u=new hye(d.lineNumber,d.column,c.lineNumber,c.column);this._onSelectionChangeRequest.fire(u)}))}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeScreenReaderContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeScreenReaderContent(e){this._currentComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent())}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};DBe.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,"\n"):t.text,i),e.preventDefault(),e.clipboardData&&IBe.setTextData(e.clipboardData,t.text,t.html,i)}}class IBe{static getTextData(e){const t=e.getData(OLe.text);let i=null;const n=e.getData("vscode-editor-data");if("string"==typeof n)try{i=JSON.parse(n),1!==i.version&&(i=null)}catch(e){}return 0===t.length&&null===i&&e.files.length>0?[Array.prototype.slice.call(e.files,0).map((e=>e.name)).join("\n"),null]:[t,i]}static setTextData(e,t,i,n){e.setData(OLe.text,t),"string"==typeof i&&e.setData("text/html",i),e.setData("vscode-editor-data",JSON.stringify(n))}}class TBe extends Owe{constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new xBe(this._actual,"keydown")).event,this.onKeyUp=this._register(new xBe(this._actual,"keyup")).event,this.onCompositionStart=this._register(new xBe(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new xBe(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new xBe(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new xBe(this._actual,"beforeinput")).event,this.onInput=this._register(new xBe(this._actual,"input")).event,this.onCut=this._register(new xBe(this._actual,"cut")).event,this.onCopy=this._register(new xBe(this._actual,"copy")).event,this.onPaste=this._register(new xBe(this._actual,"paste")).event,this.onFocus=this._register(new xBe(this._actual,"focus")).event,this.onBlur=this._register(new xBe(this._actual,"blur")).event,this._onSyntheticTap=this._register(new $we),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown((()=>dBe.onKeyDown()))),this._register(this.onBeforeInput((()=>dBe.onBeforeInput()))),this._register(this.onInput((()=>dBe.onInput()))),this._register(this.onKeyUp((()=>dBe.onKeyUp()))),this._register(tMe(this._actual,hBe.Tap,(()=>this._onSyntheticTap.fire())))}hasFocus(){const e=wMe(this._actual);return e?e.activeElement===this._actual:!!JTe(this._actual)&&document.activeElement===this._actual}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return"backward"===this._actual.selectionDirection?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return"backward"===this._actual.selectionDirection?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const n=this._actual;let o=null;const s=wMe(n);o=s?s.activeElement:document.activeElement;const r=o===n,a=n.selectionStart,l=n.selectionEnd;if(r&&a===t&&l===i)bxe&&window.parent!==window&&n.focus();else{if(r)return this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),void(bxe&&window.parent!==window&&n.focus());try{const e=function(e){const t=[];for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)t[i]=e.scrollTop,e=e.parentNode;return t}(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),function(e,t){for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)e.scrollTop!==t[i]&&(e.scrollTop=t[i]),e=e.parentNode}(n,e)}catch(e){}}}}class MBe extends bBe{constructor(e,t,i){super(e,t,i),this._register(oRe.addTarget(this.viewHelper.linesContentDomNode)),this._register(tMe(this.viewHelper.linesContentDomNode,nRe.Tap,(e=>this.onTap(e)))),this._register(tMe(this.viewHelper.linesContentDomNode,nRe.Change,(e=>this.onChange(e)))),this._register(tMe(this.viewHelper.linesContentDomNode,nRe.Contextmenu,(e=>this._onContextMenu(new rFe(e,!1,this.viewHelper.viewDomNode),!1)))),this._lastPointerType="mouse",this._register(tMe(this.viewHelper.linesContentDomNode,"pointerdown",(e=>{const t=e.pointerType;this._lastPointerType="mouse"!==t?"touch"===t?"touch":"pen":"mouse"})));const n=new lFe(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,(e=>this._onMouseMove(e)))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,(e=>this._onMouseUp(e)))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,(e=>this._onMouseLeave(e)))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,((e,t)=>this._onMouseDown(e,t))))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new rFe(e,!1,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:6===t.type&&null!==t.detail.injectedText})}onChange(e){"touch"===this._lastPointerType&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e,t){"touch"!==e.browserEvent.pointerType&&super._onMouseDown(e,t)}}class ABe extends bBe{constructor(e,t,i){super(e,t,i),this._register(oRe.addTarget(this.viewHelper.linesContentDomNode)),this._register(tMe(this.viewHelper.linesContentDomNode,nRe.Tap,(e=>this.onTap(e)))),this._register(tMe(this.viewHelper.linesContentDomNode,nRe.Change,(e=>this.onChange(e)))),this._register(tMe(this.viewHelper.linesContentDomNode,nRe.Contextmenu,(e=>this._onContextMenu(new rFe(e,!1,this.viewHelper.viewDomNode),!1))))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new rFe(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const e=document.createEvent("CustomEvent");e.initEvent(hBe.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(e),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class RBe extends Owe{constructor(e,t,i){super(),Mve&&OIe?this.handler=this._register(new MBe(e,t,i)):window.TouchEvent?this.handler=this._register(new ABe(e,t,i)):this.handler=this._register(new bBe(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}var OBe=i(8053),PBe={};PBe.styleTagTransform=zl(),PBe.setAttributes=Bl(),PBe.insert=Pl().bind(null,"head"),PBe.domAPI=Rl(),PBe.insertStyleElement=Vl(),Ml()(OBe.A,PBe),OBe.A&&OBe.A.locals&&OBe.A.locals;var FBe=i(3327),BBe={};BBe.styleTagTransform=zl(),BBe.setAttributes=Bl(),BBe.insert=Pl().bind(null,"head"),BBe.domAPI=Rl(),BBe.insertStyleElement=Vl(),Ml()(FBe.A,BBe),FBe.A&&FBe.A.locals&&FBe.A.locals;class WBe extends gFe{}const VBe=zxe("themeService");function HBe(e){return{id:e}}function zBe(e){switch(e){case xFe.DARK:return"vs-dark";case xFe.HIGH_CONTRAST_DARK:return"hc-black";case xFe.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const UBe="base.contributions.theming",KBe=new class{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new $we}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Awe((()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)}))}getThemingParticipants(){return this.themingParticipants}};function jBe(e){return KBe.onColorThemeChange(e)}RLe.add(UBe,KBe);class qBe extends Owe{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange((e=>this.onThemeChange(e))))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}const $Be=mRe("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},ove(0,"Background color for the highlight of line at the cursor position.")),GBe=mRe("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:vRe},ove(0,"Background color for the border around the line at the cursor position.")),ZBe=(mRe("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},ove(0,"Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0),mRe("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:bRe,hcLight:bRe},ove(0,"Background color of the border around highlighted ranges."),!0),mRe("editor.symbolHighlightBackground",{dark:DOe,light:DOe,hcDark:null,hcLight:null},ove(0,"Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0),mRe("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:bRe,hcLight:bRe},ove(0,"Background color of the border around highlighted symbols."),!0),mRe("editorCursor.foreground",{dark:"#AEAFAD",light:hRe.black,hcDark:hRe.white,hcLight:"#0F4A85"},ove(0,"Color of the editor cursor."))),YBe=mRe("editorCursor.background",null,ove(0,"The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),QBe=mRe("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},ove(0,"Color of whitespace characters in the editor.")),XBe=mRe("editorIndentGuide.background",{dark:QBe,light:QBe,hcDark:QBe,hcLight:QBe},ove(0,"Color of the editor indentation guides.")),JBe=mRe("editorIndentGuide.activeBackground",{dark:QBe,light:QBe,hcDark:QBe,hcLight:QBe},ove(0,"Color of the active editor indentation guides.")),eWe=mRe("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:hRe.white,hcLight:"#292929"},ove(0,"Color of editor line numbers.")),tWe=mRe("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:bRe,hcLight:bRe},ove(0,"Color of editor active line number"),!1,ove(0,"Id is deprecated. Use 'editorLineNumber.activeForeground' instead.")),iWe=(mRe("editorLineNumber.activeForeground",{dark:tWe,light:tWe,hcDark:tWe,hcLight:tWe},ove(0,"Color of editor active line number")),mRe("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},ove(0,"Color of the final editor line when editor.renderFinalNewline is set to dimmed."))),nWe=(mRe("editorRuler.foreground",{dark:"#5A5A5A",light:hRe.lightgrey,hcDark:hRe.white,hcLight:"#292929"},ove(0,"Color of the editor rulers.")),mRe("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},ove(0,"Foreground color of editor CodeLens")),mRe("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},ove(0,"Background color behind matching brackets")),mRe("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:vRe,hcLight:vRe},ove(0,"Color for matching brackets boxes")),mRe("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},ove(0,"Color of the overview ruler border."))),oWe=mRe("editorOverviewRuler.background",null,ove(0,"Background color of the editor overview ruler.")),sWe=(mRe("editorGutter.background",{dark:dOe,light:dOe,hcDark:dOe,hcLight:dOe},ove(0,"Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")),mRe("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:hRe.fromHex("#fff").transparent(.8),hcLight:vRe},ove(0,"Border color of unnecessary (unused) source code in the editor.")),mRe("editorUnnecessaryCode.opacity",{dark:hRe.fromHex("#000a"),light:hRe.fromHex("#0007"),hcDark:null,hcLight:null},ove(0,"Opacity of unnecessary (unused) source code in the editor. For example, \"#000000c0\" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out."))),rWe=(mRe("editorGhostText.border",{dark:null,light:null,hcDark:hRe.fromHex("#fff").transparent(.8),hcLight:hRe.fromHex("#292929").transparent(.8)},ove(0,"Border color of ghost text in the editor.")),mRe("editorGhostText.foreground",{dark:hRe.fromHex("#ffffff56"),light:hRe.fromHex("#0007"),hcDark:null,hcLight:null},ove(0,"Foreground color of the ghost text in the editor.")),mRe("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},ove(0,"Background color of the ghost text in the editor.")),new hRe(new aRe(0,122,204,.6))),aWe=(mRe("editorOverviewRuler.rangeHighlightForeground",{dark:rWe,light:rWe,hcDark:rWe,hcLight:rWe},ove(0,"Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),mRe("editorOverviewRuler.errorForeground",{dark:new hRe(new aRe(255,18,18,.7)),light:new hRe(new aRe(255,18,18,.7)),hcDark:new hRe(new aRe(255,50,50,1)),hcLight:"#B5200D"},ove(0,"Overview ruler marker color for errors."))),lWe=mRe("editorOverviewRuler.warningForeground",{dark:oOe,light:oOe,hcDark:sOe,hcLight:sOe},ove(0,"Overview ruler marker color for warnings.")),dWe=mRe("editorOverviewRuler.infoForeground",{dark:rOe,light:rOe,hcDark:aOe,hcLight:aOe},ove(0,"Overview ruler marker color for infos.")),hWe=mRe("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},ove(0,"Foreground color of brackets (1). Requires enabling bracket pair colorization.")),cWe=mRe("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},ove(0,"Foreground color of brackets (2). Requires enabling bracket pair colorization.")),uWe=mRe("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},ove(0,"Foreground color of brackets (3). Requires enabling bracket pair colorization.")),gWe=mRe("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ove(0,"Foreground color of brackets (4). Requires enabling bracket pair colorization.")),pWe=mRe("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ove(0,"Foreground color of brackets (5). Requires enabling bracket pair colorization.")),mWe=mRe("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ove(0,"Foreground color of brackets (6). Requires enabling bracket pair colorization.")),fWe=mRe("editorBracketHighlight.unexpectedBracket.foreground",{dark:new hRe(new aRe(255,18,18,.8)),light:new hRe(new aRe(255,18,18,.8)),hcDark:new hRe(new aRe(255,50,50,1)),hcLight:""},ove(0,"Foreground color of unexpected brackets.")),_We=mRe("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ove(0,"Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),vWe=mRe("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ove(0,"Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),bWe=mRe("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ove(0,"Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),wWe=mRe("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ove(0,"Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),CWe=mRe("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ove(0,"Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),yWe=mRe("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ove(0,"Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),SWe=mRe("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ove(0,"Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),xWe=mRe("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ove(0,"Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),kWe=mRe("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ove(0,"Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),LWe=mRe("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ove(0,"Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),DWe=mRe("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ove(0,"Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),EWe=mRe("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ove(0,"Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));mRe("editorUnicodeHighlight.border",{dark:"#BD9B03",light:"#CEA33D",hcDark:"#ff0000",hcLight:"#CEA33D"},ove(0,"Border color used to highlight unicode characters.")),mRe("editorUnicodeHighlight.background",{dark:"#bd9b0326",light:"#cea33d14",hcDark:"#00000000",hcLight:"#cea33d14"},ove(0,"Background color used to highlight unicode characters.")),jBe(((e,t)=>{const i=e.getColor(dOe),n=e.getColor($Be),o=n&&!n.isTransparent()?n:i;o&&t.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${o}; }`)}));class NWe extends WBe{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new lye(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(63);const t=e.get(64);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(89);const i=e.get(138);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,i=!0),2!==this._renderLineNumbers&&3!==this._renderLineNumbers||(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new lye(e,1));if(1!==t.column)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(2===this._renderLineNumbers){const e=Math.abs(this._lastCursorModelPosition.lineNumber-i);return 0===e?'<span class="relative-current-line-number">'+i+"</span>":String(e)}return 3===this._renderLineNumbers?this._lastCursorModelPosition.lineNumber===i||i%10==0?String(i):"":String(i)}prepareRender(e){if(0===this._renderLineNumbers)return void(this._renderResult=null);const t=Eve?this._lineHeight%2==0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o=this._context.viewModel.getLineCount(),s=[];for(let e=i;e<=n;e++){const n=e-i,r=this._getLineRenderLineNumber(e);if(!r){s[n]="";continue}let a="";if(e===o&&0===this._context.viewModel.getLineLength(e)){if("off"===this._renderFinalNewline){s[n]="";continue}"dimmed"===this._renderFinalNewline&&(a=" dimmed-line-number")}e===this._activeLineNumber&&(a=" active-line-number"),s[n]=`<div class="${NWe.CLASS_NAME}${t}${a}" style="left:${this._lineNumbersLeft}px;width:${this._lineNumbersWidth}px;">${r}</div>`}this._renderResult=s}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}NWe.CLASS_NAME="line-numbers",jBe(((e,t)=>{const i=e.getColor(eWe),n=e.getColor(iWe);n?t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n}; }`):i&&t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i.transparent(.4)}; }`)}));var IWe=i(4153),TWe={};TWe.styleTagTransform=zl(),TWe.setAttributes=Bl(),TWe.insert=Pl().bind(null,"head"),TWe.domAPI=Rl(),TWe.insertStyleElement=Vl(),Ml()(IWe.A,TWe),IWe.A&&IWe.A.locals&&IWe.A.locals;class MWe extends pFe{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(138);this._canUseLayerHinting=!t.get(29),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=Ixe(document.createElement("div")),this._domNode.setClassName(MWe.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=Ixe(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(MWe.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(138);return this._canUseLayerHinting=!t.get(29),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}}MWe.CLASS_NAME="glyph-margin",MWe.OUTER_CLASS_NAME="margin";var AWe=i(8268),RWe={};RWe.styleTagTransform=zl(),RWe.setAttributes=Bl(),RWe.insert=Pl().bind(null,"head"),RWe.domAPI=Rl(),RWe.insertStyleElement=Vl(),Ml()(AWe.A,RWe),AWe.A&&AWe.A.locals&&AWe.A.locals;const OWe="monaco-mouse-cursor-text",PWe=new class{constructor(){this._onDidChange=new $we,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}};class FWe{constructor(e,t,i,n,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=n,this.distanceToModelLineEnd=o,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new lye(this.modelLineNumber,this.distanceToModelLineStart+1),i=new lye(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(this._previousPresentation=e||{foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const BWe=bxe;class WWe extends pFe{constructor(e,t,i){super(e),this._primaryCursorPosition=new lye(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;const o=this._context.configuration.options,s=o.get(138);this._setAccessibilityOptions(o),this._contentLeft=s.contentLeft,this._contentWidth=s.contentWidth,this._contentHeight=s.height,this._fontInfo=o.get(47),this._lineHeight=o.get(63),this._emptySelectionClipboard=o.get(34),this._copyWithSyntaxHighlighting=o.get(22),this._visibleTextArea=null,this._selections=[new hye(1,1,1,1)],this._modelSelections=[new hye(1,1,1,1)],this._lastRenderPosition=null,this.textArea=Ixe(document.createElement("textarea")),mFe.write(this.textArea,6),this.textArea.setClassName(`inputarea ${OWe}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:r}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=r*this._fontInfo.spaceWidth+"px",this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(o)),this.textArea.setAttribute("tabindex",String(o.get(118))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",ove(0,"editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this._ensureReadOnlyAttribute(),this.textAreaCover=Ixe(document.createElement("div")),this.textAreaCover.setPosition("absolute");const a={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:e=>this._context.viewModel.getLineMaxColumn(e),getValueInRange:(e,t)=>this._context.viewModel.getValueInRange(e,t),getValueLengthInRange:(e,t)=>this._context.viewModel.getValueLengthInRange(e,t),modifyPosition:(e,t)=>this._context.viewModel.modifyPosition(e,t)},l={getDataToCopy:()=>{const e=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,Lve),t=this._context.viewModel.model.getEOL(),i=this._emptySelectionClipboard&&1===this._modelSelections.length&&this._modelSelections[0].isEmpty(),n=Array.isArray(e)?e:null,o=Array.isArray(e)?e.join(t):e;let s,r=null;if(this._copyWithSyntaxHighlighting&&o.length<65536){const e=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);e&&(s=e.html,r=e.mode)}return{isFromEmptySelection:i,multicursorText:n,text:o,html:s,mode:r}},getScreenReaderContent:()=>{if(1===this._accessibilitySupport){const e=this._selections[0];if(Dve&&e.isEmpty()){const t=e.getStartPosition();let i=this._getWordBeforePosition(t);if(0===i.length&&(i=this._getCharacterBeforePosition(t)),i.length>0)return new kBe(i,i.length,i.length,dye.fromPositions(t),0)}const t=500;if(Dve&&!e.isEmpty()&&a.getValueLengthInRange(e,0)<t){const t=a.getValueInRange(e,0);return new kBe(t,0,t.length,e,0)}if(yxe&&!e.isEmpty()){const e="vscode-placeholder";return new kBe(e,0,e.length,null,void 0)}return kBe.EMPTY}if(kxe){const e=this._selections[0];if(e.isEmpty()){const t=e.getStartPosition(),[i,n]=this._getAndroidWordAtPosition(t);if(i.length>0)return new kBe(i,n,n,dye.fromPositions(t),0)}return kBe.EMPTY}return LBe.fromEditorSelection(a,this._selections[0],this._accessibilityPageSize,0===this._accessibilitySupport)},deduceModelPosition:(e,t,i)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(e,t,i)},d=this._register(new TBe(this.textArea.domNode));this._textAreaInput=this._register(new NBe(l,d,Fve,n)),this._register(this._textAreaInput.onKeyDown((e=>{this._viewController.emitKeyDown(e)}))),this._register(this._textAreaInput.onKeyUp((e=>{this._viewController.emitKeyUp(e)}))),this._register(this._textAreaInput.onPaste((e=>{let t=!1,i=null,n=null;e.metadata&&(t=this._emptySelectionClipboard&&!!e.metadata.isFromEmptySelection,i=void 0!==e.metadata.multicursorText?e.metadata.multicursorText:null,n=e.metadata.mode),this._viewController.paste(e.text,t,i,n)}))),this._register(this._textAreaInput.onCut((()=>{this._viewController.cut()}))),this._register(this._textAreaInput.onType((e=>{e.replacePrevCharCnt||e.replaceNextCharCnt||e.positionDelta?this._viewController.compositionType(e.text,e.replacePrevCharCnt,e.replaceNextCharCnt,e.positionDelta):this._viewController.type(e.text)}))),this._register(this._textAreaInput.onSelectionChangeRequest((e=>{this._viewController.setSelection(e)}))),this._register(this._textAreaInput.onCompositionStart((e=>{const t=this.textArea.domNode,i=this._modelSelections[0],{distanceToModelLineStart:n,widthOfHiddenTextBefore:o}=(()=>{const e=t.value.substring(0,Math.min(t.selectionStart,t.selectionEnd)),n=e.lastIndexOf("\n"),o=e.substring(n+1),s=o.lastIndexOf("\t"),r=o.length-s-1,a=i.getStartPosition(),l=Math.min(a.column-1,r),d=a.column-1-l,h=o.substring(0,o.length-l),{tabSize:c}=this._context.viewModel.model.getOptions(),u=function(e,t,i){if(0===e.length)return 0;const n=document.createElement("div");n.style.position="absolute",n.style.top="-50000px",n.style.width="50000px";const o=document.createElement("span");Txe(o,t),o.style.whiteSpace="pre",o.style.tabSize=i*t.spaceWidth+"px",o.append(e),n.appendChild(o),document.body.appendChild(n);const s=o.offsetWidth;return document.body.removeChild(n),s}(h,this._fontInfo,c);return{distanceToModelLineStart:d,widthOfHiddenTextBefore:u}})(),{distanceToModelLineEnd:s}=(()=>{const e=t.value.substring(Math.max(t.selectionStart,t.selectionEnd)),n=e.indexOf("\n"),o=-1===n?e:e.substring(0,n),s=o.indexOf("\t"),r=-1===s?o.length:o.length-s-1,a=i.getEndPosition(),l=Math.min(this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column,r);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column-l}})();this._context.viewModel.revealRange("keyboard",!0,dye.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new FWe(this._context,i.startLineNumber,n,o,s),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${OWe} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()}))),this._register(this._textAreaInput.onCompositionUpdate((e=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())}))),this._register(this._textAreaInput.onCompositionEnd((()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${OWe}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()}))),this._register(this._textAreaInput.onFocus((()=>{this._context.viewModel.setHasFocus(!0)}))),this._register(this._textAreaInput.onBlur((()=>{this._context.viewModel.setHasFocus(!1)}))),this._register(PWe.onDidChange((()=>{this._ensureReadOnlyAttribute()})))}writeScreenReaderContent(e){this._textAreaInput.writeScreenReaderContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=MEe('`~!@#$%^&*()-=+[{]}\\|;:",.<>/?');let n=!0,o=e.column,s=!0,r=e.column,a=0;for(;a<50&&(n||s);){if(n&&o<=1&&(n=!1),n){const e=t.charCodeAt(o-2);0!==i.get(e)?n=!1:o--}if(s&&r>t.length&&(s=!1),s){const e=t.charCodeAt(r-1);0!==i.get(e)?s=!1:r++}a++}return[t.substring(o-1,r-1),e.column-o]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=MEe(this._context.configuration.options.get(124));let n=e.column,o=0;for(;n>1;){const s=t.charCodeAt(n-2);if(0!==i.get(s)||o>50)return t.substring(n-1,e.column-1);o++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const t=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!zSe(t.charCodeAt(0)))return t}return""}_getAriaLabel(e){return 1===e.get(2)?ove(0,"The editor is not accessible at this time. Press {0} for options.",Eve?"Shift+Alt+F1":"Alt+F1"):e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);2===this._accessibilitySupport&&t===vwe.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const i=e.get(138).wrappingColumn;if(-1!==i&&1!==this._accessibilitySupport){const t=e.get(47);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(i*t.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=BWe?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(138);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(47),this._lineHeight=t.get(63),this._emptySelectionClipboard=t.get(34),this._copyWithSyntaxHighlighting=t.get(22),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:n}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=n*this._fontInfo.spaceWidth+"px",this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("tabindex",String(t.get(118))),(e.hasChanged(31)||e.hasChanged(86))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}_ensureReadOnlyAttribute(){const e=this._context.configuration.options;!PWe.enabled||e.get(31)&&e.get(86)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new lye(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),null===(t=this._visibleTextArea)||void 0===t||t.prepareRender(e)}render(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()}_render(){var e;if(this._visibleTextArea){const e=this._visibleTextArea.visibleTextareaStart,t=this._visibleTextArea.visibleTextareaEnd,i=this._visibleTextArea.startPosition,n=this._visibleTextArea.endPosition;if(i&&n&&e&&t&&t.left>=this._scrollLeft&&e.left<=this._scrollLeft+this._contentWidth){const o=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,s=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let r=this._visibleTextArea.widthOfHiddenLineTextBefore,a=this._contentLeft+e.left-this._scrollLeft,l=t.left-e.left+1;if(a<this._contentLeft){const e=this._contentLeft-a;a+=e,r+=e,l-=e}l>this._contentWidth&&(l=this._contentWidth);const d=this._context.viewModel.getViewLineData(i.lineNumber),h=d.tokens.findTokenIndexAtOffset(i.column-1),c=h===d.tokens.findTokenIndexAtOffset(n.column-1),u=this._visibleTextArea.definePresentation(c?d.tokens.getPresentation(h):null);this.textArea.domNode.scrollTop=s*this._lineHeight,this.textArea.domNode.scrollLeft=r,this._doRender({lastRenderPosition:null,top:o,left:a,width:l,height:this._lineHeight,useCover:!1,color:(Eye.getColorMap()||[])[u.foreground],italic:u.italic,bold:u.bold,underline:u.underline,strikethrough:u.strikethrough})}return}if(!this._primaryCursorVisibleRange)return void this._renderAtTopLeft();const t=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(t<this._contentLeft||t>this._contentLeft+this._contentWidth)return void this._renderAtTopLeft();const i=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(i<0||i>this._contentHeight)this._renderAtTopLeft();else if(Dve){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const n=null!==(e=this._textAreaInput.textAreaState.newlineCountBeforeSelection)&&void 0!==e?e:this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=n*this._lineHeight}else this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:BWe?0:1,useCover:!1})}_newlinecount(e){let t=0,i=-1;for(;i=e.indexOf("\n",i+1),-1!==i;)t++;return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:BWe?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;Txe(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?hRe.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const n=this._context.configuration.options;n.get(54)?i.setClassName("monaco-editor-background textAreaCover "+MWe.OUTER_CLASS_NAME):0!==n.get(64).renderType?i.setClassName("monaco-editor-background textAreaCover "+NWe.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}}function VWe(e,t,i){let n=ESe(e);return-1===n&&(n=e.length),function(e,t,i){let n=0;for(let i=0;i<e.length;i++)"\t"===e.charAt(i)?n=PFe.nextIndentTabStop(n,t):n++;let o="";if(!i){const e=Math.floor(n/t);n%=t;for(let t=0;t<e;t++)o+="\t"}for(let e=0;e<n;e++)o+=" ";return o}(e.substring(0,n),t,i)+e.substring(n)}const HWe=()=>!0,zWe=()=>!1,UWe=e=>" "===e||"\t"===e;class KWe{static shouldRecreate(e){return e.hasChanged(138)||e.hasChanged(124)||e.hasChanged(34)||e.hasChanged(73)||e.hasChanged(75)||e.hasChanged(76)||e.hasChanged(5)||e.hasChanged(8)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(122)||e.hasChanged(47)||e.hasChanged(86)}constructor(e,t,i,n){this.languageConfigurationService=n,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const o=i.options,s=o.get(138),r=o.get(47);this.readOnly=o.get(86),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=o.get(110),this.lineHeight=r.lineHeight,this.typicalHalfwidthCharacterWidth=r.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(s.height/this.lineHeight)-2),this.useTabStops=o.get(122),this.wordSeparators=o.get(124),this.emptySelectionClipboard=o.get(34),this.copyWithSyntaxHighlighting=o.get(22),this.multiCursorMergeOverlapping=o.get(73),this.multiCursorPaste=o.get(75),this.multiCursorLimit=o.get(76),this.autoClosingBrackets=o.get(5),this.autoClosingQuotes=o.get(8),this.autoClosingDelete=o.get(6),this.autoClosingOvertype=o.get(7),this.autoSurround=o.get(11),this.autoIndent=o.get(9),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const a=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(a)for(const e of a)this.surroundingPairs[e.open]=e.close}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=null===(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)||void 0===e?void 0:e.getElectricCharacters();if(t)for(const e of t)this._electricChars[e]=!0}return this._electricChars}onElectricCharacter(e,t,i){const n=jke(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return o?o.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return VWe(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return UWe;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return HWe;case"never":return zWe}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return e=>-1!==i.indexOf(e)}visibleColumnFromColumn(e,t){return PFe.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const n=PFe.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(n<o)return o;const s=e.getLineMaxColumn(t);return n>s?s:n}}class jWe{static fromModelState(e){return new qWe(e)}static fromViewState(e){return new $We(e)}static fromModelSelection(e){const t=hye.liftSelection(e),i=new GWe(dye.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return jWe.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this.fromModelSelection(e[i]);return t}constructor(e,t){this._cursorStateBrand=void 0,this.modelState=e,this.viewState=t}equals(e){return this.viewState.equals(e.viewState)&&this.modelState.equals(e.modelState)}}class qWe{constructor(e){this.modelState=e,this.viewState=null}}class $We{constructor(e){this.modelState=null,this.viewState=e}}class GWe{constructor(e,t,i,n,o){this.selectionStart=e,this.selectionStartKind=t,this.selectionStartLeftoverVisibleColumns=i,this.position=n,this.leftoverVisibleColumns=o,this._singleCursorStateBrand=void 0,this.selection=GWe._computeSelection(this.selectionStart,this.position)}equals(e){return this.selectionStartLeftoverVisibleColumns===e.selectionStartLeftoverVisibleColumns&&this.leftoverVisibleColumns===e.leftoverVisibleColumns&&this.selectionStartKind===e.selectionStartKind&&this.position.equals(e.position)&&this.selectionStart.equalsRange(e.selectionStart)}hasSelection(){return!this.selection.isEmpty()||!this.selectionStart.isEmpty()}move(e,t,i,n){return e?new GWe(this.selectionStart,this.selectionStartKind,this.selectionStartLeftoverVisibleColumns,new lye(t,i),n):new GWe(new dye(t,i,t,i),0,n,new lye(t,i),n)}static _computeSelection(e,t){return e.isEmpty()||!t.isBeforeOrEqual(e.getStartPosition())?hye.fromPositions(e.getStartPosition(),t):hye.fromPositions(e.getEndPosition(),t)}}class ZWe{constructor(e,t,i){this._editOperationResultBrand=void 0,this.type=e,this.commands=t,this.shouldPushStackElementBefore=i.shouldPushStackElementBefore,this.shouldPushStackElementAfter=i.shouldPushStackElementAfter}}function YWe(e){return"'"===e||'"'===e||"`"===e}class QWe{static columnSelect(e,t,i,n,o,s){const r=Math.abs(o-i)+1,a=i>o,l=n>s,d=n<s,h=[];for(let o=0;o<r;o++){const r=i+(a?-o:o),c=e.columnFromVisibleColumn(t,r,n),u=e.columnFromVisibleColumn(t,r,s),g=e.visibleColumnFromColumn(t,new lye(r,c)),p=e.visibleColumnFromColumn(t,new lye(r,u));if(d){if(g>s)continue;if(p<n)continue}if(l){if(p>n)continue;if(g<s)continue}h.push(new GWe(new dye(r,c,r,c),0,0,new lye(r,u),0))}if(0===h.length)for(let e=0;e<r;e++){const n=i+(a?-e:e),o=t.getLineMaxColumn(n);h.push(new GWe(new dye(n,o,n,o),0,0,new lye(n,o),0))}return{viewStates:h,reversed:a,fromLineNumber:i,fromVisualColumn:n,toLineNumber:o,toVisualColumn:s}}static columnSelectLeft(e,t,i){let n=i.toViewVisualColumn;return n>0&&n--,QWe.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,i){let n=0;const o=Math.min(i.fromViewLineNumber,i.toViewLineNumber),s=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let i=o;i<=s;i++){const o=t.getLineMaxColumn(i),s=e.visibleColumnFromColumn(t,new lye(i,o));n=Math.max(n,s)}let r=i.toViewVisualColumn;return r<n&&r++,this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,r)}static columnSelectUp(e,t,i,n){const o=n?e.pageSize:1,s=Math.max(1,i.toViewLineNumber-o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,s,i.toViewVisualColumn)}static columnSelectDown(e,t,i,n){const o=n?e.pageSize:1,s=Math.min(t.getLineCount(),i.toViewLineNumber+o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,s,i.toViewVisualColumn)}}class XWe{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return hye.fromPositions(i.getEndPosition())}}class JWe{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return hye.fromPositions(i.getStartPosition())}}class eVe{constructor(e,t,i,n,o=!1){this._range=e,this._text=t,this._columnDeltaOffset=n,this._lineNumberDeltaOffset=i,this.insertsAutoWhitespace=o}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return hye.fromPositions(i.getEndPosition().delta(this._lineNumberDeltaOffset,this._columnDeltaOffset))}}class tVe{constructor(e,t,i,n=!1){this._range=e,this._text=t,this._initialSelection=i,this._forceMoveMarkers=n,this._selectionId=null}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text,this._forceMoveMarkers),this._selectionId=t.trackSelection(this._initialSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}class iVe{constructor(e,t,i){this._cursorPositionBrand=void 0,this.lineNumber=e,this.column=t,this.leftoverVisibleColumns=i}}class nVe{static leftPosition(e,t){if(t.column>e.getLineMinColumn(t.lineNumber))return t.delta(void 0,-ZSe(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new lye(i,e.getLineMaxColumn(i))}return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const n=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),s=FFe.atomicPosition(o,t.column-1,i,0);if(-1!==s&&s+1>=n)return new lye(t.lineNumber,s+1)}return this.leftPosition(e,t)}static left(e,t,i){const n=e.stickyTabStops?nVe.leftPositionAtomicSoftTabs(t,i,e.tabSize):nVe.leftPosition(t,i);return new iVe(n.lineNumber,n.column,0)}static moveLeft(e,t,i,n,o){let s,r;if(i.hasSelection()&&!n)s=i.selection.startLineNumber,r=i.selection.startColumn;else{const n=i.position.delta(void 0,-(o-1)),a=t.normalizePosition(nVe.clipPositionColumn(n,t),0),l=nVe.left(e,t,a);s=l.lineNumber,r=l.column}return i.move(n,s,r,0)}static clipPositionColumn(e,t){return new lye(e.lineNumber,nVe.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return e<t?t:e>i?i:e}static rightPosition(e,t,i){return i<e.getLineMaxColumn(t)?i+=GSe(e.getLineContent(t),i-1):t<e.getLineCount()&&(t+=1,i=e.getLineMinColumn(t)),new lye(t,i)}static rightPositionAtomicSoftTabs(e,t,i,n,o){if(i<e.getLineIndentColumn(t)){const o=e.getLineContent(t),s=FFe.atomicPosition(o,i-1,n,1);if(-1!==s)return new lye(t,s+1)}return this.rightPosition(e,t,i)}static right(e,t,i){const n=e.stickyTabStops?nVe.rightPositionAtomicSoftTabs(t,i.lineNumber,i.column,e.tabSize,e.indentSize):nVe.rightPosition(t,i.lineNumber,i.column);return new iVe(n.lineNumber,n.column,0)}static moveRight(e,t,i,n,o){let s,r;if(i.hasSelection()&&!n)s=i.selection.endLineNumber,r=i.selection.endColumn;else{const n=i.position.delta(void 0,o-1),a=t.normalizePosition(nVe.clipPositionColumn(n,t),1),l=nVe.right(e,t,a);s=l.lineNumber,r=l.column}return i.move(n,s,r,0)}static vertical(e,t,i,n,o,s,r,a){const l=PFe.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize)+o,d=t.getLineCount(),h=1===i&&1===n,c=i===d&&n===t.getLineMaxColumn(i),u=s<i?h:c;if((i=s)<1?(i=1,n=r?t.getLineMinColumn(i):Math.min(t.getLineMaxColumn(i),n)):i>d?(i=d,n=r?t.getLineMaxColumn(i):Math.min(t.getLineMaxColumn(i),n)):n=e.columnFromVisibleColumn(t,i,l),o=u?0:l-PFe.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),void 0!==a){const e=new lye(i,n),s=t.normalizePosition(e,a);o+=n-s.column,i=s.lineNumber,n=s.column}return new iVe(i,n,o)}static down(e,t,i,n,o,s,r){return this.vertical(e,t,i,n,o,i+s,r,4)}static moveDown(e,t,i,n,o){let s,r;i.hasSelection()&&!n?(s=i.selection.endLineNumber,r=i.selection.endColumn):(s=i.position.lineNumber,r=i.position.column);const a=nVe.down(e,t,s,r,i.leftoverVisibleColumns,o,!0);return i.move(n,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateDown(e,t,i){const n=i.selection,o=nVe.down(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=nVe.down(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new GWe(new dye(o.lineNumber,o.column,o.lineNumber,o.column),0,o.leftoverVisibleColumns,new lye(s.lineNumber,s.column),s.leftoverVisibleColumns)}static up(e,t,i,n,o,s,r){return this.vertical(e,t,i,n,o,i-s,r,3)}static moveUp(e,t,i,n,o){let s,r;i.hasSelection()&&!n?(s=i.selection.startLineNumber,r=i.selection.startColumn):(s=i.position.lineNumber,r=i.position.column);const a=nVe.up(e,t,s,r,i.leftoverVisibleColumns,o,!0);return i.move(n,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateUp(e,t,i){const n=i.selection,o=nVe.up(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=nVe.up(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new GWe(new dye(o.lineNumber,o.column,o.lineNumber,o.column),0,o.leftoverVisibleColumns,new lye(s.lineNumber,s.column),s.leftoverVisibleColumns)}static _isBlankLine(e,t){return 0===e.getLineFirstNonWhitespaceColumn(t)}static moveToPrevBlankLine(e,t,i,n){let o=i.position.lineNumber;for(;o>1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return i.move(n,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,n){const o=t.getLineCount();let s=i.position.lineNumber;for(;s<o&&this._isBlankLine(t,s);)s++;for(;s<o&&!this._isBlankLine(t,s);)s++;return i.move(n,s,t.getLineMinColumn(s),0)}static moveToBeginningOfLine(e,t,i,n){const o=i.position.lineNumber,s=t.getLineMinColumn(o),r=t.getLineFirstNonWhitespaceColumn(o)||s;let a;return a=i.position.column===r?s:r,i.move(n,o,a,0)}static moveToEndOfLine(e,t,i,n,o){const s=i.position.lineNumber,r=t.getLineMaxColumn(s);return i.move(n,s,r,o?1073741824-r:0)}static moveToBeginningOfBuffer(e,t,i,n){return i.move(n,1,1,0)}static moveToEndOfBuffer(e,t,i,n){const o=t.getLineCount(),s=t.getLineMaxColumn(o);return i.move(n,o,s,0)}}class oVe{static deleteRight(e,t,i,n){const o=[];let s=3!==e;for(let e=0,r=n.length;e<r;e++){const r=n[e];let a=r;if(a.isEmpty()){const e=r.getPosition(),n=nVe.right(t,i,e);a=new dye(n.lineNumber,n.column,e.lineNumber,e.column)}a.isEmpty()?o[e]=null:(a.startLineNumber!==a.endLineNumber&&(s=!0),o[e]=new XWe(a,""))}return[s,o]}static isAutoClosingPairDelete(e,t,i,n,o,s,r){if("never"===t&&"never"===i)return!1;if("never"===e)return!1;for(let a=0,l=s.length;a<l;a++){const l=s[a],d=l.getPosition();if(!l.isEmpty())return!1;const h=o.getLineContent(d.lineNumber);if(d.column<2||d.column>=h.length+1)return!1;const c=h.charAt(d.column-2),u=n.get(c);if(!u)return!1;if(YWe(c)){if("never"===i)return!1}else if("never"===t)return!1;const g=h.charAt(d.column-1);let p=!1;for(const e of u)e.open===c&&e.close===g&&(p=!0);if(!p)return!1;if("auto"===e){let e=!1;for(let t=0,i=r.length;t<i;t++){const i=r[t];if(d.lineNumber===i.startLineNumber&&d.column===i.startColumn){e=!0;break}}if(!e)return!1}}return!0}static _runAutoClosingPairDelete(e,t,i){const n=[];for(let e=0,t=i.length;e<t;e++){const t=i[e].getPosition(),o=new dye(t.lineNumber,t.column-1,t.lineNumber,t.column+1);n[e]=new XWe(o,"")}return[!0,n]}static deleteLeft(e,t,i,n,o){if(this.isAutoClosingPairDelete(t.autoClosingDelete,t.autoClosingBrackets,t.autoClosingQuotes,t.autoClosingPairs.autoClosingPairsOpenByEnd,i,n,o))return this._runAutoClosingPairDelete(t,i,n);const s=[];let r=2!==e;for(let e=0,o=n.length;e<o;e++){const o=oVe.getDeleteRange(n[e],i,t);o.isEmpty()?s[e]=null:(o.startLineNumber!==o.endLineNumber&&(r=!0),s[e]=new XWe(o,""))}return[r,s]}static getDeleteRange(e,t,i){if(!e.isEmpty())return e;const n=e.getPosition();if(i.useTabStops&&n.column>1){const e=t.getLineContent(n.lineNumber),o=ESe(e),s=-1===o?e.length+1:o+1;if(n.column<=s){const e=i.visibleColumnFromColumn(t,n),o=PFe.prevIndentTabStop(e,i.indentSize),s=i.columnFromVisibleColumn(t,n.lineNumber,o);return new dye(n.lineNumber,s,n.lineNumber,n.column)}}return dye.fromPositions(oVe.getPositionAfterDeleteLeft(n,t),n)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=function(e,t){if(0===e)return 0;const i=function(e,t){const i=new qSe(t,e);let n=i.prevCodePoint();for(;dxe(n)||65039===n||8419===n;){if(0===i.offset)return;n=i.prevCodePoint()}if(!nxe(n))return;let o=i.offset;return o>0&&8205===i.prevCodePoint()&&(o=i.offset),o}(e,t);if(void 0!==i)return i;const n=new qSe(t,e);return n.prevCodePoint(),n.offset}(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}if(e.lineNumber>1){const i=e.lineNumber-1;return new lye(i,t.getLineMaxColumn(i))}return e}static cut(e,t,i){const n=[];let o=null;i.sort(((e,t)=>lye.compare(e.getStartPosition(),t.getEndPosition())));for(let s=0,r=i.length;s<r;s++){const r=i[s];if(r.isEmpty())if(e.emptySelectionClipboard){const e=r.getPosition();let i,a,l,d;e.lineNumber<t.getLineCount()?(i=e.lineNumber,a=1,l=e.lineNumber+1,d=1):e.lineNumber>1&&(null==o?void 0:o.endLineNumber)!==e.lineNumber?(i=e.lineNumber-1,a=t.getLineMaxColumn(e.lineNumber-1),l=e.lineNumber,d=t.getLineMaxColumn(e.lineNumber)):(i=e.lineNumber,a=1,l=e.lineNumber,d=t.getLineMaxColumn(e.lineNumber));const h=new dye(i,a,l,d);o=h,h.isEmpty()?n[s]=null:n[s]=new XWe(h,"")}else n[s]=null;else n[s]=new XWe(r,"")}return new ZWe(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class sVe{static _createWord(e,t,i,n,o){return{start:n,end:o,wordType:t,nextCharClass:i}}static _findPreviousWordOnLine(e,t,i){const n=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(n,e,i)}static _doFindPreviousWordOnLine(e,t,i){let n=0;for(let o=i.column-2;o>=0;o--){const i=e.charCodeAt(o),s=t.get(i);if(0===s){if(2===n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1));n=1}else if(2===s){if(1===n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1));n=2}else if(1===s&&0!==n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1))}return 0!==n?this._createWord(e,n,1,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){const o=e.length;for(let s=n;s<o;s++){const n=e.charCodeAt(s),o=t.get(n);if(1===o)return s;if(1===i&&2===o)return s;if(2===i&&0===o)return s}return o}static _findNextWordOnLine(e,t,i){const n=t.getLineContent(i.lineNumber);return this._doFindNextWordOnLine(n,e,i)}static _doFindNextWordOnLine(e,t,i){let n=0;const o=e.length;for(let s=i.column-1;s<o;s++){const i=e.charCodeAt(s),o=t.get(i);if(0===o){if(2===n)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,s-1),s);n=1}else if(2===o){if(1===n)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,s-1),s);n=2}else if(1===o&&0!==n)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,s-1),s)}return 0!==n?this._createWord(e,n,1,this._findStartOfWord(e,t,n,o-1),o):null}static _findStartOfWord(e,t,i,n){for(let o=n;o>=0;o--){const n=e.charCodeAt(o),s=t.get(n);if(1===s)return o+1;if(1===i&&2===s)return o+1;if(2===i&&0===s)return o+1}return 0}static moveWordLeft(e,t,i,n){let o=i.lineNumber,s=i.column;1===s&&o>1&&(o-=1,s=t.getLineMaxColumn(o));let r=sVe._findPreviousWordOnLine(e,t,new lye(o,s));if(0===n)return new lye(o,r?r.start+1:1);if(1===n)return r&&2===r.wordType&&r.end-r.start==1&&0===r.nextCharClass&&(r=sVe._findPreviousWordOnLine(e,t,new lye(o,r.start+1))),new lye(o,r?r.start+1:1);if(3===n){for(;r&&2===r.wordType;)r=sVe._findPreviousWordOnLine(e,t,new lye(o,r.start+1));return new lye(o,r?r.start+1:1)}return r&&s<=r.end+1&&(r=sVe._findPreviousWordOnLine(e,t,new lye(o,r.start+1))),new lye(o,r?r.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(1===t.column)return i>1?new lye(i-1,e.getLineMaxColumn(i-1)):t;const o=e.getLineContent(i);for(let e=t.column-1;e>1;e--){const t=o.charCodeAt(e-2),s=o.charCodeAt(e-1);if(95===t&&95!==s)return new lye(i,e);if(45===t&&45!==s)return new lye(i,e);if((PSe(t)||OSe(t))&&FSe(s))return new lye(i,e);if(FSe(t)&&FSe(s)&&e+1<n){const t=o.charCodeAt(e);if(PSe(t)||OSe(t))return new lye(i,e)}}return new lye(i,1)}static moveWordRight(e,t,i,n){let o=i.lineNumber,s=i.column,r=!1;s===t.getLineMaxColumn(o)&&o<t.getLineCount()&&(r=!0,o+=1,s=1);let a=sVe._findNextWordOnLine(e,t,new lye(o,s));if(2===n)a&&2===a.wordType&&a.end-a.start==1&&0===a.nextCharClass&&(a=sVe._findNextWordOnLine(e,t,new lye(o,a.end+1))),s=a?a.end+1:t.getLineMaxColumn(o);else if(3===n){for(r&&(s=0);a&&(2===a.wordType||a.start+1<=s);)a=sVe._findNextWordOnLine(e,t,new lye(o,a.end+1));s=a?a.start+1:t.getLineMaxColumn(o)}else a&&!r&&s>=a.start+1&&(a=sVe._findNextWordOnLine(e,t,new lye(o,a.end+1))),s=a?a.start+1:t.getLineMaxColumn(o);return new lye(o,s)}static _moveWordPartRight(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===n)return i<e.getLineCount()?new lye(i+1,1):t;const o=e.getLineContent(i);for(let e=t.column+1;e<n;e++){const t=o.charCodeAt(e-2),s=o.charCodeAt(e-1);if(95!==t&&95===s)return new lye(i,e);if(45!==t&&45===s)return new lye(i,e);if((PSe(t)||OSe(t))&&FSe(s))return new lye(i,e);if(FSe(t)&&FSe(s)&&e+1<n){const t=o.charCodeAt(e);if(PSe(t)||OSe(t))return new lye(i,e)}}return new lye(i,n)}static _deleteWordLeftWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=t.column-2,o=ISe(i,n);return o+1<n?new dye(t.lineNumber,o+2,t.lineNumber,t.column):null}static deleteWordLeft(e,t){const i=e.wordSeparators,n=e.model,o=e.selection,s=e.whitespaceHeuristics;if(!o.isEmpty())return o;if(oVe.isAutoClosingPairDelete(e.autoClosingDelete,e.autoClosingBrackets,e.autoClosingQuotes,e.autoClosingPairs.autoClosingPairsOpenByEnd,e.model,[e.selection],e.autoClosedCharacters)){const t=e.selection.getPosition();return new dye(t.lineNumber,t.column-1,t.lineNumber,t.column+1)}const r=new lye(o.positionLineNumber,o.positionColumn);let a=r.lineNumber,l=r.column;if(1===a&&1===l)return null;if(s){const e=this._deleteWordLeftWhitespace(n,r);if(e)return e}let d=sVe._findPreviousWordOnLine(i,n,r);return 0===t?d?l=d.start+1:l>1?l=1:(a--,l=n.getLineMaxColumn(a)):(d&&l<=d.end+1&&(d=sVe._findPreviousWordOnLine(i,n,new lye(a,d.start+1))),d?l=d.end+1:l>1?l=1:(a--,l=n.getLineMaxColumn(a))),new dye(a,l,r.lineNumber,r.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const n=new lye(i.positionLineNumber,i.positionColumn);return this._deleteInsideWordWhitespace(t,n)||this._deleteInsideWordDetermineDeleteRange(e,t,n)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return 32===i||9===i}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=i.length;if(0===n)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let s=Math.min(t.column-1,n-1);if(!this._charAtIsWhitespace(i,s))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;s+1<n&&this._charAtIsWhitespace(i,s+1);)s++;return new dye(t.lineNumber,o+1,t.lineNumber,s+2)}static _deleteInsideWordDetermineDeleteRange(e,t,i){const n=t.getLineContent(i.lineNumber),o=n.length;if(0===o)return i.lineNumber>1?new dye(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumber<t.getLineCount()?new dye(i.lineNumber,1,i.lineNumber+1,1):new dye(i.lineNumber,1,i.lineNumber,1);const s=e=>e.start+1<=i.column&&i.column<=e.end+1,r=(e,t)=>(e=Math.min(e,i.column),t=Math.max(t,i.column),new dye(i.lineNumber,e,i.lineNumber,t)),a=e=>{let t=e.start+1,i=e.end+1,s=!1;for(;i-1<o&&this._charAtIsWhitespace(n,i-1);)s=!0,i++;if(!s)for(;t>1&&this._charAtIsWhitespace(n,t-2);)t--;return r(t,i)},l=sVe._findPreviousWordOnLine(e,t,i);if(l&&s(l))return a(l);const d=sVe._findNextWordOnLine(e,t,i);return d&&s(d)?a(d):l&&d?r(l.end+1,d.start+1):l?r(l.start+1,l.end+1):d?r(d.start+1,d.end+1):r(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=sVe._moveWordPartLeft(e,i);return new dye(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let n=t;n<i;n++){const t=e.charAt(n);if(" "!==t&&"\t"!==t)return n}return i}static _deleteWordRightWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=t.column-1,o=this._findFirstNonWhitespaceChar(i,n);return n+1<o?new dye(t.lineNumber,t.column,t.lineNumber,o+1):null}static deleteWordRight(e,t){const i=e.wordSeparators,n=e.model,o=e.selection,s=e.whitespaceHeuristics;if(!o.isEmpty())return o;const r=new lye(o.positionLineNumber,o.positionColumn);let a=r.lineNumber,l=r.column;const d=n.getLineCount(),h=n.getLineMaxColumn(a);if(a===d&&l===h)return null;if(s){const e=this._deleteWordRightWhitespace(n,r);if(e)return e}let c=sVe._findNextWordOnLine(i,n,r);return 2===t?c?l=c.end+1:l<h||a===d?l=h:(a++,c=sVe._findNextWordOnLine(i,n,new lye(a,1)),l=c?c.start+1:n.getLineMaxColumn(a)):(c&&l>=c.start+1&&(c=sVe._findNextWordOnLine(i,n,new lye(a,c.end+1))),c?l=c.start+1:l<h||a===d?l=h:(a++,c=sVe._findNextWordOnLine(i,n,new lye(a,1)),l=c?c.start+1:n.getLineMaxColumn(a))),new dye(a,l,r.lineNumber,r.column)}static _deleteWordPartRight(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=sVe._moveWordPartRight(e,i);return new dye(i.lineNumber,i.column,n.lineNumber,n.column)}static _createWordAtPosition(e,t,i){const n=new dye(t,i.start+1,t,i.end+1);return{word:e.getValueInRange(n),startColumn:n.startColumn,endColumn:n.endColumn}}static getWordAtPosition(e,t,i){const n=MEe(t),o=sVe._findPreviousWordOnLine(n,e,i);if(o&&1===o.wordType&&o.start<=i.column-1&&i.column-1<=o.end)return sVe._createWordAtPosition(e,i.lineNumber,o);const s=sVe._findNextWordOnLine(n,e,i);return s&&1===s.wordType&&s.start<=i.column-1&&i.column-1<=s.end?sVe._createWordAtPosition(e,i.lineNumber,s):null}static word(e,t,i,n,o){const s=MEe(e.wordSeparators),r=sVe._findPreviousWordOnLine(s,t,o),a=sVe._findNextWordOnLine(s,t,o);if(!n){let e,i;return r&&1===r.wordType&&r.start<=o.column-1&&o.column-1<=r.end?(e=r.start+1,i=r.end+1):a&&1===a.wordType&&a.start<=o.column-1&&o.column-1<=a.end?(e=a.start+1,i=a.end+1):(e=r?r.end+1:1,i=a?a.start+1:t.getLineMaxColumn(o.lineNumber)),new GWe(new dye(o.lineNumber,e,o.lineNumber,i),1,0,new lye(o.lineNumber,i),0)}let l,d;r&&1===r.wordType&&r.start<o.column-1&&o.column-1<r.end?(l=r.start+1,d=r.end+1):a&&1===a.wordType&&a.start<o.column-1&&o.column-1<a.end?(l=a.start+1,d=a.end+1):(l=o.column,d=o.column);const h=o.lineNumber;let c;if(i.selectionStart.containsPosition(o))c=i.selectionStart.endColumn;else if(o.isBeforeOrEqual(i.selectionStart.getStartPosition())){c=l;const e=new lye(h,c);i.selectionStart.containsPosition(e)&&(c=i.selectionStart.endColumn)}else{c=d;const e=new lye(h,c);i.selectionStart.containsPosition(e)&&(c=i.selectionStart.startColumn)}return i.move(!0,h,c,0)}}class rVe{static addCursorDown(e,t,i){const n=[];let o=0;for(let s=0,r=t.length;s<r;s++){const r=t[s];n[o++]=new jWe(r.modelState,r.viewState),n[o++]=i?jWe.fromModelState(nVe.translateDown(e.cursorConfig,e.model,r.modelState)):jWe.fromViewState(nVe.translateDown(e.cursorConfig,e,r.viewState))}return n}static addCursorUp(e,t,i){const n=[];let o=0;for(let s=0,r=t.length;s<r;s++){const r=t[s];n[o++]=new jWe(r.modelState,r.viewState),n[o++]=i?jWe.fromModelState(nVe.translateUp(e.cursorConfig,e.model,r.modelState)):jWe.fromViewState(nVe.translateUp(e.cursorConfig,e,r.viewState))}return n}static moveToBeginningOfLine(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o];n[o]=this._moveToLineStart(e,s,i)}return n}static _moveToLineStart(e,t,i){const n=t.viewState.position.column,o=n===t.modelState.position.column,s=t.viewState.position.lineNumber,r=e.getLineFirstNonWhitespaceColumn(s);return o||n===r?this._moveToLineStartByModel(e,t,i):this._moveToLineStartByView(e,t,i)}static _moveToLineStartByView(e,t,i){return jWe.fromViewState(nVe.moveToBeginningOfLine(e.cursorConfig,e,t.viewState,i))}static _moveToLineStartByModel(e,t,i){return jWe.fromModelState(nVe.moveToBeginningOfLine(e.cursorConfig,e.model,t.modelState,i))}static moveToEndOfLine(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=this._moveToLineEnd(e,r,i,n)}return o}static _moveToLineEnd(e,t,i,n){const o=t.viewState.position,s=e.getLineMaxColumn(o.lineNumber),r=o.column===s,a=t.modelState.position,l=e.model.getLineMaxColumn(a.lineNumber),d=s-o.column==l-a.column;return r||d?this._moveToLineEndByModel(e,t,i,n):this._moveToLineEndByView(e,t,i,n)}static _moveToLineEndByView(e,t,i,n){return jWe.fromViewState(nVe.moveToEndOfLine(e.cursorConfig,e,t.viewState,i,n))}static _moveToLineEndByModel(e,t,i,n){return jWe.fromModelState(nVe.moveToEndOfLine(e.cursorConfig,e.model,t.modelState,i,n))}static expandLineSelection(e,t){const i=[];for(let n=0,o=t.length;n<o;n++){const o=t[n],s=o.modelState.selection.startLineNumber,r=e.model.getLineCount();let a,l=o.modelState.selection.endLineNumber;l===r?a=e.model.getLineMaxColumn(r):(l++,a=1),i[n]=jWe.fromModelState(new GWe(new dye(s,1,s,1),0,0,new lye(l,a),0))}return i}static moveToBeginningOfBuffer(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o];n[o]=jWe.fromModelState(nVe.moveToBeginningOfBuffer(e.cursorConfig,e.model,s.modelState,i))}return n}static moveToEndOfBuffer(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o];n[o]=jWe.fromModelState(nVe.moveToEndOfBuffer(e.cursorConfig,e.model,s.modelState,i))}return n}static selectAll(e,t){const i=e.model.getLineCount(),n=e.model.getLineMaxColumn(i);return jWe.fromModelState(new GWe(new dye(1,1,1,1),0,0,new lye(i,n),0))}static line(e,t,i,n,o){const s=e.model.validatePosition(n),r=o?e.coordinatesConverter.validateViewPosition(new lye(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);if(!i){const t=e.model.getLineCount();let i=s.lineNumber+1,n=1;return i>t&&(i=t,n=e.model.getLineMaxColumn(i)),jWe.fromModelState(new GWe(new dye(s.lineNumber,1,i,n),2,0,new lye(i,n),0))}const a=t.modelState.selectionStart.getStartPosition().lineNumber;if(s.lineNumber<a)return jWe.fromViewState(t.viewState.move(!0,r.lineNumber,1,0));if(s.lineNumber>a){const i=e.getLineCount();let n=r.lineNumber+1,o=1;return n>i&&(n=i,o=e.getLineMaxColumn(n)),jWe.fromViewState(t.viewState.move(!0,n,o,0))}{const e=t.modelState.selectionStart.getEndPosition();return jWe.fromModelState(t.modelState.move(!0,e.lineNumber,e.column,0))}}static word(e,t,i,n){const o=e.model.validatePosition(n);return jWe.fromModelState(sVe.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new jWe(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return jWe.fromViewState(new GWe(new dye(i,n,i,n),0,0,new lye(i,n),0))}static moveTo(e,t,i,n,o){if(i){if(1===t.modelState.selectionStartKind)return this.word(e,t,i,n);if(2===t.modelState.selectionStartKind)return this.line(e,t,i,n,o)}const s=e.model.validatePosition(n),r=o?e.coordinatesConverter.validateViewPosition(new lye(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);return jWe.fromViewState(t.viewState.move(i,r.lineNumber,r.column,0))}static simpleMove(e,t,i,n,o,s){switch(i){case 0:return 4===s?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,o);case 1:return 4===s?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,o);case 2:return 2===s?this._moveUpByViewLines(e,t,n,o):this._moveUpByModelLines(e,t,n,o);case 3:return 2===s?this._moveDownByViewLines(e,t,n,o):this._moveDownByModelLines(e,t,n,o);case 4:return 2===s?t.map((t=>jWe.fromViewState(nVe.moveToPrevBlankLine(e.cursorConfig,e,t.viewState,n)))):t.map((t=>jWe.fromModelState(nVe.moveToPrevBlankLine(e.cursorConfig,e.model,t.modelState,n))));case 5:return 2===s?t.map((t=>jWe.fromViewState(nVe.moveToNextBlankLine(e.cursorConfig,e,t.viewState,n)))):t.map((t=>jWe.fromModelState(nVe.moveToNextBlankLine(e.cursorConfig,e.model,t.modelState,n))));case 6:return this._moveToViewMinColumn(e,t,n);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case 8:return this._moveToViewCenterColumn(e,t,n);case 9:return this._moveToViewMaxColumn(e,t,n);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,n);default:return null}}static viewportMove(e,t,i,n,o){const s=e.getCompletelyVisibleViewRange(),r=e.coordinatesConverter.convertViewRangeToModelRange(s);switch(i){case 11:{const i=this._firstLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 13:{const i=this._lastLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 12:{const i=Math.round((r.startLineNumber+r.endLineNumber)/2),o=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,o)]}case 14:{const i=[];for(let o=0,r=t.length;o<r;o++){const r=t[o];i[o]=this.findPositionInViewportIfOutside(e,r,s,n)}return i}default:return null}}static findPositionInViewportIfOutside(e,t,i,n){const o=t.viewState.position.lineNumber;if(i.startLineNumber<=o&&o<=i.endLineNumber-1)return new jWe(t.modelState,t.viewState);{let s;s=o>i.endLineNumber-1?i.endLineNumber-1:o<i.startLineNumber?i.startLineNumber:o;const r=nVe.vertical(e.cursorConfig,e,o,t.viewState.position.column,t.viewState.leftoverVisibleColumns,s,!1);return jWe.fromViewState(t.viewState.move(n,r.lineNumber,r.column,r.leftoverVisibleColumns))}}static _firstLineNumberInRange(e,t,i){let n=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(n)&&n++,Math.min(t.endLineNumber,n+i-1)}static _lastLineNumberInRange(e,t,i){let n=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(n)&&n++,Math.max(n,t.endLineNumber-i+1)}static _moveLeft(e,t,i,n){return t.map((t=>jWe.fromViewState(nVe.moveLeft(e.cursorConfig,e,t.viewState,i,n))))}static _moveHalfLineLeft(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=Math.round(e.getLineContent(r).length/2);n[o]=jWe.fromViewState(nVe.moveLeft(e.cursorConfig,e,s.viewState,i,a))}return n}static _moveRight(e,t,i,n){return t.map((t=>jWe.fromViewState(nVe.moveRight(e.cursorConfig,e,t.viewState,i,n))))}static _moveHalfLineRight(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=Math.round(e.getLineContent(r).length/2);n[o]=jWe.fromViewState(nVe.moveRight(e.cursorConfig,e,s.viewState,i,a))}return n}static _moveDownByViewLines(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=jWe.fromViewState(nVe.moveDown(e.cursorConfig,e,r.viewState,i,n))}return o}static _moveDownByModelLines(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=jWe.fromModelState(nVe.moveDown(e.cursorConfig,e.model,r.modelState,i,n))}return o}static _moveUpByViewLines(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=jWe.fromViewState(nVe.moveUp(e.cursorConfig,e,r.viewState,i,n))}return o}static _moveUpByModelLines(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=jWe.fromModelState(nVe.moveUp(e.cursorConfig,e.model,r.modelState,i,n))}return o}static _moveToViewPosition(e,t,i,n,o){return jWe.fromViewState(t.viewState.move(i,n,o,0))}static _moveToModelPosition(e,t,i,n,o){return jWe.fromModelState(t.modelState.move(i,n,o,0))}static _moveToViewMinColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineMinColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewFirstNonWhitespaceColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineFirstNonWhitespaceColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewCenterColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=Math.round((e.getLineMaxColumn(r)+e.getLineMinColumn(r))/2);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewMaxColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineMaxColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewLastNonWhitespaceColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineLastNonWhitespaceColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}}var aVe;function lVe(e,t,i,n){const o=pDe(t,i.startLineNumber,i.startColumn),s=n.getLanguageConfiguration(o.languageId);if(!s)return null;const r=o.getLineContent(),a=r.substr(0,i.startColumn-1-o.firstCharOffset);let l;l=i.isEmpty()?r.substr(i.startColumn-1-o.firstCharOffset):pDe(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-o.firstCharOffset);let d="";if(i.startLineNumber>1&&0===o.firstCharOffset){const e=pDe(t,i.startLineNumber-1);e.languageId===o.languageId&&(d=e.getLineContent())}const h=s.onEnter(e,d,a,l);if(!h)return null;const c=h.indentAction;let u=h.appendText;const g=h.removeText||0;u?c===Oke.Indent&&(u="\t"+u):u=c===Oke.Indent||c===Oke.IndentOutdent?"\t":"";let p=gDe(t,i.startLineNumber,i.startColumn);return g&&(p=p.substring(0,p.length-g)),{indentAction:c,appendText:u,removeText:g,indentation:p}}!function(e){e.description={description:"Move cursor to a logical position in the view",args:[{name:"Cursor move argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'to': A mandatory logical position value providing where to move the cursor.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',\n\t\t\t\t\t\t'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'\n\t\t\t\t\t\t'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'\n\t\t\t\t\t\t'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'by': Unit to move. Default is computed based on 'to' value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'line', 'wrappedLine', 'character', 'halfLine'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'value': Number of units to move. Default is '1'.\n\t\t\t\t\t* 'select': If 'true' makes the selection. Default is 'false'.\n\t\t\t\t",constraint:function(e){if(!_be(e))return!1;const t=e;return!(!fbe(t.to)||!ybe(t.select)&&!Cbe(t.select)||!ybe(t.by)&&!fbe(t.by)||!ybe(t.value)&&!bbe(t.value))},schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1}}}}]},e.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},e.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"},e.parse=function(t){if(!t.to)return null;let i;switch(t.to){case e.RawDirection.Left:i=0;break;case e.RawDirection.Right:i=1;break;case e.RawDirection.Up:i=2;break;case e.RawDirection.Down:i=3;break;case e.RawDirection.PrevBlankLine:i=4;break;case e.RawDirection.NextBlankLine:i=5;break;case e.RawDirection.WrappedLineStart:i=6;break;case e.RawDirection.WrappedLineFirstNonWhitespaceCharacter:i=7;break;case e.RawDirection.WrappedLineColumnCenter:i=8;break;case e.RawDirection.WrappedLineEnd:i=9;break;case e.RawDirection.WrappedLineLastNonWhitespaceCharacter:i=10;break;case e.RawDirection.ViewPortTop:i=11;break;case e.RawDirection.ViewPortBottom:i=13;break;case e.RawDirection.ViewPortCenter:i=12;break;case e.RawDirection.ViewPortIfOutside:i=14;break;default:return null}let n=0;switch(t.by){case e.RawUnit.Line:n=1;break;case e.RawUnit.WrappedLine:n=2;break;case e.RawUnit.Character:n=3;break;case e.RawUnit.HalfLine:n=4}return{direction:i,unit:n,select:!!t.select,value:t.value||1}}}(aVe||(aVe={}));const dVe=Object.create(null);function hVe(e,t){if(t<=0)return"";dVe[e]||(dVe[e]=["",e]);const i=dVe[e];for(let n=i.length;n<=t;n++)i[n]=i[n-1]+e;return i[t]}let cVe=class e{static unshiftIndent(e,t,i,n,o){const s=PFe.visibleColumnFromColumn(e,t,i);if(o){const e=hVe(" ",n);return hVe(e,PFe.prevIndentTabStop(s,n)/n)}return hVe("\t",PFe.prevRenderTabStop(s,i)/i)}static shiftIndent(e,t,i,n,o){const s=PFe.visibleColumnFromColumn(e,t,i);if(o){const e=hVe(" ",n);return hVe(e,PFe.nextIndentTabStop(s,n)/n)}return hVe("\t",PFe.nextRenderTabStop(s,i)/i)}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(t,i){const n=this._selection.startLineNumber;let o=this._selection.endLineNumber;1===this._selection.endColumn&&n!==o&&(o-=1);const{tabSize:s,indentSize:r,insertSpaces:a}=this._opts,l=n===o;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(t.getLineContent(n))&&(this._useLastEditRangeForCursorEndPosition=!0);let d=0,h=0;for(let c=n;c<=o;c++,d=h){h=0;const o=t.getLineContent(c);let u,g=ESe(o);if((!this._opts.isUnshift||0!==o.length&&0!==g)&&(l||this._opts.isUnshift||0!==o.length)){if(-1===g&&(g=o.length),c>1&&PFe.visibleColumnFromColumn(o,g+1,s)%r!=0&&t.tokenization.isCheapToTokenize(c-1)){const e=lVe(this._opts.autoIndent,t,new dye(c-1,t.getLineMaxColumn(c-1),c-1,t.getLineMaxColumn(c-1)),this._languageConfigurationService);if(e){if(h=d,e.appendText)for(let t=0,i=e.appendText.length;t<i&&h<r&&32===e.appendText.charCodeAt(t);t++)h++;e.removeText&&(h=Math.max(0,h-e.removeText));for(let e=0;e<h&&0!==g&&32===o.charCodeAt(g-1);e++)g--}}this._opts.isUnshift&&0===g||(u=this._opts.isUnshift?e.unshiftIndent(o,g+1,s,r,a):e.shiftIndent(o,g+1,s,r,a),this._addEditOperation(i,new dye(c,1,c,g+1),u),c!==n||this._selection.isEmpty()||(this._selectionStartColumnStaysPut=this._selection.startColumn<=g+1))}}}else{!this._opts.isUnshift&&this._selection.isEmpty()&&0===t.getLineLength(n)&&(this._useLastEditRangeForCursorEndPosition=!0);const e=a?hVe(" ",r):"\t";for(let s=n;s<=o;s++){const o=t.getLineContent(s);let a=ESe(o);if((!this._opts.isUnshift||0!==o.length&&0!==a)&&(l||this._opts.isUnshift||0!==o.length)&&(-1===a&&(a=o.length),!this._opts.isUnshift||0!==a))if(this._opts.isUnshift){a=Math.min(a,r);for(let e=0;e<a;e++)if(9===o.charCodeAt(e)){a=e+1;break}this._addEditOperation(i,new dye(s,1,s,a+1),"")}else this._addEditOperation(i,new dye(s,1,s,1),e),s!==n||this._selection.isEmpty()||(this._selectionStartColumnStaysPut=1===this._selection.startColumn)}}this._selectionId=i.trackSelection(this._selection)}computeCursorState(e,t){if(this._useLastEditRangeForCursorEndPosition){const e=t.getInverseEditOperations()[0];return new hye(e.range.endLineNumber,e.range.endColumn,e.range.endLineNumber,e.range.endColumn)}const i=t.getTrackedSelection(this._selectionId);if(this._selectionStartColumnStaysPut){const e=this._selection.startColumn;return i.startColumn<=e?i:0===i.getDirection()?new hye(i.startLineNumber,e,i.endLineNumber,i.endColumn):new hye(i.endLineNumber,i.endColumn,i.startLineNumber,e)}return i}};cVe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(2,dDe)],cVe);class uVe{constructor(e,t,i){this._range=e,this._charBeforeSelection=t,this._charAfterSelection=i}getEditOperations(e,t){t.addTrackedEditOperation(new dye(this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),t.addTrackedEditOperation(new dye(this._range.endLineNumber,this._range.endColumn,this._range.endLineNumber,this._range.endColumn),this._charAfterSelection)}computeCursorState(e,t){const i=t.getInverseEditOperations(),n=i[0].range,o=i[1].range;return new hye(n.endLineNumber,n.endColumn,o.endLineNumber,o.endColumn-this._charAfterSelection.length)}}class gVe{constructor(e,t,i){this._position=e,this._text=t,this._charAfter=i}getEditOperations(e,t){t.addTrackedEditOperation(new dye(this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column),this._text+this._charAfter)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return new hye(i.endLineNumber,i.startColumn,i.endLineNumber,i.endColumn-this._charAfter.length)}}function pVe(e,t,i,n=!0,o){if(e<4)return null;const s=o.getLanguageConfiguration(t.tokenization.getLanguageId()).indentRulesSupport;if(!s)return null;if(i<=1)return{indentation:"",action:null};for(let e=i-1;e>0&&""===t.getLineContent(e);e--)if(1===e)return{indentation:"",action:null};const r=function(e,t,i){const n=e.tokenization.getLanguageIdAtPosition(t,0);if(t>1){let o,s=-1;for(o=t-1;o>=1;o--){if(e.tokenization.getLanguageIdAtPosition(o,0)!==n)return s;const t=e.getLineContent(o);if(!i.shouldIgnore(t)&&!/^\s+$/.test(t)&&""!==t)return o;s=o}}return-1}(t,i,s);if(r<0)return null;if(r<1)return{indentation:"",action:null};const a=t.getLineContent(r);if(s.shouldIncrease(a)||s.shouldIndentNextLine(a))return{indentation:NSe(a),action:Oke.Indent,line:r};if(s.shouldDecrease(a))return{indentation:NSe(a),action:null,line:r};{if(1===r)return{indentation:NSe(t.getLineContent(r)),action:null,line:r};const e=r-1,i=s.getIndentMetadata(t.getLineContent(e));if(!(3&i)&&4&i){let i=0;for(let n=e-1;n>0;n--)if(!s.shouldIndentNextLine(t.getLineContent(n))){i=n;break}return{indentation:NSe(t.getLineContent(i+1)),action:null,line:i+1}}if(n)return{indentation:NSe(t.getLineContent(r)),action:null,line:r};for(let e=r;e>0;e--){const i=t.getLineContent(e);if(s.shouldIncrease(i))return{indentation:NSe(i),action:Oke.Indent,line:e};if(s.shouldIndentNextLine(i)){let i=0;for(let n=e-1;n>0;n--)if(!s.shouldIndentNextLine(t.getLineContent(e))){i=n;break}return{indentation:NSe(t.getLineContent(i+1)),action:null,line:i+1}}if(s.shouldDecrease(i))return{indentation:NSe(i),action:null,line:e}}return{indentation:NSe(t.getLineContent(1)),action:null,line:1}}}class mVe{static indent(e,t,i){if(null===t||null===i)return[];const n=[];for(let t=0,o=i.length;t<o;t++)n[t]=new cVe(i[t],{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return n}static outdent(e,t,i){const n=[];for(let t=0,o=i.length;t<o;t++)n[t]=new cVe(i[t],{isUnshift:!0,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return n}static shiftIndent(e,t,i){return i=i||1,cVe.shiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}static unshiftIndent(e,t,i){return i=i||1,cVe.unshiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}static _distributedPaste(e,t,i,n){const o=[];for(let e=0,t=i.length;e<t;e++)o[e]=new XWe(i[e],n[e]);return new ZWe(0,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _simplePaste(e,t,i,n,o){const s=[];for(let e=0,t=i.length;e<t;e++){const t=i[e],r=t.getPosition();if(o&&!t.isEmpty()&&(o=!1),o&&n.indexOf("\n")!==n.length-1&&(o=!1),o){const i=new dye(r.lineNumber,1,r.lineNumber,1);s[e]=new tVe(i,n,t,!0)}else s[e]=new XWe(t,n)}return new ZWe(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _distributePasteToCursors(e,t,i,n,o){if(n)return null;if(1===t.length)return null;if(o&&o.length===t.length)return o;if("spread"===e.multiCursorPaste){10===i.charCodeAt(i.length-1)&&(i=i.substr(0,i.length-1)),13===i.charCodeAt(i.length-1)&&(i=i.substr(0,i.length-1));const e=DSe(i);if(e.length===t.length)return e}return null}static paste(e,t,i,n,o,s){const r=this._distributePasteToCursors(e,i,n,o,s);return r?(i=i.sort(dye.compareRangesUsingStarts),this._distributedPaste(e,t,i,r)):this._simplePaste(e,t,i,n,o)}static _goodIndentForLine(e,t,i){let n=null,o="";const s=pVe(e.autoIndent,t,i,!1,e.languageConfigurationService);if(s)n=s.action,o=s.indentation;else if(i>1){let n;for(n=i-1;n>=1&&!(ISe(t.getLineContent(n))>=0);n--);if(n<1)return null;const s=t.getLineMaxColumn(n),r=lVe(e.autoIndent,t,new dye(n,s,n,s),e.languageConfigurationService);r&&(o=r.indentation+r.appendText)}return n&&(n===Oke.Indent&&(o=mVe.shiftIndent(e,o)),n===Oke.Outdent&&(o=mVe.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,n){let o="";const s=i.getStartPosition();if(e.insertSpaces){const i=e.visibleColumnFromColumn(t,s),n=e.indentSize,r=n-i%n;for(let e=0;e<r;e++)o+=" "}else o="\t";return new XWe(i,o,n)}static tab(e,t,i){const n=[];for(let o=0,s=i.length;o<s;o++){const s=i[o];if(s.isEmpty()){const i=t.getLineContent(s.startLineNumber);if(/^\s*$/.test(i)&&t.tokenization.isCheapToTokenize(s.startLineNumber)){let r=this._goodIndentForLine(e,t,s.startLineNumber);r=r||"\t";const a=e.normalizeIndentation(r);if(!i.startsWith(a)){n[o]=new XWe(new dye(s.startLineNumber,1,s.startLineNumber,i.length+1),a,!0);continue}}n[o]=this._replaceJumpToNextIndent(e,t,s,!0)}else{if(s.startLineNumber===s.endLineNumber){const i=t.getLineMaxColumn(s.startLineNumber);if(1!==s.startColumn||s.endColumn!==i){n[o]=this._replaceJumpToNextIndent(e,t,s,!1);continue}}n[o]=new cVe(s,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService)}}return n}static compositionType(e,t,i,n,o,s,r,a){const l=n.map((e=>this._compositionType(i,e,o,s,r,a)));return new ZWe(4,l,{shouldPushStackElementBefore:bVe(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,o,s){if(!t.isEmpty())return null;const r=t.getPosition(),a=Math.max(1,r.column-n),l=Math.min(e.getLineMaxColumn(r.lineNumber),r.column+o),d=new dye(r.lineNumber,a,r.lineNumber,l);return e.getValueInRange(d)===i&&0===s?null:new eVe(d,i,0,s)}static _typeCommand(e,t,i){return i?new JWe(e,t,!0):new XWe(e,t,!0)}static _enter(e,t,i,n){if(0===e.autoIndent)return mVe._typeCommand(n,"\n",i);if(!t.tokenization.isCheapToTokenize(n.getStartPosition().lineNumber)||1===e.autoIndent){const o=NSe(t.getLineContent(n.startLineNumber)).substring(0,n.startColumn-1);return mVe._typeCommand(n,"\n"+e.normalizeIndentation(o),i)}const o=lVe(e.autoIndent,t,n,e.languageConfigurationService);if(o){if(o.indentAction===Oke.None)return mVe._typeCommand(n,"\n"+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===Oke.Indent)return mVe._typeCommand(n,"\n"+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===Oke.IndentOutdent){const t=e.normalizeIndentation(o.indentation),s=e.normalizeIndentation(o.indentation+o.appendText),r="\n"+s+"\n"+t;return i?new JWe(n,r,!0):new eVe(n,r,-1,s.length-t.length,!0)}if(o.indentAction===Oke.Outdent){const t=mVe.unshiftIndent(e,o.indentation);return mVe._typeCommand(n,"\n"+e.normalizeIndentation(t+o.appendText),i)}}const s=NSe(t.getLineContent(n.startLineNumber)).substring(0,n.startColumn-1);if(e.autoIndent>=4){const o=function(e,t,i,n,o){if(e<4)return null;t.tokenization.forceTokenization(i.startLineNumber);const s=t.tokenization.getLineTokens(i.startLineNumber),r=jke(s,i.startColumn-1),a=r.getLineContent();let l,d,h=!1;r.firstCharOffset>0&&s.getLanguageId(0)!==r.languageId?(h=!0,l=a.substr(0,i.startColumn-1-r.firstCharOffset)):l=s.getLineContent().substring(0,i.startColumn-1),d=i.isEmpty()?a.substr(i.startColumn-1-r.firstCharOffset):pDe(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-r.firstCharOffset);const c=o.getLanguageConfiguration(r.languageId).indentRulesSupport;if(!c)return null;const u=l,g=NSe(l),p={tokenization:{getLineTokens:e=>t.tokenization.getLineTokens(e),getLanguageId:()=>t.getLanguageId(),getLanguageIdAtPosition:(e,i)=>t.getLanguageIdAtPosition(e,i)},getLineContent:e=>e===i.startLineNumber?u:t.getLineContent(e)},m=NSe(s.getLineContent()),f=pVe(e,p,i.startLineNumber+1,void 0,o);if(!f){const e=h?m:g;return{beforeEnter:e,afterEnter:e}}let _=h?m:f.indentation;return f.action===Oke.Indent&&(_=n.shiftIndent(_)),c.shouldDecrease(d)&&(_=n.unshiftIndent(_)),{beforeEnter:h?m:g,afterEnter:_}}(e.autoIndent,t,n,{unshiftIndent:t=>mVe.unshiftIndent(e,t),shiftIndent:t=>mVe.shiftIndent(e,t),normalizeIndentation:t=>e.normalizeIndentation(t)},e.languageConfigurationService);if(o){let s=e.visibleColumnFromColumn(t,n.getEndPosition());const r=n.endColumn,a=ESe(t.getLineContent(n.endLineNumber));if(n=a>=0?n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,a+1)):n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new JWe(n,"\n"+e.normalizeIndentation(o.afterEnter),!0);{let t=0;return r<=a+1&&(e.insertSpaces||(s=Math.ceil(s/e.indentSize)),t=Math.min(s+1-e.normalizeIndentation(o.afterEnter).length-1,0)),new eVe(n,"\n"+e.normalizeIndentation(o.afterEnter),0,t,!0)}}}return mVe._typeCommand(n,"\n"+e.normalizeIndentation(s),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let e=0,n=i.length;e<n;e++)if(!t.tokenization.isCheapToTokenize(i[e].getEndPosition().lineNumber))return!1;return!0}static _runAutoIndentType(e,t,i,n){const o=gDe(t,i.startLineNumber,i.startColumn),s=function(e,t,i,n,o,s){if(e<4)return null;const r=pDe(t,i.startLineNumber,i.startColumn);if(r.firstCharOffset)return null;const a=s.getLanguageConfiguration(r.languageId).indentRulesSupport;if(!a)return null;const l=r.getLineContent(),d=l.substr(0,i.startColumn-1-r.firstCharOffset);let h;if(h=i.isEmpty()?l.substr(i.startColumn-1-r.firstCharOffset):pDe(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-r.firstCharOffset),!a.shouldDecrease(d+h)&&a.shouldDecrease(d+n+h)){const n=pVe(e,t,i.startLineNumber,!1,s);if(!n)return null;let r=n.indentation;return n.action!==Oke.Indent&&(r=o.unshiftIndent(r)),r}return null}(e.autoIndent,t,i,n,{shiftIndent:t=>mVe.shiftIndent(e,t),unshiftIndent:t=>mVe.unshiftIndent(e,t)},e.languageConfigurationService);if(null===s)return null;if(s!==e.normalizeIndentation(o)){const o=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return 0===o?mVe._typeCommand(new dye(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+n,!1):mVe._typeCommand(new dye(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+t.getLineContent(i.startLineNumber).substring(o-1,i.startColumn-1)+n,!1)}return null}static _isAutoClosingOvertype(e,t,i,n,o){if("never"===e.autoClosingOvertype)return!1;if(!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let s=0,r=i.length;s<r;s++){const r=i[s];if(!r.isEmpty())return!1;const a=r.getPosition(),l=t.getLineContent(a.lineNumber);if(l.charAt(a.column-1)!==o)return!1;const d=YWe(o);if(92===(a.column>2?l.charCodeAt(a.column-2):0)&&d)return!1;if("auto"===e.autoClosingOvertype){let e=!1;for(let t=0,i=n.length;t<i;t++){const i=n[t];if(a.lineNumber===i.startLineNumber&&a.column===i.startColumn){e=!0;break}}if(!e)return!1}}return!0}static _runAutoClosingOvertype(e,t,i,n,o){const s=[];for(let e=0,t=n.length;e<t;e++){const t=n[e].getPosition(),i=new dye(t.lineNumber,t.column,t.lineNumber,t.column+1);s[e]=new XWe(i,o)}return new ZWe(4,s,{shouldPushStackElementBefore:bVe(e,4),shouldPushStackElementAfter:!1})}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),n=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],o=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],s=n.some((e=>t.startsWith(e.open))),r=o.some((e=>t.startsWith(e.close)));return!s&&r}static _findAutoClosingPairOpen(e,t,i,n){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!o)return null;let s=null;for(const e of o)if(null===s||e.open.length>s.open.length){let o=!0;for(const s of i)if(t.getValueInRange(new dye(s.lineNumber,s.column-e.open.length+1,s.lineNumber,s.column))+n!==e.open){o=!1;break}o&&(s=e)}return s}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),n=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const e of n)e.open!==t.open&&t.open.includes(e.open)&&t.close.endsWith(e.close)&&(!o||e.open.length>o.open.length)&&(o=e);return o}static _getAutoClosingPairClose(e,t,i,n,o){const s=YWe(n),r=s?e.autoClosingQuotes:e.autoClosingBrackets,a=s?e.shouldAutoCloseBefore.quote:e.shouldAutoCloseBefore.bracket;if("never"===r)return null;for(const e of i)if(!e.isEmpty())return null;const l=i.map((e=>{const t=e.getPosition();return o?{lineNumber:t.lineNumber,beforeColumn:t.column-n.length,afterColumn:t.column}:{lineNumber:t.lineNumber,beforeColumn:t.column,afterColumn:t.column}})),d=this._findAutoClosingPairOpen(e,t,l.map((e=>new lye(e.lineNumber,e.beforeColumn))),n);if(!d)return null;const h=this._findContainedAutoClosingPair(e,d),c=h?h.close:"";let u=!0;for(const i of l){const{lineNumber:o,beforeColumn:s,afterColumn:l}=i,h=t.getLineContent(o),g=h.substring(0,s-1),p=h.substring(l-1);if(p.startsWith(c)||(u=!1),p.length>0){const t=p.charAt(0);if(!mVe._isBeforeClosingBrace(e,p)&&!a(t))return null}if(1===d.open.length&&("'"===n||'"'===n)&&"always"!==r){const t=MEe(e.wordSeparators);if(g.length>0){const e=g.charCodeAt(g.length-1);if(0===t.get(e))return null}}if(!t.tokenization.isCheapToTokenize(o))return null;t.tokenization.forceTokenization(o);const m=jke(t.tokenization.getLineTokens(o),s-1);if(!d.shouldAutoClose(m,s-m.firstCharOffset))return null;const f=d.findNeutralCharacter();if(f){const e=t.tokenization.getTokenTypeIfInsertingCharacter(o,s,f);if(!d.isOK(e))return null}}return u?d.close.substring(0,d.close.length-c.length):d.close}static _runAutoClosingOpenCharType(e,t,i,n,o,s,r){const a=[];for(let e=0,t=n.length;e<t;e++){const t=n[e];a[e]=new fVe(t,o,!s,r)}return new ZWe(4,a,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static _shouldSurroundChar(e,t){return YWe(t)?"quotes"===e.autoSurround||"languageDefined"===e.autoSurround:"brackets"===e.autoSurround||"languageDefined"===e.autoSurround}static _isSurroundSelectionType(e,t,i,n){if(!mVe._shouldSurroundChar(e,n)||!e.surroundingPairs.hasOwnProperty(n))return!1;const o=YWe(n);for(const e of i){if(e.isEmpty())return!1;let i=!0;for(let n=e.startLineNumber;n<=e.endLineNumber;n++){const o=t.getLineContent(n),s=n===e.startLineNumber?e.startColumn-1:0,r=n===e.endLineNumber?e.endColumn-1:o.length,a=o.substring(s,r);if(/[^ \t]/.test(a)){i=!1;break}}if(i)return!1;if(o&&e.startLineNumber===e.endLineNumber&&e.startColumn+1===e.endColumn&&YWe(t.getValueInRange(e)))return!1}return!0}static _runSurroundSelectionType(e,t,i,n,o){const s=[];for(let e=0,i=n.length;e<i;e++){const i=n[e],r=t.surroundingPairs[o];s[e]=new uVe(i,o,r)}return new ZWe(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _isTypeInterceptorElectricChar(e,t,i){return!(1!==i.length||!t.tokenization.isCheapToTokenize(i[0].getEndPosition().lineNumber))}static _typeInterceptorElectricChar(e,t,i,n,o){if(!t.electricChars.hasOwnProperty(o)||!n.isEmpty())return null;const s=n.getPosition();i.tokenization.forceTokenization(s.lineNumber);const r=i.tokenization.getLineTokens(s.lineNumber);let a;try{a=t.onElectricCharacter(o,r,s.column)}catch(e){return wwe(e),null}if(!a)return null;if(a.matchOpenBracket){const n=(r.getLineContent()+o).lastIndexOf(a.matchOpenBracket)+1,l=i.bracketPairs.findMatchingBracketUp(a.matchOpenBracket,{lineNumber:s.lineNumber,column:n},500);if(l){if(l.startLineNumber===s.lineNumber)return null;const n=NSe(i.getLineContent(l.startLineNumber)),r=t.normalizeIndentation(n),a=i.getLineContent(s.lineNumber),d=i.getLineFirstNonWhitespaceColumn(s.lineNumber)||s.column,h=r+a.substring(d-1,s.column-1)+o,c=new dye(s.lineNumber,1,s.lineNumber,s.column),u=new XWe(c,h);return new ZWe(vVe(h,e),[u],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!0})}}return null}static compositionEndWithInterceptors(e,t,i,n,o,s){if(!n)return null;let r=null;for(const e of n)if(null===r)r=e.insertedText;else if(r!==e.insertedText)return null;if(!r||1!==r.length)return null;const a=r;let l=!1;for(const e of n)if(0!==e.deletedText.length){l=!0;break}if(l){if(!mVe._shouldSurroundChar(t,a)||!t.surroundingPairs.hasOwnProperty(a))return null;const e=YWe(a);for(const t of n){if(0!==t.deletedSelectionStart||t.deletedSelectionEnd!==t.deletedText.length)return null;if(/^[ \t]+$/.test(t.deletedText))return null;if(e&&YWe(t.deletedText))return null}const i=[];for(const e of o){if(!e.isEmpty())return null;i.push(e.getPosition())}if(i.length!==n.length)return null;const s=[];for(let e=0,o=i.length;e<o;e++)s.push(new gVe(i[e],n[e].deletedText,t.surroundingPairs[a]));return new ZWe(4,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(t,i,o,s,a)){const e=o.map((e=>new XWe(new dye(e.positionLineNumber,e.positionColumn,e.positionLineNumber,e.positionColumn+1),"",!1)));return new ZWe(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const d=this._getAutoClosingPairClose(t,i,o,a,!0);return null!==d?this._runAutoClosingOpenCharType(e,t,i,o,a,!0,d):null}static typeWithInterceptors(e,t,i,n,o,s,r){if(!e&&"\n"===r){const e=[];for(let t=0,s=o.length;t<s;t++)e[t]=mVe._enter(i,n,!1,o[t]);return new ZWe(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoIndentType(i,n,o)){const e=[];let t=!1;for(let s=0,a=o.length;s<a;s++)if(e[s]=this._runAutoIndentType(i,n,o[s],r),!e[s]){t=!0;break}if(!t)return new ZWe(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(i,n,o,s,r))return this._runAutoClosingOvertype(t,i,n,o,r);if(!e){const e=this._getAutoClosingPairClose(i,n,o,r,!1);if(e)return this._runAutoClosingOpenCharType(t,i,n,o,r,!1,e)}if(!e&&this._isSurroundSelectionType(i,n,o,r))return this._runSurroundSelectionType(t,i,n,o,r);if(!e&&this._isTypeInterceptorElectricChar(i,n,o)){const e=this._typeInterceptorElectricChar(t,i,n,o[0],r);if(e)return e}const a=[];for(let e=0,t=o.length;e<t;e++)a[e]=new XWe(o[e],r);const l=vVe(r,t);return new ZWe(l,a,{shouldPushStackElementBefore:bVe(t,l),shouldPushStackElementAfter:!1})}static typeWithoutInterceptors(e,t,i,n,o){const s=[];for(let e=0,t=n.length;e<t;e++)s[e]=new XWe(n[e],o);const r=vVe(o,e);return new ZWe(r,s,{shouldPushStackElementBefore:bVe(e,r),shouldPushStackElementAfter:!1})}static lineInsertBefore(e,t,i){if(null===t||null===i)return[];const n=[];for(let o=0,s=i.length;o<s;o++){let s=i[o].positionLineNumber;if(1===s)n[o]=new JWe(new dye(1,1,1,1),"\n");else{s--;const i=t.getLineMaxColumn(s);n[o]=this._enter(e,t,!1,new dye(s,i,s,i))}}return n}static lineInsertAfter(e,t,i){if(null===t||null===i)return[];const n=[];for(let o=0,s=i.length;o<s;o++){const s=i[o].positionLineNumber,r=t.getLineMaxColumn(s);n[o]=this._enter(e,t,!1,new dye(s,r,s,r))}return n}static lineBreakInsert(e,t,i){const n=[];for(let o=0,s=i.length;o<s;o++)n[o]=this._enter(e,t,!0,i[o]);return n}}class fVe extends eVe{constructor(e,t,i,n){super(e,(i?t:"")+n,0,-n.length),this._openCharacter=t,this._closeCharacter=n,this.closeCharacterRange=null,this.enclosingRange=null}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return this.closeCharacterRange=new dye(i.startLineNumber,i.endColumn-this._closeCharacter.length,i.endLineNumber,i.endColumn),this.enclosingRange=new dye(i.startLineNumber,i.endColumn-this._openCharacter.length-this._closeCharacter.length,i.endLineNumber,i.endColumn),super.computeCursorState(e,t)}}class _Ve{constructor(e,t,i,n,o,s){this.deletedText=e,this.deletedSelectionStart=t,this.deletedSelectionEnd=i,this.insertedText=n,this.insertedSelectionStart=o,this.insertedSelectionEnd=s}}function vVe(e,t){return" "===e?5===t||6===t?6:5:4}function bVe(e,t){return!(!CVe(e)||CVe(t))||5!==e&&wVe(e)!==wVe(t)}function wVe(e){return 6===e||5===e?"space":e}function CVe(e){return 4===e||5===e||6===e}var yVe,SVe,xVe,kVe;!function(e){e.editorSimpleInput=new bke("editorSimpleInput",!1,!0),e.editorTextFocus=new bke("editorTextFocus",!1,ove(0,"Whether the editor text has focus (cursor is blinking)")),e.focus=new bke("editorFocus",!1,ove(0,"Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),e.textInputFocus=new bke("textInputFocus",!1,ove(0,"Whether an editor or a rich text input has focus (cursor is blinking)")),e.readOnly=new bke("editorReadonly",!1,ove(0,"Whether the editor is read only")),e.inDiffEditor=new bke("inDiffEditor",!1,ove(0,"Whether the context is a diff editor")),e.columnSelection=new bke("editorColumnSelection",!1,ove(0,"Whether `editor.columnSelection` is enabled")),e.writable=e.readOnly.toNegated(),e.hasNonEmptySelection=new bke("editorHasSelection",!1,ove(0,"Whether the editor has text selected")),e.hasOnlyEmptySelection=e.hasNonEmptySelection.toNegated(),e.hasMultipleSelections=new bke("editorHasMultipleSelections",!1,ove(0,"Whether the editor has multiple selections")),e.hasSingleSelection=e.hasMultipleSelections.toNegated(),e.tabMovesFocus=new bke("editorTabMovesFocus",!1,ove(0,"Whether `Tab` will move focus out of the editor")),e.tabDoesNotMoveFocus=e.tabMovesFocus.toNegated(),e.isInWalkThroughSnippet=new bke("isInEmbeddedEditor",!1,!0),e.canUndo=new bke("canUndo",!1,!0),e.canRedo=new bke("canRedo",!1,!0),e.hoverVisible=new bke("editorHoverVisible",!1,ove(0,"Whether the editor hover is visible")),e.inCompositeEditor=new bke("inCompositeEditor",void 0,ove(0,"Whether the editor is part of a larger editor (e.g. notebooks)")),e.notInCompositeEditor=e.inCompositeEditor.toNegated(),e.languageId=new bke("editorLangId","",ove(0,"The language identifier of the editor")),e.hasCompletionItemProvider=new bke("editorHasCompletionItemProvider",!1,ove(0,"Whether the editor has a completion item provider")),e.hasCodeActionsProvider=new bke("editorHasCodeActionsProvider",!1,ove(0,"Whether the editor has a code actions provider")),e.hasCodeLensProvider=new bke("editorHasCodeLensProvider",!1,ove(0,"Whether the editor has a code lens provider")),e.hasDefinitionProvider=new bke("editorHasDefinitionProvider",!1,ove(0,"Whether the editor has a definition provider")),e.hasDeclarationProvider=new bke("editorHasDeclarationProvider",!1,ove(0,"Whether the editor has a declaration provider")),e.hasImplementationProvider=new bke("editorHasImplementationProvider",!1,ove(0,"Whether the editor has an implementation provider")),e.hasTypeDefinitionProvider=new bke("editorHasTypeDefinitionProvider",!1,ove(0,"Whether the editor has a type definition provider")),e.hasHoverProvider=new bke("editorHasHoverProvider",!1,ove(0,"Whether the editor has a hover provider")),e.hasDocumentHighlightProvider=new bke("editorHasDocumentHighlightProvider",!1,ove(0,"Whether the editor has a document highlight provider")),e.hasDocumentSymbolProvider=new bke("editorHasDocumentSymbolProvider",!1,ove(0,"Whether the editor has a document symbol provider")),e.hasReferenceProvider=new bke("editorHasReferenceProvider",!1,ove(0,"Whether the editor has a reference provider")),e.hasRenameProvider=new bke("editorHasRenameProvider",!1,ove(0,"Whether the editor has a rename provider")),e.hasSignatureHelpProvider=new bke("editorHasSignatureHelpProvider",!1,ove(0,"Whether the editor has a signature help provider")),e.hasInlayHintsProvider=new bke("editorHasInlayHintsProvider",!1,ove(0,"Whether the editor has an inline hints provider")),e.hasDocumentFormattingProvider=new bke("editorHasDocumentFormattingProvider",!1,ove(0,"Whether the editor has a document formatting provider")),e.hasDocumentSelectionFormattingProvider=new bke("editorHasDocumentSelectionFormattingProvider",!1,ove(0,"Whether the editor has a document selection formatting provider")),e.hasMultipleDocumentFormattingProvider=new bke("editorHasMultipleDocumentFormattingProvider",!1,ove(0,"Whether the editor has multiple document formatting providers")),e.hasMultipleDocumentSelectionFormattingProvider=new bke("editorHasMultipleDocumentSelectionFormattingProvider",!1,ove(0,"Whether the editor has multiple document selection formatting providers"))}(yVe||(yVe={}));class LVe extends IAe{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditorCommand(n,i||{})}}!function(e){e.description={description:"Scroll editor in the given direction",args:[{name:"Editor scroll argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'to': A mandatory direction value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'up', 'down'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'by': Unit to move. Default is computed based on 'to' value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'line', 'wrappedLine', 'page', 'halfPage', 'editor'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'value': Number of units to move. Default is '1'.\n\t\t\t\t\t* 'revealCursor': If 'true' reveals the cursor if it is outside view port.\n\t\t\t\t",constraint:function(e){if(!_be(e))return!1;const t=e;return!(!fbe(t.to)||!ybe(t.by)&&!fbe(t.by)||!ybe(t.value)&&!bbe(t.value)||!ybe(t.revealCursor)&&!Cbe(t.revealCursor))},schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["up","down"]},by:{type:"string",enum:["line","wrappedLine","page","halfPage","editor"]},value:{type:"number",default:1},revealCursor:{type:"boolean"}}}}]},e.RawDirection={Up:"up",Right:"right",Down:"down",Left:"left"},e.RawUnit={Line:"line",WrappedLine:"wrappedLine",Page:"page",HalfPage:"halfPage",Editor:"editor",Column:"column"},e.parse=function(t){let i,n;switch(t.to){case e.RawDirection.Up:i=1;break;case e.RawDirection.Right:i=2;break;case e.RawDirection.Down:i=3;break;case e.RawDirection.Left:i=4;break;default:return null}switch(t.by){case e.RawUnit.Line:n=1;break;case e.RawUnit.WrappedLine:n=2;break;case e.RawUnit.Page:n=3;break;case e.RawUnit.HalfPage:n=4;break;case e.RawUnit.Editor:n=5;break;case e.RawUnit.Column:n=6;break;default:n=2}return{direction:i,unit:n,value:Math.floor(t.value||1),revealCursor:!!t.revealCursor,select:!!t.select}}}(SVe||(SVe={})),function(e){e.description={description:"Reveal the given line at the given logical position",args:[{name:"Reveal line argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'lineNumber': A mandatory line number value.\n\t\t\t\t\t* 'at': Logical position at which line has to be revealed.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'top', 'center', 'bottom'\n\t\t\t\t\t\t```\n\t\t\t\t",constraint:function(e){if(!_be(e))return!1;const t=e;return!(!bbe(t.lineNumber)&&!fbe(t.lineNumber)||!ybe(t.at)&&!fbe(t.at))},schema:{type:"object",required:["lineNumber"],properties:{lineNumber:{type:["number","string"]},at:{type:"string",enum:["top","center","bottom"]}}}}]},e.RawAtArgument={Top:"top",Center:"center",Bottom:"bottom"}}(xVe||(xVe={}));class DVe{constructor(e){e.addImplementation(1e4,"code-editor",((e,t)=>{const i=e.get(Uxe).getFocusedCodeEditor();return!(!i||!i.hasTextFocus())&&this._runEditorCommand(e,i,t)})),e.addImplementation(1e3,"generic-dom-input-textarea",((e,t)=>{const i=document.activeElement;return!!(i&&["input","textarea"].indexOf(i.tagName.toLowerCase())>=0)&&(this.runDOMCommand(),!0)})),e.addImplementation(0,"generic-dom",((e,t)=>{const i=e.get(Uxe).getActiveCodeEditor();return!!i&&(i.focus(),this._runEditorCommand(e,i,t))}))}_runEditorCommand(e,t,i){return this.runEditorCommand(e,t,i)||!0}}!function(e){class t extends LVe{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[rVe.moveTo(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)])&&2!==t.revealType&&e.revealPrimaryCursor(t.source,!0,!0))}}e.MoveTo=MAe(new t({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),e.MoveToSelect=MAe(new t({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class i extends LVe{runCoreEditorCommand(e,t){e.model.pushStackElement();const i=this._getColumnSelectResult(e,e.getPrimaryCursorState(),e.getCursorColumnSelectData(),t);null!==i&&(e.setCursorStates(t.source,3,i.viewStates.map((e=>jWe.fromViewState(e)))),e.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:i.fromLineNumber,fromViewVisualColumn:i.fromVisualColumn,toViewLineNumber:i.toLineNumber,toViewVisualColumn:i.toVisualColumn}),i.reversed?e.revealTopMostCursor(t.source):e.revealBottomMostCursor(t.source))}}e.ColumnSelect=MAe(new class extends i{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(e,t,i,n){if(void 0===n.position||void 0===n.viewPosition||void 0===n.mouseColumn)return null;const o=e.model.validatePosition(n.position),s=e.coordinatesConverter.validateViewPosition(new lye(n.viewPosition.lineNumber,n.viewPosition.column),o),r=n.doColumnSelect?i.fromViewLineNumber:s.lineNumber,a=n.doColumnSelect?i.fromViewVisualColumn:n.mouseColumn-1;return QWe.columnSelect(e.cursorConfig,e,r,a,s.lineNumber,n.mouseColumn-1)}}),e.CursorColumnSelectLeft=MAe(new class extends i{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return QWe.columnSelectLeft(e.cursorConfig,e,i)}}),e.CursorColumnSelectRight=MAe(new class extends i{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return QWe.columnSelectRight(e.cursorConfig,e,i)}});class n extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return QWe.columnSelectUp(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectUp=MAe(new n({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:3600,linux:{primary:0}}})),e.CursorColumnSelectPageUp=MAe(new n({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:3595,linux:{primary:0}}}));class o extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return QWe.columnSelectDown(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectDown=MAe(new o({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:3602,linux:{primary:0}}})),e.CursorColumnSelectPageDown=MAe(new o({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:3596,linux:{primary:0}}}));class s extends LVe{constructor(){super({id:"cursorMove",precondition:void 0,description:aVe.description})}runCoreEditorCommand(e,t){const i=aVe.parse(t);i&&this._runCursorMove(e,t.source,i)}_runCursorMove(e,t,i){e.model.pushStackElement(),e.setCursorStates(t,3,s._move(e,e.getCursorStates(),i)),e.revealPrimaryCursor(t,!0)}static _move(e,t,i){const n=i.select,o=i.value;switch(i.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return rVe.simpleMove(e,t,i.direction,n,o,i.unit);case 11:case 13:case 12:case 14:return rVe.viewportMove(e,t,i.direction,n,o);default:return null}}}e.CursorMoveImpl=s,e.CursorMove=MAe(new s);class r extends LVe{constructor(e){super(e),this._staticArgs=e.args}runCoreEditorCommand(e,t){let i=this._staticArgs;-1===this._staticArgs.value&&(i={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:t.pageSize||e.cursorConfig.pageSize}),e.model.pushStackElement(),e.setCursorStates(t.source,3,rVe.simpleMove(e,e.getCursorStates(),i.direction,i.select,i.value,i.unit)),e.revealPrimaryCursor(t.source,!0)}}e.CursorLeft=MAe(new r({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),e.CursorLeftSelect=MAe(new r({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:1039}})),e.CursorRight=MAe(new r({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),e.CursorRightSelect=MAe(new r({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:1041}})),e.CursorUp=MAe(new r({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),e.CursorUpSelect=MAe(new r({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),e.CursorPageUp=MAe(new r({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:11}})),e.CursorPageUpSelect=MAe(new r({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:1035}})),e.CursorDown=MAe(new r({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),e.CursorDownSelect=MAe(new r({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),e.CursorPageDown=MAe(new r({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:12}})),e.CursorPageDownSelect=MAe(new r({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:1036}})),e.CreateCursor=MAe(new class extends LVe{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;let i;i=t.wholeLine?rVe.line(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition):rVe.moveTo(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition);const n=e.getCursorStates();if(n.length>1){const o=i.modelState?i.modelState.position:null,s=i.viewState?i.viewState.position:null;for(let i=0,r=n.length;i<r;i++){const r=n[i];if((!o||r.modelState.selection.containsPosition(o))&&(!s||r.viewState.selection.containsPosition(s)))return n.splice(i,1),e.model.pushStackElement(),void e.setCursorStates(t.source,3,n)}}n.push(i),e.model.pushStackElement(),e.setCursorStates(t.source,3,n)}}),e.LastCursorMoveToSelect=MAe(new class extends LVe{constructor(){super({id:"_lastCursorMoveToSelect",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0);o[i]=rVe.moveTo(e,n[i],!0,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}});class a extends LVe{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,rVe.moveToBeginningOfLine(e,e.getCursorStates(),this._inSelectionMode)),e.revealPrimaryCursor(t.source,!0)}}e.CursorHome=MAe(new a({inSelectionMode:!1,id:"cursorHome",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:14,mac:{primary:14,secondary:[2063]}}})),e.CursorHomeSelect=MAe(new a({inSelectionMode:!0,id:"cursorHomeSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:1038,mac:{primary:1038,secondary:[3087]}}}));class l extends LVe{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,this._exec(e.getCursorStates())),e.revealPrimaryCursor(t.source,!0)}_exec(e){const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i],o=n.modelState.position.lineNumber;t[i]=jWe.fromModelState(n.modelState.move(this._inSelectionMode,o,1,0))}return t}}e.CursorLineStart=MAe(new l({inSelectionMode:!1,id:"cursorLineStart",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:0,mac:{primary:287}}})),e.CursorLineStartSelect=MAe(new l({inSelectionMode:!0,id:"cursorLineStartSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:0,mac:{primary:1311}}}));class d extends LVe{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,rVe.moveToEndOfLine(e,e.getCursorStates(),this._inSelectionMode,t.sticky||!1)),e.revealPrimaryCursor(t.source,!0)}}e.CursorEnd=MAe(new d({inSelectionMode:!1,id:"cursorEnd",precondition:void 0,kbOpts:{args:{sticky:!1},weight:0,kbExpr:yVe.textInputFocus,primary:13,mac:{primary:13,secondary:[2065]}},description:{description:"Go to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:ove(0,"Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}})),e.CursorEndSelect=MAe(new d({inSelectionMode:!0,id:"cursorEndSelect",precondition:void 0,kbOpts:{args:{sticky:!1},weight:0,kbExpr:yVe.textInputFocus,primary:1037,mac:{primary:1037,secondary:[3089]}},description:{description:"Select to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:ove(0,"Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}}));class h extends LVe{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,this._exec(e,e.getCursorStates())),e.revealPrimaryCursor(t.source,!0)}_exec(e,t){const i=[];for(let n=0,o=t.length;n<o;n++){const o=t[n],s=o.modelState.position.lineNumber,r=e.model.getLineMaxColumn(s);i[n]=jWe.fromModelState(o.modelState.move(this._inSelectionMode,s,r,0))}return i}}e.CursorLineEnd=MAe(new h({inSelectionMode:!1,id:"cursorLineEnd",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:0,mac:{primary:291}}})),e.CursorLineEndSelect=MAe(new h({inSelectionMode:!0,id:"cursorLineEndSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:0,mac:{primary:1315}}}));class c extends LVe{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,rVe.moveToBeginningOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealPrimaryCursor(t.source,!0)}}e.CursorTop=MAe(new c({inSelectionMode:!1,id:"cursorTop",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:2062,mac:{primary:2064}}})),e.CursorTopSelect=MAe(new c({inSelectionMode:!0,id:"cursorTopSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:3086,mac:{primary:3088}}}));class u extends LVe{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,rVe.moveToEndOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealPrimaryCursor(t.source,!0)}}e.CursorBottom=MAe(new u({inSelectionMode:!1,id:"cursorBottom",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:2061,mac:{primary:2066}}})),e.CursorBottomSelect=MAe(new u({inSelectionMode:!0,id:"cursorBottomSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:3085,mac:{primary:3090}}}));class g extends LVe{constructor(){super({id:"editorScroll",precondition:void 0,description:SVe.description})}determineScrollMethod(e){return[6].includes(e.unit)&&[4,2].includes(e.direction)?this._runHorizontalEditorScroll.bind(this):[1,2,3,4,5,6].includes(e.unit)&&[1,3].includes(e.direction)?this._runVerticalEditorScroll.bind(this):null}runCoreEditorCommand(e,t){const i=SVe.parse(t);if(!i)return;const n=this.determineScrollMethod(i);n&&n(e,t.source,i)}_runVerticalEditorScroll(e,t,i){const n=this._computeDesiredScrollTop(e,i);if(i.revealCursor){const o=e.getCompletelyVisibleViewRangeAtScrollTop(n);e.setCursorStates(t,3,[rVe.findPositionInViewportIfOutside(e,e.getPrimaryCursorState(),o,i.select)])}e.viewLayout.setScrollPosition({scrollTop:n},0)}_computeDesiredScrollTop(e,t){if(1===t.unit){const i=e.viewLayout.getFutureViewport(),n=e.getCompletelyVisibleViewRangeAtScrollTop(i.top),o=e.coordinatesConverter.convertViewRangeToModelRange(n);let s;s=1===t.direction?Math.max(1,o.startLineNumber-t.value):Math.min(e.model.getLineCount(),o.startLineNumber+t.value);const r=e.coordinatesConverter.convertModelPositionToViewPosition(new lye(s,1));return e.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber)}if(5===t.unit){let i=0;return 3===t.direction&&(i=e.model.getLineCount()-e.cursorConfig.pageSize),e.viewLayout.getVerticalOffsetForLineNumber(i)}let i;i=3===t.unit?e.cursorConfig.pageSize*t.value:4===t.unit?Math.round(e.cursorConfig.pageSize/2)*t.value:t.value;const n=(1===t.direction?-1:1)*i;return e.viewLayout.getCurrentScrollTop()+n*e.cursorConfig.lineHeight}_runHorizontalEditorScroll(e,t,i){const n=this._computeDesiredScrollLeft(e,i);e.viewLayout.setScrollPosition({scrollLeft:n},0)}_computeDesiredScrollLeft(e,t){const i=(4===t.direction?-1:1)*t.value;return e.viewLayout.getCurrentScrollLeft()+i*e.cursorConfig.typicalHalfwidthCharacterWidth}}e.EditorScrollImpl=g,e.EditorScroll=MAe(new g),e.ScrollLineUp=MAe(new class extends LVe{constructor(){super({id:"scrollLineUp",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:2064,mac:{primary:267}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:SVe.RawDirection.Up,by:SVe.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollPageUp=MAe(new class extends LVe{constructor(){super({id:"scrollPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:2059,win:{primary:523},linux:{primary:523}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:SVe.RawDirection.Up,by:SVe.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollEditorTop=MAe(new class extends LVe{constructor(){super({id:"scrollEditorTop",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:SVe.RawDirection.Up,by:SVe.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollLineDown=MAe(new class extends LVe{constructor(){super({id:"scrollLineDown",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:2066,mac:{primary:268}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:SVe.RawDirection.Down,by:SVe.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollPageDown=MAe(new class extends LVe{constructor(){super({id:"scrollPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:2060,win:{primary:524},linux:{primary:524}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:SVe.RawDirection.Down,by:SVe.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollEditorBottom=MAe(new class extends LVe{constructor(){super({id:"scrollEditorBottom",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:SVe.RawDirection.Down,by:SVe.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollLeft=MAe(new class extends LVe{constructor(){super({id:"scrollLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:SVe.RawDirection.Left,by:SVe.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollRight=MAe(new class extends LVe{constructor(){super({id:"scrollRight",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:SVe.RawDirection.Right,by:SVe.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:i.source})}});class p extends LVe{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[rVe.word(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position)]),2!==t.revealType&&e.revealPrimaryCursor(t.source,!0,!0))}}e.WordSelect=MAe(new p({inSelectionMode:!1,id:"_wordSelect",precondition:void 0})),e.WordSelectDrag=MAe(new p({inSelectionMode:!0,id:"_wordSelectDrag",precondition:void 0})),e.LastCursorWordSelect=MAe(new class extends LVe{constructor(){super({id:"lastCursorWordSelect",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0),s=n[i];o[i]=rVe.word(e,s,s.modelState.hasSelection(),t.position),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}});class m extends LVe{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[rVe.line(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)]),2!==t.revealType&&e.revealPrimaryCursor(t.source,!1,!0))}}e.LineSelect=MAe(new m({inSelectionMode:!1,id:"_lineSelect",precondition:void 0})),e.LineSelectDrag=MAe(new m({inSelectionMode:!0,id:"_lineSelectDrag",precondition:void 0}));class f extends LVe{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){if(!t.position)return;const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0);o[i]=rVe.line(e,n[i],this._inSelectionMode,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}}e.LastCursorLineSelect=MAe(new f({inSelectionMode:!1,id:"lastCursorLineSelect",precondition:void 0})),e.LastCursorLineSelectDrag=MAe(new f({inSelectionMode:!0,id:"lastCursorLineSelectDrag",precondition:void 0})),e.CancelSelection=MAe(new class extends LVe{constructor(){super({id:"cancelSelection",precondition:yVe.hasNonEmptySelection,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[rVe.cancelSelection(e,e.getPrimaryCursorState())]),e.revealPrimaryCursor(t.source,!0)}}),e.RemoveSecondaryCursors=MAe(new class extends LVe{constructor(){super({id:"removeSecondaryCursors",precondition:yVe.hasMultipleSelections,kbOpts:{weight:1,kbExpr:yVe.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[e.getPrimaryCursorState()]),e.revealPrimaryCursor(t.source,!0),eAe(ove(0,"Removed secondary cursors"))}}),e.RevealLine=MAe(new class extends LVe{constructor(){super({id:"revealLine",precondition:void 0,description:xVe.description})}runCoreEditorCommand(e,t){const i=t,n=i.lineNumber||0;let o="number"==typeof n?n+1:parseInt(n)+1;o<1&&(o=1);const s=e.model.getLineCount();o>s&&(o=s);const r=new dye(o,1,o,e.model.getLineMaxColumn(o));let a=0;if(i.at)switch(i.at){case xVe.RawAtArgument.Top:a=3;break;case xVe.RawAtArgument.Center:a=1;break;case xVe.RawAtArgument.Bottom:a=4}const l=e.coordinatesConverter.convertModelRangeToViewRange(r);e.revealRange(t.source,!1,l,a,0)}}),e.SelectAll=new class extends DVe{constructor(){super(VAe)}runDOMCommand(){bxe&&(document.activeElement.focus(),document.activeElement.select()),document.execCommand("selectAll")}runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditorCommand(n,i)}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates("keyboard",3,[rVe.selectAll(e,e.getPrimaryCursorState())])}},e.SetSelection=MAe(new class extends LVe{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(e,t){t.selection&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[jWe.fromModelSelection(t.selection)]))}})}(kVe||(kVe={}));const EVe=Jxe.and(yVe.textInputFocus,yVe.columnSelection);function NVe(e,t){fAe.registerKeybindingRule({id:e,primary:t,when:EVe,weight:1})}function IVe(e){return e.register(),e}var TVe,MVe;NVe(kVe.CursorColumnSelectLeft.id,1039),NVe(kVe.CursorColumnSelectRight.id,1041),NVe(kVe.CursorColumnSelectUp.id,1040),NVe(kVe.CursorColumnSelectPageUp.id,1035),NVe(kVe.CursorColumnSelectDown.id,1042),NVe(kVe.CursorColumnSelectPageDown.id,1036),function(e){class t extends IAe{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditingCommand(t,n,i||{})}}e.CoreEditingCommand=t,e.LineBreakInsert=MAe(new class extends t{constructor(){super({id:"lineBreakInsert",precondition:yVe.writable,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,mVe.lineBreakInsert(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection))))}}),e.Outdent=MAe(new class extends t{constructor(){super({id:"outdent",precondition:yVe.writable,kbOpts:{weight:0,kbExpr:Jxe.and(yVe.editorTextFocus,yVe.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,mVe.outdent(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)))),e.pushUndoStop()}}),e.Tab=MAe(new class extends t{constructor(){super({id:"tab",precondition:yVe.writable,kbOpts:{weight:0,kbExpr:Jxe.and(yVe.editorTextFocus,yVe.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,mVe.tab(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)))),e.pushUndoStop()}}),e.DeleteLeft=MAe(new class extends t{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(e,t,i){const[n,o]=oVe.deleteLeft(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)),t.getCursorAutoClosedCharacters());n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(2)}}),e.DeleteRight=MAe(new class extends t{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:0,kbExpr:yVe.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(e,t,i){const[n,o]=oVe.deleteRight(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)));n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(3)}}),e.Undo=new class extends DVe{constructor(){super(BAe)}runDOMCommand(){document.execCommand("undo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(86))return t.getModel().undo()}},e.Redo=new class extends DVe{constructor(){super(WAe)}runDOMCommand(){document.execCommand("redo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(86))return t.getModel().redo()}}}(TVe||(TVe={}));class AVe extends DAe{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get(Uxe).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function RVe(e,t){IVe(new AVe("default:"+e,e)),IVe(new AVe(e,e,t))}RVe("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]}),RVe("replacePreviousChar"),RVe("compositionType"),RVe("compositionStart"),RVe("compositionEnd"),RVe("paste"),RVe("cut");class OVe{constructor(e,t,i,n){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=n}paste(e,t,i,n){this.commandDelegate.paste(e,t,i,n)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,n){this.commandDelegate.compositionType(e,t,i,n)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){kVe.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<t?new lye(e.lineNumber,t):e}_hasMulticursorModifier(e){switch(this.configuration.options.get(74)){case"altKey":return e.altKey;case"ctrlKey":return e.ctrlKey;case"metaKey":return e.metaKey;default:return!1}}_hasNonMulticursorModifier(e){switch(this.configuration.options.get(74)){case"altKey":return e.ctrlKey||e.metaKey;case"ctrlKey":return e.altKey||e.metaKey;case"metaKey":return e.ctrlKey||e.altKey;default:return!1}}dispatchMouse(e){const t=this.configuration.options,i=Eve&&t.get(101),n=t.get(19);e.middleButton&&!i?this._columnSelect(e.position,e.mouseColumn,e.inSelectionMode):e.startedOnLineNumbers?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelect(e.position,e.revealType):this._createCursor(e.position,!0):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount>=4?this._selectAll():3===e.mouseDownCount?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):2===e.mouseDownCount?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey||n?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){kVe.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){kVe.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),kVe.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),kVe.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){kVe.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){kVe.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){kVe.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){kVe.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){kVe.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){kVe.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){kVe.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){kVe.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){kVe.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}class PVe{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){var t;null===(t=this.onKeyDown)||void 0===t||t.call(this,e)}emitKeyUp(e){var t;null===(t=this.onKeyUp)||void 0===t||t.call(this,e)}emitContextMenu(e){var t;null===(t=this.onContextMenu)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;null===(t=this.onMouseMove)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;null===(t=this.onMouseLeave)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;null===(t=this.onMouseDown)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;null===(t=this.onMouseUp)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;null===(t=this.onMouseDrag)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;null===(t=this.onMouseDrop)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;null===(e=this.onMouseDropCanceled)||void 0===e||e.call(this)}emitMouseWheel(e){var t;null===(t=this.onMouseWheel)||void 0===t||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return PVe.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i=Object.assign({},e);return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),i}}class FVe{constructor(e){this._createLine=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new Error("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(0===this.getCount())return null;const i=this.getStartLineNumber(),n=this.getEndLineNumber();if(t<i){const i=t-e+1;return this._rendLineNumberStart-=i,null}if(e>n)return null;let o=0,s=0;for(let r=i;r<=n;r++){const i=r-this._rendLineNumberStart;e<=r&&r<=t&&(0===s?(o=i,s=1):s++)}if(e<i){let n=0;n=t<i?t-e+1:i-e,this._rendLineNumberStart-=n}return this._lines.splice(o,s)}onLinesChanged(e,t){const i=e+t-1;if(0===this.getCount())return!1;const n=this.getStartLineNumber(),o=this.getEndLineNumber();let s=!1;for(let t=e;t<=i;t++)t>=n&&t<=o&&(this._lines[t-this._rendLineNumberStart].onContentChanged(),s=!0);return s}onLinesInserted(e,t){if(0===this.getCount())return null;const i=t-e+1,n=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=n)return this._rendLineNumberStart+=i,null;if(e>o)return null;if(i+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const s=[];for(let e=0;e<i;e++)s[e]=this._createLine();const r=e-this._rendLineNumberStart,a=this._lines.slice(0,r),l=this._lines.slice(r,this._lines.length-i),d=this._lines.slice(this._lines.length-i,this._lines.length);return this._lines=a.concat(s).concat(l),d}onTokensChanged(e){if(0===this.getCount())return!1;const t=this.getStartLineNumber(),i=this.getEndLineNumber();let n=!1;for(let o=0,s=e.length;o<s;o++){const s=e[o];if(s.toLineNumber<t||s.fromLineNumber>i)continue;const r=Math.max(t,s.fromLineNumber),a=Math.min(i,s.toLineNumber);for(let e=r;e<=a;e++){const t=e-this._rendLineNumberStart;this._lines[t].onTokensChanged(),n=!0}}return n}}class BVe{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new FVe((()=>this._host.createVisibleLine()))}_createDomNode(){const e=Ixe(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(138)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let e=0,i=t.length;e<i;e++){const i=t[e].getDomNode();i&&this.domNode.domNode.removeChild(i)}return!0}onLinesInserted(e){const t=this._linesCollection.onLinesInserted(e.fromLineNumber,e.toLineNumber);if(t)for(let e=0,i=t.length;e<i;e++){const i=t[e].getDomNode();i&&this.domNode.domNode.removeChild(i)}return!0}onScrollChanged(e){return e.scrollTopChanged}onTokensChanged(e){return this._linesCollection.onTokensChanged(e.ranges)}onZonesChanged(e){return!0}getStartLineNumber(){return this._linesCollection.getStartLineNumber()}getEndLineNumber(){return this._linesCollection.getEndLineNumber()}getVisibleLine(e){return this._linesCollection.getLine(e)}renderLines(e){const t=this._linesCollection._get(),i=new WVe(this.domNode.domNode,this._host,e),n={rendLineNumberStart:t.rendLineNumberStart,lines:t.lines,linesLength:t.lines.length},o=i.render(n,e.startLineNumber,e.endLineNumber,e.relativeVerticalOffset);this._linesCollection._set(o.rendLineNumberStart,o.lines)}}class WVe{constructor(e,t,i){this.domNode=e,this.host=t,this.viewportData=i}render(e,t,i,n){const o={rendLineNumberStart:e.rendLineNumberStart,lines:e.lines.slice(0),linesLength:e.linesLength};if(o.rendLineNumberStart+o.linesLength-1<t||i<o.rendLineNumberStart){o.rendLineNumberStart=t,o.linesLength=i-t+1,o.lines=[];for(let e=t;e<=i;e++)o.lines[e-t]=this.host.createVisibleLine();return this._finishRendering(o,!0,n),o}if(this._renderUntouchedLines(o,Math.max(t-o.rendLineNumberStart,0),Math.min(i-o.rendLineNumberStart,o.linesLength-1),n,t),o.rendLineNumberStart>t){const e=t,s=Math.min(i,o.rendLineNumberStart-1);e<=s&&(this._insertLinesBefore(o,e,s,n,t),o.linesLength+=s-e+1)}else if(o.rendLineNumberStart<t){const e=Math.min(o.linesLength,t-o.rendLineNumberStart);e>0&&(this._removeLinesBefore(o,e),o.linesLength-=e)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1<i){const e=o.rendLineNumberStart+o.linesLength,s=i;e<=s&&(this._insertLinesAfter(o,e,s,n,t),o.linesLength+=s-e+1)}else if(o.rendLineNumberStart+o.linesLength-1>i){const e=Math.max(0,i-o.rendLineNumberStart+1),t=o.linesLength-1-e+1;t>0&&(this._removeLinesAfter(o,t),o.linesLength-=t)}return this._finishRendering(o,!1,n),o}_renderUntouchedLines(e,t,i,n,o){const s=e.rendLineNumberStart,r=e.lines;for(let e=t;e<=i;e++){const t=s+e;r[e].layoutLine(t,n[t-o])}}_insertLinesBefore(e,t,i,n,o){const s=[];let r=0;for(let e=t;e<=i;e++)s[r++]=this.host.createVisibleLine();e.lines=s.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i<t;i++){const t=e.lines[i].getDomNode();t&&this.domNode.removeChild(t)}e.lines.splice(0,t)}_insertLinesAfter(e,t,i,n,o){const s=[];let r=0;for(let e=t;e<=i;e++)s[r++]=this.host.createVisibleLine();e.lines=e.lines.concat(s)}_removeLinesAfter(e,t){const i=e.linesLength-t;for(let n=0;n<t;n++){const t=e.lines[i+n].getDomNode();t&&this.domNode.removeChild(t)}e.lines.splice(i,t)}_finishRenderingNewLines(e,t,i,n){WVe._ttPolicy&&(i=WVe._ttPolicy.createHTML(i));const o=this.domNode.lastChild;t||!o?this.domNode.innerHTML=i:o.insertAdjacentHTML("afterend",i);let s=this.domNode.lastChild;for(let t=e.linesLength-1;t>=0;t--){const i=e.lines[t];n[t]&&(i.setDomNode(s),s=s.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const n=document.createElement("div");WVe._ttPolicy&&(t=WVe._ttPolicy.createHTML(t)),n.innerHTML=t;for(let t=0;t<e.linesLength;t++){const o=e.lines[t];if(i[t]){const e=n.firstChild,t=o.getDomNode();t.parentNode.replaceChild(e,t),o.setDomNode(e)}}}_finishRendering(e,t,i){const n=WVe._sb,o=e.linesLength,s=e.lines,r=e.rendLineNumberStart,a=[];{n.reset();let l=!1;for(let e=0;e<o;e++){const t=s[e];a[e]=!1,t.getDomNode()||t.renderLine(e+r,i[e],this.viewportData,n)&&(a[e]=!0,l=!0)}l&&this._finishRenderingNewLines(e,t,n.build(),a)}{n.reset();let t=!1;const l=[];for(let e=0;e<o;e++){const o=s[e];(l[e]=!1,a[e])||o.renderLine(e+r,i[e],this.viewportData,n)&&(l[e]=!0,t=!0)}t&&this._finishRenderingInvalidLines(e,n.build(),l)}}}WVe._ttPolicy=null===(MVe=window.trustedTypes)||void 0===MVe?void 0:MVe.createPolicy("editorViewLayer",{createHTML:e=>e}),WVe._sb=new dLe(1e5);class VVe extends pFe{constructor(e){super(e),this._visibleLines=new BVe(this),this.domNode=this._visibleLines.domNode;const t=this._context.configuration.options.get(47);Txe(this.domNode,t),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;e<t;e++)if(this._dynamicOverlays[e].shouldRender())return!0;return!1}dispose(){super.dispose();for(let e=0,t=this._dynamicOverlays.length;e<t;e++)this._dynamicOverlays[e].dispose();this._dynamicOverlays=[]}getDomNode(){return this.domNode}createVisibleLine(){return new HVe(this._context.configuration,this._dynamicOverlays)}addDynamicOverlay(e){this._dynamicOverlays.push(e)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e);const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let n=t;n<=i;n++)this._visibleLines.getVisibleLine(n).onConfigurationChanged(e);const n=this._context.configuration.options.get(47);return Txe(this.domNode,n),!0}onFlushed(e){return this._visibleLines.onFlushed(e)}onFocusChanged(e){return this._isFocused=e.isFocused,!0}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onScrollChanged(e){return this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._visibleLines.onZonesChanged(e)}prepareRender(e){const t=this._dynamicOverlays.filter((e=>e.shouldRender()));for(let i=0,n=t.length;i<n;i++){const n=t[i];n.prepareRender(e),n.onDidRender()}}render(e){this._viewOverlaysRender(e),this.domNode.toggleClassName("focused",this._isFocused)}_viewOverlaysRender(e){this._visibleLines.renderLines(e.viewportData)}}class HVe{constructor(e,t){this._configuration=e,this._lineHeight=this._configuration.options.get(63),this._dynamicOverlays=t,this._domNode=null,this._renderedContent=null}getDomNode(){return this._domNode?this._domNode.domNode:null}setDomNode(e){this._domNode=Ixe(e)}onContentChanged(){}onTokensChanged(){}onConfigurationChanged(e){this._lineHeight=this._configuration.options.get(63)}renderLine(e,t,i,n){let o="";for(let t=0,n=this._dynamicOverlays.length;t<n;t++)o+=this._dynamicOverlays[t].render(i.startLineNumber,e);return this._renderedContent!==o&&(this._renderedContent=o,n.appendString('<div style="position:absolute;top:'),n.appendString(String(t)),n.appendString("px;width:100%;height:"),n.appendString(String(this._lineHeight)),n.appendString('px;">'),n.appendString(o),n.appendString("</div>"),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class zVe extends VVe{constructor(e){super(e);const t=this._context.configuration.options.get(138);this._contentWidth=t.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const t=this._context.configuration.options.get(138);return this._contentWidth=t.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class UVe extends VVe{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(138);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),Txe(this.domNode,t.get(47))}onConfigurationChanged(e){const t=this._context.configuration.options;Txe(this.domNode,t.get(47));const i=t.get(138);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class KVe extends pFe{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=Ixe(document.createElement("div")),mFe.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=Ixe(document.createElement("div")),mFe.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesDeleted(e){return this._updateAnchorsViewPositions(),!0}onLinesInserted(e){return this._updateAnchorsViewPositions(),!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}_updateAnchorsViewPositions(){const e=Object.keys(this._widgets);for(const t of e)this._widgets[t].updateAnchorViewPosition()}addWidget(e){const t=new jVe(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,i,n,o){this._widgets[e.getId()].setPosition(t,i,n,o),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t];delete this._widgets[t];const i=e.domNode.domNode;i.parentNode.removeChild(i),i.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return!!this._widgets.hasOwnProperty(e)&&this._widgets[e].suppressMouseDown}onBeforeRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].render(e)}}class jVe{constructor(e,t,i){this._primaryAnchor=new qVe(null,null),this._secondaryAnchor=new qVe(null,null),this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=Ixe(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const n=this._context.configuration.options,o=n.get(138);this._fixedOverflowWidgets=n.get(39),this._contentWidth=o.contentWidth,this._contentLeft=o.contentLeft,this._lineHeight=n.get(63),this._affinity=null,this._preference=[],this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setDisplay("none"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){const t=this._context.configuration.options;if(this._lineHeight=t.get(63),e.hasChanged(138)){const e=t.get(138);this._contentLeft=e.contentLeft,this._contentWidth=e.contentWidth,this._maxWidth=this._getMaxWidth()}}updateAnchorViewPosition(){this._setPosition(this._affinity,this._primaryAnchor.modelPosition,this._secondaryAnchor.modelPosition)}_setPosition(e,t,i){function n(e,t,i){if(!e)return new qVe(null,null);const n=t.model.validatePosition(e);if(t.coordinatesConverter.modelPositionIsVisible(n)){const o=t.coordinatesConverter.convertModelPositionToViewPosition(n,null!=i?i:void 0);return new qVe(e,o)}return new qVe(e,null)}this._affinity=e,this._primaryAnchor=n(t,this._context.viewModel,this._affinity),this._secondaryAnchor=n(i,this._context.viewModel,this._affinity)}_getMaxWidth(){return this.allowEditorOverflow?window.innerWidth||document.documentElement.offsetWidth||document.body.offsetWidth:this._contentWidth}setPosition(e,t,i,n){this._setPosition(n,e,t),this._preference=i,this._primaryAnchor.viewPosition&&this._preference&&this._preference.length>0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,n){const o=e.top,s=o,r=e.top+e.height,a=o-i,l=s>=i,d=r,h=n.viewportHeight-r>=i;let c=e.left;return c+t>n.scrollLeft+n.viewportWidth&&(c=n.scrollLeft+n.viewportWidth-t),c<n.scrollLeft&&(c=n.scrollLeft),{fitsAbove:l,aboveTop:a,fitsBelow:h,belowTop:d,left:c}}_layoutHorizontalSegmentInPage(e,t,i,n){const o=Math.max(15,t.left-n),s=Math.min(t.left+t.width+n,e.width-15);let r=t.left+i-window.scrollX;if(r+n>s){const e=r-(s-n);r-=e,i-=e}if(r<o){const e=r-o;r-=e,i-=e}return[i,r]}_layoutBoxInPage(e,t,i,n){const o=e.top-i,s=e.top+e.height,r=hMe(this._viewDomNode.domNode),a=r.top+o-window.scrollY,l=r.top+s-window.scrollY,d=aMe(document.body),[h,c]=this._layoutHorizontalSegmentInPage(d,r,e.left-n.scrollLeft+this._contentLeft,t),u=a>=22,g=l+i<=d.height-22;return this._fixedOverflowWidgets?{fitsAbove:u,aboveTop:Math.max(a,22),fitsBelow:g,belowTop:l,left:c}:{fitsAbove:u,aboveTop:o,fitsBelow:g,belowTop:s,left:h}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new $Ve(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var t,i;return{primary:n(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),secondary:n((null===(t=this._secondaryAnchor.viewPosition)||void 0===t?void 0:t.lineNumber)===(null===(i=this._primaryAnchor.viewPosition)||void 0===i?void 0:i.lineNumber)?this._secondaryAnchor.viewPosition:null,this._affinity,this._lineHeight)};function n(t,i,n){if(!t)return null;const o=e.visibleRangeForPosition(t);if(!o)return null;const s=1===t.column&&3===i?0:o.left,r=e.getVerticalOffsetForLineNumber(t.lineNumber)-e.scrollTop;return new GVe(r,s,n)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const n=this._context.configuration.options.get(47);let o=t.left;return o=o<e.left?Math.max(o,e.left-i+n.typicalFullwidthCharacterWidth):Math.min(o,e.left+i-n.typicalFullwidthCharacterWidth),new GVe(e.top,o,e.height)}_prepareRenderWidget(e){if(!this._preference||0===this._preference.length)return null;const{primary:t,secondary:i}=this._getAnchorsCoordinates(e);if(!t)return null;if(-1===this._cachedDomNodeOffsetWidth||-1===this._cachedDomNodeOffsetHeight){let e=null;if("function"==typeof this._actual.beforeRender&&(e=ZVe(this._actual.beforeRender,this._actual)),e)this._cachedDomNodeOffsetWidth=e.width,this._cachedDomNodeOffsetHeight=e.height;else{const e=this.domNode.domNode.getBoundingClientRect();this._cachedDomNodeOffsetWidth=Math.round(e.width),this._cachedDomNodeOffsetHeight=Math.round(e.height)}}const n=this._reduceAnchorCoordinates(t,i,this._cachedDomNodeOffsetWidth);let o;o=this.allowEditorOverflow?this._layoutBoxInPage(n,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e):this._layoutBoxInViewport(n,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e);for(let e=1;e<=2;e++)for(const t of this._preference)if(1===t){if(!o)return null;if(2===e||o.fitsAbove)return{coordinate:new $Ve(o.aboveTop,o.left),position:1}}else{if(2!==t)return this.allowEditorOverflow?{coordinate:this._prepareRenderWidgetAtExactPositionOverflowing(new $Ve(n.top,n.left)),position:0}:{coordinate:new $Ve(n.top,n.left),position:0};if(!o)return null;if(2===e||o.fitsBelow)return{coordinate:new $Ve(o.belowTop,o.left),position:2}}return null}onBeforeRender(e){this._primaryAnchor.viewPosition&&this._preference&&(this._primaryAnchor.viewPosition.lineNumber<e.startLineNumber||this._primaryAnchor.viewPosition.lineNumber>e.endLineNumber||this.domNode.setMaxWidth(this._maxWidth))}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData)return this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),void("function"==typeof this._actual.afterRender&&ZVe(this._actual.afterRender,this._actual,null));this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),"function"==typeof this._actual.afterRender&&ZVe(this._actual.afterRender,this._actual,this._renderData.position)}}class qVe{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class $Ve{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class GVe{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function ZVe(e,t,...i){try{return e.call(t,...i)}catch(e){return null}}var YVe=i(1067),QVe={};QVe.styleTagTransform=zl(),QVe.setAttributes=Bl(),QVe.insert=Pl().bind(null,"head"),QVe.domAPI=Rl(),QVe.insertStyleElement=Vl(),Ml()(YVe.A,QVe),YVe.A&&YVe.A.locals&&YVe.A.locals;class XVe extends WBe{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(138);this._lineHeight=t.get(63),this._renderLineHighlight=t.get(90),this._renderLineHighlightOnlyWhenFocus=t.get(91),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new hye(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=this._selections.map((e=>e.positionLineNumber));t.sort(((e,t)=>e-t)),tbe(this._cursorLineNumbers,t)||(this._cursorLineNumbers=t,e=!0);const i=this._selections.every((e=>e.isEmpty()));return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(138);return this._lineHeight=t.get(63),this._renderLineHighlight=t.get(90),this._renderLineHighlightOnlyWhenFocus=t.get(91),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return!!this._renderLineHighlightOnlyWhenFocus&&(this._focused=e.isFocused,!0)}prepareRender(e){if(!this._shouldRenderThis())return void(this._renderData=null);const t=this._renderOne(e),i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o=this._cursorLineNumbers.length;let s=0;const r=[];for(let e=i;e<=n;e++){const n=e-i;for(;s<o&&this._cursorLineNumbers[s]<e;)s++;s<o&&this._cursorLineNumbers[s]===e?r[n]=t:r[n]=""}this._renderData=r}render(e,t){if(!this._renderData)return"";const i=t-e;return i>=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return("gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class JVe extends XVe{_renderOne(e){return`<div class="${"current-line"+(this._shouldRenderOther()?" current-line-both":"")}" style="width:${Math.max(e.scrollWidth,this._contentWidth)}px; height:${this._lineHeight}px;"></div>`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class eHe extends XVe{_renderOne(e){return`<div class="${"current-line"+(this._shouldRenderInMargin()?" current-line-margin":"")+(this._shouldRenderOther()?" current-line-margin-both":"")}" style="width:${this._contentLeft}px; height:${this._lineHeight}px;"></div>`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}jBe(((e,t)=>{const i=e.getColor($Be);if(i&&(t.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${i}; border: none; }`)),!i||i.isTransparent()||e.defines(GBe)){const i=e.getColor(GBe);i&&(t.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${i}; }`),kFe(e.type)&&(t.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"),t.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")))}}));var tHe=i(8315),iHe={};iHe.styleTagTransform=zl(),iHe.setAttributes=Bl(),iHe.insert=Pl().bind(null,"head"),iHe.domAPI=Rl(),iHe.insertStyleElement=Vl(),Ml()(tHe.A,iHe),tHe.A&&tHe.A.locals&&tHe.A.locals;class nHe extends WBe{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(63),this._typicalHalfwidthCharacterWidth=t.get(47).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(63),this._typicalHalfwidthCharacterWidth=t.get(47).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let i=[],n=0;for(let e=0,o=t.length;e<o;e++){const o=t[e];o.options.className&&(i[n++]=o)}i=i.sort(((e,t)=>{if(e.options.zIndex<t.options.zIndex)return-1;if(e.options.zIndex>t.options.zIndex)return 1;const i=e.options.className,n=t.options.className;return i<n?-1:i>n?1:dye.compareRangesUsingStarts(e.range,t.range)}));const o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,r=[];for(let e=o;e<=s;e++)r[e-o]="";this._renderWholeLineDecorations(e,i,r),this._renderNormalDecorations(e,i,r),this._renderResult=r}_renderWholeLineDecorations(e,t,i){const n=String(this._lineHeight),o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let e=0,r=t.length;e<r;e++){const r=t[e];if(!r.options.isWholeLine)continue;const a='<div class="cdr '+r.options.className+'" style="left:0;width:100%;height:'+n+'px;"></div>',l=Math.max(r.range.startLineNumber,o),d=Math.min(r.range.endLineNumber,s);for(let e=l;e<=d;e++)i[e-o]+=a}}_renderNormalDecorations(e,t,i){const n=String(this._lineHeight),o=e.visibleRange.startLineNumber;let s=null,r=!1,a=null;for(let l=0,d=t.length;l<d;l++){const d=t[l];if(d.options.isWholeLine)continue;const h=d.options.className,c=Boolean(d.options.showIfCollapsed);let u=d.range;c&&1===u.endColumn&&u.endLineNumber!==u.startLineNumber&&(u=new dye(u.startLineNumber,u.startColumn,u.endLineNumber-1,this._context.viewModel.getLineMaxColumn(u.endLineNumber-1))),s===h&&r===c&&dye.areIntersectingOrTouching(a,u)?a=dye.plusRange(a,u):(null!==s&&this._renderNormalDecoration(e,a,s,r,n,o,i),s=h,r=c,a=u)}null!==s&&this._renderNormalDecoration(e,a,s,r,n,o,i)}_renderNormalDecoration(e,t,i,n,o,s,r){const a=e.linesVisibleRangesForRange(t,"findMatch"===i);if(a)for(let e=0,t=a.length;e<t;e++){const t=a[e];if(t.outsideRenderedLine)continue;const l=t.lineNumber-s;if(n&&1===t.ranges.length){const e=t.ranges[0];if(e.width<this._typicalHalfwidthCharacterWidth){const i=Math.round(e.left+e.width/2),n=Math.max(0,Math.round(i-this._typicalHalfwidthCharacterWidth/2));t.ranges[0]=new bFe(n,this._typicalHalfwidthCharacterWidth)}}for(let e=0,n=t.ranges.length;e<n;e++){const n=t.ranges[e],s='<div class="cdr '+i+'" style="left:'+String(n.left)+"px;width:"+String(n.width)+"px;height:"+o+'px;"></div>';r[l]+=s}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class oHe extends pFe{constructor(e,t,i,n){super(e);const o=this._context.configuration.options,s=o.get(97),r=o.get(71),a=o.get(37),l=o.get(100),d={listenOnDomNode:i.domNode,className:"editor-scrollable "+zBe(e.theme.type),useShadows:!1,lazyRender:!0,vertical:s.vertical,horizontal:s.horizontal,verticalHasArrows:s.verticalHasArrows,horizontalHasArrows:s.horizontalHasArrows,verticalScrollbarSize:s.verticalScrollbarSize,verticalSliderSize:s.verticalSliderSize,horizontalScrollbarSize:s.horizontalScrollbarSize,horizontalSliderSize:s.horizontalSliderSize,handleMouseWheel:s.handleMouseWheel,alwaysConsumeMouseWheel:s.alwaysConsumeMouseWheel,arrowSize:s.arrowSize,mouseWheelScrollSensitivity:r,fastScrollSensitivity:a,scrollPredominantAxis:l,scrollByPage:s.scrollByPage};this.scrollbar=this._register(new _Be(t.domNode,d,this._context.viewLayout.getScrollable())),mFe.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=Ixe(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const h=(e,t,i)=>{const n={};if(t){const t=e.scrollTop;t&&(n.scrollTop=this._context.viewLayout.getCurrentScrollTop()+t,e.scrollTop=0)}if(i){const t=e.scrollLeft;t&&(n.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+t,e.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(n,1)};this._register(tMe(i.domNode,"scroll",(e=>h(i.domNode,!0,!0)))),this._register(tMe(t.domNode,"scroll",(e=>h(t.domNode,!0,!1)))),this._register(tMe(n.domNode,"scroll",(e=>h(n.domNode,!0,!1)))),this._register(tMe(this.scrollbarDomNode.domNode,"scroll",(e=>h(this.scrollbarDomNode.domNode,!0,!1))))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(138);this.scrollbarDomNode.setLeft(t.contentLeft),"right"===e.get(69).side?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(97)||e.hasChanged(71)||e.hasChanged(37)){const e=this._context.configuration.options,t=e.get(97),i=e.get(71),n=e.get(37),o=e.get(100),s={vertical:t.vertical,horizontal:t.horizontal,verticalScrollbarSize:t.verticalScrollbarSize,horizontalScrollbarSize:t.horizontalScrollbarSize,scrollByPage:t.scrollByPage,handleMouseWheel:t.handleMouseWheel,mouseWheelScrollSensitivity:i,fastScrollSensitivity:n,scrollPredominantAxis:o};this.scrollbar.updateOptions(s)}return e.hasChanged(138)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+zBe(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}var sHe=i(9959),rHe={};rHe.styleTagTransform=zl(),rHe.setAttributes=Bl(),rHe.insert=Pl().bind(null,"head"),rHe.domAPI=Rl(),rHe.insertStyleElement=Vl(),Ml()(sHe.A,rHe),sHe.A&&sHe.A.locals&&sHe.A.locals;class aHe{constructor(e,t,i){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i)}}class lHe extends WBe{_render(e,t,i){const n=[];for(let i=e;i<=t;i++)n[i-e]=[];if(0===i.length)return n;i.sort(((e,t)=>e.className===t.className?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.className<t.className?-1:1));let o=null,s=0;for(let r=0,a=i.length;r<a;r++){const a=i[r],l=a.className;let d=Math.max(a.startLineNumber,e)-e;const h=Math.min(a.endLineNumber,t)-e;o===l?(d=Math.max(s+1,d),s=Math.max(s,h)):(o=l,s=h);for(let e=d;e<=s;e++)n[e].push(o)}return n}}class dHe extends lHe{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(138);this._lineHeight=t.get(63),this._glyphMargin=t.get(54),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(138);return this._lineHeight=t.get(63),this._glyphMargin=t.get(54),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let n=0;for(let e=0,o=t.length;e<o;e++){const o=t[e],s=o.options.glyphMarginClassName;s&&(i[n++]=new aHe(o.range.startLineNumber,o.range.endLineNumber,s))}return i}prepareRender(e){if(!this._glyphMargin)return void(this._renderResult=null);const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o=this._lineHeight.toString(),s='" style="left:'+this._glyphMarginLeft.toString()+"px;width:"+this._glyphMarginWidth.toString()+"px;height:"+o+'px;"></div>',r=[];for(let e=t;e<=i;e++){const i=e-t,o=n[i];0===o.length?r[i]="":r[i]='<div class="cgmr codicon '+o.join(" ")+s}this._renderResult=r}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}var hHe,cHe=i(7823),uHe={};uHe.styleTagTransform=zl(),uHe.setAttributes=Bl(),uHe.insert=Pl().bind(null,"head"),uHe.domAPI=Rl(),uHe.insertStyleElement=Vl(),Ml()(cHe.A,uHe),cHe.A&&cHe.A.locals&&cHe.A.locals;class gHe extends Owe{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}!function(e){e[e.Disabled=0]="Disabled",e[e.EnabledForActive=1]="EnabledForActive",e[e.Enabled=2]="Enabled"}(hHe||(hHe={}));class pHe{constructor(e,t,i,n,o,s){if(this.visibleColumn=e,this.column=t,this.className=i,this.horizontalLine=n,this.forWrappedLinesAfterColumn=o,this.forWrappedLinesBeforeOrAtColumn=s,-1!==e==(-1!==t))throw new Error}}class mHe{constructor(e,t){this.top=e,this.endColumn=t}}class fHe extends gHe{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t}getLanguageConfiguration(e){return this.languageConfigurationService.getLanguageConfiguration(e)}_computeIndentLevel(e){return function(e,t){let i=0,n=0;const o=e.length;for(;n<o;){const o=e.charCodeAt(n);if(32===o)i++;else{if(9!==o)break;i=i-i%t+t}n++}return n===o?-1:i}(this.textModel.getLineContent(e+1),this.textModel.getOptions().tabSize)}getActiveIndentGuide(e,t,i){this.assertNotDisposed();const n=this.textModel.getLineCount();if(e<1||e>n)throw new Error("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=Boolean(o&&o.offSide);let r=-2,a=-1,l=-2,d=-1;const h=e=>{if(-1!==r&&(-2===r||r>e-1)){r=-1,a=-1;for(let t=e-2;t>=0;t--){const e=this._computeIndentLevel(t);if(e>=0){r=t,a=e;break}}}if(-2===l){l=-1,d=-1;for(let t=e;t<n;t++){const e=this._computeIndentLevel(t);if(e>=0){l=t,d=e;break}}}};let c=-2,u=-1,g=-2,p=-1;const m=e=>{if(-2===c){c=-1,u=-1;for(let t=e-2;t>=0;t--){const e=this._computeIndentLevel(t);if(e>=0){c=t,u=e;break}}}if(-1!==g&&(-2===g||g<e-1)){g=-1,p=-1;for(let t=e;t<n;t++){const e=this._computeIndentLevel(t);if(e>=0){g=t,p=e;break}}}};let f=0,_=!0,v=0,b=!0,w=0,C=0;for(let o=0;_||b;o++){const r=e-o,g=e+o;o>1&&(r<1||r<t)&&(_=!1),o>1&&(g>n||g>i)&&(b=!1),o>5e4&&(_=!1,b=!1);let y=-1;if(_&&r>=1){const e=this._computeIndentLevel(r-1);e>=0?(l=r-1,d=e,y=Math.ceil(e/this.textModel.getOptions().indentSize)):(h(r),y=this._getIndentLevelForWhitespaceLine(s,a,d))}let S=-1;if(b&&g<=n){const e=this._computeIndentLevel(g-1);e>=0?(c=g-1,u=e,S=Math.ceil(e/this.textModel.getOptions().indentSize)):(m(g),S=this._getIndentLevelForWhitespaceLine(s,u,p))}if(0!==o){if(1===o){if(g<=n&&S>=0&&C+1===S){_=!1,f=g,v=g,w=S;continue}if(r>=1&&y>=0&&y-1===C){b=!1,f=r,v=r,w=y;continue}if(f=e,v=e,w=C,0===w)return{startLineNumber:f,endLineNumber:v,indent:w}}_&&(y>=w?f=r:_=!1),b&&(S>=w?v=g:b=!1)}else C=y}return{startLineNumber:f,endLineNumber:v,indent:w}}getLinesBracketGuides(e,t,i,n){var o;const s=[];for(let i=e;i<=t;i++)s.push([]);const r=!0,a=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new dye(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let l;i&&a.length>0&&(l=null===(o=function(e){const t=function(e,t){for(let i=e.length-1;i>=0;i--)if(t(e[i]))return i;return-1}(e,(e=>r));if(-1!==t)return e[t]}((e<=i.lineNumber&&i.lineNumber<=t?a:this.textModel.bracketPairs.getBracketPairsInRange(dye.fromPositions(i)).toArray()).filter((e=>dye.strictContainsPosition(e.range,i)))))||void 0===o?void 0:o.range);const d=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,h=new _He;for(const i of a){if(!i.closingBracketRange)continue;const o=l&&i.range.equalsRange(l);if(!o&&!n.includeInactive)continue;const r=h.getInlineClassName(i.nestingLevel,i.nestingLevelOfEqualBracketType,d)+(n.highlightActive&&o?" "+h.activeClassName:""),a=i.openingBracketRange.getStartPosition(),c=i.closingBracketRange.getStartPosition(),u=n.horizontalGuides===hHe.Enabled||n.horizontalGuides===hHe.EnabledForActive&&o;if(i.range.startLineNumber===i.range.endLineNumber){u&&s[i.range.startLineNumber-e].push(new pHe(-1,i.openingBracketRange.getEndPosition().column,r,new mHe(!1,c.column),-1,-1));continue}const g=this.getVisibleColumnFromPosition(c),p=this.getVisibleColumnFromPosition(i.openingBracketRange.getStartPosition()),m=Math.min(p,g,i.minVisibleColumnIndentation+1);let f=!1;ESe(this.textModel.getLineContent(i.closingBracketRange.startLineNumber))<i.closingBracketRange.startColumn-1&&(f=!0);const _=Math.max(a.lineNumber,e),v=Math.min(c.lineNumber,t),b=f?1:0;for(let t=_;t<v+b;t++)s[t-e].push(new pHe(m,-1,r,null,t===a.lineNumber?a.column:-1,t===c.lineNumber?c.column:-1));u&&(a.lineNumber>=e&&p>m&&s[a.lineNumber-e].push(new pHe(m,-1,r,new mHe(!1,a.column),-1,-1)),c.lineNumber<=t&&g>m&&s[c.lineNumber-e].push(new pHe(m,-1,r,new mHe(!f,c.column),-1,-1)))}for(const e of s)e.sort(((e,t)=>e.visibleColumn-t.visibleColumn));return s}getVisibleColumnFromPosition(e){return PFe.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const i=this.textModel.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const n=this.textModel.getOptions(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=Boolean(o&&o.offSide),r=new Array(t-e+1);let a=-2,l=-1,d=-2,h=-1;for(let o=e;o<=t;o++){const t=o-e,c=this._computeIndentLevel(o-1);if(c>=0)a=o-1,l=c,r[t]=Math.ceil(c/n.indentSize);else{if(-2===a){a=-1,l=-1;for(let e=o-2;e>=0;e--){const t=this._computeIndentLevel(e);if(t>=0){a=e,l=t;break}}}if(-1!==d&&(-2===d||d<o-1)){d=-1,h=-1;for(let e=o;e<i;e++){const t=this._computeIndentLevel(e);if(t>=0){d=e,h=t;break}}}r[t]=this._getIndentLevelForWhitespaceLine(s,l,h)}}return r}_getIndentLevelForWhitespaceLine(e,t,i){const n=this.textModel.getOptions();return-1===t||-1===i?0:t<i?1+Math.floor(t/n.indentSize):t===i||e?Math.ceil(i/n.indentSize):1+Math.floor(i/n.indentSize)}}class _He{constructor(){this.activeClassName="indent-active"}getInlineClassName(e,t,i){return this.getInlineClassNameOfLevel(i?t:e)}getInlineClassNameOfLevel(e){return"bracket-indent-guide lvl-"+e%30}}class vHe extends WBe{constructor(e){super(),this._context=e,this._primaryPosition=null;const t=this._context.configuration.options,i=t.get(139),n=t.get(47);this._lineHeight=t.get(63),this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(13),this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(139),n=t.get(47);return this._lineHeight=t.get(63),this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(13),!0}onCursorStateChanged(e){var t;const i=e.selections[0].getPosition();return!(null===(t=this._primaryPosition)||void 0===t?void 0:t.equals(i))&&(this._primaryPosition=i,!0)}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onLanguageConfigurationChanged(e){return!0}prepareRender(e){var t,i,n,o;if(!this._bracketPairGuideOptions.indentation&&!1===this._bracketPairGuideOptions.bracketPairs)return void(this._renderResult=null);const s=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=e.scrollWidth,l=this._lineHeight,d=this._primaryPosition,h=this.getGuidesByLine(s,Math.min(r+1,this._context.viewModel.getLineCount()),d),c=[];for(let d=s;d<=r;d++){const r=d-s,u=h[r];let g="";const p=null!==(i=null===(t=e.visibleRangeForPosition(new lye(d,1)))||void 0===t?void 0:t.left)&&void 0!==i?i:0;for(const t of u){const i=-1===t.column?p+(t.visibleColumn-1)*this._spaceWidth:e.visibleRangeForPosition(new lye(d,t.column)).left;if(i>a||this._maxIndentLeft>0&&i>this._maxIndentLeft)break;const s=t.horizontalLine?t.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",r=t.horizontalLine?(null!==(o=null===(n=e.visibleRangeForPosition(new lye(d,t.horizontalLine.endColumn)))||void 0===n?void 0:n.left)&&void 0!==o?o:i+this._spaceWidth)-i:this._spaceWidth;g+=`<div class="core-guide ${t.className} ${s}" style="left:${i}px;height:${l}px;width:${r}px"></div>`}c[r]=g}this._renderResult=c}getGuidesByLine(e,t,i){const n=!1!==this._bracketPairGuideOptions.bracketPairs?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:!0===this._bracketPairGuideOptions.bracketPairsHorizontal?hHe.Enabled:"active"===this._bracketPairGuideOptions.bracketPairsHorizontal?hHe.EnabledForActive:hHe.Disabled,includeInactive:!0===this._bracketPairGuideOptions.bracketPairs}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let s=0,r=0,a=0;if(!1!==this._bracketPairGuideOptions.highlightActiveIndentation&&i){const n=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);s=n.startLineNumber,r=n.endLineNumber,a=n.indent}const{indentSize:l}=this._context.viewModel.model.getOptions(),d=[];for(let i=e;i<=t;i++){const t=new Array;d.push(t);const h=n?n[i-e]:[],c=new pbe(h),u=o?o[i-e]:0;for(let e=1;e<=u;e++){const n=(e-1)*l+1,o=("always"===this._bracketPairGuideOptions.highlightActiveIndentation||0===h.length)&&s<=i&&i<=r&&e===a;t.push(...c.takeWhile((e=>e.visibleColumn<n))||[]);const d=c.peek();d&&d.visibleColumn===n&&!d.horizontalLine||t.push(new pHe(n,-1,o?"core-guide-indent-active":"core-guide-indent",null,-1,-1))}t.push(...c.takeWhile((e=>!0))||[])}return d}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function bHe(e){if(!e||!e.isTransparent())return e}jBe(((e,t)=>{const i=[{bracketColor:hWe,guideColor:_We,guideColorActive:SWe},{bracketColor:cWe,guideColor:vWe,guideColorActive:xWe},{bracketColor:uWe,guideColor:bWe,guideColorActive:kWe},{bracketColor:gWe,guideColor:wWe,guideColorActive:LWe},{bracketColor:pWe,guideColor:CWe,guideColorActive:DWe},{bracketColor:mWe,guideColor:yWe,guideColorActive:EWe}],n=new _He,o=i.map((t=>{var i,n;const o=e.getColor(t.bracketColor),s=e.getColor(t.guideColor),r=e.getColor(t.guideColorActive),a=bHe(null!==(i=bHe(s))&&void 0!==i?i:null==o?void 0:o.transparent(.3)),l=bHe(null!==(n=bHe(r))&&void 0!==n?n:o);if(a&&l)return{guideColor:a,guideColorActive:l}})).filter(Sbe);if(o.length>0){for(let e=0;e<30;e++){const i=o[e%o.length];t.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(e).replace(/ /g,".")} { --guide-color: ${i.guideColor}; --guide-color-active: ${i.guideColorActive}; }`)}t.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),t.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),t.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),t.addRule(`.monaco-editor .vertical.${n.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),t.addRule(`.monaco-editor .horizontal-top.${n.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),t.addRule(`.monaco-editor .horizontal-bottom.${n.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}}));var wHe=i(346),CHe={};CHe.styleTagTransform=zl(),CHe.setAttributes=Bl(),CHe.insert=Pl().bind(null,"head"),CHe.domAPI=Rl(),CHe.insertStyleElement=Vl(),Ml()(wHe.A,CHe),wHe.A&&wHe.A.locals&&wHe.A.locals;class yHe{constructor(){this._currentVisibleRange=new dye(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class SHe{constructor(e,t,i,n,o,s,r){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=n,this.startScrollTop=o,this.stopScrollTop=s,this.scrollType=r,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class xHe{constructor(e,t,i,n,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=n,this.scrollType=o,this.type="selections";let s=t[0].startLineNumber,r=t[0].endLineNumber;for(let e=1,i=t.length;e<i;e++){const i=t[e];s=Math.min(s,i.startLineNumber),r=Math.max(r,i.endLineNumber)}this.minLineNumber=s,this.maxLineNumber=r}}class kHe extends pFe{constructor(e,t){super(e),this._linesContent=t,this._textRangeRestingSpot=document.createElement("div"),this._visibleLines=new BVe(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration,n=this._context.configuration.options,o=n.get(47),s=n.get(139);this._lineHeight=n.get(63),this._typicalHalfwidthCharacterWidth=o.typicalHalfwidthCharacterWidth,this._isViewportWrapping=s.isViewportWrapping,this._revealHorizontalRightPadding=n.get(94),this._cursorSurroundingLines=n.get(26),this._cursorSurroundingLinesStyle=n.get(27),this._canUseLayerHinting=!n.get(29),this._viewLineOptions=new IFe(i,this._context.theme.type),mFe.write(this.domNode,7),this.domNode.setClassName(`view-lines ${OWe}`),Txe(this.domNode,o),this._maxLineWidth=0,this._asyncUpdateLineWidths=new FDe((()=>{this._updateLineWidthsSlow()}),200),this._asyncCheckMonospaceFontAssumptions=new FDe((()=>{this._checkMonospaceFontAssumptions()}),2e3),this._lastRenderedData=new yHe,this._horizontalRevealRequest=null,this._stickyScrollEnabled=n.get(109).enabled,this._maxNumberStickyLines=n.get(109).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new TFe(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(139)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(47),n=t.get(139);return this._lineHeight=t.get(63),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping,this._revealHorizontalRightPadding=t.get(94),this._cursorSurroundingLines=t.get(26),this._cursorSurroundingLinesStyle=t.get(27),this._canUseLayerHinting=!t.get(29),this._stickyScrollEnabled=t.get(109).enabled,this._maxNumberStickyLines=t.get(109).maxLineCount,Txe(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(138)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new IFe(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const e=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let t=e;t<=i;t++)this._visibleLines.getVisibleLine(t).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let e=t;e<=i;e++)n=this._visibleLines.getVisibleLine(e).onSelectionChanged()||n;return n}onDecorationsChanged(e){{const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++)this._visibleLines.getVisibleLine(i).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(-1===t)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new SHe(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new xHe(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const n=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,n),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTop<t||e.scrollTop>i)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const i=this._getViewLineDomNode(e);if(null===i)return null;const n=this._getLineNumberFor(i);if(-1===n)return null;if(n<1||n>this._context.viewModel.getLineCount())return null;if(1===this._context.viewModel.getLineMaxColumn(n))return new lye(n,1);const o=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();if(n<o||n>s)return null;let r=this._visibleLines.getVisibleLine(n).getColumnOfNodeOffset(n,e,t);const a=this._context.viewModel.getLineMinColumn(n);return r<a&&(r=a),new lye(n,r)}_getViewLineDomNode(e){for(;e&&1===e.nodeType;){if(e.className===TFe.CLASS_NAME)return e;e=e.parentElement}return null}_getLineNumberFor(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let n=t;n<=i;n++)if(e===this._visibleLines.getVisibleLine(n).getDomNode())return n;return-1}getLineWidth(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();return e<t||e>i?-1:this._visibleLines.getVisibleLine(e).getWidth()}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,n=dye.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;const o=[];let s=0;const r=new NFe(this.domNode.domNode,this._textRangeRestingSpot);let a=0;t&&(a=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new lye(n.startLineNumber,1)).lineNumber);const l=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let e=n.startLineNumber;e<=n.endLineNumber;e++){if(e<l||e>d)continue;const h=e===n.startLineNumber?n.startColumn:1,c=e===n.endLineNumber?n.endColumn:this._context.viewModel.getLineMaxColumn(e),u=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,h,c,r);if(u){if(t&&e<i){const t=a;a=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new lye(e+1,1)).lineNumber,t!==a&&(u.ranges[u.ranges.length-1].width+=this._typicalHalfwidthCharacterWidth)}o[s++]=new vFe(u.outsideRenderedLine,e,bFe.from(u.ranges))}}return 0===s?null:o}_visibleRangesForLineRange(e,t,i){return this.shouldRender()||e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber()?null:this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,new NFe(this.domNode.domNode,this._textRangeRestingSpot))}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new CFe(t.outsideRenderedLine,t.ranges[0].left):null}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=1,o=!0;for(let s=t;s<=i;s++){const t=this._visibleLines.getVisibleLine(s);!e||t.getWidthIsFast()?n=Math.max(n,t.getWidth()):o=!1}return o&&1===t&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++){const i=this._visibleLines.getVisibleLine(o);if(i.needsMonospaceFontCheck()){const n=i.getWidth();n>t&&(t=n,e=o)}}if(-1!==e&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let e=i;e<=n;e++)this._visibleLines.getVisibleLine(e).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const t=this._horizontalRevealRequest;if(e.startLineNumber<=t.minLineNumber&&t.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const e=this._computeScrollLeftToReveal(t);e&&(this._isViewportWrapping||this._ensureMaxLineWidth(e.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:e.scrollLeft},t.scrollType))}}if(this._updateLineWidthsFast()||this._asyncUpdateLineWidths.schedule(),Eve&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++)if(this._visibleLines.getVisibleLine(i).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth<t&&(this._maxLineWidth=t,this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth))}_computeScrollTopToRevealRange(e,t,i,n,o,s){const r=e.top,a=e.height,l=r+a;let d,h,c;if(o&&o.length>0){let e=o[0].startLineNumber,t=o[0].endLineNumber;for(let i=1,n=o.length;i<n;i++){const n=o[i];e=Math.min(e,n.startLineNumber),t=Math.max(t,n.endLineNumber)}d=!1,h=this._context.viewLayout.getVerticalOffsetForLineNumber(e),c=this._context.viewLayout.getVerticalOffsetForLineNumber(t)+this._lineHeight}else{if(!n)return-1;d=!0,h=this._context.viewLayout.getVerticalOffsetForLineNumber(n.startLineNumber),c=this._context.viewLayout.getVerticalOffsetForLineNumber(n.endLineNumber)+this._lineHeight}let u,g=0,p=0;if("mouse"!==t&&!i||"default"!==this._cursorSurroundingLinesStyle){const e=Math.min(a/this._lineHeight/2,this._cursorSurroundingLines);g=this._stickyScrollEnabled?Math.max(e,this._maxNumberStickyLines)*this._lineHeight:e*this._lineHeight,p=Math.max(0,e-1)*this._lineHeight}else i||(g=this._lineHeight);if(i||0!==s&&4!==s||(p+=this._lineHeight),h-=g,c+=p,c-h>a){if(!d)return-1;u=h}else if(5===s||6===s)if(6===s&&r<=h&&c<=l)u=r;else{const e=h-Math.max(5*this._lineHeight,.2*a),t=c-a;u=Math.max(t,e)}else if(1===s||2===s)if(2===s&&r<=h&&c<=l)u=r;else{const e=(h+c)/2;u=Math.max(0,e-a/2)}else u=this._computeMinimumScrolling(r,l,h,c,3===s,4===s);return u}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(138),n=t.left,o=n+t.width-i.verticalScrollbarWidth;let s=1073741824,r=0;if("range"===e.type){const t=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!t)return null;for(const e of t.ranges)s=Math.min(s,Math.round(e.left)),r=Math.max(r,Math.round(e.left+e.width))}else for(const t of e.selections){if(t.startLineNumber!==t.endLineNumber)return null;const e=this._visibleRangesForLineRange(t.startLineNumber,t.startColumn,t.endColumn);if(!e)return null;for(const t of e.ranges)s=Math.min(s,Math.round(t.left)),r=Math.max(r,Math.round(t.left+t.width))}return e.minimalReveal||(s=Math.max(0,s-kHe.HORIZONTAL_EXTRA_PX),r+=this._revealHorizontalRightPadding),"selections"===e.type&&r-s>t.width?null:{scrollLeft:this._computeMinimumScrolling(n,o,s,r),maxHorizontalOffset:r}}_computeMinimumScrolling(e,t,i,n,o,s){o=!!o,s=!!s;const r=(t|=0)-(e|=0);return(n|=0)-(i|=0)<r?o?i:s?Math.max(0,n-r):i<e?i:n>t?Math.max(0,n-r):e:i}}kHe.HORIZONTAL_EXTRA_PX=30;var LHe=i(5277),DHe={};DHe.styleTagTransform=zl(),DHe.setAttributes=Bl(),DHe.insert=Pl().bind(null,"head"),DHe.domAPI=Rl(),DHe.insertStyleElement=Vl(),Ml()(LHe.A,DHe),LHe.A&&LHe.A.locals&&LHe.A.locals;class EHe extends lHe{constructor(e){super(),this._context=e;const t=this._context.configuration.options.get(138);this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options.get(138);return this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let n=0;for(let e=0,o=t.length;e<o;e++){const o=t[e],s=o.options.linesDecorationsClassName;s&&(i[n++]=new aHe(o.range.startLineNumber,o.range.endLineNumber,s));const r=o.options.firstLineDecorationClassName;r&&(i[n++]=new aHe(o.range.startLineNumber,o.range.startLineNumber,r))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o='" style="left:'+this._decorationsLeft.toString()+"px;width:"+this._decorationsWidth.toString()+'px;"></div>',s=[];for(let e=t;e<=i;e++){const i=e-t,r=n[i];let a="";for(let e=0,t=r.length;e<t;e++)a+='<div class="cldr '+r[e]+o;s[i]=a}this._renderResult=s}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}var NHe=i(1255),IHe={};IHe.styleTagTransform=zl(),IHe.setAttributes=Bl(),IHe.insert=Pl().bind(null,"head"),IHe.domAPI=Rl(),IHe.insertStyleElement=Vl(),Ml()(NHe.A,IHe),NHe.A&&NHe.A.locals&&NHe.A.locals;class THe extends lHe{constructor(e){super(),this._context=e,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let n=0;for(let e=0,o=t.length;e<o;e++){const o=t[e],s=o.options.marginClassName;s&&(i[n++]=new aHe(o.range.startLineNumber,o.range.endLineNumber,s))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o=[];for(let e=t;e<=i;e++){const i=e-t,s=n[i];let r="";for(let e=0,t=s.length;e<t;e++)r+='<div class="cmdr '+s[e]+'" style=""></div>';o[i]=r}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}var MHe=i(8403),AHe={};AHe.styleTagTransform=zl(),AHe.setAttributes=Bl(),AHe.insert=Pl().bind(null,"head"),AHe.domAPI=Rl(),AHe.insertStyleElement=Vl(),Ml()(MHe.A,AHe),MHe.A&&MHe.A.locals&&MHe.A.locals;class RHe{constructor(e,t,i,n){this._rgba8Brand=void 0,this.r=RHe._clamp(e),this.g=RHe._clamp(t),this.b=RHe._clamp(i),this.a=RHe._clamp(n)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:0|e}}RHe.Empty=new RHe(0,0,0,0);class OHe extends Owe{static getInstance(){return this._INSTANCE||(this._INSTANCE=new OHe),this._INSTANCE}constructor(){super(),this._onDidChange=new $we,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(Eye.onDidChange((e=>{e.changedColorMap&&this._updateColorMap()})))}_updateColorMap(){const e=Eye.getColorMap();if(!e)return this._colors=[RHe.Empty],void(this._backgroundIsLight=!0);this._colors=[RHe.Empty];for(let t=1;t<e.length;t++){const i=e[t].rgba;this._colors[t]=new RHe(i.r,i.g,i.b,Math.round(255*i.a))}const t=e[2].getRelativeLuminance();this._backgroundIsLight=t>=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}OHe._INSTANCE=null;const PHe=(()=>{const e=[];for(let t=32;t<=126;t++)e.push(t);return e.push(65533),e})();class FHe{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=FHe.soften(e,.8),this.charDataLight=FHe.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=vEe(e[n]*t);return i}renderChar(e,t,i,n,o,s,r,a,l,d,h){const c=1*this.scale,u=2*this.scale,g=h?1:u;if(t+c>e.width||i+g>e.height)return void console.warn("bad render request outside image data");const p=d?this.charDataLight:this.charDataNormal,m=((e,t)=>(e-=32)<0||e>96?t<=2?(e+96)%96:95:e)(n,l),f=4*e.width,_=r.r,v=r.g,b=r.b,w=o.r-_,C=o.g-v,y=o.b-b,S=Math.max(s,a),x=e.data;let k=m*c*u,L=i*f+4*t;for(let e=0;e<g;e++){let e=L;for(let t=0;t<c;t++){const t=p[k++]/255*(s/255);x[e++]=_+w*t,x[e++]=v+C*t,x[e++]=b+y*t,x[e++]=S}L+=f}}blockRenderChar(e,t,i,n,o,s,r,a){const l=1*this.scale,d=2*this.scale,h=a?1:d;if(t+l>e.width||i+h>e.height)return void console.warn("bad render request outside image data");const c=4*e.width,u=o/255*.5,g=s.r,p=s.g,m=s.b,f=g+(n.r-g)*u,_=p+(n.g-p)*u,v=m+(n.b-m)*u,b=Math.max(o,r),w=e.data;let C=i*c+4*t;for(let e=0;e<h;e++){let e=C;for(let t=0;t<l;t++)w[e++]=f,w[e++]=_,w[e++]=v,w[e++]=b;C+=c}}}const BHe={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15},WHe=e=>{const t=new Uint8ClampedArray(e.length/2);for(let i=0;i<e.length;i+=2)t[i>>1]=BHe[e[i]]<<4|15&BHe[e[i+1]];return t},VHe={1:Iwe((()=>WHe("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792"))),2:Iwe((()=>WHe("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126")))};class HHe{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return i=VHe[e]?new FHe(VHe[e](),e):HHe.createFromSampleData(HHe.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height="16px",t.height=16,t.width=960,t.style.width="960px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let n=0;for(const e of PHe)i.fillText(String.fromCharCode(e),n,8),n+=10;return i.getImageData(0,0,960,16)}static createFromSampleData(e,t){if(61440!==e.length)throw new Error("Unexpected source in MinimapCharRenderer");const i=HHe._downsample(e,t);return new FHe(i,t)}static _downsampleChar(e,t,i,n,o){const s=1*o,r=2*o;let a=n,l=0;for(let n=0;n<r;n++){const o=n/r*16,d=(n+1)/r*16;for(let n=0;n<s;n++){const r=n/s*10,h=(n+1)/s*10;let c=0,u=0;for(let i=o;i<d;i++){const n=t+3840*Math.floor(i),o=1-(i-Math.floor(i));for(let t=r;t<h;t++){const i=1-(t-Math.floor(t)),s=n+4*Math.floor(t),r=i*o;u+=r,c+=e[s]*e[s+3]/255*r}}const g=c/u;l=Math.max(l,g),i[a++]=vEe(g)}}return l}static _downsample(e,t){const i=2*t*1*t,n=96*i,o=new Uint8ClampedArray(n);let s=0,r=0,a=0;for(let n=0;n<96;n++)a=Math.max(a,this._downsampleChar(e,r,o,s,t)),s+=i,r+=40;if(a>0){const e=255/a;for(let t=0;t<n;t++)o[t]*=e}return o}}class zHe{constructor(e,t,i){const n=e.options,o=n.get(136),s=n.get(138),r=s.minimap,a=n.get(47),l=n.get(69);this.renderMinimap=r.renderMinimap,this.size=l.size,this.minimapHeightIsEditorHeight=r.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=n.get(99),this.paddingTop=n.get(80).top,this.paddingBottom=n.get(80).bottom,this.showSlider=l.showSlider,this.autohide=l.autohide,this.pixelRatio=o,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.lineHeight=n.get(63),this.minimapLeft=r.minimapLeft,this.minimapWidth=r.minimapWidth,this.minimapHeight=s.height,this.canvasInnerWidth=r.minimapCanvasInnerWidth,this.canvasInnerHeight=r.minimapCanvasInnerHeight,this.canvasOuterWidth=r.minimapCanvasOuterWidth,this.canvasOuterHeight=r.minimapCanvasOuterHeight,this.isSampling=r.minimapIsSampling,this.editorHeight=s.height,this.fontScale=r.minimapScale,this.minimapLineHeight=r.minimapLineHeight,this.minimapCharWidth=1*this.fontScale,this.charRenderer=Iwe((()=>HHe.create(this.fontScale,a.fontFamily))),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=zHe._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=zHe._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(VPe);return i?new RHe(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(HPe);return t?RHe._clamp(Math.round(255*t.rgba.a)):255}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class UHe{constructor(e,t,i,n,o,s,r,a,l){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,this.sliderTop=o,this.sliderHeight=s,this.topPaddingLineCount=r,this.startLineNumber=a,this.endLineNumber=l}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumber,e.endLineNumber);return t>i?null:[t,i]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,i,n,o,s,r,a,l,d,h){const c=e.pixelRatio,u=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/u),p=e.lineHeight;if(e.minimapHeightIsEditorHeight){let t=a*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(t+=Math.max(0,o-e.lineHeight-e.paddingBottom));const i=Math.max(1,Math.floor(o*o/t)),n=Math.max(0,e.minimapHeight-i),s=n/(d-o),h=l*s,c=n>0,u=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),g=Math.floor(e.paddingTop/e.lineHeight);return new UHe(l,d,c,s,h,i,g,1,Math.min(r,u))}let m;if(s&&i!==r){const e=i-t+1;m=Math.floor(e*u/c)}else{const e=o/p;m=Math.floor(e*u/c)}const f=Math.floor(e.paddingTop/p);let _,v=Math.floor(e.paddingBottom/p);if(e.scrollBeyondLastLine){const e=o/p;v=Math.max(v,e-1)}_=v>0?(f+r+v-o/p-1)*u/c:Math.max(0,(f+r)*u/c-m),_=Math.min(e.minimapHeight-m,_);const b=_/(d-o),w=l*b;if(g>=f+r+v)return new UHe(l,d,_>0,b,w,m,f,1,r);{let i,o;i=t>1?t+f:Math.max(1,l/p);let s=Math.max(1,Math.floor(i-w*c/u));s<f?(o=f-s+1,s=1):(o=0,s=Math.max(1,s-f)),h&&h.scrollHeight===d&&(h.scrollTop>l&&(s=Math.min(s,h.startLineNumber),o=Math.max(o,h.topPaddingLineCount)),h.scrollTop<l&&(s=Math.max(s,h.startLineNumber),o=Math.min(o,h.topPaddingLineCount)));const a=Math.min(r,s-o+g-1),_=(l-n)/p;let v;return v=l>e.paddingTop?(t-s+o+_)*u/c:l/e.paddingTop*(o+_)*u/c,new UHe(l,d,!0,b,v,m,o,s,a)}}}class KHe{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}KHe.INVALID=new KHe(-1);class jHe{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new FVe((()=>KHe.INVALID)),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const t=this._renderedLines._get().lines;for(let e=0,i=t.length;e<i;e++)if(-1===t[e].dy)return!1;return!0}scrollEquals(e){return this.renderedLayout.startLineNumber===e.startLineNumber&&this.renderedLayout.endLineNumber===e.endLineNumber}_get(){const e=this._renderedLines._get();return{imageData:this._imageData,rendLineNumberStart:e.rendLineNumberStart,lines:e.lines}}onLinesChanged(e,t){return this._renderedLines.onLinesChanged(e,t)}onLinesDeleted(e,t){this._renderedLines.onLinesDeleted(e,t)}onLinesInserted(e,t){this._renderedLines.onLinesInserted(e,t)}onTokensChanged(e){return this._renderedLines.onTokensChanged(e)}}class qHe{constructor(e,t,i,n){this._backgroundFillData=qHe._createBackgroundFillData(t,i,n),this._buffers=[e.createImageData(t,i),e.createImageData(t,i)],this._lastUsedBuffer=0}getBuffer(){this._lastUsedBuffer=1-this._lastUsedBuffer;const e=this._buffers[this._lastUsedBuffer];return e.data.set(this._backgroundFillData),e}static _createBackgroundFillData(e,t,i){const n=i.r,o=i.g,s=i.b,r=i.a,a=new Uint8ClampedArray(e*t*4);let l=0;for(let i=0;i<t;i++)for(let t=0;t<e;t++)a[l]=n,a[l+1]=o,a[l+2]=s,a[l+3]=r,l+=4;return a}}class $He{static compute(e,t,i){if(0===e.renderMinimap||!e.isSampling)return[null,[]];const{minimapLineCount:n}=nwe.computeContainedMinimapLineCount({viewLineCount:t,scrollBeyondLastLine:e.scrollBeyondLastLine,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:e.editorHeight,lineHeight:e.lineHeight,pixelRatio:e.pixelRatio}),o=t/n,s=o/2;if(!i||0===i.minimapLines.length){const e=[];if(e[0]=1,n>1){for(let t=0,i=n-1;t<i;t++)e[t]=Math.round(t*o+s);e[n-1]=t}return[new $He(o,e),[]]}const r=i.minimapLines,a=r.length,l=[];let d=0,h=0,c=1,u=[],g=null;for(let e=0;e<n;e++){const i=Math.max(c,Math.round(e*o)),p=Math.max(i,Math.round((e+1)*o));for(;d<a&&r[d]<i;){if(u.length<10){const e=d+1+h;g&&"deleted"===g.type&&g._oldIndex===d-1?g.deleteToLineNumber++:(g={type:"deleted",_oldIndex:d,deleteFromLineNumber:e,deleteToLineNumber:e},u.push(g)),h--}d++}let m;if(d<a&&r[d]<=p)m=r[d],d++;else if(m=0===e?1:e+1===n?t:Math.round(e*o+s),u.length<10){const t=d+1+h;g&&"inserted"===g.type&&g._i===e-1?g.insertToLineNumber++:(g={type:"inserted",_i:e,insertFromLineNumber:t,insertToLineNumber:t},u.push(g)),h++}l[e]=m,c=m}if(u.length<10)for(;d<a;){const e=d+1+h;g&&"deleted"===g.type&&g._oldIndex===d-1?g.deleteToLineNumber++:(g={type:"deleted",_oldIndex:d,deleteFromLineNumber:e,deleteToLineNumber:e},u.push(g)),h--,d++}else u=[{type:"flush"}];return[new $He(o,l),u]}constructor(e,t){this.samplingRatio=e,this.minimapLines=t}modelLineToMinimapLine(e){return Math.min(this.minimapLines.length,Math.max(1,Math.round(e/this.samplingRatio)))}modelLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e)-1;for(;i>0&&this.minimapLines[i-1]>=e;)i--;let n=this.modelLineToMinimapLine(t)-1;for(;n+1<this.minimapLines.length&&this.minimapLines[n+1]<=t;)n++;if(i===n){const n=this.minimapLines[i];if(n<e||n>t)return null}return[i+1,n+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),n=this.modelLineToMinimapLine(t);return e!==t&&n===i&&(n===this.minimapLines.length?i>1&&i--:n++),[i,n]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,n=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]<e.fromLineNumber);o--)this.minimapLines[o]<=e.toLineNumber?(this.minimapLines[o]=Math.max(1,e.fromLineNumber-1),i=Math.min(i,o),n=Math.max(n,o)):this.minimapLines[o]-=t;return[i,n]}onLinesInserted(e){const t=e.toLineNumber-e.fromLineNumber+1;for(let i=this.minimapLines.length-1;i>=0&&!(this.minimapLines[i]<e.fromLineNumber);i--)this.minimapLines[i]+=t}}class GHe extends pFe{constructor(e){super(e),this.tokensColorTracker=OHe.getInstance(),this._selections=[],this._minimapSelections=null,this.options=new zHe(this._context.configuration,this._context.theme,this.tokensColorTracker);const[t]=$He.compute(this.options,this._context.viewModel.getLineCount(),null);this._samplingState=t,this._shouldCheckSampling=!1,this._actual=new ZHe(e.theme,this)}dispose(){this._actual.dispose(),super.dispose()}getDomNode(){return this._actual.getDomNode()}_onOptionsMaybeChanged(){const e=new zHe(this._context.configuration,this._context.theme,this.tokensColorTracker);return!this.options.equals(e)&&(this.options=e,this._recreateLineSampling(),this._actual.onDidChangeOptions(),!0)}onConfigurationChanged(e){return this._onOptionsMaybeChanged()}onCursorStateChanged(e){return this._selections=e.selections,this._minimapSelections=null,this._actual.onSelectionChanged()}onDecorationsChanged(e){return!!e.affectsMinimap&&this._actual.onDecorationsChanged()}onFlushed(e){return this._samplingState&&(this._shouldCheckSampling=!0),this._actual.onFlushed()}onLinesChanged(e){if(this._samplingState){const t=this._samplingState.modelLineRangeToMinimapLineRange(e.fromLineNumber,e.fromLineNumber+e.count-1);return!!t&&this._actual.onLinesChanged(t[0],t[1]-t[0]+1)}return this._actual.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){if(this._samplingState){const[t,i]=this._samplingState.onLinesDeleted(e);return t<=i&&this._actual.onLinesChanged(t+1,i-t+1),this._shouldCheckSampling=!0,!0}return this._actual.onLinesDeleted(e.fromLineNumber,e.toLineNumber)}onLinesInserted(e){return this._samplingState?(this._samplingState.onLinesInserted(e),this._shouldCheckSampling=!0,!0):this._actual.onLinesInserted(e.fromLineNumber,e.toLineNumber)}onScrollChanged(e){return this._actual.onScrollChanged()}onThemeChanged(e){return this._actual.onThemeChanged(),this._onOptionsMaybeChanged(),!0}onTokensChanged(e){if(this._samplingState){const t=[];for(const i of e.ranges){const e=this._samplingState.modelLineRangeToMinimapLineRange(i.fromLineNumber,i.toLineNumber);e&&t.push({fromLineNumber:e[0],toLineNumber:e[1]})}return!!t.length&&this._actual.onTokensChanged(t)}return this._actual.onTokensChanged(e.ranges)}onTokensColorsChanged(e){return this._onOptionsMaybeChanged(),this._actual.onTokensColorsChanged()}onZonesChanged(e){return this._actual.onZonesChanged()}prepareRender(e){this._shouldCheckSampling&&(this._shouldCheckSampling=!1,this._recreateLineSampling())}render(e){let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber;this._samplingState&&(t=this._samplingState.modelLineToMinimapLine(t),i=this._samplingState.modelLineToMinimapLine(i));const n={viewportContainsWhitespaceGaps:e.viewportData.whitespaceViewportData.length>0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(n)}_recreateLineSampling(){this._minimapSelections=null;const e=Boolean(this._samplingState),[t,i]=$He.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const e of i)switch(e.type){case"deleted":this._actual.onLinesDeleted(e.deleteFromLineNumber,e.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(e.insertFromLineNumber,e.insertToLineNumber);break;case"flush":this._actual.onFlushed()}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){const n=[];for(let o=0,s=t-e+1;o<s;o++)i[o]?n[o]=this._context.viewModel.getViewLineData(this._samplingState.minimapLines[e+o-1]):n[o]=null;return n}return this._context.viewModel.getMinimapLinesRenderingData(e,t,i).data}getSelections(){if(null===this._minimapSelections)if(this._samplingState){this._minimapSelections=[];for(const e of this._selections){const[t,i]=this._samplingState.decorationLineRangeToMinimapLineRange(e.startLineNumber,e.endLineNumber);this._minimapSelections.push(new hye(t,e.startColumn,i,e.endColumn))}}else this._minimapSelections=this._selections;return this._minimapSelections}getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){const n=this._samplingState.minimapLines[e-1],o=this._samplingState.minimapLines[t-1];i=new dye(n,1,o,this._context.viewModel.getLineMaxColumn(o))}else i=new dye(e,1,t,this._context.viewModel.getLineMaxColumn(t));const n=this._context.viewModel.getDecorationsInViewport(i,!0);if(this._samplingState){const e=[];for(const t of n){if(!t.options.minimap)continue;const i=t.range,n=this._samplingState.modelLineToMinimapLine(i.startLineNumber),o=this._samplingState.modelLineToMinimapLine(i.endLineNumber);e.push(new cIe(new dye(n,i.startColumn,o,i.endColumn),t.options))}return e}return n}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new dye(e,1,e,1),1,0)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},1)}}class ZHe extends Owe{constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(FPe),this._domNode=Ixe(document.createElement("div")),mFe.write(this._domNode,8),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=Ixe(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=Ixe(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=Ixe(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=Ixe(document.createElement("div")),this._slider.setPosition("absolute"),this._slider.setClassName("minimap-slider"),this._slider.setLayerHinting(!0),this._slider.setContain("strict"),this._domNode.appendChild(this._slider),this._sliderHorizontal=Ixe(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._pointerDownListener=iMe(this._domNode.domNode,LMe.POINTER_DOWN,(e=>{if(e.preventDefault(),0===this._model.options.renderMinimap)return;if(!this._lastRenderData)return;if("proportional"!==this._model.options.size){if(0===e.button&&this._lastRenderData){const t=hMe(this._slider.domNode),i=t.top+t.height/2;this._startSliderDragging(e,i,this._lastRenderData.renderedLayout)}return}const t=this._model.options.minimapLineHeight,i=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*e.offsetY;let n=Math.floor(i/t)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;n=Math.min(n,this._model.getLineCount()),this._model.revealLineNumber(n)})),this._sliderPointerMoveMonitor=new sRe,this._sliderPointerDownListener=iMe(this._slider.domNode,LMe.POINTER_DOWN,(e=>{e.preventDefault(),e.stopPropagation(),0===e.button&&this._lastRenderData&&this._startSliderDragging(e,e.pageY,this._lastRenderData.renderedLayout)})),this._gestureDisposable=oRe.addTarget(this._domNode.domNode),this._sliderTouchStartListener=tMe(this._domNode.domNode,nRe.Start,(e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(e))}),{passive:!1}),this._sliderTouchMoveListener=tMe(this._domNode.domNode,nRe.Change,(e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(e)}),{passive:!1}),this._sliderTouchEndListener=iMe(this._domNode.domNode,nRe.End,(e=>{e.preventDefault(),e.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)}))}_startSliderDragging(e,t,i){if(!(e.target&&e.target instanceof Element))return;const n=e.pageX;this._slider.toggleClassName("active",!0);const o=(e,o)=>{const s=hMe(this._domNode.domNode),r=Math.min(Math.abs(o-n),Math.abs(o-s.left),Math.abs(o-s.left-s.width));if(Lve&&r>140)return void this._model.setScrollTop(i.scrollTop);const a=e-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(a))};e.pageY!==t&&o(e.pageY,n),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,(e=>o(e.pageY,e.pageX)),(()=>{this._slider.toggleClassName("active",!1)}))}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return"always"===this._model.options.showSlider?e.push("slider-always"):e.push("slider-mouseover"),this._model.options.autohide&&e.push("autohide"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new qHe(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return!!this._lastRenderData&&this._lastRenderData.onLinesChanged(e,t)}onLinesDeleted(e,t){var i;return null===(i=this._lastRenderData)||void 0===i||i.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var i;return null===(i=this._lastRenderData)||void 0===i||i.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(FPe),this._renderDecorations=!0,!0}onTokensChanged(e){return!!this._lastRenderData&&this._lastRenderData.onTokensChanged(e)}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(0===this._model.options.renderMinimap)return this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),void this._sliderHorizontal.setHeight(0);e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const t=UHe.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(t.sliderNeeded?"block":"none"),this._slider.setTop(t.sliderTop),this._slider.setHeight(t.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(t.sliderHeight),this.renderDecorations(t),this._lastRenderData=this.renderLines(t)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(dye.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort(((e,t)=>(e.options.zIndex||0)-(t.options.zIndex||0)));const{canvasInnerWidth:n,canvasInnerHeight:o}=this._model.options,s=this._model.options.minimapLineHeight,r=this._model.options.minimapCharWidth,a=this._model.getOptions().tabSize,l=this._decorationsCanvas.domNode.getContext("2d");l.clearRect(0,0,n,o);const d=new YHe(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(l,t,d,e,s),this._renderDecorationsLineHighlights(l,i,d,e,s);const h=new YHe(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(l,t,h,e,s,a,r,n),this._renderDecorationsHighlights(l,i,h,e,s,a,r,n)}}_renderSelectionLineHighlights(e,t,i,n,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let s=0,r=0;for(const a of t){const t=n.intersectWithViewport(a);if(!t)continue;const[l,d]=t;for(let e=l;e<=d;e++)i.set(e,!0);const h=n.getYForLineNumber(l,o),c=n.getYForLineNumber(d,o);r>=h||(r>s&&e.fillRect(8,s,e.canvas.width,r-s),s=h),r=c}r>s&&e.fillRect(8,s,e.canvas.width,r-s)}_renderDecorationsLineHighlights(e,t,i,n,o){const s=new Map;for(let r=t.length-1;r>=0;r--){const a=t[r],l=a.options.minimap;if(!l||l.position!==Ake.Inline)continue;const d=n.intersectWithViewport(a.range);if(!d)continue;const[h,c]=d,u=l.getColor(this._theme.value);if(!u||u.isTransparent())continue;let g=s.get(u.toString());g||(g=u.transparent(.5).toString(),s.set(u.toString(),g)),e.fillStyle=g;for(let t=h;t<=c;t++){if(i.has(t))continue;i.set(t,!0);const s=n.getYForLineNumber(h,o);e.fillRect(8,s,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,n,o,s,r,a){if(this._selectionColor&&!this._selectionColor.isTransparent())for(const l of t){const t=n.intersectWithViewport(l);if(!t)continue;const[d,h]=t;for(let t=d;t<=h;t++)this.renderDecorationOnLine(e,i,l,this._selectionColor,n,t,o,o,s,r,a)}}_renderDecorationsHighlights(e,t,i,n,o,s,r,a){for(const l of t){const t=l.options.minimap;if(!t)continue;const d=n.intersectWithViewport(l.range);if(!d)continue;const[h,c]=d,u=t.getColor(this._theme.value);if(u&&!u.isTransparent())for(let d=h;d<=c;d++)switch(t.position){case Ake.Inline:this.renderDecorationOnLine(e,i,l.range,u,n,d,o,o,s,r,a);continue;case Ake.Gutter:{const t=n.getYForLineNumber(d,o),i=2;this.renderDecoration(e,u,i,t,2,o);continue}}}}renderDecorationOnLine(e,t,i,n,o,s,r,a,l,d,h){const c=o.getYForLineNumber(s,a);if(c+r<0||c>this._model.options.canvasInnerHeight)return;const{startLineNumber:u,endLineNumber:g}=i,p=u===s?i.startColumn:1,m=g===s?i.endColumn:this._model.getLineMaxColumn(s),f=this.getXOffsetForPosition(t,s,p,l,d,h),_=this.getXOffsetForPosition(t,s,m,l,d,h);this.renderDecoration(e,n,f,c,_-f,r)}getXOffsetForPosition(e,t,i,n,o,s){if(1===i)return 8;if((i-1)*o>=s)return s;let r=e.get(t);if(!r){const i=this._model.getLineContent(t);r=[8];let a=8;for(let e=1;e<i.length+1;e++){const t=i.charCodeAt(e-1),l=a+(9===t?n*o:ixe(t)?2*o:o);if(l>=s){r[e]=s;break}r[e]=l,a=l}e.set(t,r)}return i-1<r.length?r[i-1]:s}renderDecoration(e,t,i,n,o,s){e.fillStyle=t&&t.toString()||"",e.fillRect(i,n,o,s)}renderLines(e){const t=e.startLineNumber,i=e.endLineNumber,n=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const t=this._lastRenderData._get();return new jHe(e,t.imageData,t.lines)}const o=this._getBuffer();if(!o)return null;const[s,r,a]=ZHe._renderUntouchedLines(o,e.topPaddingLineCount,t,i,n,this._lastRenderData),l=this._model.getMinimapLinesRenderingData(t,i,a),d=this._model.getOptions().tabSize,h=this._model.options.defaultBackgroundColor,c=this._model.options.backgroundColor,u=this._model.options.foregroundAlpha,g=this._model.tokensColorTracker,p=g.backgroundIsLight(),m=this._model.options.renderMinimap,f=this._model.options.charRenderer(),_=this._model.options.fontScale,v=this._model.options.minimapCharWidth,b=(1===m?2:3)*_,w=n>b?Math.floor((n-b)/2):0,C=c.a/255,y=new RHe(Math.round((c.r-h.r)*C+h.r),Math.round((c.g-h.g)*C+h.g),Math.round((c.b-h.b)*C+h.b),255);let S=e.topPaddingLineCount*n;const x=[];for(let e=0,s=i-t+1;e<s;e++)a[e]&&ZHe._renderLine(o,y,c.a,p,m,v,g,u,f,S,w,d,l[e],_,n),x[e]=new KHe(S),S+=n;const k=-1===s?0:s,L=(-1===r?o.height:r)-k;return this._canvas.domNode.getContext("2d").putImageData(o,0,0,0,k,o.width,L),new jHe(e,o,x)}static _renderUntouchedLines(e,t,i,n,o,s){const r=[];if(!s){for(let e=0,t=n-i+1;e<t;e++)r[e]=!0;return[-1,-1,r]}const a=s._get(),l=a.imageData.data,d=a.rendLineNumberStart,h=a.lines,c=h.length,u=e.width,g=e.data,p=(n-i+1)*o*u*4;let m=-1,f=-1,_=-1,v=-1,b=-1,w=-1,C=t*o;for(let e=i;e<=n;e++){const t=e-i,n=e-d,s=n>=0&&n<c?h[n].dy:-1;if(-1===s){r[t]=!0,C+=o;continue}const a=s*u*4,y=(s+o)*u*4,S=C*u*4,x=(C+o)*u*4;v===a&&w===S?(v=y,w=x):(-1!==_&&(g.set(l.subarray(_,v),b),-1===m&&0===_&&_===b&&(m=v),-1===f&&v===p&&_===b&&(f=_)),_=a,v=y,b=S,w=x),r[t]=!1,C+=o}return-1!==_&&(g.set(l.subarray(_,v),b),-1===m&&0===_&&_===b&&(m=v),-1===f&&v===p&&_===b&&(f=_)),[-1===m?-1:m/(4*u),-1===f?-1:f/(4*u),r]}static _renderLine(e,t,i,n,o,s,r,a,l,d,h,c,u,g,p){const m=u.content,f=u.tokens,_=e.width-s,v=1===p;let b=8,w=0,C=0;for(let u=0,p=f.getCount();u<p;u++){const p=f.getEndOffset(u),y=f.getForeground(u),S=r.getColor(y);for(;w<p;w++){if(b>_)return;const r=m.charCodeAt(w);if(9===r){const e=c-(w+C)%c;C+=e-1,b+=e*s}else if(32===r)b+=s;else{const c=ixe(r)?2:1;for(let u=0;u<c;u++)if(2===o?l.blockRenderChar(e,b,d+h,S,a,t,i,v):l.renderChar(e,b,d+h,r,S,a,t,i,g,n,v),b+=s,b>_)return}}}}}class YHe{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let e=0,t=this._endLineNumber-this._startLineNumber+1;e<t;e++)this._values[e]=i}has(e){return this.get(e)!==this._defaultValue}set(e,t){e<this._startLineNumber||e>this._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return e<this._startLineNumber||e>this._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}var QHe=i(7147),XHe={};XHe.styleTagTransform=zl(),XHe.setAttributes=Bl(),XHe.insert=Pl().bind(null,"head"),XHe.domAPI=Rl(),XHe.insertStyleElement=Vl(),Ml()(QHe.A,XHe),QHe.A&&QHe.A.locals&&QHe.A.locals;class JHe extends pFe{constructor(e){super(e);const t=this._context.configuration.options.get(138);this._widgets={},this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,this._domNode=Ixe(document.createElement("div")),mFe.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options.get(138);return this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,!0}addWidget(e){const t=Ixe(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),this.setShouldRender()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference!==t&&(i.preference=t,this.setShouldRender(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.parentNode.removeChild(e),this.setShouldRender()}}_renderWidget(e){const t=e.domNode;if(null!==e.preference)if(0===e.preference)t.setTop(0),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth);else if(1===e.preference){const e=t.domNode.clientHeight;t.setTop(this._editorHeight-e-2*this._horizontalScrollbarHeight),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth)}else 2===e.preference&&(t.setTop(0),t.domNode.style.right="50%");else t.setTop("")}prepareRender(e){}render(e){this._domNode.setWidth(this._editorWidth);const t=Object.keys(this._widgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];this._renderWidget(this._widgets[i])}}}class eze{constructor(e,t){const i=e.options;this.lineHeight=i.get(63),this.pixelRatio=i.get(136),this.overviewRulerLanes=i.get(79),this.renderBorder=i.get(78);const n=t.getColor(nWe);this.borderColor=n?n.toString():null,this.hideCursor=i.get(56);const o=t.getColor(ZBe);this.cursorColor=o?o.transparent(.7).toString():null,this.themeType=t.type;const s=i.get(69),r=s.enabled,a=s.side,l=t.getColor(oWe),d=Eye.getDefaultBackground();this.backgroundColor=l||(r&&"right"===a?d:null);const h=i.get(138).overviewRuler;this.top=h.top,this.right=h.right,this.domWidth=h.width,this.domHeight=h.height,0===this.overviewRulerLanes?(this.canvasWidth=0,this.canvasHeight=0):(this.canvasWidth=this.domWidth*this.pixelRatio|0,this.canvasHeight=this.domHeight*this.pixelRatio|0);const[c,u]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=c,this.w=u}_initLanes(e,t,i){const n=t-e;if(i>=3){const t=Math.floor(n/3),i=Math.floor(n/3),o=n-t-i,s=e+t;return[[0,e,s,e,e+t+o,e,s,e],[0,t,o,t+o,i,t+o+i,o+i,t+o+i]]}if(2===i){const t=Math.floor(n/2),i=n-t;return[[0,e,e,e,e+t,e,e,e],[0,t,t,t,i,t+i,t+i,t+i]]}return[[0,e,e,e,e,e,e,e],[0,n,n,n,n,n,n,n]]}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColor===e.cursorColor&&this.themeType===e.themeType&&hRe.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}class tze extends pFe{constructor(e){super(e),this._domNode=Ixe(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=Eye.onDidChange((e=>{e.changedColorMap&&this._updateSettings(!0)})),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new eze(this._context.configuration,this._context.theme);return!(this._settings&&this._settings.equals(t)||(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),0))}onConfigurationChanged(e){return this._updateSettings(!1)}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t<i;t++)this._cursorPositions[t]=e.selections[t].getPosition();return this._cursorPositions.sort(lye.compare),!0}onDecorationsChanged(e){return!!e.affectsOverviewRuler}onFlushed(e){return!0}onScrollChanged(e){return e.scrollHeightChanged}onZonesChanged(e){return!0}onThemeChanged(e){return this._updateSettings(!1)}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render()}_render(){const e=this._settings.backgroundColor;if(0===this._settings.overviewRulerLanes)return this._domNode.setBackgroundColor(e?hRe.Format.CSS.formatHexA(e):""),void this._domNode.setDisplay("none");this._domNode.setDisplay("block");const t=this._settings.canvasWidth,i=this._settings.canvasHeight,n=this._settings.lineHeight,o=this._context.viewLayout,s=i/this._context.viewLayout.getScrollHeight(),r=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme),a=6*this._settings.pixelRatio|0,l=a/2|0,d=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(d.fillStyle=hRe.Format.CSS.formatHexA(e),d.fillRect(0,0,t,i)):(d.clearRect(0,0,t,i),d.fillStyle=hRe.Format.CSS.formatHexA(e),d.fillRect(0,0,t,i)):d.clearRect(0,0,t,i);const h=this._settings.x,c=this._settings.w;r.sort(uIe.cmp);for(const e of r){const t=e.color,r=e.data;d.fillStyle=t;let u=0,g=0,p=0;for(let e=0,t=r.length/3;e<t;e++){const t=r[3*e],m=r[3*e+1],f=r[3*e+2];let _=o.getVerticalOffsetForLineNumber(m)*s|0,v=(o.getVerticalOffsetForLineNumber(f)+n)*s|0;if(v-_<a){let e=(_+v)/2|0;e<l?e=l:e+l>i&&(e=i-l),_=e-l,v=e+l}_>p+1||t!==u?(0!==e&&d.fillRect(h[u],g,c[u],p-g),u=t,g=_,p=v):v>p&&(p=v)}d.fillRect(h[u],g,c[u],p-g)}if(!this._settings.hideCursor&&this._settings.cursorColor){const e=2*this._settings.pixelRatio|0,t=e/2|0,n=this._settings.x[7],r=this._settings.w[7];d.fillStyle=this._settings.cursorColor;let a=-100,l=-100;for(let h=0,c=this._cursorPositions.length;h<c;h++){const c=this._cursorPositions[h];let u=o.getVerticalOffsetForLineNumber(c.lineNumber)*s|0;u<t?u=t:u+t>i&&(u=i-t);const g=u-t,p=g+e;g>l+1?(0!==h&&d.fillRect(n,a,r,l-a),a=g,l=p):p>l&&(l=p)}d.fillRect(n,a,r,l-a)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(d.beginPath(),d.lineWidth=1,d.strokeStyle=this._settings.borderColor,d.moveTo(0,0),d.lineTo(0,i),d.stroke(),d.moveTo(0,0),d.lineTo(t,0),d.stroke())}}class ize{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=0|e,this.to=0|t,this.colorId=0|i}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class nze{constructor(e,t,i,n){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=n,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber:e.color<t.color?-1:1}setColorZone(e){this._colorZone=e}getColorZones(){return this._colorZone}}class oze{constructor(e){this._getVerticalOffsetForLine=e,this._zones=[],this._colorZonesInvalid=!1,this._lineHeight=0,this._domWidth=0,this._domHeight=0,this._outerHeight=0,this._pixelRatio=1,this._lastAssignedId=0,this._color2Id=Object.create(null),this._id2Color=[]}getId2Color(){return this._id2Color}setZones(e){this._zones=e,this._zones.sort(nze.compare)}setLineHeight(e){return this._lineHeight!==e&&(this._lineHeight=e,this._colorZonesInvalid=!0,!0)}setPixelRatio(e){this._pixelRatio=e,this._colorZonesInvalid=!0}getDOMWidth(){return this._domWidth}getCanvasWidth(){return this._domWidth*this._pixelRatio}setDOMWidth(e){return this._domWidth!==e&&(this._domWidth=e,this._colorZonesInvalid=!0,!0)}getDOMHeight(){return this._domHeight}getCanvasHeight(){return this._domHeight*this._pixelRatio}setDOMHeight(e){return this._domHeight!==e&&(this._domHeight=e,this._colorZonesInvalid=!0,!0)}getOuterHeight(){return this._outerHeight}setOuterHeight(e){return this._outerHeight!==e&&(this._outerHeight=e,this._colorZonesInvalid=!0,!0)}resolveColorZones(){const e=this._colorZonesInvalid,t=Math.floor(this._lineHeight),i=Math.floor(this.getCanvasHeight()),n=i/Math.floor(this._outerHeight),o=Math.floor(4*this._pixelRatio/2),s=[];for(let r=0,a=this._zones.length;r<a;r++){const a=this._zones[r];if(!e){const e=a.getColorZones();if(e){s.push(e);continue}}const l=this._getVerticalOffsetForLine(a.startLineNumber),d=0===a.heightInLines?this._getVerticalOffsetForLine(a.endLineNumber)+t:l+a.heightInLines*t,h=Math.floor(n*l),c=Math.floor(n*d);let u=Math.floor((h+c)/2),g=c-u;g<o&&(g=o),u-g<0&&(u=g),u+g>i&&(u=i-g);const p=a.color;let m=this._color2Id[p];m||(m=++this._lastAssignedId,this._color2Id[p]=m,this._id2Color[m]=p);const f=new ize(u-g,u+g,m);a.setColorZone(f),s.push(f)}return this._colorZonesInvalid=!1,s.sort(ize.compare),s}}class sze extends gFe{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=Ixe(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new oze((e=>this._context.viewLayout.getVerticalOffsetForLineNumber(e))),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(63)),this._zoneManager.setPixelRatio(i.get(136)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(63)&&(this._zoneManager.setLineHeight(t.get(63)),this._render()),e.hasChanged(136)&&(this._zoneManager.setPixelRatio(t.get(136)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(0===this._zoneManager.getOuterHeight())return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),n=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,n,e),!0}_renderOneLane(e,t,i,n){let o=0,s=0,r=0;for(const a of t){const t=a.colorId,l=a.from,d=a.to;t!==o?(e.fillRect(0,s,n,r-s),o=t,e.fillStyle=i[o],s=l,r=d):r>=l?r=Math.max(r,d):(e.fillRect(0,s,n,r-s),s=l,r=d)}e.fillRect(0,s,n,r-s)}}var rze=i(4747),aze={};aze.styleTagTransform=zl(),aze.setAttributes=Bl(),aze.insert=Pl().bind(null,"head"),aze.domAPI=Rl(),aze.insertStyleElement=Vl(),Ml()(rze.A,aze),rze.A&&rze.A.locals&&rze.A.locals;class lze extends pFe{constructor(e){super(e),this.domNode=Ixe(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(96),this._typicalHalfwidthCharacterWidth=t.get(47).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(96),this._typicalHalfwidthCharacterWidth=t.get(47).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e<t){const{tabSize:i}=this._context.viewModel.model.getOptions(),n=i;let o=t-e;for(;o>0;){const e=Ixe(document.createElement("div"));e.setClassName("view-ruler"),e.setWidth(n),this.domNode.appendChild(e),this._renderedRulers.push(e),o--}return}let i=e-t;for(;i>0;){const e=this._renderedRulers.pop();this.domNode.removeChild(e),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t<i;t++){const i=this._renderedRulers[t],n=this._rulers[t];i.setBoxShadow(n.color?`1px 0 0 0 ${n.color} inset`:""),i.setHeight(Math.min(e.scrollHeight,1e6)),i.setLeft(n.column*this._typicalHalfwidthCharacterWidth)}}}var dze=i(6851),hze={};hze.styleTagTransform=zl(),hze.setAttributes=Bl(),hze.insert=Pl().bind(null,"head"),hze.domAPI=Rl(),hze.insertStyleElement=Vl(),Ml()(dze.A,hze),dze.A&&dze.A.locals&&dze.A.locals;class cze extends pFe{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;const t=this._context.configuration.options.get(97);this._useShadows=t.useShadows,this._domNode=Ixe(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true")}dispose(){super.dispose()}_updateShouldShow(){const e=this._useShadows&&this._scrollTop>0;return this._shouldShow!==e&&(this._shouldShow=e,!0)}getDomNode(){return this._domNode}_updateWidth(){const e=this._context.configuration.options.get(138);0===e.minimap.renderMinimap||e.minimap.minimapWidth>0&&0===e.minimap.minimapLeft?this._width=e.width:this._width=e.width-e.verticalScrollbarWidth}onConfigurationChanged(e){const t=this._context.configuration.options.get(97);return this._useShadows=t.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}var uze=i(9507),gze={};gze.styleTagTransform=zl(),gze.setAttributes=Bl(),gze.insert=Pl().bind(null,"head"),gze.domAPI=Rl(),gze.insertStyleElement=Vl(),Ml()(uze.A,gze),uze.A&&uze.A.locals&&uze.A.locals;class pze{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class mze{constructor(e,t){this.lineNumber=e,this.ranges=t}}function fze(e){return new pze(e)}function _ze(e){return new mze(e.lineNumber,e.ranges.map(fze))}class vze extends WBe{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(63),this._roundedSelection=t.get(95),this._typicalHalfwidthCharacterWidth=t.get(47).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(63),this._roundedSelection=t.get(95),this._typicalHalfwidthCharacterWidth=t.get(47).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t<i;t++)if(e[t].ranges.length>1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){const n=this._typicalHalfwidthCharacterWidth/4;let o=null,s=null;if(i&&i.length>0&&t.length>0){const n=t[0].lineNumber;if(n===e.startLineNumber)for(let e=0;!o&&e<i.length;e++)i[e].lineNumber===n&&(o=i[e].ranges[0]);const r=t[t.length-1].lineNumber;if(r===e.endLineNumber)for(let e=i.length-1;!s&&e>=0;e--)i[e].lineNumber===r&&(s=i[e].ranges[0]);o&&!o.startStyle&&(o=null),s&&!s.startStyle&&(s=null)}for(let e=0,i=t.length;e<i;e++){const r=t[e].ranges[0],a=r.left,l=r.left+r.width,d={top:0,bottom:0},h={top:0,bottom:0};if(e>0){const i=t[e-1].ranges[0].left,o=t[e-1].ranges[0].left+t[e-1].ranges[0].width;bze(a-i)<n?d.top=2:a>i&&(d.top=1),bze(l-o)<n?h.top=2:i<l&&l<o&&(h.top=1)}else o&&(d.top=o.startStyle.top,h.top=o.endStyle.top);if(e+1<i){const i=t[e+1].ranges[0].left,o=t[e+1].ranges[0].left+t[e+1].ranges[0].width;bze(a-i)<n?d.bottom=2:i<a&&a<o&&(d.bottom=1),bze(l-o)<n?h.bottom=2:l<o&&(h.bottom=1)}else s&&(d.bottom=s.startStyle.bottom,h.bottom=s.endStyle.bottom);r.startStyle=d,r.endStyle=h}}_getVisibleRangesWithStyle(e,t,i){const n=(t.linesVisibleRangesForRange(e,!0)||[]).map(_ze);return!this._visibleRangesHaveGaps(n)&&this._roundedSelection&&this._enrichVisibleRangesWithStyle(t.visibleRange,n,i),n}_createSelectionPiece(e,t,i,n,o){return'<div class="cslr '+i+'" style="top:'+e.toString()+"px;left:"+n.toString()+"px;width:"+o.toString()+"px;height:"+t+'px;"></div>'}_actualRenderOneSelection(e,t,i,n){if(0===n.length)return;const o=!!n[0].ranges[0].startStyle,s=this._lineHeight.toString(),r=(this._lineHeight-1).toString(),a=n[0].lineNumber,l=n[n.length-1].lineNumber;for(let d=0,h=n.length;d<h;d++){const h=n[d],c=h.lineNumber,u=c-t,g=!i||c!==l&&c!==a?s:r,p=i&&c===a?1:0;let m="",f="";for(let e=0,t=h.ranges.length;e<t;e++){const t=h.ranges[e];if(o){const e=t.startStyle,i=t.endStyle;if(1===e.top||1===e.bottom){m+=this._createSelectionPiece(p,g,vze.SELECTION_CLASS_NAME,t.left-vze.ROUNDED_PIECE_WIDTH,vze.ROUNDED_PIECE_WIDTH);let i=vze.EDITOR_BACKGROUND_CLASS_NAME;1===e.top&&(i+=" "+vze.SELECTION_TOP_RIGHT),1===e.bottom&&(i+=" "+vze.SELECTION_BOTTOM_RIGHT),m+=this._createSelectionPiece(p,g,i,t.left-vze.ROUNDED_PIECE_WIDTH,vze.ROUNDED_PIECE_WIDTH)}if(1===i.top||1===i.bottom){m+=this._createSelectionPiece(p,g,vze.SELECTION_CLASS_NAME,t.left+t.width,vze.ROUNDED_PIECE_WIDTH);let e=vze.EDITOR_BACKGROUND_CLASS_NAME;1===i.top&&(e+=" "+vze.SELECTION_TOP_LEFT),1===i.bottom&&(e+=" "+vze.SELECTION_BOTTOM_LEFT),m+=this._createSelectionPiece(p,g,e,t.left+t.width,vze.ROUNDED_PIECE_WIDTH)}}let i=vze.SELECTION_CLASS_NAME;if(o){const e=t.startStyle,n=t.endStyle;0===e.top&&(i+=" "+vze.SELECTION_TOP_LEFT),0===e.bottom&&(i+=" "+vze.SELECTION_BOTTOM_LEFT),0===n.top&&(i+=" "+vze.SELECTION_TOP_RIGHT),0===n.bottom&&(i+=" "+vze.SELECTION_BOTTOM_RIGHT)}f+=this._createSelectionPiece(p,g,i,t.left,t.width)}e[u][0]+=m,e[u][1]+=f}}prepareRender(e){const t=[],i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber;for(let e=i;e<=n;e++)t[e-i]=["",""];const o=[];for(let n=0,s=this._selections.length;n<s;n++){const s=this._selections[n];if(s.isEmpty()){o[n]=null;continue}const r=this._getVisibleRangesWithStyle(s,e,this._previousFrameVisibleRangesWithStyle[n]);o[n]=r,this._actualRenderOneSelection(t,i,this._selections.length>1,r)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map((([e,t])=>e+t))}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function bze(e){return e<0?-e:e}vze.SELECTION_CLASS_NAME="selected-text",vze.SELECTION_TOP_LEFT="top-left-radius",vze.SELECTION_BOTTOM_LEFT="bottom-left-radius",vze.SELECTION_TOP_RIGHT="top-right-radius",vze.SELECTION_BOTTOM_RIGHT="bottom-right-radius",vze.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",vze.ROUNDED_PIECE_WIDTH=10,jBe(((e,t)=>{const i=e.getColor(xOe);i&&!i.isTransparent()&&t.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${i}; }`)}));var wze=i(9575),Cze={};Cze.styleTagTransform=zl(),Cze.setAttributes=Bl(),Cze.insert=Pl().bind(null,"head"),Cze.domAPI=Rl(),Cze.insertStyleElement=Vl(),Ml()(wze.A,Cze),wze.A&&wze.A.locals&&wze.A.locals;class yze{constructor(e,t,i,n,o,s,r){this.top=e,this.left=t,this.paddingLeft=i,this.width=n,this.height=o,this.textContent=s,this.textContentClassName=r}}class Sze{constructor(e){this._context=e;const t=this._context.configuration.options,i=t.get(47);this._cursorStyle=t.get(25),this._lineHeight=t.get(63),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(28),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=Ixe(document.createElement("div")),this._domNode.setClassName(`cursor ${OWe}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Txe(this._domNode,i),this._domNode.setDisplay("none"),this._position=new lye(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(47);return this._cursorStyle=t.get(25),this._lineHeight=t.get(63),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(28),this._typicalHalfwidthCharacterWidth),Txe(this._domNode,i),!0}onCursorPositionChanged(e,t){return this._domNode.domNode.style.transitionProperty=t?"none":"",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[n,o]=function(e,t){t>0&&USe(e.charCodeAt(t))&&t--;const i=t+GSe(e,t);return[i-ZSe(e,i),i]}(i,t-1);return[new lye(e,n+1),i.substring(n,o)]}_prepareRender(e){let t="",i="";const[n,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===Jbe.Line||this._cursorStyle===Jbe.LineThin){const s=e.visibleRangeForPosition(n);if(!s||s.outsideRenderedLine)return null;let r;this._cursorStyle===Jbe.Line?(r=BMe(this._lineCursorWidth>0?this._lineCursorWidth:2),r>2&&(t=o,i=this._getTokenClassName(n))):r=BMe(1);let a=s.left,l=0;r>=2&&a>=1&&(l=1,a-=l);const d=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta;return new yze(d,a,l,r,this._lineHeight,t,i)}const s=e.linesVisibleRangesForRange(new dye(n.lineNumber,n.column,n.lineNumber,n.column+o.length),!1);if(!s||0===s.length)return null;const r=s[0];if(r.outsideRenderedLine||0===r.ranges.length)return null;const a=r.ranges[0],l="\t"===o||a.width<1?this._typicalHalfwidthCharacterWidth:a.width;this._cursorStyle===Jbe.Block&&(t=o,i=this._getTokenClassName(n));let d=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta,h=this._lineHeight;return this._cursorStyle!==Jbe.Underline&&this._cursorStyle!==Jbe.UnderlineThin||(d+=this._lineHeight-2,h=2),new yze(d,a.left,0,l,h,t,i)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),i=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(i)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${OWe} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}class xze extends pFe{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(86),this._cursorBlinking=t.get(23),this._cursorStyle=t.get(25),this._cursorSmoothCaretAnimation=t.get(24),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new Sze(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=Ixe(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new ODe,this._cursorFlatBlinkInterval=new PDe,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(86),this._cursorBlinking=t.get(23),this._cursorStyle=t.get(25),this._cursorSmoothCaretAnimation=t.get(24),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let t=0,i=this._secondaryCursors.length;t<i;t++)this._secondaryCursors[t].onConfigurationChanged(e);return!0}_onCursorPositionChanged(e,t,i){const n=this._secondaryCursors.length!==t.length||"explicit"===this._cursorSmoothCaretAnimation&&3!==i;if(this._primaryCursor.onCursorPositionChanged(e,n),this._updateBlinking(),this._secondaryCursors.length<t.length){const e=t.length-this._secondaryCursors.length;for(let t=0;t<e;t++){const e=new Sze(this._context);this._domNode.domNode.insertBefore(e.getDomNode().domNode,this._primaryCursor.getDomNode().domNode.nextSibling),this._secondaryCursors.push(e)}}else if(this._secondaryCursors.length>t.length){const e=this._secondaryCursors.length-t.length;for(let t=0;t<e;t++)this._domNode.removeChild(this._secondaryCursors[0].getDomNode()),this._secondaryCursors.splice(0,1)}for(let e=0;e<t.length;e++)this._secondaryCursors[e].onCursorPositionChanged(t[e],n)}onCursorStateChanged(e){const t=[];for(let i=0,n=e.selections.length;i<n;i++)t[i]=e.selections[i].getPosition();this._onCursorPositionChanged(t[0],t.slice(1),e.reason);const i=e.selections[0].isEmpty();return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,this._updateDomClassName()),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onFocusChanged(e){return this._editorHasFocus=e.isFocused,this._updateBlinking(),!1}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return!0}onTokensChanged(e){const t=t=>{for(let i=0,n=e.ranges.length;i<n;i++)if(e.ranges[i].fromLineNumber<=t.lineNumber&&t.lineNumber<=e.ranges[i].toLineNumber)return!0;return!1};if(t(this._primaryCursor.getPosition()))return!0;for(const e of this._secondaryCursors)if(t(e.getPosition()))return!0;return!1}onZonesChanged(e){return!0}_getCursorBlinking(){return this._isComposingInput?0:this._editorHasFocus?this._readOnly?5:this._cursorBlinking:0}_updateBlinking(){this._startCursorBlinkAnimation.cancel(),this._cursorFlatBlinkInterval.cancel();const e=this._getCursorBlinking(),t=0===e,i=5===e;t?this._hide():this._show(),this._blinkingEnabled=!1,this._updateDomClassName(),t||i||(1===e?this._cursorFlatBlinkInterval.cancelAndSet((()=>{this._isVisible?this._hide():this._show()}),xze.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet((()=>{this._blinkingEnabled=!0,this._updateDomClassName()}),xze.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case Jbe.Line:e+=" cursor-line-style";break;case Jbe.Block:e+=" cursor-block-style";break;case Jbe.Underline:e+=" cursor-underline-style";break;case Jbe.LineThin:e+=" cursor-line-thin-style";break;case Jbe.BlockOutline:e+=" cursor-block-outline-style";break;case Jbe.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return"on"!==this._cursorSmoothCaretAnimation&&"explicit"!==this._cursorSmoothCaretAnimation||(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].show();this._isVisible=!0}_hide(){this._primaryCursor.hide();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].hide();this._isVisible=!1}prepareRender(e){this._primaryCursor.prepareRender(e);for(let t=0,i=this._secondaryCursors.length;t<i;t++)this._secondaryCursors[t].prepareRender(e)}render(e){const t=[];let i=0;const n=this._primaryCursor.render(e);n&&(t[i++]=n);for(let n=0,o=this._secondaryCursors.length;n<o;n++){const o=this._secondaryCursors[n].render(e);o&&(t[i++]=o)}this._renderData=t}getLastRenderData(){return this._renderData}}xze.BLINK_INTERVAL=500,jBe(((e,t)=>{const i=e.getColor(ZBe);if(i){let n=e.getColor(YBe);n||(n=i.opposite()),t.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${i}; border-color: ${i}; color: ${n}; }`),kFe(e.type)&&t.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${n}; border-right: 1px solid ${n}; }`)}}));const kze=()=>{throw new Error("Invalid change accessor")};class Lze extends pFe{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(138);this._lineHeight=t.get(63),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=Ixe(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=Ixe(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const i of e)t.set(i.id,i);let i=!1;return this._context.viewModel.changeWhitespace((e=>{const n=Object.keys(this._zones);for(let o=0,s=n.length;o<s;o++){const s=n[o],r=this._zones[s],a=this._computeWhitespaceProps(r.delegate);r.isInHiddenArea=a.isInHiddenArea;const l=t.get(s);!l||l.afterLineNumber===a.afterViewLineNumber&&l.height===a.heightInPx||(e.changeOneWhitespace(s,a.afterViewLineNumber,a.heightInPx),this._safeCallOnComputedHeight(r.delegate,a.heightInPx),i=!0)}})),i}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(138);return this._lineHeight=t.get(63),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,e.hasChanged(63)&&this._recomputeWhitespacesProps(),!0}onLineMappingChanged(e){return this._recomputeWhitespacesProps()}onLinesDeleted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}onLinesInserted(e){return!0}_getZoneOrdinal(e){return void 0!==e.afterColumn?e.afterColumn:1e4}_computeWhitespaceProps(e){if(0===e.afterLineNumber)return{isInHiddenArea:!1,afterViewLineNumber:0,heightInPx:this._heightInPixels(e),minWidthInPx:this._minWidthInPixels(e)};let t,i;if(void 0!==e.afterColumn)t=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:e.afterColumn});else{const i=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:1}).lineNumber;t=new lye(i,this._context.viewModel.model.getLineMaxColumn(i))}i=t.column===this._context.viewModel.model.getLineMaxColumn(t.lineNumber)?this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber+1,column:1}):this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber,column:t.column+1});const n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t,e.afterColumnAffinity),o=this._context.viewModel.coordinatesConverter.modelPositionIsVisible(i);return{isInHiddenArea:!o,afterViewLineNumber:n.lineNumber,heightInPx:o?this._heightInPixels(e):0,minWidthInPx:this._minWidthInPixels(e)}}changeViewZones(e){let t=!1;return this._context.viewModel.changeWhitespace((i=>{const n={addZone:e=>(t=!0,this._addZone(i,e)),removeZone:e=>{e&&(t=this._removeZone(i,e)||t)},layoutZone:e=>{e&&(t=this._layoutZone(i,e)||t)}};!function(e,t){try{return e(t)}catch(e){wwe(e)}}(e,n),n.addZone=kze,n.removeZone=kze,n.layoutZone=kze})),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),n={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:Ixe(t.domNode),marginDomNode:t.marginDomNode?Ixe(t.marginDomNode):null};return this._safeCallOnComputedHeight(n.delegate,i.heightInPx),n.domNode.setPosition("absolute"),n.domNode.domNode.style.width="100%",n.domNode.setDisplay("none"),n.domNode.setAttribute("monaco-view-zone",n.whitespaceId),this.domNode.appendChild(n.domNode),n.marginDomNode&&(n.marginDomNode.setPosition("absolute"),n.marginDomNode.domNode.style.width="100%",n.marginDomNode.setDisplay("none"),n.marginDomNode.setAttribute("monaco-view-zone",n.whitespaceId),this.marginDomNode.appendChild(n.marginDomNode)),this._zones[n.whitespaceId]=n,this.setShouldRender(),n.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],n=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=n.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,n.afterViewLineNumber,n.heightInPx),this._safeCallOnComputedHeight(i.delegate,n.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){if(this._zones.hasOwnProperty(e)){const t=this._zones[e];return Boolean(t.delegate.suppressMouseDown)}return!1}_heightInPixels(e){return"number"==typeof e.heightInPx?e.heightInPx:"number"==typeof e.heightInLines?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return"number"==typeof e.minWidthInPx?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if("function"==typeof e.onComputedHeight)try{e.onComputedHeight(t)}catch(e){wwe(e)}}_safeCallOnDomNodeTop(e,t){if("function"==typeof e.onDomNodeTop)try{e.onDomNodeTop(t)}catch(e){wwe(e)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(const e of t)this._zones[e.id].isInHiddenArea||(i[e.id]=e,n=!0);const o=Object.keys(this._zones);for(let t=0,n=o.length;t<n;t++){const n=o[t],s=this._zones[n];let r=0,a=0,l="none";i.hasOwnProperty(n)?(r=i[n].verticalOffset-e.bigNumbersDelta,a=i[n].height,l="block",s.isVisible||(s.domNode.setAttribute("monaco-visible-view-zone","true"),s.isVisible=!0),this._safeCallOnDomNodeTop(s.delegate,e.getScrolledTopFromAbsoluteTop(i[n].verticalOffset))):(s.isVisible&&(s.domNode.removeAttribute("monaco-visible-view-zone"),s.isVisible=!1),this._safeCallOnDomNodeTop(s.delegate,e.getScrolledTopFromAbsoluteTop(-1e6))),s.domNode.setTop(r),s.domNode.setHeight(a),s.domNode.setDisplay(l),s.marginDomNode&&(s.marginDomNode.setTop(r),s.marginDomNode.setHeight(a),s.marginDomNode.setDisplay(l))}n&&(this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth)),this.marginDomNode.setWidth(this._contentLeft))}}class Dze{get type(){return this._theme.type}get value(){return this._theme}constructor(e){this._theme=e}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class Eze{constructor(e,t,i){this.configuration=e,this.theme=new Dze(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}class Nze{constructor(e,t,i,n){this.selections=e,this.startLineNumber=0|t.startLineNumber,this.endLineNumber=0|t.endLineNumber,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=0|t.bigNumbersDelta,this.whitespaceViewportData=i,this._model=n,this.visibleRange=new dye(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewportViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}var Ize=i(7161),Tze={};Tze.styleTagTransform=zl(),Tze.setAttributes=Bl(),Tze.insert=Pl().bind(null,"head"),Tze.domAPI=Rl(),Tze.insertStyleElement=Vl(),Ml()(Ize.A,Tze),Ize.A&&Ize.A.locals&&Ize.A.locals;class Mze extends pFe{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.domNode=Ixe(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("blockDecorations-container"),this.update()}update(){let e=!1;const t=this._context.configuration.options.get(138),i=t.contentWidth-t.verticalScrollbarWidth;return this.contentWidth!==i&&(this.contentWidth=i,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){let t=0;const i=e.getDecorationsInViewport();for(const n of i){if(!n.options.blockClassName)continue;let i,o,s=this.blocks[t];s||(s=this.blocks[t]=Ixe(document.createElement("div")),this.domNode.appendChild(s)),n.options.blockIsAfterEnd?(i=e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!1),o=e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!0)):(i=e.getVerticalOffsetForLineNumber(n.range.startLineNumber,!0),o=n.range.isEmpty()?e.getVerticalOffsetForLineNumber(n.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!0)),s.setClassName("blockDecorations-block "+n.options.blockClassName),s.setLeft(e.scrollLeft),s.setWidth(this.contentWidth),s.setTop(i),s.setHeight(o-i),t++}for(let e=t;e<this.blocks.length;e++)this.blocks[e].domNode.remove();this.blocks.length=t}}var Aze=i(299),Rze={};Rze.styleTagTransform=zl(),Rze.setAttributes=Bl(),Rze.insert=Pl().bind(null,"head"),Rze.domAPI=Rl(),Rze.insertStyleElement=Vl(),Ml()(Aze.A,Rze),Aze.A&&Aze.A.locals&&Aze.A.locals;class Oze extends WBe{constructor(e){super(),this._context=e,this._options=new Pze(this._context.configuration),this._selection=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=new Pze(this._context.configuration);return this._options.equals(t)?e.hasChanged(138):(this._options=t,!0)}onCursorStateChanged(e){return this._selection=e.selections,"selection"===this._options.renderWhitespace}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}prepareRender(e){if("none"===this._options.renderWhitespace)return void(this._renderResult=null);const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber-t+1,n=new Array(i);for(let e=0;e<i;e++)n[e]=!0;const o=this._context.viewModel.getMinimapLinesRenderingData(e.viewportData.startLineNumber,e.viewportData.endLineNumber,n);this._renderResult=[];for(let t=e.viewportData.startLineNumber;t<=e.viewportData.endLineNumber;t++){const i=t-e.viewportData.startLineNumber,n=o.data[i];let s=null;if("selection"===this._options.renderWhitespace){const e=this._selection;for(const i of e){if(i.endLineNumber<t||i.startLineNumber>t)continue;const e=i.startLineNumber===t?i.startColumn:n.minColumn,o=i.endLineNumber===t?i.endColumn:n.maxColumn;e<o&&(s||(s=[]),s.push(new GNe(e-1,o-1)))}}this._renderResult[i]=this._applyRenderWhitespace(e,t,s,n)}}_applyRenderWhitespace(e,t,i,n){if("selection"===this._options.renderWhitespace&&!i)return"";if("trailing"===this._options.renderWhitespace&&n.continuesWithWrappedLine)return"";const o=this._context.theme.getColor(QBe),s=this._options.renderWithSVG,r=n.content,a=-1===this._options.stopRenderingLineAfter?r.length:Math.min(this._options.stopRenderingLineAfter,r.length),l=n.continuesWithWrappedLine,d=n.minColumn-1,h="boundary"===this._options.renderWhitespace,c="trailing"===this._options.renderWhitespace,u=this._options.lineHeight,g=this._options.middotWidth,p=this._options.wsmiddotWidth,m=this._options.spaceWidth,f=Math.abs(p-m)<Math.abs(g-m)?11825:183,_=this._options.canUseHalfwidthRightwardsArrow;let v,b="",w=!1,C=ESe(r);-1===C?(w=!0,C=a,v=a):v=ISe(r);let y=0,S=i&&i[y],x=0;for(let n=d;n<a;n++){const o=r.charCodeAt(n);if(S&&n>=S.endOffset&&(y++,S=i&&i[y]),9!==o&&32!==o)continue;if(c&&!w&&n<=v)continue;if(h&&n>=C&&n<=v&&32===o){const e=n-1>=0?r.charCodeAt(n-1):0,t=n+1<a?r.charCodeAt(n+1):0;if(32!==e&&32!==t)continue}if(h&&l&&n===a-1){const e=n-1>=0?r.charCodeAt(n-1):0;if(32===o&&32!==e&&9!==e)continue}if(i&&(!S||S.startOffset>n||S.endOffset<=n))continue;const d=e.visibleRangeForPosition(new lye(t,n+1));d&&(s?(x=Math.max(x,d.left),b+=9===o?this._renderArrow(u,m,d.left):`<circle cx="${(d.left+m/2).toFixed(2)}" cy="${(u/2).toFixed(2)}" r="${(m/7).toFixed(2)}" />`):b+=9===o?`<div class="mwh" style="left:${d.left}px;height:${u}px;">${_?String.fromCharCode(65515):String.fromCharCode(8594)}</div>`:`<div class="mwh" style="left:${d.left}px;height:${u}px;">${String.fromCharCode(f)}</div>`)}return s?(x=Math.round(x+m),`<svg style="position:absolute;width:${x}px;height:${u}px" viewBox="0 0 ${x} ${u}" xmlns="http://www.w3.org/2000/svg" fill="${o}">`+b+"</svg>"):b}_renderArrow(e,t,i){const n=e/2,o=i,s={x:0,y:t/7/2},r={x:.8*t,y:s.y},a={x:r.x-.2*r.x,y:r.y+.2*r.x},l={x:a.x+.1*r.x,y:a.y+.1*r.x},d={x:l.x+.35*r.x,y:l.y-.35*r.x};return`<path d="M ${[s,r,a,l,d,{x:d.x,y:-d.y},{x:l.x,y:-l.y},{x:a.x,y:-a.y},{x:r.x,y:-r.y},{x:s.x,y:-s.y}].map((e=>`${(o+e.x).toFixed(2)} ${(n+e.y).toFixed(2)}`)).join(" L ")}" />`}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class Pze{constructor(e){const t=e.options,i=t.get(47),n=t.get(35);"off"===n?(this.renderWhitespace="none",this.renderWithSVG=!1):"svg"===n?(this.renderWhitespace=t.get(93),this.renderWithSVG=!0):(this.renderWhitespace=t.get(93),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(63),this.stopRenderingLineAfter=t.get(111)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}class Fze extends gFe{constructor(e,t,i,n,o,s){super(),this._selections=[new hye(1,1,1,1)],this._renderAnimationFrame=null;const r=new OVe(t,n,o,e);this._context=new Eze(t,i,n),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=new WWe(this._context,r,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=Ixe(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=Ixe(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=Ixe(document.createElement("div")),mFe.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new oHe(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new kHe(this._context,this._linesContent),this._viewZones=new Lze(this._context),this._viewParts.push(this._viewZones);const a=new tze(this._context);this._viewParts.push(a);const l=new cze(this._context);this._viewParts.push(l);const d=new zVe(this._context);this._viewParts.push(d),d.addDynamicOverlay(new JVe(this._context)),d.addDynamicOverlay(new vze(this._context)),d.addDynamicOverlay(new vHe(this._context)),d.addDynamicOverlay(new nHe(this._context)),d.addDynamicOverlay(new Oze(this._context));const h=new UVe(this._context);this._viewParts.push(h),h.addDynamicOverlay(new eHe(this._context)),h.addDynamicOverlay(new dHe(this._context)),h.addDynamicOverlay(new THe(this._context)),h.addDynamicOverlay(new EHe(this._context)),h.addDynamicOverlay(new NWe(this._context));const c=new MWe(this._context);c.getDomNode().appendChild(this._viewZones.marginDomNode),c.getDomNode().appendChild(h.getDomNode()),this._viewParts.push(c),this._contentWidgets=new KVe(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new xze(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new JHe(this._context),this._viewParts.push(this._overlayWidgets);const u=new lze(this._context);this._viewParts.push(u);const g=new Mze(this._context);this._viewParts.push(g);const p=new GHe(this._context);if(this._viewParts.push(p),a){const e=this._scrollbar.getOverviewRulerLayoutInfo();e.parent.insertBefore(a.getDomNode(),e.insertBefore)}this._linesContent.appendChild(d.getDomNode()),this._linesContent.appendChild(u.domNode),this._linesContent.appendChild(g.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(c.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(l.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(p.getDomNode()),this.domNode.appendChild(this._overflowGuardContainer),s?s.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new RBe(this._context,r,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){dBe.onRenderStart(),this._renderNow()}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new HFe(e,t)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new lye(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const e=this._context.configuration.options.get(138);this.domNode.setWidth(e.width),this.domNode.setHeight(e.height),this._overflowGuardContainer.setWidth(e.width),this._overflowGuardContainer.setHeight(e.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(135)+" "+zBe(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){null!==this._renderAnimationFrame&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){null===this._renderAnimationFrame&&(this._renderAnimationFrame=nMe(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){!function(e){try{return e()}catch(e){wwe(e)}}((()=>this._actualRender()))}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_actualRender(){if(!JTe(this.domNode.domNode))return;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&0===e.length)return;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new Nze(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender());const n=new _Fe(this._context.viewLayout,i,this._viewLines);for(const t of e)t.prepareRender(n);for(const t of e)t.render(n),t.onDidRender()}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.tokenizeViewport()}getOffsetForColumn(e,t){const i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new lye(n.lineNumber,n.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?PVe.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new sze(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const e of this._viewParts)e.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){var t,i,n,o,s,r,a,l;this._contentWidgets.setWidgetPosition(e.widget,null!==(i=null===(t=e.position)||void 0===t?void 0:t.position)&&void 0!==i?i:null,null!==(o=null===(n=e.position)||void 0===n?void 0:n.secondaryPosition)&&void 0!==o?o:null,null!==(r=null===(s=e.position)||void 0===s?void 0:s.preference)&&void 0!==r?r:null,null!==(l=null===(a=e.position)||void 0===a?void 0:a.positionAffinity)&&void 0!==l?l:null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){const t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}}class Bze{constructor(e,t,i,n,o,s){this.id=e,this.label=t,this.alias=i,this._precondition=n,this._run=o,this._contextKeyService=s}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(){return this.isSupported()?this._run():Promise.resolve(void 0)}}function Wze(e){let t=0,i=0,n=0,o=0;for(let s=0,r=e.length;s<r;s++){const a=e.charCodeAt(s);13===a?(0===t&&(i=s),t++,s+1<r&&10===e.charCodeAt(s+1)?(o|=2,s++):o|=3,n=s+1):10===a&&(o|=1,0===t&&(i=s),t++,n=s+1)}return 0===t&&(i=e.length),[t,i,e.length-n,o]}class Vze{constructor(e,t,i,n){this.range=e,this.nestingLevel=t,this.nestingLevelOfEqualBracketType=i,this.isInvalid=n}}class Hze{constructor(e,t,i,n,o,s){this.range=e,this.openingBracketRange=t,this.closingBracketRange=i,this.nestingLevel=n,this.nestingLevelOfEqualBracketType=o,this.bracketPairNode=s}get openingBracketInfo(){return this.bracketPairNode.openingBracket.bracketInfo}}class zze extends Hze{constructor(e,t,i,n,o,s,r){super(e,t,i,n,o,s),this.minVisibleColumnIndentation=r}}class Uze{constructor(e,t){this.lineCount=e,this.columnCount=t}toString(){return`${this.lineCount},${this.columnCount}`}}function Kze(e){return 0===e}Uze.zero=new Uze(0,0);const jze=Math.pow(2,26);function qze(e,t){return e*jze+t}function $ze(e){const t=e,i=Math.floor(t/jze);return new Uze(i,t-i*jze)}function Gze(e,t){let i=e+t;return t>=jze&&(i-=e%jze),i}function Zze(e,t){return e.reduce(((e,i)=>Gze(e,t(i))),0)}function Yze(e,t){const i=e,n=t;if(n-i<=0)return 0;const o=Math.floor(i/jze),s=Math.floor(n/jze),r=n-s*jze;return o===s?qze(0,r-(i-o*jze)):qze(s-o,r)}function Qze(e,t){return e<t}function Xze(e,t){return e<=t}function Jze(e,t){return e>=t}function eUe(e){return qze(e.lineNumber-1,e.column-1)}function tUe(e,t){const i=e,n=Math.floor(i/jze),o=i-n*jze,s=t,r=Math.floor(s/jze);return new dye(n+1,o+1,r+1,s-r*jze+1)}class iUe{constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}}class nUe{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map((e=>oUe.from(e)))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return null===i?null:Yze(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?qze(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):qze(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=$ze(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?qze(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):qze(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx<this.edits.length;){const t=this.edits[this.nextEditIdx],i=this.translateOldToCur(t.endOffsetAfterObj);if(!Xze(i,e))break;{this.nextEditIdx++;const e=$ze(i),n=$ze(this.translateOldToCur(t.endOffsetBeforeObj)),o=e.lineCount-n.lineCount;this.deltaOldToNewLineCount+=o;const s=this.deltaLineIdxInOld===t.endOffsetBeforeObj.lineCount?this.deltaOldToNewColumnCount:0,r=e.columnCount-n.columnCount;this.deltaOldToNewColumnCount=s+r,this.deltaLineIdxInOld=t.endOffsetBeforeObj.lineCount}}}}class oUe{static from(e){return new oUe(e.startOffset,e.endOffset,e.newLength)}constructor(e,t,i){this.endOffsetBeforeObj=$ze(t),this.endOffsetAfterObj=$ze(Gze(e,i)),this.offsetObj=$ze(e)}}const sUe=[];class rUe{static create(e,t){if(e<=128&&0===t.length){let i=rUe.cache[e];return i||(i=new rUe(e,t),rUe.cache[e]=i),i}return new rUe(e,t)}static getEmpty(){return this.empty}constructor(e,t){this.items=e,this.additionalItems=t}add(e,t){const i=t.getKey(e);let n=i>>5;if(0===n){const e=1<<i|this.items;return e===this.items?this:rUe.create(e,this.additionalItems)}n--;const o=this.additionalItems.slice(0);for(;o.length<n;)o.push(0);return o[n]|=1<<(31&i),rUe.create(this.items,o)}merge(e){const t=this.items|e.items;if(this.additionalItems===sUe&&e.additionalItems===sUe)return t===this.items?this:t===e.items?e:rUe.create(t,sUe);const i=[];for(let t=0;t<Math.max(this.additionalItems.length,e.additionalItems.length);t++){const n=this.additionalItems[t]||0,o=e.additionalItems[t]||0;i.push(n|o)}return rUe.create(t,i)}intersects(e){if(this.items&e.items)return!0;for(let t=0;t<Math.min(this.additionalItems.length,e.additionalItems.length);t++)if(this.additionalItems[t]&e.additionalItems[t])return!0;return!1}}rUe.cache=new Array(129),rUe.empty=rUe.create(0,sUe);const aUe={getKey:e=>e};class lUe{constructor(){this.items=new Map}getKey(e){let t=this.items.get(e);return void 0===t&&(t=this.items.size,this.items.set(e,t)),t}}class dUe{get length(){return this._length}constructor(e){this._length=e}}class hUe extends dUe{static create(e,t,i){let n=e.length;return t&&(n=Gze(n,t.length)),i&&(n=Gze(n,i.length)),new hUe(n,e,t,i,t?t.missingOpeningBracketIds:rUe.getEmpty())}get kind(){return 2}get listHeight(){return 0}get childrenLength(){return 3}getChild(e){switch(e){case 0:return this.openingBracket;case 1:return this.child;case 2:return this.closingBracket}throw new Error("Invalid child index")}get children(){const e=[];return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}constructor(e,t,i,n,o){super(e),this.openingBracket=t,this.child=i,this.closingBracket=n,this.missingOpeningBracketIds=o}canBeReused(e){return null!==this.closingBracket&&!e.intersects(this.missingOpeningBracketIds)}deepClone(){return new hUe(this.length,this.openingBracket.deepClone(),this.child&&this.child.deepClone(),this.closingBracket&&this.closingBracket.deepClone(),this.missingOpeningBracketIds)}computeMinIndentation(e,t){return this.child?this.child.computeMinIndentation(Gze(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class cUe extends dUe{static create23(e,t,i,n=!1){let o=e.length,s=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(o=Gze(o,t.length),s=s.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");o=Gze(o,i.length),s=s.merge(i.missingOpeningBracketIds)}return n?new gUe(o,e.listHeight+1,e,t,i,s):new uUe(o,e.listHeight+1,e,t,i,s)}static getEmpty(){return new mUe(0,0,[],rUe.getEmpty())}get kind(){return 4}get missingOpeningBracketIds(){return this._missingOpeningBracketIds}constructor(e,t,i){super(e),this.listHeight=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}throwIfImmutable(){}makeLastElementMutable(){this.throwIfImmutable();const e=this.childrenLength;if(0===e)return;const t=this.getChild(e-1),i=4===t.kind?t.toMutable():t;return t!==i&&this.setChild(e-1,i),i}makeFirstElementMutable(){if(this.throwIfImmutable(),0===this.childrenLength)return;const e=this.getChild(0),t=4===e.kind?e.toMutable():e;return e!==t&&this.setChild(0,t),t}canBeReused(e){if(e.intersects(this.missingOpeningBracketIds))return!1;if(0===this.childrenLength)return!1;let t=this;for(;4===t.kind;){const e=t.childrenLength;if(0===e)throw new Nwe;t=t.getChild(e-1)}return t.canBeReused(e)}handleChildrenChanged(){this.throwIfImmutable();const e=this.childrenLength;let t=this.getChild(0).length,i=this.getChild(0).missingOpeningBracketIds;for(let n=1;n<e;n++){const e=this.getChild(n);t=Gze(t,e.length),i=i.merge(e.missingOpeningBracketIds)}this._length=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}computeMinIndentation(e,t){if(-1!==this.cachedMinIndentation)return this.cachedMinIndentation;let i=Number.MAX_SAFE_INTEGER,n=e;for(let e=0;e<this.childrenLength;e++){const o=this.getChild(e);o&&(i=Math.min(i,o.computeMinIndentation(n,t)),n=Gze(n,o.length))}return this.cachedMinIndentation=i,i}}class uUe extends cUe{get childrenLength(){return null!==this._item3?3:2}getChild(e){switch(e){case 0:return this._item1;case 1:return this._item2;case 2:return this._item3}throw new Error("Invalid child index")}setChild(e,t){switch(e){case 0:return void(this._item1=t);case 1:return void(this._item2=t);case 2:return void(this._item3=t)}throw new Error("Invalid child index")}get children(){return this._item3?[this._item1,this._item2,this._item3]:[this._item1,this._item2]}get item1(){return this._item1}get item2(){return this._item2}get item3(){return this._item3}constructor(e,t,i,n,o,s){super(e,t,s),this._item1=i,this._item2=n,this._item3=o}deepClone(){return new uUe(this.length,this.listHeight,this._item1.deepClone(),this._item2.deepClone(),this._item3?this._item3.deepClone():null,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){if(this._item3)throw new Error("Cannot append to a full (2,3) tree node");this.throwIfImmutable(),this._item3=e,this.handleChildrenChanged()}unappendChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item3;return this._item3=null,this.handleChildrenChanged(),e}prependChildOfSameHeight(e){if(this._item3)throw new Error("Cannot prepend to a full (2,3) tree node");this.throwIfImmutable(),this._item3=this._item2,this._item2=this._item1,this._item1=e,this.handleChildrenChanged()}unprependChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item1;return this._item1=this._item2,this._item2=this._item3,this._item3=null,this.handleChildrenChanged(),e}toMutable(){return this}}class gUe extends uUe{toMutable(){return new uUe(this.length,this.listHeight,this.item1,this.item2,this.item3,this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}class pUe extends cUe{get childrenLength(){return this._children.length}getChild(e){return this._children[e]}setChild(e,t){this._children[e]=t}get children(){return this._children}constructor(e,t,i,n){super(e,t,n),this._children=i}deepClone(){const e=new Array(this._children.length);for(let t=0;t<this._children.length;t++)e[t]=this._children[t].deepClone();return new pUe(this.length,this.listHeight,e,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){this.throwIfImmutable(),this._children.push(e),this.handleChildrenChanged()}unappendChild(){this.throwIfImmutable();const e=this._children.pop();return this.handleChildrenChanged(),e}prependChildOfSameHeight(e){this.throwIfImmutable(),this._children.unshift(e),this.handleChildrenChanged()}unprependChild(){this.throwIfImmutable();const e=this._children.shift();return this.handleChildrenChanged(),e}toMutable(){return this}}class mUe extends pUe{toMutable(){return new pUe(this.length,this.listHeight,[...this.children],this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}const fUe=[];class _Ue extends dUe{get listHeight(){return 0}get childrenLength(){return 0}getChild(e){return null}get children(){return fUe}deepClone(){return this}}class vUe extends _Ue{get kind(){return 0}get missingOpeningBracketIds(){return rUe.getEmpty()}canBeReused(e){return!0}computeMinIndentation(e,t){const i=$ze(e),n=(0===i.columnCount?i.lineCount:i.lineCount+1)+1,o=(s=Gze(e,this.length),Math.floor(s/jze)+1);var s;let r=Number.MAX_SAFE_INTEGER;for(let e=n;e<=o;e++){const i=t.getLineFirstNonWhitespaceColumn(e),n=t.getLineContent(e);if(0===i)continue;const o=PFe.visibleColumnFromColumn(n,i,t.getOptions().tabSize);r=Math.min(r,o)}return r}}class bUe extends _Ue{static create(e,t,i){return new bUe(e,t,i)}get kind(){return 1}get missingOpeningBracketIds(){return rUe.getEmpty()}constructor(e,t,i){super(e),this.bracketInfo=t,this.bracketIds=i}get text(){return this.bracketInfo.bracketText}get languageId(){return this.bracketInfo.languageId}canBeReused(e){return!1}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class wUe extends _Ue{get kind(){return 3}constructor(e,t){super(t),this.missingOpeningBracketIds=e}canBeReused(e){return!e.intersects(this.missingOpeningBracketIds)}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class CUe{constructor(e,t,i,n,o){this.length=e,this.kind=t,this.bracketId=i,this.bracketIds=n,this.astNode=o}}class yUe{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new SUe(this.textModel,this.bracketTokens),this._offset=0,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return qze(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=Gze(this._offset,e);const t=$ze(this._offset);this.reader.setPosition(t.lineCount,t.columnCount)}read(){let e;return this.peeked?(this.didPeek=!1,e=this.peeked):e=this.reader.read(),e&&(this._offset=Gze(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}class SUe{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.lineIdx=0,this.line=null,this.lineCharOffset=0,this.lineTokens=null,this.lineTokenOffset=0,this.peekedToken=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}setPosition(e,t){e===this.lineIdx?(this.lineCharOffset=t,null!==this.line&&(this.lineTokenOffset=0===this.lineCharOffset?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset))):(this.lineIdx=e,this.lineCharOffset=t,this.line=null),this.peekedToken=null}read(){if(this.peekedToken){const e=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=e.length,e}if(this.lineIdx>this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;null===this.line&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=0===this.lineCharOffset?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const n=this.lineTokens,o=n.getCount();let s=null;if(this.lineTokenOffset<o){const r=n.getMetadata(this.lineTokenOffset);for(;this.lineTokenOffset+1<o&&r===n.getMetadata(this.lineTokenOffset+1);)this.lineTokenOffset++;const a=0===VNe.getTokenType(r),l=VNe.containsBalancedBrackets(r),d=n.getEndOffset(this.lineTokenOffset);if(l&&a&&this.lineCharOffset<d){const e=n.getLanguageId(this.lineTokenOffset),t=this.line.substring(this.lineCharOffset,d),i=this.bracketTokens.getSingleLanguageBracketTokens(e),o=i.regExpGlobal;if(o){o.lastIndex=0;const e=o.exec(t);e&&(s=i.getToken(e[0]),s&&(this.lineCharOffset+=e.index))}}if(i+=d-this.lineCharOffset,s){if(e!==this.lineIdx||t!==this.lineCharOffset){this.peekedToken=s;break}return this.lineCharOffset+=s.length,s}this.lineTokenOffset++,this.lineCharOffset=d}else{if(this.lineIdx===this.textBufferLineCount-1)break;if(this.lineIdx++,this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.lineTokenOffset=0,this.line=this.lineTokens.getLineContent(),this.lineCharOffset=0,i+=33,i>1e3)break}if(i>1500)break}const n=(o=e,s=t,r=this.lineIdx,a=this.lineCharOffset,o!==r?qze(r-o,a):qze(0,a-s));var o,s,r,a;return new CUe(n,0,-1,rUe.getEmpty(),new vUe(n))}}class xUe{constructor(e,t){this.text=e,this._offset=0,this.idx=0;const i=t.getRegExpStr(),n=i?new RegExp(i+"|\n","gi"):null,o=[];let s,r=0,a=0,l=0,d=0;const h=[];for(let e=0;e<60;e++)h.push(new CUe(qze(0,e),0,-1,rUe.getEmpty(),new vUe(qze(0,e))));const c=[];for(let e=0;e<60;e++)c.push(new CUe(qze(1,e),0,-1,rUe.getEmpty(),new vUe(qze(1,e))));if(n)for(n.lastIndex=0;null!==(s=n.exec(e));){const e=s.index,i=s[0];if("\n"===i)r++,a=e+1;else{if(l!==e){let t;if(d===r){const i=e-l;if(i<h.length)t=h[i];else{const e=qze(0,i);t=new CUe(e,0,-1,rUe.getEmpty(),new vUe(e))}}else{const i=r-d,n=e-a;if(1===i&&n<c.length)t=c[n];else{const e=qze(i,n);t=new CUe(e,0,-1,rUe.getEmpty(),new vUe(e))}}o.push(t)}o.push(t.getToken(i)),l=e+i.length,d=r}}const u=e.length;if(l!==u){const e=d===r?qze(0,u-l):qze(r-d,u-a);o.push(new CUe(e,0,-1,rUe.getEmpty(),new vUe(e)))}this.length=qze(r,u-a),this.tokens=o}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new Dwe}}class kUe{static createFromLanguage(e,t){function i(e){return t.getKey(`${e.languageId}:::${e.bracketText}`)}const n=new Map;for(const t of e.bracketsNew.openingBrackets){const e=qze(0,t.bracketText.length),o=i(t),s=rUe.getEmpty().add(o,aUe);n.set(t.bracketText,new CUe(e,1,o,s,bUe.create(e,t,s)))}for(const t of e.bracketsNew.closingBrackets){const e=qze(0,t.bracketText.length);let o=rUe.getEmpty();const s=t.getClosedBrackets();for(const e of s)o=o.add(i(e),aUe);n.set(t.bracketText,new CUe(e,2,i(s[0]),o,bUe.create(e,t,o)))}return new kUe(n)}constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}getRegExpStr(){if(this.isEmpty)return null;{const e=[...this.map.keys()];return e.sort(),e.reverse(),e.map((e=>function(e){let t=SSe(e);return/^[\w ]+/.test(e)&&(t=`\\b${t}`),/[\w ]+$/.test(e)&&(t=`${t}\\b`),t}(e))).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(2===i.kind&&i.bracketIds.intersects(e))return t}get isEmpty(){return 0===this.map.size}}class LUe{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=kUe.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function DUe(e,t=!1){if(0===e.length)return null;if(1===e.length)return e[0];let i=e.length;for(;i>3;){const n=i>>1;for(let o=0;o<n;o++){const n=o<<1;e[o]=cUe.create23(e[n],e[n+1],n+3===i?e[n+2]:null,t)}i=n}return cUe.create23(e[0],e[1],i>=3?e[2]:null,t)}function EUe(e,t){return Math.abs(e.listHeight-t.listHeight)}function NUe(e,t){return e.listHeight===t.listHeight?cUe.create23(e,t,null,!1):e.listHeight>t.listHeight?function(e,t){let i=e=e.toMutable();const n=[];let o;for(;;){if(t.listHeight===i.listHeight){o=t;break}if(4!==i.kind)throw new Error("unexpected");n.push(i),i=i.makeLastElementMutable()}for(let e=n.length-1;e>=0;e--){const t=n[e];o?t.childrenLength>=3?o=cUe.create23(t.unappendChild(),o,null,!1):(t.appendChildOfSameHeight(o),o=void 0):t.handleChildrenChanged()}return o?cUe.create23(e,o,null,!1):e}(e,t):function(e,t){let i=e=e.toMutable();const n=[];for(;t.listHeight!==i.listHeight;){if(4!==i.kind)throw new Error("unexpected");n.push(i),i=i.makeFirstElementMutable()}let o=t;for(let e=n.length-1;e>=0;e--){const t=n[e];o?t.childrenLength>=3?o=cUe.create23(o,t.unprependChild(),null,!1):(t.prependChildOfSameHeight(o),o=void 0):t.handleChildrenChanged()}return o?cUe.create23(o,e,null,!1):e}(t,e)}class IUe{constructor(e){this.lastOffset=0,this.nextNodes=[e],this.offsets=[0],this.idxs=[]}readLongestNodeAt(e,t){if(Qze(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=MUe(this.nextNodes);if(!i)return;const n=MUe(this.offsets);if(Qze(e,n))return;if(Qze(n,e))if(Gze(n,i.length)<=e)this.nextNodeAfterCurrent();else{const e=TUe(i);-1!==e?(this.nextNodes.push(i.getChild(e)),this.offsets.push(n),this.idxs.push(e)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const e=TUe(i);if(-1===e)return void this.nextNodeAfterCurrent();this.nextNodes.push(i.getChild(e)),this.offsets.push(n),this.idxs.push(e)}}}}nextNodeAfterCurrent(){for(;;){const e=MUe(this.offsets),t=MUe(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),0===this.idxs.length)break;const i=MUe(this.nextNodes),n=TUe(i,this.idxs[this.idxs.length-1]);if(-1!==n){this.nextNodes.push(i.getChild(n)),this.offsets.push(Gze(e,t.length)),this.idxs[this.idxs.length-1]=n;break}this.idxs.pop()}}}function TUe(e,t=-1){for(;;){if(++t>=e.childrenLength)return-1;if(e.getChild(t))return t}}function MUe(e){return e.length>0?e[e.length-1]:void 0}function AUe(e,t,i,n){return new RUe(e,t,i,n).parseDocument()}class RUe{constructor(e,t,i,n){if(this.tokenizer=e,this.createImmutableLists=n,this._itemsConstructed=0,this._itemsFromCache=0,i&&n)throw new Error("Not supported");this.oldNodeReader=i?new IUe(i):void 0,this.positionMapper=new nUe(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(rUe.getEmpty());return e||(e=cUe.getEmpty()),e}parseList(e){const t=[];for(;;){let i=this.tryReadChildFromCache(e);if(!i){const t=this.tokenizer.peek();if(!t||2===t.kind&&t.bracketIds.intersects(e))break;i=this.parseChild(e)}4===i.kind&&0===i.childrenLength||t.push(i)}const i=this.oldNodeReader?function(e){if(0===e.length)return null;if(1===e.length)return e[0];let t=0;function i(){if(t>=e.length)return null;const i=t,n=e[i].listHeight;for(t++;t<e.length&&e[t].listHeight===n;)t++;return t-i>=2?DUe(0===i&&t===e.length?e:e.slice(i,t),!1):e[i]}let n=i(),o=i();if(!o)return n;for(let e=i();e;e=i())EUe(n,o)<=EUe(o,e)?(n=NUe(n,o),o=e):o=NUe(o,e);return NUe(n,o)}(t):DUe(t,this.createImmutableLists);return i}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(null===t||!Kze(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),(i=>!(null!==t&&!Qze(i.length,t))&&i.canBeReused(e)));if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}}parseChild(e){this._itemsConstructed++;const t=this.tokenizer.read();switch(t.kind){case 2:return new wUe(t.bracketIds,t.length);case 0:return t.astNode;case 1:{const i=e.merge(t.bracketIds),n=this.parseList(i),o=this.tokenizer.peek();return o&&2===o.kind&&(o.bracketId===t.bracketId||o.bracketIds.intersects(t.bracketIds))?(this.tokenizer.read(),hUe.create(t.astNode,n,o.astNode)):hUe.create(t.astNode,n,null)}default:throw new Error("unexpected")}}}function OUe(e,t){if(0===e.length)return t;const i=new pbe(PUe(e)),n=PUe(t);let o,s=0;function r(e){const t=[];for(;;){if(void 0!==o&&!Kze(o)||!Kze(s)){let i;void 0!==e&&Xze(e,s)?(i=e,s=Yze(e,s),e=0):(i=s,void 0!==e&&(e=Yze(s,e)),s=0),void 0===o?t.push({oldLength:i,newLength:void 0}):(t.push({oldLength:o,newLength:i}),o=0)}if(void 0!==e&&Kze(e))break;const n=i.dequeue();if(!n){void 0!==e&&t.push({oldLength:e,newLength:void 0});break}void 0===n.newLength?(s=n.oldLength,o=void 0):(o=n.oldLength,s=n.newLength)}return t}const a=[];function l(e,t,i){if(a.length>0&&a[a.length-1].endOffset===e){const e=a[a.length-1];a[a.length-1]=new iUe(e.startOffset,t,Gze(e.newLength,i))}else a.push({startOffset:e,endOffset:t,newLength:i})}let d=0;for(const e of n){const t=r(e.oldLength);if(void 0!==e.newLength){const i=Gze(d,Zze(t,(e=>e.oldLength)));l(d,i,e.newLength),d=i}else for(const e of t){const t=d;d=Gze(d,e.oldLength),void 0!==e.newLength&&l(t,d,e.newLength)}}const h=r(void 0);for(const e of h){const t=d;d=Gze(d,e.oldLength),void 0!==e.newLength&&l(t,d,e.newLength)}return a}function PUe(e){const t=[];let i=0;for(const n of e){const e=Yze(i,n.startOffset);Kze(e)||t.push({oldLength:e});const o=Yze(n.startOffset,n.endOffset);t.push({oldLength:o,newLength:n.newLength}),i=n.endOffset}return t}class FUe extends Owe{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new $we,this.denseKeyProvider=new lUe,this.brackets=new LUe(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],0===e.tokenization.backgroundTokenizationState){const e=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),t=new xUe(this.textModel.getValue(),e);this.initialAstWithoutTokens=AUe(t,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}else 2===e.tokenization.backgroundTokenizationState?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):1===e.tokenization.backgroundTokenizationState&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens)}handleDidChangeBackgroundTokenizationState(){if(2===this.textModel.tokenization.backgroundTokenizationState){const e=void 0===this.initialAstWithoutTokens;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map((e=>new iUe(qze(e.fromLineNumber-1,0),qze(e.toLineNumber,0),qze(e.toLineNumber-e.fromLineNumber+1,0))));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=e.changes.map((e=>{const t=dye.lift(e.range);return new iUe(eUe(t.getStartPosition()),eUe(t.getEndPosition()),function(e){const t=DSe(e);return qze(t.length-1,t[t.length-1].length)}(e.text))})).reverse();this.handleEdits(t,!1)}handleEdits(e,t){const i=OUe(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=OUe(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,i){const n=t;return AUe(new yUe(this.textModel,this.brackets),e,n,i)}getBracketsInRange(e){this.flushQueue();const t=qze(e.startLineNumber-1,e.startColumn-1),i=qze(e.endLineNumber-1,e.endColumn-1);return new mbe((e=>{const n=this.initialAstWithoutTokens||this.astWithTokens;VUe(n,0,n.length,t,i,e,0,0,new Map)}))}getBracketPairsInRange(e,t){this.flushQueue();const i=eUe(e.getStartPosition()),n=eUe(e.getEndPosition());return new mbe((e=>{const o=this.initialAstWithoutTokens||this.astWithTokens,s=new HUe(e,t,this.textModel);zUe(o,0,o.length,i,n,s,0,new Map)}))}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return WUe(t,0,t.length,eUe(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return BUe(t,0,t.length,eUe(e))}}function BUe(e,t,i,n){if(4===e.kind||2===e.kind){const o=[];for(const n of e.children)i=Gze(t,n.length),o.push({nodeOffsetStart:t,nodeOffsetEnd:i}),t=i;for(let t=o.length-1;t>=0;t--){const{nodeOffsetStart:i,nodeOffsetEnd:s}=o[t];if(Qze(i,n)){const o=BUe(e.children[t],i,s,n);if(o)return o}}return null}if(3===e.kind)return null;if(1===e.kind){const n=tUe(t,i);return{bracketInfo:e.bracketInfo,range:n}}return null}function WUe(e,t,i,n){if(4===e.kind||2===e.kind){for(const o of e.children){if(Qze(n,i=Gze(t,o.length))){const e=WUe(o,t,i,n);if(e)return e}t=i}return null}if(3===e.kind)return null;if(1===e.kind){const n=tUe(t,i);return{bracketInfo:e.bracketInfo,range:n}}return null}function VUe(e,t,i,n,o,s,r,a,l,d=!1){if(r>200)return!0;e:for(;;)switch(e.kind){case 4:{const a=e.childrenLength;for(let d=0;d<a;d++){const a=e.getChild(d);if(a){if(i=Gze(t,a.length),Xze(t,o)&&Jze(i,n)){if(Jze(i,o)){e=a;continue e}if(!VUe(a,t,i,n,o,s,r,0,l))return!1}t=i}}return!0}case 2:{let d=0;if(l){let t=l.get(e.openingBracket.text);void 0===t&&(t=0),d=t,t++,l.set(e.openingBracket.text,t)}const h=e.childrenLength;for(let c=0;c<h;c++){const h=e.getChild(c);if(h){if(i=Gze(t,h.length),Xze(t,o)&&Jze(i,n)){if(Jze(i,o)){e=h,r++,a=d+1;continue e}if(!VUe(h,t,i,n,o,s,r+1,d+1,l,!e.closingBracket))return!1}t=i}}return null==l||l.set(e.openingBracket.text,d),!0}case 3:{const e=tUe(t,i);return s(new Vze(e,r-1,0,!0))}case 1:{const e=tUe(t,i);return s(new Vze(e,r-1,a-1,d))}case 0:return!0}}class HUe{constructor(e,t,i){this.push=e,this.includeMinIndentation=t,this.textModel=i}}function zUe(e,t,i,n,o,s,r,a){var l;if(r>200)return!0;let d=!0;if(2===e.kind){let h=0;if(a){let t=a.get(e.openingBracket.text);void 0===t&&(t=0),h=t,t++,a.set(e.openingBracket.text,t)}const c=Gze(t,e.openingBracket.length);let u=-1;if(s.includeMinIndentation&&(u=e.computeMinIndentation(t,s.textModel)),d=s.push(new zze(tUe(t,i),tUe(t,c),e.closingBracket?tUe(Gze(c,(null===(l=e.child)||void 0===l?void 0:l.length)||0),i):void 0,r,h,e,u)),t=c,d&&e.child){const l=e.child;if(i=Gze(t,l.length),Xze(t,o)&&Jze(i,n)&&(d=zUe(l,t,i,n,o,s,r+1,a),!d))return!1}null==a||a.set(e.openingBracket.text,h)}else{let i=t;for(const t of e.children){const e=i;if(i=Gze(i,t.length),Xze(e,o)&&Xze(n,i)&&(d=zUe(t,e,i,n,o,s,r,a),!d))return!1}}return d}class UUe extends Owe{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Pwe),this.onDidChangeEmitter=new $we,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange((e=>{var t;e.languageId&&!(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.didLanguageChange(e.languageId))||(this.bracketPairsTree.clear(),this.updateBracketPairsTree())})))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;null===(t=this.bracketPairsTree.value)||void 0===t||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;null===(e=this.bracketPairsTree.value)||void 0===e||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;null===(t=this.bracketPairsTree.value)||void 0===t||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const i=new Rwe;this.bracketPairsTree.value=(e=i.add(new FUe(this.textModel,(e=>this.languageConfigurationService.getLanguageConfiguration(e)))),t=i,{object:e,dispose:()=>null==t?void 0:t.dispose()}),i.add(this.bracketPairsTree.value.object.onDidChange((e=>this.onDidChangeEmitter.fire(e)))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire());var e,t}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getBracketPairsInRange(e,!1))||mbe.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getBracketPairsInRange(e,!0))||mbe.empty}getBracketsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getBracketsInRange(e))||mbe.empty}findMatchingBracketUp(e,t,i){const n=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(n.lineNumber,n.column);if(this.canBuildAST){const i=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!i)return null;const n=this.getBracketPairsInRange(dye.fromPositions(t,t)).findLast((e=>i.closes(e.openingBracketInfo)));return n?n.openingBracketRange:null}{const t=e.toLowerCase(),s=this.languageConfigurationService.getLanguageConfiguration(o).brackets;if(!s)return null;const r=s.textIsBracket[t];return r?qUe(this._findMatchingBracketUp(r,n,KUe(i))):null}}matchBracket(e,t){if(this.canBuildAST){const t=this.getBracketPairsInRange(dye.fromPositions(e,e)).filter((t=>void 0!==t.closingBracketRange&&(t.openingBracketRange.containsPosition(e)||t.closingBracketRange.containsPosition(e)))).findLastMaxBy(gbe((t=>t.openingBracketRange.containsPosition(e)?t.openingBracketRange:t.closingBracketRange),dye.compareRangesUsingStarts));return t?[t.openingBracketRange,t.closingBracketRange]:null}{const i=KUe(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,n){const o=t.getCount(),s=t.getLanguageId(n);let r=Math.max(0,e.column-1-i.maxBracketLength);for(let e=n-1;e>=0;e--){const i=t.getEndOffset(e);if(i<=r)break;if($ke(t.getStandardTokenType(e))||t.getLanguageId(e)!==s){r=i;break}}let a=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let e=n+1;e<o;e++){const i=t.getStartOffset(e);if(i>=a)break;if($ke(t.getStandardTokenType(e))||t.getLanguageId(e)!==s){a=i;break}}return{searchStartOffset:r,searchEndOffset:a}}_matchBracket(e,t){const i=e.lineNumber,n=this.textModel.tokenization.getLineTokens(i),o=this.textModel.getLineContent(i),s=n.findTokenIndexAtOffset(e.column-1);if(s<0)return null;const r=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(s)).brackets;if(r&&!$ke(n.getStandardTokenType(s))){let{searchStartOffset:a,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,r,s),d=null;for(;;){const n=vLe.findNextBracketInRange(r.forwardRegex,i,o,a,l);if(!n)break;if(n.startColumn<=e.column&&e.column<=n.endColumn){const e=o.substring(n.startColumn-1,n.endColumn-1).toLowerCase(),i=this._matchFoundBracket(n,r.textIsBracket[e],r.textIsOpenBracket[e],t);if(i){if(i instanceof jUe)return null;d=i}}a=n.endColumn-1}if(d)return d}if(s>0&&n.getStartOffset(s)===e.column-1){const r=s-1,a=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(r)).brackets;if(a&&!$ke(n.getStandardTokenType(r))){const{searchStartOffset:s,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,a,r),d=vLe.findPrevBracketInRange(a.reversedRegex,i,o,s,l);if(d&&d.startColumn<=e.column&&e.column<=d.endColumn){const e=o.substring(d.startColumn-1,d.endColumn-1).toLowerCase(),i=this._matchFoundBracket(d,a.textIsBracket[e],a.textIsOpenBracket[e],t);if(i)return i instanceof jUe?null:i}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return o?o instanceof jUe?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const n=e.languageId,o=e.reversedRegex;let s=-1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return jUe.INSTANCE;const d=vLe.findPrevBracketInRange(o,t,n,a,l);if(!d)break;const h=n.substring(d.startColumn-1,d.endColumn-1).toLowerCase();if(e.isOpen(h)?s++:e.isClose(h)&&s--,0===s)return d;l=d.startColumn-1}return null};for(let e=t.lineNumber;e>=1;e--){const i=this.textModel.tokenization.getLineTokens(e),o=i.getCount(),s=this.textModel.getLineContent(e);let r=o-1,l=s.length,d=s.length;e===t.lineNumber&&(r=i.findTokenIndexAtOffset(t.column-1),l=t.column-1,d=t.column-1);let h=!0;for(;r>=0;r--){const t=i.getLanguageId(r)===n&&!$ke(i.getStandardTokenType(r));if(t)h?l=i.getStartOffset(r):(l=i.getStartOffset(r),d=i.getEndOffset(r));else if(h&&l!==d){const t=a(e,s,l,d);if(t)return t}h=t}if(h&&l!==d){const t=a(e,s,l,d);if(t)return t}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageId,o=e.forwardRegex;let s=1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return jUe.INSTANCE;const d=vLe.findNextBracketInRange(o,t,n,a,l);if(!d)break;const h=n.substring(d.startColumn-1,d.endColumn-1).toLowerCase();if(e.isOpen(h)?s++:e.isClose(h)&&s--,0===s)return d;a=d.endColumn-1}return null},l=this.textModel.getLineCount();for(let e=t.lineNumber;e<=l;e++){const i=this.textModel.tokenization.getLineTokens(e),o=i.getCount(),s=this.textModel.getLineContent(e);let r=0,l=0,d=0;e===t.lineNumber&&(r=i.findTokenIndexAtOffset(t.column-1),l=t.column-1,d=t.column-1);let h=!0;for(;r<o;r++){const t=i.getLanguageId(r)===n&&!$ke(i.getStandardTokenType(r));if(t)h||(l=i.getStartOffset(r)),d=i.getEndOffset(r);else if(h&&l!==d){const t=a(e,s,l,d);if(t)return t}h=t}if(h&&l!==d){const t=a(e,s,l,d);if(t)return t}}return null}findPrevBracket(e){var t;const i=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getFirstBracketBefore(i))||null;let n=null,o=null,s=null;for(let e=i.lineNumber;e>=1;e--){const t=this.textModel.tokenization.getLineTokens(e),r=t.getCount(),a=this.textModel.getLineContent(e);let l=r-1,d=a.length,h=a.length;if(e===i.lineNumber){l=t.findTokenIndexAtOffset(i.column-1),d=i.column-1,h=i.column-1;const e=t.getLanguageId(l);n!==e&&(n=e,o=this.languageConfigurationService.getLanguageConfiguration(n).brackets,s=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew)}let c=!0;for(;l>=0;l--){const i=t.getLanguageId(l);if(n!==i){if(o&&s&&c&&d!==h){const t=vLe.findPrevBracketInRange(o.reversedRegex,e,a,d,h);if(t)return this._toFoundBracket(s,t);c=!1}n=i,o=this.languageConfigurationService.getLanguageConfiguration(n).brackets,s=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew}const r=!!o&&!$ke(t.getStandardTokenType(l));if(r)c?d=t.getStartOffset(l):(d=t.getStartOffset(l),h=t.getEndOffset(l));else if(s&&o&&c&&d!==h){const t=vLe.findPrevBracketInRange(o.reversedRegex,e,a,d,h);if(t)return this._toFoundBracket(s,t)}c=r}if(s&&o&&c&&d!==h){const t=vLe.findPrevBracketInRange(o.reversedRegex,e,a,d,h);if(t)return this._toFoundBracket(s,t)}}return null}findNextBracket(e){var t;const i=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getFirstBracketAfter(i))||null;const n=this.textModel.getLineCount();let o=null,s=null,r=null;for(let e=i.lineNumber;e<=n;e++){const t=this.textModel.tokenization.getLineTokens(e),n=t.getCount(),a=this.textModel.getLineContent(e);let l=0,d=0,h=0;if(e===i.lineNumber){l=t.findTokenIndexAtOffset(i.column-1),d=i.column-1,h=i.column-1;const e=t.getLanguageId(l);o!==e&&(o=e,s=this.languageConfigurationService.getLanguageConfiguration(o).brackets,r=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew)}let c=!0;for(;l<n;l++){const i=t.getLanguageId(l);if(o!==i){if(r&&s&&c&&d!==h){const t=vLe.findNextBracketInRange(s.forwardRegex,e,a,d,h);if(t)return this._toFoundBracket(r,t);c=!1}o=i,s=this.languageConfigurationService.getLanguageConfiguration(o).brackets,r=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew}const n=!!s&&!$ke(t.getStandardTokenType(l));if(n)c||(d=t.getStartOffset(l)),h=t.getEndOffset(l);else if(r&&s&&c&&d!==h){const t=vLe.findNextBracketInRange(s.forwardRegex,e,a,d,h);if(t)return this._toFoundBracket(r,t)}c=n}if(r&&s&&c&&d!==h){const t=vLe.findNextBracketInRange(s.forwardRegex,e,a,d,h);if(t)return this._toFoundBracket(r,t)}}return null}findEnclosingBrackets(e,t){const i=this.textModel.validatePosition(e);if(this.canBuildAST){const e=dye.fromPositions(i),t=this.getBracketPairsInRange(dye.fromPositions(i,i)).findLast((t=>void 0!==t.closingBracketRange&&t.range.strictContainsRange(e)));return t?[t.openingBracketRange,t.closingBracketRange]:null}const n=KUe(t),o=this.textModel.getLineCount(),s=new Map;let r=[];const a=(e,t)=>{if(!s.has(e)){const i=[];for(let e=0,n=t?t.brackets.length:0;e<n;e++)i[e]=0;s.set(e,i)}r=s.get(e)};let l=0;const d=(e,t,i,o,s)=>{for(;;){if(n&&++l%100==0&&!n())return jUe.INSTANCE;const a=vLe.findNextBracketInRange(e.forwardRegex,t,i,o,s);if(!a)break;const d=i.substring(a.startColumn-1,a.endColumn-1).toLowerCase(),h=e.textIsBracket[d];if(h&&(h.isOpen(d)?r[h.index]++:h.isClose(d)&&r[h.index]--,-1===r[h.index]))return this._matchFoundBracket(a,h,!1,n);o=a.endColumn-1}return null};let h=null,c=null;for(let e=i.lineNumber;e<=o;e++){const t=this.textModel.tokenization.getLineTokens(e),n=t.getCount(),o=this.textModel.getLineContent(e);let s=0,r=0,l=0;if(e===i.lineNumber){s=t.findTokenIndexAtOffset(i.column-1),r=i.column-1,l=i.column-1;const e=t.getLanguageId(s);h!==e&&(h=e,c=this.languageConfigurationService.getLanguageConfiguration(h).brackets,a(h,c))}let u=!0;for(;s<n;s++){const i=t.getLanguageId(s);if(h!==i){if(c&&u&&r!==l){const t=d(c,e,o,r,l);if(t)return qUe(t);u=!1}h=i,c=this.languageConfigurationService.getLanguageConfiguration(h).brackets,a(h,c)}const n=!!c&&!$ke(t.getStandardTokenType(s));if(n)u||(r=t.getStartOffset(s)),l=t.getEndOffset(s);else if(c&&u&&r!==l){const t=d(c,e,o,r,l);if(t)return qUe(t)}u=n}if(c&&u&&r!==l){const t=d(c,e,o,r,l);if(t)return qUe(t)}}return null}_toFoundBracket(e,t){if(!t)return null;let i=this.textModel.getValueInRange(t);i=i.toLowerCase();const n=e.getBracketInfo(i);return n?{range:t,bracketInfo:n}:null}}function KUe(e){if(void 0===e)return()=>!0;{const t=Date.now();return()=>Date.now()-t<=e}}class jUe{constructor(){this._searchCanceledBrand=void 0}}function qUe(e){return e instanceof jUe?null:e}jUe.INSTANCE=new jUe;class $Ue extends Owe{constructor(e){super(),this.textModel=e,this.colorProvider=new GUe,this.onDidChangeEmitter=new $we,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange((e=>{this.onDidChangeEmitter.fire()})))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,n){return n||void 0===t?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e).map((e=>({id:`bracket${e.range.toString()}-${e.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(e,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:e.range}))).toArray():[]}getAllDecorations(e,t){return void 0===e?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new dye(1,1,this.textModel.getLineCount(),1),e,t):[]}}class GUe{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return"bracket-highlighting-"+e%30}}function ZUe(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}jBe(((e,t)=>{const i=[hWe,cWe,uWe,gWe,pWe,mWe],n=new GUe;t.addRule(`.monaco-editor .${n.unexpectedClosingBracketClassName} { color: ${e.getColor(fWe)}; }`);const o=i.map((t=>e.getColor(t))).filter((e=>!!e)).filter((e=>!e.isTransparent()));for(let e=0;e<30;e++){const i=o[e%o.length];t.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(e)} { color: ${i}; }`)}}));class YUe{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,i,n){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=n}toString(){return 0===this.oldText.length?`(insert@${this.oldPosition} "${ZUe(this.newText)}")`:0===this.newText.length?`(delete@${this.oldPosition} "${ZUe(this.oldText)}")`:`(replace@${this.oldPosition} "${ZUe(this.oldText)}" with "${ZUe(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const n=t.length;oLe(e,n,i),i+=4;for(let o=0;o<n;o++)iLe(e,t.charCodeAt(o),i),i+=2;return i}static _readString(e,t){const i=nLe(e,t);return function(e,t,i){const n=new Uint16Array(e.buffer,t,i);return i>0&&(65279===n[0]||65534===n[0])?function(e,t,i){const n=[];let o=0;for(let s=0;s<i;s++){const i=tLe(e,t);t+=2,n[o++]=String.fromCharCode(i)}return n.join("")}(e,t,i):aLe().decode(n)}(e,t+=4,i)}writeSize(){return 8+YUe._writeStringSize(this.oldText)+YUe._writeStringSize(this.newText)}write(e,t){return oLe(e,this.oldPosition,t),t+=4,oLe(e,this.newPosition,t),t+=4,t=YUe._writeString(e,this.oldText,t),YUe._writeString(e,this.newText,t)}static read(e,t,i){const n=nLe(e,t),o=nLe(e,t+=4);t+=4;const s=YUe._readString(e,t);t+=YUe._writeStringSize(s);const r=YUe._readString(e,t);return t+=YUe._writeStringSize(r),i.push(new YUe(n,s,o,r)),t}}class QUe{constructor(e,t){this._prevEdits=e,this._currEdits=t,this._result=[],this._resultLen=0,this._prevLen=this._prevEdits.length,this._prevDeltaOffset=0,this._currLen=this._currEdits.length,this._currDeltaOffset=0}compress(){let e=0,t=0,i=this._getPrev(e),n=this._getCurr(t);for(;e<this._prevLen||t<this._currLen;){if(null===i){this._acceptCurr(n),n=this._getCurr(++t);continue}if(null===n){this._acceptPrev(i),i=this._getPrev(++e);continue}if(n.oldEnd<=i.newPosition){this._acceptCurr(n),n=this._getCurr(++t);continue}if(i.newEnd<=n.oldPosition){this._acceptPrev(i),i=this._getPrev(++e);continue}if(n.oldPosition<i.newPosition){const[e,t]=QUe._splitCurr(n,i.newPosition-n.oldPosition);this._acceptCurr(e),n=t;continue}if(i.newPosition<n.oldPosition){const[e,t]=QUe._splitPrev(i,n.oldPosition-i.newPosition);this._acceptPrev(e),i=t;continue}let o,s;if(n.oldEnd===i.newEnd)o=i,s=n,i=this._getPrev(++e),n=this._getCurr(++t);else if(n.oldEnd<i.newEnd){const[e,r]=QUe._splitPrev(i,n.oldLength);o=e,s=n,i=r,n=this._getCurr(++t)}else{const[t,r]=QUe._splitCurr(n,i.newLength);o=i,s=t,i=this._getPrev(++e),n=r}this._result[this._resultLen++]=new YUe(o.oldPosition,o.oldText,s.newPosition,s.newText),this._prevDeltaOffset+=o.newLength-o.oldLength,this._currDeltaOffset+=s.newLength-s.oldLength}const o=QUe._merge(this._result);return QUe._removeNoOps(o)}_acceptCurr(e){this._result[this._resultLen++]=QUe._rebaseCurr(this._prevDeltaOffset,e),this._currDeltaOffset+=e.newLength-e.oldLength}_getCurr(e){return e<this._currLen?this._currEdits[e]:null}_acceptPrev(e){this._result[this._resultLen++]=QUe._rebasePrev(this._currDeltaOffset,e),this._prevDeltaOffset+=e.newLength-e.oldLength}_getPrev(e){return e<this._prevLen?this._prevEdits[e]:null}static _rebaseCurr(e,t){return new YUe(t.oldPosition-e,t.oldText,t.newPosition,t.newText)}static _rebasePrev(e,t){return new YUe(t.oldPosition,t.oldText,t.newPosition+e,t.newText)}static _splitPrev(e,t){const i=e.newText.substr(0,t),n=e.newText.substr(t);return[new YUe(e.oldPosition,e.oldText,e.newPosition,i),new YUe(e.oldEnd,"",e.newPosition+t,n)]}static _splitCurr(e,t){const i=e.oldText.substr(0,t),n=e.oldText.substr(t);return[new YUe(e.oldPosition,i,e.newPosition,e.newText),new YUe(e.oldPosition+t,n,e.newEnd,"")]}static _merge(e){if(0===e.length)return e;const t=[];let i=0,n=e[0];for(let o=1;o<e.length;o++){const s=e[o];n.oldEnd===s.oldPosition?n=new YUe(n.oldPosition,n.oldText+s.oldText,n.newPosition,n.newText+s.newText):(t[i++]=n,n=s)}return t[i++]=n,t}static _removeNoOps(e){if(0===e.length)return e;const t=[];let i=0;for(let n=0;n<e.length;n++){const o=e[n];o.oldText!==o.newText&&(t[i++]=o)}return t}}function XUe(e){return 47===e||92===e}function JUe(e){return e.replace(/[\\/]/g,PCe.sep)}function eKe(e,t=PCe.sep){if(!e)return"";const i=e.length,n=e.charCodeAt(0);if(XUe(n)){if(XUe(e.charCodeAt(1))&&!XUe(e.charCodeAt(2))){let n=3;const o=n;for(;n<i&&!XUe(e.charCodeAt(n));n++);if(o!==n&&!XUe(e.charCodeAt(n+1)))for(n+=1;n<i;n++)if(XUe(e.charCodeAt(n)))return e.slice(0,n+1).replace(/[\\/]/g,t)}return t}if(((o=n)>=65&&o<=90||o>=97&&o<=122)&&58===e.charCodeAt(1))return XUe(e.charCodeAt(2))?e.slice(0,2)+t:e.slice(0,2);var o;let s=e.indexOf("://");if(-1!==s)for(s+=3;s<i;s++)if(XUe(e.charCodeAt(s)))return e.slice(0,s+1);return""}function tKe(e,t,i,n=UCe){if(e===t)return!0;if(!e||!t)return!1;if(t.length>e.length)return!1;if(i){if(!WSe(e,t))return!1;if(t.length===e.length)return!0;let i=t.length;return t.charAt(t.length-1)===n&&i--,e.charAt(i)===n}return t.charAt(t.length-1)!==n&&(t+=n),0===e.indexOf(t)}function iKe(e){return nye(e,!0)}class nKe{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:TSe(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t||!(!e||!t)&&this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}isEqualOrParent(e,t,i=!1){if(e.scheme===t.scheme){if(e.scheme===$Te.file)return tKe(iKe(e),iKe(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(dKe(e.authority,t.authority))return tKe(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return QCe.joinPath(e,...t)}basenameOrAuthority(e){return sKe(e)||e.authority}basename(e){return PCe.basename(e.path)}extname(e){return PCe.extname(e.path)}dirname(e){if(0===e.path.length)return e;let t;return e.scheme===$Te.file?t=QCe.file(VCe(iKe(e))).path:(t=PCe.dirname(e.path),e.authority&&t.length&&47!==t.charCodeAt(0)&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return t=e.scheme===$Te.file?QCe.file(FCe(iKe(e))).path:PCe.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!dKe(e.authority,t.authority))return;if(e.scheme===$Te.file){const i=WCe(iKe(e),iKe(t));return Lve?JUe(i):i}let i=e.path||"/";const n=t.path||"/";if(this._ignorePathCasing(e)){let e=0;for(const t=Math.min(i.length,n.length);e<t&&(i.charCodeAt(e)===n.charCodeAt(e)||i.charAt(e).toLowerCase()===n.charAt(e).toLowerCase());e++);i=n.substr(0,e)+i.substr(e)}return PCe.relative(i,n)}resolvePath(e,t){if(e.scheme===$Te.file){const i=QCe.file(BCe(iKe(e),t));return e.with({authority:i.authority,path:i.path})}var i;return-1===(i=t).indexOf("/")&&(i=JUe(i)),/^[a-zA-Z]:(\/|$)/.test(i)&&(i="/"+i),t=i,e.with({path:PCe.resolve(e.path,t)})}isAbsolutePath(e){return!!e.path&&"/"===e.path[0]}isEqualAuthority(e,t){return e===t||void 0!==e&&void 0!==t&&BSe(e,t)}hasTrailingPathSeparator(e,t=UCe){if(e.scheme===$Te.file){const i=iKe(e);return i.length>eKe(i).length&&i[i.length-1]===t}{const t=e.path;return t.length>1&&47===t.charCodeAt(t.length-1)&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=UCe){return hKe(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=UCe){let i=!1;if(e.scheme===$Te.file){const n=iKe(e);i=void 0!==n&&n.length===eKe(n).length&&n[n.length-1]===t}else{t="/";const n=e.path;i=1===n.length&&47===n.charCodeAt(n.length-1)}return i||hKe(e,t)?e:e.with({path:e.path+"/"})}}const oKe=new nKe((()=>!1)),sKe=(new nKe((e=>e.scheme!==$Te.file||!Eve)),new nKe((e=>!0)),oKe.isEqual.bind(oKe),oKe.isEqualOrParent.bind(oKe),oKe.getComparisonKey.bind(oKe),oKe.basenameOrAuthority.bind(oKe),oKe.basename.bind(oKe)),rKe=(oKe.extname.bind(oKe),oKe.dirname.bind(oKe)),aKe=(oKe.joinPath.bind(oKe),oKe.normalizePath.bind(oKe)),lKe=(oKe.relativePath.bind(oKe),oKe.resolvePath.bind(oKe)),dKe=(oKe.isAbsolutePath.bind(oKe),oKe.isEqualAuthority.bind(oKe)),hKe=oKe.hasTrailingPathSeparator.bind(oKe);var cKe;function uKe(e){return e.toString()}oKe.removeTrailingPathSeparator.bind(oKe),oKe.addTrailingPathSeparator.bind(oKe),function(e){e.META_DATA_LABEL="label",e.META_DATA_DESCRIPTION="description",e.META_DATA_SIZE="size",e.META_DATA_MIME="mime",e.parseMetaData=function(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach((e=>{const[t,n]=e.split(":");t&&n&&i.set(t,n)}));const n=t.path.substring(0,t.path.indexOf(";"));return n&&i.set(e.META_DATA_MIME,n),i}}(cKe||(cKe={}));class gKe{static create(e,t){const i=e.getAlternativeVersionId(),n=fKe(e);return new gKe(i,i,n,n,t,t,[])}constructor(e,t,i,n,o,s,r){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=n,this.beforeCursorState=o,this.afterCursorState=s,this.changes=r}append(e,t,i,n,o){var s,r;t.length>0&&(this.changes=(r=t,null===(s=this.changes)||0===s.length?r:new QUe(s,r).compress())),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+16*(e?e.length:0)}static _writeSelections(e,t,i){if(oLe(e,t?t.length:0,i),i+=4,t)for(const n of t)oLe(e,n.selectionStartLineNumber,i),i+=4,oLe(e,n.selectionStartColumn,i),i+=4,oLe(e,n.positionLineNumber,i),i+=4,oLe(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=nLe(e,t);t+=4;for(let o=0;o<n;o++){const n=nLe(e,t),o=nLe(e,t+=4),s=nLe(e,t+=4),r=nLe(e,t+=4);t+=4,i.push(new hye(n,o,s,r))}return t}serialize(){let e=10+gKe._writeSelectionsSize(this.beforeCursorState)+gKe._writeSelectionsSize(this.afterCursorState)+4;for(const t of this.changes)e+=t.writeSize();const t=new Uint8Array(e);let i=0;oLe(t,this.beforeVersionId,i),i+=4,oLe(t,this.afterVersionId,i),i+=4,rLe(t,this.beforeEOL,i),i+=1,rLe(t,this.afterEOL,i),i+=1,i=gKe._writeSelections(t,this.beforeCursorState,i),i=gKe._writeSelections(t,this.afterCursorState,i),oLe(t,this.changes.length,i),i+=4;for(const e of this.changes)i=e.write(t,i);return t.buffer}static deserialize(e){const t=new Uint8Array(e);let i=0;const n=nLe(t,i);i+=4;const o=nLe(t,i);i+=4;const s=sLe(t,i);i+=1;const r=sLe(t,i);i+=1;const a=[];i=gKe._readSelections(t,i,a);const l=[];i=gKe._readSelections(t,i,l);const d=nLe(t,i);i+=4;const h=[];for(let e=0;e<d;e++)i=YUe.read(t,i,h);return new gKe(n,o,s,r,a,l,h)}}class pKe{get type(){return 0}get resource(){return QCe.isUri(this.model)?this.model:this.model.uri}constructor(e,t,i,n){this.label=e,this.code=t,this.model=i,this._data=gKe.create(i,n)}toString(){return(this._data instanceof gKe?this._data:gKe.deserialize(this._data)).changes.map((e=>e.toString())).join(", ")}matchesResource(e){return(QCe.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof gKe}append(e,t,i,n,o){this._data instanceof gKe&&this._data.append(e,t,i,n,o)}close(){this._data instanceof gKe&&(this._data=this._data.serialize())}open(){this._data instanceof gKe||(this._data=gKe.deserialize(this._data))}undo(){if(QCe.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof gKe&&(this._data=this._data.serialize());const e=gKe.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(QCe.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof gKe&&(this._data=this._data.serialize());const e=gKe.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof gKe&&(this._data=this._data.serialize()),this._data.byteLength+168}}class mKe{get resources(){return this._editStackElementsArr.map((e=>e.resource))}constructor(e,t,i){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const e of this._editStackElementsArr){const t=uKe(e.resource);this._editStackElementsMap.set(t,e)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=uKe(e);return this._editStackElementsMap.has(t)}setModel(e){const t=uKe(QCe.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=uKe(e.uri);return!!this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).canAppend(e)}append(e,t,i,n,o){const s=uKe(e.uri);this._editStackElementsMap.get(s).append(e,t,i,n,o)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=uKe(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${sKe(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function fKe(e){return"\n"===e.getEOL()?0:1}function _Ke(e){return!!e&&(e instanceof pKe||e instanceof mKe)}class vKe{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);_Ke(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);_Ke(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(_Ke(i)&&i.canAppend(this._model))return i;const n=new pKe(ove(0,"Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(n,t),n}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],fKe(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n){const o=this._getOrCreateEditStackElement(e,n),s=this._model.applyEdits(t,!0),r=vKe._computeCursorState(i,s),a=s.map(((e,t)=>({index:t,textChange:e.textChange})));return a.sort(((e,t)=>e.textChange.oldPosition===t.textChange.oldPosition?e.index-t.index:e.textChange.oldPosition-t.textChange.oldPosition)),o.append(this._model,a.map((e=>e.textChange)),fKe(this._model),this._model.getAlternativeVersionId(),r),r}static _computeCursorState(e,t){try{return e?e(t):null}catch(e){return wwe(e),null}}}class bKe{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function wKe(e,t,i,n,o){let s;for(o.spacesDiff=0,o.looksLikeAlignment=!1,s=0;s<t&&s<n&&e.charCodeAt(s)===i.charCodeAt(s);s++);let r=0,a=0;for(let i=s;i<t;i++)32===e.charCodeAt(i)?r++:a++;let l=0,d=0;for(let e=s;e<n;e++)32===i.charCodeAt(e)?l++:d++;if(r>0&&a>0)return;if(l>0&&d>0)return;const h=Math.abs(a-d),c=Math.abs(r-l);if(0===h)return o.spacesDiff=c,void(c>0&&0<=l-1&&l-1<e.length&&l<i.length&&32!==i.charCodeAt(l)&&32===e.charCodeAt(l-1)&&44===e.charCodeAt(e.length-1)&&(o.looksLikeAlignment=!0));c%h!=0||(o.spacesDiff=c/h)}function CKe(e,t,i){const n=Math.min(e.getLineCount(),1e4);let o=0,s=0,r="",a=0;const l=[2,4,6,8,3,5,7],d=[0,0,0,0,0,0,0,0,0],h=new bKe;for(let l=1;l<=n;l++){const n=e.getLineLength(l),c=e.getLineContent(l),u=n<=65536;let g=!1,p=0,m=0,f=0;for(let t=0,i=n;t<i;t++){const i=u?c.charCodeAt(t):e.getLineCharCode(l,t);if(9===i)f++;else{if(32!==i){g=!0,p=t;break}m++}}if(!g)continue;if(f>0?o++:m>1&&s++,wKe(r,a,c,p,h),h.looksLikeAlignment&&(!i||t!==h.spacesDiff))continue;const _=h.spacesDiff;_<=8&&d[_]++,r=c,a=p}let c=i;o!==s&&(c=o<s);let u=t;if(c){let e=c?0:.1*n;l.forEach((t=>{const i=d[t];i>e&&(e=i,u=t)})),4===u&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(u=2)}return{insertSpaces:c,tabSize:u}}function yKe(e){return(1&e.metadata)>>>0}function SKe(e,t){e.metadata=254&e.metadata|t}function xKe(e){return(2&e.metadata)>>>1==1}function kKe(e,t){e.metadata=253&e.metadata|(t?1:0)<<1}function LKe(e){return(4&e.metadata)>>>2==1}function DKe(e,t){e.metadata=251&e.metadata|(t?1:0)<<2}function EKe(e,t){e.metadata=231&e.metadata|t<<3}function NKe(e,t){e.metadata=223&e.metadata|(t?1:0)<<5}class IKe{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,SKe(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,DKe(this,!1),EKe(this,1),NKe(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,kKe(this,!1)}reset(e,t,i,n){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=n}setOptions(e){this.options=e;const t=this.options.className;DKe(this,"squiggly-error"===t||"squiggly-warning"===t||"squiggly-info"===t),EKe(this,this.options.stickiness),NKe(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const TKe=new IKe(null,0,0);TKe.parent=TKe,TKe.left=TKe,TKe.right=TKe,SKe(TKe,0);class MKe{constructor(){this.root=TKe,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,n,o){return this.root===TKe?[]:function(e,t,i,n,o,s){let r=e.root,a=0,l=0,d=0,h=0;const c=[];let u=0;for(;r!==TKe;)if(xKe(r))kKe(r.left,!1),kKe(r.right,!1),r===r.parent.right&&(a-=r.parent.delta),r=r.parent;else{if(!xKe(r.left)){if(l=a+r.maxEnd,l<t){kKe(r,!0);continue}if(r.left!==TKe){r=r.left;continue}}if(d=a+r.start,d>i)kKe(r,!0);else{if(h=a+r.end,h>=t){r.setCachedOffsets(d,h,s);let e=!0;n&&r.ownerId&&r.ownerId!==n&&(e=!1),o&&LKe(r)&&(e=!1),e&&(c[u++]=r)}kKe(r,!0),r.right===TKe||xKe(r.right)||(a+=r.delta,r=r.right)}}return kKe(e.root,!1),c}(this,e,t,i,n,o)}search(e,t,i){return this.root===TKe?[]:function(e,t,i,n){let o=e.root,s=0,r=0,a=0;const l=[];let d=0;for(;o!==TKe;){if(xKe(o)){kKe(o.left,!1),kKe(o.right,!1),o===o.parent.right&&(s-=o.parent.delta),o=o.parent;continue}if(o.left!==TKe&&!xKe(o.left)){o=o.left;continue}r=s+o.start,a=s+o.end,o.setCachedOffsets(r,a,n);let e=!0;t&&o.ownerId&&o.ownerId!==t&&(e=!1),i&&LKe(o)&&(e=!1),e&&(l[d++]=o),kKe(o,!0),o.right===TKe||xKe(o.right)||(s+=o.delta,o=o.right)}return kKe(e.root,!1),l}(this,e,t,i)}collectNodesFromOwner(e){return function(e,t){let i=e.root;const n=[];let o=0;for(;i!==TKe;)xKe(i)?(kKe(i.left,!1),kKe(i.right,!1),i=i.parent):i.left===TKe||xKe(i.left)?(i.ownerId===t&&(n[o++]=i),kKe(i,!0),i.right===TKe||xKe(i.right)||(i=i.right)):i=i.left;return kKe(e.root,!1),n}(this,e)}collectNodesPostOrder(){return function(e){let t=e.root;const i=[];let n=0;for(;t!==TKe;)xKe(t)?(kKe(t.left,!1),kKe(t.right,!1),t=t.parent):t.left===TKe||xKe(t.left)?t.right===TKe||xKe(t.right)?(i[n++]=t,kKe(t,!0)):t=t.right:t=t.left;return kKe(e.root,!1),i}(this)}insert(e){OKe(this,e),this._normalizeDeltaIfNecessary()}delete(e){PKe(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let n=0;for(;e!==this.root;)e===e.parent.right&&(n+=e.parent.delta),e=e.parent;const o=i.start+n,s=i.end+n;i.setCachedOffsets(o,s,t)}acceptReplace(e,t,i,n){const o=function(e,t,i){let n=e.root,o=0,s=0,r=0,a=0;const l=[];let d=0;for(;n!==TKe;)if(xKe(n))kKe(n.left,!1),kKe(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),n=n.parent;else{if(!xKe(n.left)){if(s=o+n.maxEnd,s<t){kKe(n,!0);continue}if(n.left!==TKe){n=n.left;continue}}r=o+n.start,r>i?kKe(n,!0):(a=o+n.end,a>=t&&(n.setCachedOffsets(r,a,0),l[d++]=n),kKe(n,!0),n.right===TKe||xKe(n.right)||(o+=n.delta,n=n.right))}return kKe(e.root,!1),l}(this,e,e+t);for(let e=0,t=o.length;e<t;e++)PKe(this,o[e]);this._normalizeDeltaIfNecessary(),function(e,t,i,n){let o=e.root,s=0,r=0,a=0;const l=n-(i-t);for(;o!==TKe;)if(xKe(o))kKe(o.left,!1),kKe(o.right,!1),o===o.parent.right&&(s-=o.parent.delta),HKe(o),o=o.parent;else{if(!xKe(o.left)){if(r=s+o.maxEnd,r<t){kKe(o,!0);continue}if(o.left!==TKe){o=o.left;continue}}a=s+o.start,a>i?(o.start+=l,o.end+=l,o.delta+=l,(o.delta<-1073741824||o.delta>1073741824)&&(e.requestNormalizeDelta=!0),kKe(o,!0)):(kKe(o,!0),o.right===TKe||xKe(o.right)||(s+=o.delta,o=o.right))}kKe(e.root,!1)}(this,e,e+t,i),this._normalizeDeltaIfNecessary();for(let s=0,r=o.length;s<r;s++){const r=o[s];r.start=r.cachedAbsoluteStart,r.end=r.cachedAbsoluteEnd,RKe(r,e,e+t,i,n),r.maxEnd=r.end,OKe(this,r)}this._normalizeDeltaIfNecessary()}_normalizeDeltaIfNecessary(){this.requestNormalizeDelta&&(this.requestNormalizeDelta=!1,function(e){let t=e.root,i=0;for(;t!==TKe;)t.left===TKe||xKe(t.left)?t.right===TKe||xKe(t.right)?(t.start=i+t.start,t.end=i+t.end,t.delta=0,HKe(t),kKe(t,!0),kKe(t.left,!1),kKe(t.right,!1),t===t.parent.right&&(i-=t.parent.delta),t=t.parent):(i+=t.delta,t=t.right):t=t.left;kKe(e.root,!1)}(this))}}function AKe(e,t,i,n){return e<i||!(e>i)&&1!==n&&(2===n||t)}function RKe(e,t,i,n,o){const s=function(e){return(24&e.metadata)>>>3}(e),r=0===s||2===s,a=1===s||2===s,l=i-t,d=n,h=Math.min(l,d),c=e.start;let u=!1;const g=e.end;let p=!1;t<=c&&g<=i&&function(e){return(32&e.metadata)>>>5==1}(e)&&(e.start=t,u=!0,e.end=t,p=!0);{const e=o?1:l>0?2:0;!u&&AKe(c,r,t,e)&&(u=!0),!p&&AKe(g,a,t,e)&&(p=!0)}if(h>0&&!o){const e=l>d?2:0;!u&&AKe(c,r,t+h,e)&&(u=!0),!p&&AKe(g,a,t+h,e)&&(p=!0)}{const n=o?1:0;!u&&AKe(c,r,i,n)&&(e.start=t+d,u=!0),!p&&AKe(g,a,i,n)&&(e.end=t+d,p=!0)}const m=d-l;u||(e.start=Math.max(0,c+m)),p||(e.end=Math.max(0,g+m)),e.start>e.end&&(e.end=e.start)}function OKe(e,t){if(e.root===TKe)return t.parent=TKe,t.left=TKe,t.right=TKe,SKe(t,0),e.root=t,e.root;!function(e,t){let i=0,n=e.root;const o=t.start,s=t.end;for(;;)if(r=o,a=s,l=n.start+i,d=n.end+i,(r===l?a-d:r-l)<0){if(n.left===TKe){t.start-=i,t.end-=i,t.maxEnd-=i,n.left=t;break}n=n.left}else{if(n.right===TKe){t.start-=i+n.delta,t.end-=i+n.delta,t.maxEnd-=i+n.delta,n.right=t;break}i+=n.delta,n=n.right}var r,a,l,d;t.parent=n,t.left=TKe,t.right=TKe,SKe(t,1)}(e,t),zKe(t.parent);let i=t;for(;i!==e.root&&1===yKe(i.parent);)if(i.parent===i.parent.parent.left){const t=i.parent.parent.right;1===yKe(t)?(SKe(i.parent,0),SKe(t,0),SKe(i.parent.parent,1),i=i.parent.parent):(i===i.parent.right&&(i=i.parent,BKe(e,i)),SKe(i.parent,0),SKe(i.parent.parent,1),WKe(e,i.parent.parent))}else{const t=i.parent.parent.left;1===yKe(t)?(SKe(i.parent,0),SKe(t,0),SKe(i.parent.parent,1),i=i.parent.parent):(i===i.parent.left&&(i=i.parent,WKe(e,i)),SKe(i.parent,0),SKe(i.parent.parent,1),BKe(e,i.parent.parent))}return SKe(e.root,0),t}function PKe(e,t){let i,n;if(t.left===TKe?(i=t.right,n=t,i.delta+=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta):t.right===TKe?(i=t.left,n=t):(n=function(e){for(;e.left!==TKe;)e=e.left;return e}(t.right),i=n.right,i.start+=n.delta,i.end+=n.delta,i.delta+=n.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=t.delta,n.end+=t.delta,n.delta=t.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0)),n===e.root)return e.root=i,SKe(i,0),t.detach(),FKe(),HKe(i),void(e.root.parent=TKe);const o=1===yKe(n);if(n===n.parent.left?n.parent.left=i:n.parent.right=i,n===t?i.parent=n.parent:(n.parent===t?i.parent=n:i.parent=n.parent,n.left=t.left,n.right=t.right,n.parent=t.parent,SKe(n,yKe(t)),t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==TKe&&(n.left.parent=n),n.right!==TKe&&(n.right.parent=n)),t.detach(),o)return zKe(i.parent),n!==t&&(zKe(n),zKe(n.parent)),void FKe();let s;for(zKe(i),zKe(i.parent),n!==t&&(zKe(n),zKe(n.parent));i!==e.root&&0===yKe(i);)i===i.parent.left?(s=i.parent.right,1===yKe(s)&&(SKe(s,0),SKe(i.parent,1),BKe(e,i.parent),s=i.parent.right),0===yKe(s.left)&&0===yKe(s.right)?(SKe(s,1),i=i.parent):(0===yKe(s.right)&&(SKe(s.left,0),SKe(s,1),WKe(e,s),s=i.parent.right),SKe(s,yKe(i.parent)),SKe(i.parent,0),SKe(s.right,0),BKe(e,i.parent),i=e.root)):(s=i.parent.left,1===yKe(s)&&(SKe(s,0),SKe(i.parent,1),WKe(e,i.parent),s=i.parent.left),0===yKe(s.left)&&0===yKe(s.right)?(SKe(s,1),i=i.parent):(0===yKe(s.left)&&(SKe(s.right,0),SKe(s,1),BKe(e,s),s=i.parent.left),SKe(s,yKe(i.parent)),SKe(i.parent,0),SKe(s.left,0),WKe(e,i.parent),i=e.root));SKe(i,0),FKe()}function FKe(){TKe.parent=TKe,TKe.delta=0,TKe.start=0,TKe.end=0}function BKe(e,t){const i=t.right;i.delta+=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta,t.right=i.left,i.left!==TKe&&(i.left.parent=t),i.parent=t.parent,t.parent===TKe?e.root=i:t===t.parent.left?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i,HKe(t),HKe(i)}function WKe(e,t){const i=t.left;t.delta-=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(e.requestNormalizeDelta=!0),t.start-=i.delta,t.end-=i.delta,t.left=i.right,i.right!==TKe&&(i.right.parent=t),i.parent=t.parent,t.parent===TKe?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i,HKe(t),HKe(i)}function VKe(e){let t=e.end;if(e.left!==TKe){const i=e.left.maxEnd;i>t&&(t=i)}if(e.right!==TKe){const i=e.right.maxEnd+e.delta;i>t&&(t=i)}return t}function HKe(e){e.maxEnd=VKe(e)}function zKe(e){for(;e!==TKe;){const t=VKe(e);if(e.maxEnd===t)return;e.maxEnd=t,e=e.parent}}class UKe{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==KKe)return jKe(this.right);let e=this;for(;e.parent!==KKe&&e.parent.left!==e;)e=e.parent;return e.parent===KKe?KKe:e.parent}prev(){if(this.left!==KKe)return qKe(this.left);let e=this;for(;e.parent!==KKe&&e.parent.right!==e;)e=e.parent;return e.parent===KKe?KKe:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const KKe=new UKe(null,0);function jKe(e){for(;e.left!==KKe;)e=e.left;return e}function qKe(e){for(;e.right!==KKe;)e=e.right;return e}function $Ke(e){return e===KKe?0:e.size_left+e.piece.length+$Ke(e.right)}function GKe(e){return e===KKe?0:e.lf_left+e.piece.lineFeedCnt+GKe(e.right)}function ZKe(){KKe.parent=KKe}function YKe(e,t){const i=t.right;i.size_left+=t.size_left+(t.piece?t.piece.length:0),i.lf_left+=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),t.right=i.left,i.left!==KKe&&(i.left.parent=t),i.parent=t.parent,t.parent===KKe?e.root=i:t.parent.left===t?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i}function QKe(e,t){const i=t.left;t.left=i.right,i.right!==KKe&&(i.right.parent=t),i.parent=t.parent,t.size_left-=i.size_left+(i.piece?i.piece.length:0),t.lf_left-=i.lf_left+(i.piece?i.piece.lineFeedCnt:0),t.parent===KKe?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i}function XKe(e,t){let i,n;if(t.left===KKe?(n=t,i=n.right):t.right===KKe?(n=t,i=n.left):(n=jKe(t.right),i=n.right),n===e.root)return e.root=i,i.color=0,t.detach(),ZKe(),void(e.root.parent=KKe);const o=1===n.color;if(n===n.parent.left?n.parent.left=i:n.parent.right=i,n===t?(i.parent=n.parent,tje(e,i)):(n.parent===t?i.parent=n:i.parent=n.parent,tje(e,i),n.left=t.left,n.right=t.right,n.parent=t.parent,n.color=t.color,t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==KKe&&(n.left.parent=n),n.right!==KKe&&(n.right.parent=n),n.size_left=t.size_left,n.lf_left=t.lf_left,tje(e,n)),t.detach(),i.parent.left===i){const t=$Ke(i),n=GKe(i);if(t!==i.parent.size_left||n!==i.parent.lf_left){const o=t-i.parent.size_left,s=n-i.parent.lf_left;i.parent.size_left=t,i.parent.lf_left=n,eje(e,i.parent,o,s)}}if(tje(e,i.parent),o)return void ZKe();let s;for(;i!==e.root&&0===i.color;)i===i.parent.left?(s=i.parent.right,1===s.color&&(s.color=0,i.parent.color=1,YKe(e,i.parent),s=i.parent.right),0===s.left.color&&0===s.right.color?(s.color=1,i=i.parent):(0===s.right.color&&(s.left.color=0,s.color=1,QKe(e,s),s=i.parent.right),s.color=i.parent.color,i.parent.color=0,s.right.color=0,YKe(e,i.parent),i=e.root)):(s=i.parent.left,1===s.color&&(s.color=0,i.parent.color=1,QKe(e,i.parent),s=i.parent.left),0===s.left.color&&0===s.right.color?(s.color=1,i=i.parent):(0===s.left.color&&(s.right.color=0,s.color=1,YKe(e,s),s=i.parent.left),s.color=i.parent.color,i.parent.color=0,s.left.color=0,QKe(e,i.parent),i=e.root));i.color=0,ZKe()}function JKe(e,t){for(tje(e,t);t!==e.root&&1===t.parent.color;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;1===i.color?(t.parent.color=0,i.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.right&&YKe(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,QKe(e,t.parent.parent))}else{const i=t.parent.parent.left;1===i.color?(t.parent.color=0,i.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.left&&QKe(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,YKe(e,t.parent.parent))}e.root.color=0}function eje(e,t,i,n){for(;t!==e.root&&t!==KKe;)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}function tje(e,t){let i=0,n=0;if(t!==e.root){for(;t!==e.root&&t===t.parent.right;)t=t.parent;if(t!==e.root)for(i=$Ke((t=t.parent).left)-t.size_left,n=GKe(t.left)-t.lf_left,t.size_left+=i,t.lf_left+=n;t!==e.root&&(0!==i||0!==n);)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}}KKe.parent=KKe,KKe.left=KKe,KKe.right=KKe,KKe.color=0;const ije=65535;function nje(e){let t;return t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length),t.set(e,0),t}class oje{constructor(e,t,i,n,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=o}}function sje(e,t=!0){const i=[0];let n=1;for(let t=0,o=e.length;t<o;t++){const s=e.charCodeAt(t);13===s?t+1<o&&10===e.charCodeAt(t+1)?(i[n++]=t+2,t++):i[n++]=t+1:10===s&&(i[n++]=t+1)}return t?nje(i):i}class rje{constructor(e,t,i,n,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=o}}class aje{constructor(e,t){this.buffer=e,this.lineStarts=t}}class lje{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==KKe&&e.iterate(e.root,(e=>(e!==KKe&&this._pieces.push(e.piece),!0)))}read(){return 0===this._pieces.length?0===this._index?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:0===this._index?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class dje{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber<e&&i.nodeStartLineNumber+i.node.piece.lineFeedCnt>=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const i=this._cache;for(let n=0;n<i.length;n++){const o=i[n];(null===o.node.parent||o.nodeStartOffset>=e)&&(i[n]=null,t=!0)}if(t){const e=[];for(const t of i)null!==t&&e.push(t);this._cache=e}}}class hje{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new aje("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=KKe,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let t=0,i=e.length;t<i;t++)if(e[t].buffer.length>0){e[t].lineStarts||(e[t].lineStarts=sje(e[t].buffer));const i=new rje(t+1,{line:0,column:0},{line:e[t].lineStarts.length-1,column:e[t].buffer.length-e[t].lineStarts[e[t].lineStarts.length-1]},e[t].lineStarts.length-1,e[t].buffer.length);this._buffers.push(e[t]),n=this.rbInsertRight(n,i)}this._searchCache=new dje(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=65535-Math.floor(21845),i=2*t;let n="",o=0;const s=[];if(this.iterate(this.root,(r=>{const a=this.getNodeContent(r),l=a.length;if(o<=t||o+l<i)return n+=a,o+=l,!0;const d=n.replace(/\r\n|\r|\n/g,e);return s.push(new aje(d,sje(d))),n=a,o=l,!0})),o>0){const t=n.replace(/\r\n|\r|\n/g,e);s.push(new aje(t,sje(t)))}this.create(s,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new lje(this,e)}getOffsetAt(e,t){let i=0,n=this.root;for(;n!==KKe;)if(n.left!==KKe&&n.lf_left+1>=e)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt+1>=e)return i+=n.size_left,i+(this.getAccumulatedValue(n,e-n.lf_left-2)+t-1);e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right}return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0;const n=e;for(;t!==KKe;)if(0!==t.size_left&&t.size_left>=e)t=t.left;else{if(t.size_left+t.piece.length>=e){const o=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+o.index,0===o.index){const e=this.getOffsetAt(i+1,1);return new lye(i+1,n-e+1)}return new lye(i+1,o.remainder+1)}if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===KKe){const t=this.getOffsetAt(i+1,1);return new lye(i+1,n-e-t+1)}t=t.right}return new lye(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const i=this.nodeAt2(e.startLineNumber,e.startColumn),n=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,n);return t?t===this._EOL&&this._EOLNormalized&&t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const i=e.node,n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n.substring(o+e.remainder,o+t.remainder)}let i=e.node;const n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let s=n.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==KKe;){const e=this._buffers[i.piece.bufferIndex].buffer,n=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){s+=e.substring(n,n+t.remainder);break}s+=e.substr(n,i.piece.length),i=i.next()}return s}getLinesContent(){const e=[];let t=0,i="",n=!1;return this.iterate(this.root,(o=>{if(o===KKe)return!0;const s=o.piece;let r=s.length;if(0===r)return!0;const a=this._buffers[s.bufferIndex].buffer,l=this._buffers[s.bufferIndex].lineStarts,d=s.start.line,h=s.end.line;let c=l[d]+s.start.column;if(n&&(10===a.charCodeAt(c)&&(c++,r--),e[t++]=i,i="",n=!1,0===r))return!0;if(d===h)return this._EOLNormalized||13!==a.charCodeAt(c+r-1)?i+=a.substr(c,r):(n=!0,i+=a.substr(c,r-1)),!0;i+=this._EOLNormalized?a.substring(c,Math.max(c,l[d+1]-this._EOLLength)):a.substring(c,l[d+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let n=d+1;n<h;n++)i=this._EOLNormalized?a.substring(l[n],l[n+1]-this._EOLLength):a.substring(l[n],l[n+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;return this._EOLNormalized||13!==a.charCodeAt(l[h]+s.end.column-1)?i=a.substr(l[h],s.end.column):(n=!0,0===s.end.column?t--:i=a.substr(l[h],s.end.column-1)),!0})),n&&(e[t++]=i,i=""),e[t++]=i,e}getLength(){return this._length}getLineCount(){return this._lineCnt}getLineContent(e){return this._lastVisitedLine.lineNumber===e||(this._lastVisitedLine.lineNumber=e,e===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(e):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(e,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(e).replace(/(\r\n|\r|\n)$/,"")),this._lastVisitedLine.value}_getCharCode(e){if(e.remainder===e.node.piece.length){const t=e.node.next();if(!t)return 0;const i=this._buffers[t.piece.bufferIndex],n=this.offsetInBuffer(t.piece.bufferIndex,t.piece.start);return i.buffer.charCodeAt(n)}{const t=this._buffers[e.node.piece.bufferIndex],i=this.offsetInBuffer(e.node.piece.bufferIndex,e.node.piece.start)+e.remainder;return t.buffer.charCodeAt(i)}}getLineCharCode(e,t){const i=this.nodeAt2(e,t+1);return this._getCharCode(i)}getLineLength(e){if(e===this.getLineCount()){const t=this.getOffsetAt(e,1);return this.getLength()-t}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength}findMatchesInNode(e,t,i,n,o,s,r,a,l,d,h){const c=this._buffers[e.piece.bufferIndex],u=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),g=this.offsetInBuffer(e.piece.bufferIndex,o),p=this.offsetInBuffer(e.piece.bufferIndex,s);let m;const f={line:0,column:0};let _,v;t._wordSeparators?(_=c.buffer.substring(g,p),v=e=>e+g,t.reset(0)):(_=c.buffer,v=e=>e,t.reset(g));do{if(m=t.next(_),m){if(v(m.index)>=p)return d;this.positionInBuffer(e,v(m.index)-u,f);const t=this.getLineFeedCnt(e.piece.bufferIndex,o,f),s=f.line===o.line?f.column-o.column+n:f.column+1,r=s+m[0].length;if(h[d++]=REe(new dye(i+t,s,i+t,r),m,a),v(m.index)+m[0].length>=p)return d;if(d>=l)return d}}while(m);return d}findMatchesLineByLine(e,t,i,n){const o=[];let s=0;const r=new BEe(t.wordSeparators,t.regex);let a=this.nodeAt2(e.startLineNumber,e.startColumn);if(null===a)return[];const l=this.nodeAt2(e.endLineNumber,e.endColumn);if(null===l)return[];let d=this.positionInBuffer(a.node,a.remainder);const h=this.positionInBuffer(l.node,l.remainder);if(a.node===l.node)return this.findMatchesInNode(a.node,r,e.startLineNumber,e.startColumn,d,h,t,i,n,s,o),o;let c=e.startLineNumber,u=a.node;for(;u!==l.node;){const l=this.getLineFeedCnt(u.piece.bufferIndex,d,u.piece.end);if(l>=1){const a=this._buffers[u.piece.bufferIndex].lineStarts,h=this.offsetInBuffer(u.piece.bufferIndex,u.piece.start),g=a[d.line+l],p=c===e.startLineNumber?e.startColumn:1;if(s=this.findMatchesInNode(u,r,c,p,d,this.positionInBuffer(u,g-h),t,i,n,s,o),s>=n)return o;c+=l}const h=c===e.startLineNumber?e.startColumn-1:0;if(c===e.endLineNumber){const a=this.getLineContent(c).substring(h,e.endColumn-1);return s=this._findMatchesInLine(t,r,a,e.endLineNumber,h,s,o,i,n),o}if(s=this._findMatchesInLine(t,r,this.getLineContent(c).substr(h),c,h,s,o,i,n),s>=n)return o;c++,a=this.nodeAt2(c,1),u=a.node,d=this.positionInBuffer(a.node,a.remainder)}if(c===e.endLineNumber){const a=c===e.startLineNumber?e.startColumn-1:0,l=this.getLineContent(c).substring(a,e.endColumn-1);return s=this._findMatchesInLine(t,r,l,e.endLineNumber,a,s,o,i,n),o}const g=c===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(l.node,r,c,g,d,h,t,i,n,s,o),o}_findMatchesInLine(e,t,i,n,o,s,r,a,l){const d=e.wordSeparators;if(!a&&e.simpleSearch){const t=e.simpleSearch,a=t.length,h=i.length;let c=-a;for(;-1!==(c=i.indexOf(t,c+a));)if((!d||FEe(d,i,h,c,a))&&(r[s++]=new Fke(new dye(n,c+1+o,n,c+1+a+o),null),s>=l))return s;return s}let h;t.reset(0);do{if(h=t.next(i),h&&(r[s++]=REe(new dye(n,h.index+1+o,n,h.index+1+h[0].length+o),h,a),s>=l))return s}while(h);return s}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==KKe){const{node:i,remainder:n,nodeStartOffset:o}=this.nodeAt(e),s=i.piece,r=s.bufferIndex,a=this.positionInBuffer(i,n);if(0===i.piece.bufferIndex&&s.end.line===this._lastChangeBufferPos.line&&s.end.column===this._lastChangeBufferPos.column&&o+s.length===e&&t.length<ije)return this.appendToNode(i,t),void this.computeBufferMetadata();if(o===e)this.insertContentToNodeLeft(t,i),this._searchCache.validate(e);else if(o+i.piece.length>e){const e=[];let o=new rje(s.bufferIndex,a,s.end,this.getLineFeedCnt(s.bufferIndex,a,s.end),this.offsetInBuffer(r,s.end)-this.offsetInBuffer(r,a));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&10===this.nodeCharCodeAt(i,n)){const e={line:o.start.line+1,column:0};o=new rje(o.bufferIndex,e,o.end,this.getLineFeedCnt(o.bufferIndex,e,o.end),o.length-1),t+="\n"}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(13===this.nodeCharCodeAt(i,n-1)){const o=this.positionInBuffer(i,n-1);this.deleteNodeTail(i,o),t="\r"+t,0===i.piece.length&&e.push(i)}else this.deleteNodeTail(i,a);else this.deleteNodeTail(i,a);const l=this.createNewPieces(t);o.length>0&&this.rbInsertRight(i,o);let d=i;for(let e=0;e<l.length;e++)d=this.rbInsertRight(d,l[e]);this.deleteNodes(e)}else this.insertContentToNodeRight(t,i)}else{const e=this.createNewPieces(t);let i=this.rbInsertLeft(null,e[0]);for(let t=1;t<e.length;t++)i=this.rbInsertRight(i,e[t])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===KKe)return;const i=this.nodeAt(e),n=this.nodeAt(e+t),o=i.node,s=n.node;if(o===s){const s=this.positionInBuffer(o,i.remainder),r=this.positionInBuffer(o,n.remainder);if(i.nodeStartOffset===e){if(t===o.piece.length){const e=o.next();return XKe(this,o),this.validateCRLFWithPrevNode(e),void this.computeBufferMetadata()}return this.deleteNodeHead(o,r),this._searchCache.validate(e),this.validateCRLFWithPrevNode(o),void this.computeBufferMetadata()}return i.nodeStartOffset+o.piece.length===e+t?(this.deleteNodeTail(o,s),this.validateCRLFWithNextNode(o),void this.computeBufferMetadata()):(this.shrinkNode(o,s,r),void this.computeBufferMetadata())}const r=[],a=this.positionInBuffer(o,i.remainder);this.deleteNodeTail(o,a),this._searchCache.validate(e),0===o.piece.length&&r.push(o);const l=this.positionInBuffer(s,n.remainder);this.deleteNodeHead(s,l),0===s.piece.length&&r.push(s);for(let e=o.next();e!==KKe&&e!==s;e=e.next())r.push(e);const d=0===o.piece.length?o.prev():o;this.deleteNodes(r),this.validateCRLFWithNextNode(d),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){const i=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){const n=t.piece,o={line:n.start.line+1,column:0},s=new rje(n.bufferIndex,o,n.end,this.getLineFeedCnt(n.bufferIndex,o,n.end),n.length-1);t.piece=s,e+="\n",eje(this,t,-1,-1),0===t.piece.length&&i.push(t)}const n=this.createNewPieces(e);let o=this.rbInsertLeft(t,n[n.length-1]);for(let e=n.length-2;e>=0;e--)o=this.rbInsertLeft(o,n[e]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+="\n");const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let o=n;for(let e=1;e<i.length;e++)o=this.rbInsertRight(o,i[e]);this.validateCRLFWithPrevNode(n)}positionInBuffer(e,t,i){const n=e.piece,o=e.piece.bufferIndex,s=this._buffers[o].lineStarts,r=s[n.start.line]+n.start.column+t;let a=n.start.line,l=n.end.line,d=0,h=0,c=0;for(;a<=l&&(d=a+(l-a)/2|0,c=s[d],d!==l);)if(h=s[d+1],r<c)l=d-1;else{if(!(r>=h))break;a=d+1}return i?(i.line=d,i.column=r-c,null):{line:d,column:r-c}}getLineFeedCnt(e,t,i){if(0===i.column)return i.line-t.line;const n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;const o=n[i.line+1],s=n[i.line]+i.column;if(o>s+1)return i.line-t.line;const r=s-1;return 13===this._buffers[e].buffer.charCodeAt(r)?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;t<e.length;t++)XKe(this,e[t])}createNewPieces(e){if(e.length>ije){const t=[];for(;e.length>ije;){const i=e.charCodeAt(65534);let n;13===i||i>=55296&&i<=56319?(n=e.substring(0,65534),e=e.substring(65534)):(n=e.substring(0,ije),e=e.substring(ije));const o=sje(n);t.push(new rje(this._buffers.length,{line:0,column:0},{line:o.length-1,column:n.length-o[o.length-1]},o.length-1,n.length)),this._buffers.push(new aje(n,o))}const i=sje(e);return t.push(new rje(this._buffers.length,{line:0,column:0},{line:i.length-1,column:e.length-i[i.length-1]},i.length-1,e.length)),this._buffers.push(new aje(e,i)),t}let t=this._buffers[0].buffer.length;const i=sje(e,!1);let n=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&0!==t&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},n=this._lastChangeBufferPos;for(let e=0;e<i.length;e++)i[e]+=t+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+="_"+e,t+=1}else{if(0!==t)for(let e=0;e<i.length;e++)i[e]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+=e}const o=this._buffers[0].buffer.length,s=this._buffers[0].lineStarts.length-1,r={line:s,column:o-this._buffers[0].lineStarts[s]},a=new rje(0,n,r,this.getLineFeedCnt(0,n,r),o-t);return this._lastChangeBufferPos=r,[a]}getLineRawContent(e,t=0){let i=this.root,n="";const o=this._searchCache.get2(e);if(o){i=o.node;const s=this.getAccumulatedValue(i,e-o.nodeStartLineNumber-1),r=this._buffers[i.piece.bufferIndex].buffer,a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(o.nodeStartLineNumber+i.piece.lineFeedCnt!==e){const n=this.getAccumulatedValue(i,e-o.nodeStartLineNumber);return r.substring(a+s,a+n-t)}n=r.substring(a+s,a+i.piece.length)}else{let o=0;const s=e;for(;i!==KKe;)if(i.left!==KKe&&i.lf_left>=e-1)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt>e-1){const n=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return o+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:o,nodeStartLineNumber:s-(e-1-i.lf_left)}),a.substring(l+n,l+r-t)}if(i.lf_left+i.piece.lineFeedCnt===e-1){const t=this.getAccumulatedValue(i,e-i.lf_left-2),o=this._buffers[i.piece.bufferIndex].buffer,s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=o.substring(s+t,s+i.piece.length);break}e-=i.lf_left+i.piece.lineFeedCnt,o+=i.size_left+i.piece.length,i=i.right}}for(i=i.next();i!==KKe;){const e=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const o=this.getAccumulatedValue(i,0),s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=e.substring(s,s+o-t),n}{const t=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=e.substr(t,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==KKe;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){const i=e.piece,n=this.positionInBuffer(e,t),o=n.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){const t=this.getLineFeedCnt(e.piece.bufferIndex,i.start,n);if(t!==o)return{index:t,remainder:0}}return{index:o,remainder:n.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,n=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?n[i.end.line]+i.end.column-n[i.start.line]-i.start.column:n[o]-n[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.end),s=t,r=this.offsetInBuffer(i.bufferIndex,s),a=this.getLineFeedCnt(i.bufferIndex,i.start,s),l=a-n,d=r-o,h=i.length+d;e.piece=new rje(i.bufferIndex,i.start,s,a,h),eje(this,e,d,l)}deleteNodeHead(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.start),s=t,r=this.getLineFeedCnt(i.bufferIndex,s,i.end),a=r-n,l=o-this.offsetInBuffer(i.bufferIndex,s),d=i.length+l;e.piece=new rje(i.bufferIndex,s,i.end,r,d),eje(this,e,l,a)}shrinkNode(e,t,i){const n=e.piece,o=n.start,s=n.end,r=n.length,a=n.lineFeedCnt,l=t,d=this.getLineFeedCnt(n.bufferIndex,n.start,l),h=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,o);e.piece=new rje(n.bufferIndex,n.start,l,d,h),eje(this,e,h-r,d-a);const c=new rje(n.bufferIndex,i,s,this.getLineFeedCnt(n.bufferIndex,i,s),this.offsetInBuffer(n.bufferIndex,s)-this.offsetInBuffer(n.bufferIndex,i)),u=this.rbInsertRight(e,c);this.validateCRLFWithPrevNode(u)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+="\n");const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=sje(t,!1);for(let e=0;e<o.length;e++)o[e]+=n;if(i){const e=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:n-e}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(o.slice(1));const s=this._buffers[0].lineStarts.length-1,r={line:s,column:this._buffers[0].buffer.length-this._buffers[0].lineStarts[s]},a=e.piece.length+t.length,l=e.piece.lineFeedCnt,d=this.getLineFeedCnt(0,e.piece.start,r),h=d-l;e.piece=new rje(e.piece.bufferIndex,e.piece.start,r,d,a),this._lastChangeBufferPos=r,eje(this,e,t.length,h)}nodeAt(e){let t=this.root;const i=this._searchCache.get(e);if(i)return{node:i.node,nodeStartOffset:i.nodeStartOffset,remainder:e-i.nodeStartOffset};let n=0;for(;t!==KKe;)if(t.size_left>e)t=t.left;else{if(t.size_left+t.piece.length>=e){n+=t.size_left;const i={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(i),i}e-=t.size_left+t.piece.length,n+=t.size_left+t.piece.length,t=t.right}return null}nodeAt2(e,t){let i=this.root,n=0;for(;i!==KKe;)if(i.left!==KKe&&i.lf_left>=e-1)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt>e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2),s=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(o+t-1,s),nodeStartOffset:n}}if(i.lf_left+i.piece.lineFeedCnt===e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2);if(o+t-1<=i.piece.length)return{node:i,remainder:o+t-1,nodeStartOffset:n};t-=i.piece.length-o;break}e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==KKe;){if(i.piece.lineFeedCnt>0){const e=this.getAccumulatedValue(i,0),n=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,e),nodeStartOffset:n}}if(i.piece.length>=t-1)return{node:i,remainder:t-1,nodeStartOffset:this.offsetOfNode(i)};t-=i.piece.length,i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(n)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&"\n"===this._EOL)}startWithLF(e){if("string"==typeof e)return 10===e.charCodeAt(0);if(e===KKe||0===e.piece.lineFeedCnt)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,o=i[n]+t.start.column;return n!==i.length-1&&(!(i[n+1]>o+1)&&10===this._buffers[t.bufferIndex].buffer.charCodeAt(o))}endWithCR(e){return"string"==typeof e?13===e.charCodeAt(e.length-1):e!==KKe&&0!==e.piece.lineFeedCnt&&13===this.nodeCharCodeAt(e,e.piece.length-1)}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const i=[],n=this._buffers[e.piece.bufferIndex].lineStarts;let o;o=0===e.piece.end.column?{line:e.piece.end.line-1,column:n[e.piece.end.line]-n[e.piece.end.line-1]-1}:{line:e.piece.end.line,column:e.piece.end.column-1};const s=e.piece.length-1,r=e.piece.lineFeedCnt-1;e.piece=new rje(e.piece.bufferIndex,e.piece.start,o,r,s),eje(this,e,-1,-1),0===e.piece.length&&i.push(e);const a={line:t.piece.start.line+1,column:0},l=t.piece.length-1,d=this.getLineFeedCnt(t.piece.bufferIndex,a,t.piece.end);t.piece=new rje(t.piece.bufferIndex,a,t.piece.end,d,l),eje(this,t,-1,-1),0===t.piece.length&&i.push(t);const h=this.createNewPieces("\r\n");this.rbInsertRight(e,h[0]);for(let e=0;e<i.length;e++)XKe(this,i[e])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const i=t.next();if(this.startWithLF(i)){if(e+="\n",1===i.piece.length)XKe(this,i);else{const e=i.piece,t={line:e.start.line+1,column:0},n=e.length-1,o=this.getLineFeedCnt(e.bufferIndex,t,e.end);i.piece=new rje(e.bufferIndex,t,e.end,o,n),eje(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===KKe)return t(KKe);const i=this.iterate(e.left,t);return i?t(e)&&this.iterate(e.right,t):i}getNodeContent(e){if(e===KKe)return"";const t=this._buffers[e.piece.bufferIndex],i=e.piece,n=this.offsetInBuffer(i.bufferIndex,i.start),o=this.offsetInBuffer(i.bufferIndex,i.end);return t.buffer.substring(n,o)}getPieceContent(e){const t=this._buffers[e.bufferIndex],i=this.offsetInBuffer(e.bufferIndex,e.start),n=this.offsetInBuffer(e.bufferIndex,e.end);return t.buffer.substring(i,n)}rbInsertRight(e,t){const i=new UKe(t,1);if(i.left=KKe,i.right=KKe,i.parent=KKe,i.size_left=0,i.lf_left=0,this.root===KKe)this.root=i,i.color=0;else if(e.right===KKe)e.right=i,i.parent=e;else{const t=jKe(e.right);t.left=i,i.parent=t}return JKe(this,i),i}rbInsertLeft(e,t){const i=new UKe(t,1);if(i.left=KKe,i.right=KKe,i.parent=KKe,i.size_left=0,i.lf_left=0,this.root===KKe)this.root=i,i.color=0;else if(e.left===KKe)e.left=i,i.parent=e;else{const t=qKe(e.left);t.right=i,i.parent=t}return JKe(this,i),i}}class cje extends Owe{constructor(e,t,i,n,o,s,r){super(),this._onDidChangeContent=this._register(new $we),this._BOM=t,this._mightContainNonBasicASCII=!s,this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._pieceTree=new hje(e,i,r)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(e){return this._pieceTree.createSnapshot(e?this._BOM:"")}getOffsetAt(e,t){return this._pieceTree.getOffsetAt(e,t)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,t){const i=e+t,n=this.getPositionAt(e),o=this.getPositionAt(i);return new dye(n.lineNumber,n.column,o.lineNumber,o.column)}getValueInRange(e,t=0){if(e.isEmpty())return"";const i=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,i)}getValueLengthInRange(e,t=0){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;const i=this.getOffsetAt(e.startLineNumber,e.startColumn),n=this.getOffsetAt(e.endLineNumber,e.endColumn);let o=0;const s=this._getEndOfLine(t),r=this.getEOL();return s.length!==r.length&&(o=(s.length-r.length)*(e.endLineNumber-e.startLineNumber)),n-i+o}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let i=0;const n=e.startLineNumber,o=e.endLineNumber;for(let t=n;t<=o;t++){const s=this.getLineContent(t),r=t===n?e.startColumn-1:0,a=t===o?e.endColumn-1:s.length;for(let e=r;e<a;e++)zSe(s.charCodeAt(e))?(i+=1,e+=1):i+=1}return i+=this._getEndOfLine(t).length*(o-n),i}return this.getValueLengthInRange(e,t)}getLength(){return this._pieceTree.getLength()}getLineCount(){return this._pieceTree.getLineCount()}getLinesContent(){return this._pieceTree.getLinesContent()}getLineContent(e){return this._pieceTree.getLineContent(e)}getLineCharCode(e,t){return this._pieceTree.getLineCharCode(e,t)}getLineLength(e){return this._pieceTree.getLineLength(e)}getLineFirstNonWhitespaceColumn(e){const t=ESe(this.getLineContent(e));return-1===t?0:t+1}getLineLastNonWhitespaceColumn(e){const t=ISe(this.getLineContent(e));return-1===t?0:t+2}_getEndOfLine(e){switch(e){case 1:return"\n";case 2:return"\r\n";case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,t,i){let n=this._mightContainRTL,o=this._mightContainUnusualLineTerminators,s=this._mightContainNonBasicASCII,r=!0,a=[];for(let t=0;t<e.length;t++){const i=e[t];r&&i._isTracked&&(r=!1);const l=i.range;if(i.text){let e=!0;s||(e=!JSe(i.text),s=e),!n&&e&&(n=QSe(i.text)),!o&&e&&(o=txe(i.text))}let d="",h=0,c=0,u=0;if(i.text){let e;[h,c,u,e]=Wze(i.text);const t=this.getEOL();d=0===e||e===("\r\n"===t?2:1)?i.text:i.text.replace(/\r\n|\r|\n/g,t)}a[t]={sortIndex:t,identifier:i.identifier||null,range:l,rangeOffset:this.getOffsetAt(l.startLineNumber,l.startColumn),rangeLength:this.getValueLengthInRange(l),text:d,eolCount:h,firstLineLength:c,lastLineLength:u,forceMoveMarkers:Boolean(i.forceMoveMarkers),isAutoWhitespaceEdit:i.isAutoWhitespaceEdit||!1}}a.sort(cje._sortOpsAscending);let l=!1;for(let e=0,t=a.length-1;e<t;e++){const t=a[e].range.getEndPosition(),i=a[e+1].range.getStartPosition();if(i.isBeforeOrEqual(t)){if(i.isBefore(t))throw new Error("Overlapping ranges are not allowed!");l=!0}}r&&(a=this._reduceOperations(a));const d=i||t?cje._getInverseEditRanges(a):[],h=[];if(t)for(let e=0;e<a.length;e++){const t=a[e],i=d[e];if(t.isAutoWhitespaceEdit&&t.range.isEmpty())for(let e=i.startLineNumber;e<=i.endLineNumber;e++){let n="";e===i.startLineNumber&&(n=this.getLineContent(t.range.startLineNumber),-1!==ESe(n))||h.push({lineNumber:e,oldContent:n})}}let c=null;if(i){let e=0;c=[];for(let t=0;t<a.length;t++){const i=a[t],n=d[t],o=this.getValueInRange(i.range),s=i.rangeOffset+e;e+=i.text.length-o.length,c[t]={sortIndex:i.sortIndex,identifier:i.identifier,range:n,text:o,textChange:new YUe(i.rangeOffset,o,s,i.text)}}l||c.sort(((e,t)=>e.sortIndex-t.sortIndex))}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=s;const u=this._doApplyEdits(a);let g=null;if(t&&h.length>0){h.sort(((e,t)=>t.lineNumber-e.lineNumber)),g=[];for(let e=0,t=h.length;e<t;e++){const t=h[e].lineNumber;if(e>0&&h[e-1].lineNumber===t)continue;const i=h[e].oldContent,n=this.getLineContent(t);0!==n.length&&n!==i&&-1===ESe(n)&&g.push(t)}}return this._onDidChangeContent.fire(),new Vke(c,u,g)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,n=e[e.length-1].range,o=new dye(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let s=i.startLineNumber,r=i.startColumn;const a=[];for(let i=0,n=e.length;i<n;i++){const n=e[i],o=n.range;t=t||n.forceMoveMarkers,a.push(this.getValueInRange(new dye(s,r,o.startLineNumber,o.startColumn))),n.text.length>0&&a.push(n.text),s=o.endLineNumber,r=o.endColumn}const l=a.join(""),[d,h,c]=Wze(l);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:l,eolCount:d,firstLineLength:h,lastLineLength:c,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(cje._sortOpsDescending);const t=[];for(let i=0;i<e.length;i++){const n=e[i],o=n.range.startLineNumber,s=n.range.startColumn,r=n.range.endLineNumber,a=n.range.endColumn;if(o===r&&s===a&&0===n.text.length)continue;n.text?(this._pieceTree.delete(n.rangeOffset,n.rangeLength),this._pieceTree.insert(n.rangeOffset,n.text,!0)):this._pieceTree.delete(n.rangeOffset,n.rangeLength);const l=new dye(o,s,r,a);t.push({range:l,rangeLength:n.rangeLength,text:n.text,rangeOffset:n.rangeOffset,forceMoveMarkers:n.forceMoveMarkers})}return t}findMatchesLineByLine(e,t,i,n){return this._pieceTree.findMatchesLineByLine(e,t,i,n)}static _getInverseEditRanges(e){const t=[];let i=0,n=0,o=null;for(let s=0,r=e.length;s<r;s++){const r=e[s];let a,l,d;if(o?o.range.endLineNumber===r.range.startLineNumber?(a=i,l=n+(r.range.startColumn-o.range.endColumn)):(a=i+(r.range.startLineNumber-o.range.endLineNumber),l=r.range.startColumn):(a=r.range.startLineNumber,l=r.range.startColumn),r.text.length>0){const e=r.eolCount+1;d=1===e?new dye(a,l,a,l+r.firstLineLength):new dye(a,l,a+e-1,r.lastLineLength+1)}else d=new dye(a,l,a,l);i=d.endLineNumber,n=d.endColumn,t.push(d),o=r}return t}static _sortOpsAscending(e,t){const i=dye.compareRangesUsingEnds(e.range,t.range);return 0===i?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=dye.compareRangesUsingEnds(e.range,t.range);return 0===i?t.sortIndex-e.sortIndex:-i}}class uje{constructor(e,t,i,n,o,s,r,a,l){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=o,this._containsRTL=s,this._containsUnusualLineTerminators=r,this._isBasicASCII=a,this._normalizeEOL=l}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return 0===t?1===e?"\n":"\r\n":i>t/2?"\r\n":"\n"}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&("\r\n"===t&&(this._cr>0||this._lf>0)||"\n"===t&&(this._cr>0||this._crlf>0)))for(let e=0,n=i.length;e<n;e++){const n=i[e].buffer.replace(/\r\n|\r|\n/g,t),o=sje(n);i[e]=new aje(n,o)}const n=new cje(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:n,disposable:n}}}class gje{constructor(){this.chunks=[],this.BOM="",this._hasPreviousChar=!1,this._previousChar=0,this._tmpLineStarts=[],this.cr=0,this.lf=0,this.crlf=0,this.containsRTL=!1,this.containsUnusualLineTerminators=!1,this.isBasicASCII=!0}acceptChunk(e){if(0===e.length)return;0===this.chunks.length&&sxe(e)&&(this.BOM=oxe,e=e.substr(1));const t=e.charCodeAt(e.length-1);13===t||t>=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){(t||0!==e.length)&&(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=function(e,t){e.length=0,e[0]=0;let i=1,n=0,o=0,s=0,r=!0;for(let a=0,l=t.length;a<l;a++){const d=t.charCodeAt(a);13===d?a+1<l&&10===t.charCodeAt(a+1)?(s++,e[i++]=a+2,a++):(n++,e[i++]=a+1):10===d?(o++,e[i++]=a+1):r&&9!==d&&(d<32||d>126)&&(r=!1)}const a=new oje(nje(e),n,o,s,r);return e.length=0,a}(this._tmpLineStarts,e);this.chunks.push(new aje(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,this.isBasicASCII&&(this.isBasicASCII=t.isBasicASCII),this.isBasicASCII||this.containsRTL||(this.containsRTL=QSe(e)),this.isBasicASCII||this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=txe(e))}finish(e=!0){return this._finish(),new uje(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(0===this.chunks.length&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=sje(e.buffer);e.lineStarts=t,13===this._previousChar&&this.cr++}}}class pje{get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._startLineNumber+this._tokens.length-1}constructor(e,t){this._startLineNumber=e,this._tokens=t}getLineTokens(e){return this._tokens[e-this._startLineNumber]}appendLineTokens(e){this._tokens.push(e)}}class mje{constructor(){this._tokens=[]}add(e,t){if(this._tokens.length>0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e)return void i.appendLineTokens(t)}this._tokens.push(new pje(e,[t]))}finalize(){return this._tokens}}class fje{constructor(e){this._default=e,this._store=[]}get(e){return e<this._store.length?this._store[e]:this._default}set(e,t){for(;e>=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}delete(e,t){0===t||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(0===t||e>=this._store.length)return;const i=[];for(let e=0;e<t;e++)i[e]=this._default;this._store=rbe(this._store,e,i)}}class _je{get invalidLineStartIndex(){return this._firstLineNeedsTokenization}constructor(e,t){this.tokenizationSupport=e,this.initialState=t,this._lineBeginState=new fje(null),this._lineNeedsTokenization=new fje(!0),this._firstLineNeedsTokenization=0,this._lineBeginState.set(0,this.initialState)}markMustBeTokenized(e){this._lineNeedsTokenization.set(e,!0),this._firstLineNeedsTokenization=Math.min(this._firstLineNeedsTokenization,e)}getBeginState(e){return this._lineBeginState.get(e)}setEndState(e,t,i){if(this._lineNeedsTokenization.set(t,!1),this._firstLineNeedsTokenization=t+1,t===e-1)return;const n=this._lineBeginState.get(t+1);if(null===n||!i.equals(n))return this._lineBeginState.set(t+1,i),void this.markMustBeTokenized(t+1);let o=t+1;for(;o<e&&!this._lineNeedsTokenization.get(o);)o++;this._firstLineNeedsTokenization=o}applyEdits(e,t){this.markMustBeTokenized(e.startLineNumber-1),this._lineBeginState.delete(e.startLineNumber,e.endLineNumber-e.startLineNumber),this._lineNeedsTokenization.delete(e.startLineNumber,e.endLineNumber-e.startLineNumber),this._lineBeginState.insert(e.startLineNumber,t),this._lineNeedsTokenization.insert(e.startLineNumber,t)}}class vje extends Owe{constructor(e,t,i){super(),this._textModel=e,this._tokenizationPart=t,this._languageIdCodec=i,this._isScheduled=!1,this._isDisposed=!1,this._tokenizationStateStore=null,this._register(Eye.onDidChange((e=>{const t=this._textModel.getLanguageId();-1!==e.changedLanguages.indexOf(t)&&(this._resetTokenizationState(),this._tokenizationPart.clearTokens())}))),this._resetTokenizationState()}dispose(){this._isDisposed=!0,super.dispose()}handleDidChangeContent(e){if(e.isFlush)this._resetTokenizationState();else{if(this._tokenizationStateStore)for(let t=0,i=e.changes.length;t<i;t++){const i=e.changes[t],[n]=Wze(i.text);this._tokenizationStateStore.applyEdits(i.range,n)}this._beginBackgroundTokenization()}}handleDidChangeAttached(){this._beginBackgroundTokenization()}handleDidChangeLanguage(e){this._resetTokenizationState(),this._tokenizationPart.clearTokens()}_resetTokenizationState(){const[e,t]=function(e,t){if(e.isTooLargeForTokenization())return[null,null];const i=Eye.get(t.getLanguageId());if(!i)return[null,null];let n;try{n=i.getInitialState()}catch(e){return wwe(e),[null,null]}return[i,n]}(this._textModel,this._tokenizationPart);this._tokenizationStateStore=e&&t?new _je(e,t):null,this._beginBackgroundTokenization()}_beginBackgroundTokenization(){!this._isScheduled&&this._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&(this._isScheduled=!0,BDe((e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)})))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),i=()=>{!this._isDisposed&&this._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&(this._backgroundTokenizeForAtLeast1ms(),Date.now()<t?Pve(i):this._beginBackgroundTokenization())};i()}_backgroundTokenizeForAtLeast1ms(){const e=this._textModel.getLineCount(),t=new mje,i=Hwe.create(!1);do{if(i.elapsed()>1)break;if(this._tokenizeOneInvalidLine(t)>=e)break}while(this._hasLinesToTokenize());this._tokenizationPart.setTokens(t.finalize(),this._isTokenizationComplete())}tokenizeViewport(e,t){const i=new mje;this._tokenizeViewport(i,e,t),this._tokenizationPart.setTokens(i.finalize(),this._isTokenizationComplete())}reset(){this._resetTokenizationState(),this._tokenizationPart.clearTokens()}forceTokenization(e){const t=new mje;this._updateTokensUntilLine(t,e),this._tokenizationPart.setTokens(t.finalize(),this._isTokenizationComplete())}getTokenTypeIfInsertingCharacter(e,t){if(!this._tokenizationStateStore)return 0;this.forceTokenization(e.lineNumber);const i=this._tokenizationStateStore.getBeginState(e.lineNumber-1);if(!i)return 0;const n=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),s=o.substring(0,e.column-1)+t+o.substring(e.column-1),r=bje(this._languageIdCodec,n,this._tokenizationStateStore.tokenizationSupport,s,!0,i),a=new HNe(r.tokens,s,this._languageIdCodec);if(0===a.getCount())return 0;const l=a.findTokenIndexAtOffset(e.column-1);return a.getStandardTokenType(l)}tokenizeLineWithEdit(e,t,i){const n=e.lineNumber,o=e.column;if(!this._tokenizationStateStore)return null;this.forceTokenization(n);const s=this._tokenizationStateStore.getBeginState(n-1);if(!s)return null;const r=this._textModel.getLineContent(n),a=r.substring(0,o-1)+i+r.substring(o-1+t),l=this._textModel.getLanguageIdAtPosition(n,0),d=bje(this._languageIdCodec,l,this._tokenizationStateStore.tokenizationSupport,a,!0,s);return new HNe(d.tokens,a,this._languageIdCodec)}isCheapToTokenize(e){if(!this._tokenizationStateStore)return!0;const t=this._tokenizationStateStore.invalidLineStartIndex+1;return!(e>t)&&(e<t||this._textModel.getLineLength(e)<2048)}_hasLinesToTokenize(){return!!this._tokenizationStateStore&&this._tokenizationStateStore.invalidLineStartIndex<this._textModel.getLineCount()}_isTokenizationComplete(){return!!this._tokenizationStateStore&&this._tokenizationStateStore.invalidLineStartIndex>=this._textModel.getLineCount()}_tokenizeOneInvalidLine(e){if(!this._tokenizationStateStore||!this._hasLinesToTokenize())return this._textModel.getLineCount()+1;const t=this._tokenizationStateStore.invalidLineStartIndex+1;return this._updateTokensUntilLine(e,t),t}_updateTokensUntilLine(e,t){if(!this._tokenizationStateStore)return;const i=this._textModel.getLanguageId(),n=this._textModel.getLineCount(),o=t-1;for(let t=this._tokenizationStateStore.invalidLineStartIndex;t<=o;t++){const o=this._textModel.getLineContent(t+1),s=this._tokenizationStateStore.getBeginState(t),r=bje(this._languageIdCodec,i,this._tokenizationStateStore.tokenizationSupport,o,!0,s);e.add(t+1,r.tokens),this._tokenizationStateStore.setEndState(n,t,r.endState),t=this._tokenizationStateStore.invalidLineStartIndex-1}}_tokenizeViewport(e,t,i){if(!this._tokenizationStateStore)return;if(i<=this._tokenizationStateStore.invalidLineStartIndex)return;if(t<=this._tokenizationStateStore.invalidLineStartIndex)return void this._updateTokensUntilLine(e,i);let n=this._textModel.getLineFirstNonWhitespaceColumn(t);const o=[];let s=null;for(let e=t-1;n>1&&e>=1;e--){const t=this._textModel.getLineFirstNonWhitespaceColumn(e);if(0!==t&&t<n&&(o.push(this._textModel.getLineContent(e)),n=t,s=this._tokenizationStateStore.getBeginState(e-1),s))break}s||(s=this._tokenizationStateStore.initialState);const r=this._textModel.getLanguageId();let a=s;for(let e=o.length-1;e>=0;e--)a=bje(this._languageIdCodec,r,this._tokenizationStateStore.tokenizationSupport,o[e],!1,a).endState;for(let n=t;n<=i;n++){const t=this._textModel.getLineContent(n),i=bje(this._languageIdCodec,r,this._tokenizationStateStore.tokenizationSupport,t,!0,a);e.add(n,i.tokens),this._tokenizationStateStore.markMustBeTokenized(n-1),a=i.endState}}}function bje(e,t,i,n,o,s){let r=null;if(i)try{r=i.tokenizeEncoded(n,o,s.clone())}catch(e){wwe(e)}return r||(r=SDe(e.encodeLanguageId(t),s)),HNe.convertToEndOffset(r.tokens,n.length),r}const wje=new Uint32Array(0).buffer;class Cje{static deleteBeginning(e,t){return null===e||e===wje?e:Cje.delete(e,0,t)}static deleteEnding(e,t){if(null===e||e===wje)return e;const i=yje(e),n=i[i.length-2];return Cje.delete(e,t,n)}static delete(e,t,i){if(null===e||e===wje||t===i)return e;const n=yje(e),o=n.length>>>1;if(0===t&&n[n.length-2]===i)return wje;const s=HNe.findIndexInTokensArray(n,t),r=s>0?n[s-1<<1]:0;if(i<n[s<<1]){const r=i-t;for(let e=s;e<o;e++)n[e<<1]-=r;return e}let a,l;r!==t?(n[s<<1]=t,a=s+1<<1,l=t):(a=s<<1,l=r);const d=i-t;for(let e=s+1;e<o;e++){const t=n[e<<1]-d;t>l&&(n[a++]=t,n[a++]=n[1+(e<<1)],l=t)}if(a===n.length)return e;const h=new Uint32Array(a);return h.set(n.subarray(0,a),0),h.buffer}static append(e,t){if(t===wje)return e;if(e===wje)return t;if(null===e)return e;if(null===t)return null;const i=yje(e),n=yje(t),o=n.length>>>1,s=new Uint32Array(i.length+n.length);s.set(i,0);let r=i.length;const a=i[i.length-2];for(let e=0;e<o;e++)s[r++]=n[e<<1]+a,s[r++]=n[1+(e<<1)];return s.buffer}static insert(e,t,i){if(null===e||e===wje)return e;const n=yje(e),o=n.length>>>1;let s=HNe.findIndexInTokensArray(n,t);s>0&&n[s-1<<1]===t&&s--;for(let e=s;e<o;e++)n[e<<1]+=i;return e}}function yje(e){return e instanceof Uint32Array?e:new Uint32Array(e)}class Sje{constructor(e){this._lineTokens=[],this._len=0,this._languageIdCodec=e}flush(){this._lineTokens=[],this._len=0}getTokens(e,t,i){let n=null;if(t<this._len&&(n=this._lineTokens[t]),null!==n&&n!==wje)return new HNe(yje(n),i,this._languageIdCodec);const o=new Uint32Array(2);return o[0]=i.length,o[1]=xje(this._languageIdCodec.encodeLanguageId(e)),new HNe(o,i,this._languageIdCodec)}static _massageTokens(e,t,i){const n=i?yje(i):null;if(0===t){let t=!1;if(n&&n.length>1&&(t=VNe.getLanguageId(n[1])!==e),!t)return wje}if(!n||0===n.length){const i=new Uint32Array(2);return i[0]=t,i[1]=xje(e),i.buffer}return n[n.length-2]=t,0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(0===t)return;const i=[];for(let e=0;e<t;e++)i[e]=null;this._lineTokens=rbe(this._lineTokens,e,i),this._len+=t}setTokens(e,t,i,n,o){const s=Sje._massageTokens(this._languageIdCodec.encodeLanguageId(e),i,n);this._ensureLine(t);const r=this._lineTokens[t];return this._lineTokens[t]=s,!!o&&!Sje._equals(r,s)}static _equals(e,t){if(!e||!t)return!e&&!t;const i=yje(e),n=yje(t);if(i.length!==n.length)return!1;for(let e=0,t=i.length;e<t;e++)if(i[e]!==n[e])return!1;return!0}acceptEdit(e,t,i){this._acceptDeleteRange(e),this._acceptInsertText(new lye(e.startLineNumber,e.startColumn),t,i)}_acceptDeleteRange(e){const t=e.startLineNumber-1;if(t>=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;return void(this._lineTokens[t]=Cje.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1))}this._lineTokens[t]=Cje.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i<this._len&&(n=Cje.deleteBeginning(this._lineTokens[i],e.endColumn-1)),this._lineTokens[t]=Cje.append(this._lineTokens[t],n),this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t,i){if(0===t&&0===i)return;const n=e.lineNumber-1;n>=this._len||(0!==t?(this._lineTokens[n]=Cje.deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=Cje.insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)):this._lineTokens[n]=Cje.insert(this._lineTokens[n],e.column-1,i))}}function xje(e){return(32768|e|2<<24|1024)>>>0}class kje{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return 0===this._pieces.length}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const n=t[0].getRange(),o=t[t.length-1].getRange();if(!n||!o)return e;i=e.plusRange(n).plusRange(o)}let n=null;for(let e=0,t=this._pieces.length;e<t;e++){const o=this._pieces[e];if(o.endLineNumber<i.startLineNumber)continue;if(o.startLineNumber>i.endLineNumber){n=n||{index:e};break}if(o.removeTokens(i),o.isEmpty()){this._pieces.splice(e,1),e--,t--;continue}if(o.endLineNumber<i.startLineNumber)continue;if(o.startLineNumber>i.endLineNumber){n=n||{index:e};continue}const[s,r]=o.split(i);s.isEmpty()?n=n||{index:e}:r.isEmpty()||(this._pieces.splice(e,1,s,r),e++,t++,n=n||{index:e})}return n=n||{index:this._pieces.length},t.length>0&&(this._pieces=rbe(this._pieces,n.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(0===t.getLineContent().length)return t;const i=this._pieces;if(0===i.length)return t;const n=i[kje._findFirstPieceWithLine(i,e)].getLineTokens(e);if(!n)return t;const o=t.getCount(),s=n.getCount();let r=0;const a=[];let l=0,d=0;const h=(e,t)=>{e!==d&&(d=e,a[l++]=e,a[l++]=t)};for(let e=0;e<s;e++){const i=n.getStartCharacter(e),s=n.getEndCharacter(e),a=n.getMetadata(e),l=((1&a?2048:0)|(2&a?4096:0)|(4&a?8192:0)|(8&a?16384:0)|(16&a?16744448:0)|(32&a?4278190080:0))>>>0,d=~l>>>0;for(;r<o&&t.getEndOffset(r)<=i;)h(t.getEndOffset(r),t.getMetadata(r)),r++;for(r<o&&t.getStartOffset(r)<i&&h(i,t.getMetadata(r));r<o&&t.getEndOffset(r)<s;)h(t.getEndOffset(r),t.getMetadata(r)&d|a&l),r++;if(r<o)h(s,t.getMetadata(r)&d|a&l),t.getEndOffset(r)===s&&r++;else{const e=Math.min(Math.max(0,r-1),o-1);h(s,t.getMetadata(e)&d|a&l)}}for(;r<o;)h(t.getEndOffset(r),t.getMetadata(r)),r++;return new HNe(new Uint32Array(a),t.getLineContent(),this._languageIdCodec)}static _findFirstPieceWithLine(e,t){let i=0,n=e.length-1;for(;i<n;){let o=i+Math.floor((n-i)/2);if(e[o].endLineNumber<t)i=o+1;else{if(!(e[o].startLineNumber>t)){for(;o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}n=o-1}}return i}acceptEdit(e,t,i,n,o){for(const s of this._pieces)s.acceptEdit(e,t,i,n,o)}}class Lje extends gHe{constructor(e,t,i,n,o){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this.bracketPairsTextModelPart=n,this._languageId=o,this._onDidChangeLanguage=this._register(new $we),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new $we),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new $we),this.onDidChangeTokens=this._onDidChangeTokens.event,this._backgroundTokenizationState=0,this._onBackgroundTokenizationStateChanged=this._register(new $we),this._tokens=new Sje(this._languageService.languageIdCodec),this._semanticTokens=new kje(this._languageService.languageIdCodec),this._tokenization=new vje(i,this,this._languageService.languageIdCodec),this._languageRegistryListener=this._languageConfigurationService.onDidChange((e=>{e.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})}))}acceptEdit(e,t,i,n,o){this._tokens.acceptEdit(e,i,n),this._semanticTokens.acceptEdit(e,i,n,o,t.length>0?t.charCodeAt(0):0)}handleDidChangeAttached(){this._tokenization.handleDidChangeAttached()}flush(){this._tokens.flush(),this._semanticTokens.flush()}handleDidChangeContent(e){this._tokenization.handleDidChangeContent(e)}dispose(){this._languageRegistryListener.dispose(),this._tokenization.dispose(),super.dispose()}get backgroundTokenizationState(){return this._backgroundTokenizationState}handleTokenizationProgress(e){if(2===this._backgroundTokenizationState)return;const t=e?2:1;this._backgroundTokenizationState!==t&&(this._backgroundTokenizationState=t,this.bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState(),this._onBackgroundTokenizationStateChanged.fire())}setTokens(e,t=!1){if(0!==e.length){const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];let o=0,s=0,r=!1;for(let e=n.startLineNumber;e<=n.endLineNumber;e++)r?(this._tokens.setTokens(this._languageId,e-1,this._textModel.getLineLength(e),n.getLineTokens(e),!1),s=e):this._tokens.setTokens(this._languageId,e-1,this._textModel.getLineLength(e),n.getLineTokens(e),!0)&&(r=!0,o=e,s=e);r&&t.push({fromLineNumber:o,toLineNumber:s})}t.length>0&&this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:!1,ranges:t})}this.handleTokenizationProgress(t)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:null!==e,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}tokenizeViewport(e,t){e=Math.max(1,e),t=Math.min(this._textModel.getLineCount(),t),this._tokenization.tokenizeViewport(e,t)}clearTokens(){this._tokens.flush(),this._emitModelTokensChangedEvent({tokenizationSupportChanged:!0,semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this.bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}resetTokenization(){this._tokenization.reset()}forceTokenization(e){if(e<1||e>this._textModel.getLineCount())throw new Error("Illegal value for lineNumber");this._tokenization.forceTokenization(e)}isCheapToTokenize(e){return this._tokenization.isCheapToTokenize(e)}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){if(e<1||e>this._textModel.getLineCount())throw new Error("Illegal value for lineNumber");return this._getLineTokens(e)}_getLineTokens(e){const t=this._textModel.getLineContent(e),i=this._tokens.getTokens(this._languageId,e-1,t);return this._semanticTokens.addSparseTokens(e,i)}getTokenTypeIfInsertingCharacter(e,t,i){const n=this._textModel.validatePosition(new lye(e,t));return this._tokenization.getTokenTypeIfInsertingCharacter(n,i)}tokenizeLineWithEdit(e,t,i){const n=this._textModel.validatePosition(e);return this._tokenization.tokenizeLineWithEdit(n,t,i)}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),i=this._textModel.getLineContent(t.lineNumber),n=this._getLineTokens(t.lineNumber),o=n.findTokenIndexAtOffset(t.column-1),[s,r]=Lje._findLanguageBoundaries(n,o),a=Xve(t.column,this.getLanguageConfiguration(n.getLanguageId(o)).getWordDefinition(),i.substring(s,r),s);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a;if(o>0&&s===t.column-1){const[s,r]=Lje._findLanguageBoundaries(n,o-1),a=Xve(t.column,this.getLanguageConfiguration(n.getLanguageId(o-1)).getWordDefinition(),i.substring(s,r),s);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a}return null}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let n=0;for(let o=t;o>=0&&e.getLanguageId(o)===i;o--)n=e.getStartOffset(o);let o=e.getLineContent().length;for(let n=t,s=e.getCount();n<s&&e.getLanguageId(n)===i;n++)o=e.getEndOffset(n);return[n,o]}getWordUntilPosition(e){const t=this.getWordAtPosition(e);return t?{word:t.word.substr(0,e.column-t.startColumn),startColumn:t.startColumn,endColumn:e.column}:{word:"",startColumn:e.column,endColumn:e.column}}getLanguageId(){return this._languageId}getLanguageIdAtPosition(e,t){const i=this._textModel.validatePosition(new lye(e,t)),n=this.getLineTokens(i.lineNumber);return n.getLanguageId(n.findTokenIndexAtOffset(i.column-1))}setLanguageId(e,t="api"){if(this._languageId===e)return;const i={oldLanguage:this._languageId,newLanguage:e,source:t};this._languageId=e,this.bracketPairsTextModelPart.handleDidChangeLanguage(i),this._tokenization.handleDidChangeLanguage(i),this._onDidChangeLanguage.fire(i),this._onDidChangeLanguageConfiguration.fire({})}}class Dje{constructor(){this.changeType=1}}class Eje{static applyInjectedText(e,t){if(!t||0===t.length)return e;let i="",n=0;for(const o of t)i+=e.substring(n,o.column-1),n=o.column-1,i+=o.options.content;return i+=e.substring(n),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new Eje(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new Eje(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort(((e,t)=>e.lineNumber===t.lineNumber?e.column===t.column?e.order-t.order:e.column-t.column:e.lineNumber-t.lineNumber)),t}constructor(e,t,i,n,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=n,this.order=o}}class Nje{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class Ije{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class Tje{constructor(e,t,i,n){this.changeType=4,this.injectedTexts=n,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class Mje{constructor(){this.changeType=5}}class Aje{constructor(e,t,i,n){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=n,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;t<i;t++)if(this.changes[t].changeType===e)return!0;return!1}static merge(e,t){const i=[].concat(e.changes).concat(t.changes),n=t.versionId,o=e.isUndoing||t.isUndoing,s=e.isRedoing||t.isRedoing;return new Aje(i,n,o,s)}}class Rje{constructor(e){this.changes=e}}class Oje{constructor(e,t){this.rawContentChangedEvent=e,this.contentChangedEvent=t}merge(e){const t=Aje.merge(this.rawContentChangedEvent,e.rawContentChangedEvent),i=Oje._mergeChangeEvents(this.contentChangedEvent,e.contentChangedEvent);return new Oje(t,i)}static _mergeChangeEvents(e,t){return{changes:[].concat(e.changes).concat(t.changes),eol:t.eol,versionId:t.versionId,isUndoing:e.isUndoing||t.isUndoing,isRedoing:e.isRedoing||t.isRedoing,isFlush:e.isFlush||t.isFlush}}}const Pje=zxe("undoRedoService");class Fje{constructor(e,t){this.resource=e,this.elements=t}}class Bje{constructor(){this.id=Bje._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}}Bje._ID=0,Bje.None=new Bje;class Wje{constructor(){this.id=Wje._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}}Wje._ID=0,Wje.None=new Wje;var Vje=function(e,t){return function(i,n){t(i,n,e)}};function Hje(e,t){let i;var n;return i="string"==typeof e?function(e){const t=new gje;return t.acceptChunk(e),t.finish()}(e):(n=e)&&"function"==typeof n.read?function(e){const t=new gje;let i;for(;"string"==typeof(i=e.read());)t.acceptChunk(i);return t.finish()}(e):e,i.create(t)}let zje=0;class Uje{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;for(;;){const n=this._source.read();if(null===n)return this._eos=!0,0===t?null:e.join("");if(n.length>0&&(e[t++]=n,i+=n.length),i>=65536)return e.join("")}}}const Kje=()=>{throw new Error("Invalid change accessor")};let jje=class e extends Owe{static resolveOptions(e,t){if(t.detectIndentation){const i=CKe(e,t.tabSize,t.insertSpaces);return new Pke({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new Pke(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}onDidChangeContent(e){return this._eventEmitter.slowEvent((t=>e(t.contentChangedEvent)))}onDidChangeContentOrInjectedText(e){return Mwe(this._eventEmitter.fastEvent((t=>e(t))),this._onDidChangeInjectedText.event((t=>e(t))))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(t,i,n,o=null,s,r,a){super(),this._undoRedoService=s,this._languageService=r,this._languageConfigurationService=a,this._onWillDispose=this._register(new $we),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new nqe((e=>this.handleBeforeFireDecorationsChangedEvent(e)))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new $we),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new $we),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new $we),this._eventEmitter=this._register(new oqe),this._deltaDecorationCallCnt=0,zje++,this.id="$model"+zje,this.isForSimpleWidget=n.isForSimpleWidget,this._associatedResource=null==o?QCe.parse("inmemory://model/"+zje):o,this._attachedEditorCount=0;const{textBuffer:l,disposable:d}=Hje(t,n.defaultEOL);this._buffer=l,this._bufferDisposable=d,this._options=e.resolveOptions(this._buffer,n),this._bracketPairs=this._register(new UUe(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new fHe(this,this._languageConfigurationService)),this._decorationProvider=this._register(new $Ue(this)),this._tokenizationTextModelPart=new Lje(this._languageService,this._languageConfigurationService,this,this._bracketPairs,i);const h=this._buffer.getLineCount(),c=this._buffer.getValueLengthInRange(new dye(1,1,h,this._buffer.getLineLength(h)+1),0);n.largeFileOptimizations?this._isTooLargeForTokenization=c>e.LARGE_FILE_SIZE_THRESHOLD||h>e.LARGE_FILE_LINE_COUNT_THRESHOLD:this._isTooLargeForTokenization=!1,this._isTooLargeForSyncing=c>e._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=rxe(zje),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new Gje,this._commandManager=new vKe(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange((()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})))}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new cje([],"","\n",!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=Owe.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new Oje(e,t)))}setValue(e){if(this._assertNotDisposed(),null==e)throw Lwe();const{textBuffer:t,disposable:i}=Hje(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,o,s,r){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:o,isRedoing:s,isFlush:r}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._tokenizationTextModelPart.flush(),this._decorations=Object.create(null),this._decorationsTree=new Gje,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new Aje([new Dje],this._versionId,!1,!1),this._createContentChanged2(new dye(1,1,o,s),0,n,this.getValue(),!1,!1,!0))}setEOL(e){this._assertNotDisposed();const t=1===e?"\r\n":"\n";if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new Aje([new Mje],this._versionId,!1,!1),this._createContentChanged2(new dye(1,1,o,s),0,n,this.getValue(),!1,!1,!1))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i<n;i++){const n=t[i],o=n.range,s=n.cachedAbsoluteStart-n.start,r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);n.cachedAbsoluteStart=r,n.cachedAbsoluteEnd=a,n.cachedVersionId=e,n.start=r-s,n.end=a-s,HKe(n)}}onBeforeAttached(){this._attachedEditorCount++,1===this._attachedEditorCount&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0))}onBeforeDetached(){this._attachedEditorCount--,0===this._attachedEditorCount&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0))}isAttachedToEditor(){return this._attachedEditorCount>0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let n=1;n<=i;n++){const i=this._buffer.getLineLength(n);i>=1e4?t+=i:e+=i}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=void 0!==e.tabSize?e.tabSize:this._options.tabSize,i=void 0!==e.indentSize?e.indentSize:this._options.originalIndentSize,n=void 0!==e.insertSpaces?e.insertSpaces:this._options.insertSpaces,o=void 0!==e.trimAutoWhitespace?e.trimAutoWhitespace:this._options.trimAutoWhitespace,s=void 0!==e.bracketColorizationOptions?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,r=new Pke({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:s});if(this._options.equals(r))return;const a=this._options.createChangeEvent(r);this._options=r,this._bracketPairs.handleDidChangeOptions(a),this._decorationProvider.handleDidChangeOptions(a),this._onDidChangeOptions.fire(a)}detectIndentation(e,t){this._assertNotDisposed();const i=CKe(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),VWe(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(exe.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map((e=>({range:e.range,text:null}))),(()=>null))}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueInRange(i,e);return t?this._buffer.getBOM()+n:n}createSnapshot(e=!1){return new Uje(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+n:n}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){return this._assertNotDisposed(),this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),"\n"===this._buffer.getEOL()?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let o=Math.floor("number"!=typeof i||isNaN(i)?1:i),s=Math.floor("number"!=typeof n||isNaN(n)?1:n);if(o<1)o=1,s=1;else if(o>t)o=t,s=this.getLineMaxColumn(o);else if(s<=1)s=1;else{const e=this.getLineMaxColumn(o);s>=e&&(s=e)}const r=e.endLineNumber,a=e.endColumn;let l=Math.floor("number"!=typeof r||isNaN(r)?1:r),d=Math.floor("number"!=typeof a||isNaN(a)?1:a);if(l<1)l=1,d=1;else if(l>t)l=t,d=this.getLineMaxColumn(l);else if(d<=1)d=1;else{const e=this.getLineMaxColumn(l);d>=e&&(d=e)}return i===o&&n===s&&r===l&&a===d&&e instanceof dye&&!(e instanceof hye)?e:new dye(o,s,l,d)}_isValidPosition(e,t,i){return"number"==typeof e&&"number"==typeof t&&(!isNaN(e)&&!isNaN(t)&&(!(e<1||t<1)&&((0|e)===e&&(0|t)===t&&(!(e>this._buffer.getLineCount())&&(1===t||!(t>this.getLineMaxColumn(e))&&(1!==i||!zSe(this._buffer.getLineCharCode(e,t-2))))))))}_validatePosition(e,t,i){const n=Math.floor("number"!=typeof e||isNaN(e)?1:e),o=Math.floor("number"!=typeof t||isNaN(t)?1:t),s=this._buffer.getLineCount();if(n<1)return new lye(1,1);if(n>s)return new lye(s,this.getLineMaxColumn(s));if(o<=1)return new lye(n,1);const r=this.getLineMaxColumn(n);return o>=r?new lye(n,r):1===i&&zSe(this._buffer.getLineCharCode(n,o-2))?new lye(n,o-1):new lye(n,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof lye&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,s=e.endColumn;if(!this._isValidPosition(i,n,0))return!1;if(!this._isValidPosition(o,s,0))return!1;if(1===t){const e=n>1?this._buffer.getLineCharCode(i,n-2):0,t=s>1&&s<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,s-2):0,r=zSe(e),a=zSe(t);return!r&&!a}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof dye&&!(e instanceof hye)&&this._isValidRange(e,1))return e;const t=this._validatePosition(e.startLineNumber,e.startColumn,0),i=this._validatePosition(e.endLineNumber,e.endColumn,0),n=t.lineNumber,o=t.column,s=i.lineNumber,r=i.column;{const e=o>1?this._buffer.getLineCharCode(n,o-2):0,t=r>1&&r<=this._buffer.getLineLength(s)?this._buffer.getLineCharCode(s,r-2):0,i=zSe(e),a=zSe(t);return i||a?n===s&&o===r?new dye(n,o-1,s,r-1):i&&a?new dye(n,o-1,s,r+1):i?new dye(n,o-1,s,r):new dye(n,o,s,r+1):new dye(n,o,s,r)}}modifyPosition(e,t){this._assertNotDisposed();const i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new dye(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,o,s,r=999){this._assertNotDisposed();let a=null;null!==t&&(Array.isArray(t)||(t=[t]),t.every((e=>dye.isIRange(e)))&&(a=t.map((e=>this.validateRange(e))))),null===a&&(a=[this.getFullModelRange()]),a=a.sort(((e,t)=>e.startLineNumber-t.startLineNumber||e.startColumn-t.startColumn));const l=[];let d;if(l.push(a.reduce(((e,t)=>dye.areIntersecting(e,t)?e.plusRange(t):(l.push(e),t)))),!i&&e.indexOf("\n")<0){const t=new AEe(e,i,n,o).parseSearchRequest();if(!t)return[];d=e=>this.findMatchesLineByLine(e,t,s,r)}else d=t=>PEe.findMatches(this,new AEe(e,i,n,o),t,s,r);return l.map(d).reduce(((e,t)=>e.concat(t)),[])}findNextMatch(e,t,i,n,o,s){this._assertNotDisposed();const r=this.validatePosition(t);if(!i&&e.indexOf("\n")<0){const t=new AEe(e,i,n,o).parseSearchRequest();if(!t)return null;const a=this.getLineCount();let l=new dye(r.lineNumber,r.column,a,this.getLineMaxColumn(a)),d=this.findMatchesLineByLine(l,t,s,1);return PEe.findNextMatch(this,new AEe(e,i,n,o),r,s),d.length>0?d[0]:(l=new dye(1,1,r.lineNumber,this.getLineMaxColumn(r.lineNumber)),d=this.findMatchesLineByLine(l,t,s,1),d.length>0?d[0]:null)}return PEe.findNextMatch(this,new AEe(e,i,n,o),r,s)}findPreviousMatch(e,t,i,n,o,s){this._assertNotDisposed();const r=this.validatePosition(t);return PEe.findPreviousMatch(this,new AEe(e,i,n,o),r,s)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if(("\n"===this.getEOL()?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof Bke?e:new Bke(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this._validateEditOperation(e[i]);return t}pushEditOperations(e,t,i,n){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(t),i,n)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,t,i,n){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){const i=t.map((e=>({range:this.validateRange(e.range),text:e.text})));let n=!0;if(e)for(let t=0,o=e.length;t<o;t++){const o=e[t];let s=!1;for(let e=0,t=i.length;e<t;e++){const t=i[e].range,n=t.startLineNumber>o.endLineNumber,r=o.startLineNumber>t.endLineNumber;if(!n&&!r){s=!0;break}}if(!s){n=!1;break}}if(n)for(let e=0,n=this._trimAutoWhitespaceLines.length;e<n;e++){const n=this._trimAutoWhitespaceLines[e],o=this.getLineMaxColumn(n);let s=!0;for(let e=0,t=i.length;e<t;e++){const t=i[e].range,r=i[e].text;if(!(n<t.startLineNumber||n>t.endLineNumber||n===t.startLineNumber&&t.startColumn===o&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(0)||n===t.startLineNumber&&1===t.startColumn&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(r.length-1))){s=!1;break}}if(s){const e=new dye(n,1,n,o);t.push(new Bke(null,e,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,n)}_applyUndo(e,t,i,n){const o=e.map((e=>{const t=this.getPositionAt(e.newPosition),i=this.getPositionAt(e.newEnd);return{range:new dye(t.lineNumber,t.column,i.lineNumber,i.column),text:e.oldText}}));this._applyUndoRedoEdits(o,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const o=e.map((e=>{const t=this.getPositionAt(e.oldPosition),i=this.getPositionAt(e.oldEnd);return{range:new dye(t.lineNumber,t.column,i.lineNumber,i.column),text:e.newText}}));this._applyUndoRedoEdits(o,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,o,s){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(s),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),n=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),s=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,0!==s.length){for(let e=0,t=s.length;e<t;e++){const t=s[e],[i,n,o]=Wze(t.text);this._tokenizationTextModelPart.acceptEdit(t.range,t.text,i,n,o),this._decorationsTree.acceptReplace(t.rangeOffset,t.rangeLength,t.text.length,t.forceMoveMarkers)}const e=[];this._increaseVersionId();let t=i;for(let i=0,n=s.length;i<n;i++){const n=s[i],[r]=Wze(n.text);this._onDidChangeDecorations.fire();const a=n.range.startLineNumber,l=n.range.endLineNumber,d=l-a,h=r,c=Math.min(d,h),u=h-d,g=o-t-u+a,p=g,m=g+h,f=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new lye(p,1)),this.getOffsetAt(new lye(m,this.getLineMaxColumn(m))),0),_=Eje.fromDecorations(f),v=new pbe(_);for(let t=c;t>=0;t--){const i=a+t,n=g+t;v.takeFromEndWhile((e=>e.lineNumber>n));const o=v.takeFromEndWhile((e=>e.lineNumber===n));e.push(new Nje(i,this.getLineContent(n),o))}if(c<d){const t=a+c;e.push(new Ije(t+1,l))}if(c<h){const i=new pbe(_),n=a+c,s=h-c,r=o-t-s+n+1,l=[],d=[];for(let e=0;e<s;e++){const t=r+e;d[e]=this.getLineContent(t),i.takeWhile((e=>e.lineNumber<t)),l[e]=i.takeWhile((e=>e.lineNumber===t))}e.push(new Tje(n+1,a+h,d,l))}t+=u}this._emitContentChangedEvent(new Aje(e,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:s,eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return null===n.reverseEdits?void 0:n.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(null===e||0===e.size)return;const t=Array.from(e).map((e=>new Nje(e,this.getLineContent(e),this._getInjectedTextInLine(e))));this._onDidChangeInjectedText.fire(new Rje(t))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(t,i)=>this._deltaDecorationsImpl(e,[],[{range:t,options:i}])[0],changeDecoration:(e,t)=>{this._changeDecorationImpl(e,t)},changeDecorationOptions:(e,t)=>{this._changeDecorationOptionsImpl(e,iqe(t))},removeDecoration:t=>{this._deltaDecorationsImpl(e,[t],[])},deltaDecorations:(t,i)=>0===t.length&&0===i.length?[]:this._deltaDecorationsImpl(e,t,i)};let n=null;try{n=t(i)}catch(e){wwe(e)}return i.addDecoration=Kje,i.changeDecoration=Kje,i.changeDecorationOptions=Kje,i.removeDecoration=Kje,i.deltaDecorations=Kje,n}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),0===e.length&&0===t.length)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),wwe(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const n=e?this._decorations[e]:null;if(!n)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:tqe[i]}])[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.id],null;const o=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),r=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(n),n.reset(this.getVersionId(),s,r,o),n.setOptions(tqe[i]),this._decorationsTree.insert(n),n.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let e=0,i=t.length;e<i;e++){const i=t[e];this._decorationsTree.delete(i),delete this._decorations[i.id]}}getDecorationOptions(e){const t=this._decorations[e];return t?t.options:null}getDecorationRange(e){const t=this._decorations[e];return t?this._decorationsTree.getNodeRange(this,t):null}getLineDecorations(e,t=0,i=!1){return e<1||e>this.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,n=!1){const o=this.getLineCount(),s=Math.min(o,Math.max(1,e)),r=Math.min(o,Math.max(1,t)),a=this.getLineMaxColumn(r),l=new dye(s,1,r,a),d=this._getDecorationsInRange(l,i,n);return dbe(d,this._decorationProvider.getDecorationsInRange(l,i,n)),d}getDecorationsInRange(e,t=0,i=!1,n=!1){const o=this.validateRange(e),s=this._getDecorationsInRange(o,t,i);return dbe(s,this._decorationProvider.getDecorationsInRange(o,t,i,n)),s}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),n=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return Eje.fromDecorations(n).filter((t=>t.lineNumber===e))}getAllDecorations(e=0,t=!1){let i=this._decorationsTree.getAll(this,e,t,!1);return i=i.concat(this._decorationProvider.getAllDecorations(e,t)),i}_getDecorationsInRange(e,t,i){const n=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),o=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,n,o,t,i)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const i=this._decorations[e];if(!i)return;if(i.options.after){const t=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(t.endLineNumber)}if(i.options.before){const t=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(t.startLineNumber)}const n=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(n.startLineNumber,n.startColumn),s=this._buffer.getOffsetAt(n.endLineNumber,n.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),o,s,n),this._decorationsTree.insert(i),this._onDidChangeDecorations.checkAffectedAndFire(i.options),i.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(n.endLineNumber),i.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(n.startLineNumber)}_changeDecorationOptionsImpl(e,t){const i=this._decorations[e];if(!i)return;const n=!(!i.options.overviewRuler||!i.options.overviewRuler.color),o=!(!t.overviewRuler||!t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){const e=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(i.options.before||t.before){const e=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}n!==o?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i){const n=this.getVersionId(),o=t.length;let s=0;const r=i.length;let a=0;this._onDidChangeDecorations.beginDeferredEmit();try{const l=new Array(r);for(;s<o||a<r;){let d=null;if(s<o){do{d=this._decorations[t[s++]]}while(!d&&s<o);if(d){if(d.options.after){const e=this._decorationsTree.getNodeRange(this,d);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(d.options.before){const e=this._decorationsTree.getNodeRange(this,d);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}this._decorationsTree.delete(d),this._onDidChangeDecorations.checkAffectedAndFire(d.options)}}if(a<r){if(!d){const e=++this._lastDecorationId,t=`${this._instanceId};${e}`;d=new IKe(t,0,0),this._decorations[t]=d}const t=i[a],o=this._validateRangeRelaxedNoAllocations(t.range),s=iqe(t.options),r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),h=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);d.ownerId=e,d.reset(n,r,h,o),d.setOptions(s),d.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.endLineNumber),d.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.startLineNumber),this._onDidChangeDecorations.checkAffectedAndFire(s),this._decorationsTree.insert(d),l[a]=d.id,a++}else d&&delete this._decorations[d.id]}return l}finally{this._onDidChangeDecorations.endDeferredEmit()}}getLanguageId(){return this.tokenization.getLanguageId()}setMode(e,t){this.tokenization.setLanguageId(e,t)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return function(e){let t=0;for(const i of e){if(" "!==i&&"\t"!==i)break;t++}return t}(this.getLineContent(e))+1}};function qje(e){return!(!e.options.overviewRuler||!e.options.overviewRuler.color)}function $je(e){return!!e.options.after||!!e.options.before}jje._MODEL_SYNC_LIMIT=52428800,jje.LARGE_FILE_SIZE_THRESHOLD=20971520,jje.LARGE_FILE_LINE_COUNT_THRESHOLD=3e5,jje.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:Pbe.tabSize,indentSize:Pbe.indentSize,insertSpaces:Pbe.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:Pbe.trimAutoWhitespace,largeFileOptimizations:Pbe.largeFileOptimizations,bracketPairColorizationOptions:Pbe.bracketPairColorizationOptions},jje=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Vje(4,Pje),Vje(5,NLe),Vje(6,dDe)],jje);class Gje{constructor(){this._decorationsTree0=new MKe,this._decorationsTree1=new MKe,this._injectedTextDecorationsTree=new MKe}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)null===i.range&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,n,o){const s=e.getVersionId(),r=this._intervalSearch(t,i,n,o,s);return this._ensureNodesHaveRanges(e,r)}_intervalSearch(e,t,i,n,o){const s=this._decorationsTree0.intervalSearch(e,t,i,n,o),r=this._decorationsTree1.intervalSearch(e,t,i,n,o),a=this._injectedTextDecorationsTree.intervalSearch(e,t,i,n,o);return s.concat(r).concat(a)}getInjectedTextInInterval(e,t,i,n){const o=e.getVersionId(),s=this._injectedTextDecorationsTree.intervalSearch(t,i,n,!1,o);return this._ensureNodesHaveRanges(e,s).filter((e=>e.options.showIfCollapsed||!e.range.isEmpty()))}getAllInjectedText(e,t){const i=e.getVersionId(),n=this._injectedTextDecorationsTree.search(t,!1,i);return this._ensureNodesHaveRanges(e,n).filter((e=>e.options.showIfCollapsed||!e.range.isEmpty()))}getAll(e,t,i,n){const o=e.getVersionId(),s=this._search(t,i,n,o);return this._ensureNodesHaveRanges(e,s)}_search(e,t,i,n){if(i)return this._decorationsTree1.search(e,t,n);{const i=this._decorationsTree0.search(e,t,n),o=this._decorationsTree1.search(e,t,n),s=this._injectedTextDecorationsTree.search(e,t,n);return i.concat(o).concat(s)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),n=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(n)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){$je(e)?this._injectedTextDecorationsTree.insert(e):qje(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){$je(e)?this._injectedTextDecorationsTree.delete(e):qje(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),null===t.range&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){$je(e)?this._injectedTextDecorationsTree.resolveNode(e,t):qje(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,n){this._decorationsTree0.acceptReplace(e,t,i,n),this._decorationsTree1.acceptReplace(e,t,i,n),this._injectedTextDecorationsTree.acceptReplace(e,t,i,n)}}function Zje(e){return e.replace(/[^a-z0-9\-_]/gi," ")}class Yje{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class Qje extends Yje{constructor(e){super(e),this._resolvedColor=null,this.position="number"==typeof e.position?e.position:Mke.Center}getColor(e){return this._resolvedColor||("light"!==e.type&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if("string"==typeof e)return e;const i=e?t.getColor(e.id):null;return i?i.toString():""}}class Xje extends Yje{constructor(e){super(e),this.position=e.position}getColor(e){return this._resolvedColor||("light"!==e.type&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return"string"==typeof e?hRe.fromHex(e):t.getColor(e.id)}}class Jje{static from(e){return e instanceof Jje?e:new Jje(e)}constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}}class eqe{static register(e){return new eqe(e)}static createDynamic(e){return new eqe(e)}constructor(e){var t,i,n;this.description=e.description,this.blockClassName=e.blockClassName?Zje(e.blockClassName):null,this.blockIsAfterEnd=null!==(t=e.blockIsAfterEnd)&&void 0!==t?t:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?Zje(e.className):null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new Qje(e.overviewRuler):null,this.minimap=e.minimap?new Xje(e.minimap):null,this.glyphMarginClassName=e.glyphMarginClassName?Zje(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?Zje(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?Zje(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?Zje(e.marginClassName):null,this.inlineClassName=e.inlineClassName?Zje(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?Zje(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?Zje(e.afterContentClassName):null,this.after=e.after?Jje.from(e.after):null,this.before=e.before?Jje.from(e.before):null,this.hideInCommentTokens=null!==(i=e.hideInCommentTokens)&&void 0!==i&&i,this.hideInStringTokens=null!==(n=e.hideInStringTokens)&&void 0!==n&&n}}eqe.EMPTY=eqe.register({description:"empty"});const tqe=[eqe.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),eqe.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),eqe.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),eqe.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function iqe(e){return e instanceof eqe?e:eqe.createDynamic(e)}class nqe extends Owe{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new $we),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;this._deferredCnt--,0===this._deferredCnt&&(this._shouldFireDeferred&&this.doFire(),null===(e=this._affectedInjectedTextLines)||void 0===e||e.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){this._affectsMinimap||(this._affectsMinimap=!(!e.minimap||!e.minimap.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!(!e.overviewRuler||!e.overviewRuler.color)),this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this.tryFire()}tryFire(){0===this._deferredCnt?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._actual.fire(e)}}class oqe extends Owe{constructor(){super(),this._fastEmitter=this._register(new $we),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new $we),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,0===this._deferredCnt&&null!==this._deferredEvent){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){this._deferredCnt>0?this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e:(this._fastEmitter.fire(e),this._slowEmitter.fire(e))}}class sqe{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new GWe(new dye(1,1,1,1),0,0,new lye(1,1),0),new GWe(new dye(1,1,1,1),0,0,new lye(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new jWe(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?hye.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):hye.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,n){return t.equals(i)?n:e.normalizePosition(t,2)}static _validateViewState(e,t){const i=t.position,n=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),s=e.normalizePosition(i,2),r=this._validatePositionWithCache(e,n,i,s),a=this._validatePositionWithCache(e,o,n,r);return i.equals(s)&&n.equals(r)&&o.equals(a)?t:new GWe(dye.fromPositions(r,a),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+n.column-r.column,s,t.leftoverVisibleColumns+i.column-s.column)}_setState(e,t,i){if(i&&(i=sqe._validateViewState(e.viewModel,i)),t){const i=e.model.validateRange(t.selectionStart),n=t.selectionStart.equalsRange(i)?t.selectionStartLeftoverVisibleColumns:0,o=e.model.validatePosition(t.position),s=t.position.equals(o)?t.leftoverVisibleColumns:0;t=new GWe(i,t.selectionStartKind,n,o,s)}else{if(!i)return;const n=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new GWe(n,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){const n=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new GWe(n,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const n=e.coordinatesConverter.convertModelPositionToViewPosition(new lye(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new lye(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),s=new dye(n.lineNumber,n.column,o.lineNumber,o.column),r=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new GWe(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,r,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class rqe{constructor(e){this.context=e,this.cursors=[new sqe(e)],this.lastAddedCursorIndex=0}dispose(){for(const e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(const e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(const e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(const e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map((e=>e.readSelectionFromMarkers(this.context)))}getAll(){return this.cursors.map((e=>e.asCursorState()))}getViewPositions(){return this.cursors.map((e=>e.viewState.position))}getTopMostViewPosition(){return(e=this.cursors,t=gbe((e=>e.viewState.position),lye.compare),function(e,t){if(0===e.length)return;let i=e[0];for(let n=1;n<e.length;n++){const o=e[n];t(o,i)>0&&(i=o)}return i}(e,((e,i)=>-t(e,i)))).viewState.position;var e,t}getBottomMostViewPosition(){return function(e,t){if(0===e.length)return;let i=e[0];for(let n=1;n<e.length;n++){const o=e[n];t(o,i)>=0&&(i=o)}return i}(this.cursors,gbe((e=>e.viewState.position),lye.compare)).viewState.position}getSelections(){return this.cursors.map((e=>e.modelState.selection))}getViewSelections(){return this.cursors.map((e=>e.viewState.selection))}setSelections(e){this.setStates(jWe.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){null!==e&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.cursors.length-1,i=e.length;if(t<i){const e=i-t;for(let t=0;t<e;t++)this._addSecondaryCursor()}else if(t>i){const e=t-i;for(let t=0;t<e;t++)this._removeSecondaryCursor(this.cursors.length-2)}for(let t=0;t<i;t++)this.cursors[t+1].setState(this.context,e[t].modelState,e[t].viewState)}killSecondaryCursors(){this._setSecondaryStates([])}_addSecondaryCursor(){this.cursors.push(new sqe(this.context)),this.lastAddedCursorIndex=this.cursors.length-1}getLastAddedCursorIndex(){return 1===this.cursors.length||0===this.lastAddedCursorIndex?0:this.lastAddedCursorIndex}_removeSecondaryCursor(e){this.lastAddedCursorIndex>=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(1===this.cursors.length)return;const e=this.cursors.slice(0),t=[];for(let i=0,n=e.length;i<n;i++)t.push({index:i,selection:e[i].modelState.selection});t.sort(gbe((e=>e.selection),dye.compareRangesUsingStarts));for(let i=0;i<t.length-1;i++){const n=t[i],o=t[i+1],s=n.selection,r=o.selection;if(!this.context.cursorConfig.multiCursorMergeOverlapping)continue;let a;if(a=r.isEmpty()||s.isEmpty()?r.getStartPosition().isBeforeOrEqual(s.getEndPosition()):r.getStartPosition().isBefore(s.getEndPosition()),a){const s=n.index<o.index?i:i+1,r=n.index<o.index?i+1:i,a=t[r].index,l=t[s].index,d=t[r].selection,h=t[s].selection;if(!d.equalsSelection(h)){const i=d.plusRange(h),n=d.selectionStartLineNumber===d.startLineNumber&&d.selectionStartColumn===d.startColumn,o=h.selectionStartLineNumber===h.startLineNumber&&h.selectionStartColumn===h.startColumn;let r,c;a===this.lastAddedCursorIndex?(r=n,this.lastAddedCursorIndex=l):r=o,c=r?new hye(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn):new hye(i.endLineNumber,i.endColumn,i.startLineNumber,i.startColumn),t[s].selection=c;const u=jWe.fromModelSelection(c);e[l].setState(this.context,u.modelState,u.viewState)}for(const e of t)e.index>a&&e.index--;e.splice(a,1),t.splice(r,1),this._removeSecondaryCursor(a-1),i--}}}}class aqe{constructor(e,t,i,n){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=n}}class lqe{constructor(){this.type=0}}class dqe{constructor(){this.type=1}}class hqe{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class cqe{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}}class uqe{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0)}}class gqe{constructor(){this.type=5}}class pqe{constructor(e){this.type=6,this.isFocused=e}}class mqe{constructor(){this.type=7}}class fqe{constructor(){this.type=8}}class _qe{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class vqe{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class bqe{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class wqe{constructor(e,t,i,n,o,s,r){this.source=e,this.minimalReveal=t,this.range=i,this.selections=n,this.verticalType=o,this.revealHorizontal=s,this.scrollType=r,this.type=12}}class Cqe{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class yqe{constructor(e){this.theme=e,this.type=14}}class Sqe{constructor(e){this.type=15,this.ranges=e}}class xqe{constructor(){this.type=16}}class kqe{constructor(){this.type=17}}class Lqe extends Owe{constructor(){super(),this._onEvent=this._register(new $we),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t<i;t++){const i=this._outgoingEvents[t].kind===e.kind?this._outgoingEvents[t].attemptToMerge(e):null;if(i)return void(this._outgoingEvents[t]=i)}this._outgoingEvents.push(e)}_emitOutgoingEvents(){for(;this._outgoingEvents.length>0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t<i;t++)this._eventHandlers[t]===e&&console.warn("Detected duplicate listener in ViewEventDispatcher",e);this._eventHandlers.push(e)}removeViewEventHandler(e){for(let t=0;t<this._eventHandlers.length;t++)if(this._eventHandlers[t]===e){this._eventHandlers.splice(t,1);break}}beginEmitViewEvents(){return this._collectorCnt++,1===this._collectorCnt&&(this._collector=new Dqe),this._collector}endEmitViewEvents(){if(this._collectorCnt--,0===this._collectorCnt){const e=this._collector.outgoingEvents,t=this._collector.viewEvents;this._collector=null;for(const t of e)this._addOutgoingEvent(t);t.length>0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class Dqe{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class Eqe{constructor(e,t,i,n){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=n,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new Eqe(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class Nqe{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new Nqe(this.oldHasFocus,e.hasFocus)}}class Iqe{constructor(e,t,i,n,o,s,r,a){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,this.scrollWidth=o,this.scrollLeft=s,this.scrollHeight=r,this.scrollTop=a,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!(this.scrollWidthChanged||this.scrollLeftChanged||this.scrollHeightChanged||this.scrollTopChanged)}attemptToMerge(e){return e.kind!==this.kind?null:new Iqe(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class Tqe{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class Mqe{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class Aqe{constructor(e,t,i,n,o,s,r){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,this.source=o,this.reason=s,this.reachedMaxCursorCount=r}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(!e[n].equalsSelection(t[n]))return!1;return!0}isNoOp(){return Aqe._selectionsAreEqual(this.oldSelections,this.selections)&&this.oldModelVersionId===this.modelVersionId}attemptToMerge(e){return e.kind!==this.kind?null:new Aqe(this.oldSelections,e.selections,this.oldModelVersionId,e.modelVersionId,e.source,e.reason,this.reachedMaxCursorCount||e.reachedMaxCursorCount)}}class Rqe{constructor(){this.kind=5}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class Oqe{constructor(e){this.event=e,this.kind=7}isNoOp(){return!1}attemptToMerge(e){return null}}class Pqe{constructor(e){this.event=e,this.kind=8}isNoOp(){return!1}attemptToMerge(e){return null}}class Fqe{constructor(e){this.event=e,this.kind=9}isNoOp(){return!1}attemptToMerge(e){return null}}class Bqe{constructor(e){this.event=e,this.kind=10}isNoOp(){return!1}attemptToMerge(e){return null}}class Wqe{constructor(e){this.event=e,this.kind=11}isNoOp(){return!1}attemptToMerge(e){return null}}class Vqe{constructor(e){this.event=e,this.kind=12}isNoOp(){return!1}attemptToMerge(e){return null}}class Hqe extends Owe{constructor(e,t,i,n){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=i,this.context=new aqe(this._model,this._viewModel,this._coordinatesConverter,n),this._cursors=new rqe(this.context),this._hasFocus=!1,this._isHandling=!1,this._compositionState=null,this._columnSelectData=null,this._autoClosedActions=[],this._prevEditOperationType=0}dispose(){this._cursors.dispose(),this._autoClosedActions=Twe(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new aqe(this._model,this._viewModel,this._coordinatesConverter,e),this._cursors.updateContext(this.context)}onLineMappingChanged(e){this._knownModelVersionId===this._model.getVersionId()&&this.setStates(e,"viewModel",0,this.getCursorStates())}setHasFocus(e){this._hasFocus=e}_validateAutoClosedActions(){if(this._autoClosedActions.length>0){const e=this._cursors.getSelections();for(let t=0;t<this._autoClosedActions.length;t++){const i=this._autoClosedActions[t];i.isValid(e)||(i.dispose(),this._autoClosedActions.splice(t,1),t--)}}}getPrimaryCursorState(){return this._cursors.getPrimaryCursor()}getLastAddedCursorIndex(){return this._cursors.getLastAddedCursorIndex()}getCursorStates(){return this._cursors.getAll()}setStates(e,t,i,n){let o=!1;const s=this.context.cursorConfig.multiCursorLimit;null!==n&&n.length>s&&(n=n.slice(0,s),o=!0);const r=zqe.from(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,r,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,i,n,o,s){const r=this._cursors.getViewPositions();let a=null,l=null;r.length>1?l=this._cursors.getViewSelections():a=dye.fromPositions(r[0],r[0]),e.emitViewEvent(new wqe(t,i,a,l,n,o,s))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,n=t.length;i<n;i++){const n=t[i];e.push({inSelectionMode:!n.isEmpty(),selectionStart:{lineNumber:n.selectionStartLineNumber,column:n.selectionStartColumn},position:{lineNumber:n.positionLineNumber,column:n.positionColumn}})}return e}restoreState(e,t){const i=[];for(let e=0,n=t.length;e<n;e++){const n=t[e];let o=1,s=1;n.position&&n.position.lineNumber&&(o=n.position.lineNumber),n.position&&n.position.column&&(s=n.position.column);let r=o,a=s;n.selectionStart&&n.selectionStart.lineNumber&&(r=n.selectionStart.lineNumber),n.selectionStart&&n.selectionStart.column&&(a=n.selectionStart.column),i.push({selectionStartLineNumber:r,selectionStartColumn:a,positionLineNumber:o,positionColumn:s})}this.setStates(e,"restoreState",0,jWe.fromModelSelections(i)),this.revealPrimary(e,"restoreState",!1,0,!0,1)}onModelContentChanged(e,t){if(t instanceof Rje){if(this._isHandling)return;this._isHandling=!0;try{this.setStates(e,"modelChange",0,this.getCursorStates())}finally{this._isHandling=!1}}else{const i=t.rawContentChangedEvent;if(this._knownModelVersionId=i.versionId,this._isHandling)return;const n=i.containsEvent(1);if(this._prevEditOperationType=0,n)this._cursors.dispose(),this._cursors=new rqe(this.context),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,"model",1,null,!1);else if(this._hasFocus&&i.resultingSelection&&i.resultingSelection.length>0){const t=jWe.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?5:i.isRedoing?6:2,t)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const t=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,jWe.fromModelSelections(t))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,n){this.setStates(e,t,n,jWe.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],n=[];for(let o=0,s=e.length;o<s;o++)i.push({range:e[o],options:{description:"auto-closed-character",inlineClassName:"auto-closed-character",stickiness:1}}),n.push({range:t[o],options:{description:"auto-closed-enclosing",stickiness:1}});const o=this._model.deltaDecorations([],i),s=this._model.deltaDecorations([],n);this._autoClosedActions.push(new Uqe(this._model,o,s))}_executeEditOperation(e){if(!e)return;e.shouldPushStackElementBefore&&this._model.pushStackElement();const t=Kqe.executeCommands(this._model,this._cursors.getSelections(),e.commands);if(t){this._interpretCommandResult(t);const i=[],n=[];for(let t=0;t<e.commands.length;t++){const o=e.commands[t];o instanceof fVe&&o.enclosingRange&&o.closeCharacterRange&&(i.push(o.closeCharacterRange),n.push(o.enclosingRange))}i.length>0&&this._pushAutoClosedAction(i,n),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){e&&0!==e.length||(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,n,o){const s=zqe.from(this._model,this);if(s.equals(n))return!1;const r=this._cursors.getSelections(),a=this._cursors.getViewSelections();if(e.emitViewEvent(new cqe(a,r,i)),!n||n.cursorState.length!==s.cursorState.length||s.cursorState.some(((e,t)=>!e.modelState.equals(n.cursorState[t].modelState)))){const a=n?n.cursorState.map((e=>e.modelState.selection)):null,l=n?n.modelVersionId:0;e.emitOutgoingEvent(new Aqe(a,r,l,s.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];if(!n.text||n.text.indexOf("\n")>=0)return null;const o=n.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!o)return null;const s=o[1],r=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(s);if(!r||1!==r.length)return null;const a=r[0].open,l=n.text.length-o[2].length-1,d=n.text.lastIndexOf(a,l-1);if(-1===d)return null;t.push([d,l])}return t}executeEdits(e,t,i,n){let o=null;"snippet"===t&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);const s=[],r=[],a=this._model.pushEditOperations(this.getSelections(),i,(e=>{if(o)for(let t=0,i=o.length;t<i;t++){const[i,n]=o[t],a=e[t],l=a.range.startLineNumber,d=a.range.startColumn-1+i,h=a.range.startColumn-1+n;s.push(new dye(l,h+1,l,h+2)),r.push(new dye(l,d+1,l,h+2))}const t=n(e);return t&&(this._isHandling=!0),t}));a&&(this._isHandling=!1,this.setSelections(e,t,a,0)),s.length>0&&this._pushAutoClosedAction(s,r)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const o=zqe.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(e){wwe(e)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,o,!1)&&this.revealPrimary(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return Uqe.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new qqe(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit((()=>{"keyboard"===t&&this._executeEditOperation(mVe.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))}),e,t)}type(e,t,i){this._executeEdit((()=>{if("keyboard"===i){const e=t.length;let i=0;for(;i<e;){const e=GSe(t,i),n=t.substr(i,e);this._executeEditOperation(mVe.typeWithInterceptors(!!this._compositionState,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),n)),i+=e}}else this._executeEditOperation(mVe.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t))}),e,i)}compositionType(e,t,i,n,o,s){if(0!==t.length||0!==i||0!==n)this._executeEdit((()=>{this._executeEditOperation(mVe.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,o))}),e,s);else if(0!==o){const t=this.getSelections().map((e=>{const t=e.getPosition();return new hye(t.lineNumber,t.column+o,t.lineNumber,t.column+o)}));this.setSelections(e,s,t,0)}}paste(e,t,i,n,o){this._executeEdit((()=>{this._executeEditOperation(mVe.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))}),e,o,4)}cut(e,t){this._executeEdit((()=>{this._executeEditOperation(oVe.cut(this.context.cursorConfig,this._model,this.getSelections()))}),e,t)}executeCommand(e,t,i){this._executeEdit((()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new ZWe(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))}),e,i)}executeCommands(e,t,i){this._executeEdit((()=>{this._executeEditOperation(new ZWe(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))}),e,i)}}class zqe{static from(e,t){return new zqe(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e)return!1;if(this.modelVersionId!==e.modelVersionId)return!1;if(this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t<i;t++)if(!this.cursorState[t].equals(e.cursorState[t]))return!1;return!0}}class Uqe{static getAllAutoClosedCharacters(e){let t=[];for(const i of e)t=t.concat(i.getAutoClosedCharactersRanges());return t}constructor(e,t,i){this._model=e,this._autoClosedCharactersDecorations=t,this._autoClosedEnclosingDecorations=i}dispose(){this._autoClosedCharactersDecorations=this._model.deltaDecorations(this._autoClosedCharactersDecorations,[]),this._autoClosedEnclosingDecorations=this._model.deltaDecorations(this._autoClosedEnclosingDecorations,[])}getAutoClosedCharactersRanges(){const e=[];for(let t=0;t<this._autoClosedCharactersDecorations.length;t++){const i=this._model.getDecorationRange(this._autoClosedCharactersDecorations[t]);i&&e.push(i)}return e}isValid(e){const t=[];for(let e=0;e<this._autoClosedEnclosingDecorations.length;e++){const i=this._model.getDecorationRange(this._autoClosedEnclosingDecorations[e]);if(i&&(t.push(i),i.startLineNumber!==i.endLineNumber))return!1}t.sort(dye.compareRangesUsingStarts),e.sort(dye.compareRangesUsingStarts);for(let i=0;i<e.length;i++){if(i>=t.length)return!1;if(!t[i].strictContainsRange(e[i]))return!1}return!0}}class Kqe{static executeCommands(e,t,i){const n={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(n,i);for(let e=0,t=n.trackedRanges.length;e<t;e++)n.model._setTrackedRange(n.trackedRanges[e],null,0);return o}static _innerExecuteCommands(e,t){if(this._arrayIsEmpty(t))return null;const i=this._getEditOperations(e,t);if(0===i.operations.length)return null;const n=i.operations,o=this._getLoserCursorMap(n);if(o.hasOwnProperty("0"))return console.warn("Ignoring commands"),null;const s=[];for(let e=0,t=n.length;e<t;e++)o.hasOwnProperty(n[e].identifier.major.toString())||s.push(n[e]);i.hadTrackedEditOperation&&s.length>0&&(s[0]._isTracked=!0);let r=e.model.pushEditOperations(e.selectionsBefore,s,(i=>{const n=[];for(let t=0;t<e.selectionsBefore.length;t++)n[t]=[];for(const e of i)e.identifier&&n[e.identifier.major].push(e);const o=(e,t)=>e.identifier.minor-t.identifier.minor,s=[];for(let i=0;i<e.selectionsBefore.length;i++)n[i].length>0?(n[i].sort(o),s[i]=t[i].computeCursorState(e.model,{getInverseEditOperations:()=>n[i],getTrackedSelection:t=>{const i=parseInt(t,10),n=e.model._getTrackedRange(e.trackedRanges[i]);return 0===e.trackedRangesDirection[i]?new hye(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn):new hye(n.endLineNumber,n.endColumn,n.startLineNumber,n.startColumn)}})):s[i]=e.selectionsBefore[i];return s}));r||(r=e.selectionsBefore);const a=[];for(const e in o)o.hasOwnProperty(e)&&a.push(parseInt(e,10));a.sort(((e,t)=>t-e));for(const e of a)r.splice(e,1);return r}static _arrayIsEmpty(e){for(let t=0,i=e.length;t<i;t++)if(e[t])return!1;return!0}static _getEditOperations(e,t){let i=[],n=!1;for(let o=0,s=t.length;o<s;o++){const s=t[o];if(s){const t=this._getEditOperationsFromCommand(e,o,s);i=i.concat(t.operations),n=n||t.hadTrackedEditOperation}}return{operations:i,hadTrackedEditOperation:n}}static _getEditOperationsFromCommand(e,t,i){const n=[];let o=0;const s=(e,s,r=!1)=>{dye.isEmpty(e)&&""===s||n.push({identifier:{major:t,minor:o++},range:e,text:s,forceMoveMarkers:r,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let r=!1;const a={addEditOperation:s,addTrackedEditOperation:(e,t,i)=>{r=!0,s(e,t,i)},trackSelection:(t,i)=>{const n=hye.liftSelection(t);let o;if(n.isEmpty())if("boolean"==typeof i)o=i?2:3;else{const t=e.model.getLineMaxColumn(n.startLineNumber);o=n.startColumn===t?2:3}else o=1;const s=e.trackedRanges.length,r=e.model._setTrackedRange(null,n,o);return e.trackedRanges[s]=r,e.trackedRangesDirection[s]=n.getDirection(),s.toString()}};try{i.getEditOperations(e.model,a)}catch(e){return wwe(e),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:r}}static _getLoserCursorMap(e){(e=e.slice(0)).sort(((e,t)=>-dye.compareRangesUsingEnds(e.range,t.range)));const t={};for(let i=1;i<e.length;i++){const n=e[i-1],o=e[i];if(dye.getStartPosition(n.range).isBefore(dye.getEndPosition(o.range))){let s;s=n.identifier.major>o.identifier.major?n.identifier.major:o.identifier.major,t[s.toString()]=!0;for(let t=0;t<e.length;t++)e[t].identifier.major===s&&(e.splice(t,1),t<i&&i--,t--);i>0&&i--}}return t}}class jqe{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class qqe{static _capture(e,t){const i=[];for(const n of t){if(n.startLineNumber!==n.endLineNumber)return null;i.push(new jqe(e.getLineContent(n.startLineNumber),n.startColumn-1,n.endColumn-1))}return i}constructor(e,t){this._original=qqe._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=qqe._capture(e,t);if(!i)return null;if(this._original.length!==i.length)return null;const n=[];for(let e=0,t=this._original.length;e<t;e++)n.push(qqe._deduceOutcome(this._original[e],i[e]));return n}static _deduceOutcome(e,t){const i=Math.min(e.startSelection,t.startSelection,VSe(e.text,t.text)),n=Math.min(e.text.length-e.endSelection,t.text.length-t.endSelection,HSe(e.text,t.text)),o=e.text.substring(i,e.text.length-n),s=t.text.substring(i,t.text.length-n);return new _Ve(o,e.startSelection-i,e.endSelection-i,s,t.startSelection-i,t.endSelection-i)}}function $qe(e,t,i,n,o,s,r){let a="<div>",l=n,d=0,h=!0;for(let c=0,u=t.getCount();c<u;c++){const u=t.getEndOffset(c);if(u<=n)continue;let g="";for(;l<u&&l<o;l++){const t=e.charCodeAt(l);switch(t){case 9:{let e=s-(l+d)%s;for(d+=e-1;e>0;)r&&h?(g+=" ",h=!1):(g+=" ",h=!0),e--;break}case 60:g+="<",h=!1;break;case 62:g+=">",h=!1;break;case 38:g+="&",h=!1;break;case 0:g+="�",h=!1;break;case 65279:case 8232:case 8233:case 133:g+="�",h=!1;break;case 13:g+="​",h=!1;break;case 32:r&&h?(g+=" ",h=!1):(g+=" ",h=!0);break;default:g+=String.fromCharCode(t),h=!1}}if(a+=`<span style="${t.getInlineStyle(c,i)}">${g}</span>`,u>o||l>=o)break}return a+="</div>",a}class Gqe{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;const t=this._inserts,i=this._changes,n=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,n)}}class Zqe{constructor(e,t,i,n,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=n,this.minWidth=o,this.prefixSum=0}}class Yqe{constructor(e,t,i,n){this._instanceId=rxe(++Yqe.INSTANCE_COUNT),this._pendingChanges=new Gqe,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=i,this._paddingBottom=n}static findInsertionIndex(e,t,i){let n=0,o=e.length;for(;n<o;){const s=n+o>>>1;t===e[s].afterLineNumber?i<e[s].ordinal?o=s:n=s+1:t<e[s].afterLineNumber?o=s:n=s+1}return n}setLineHeight(e){this._checkPendingChanges(),this._lineHeight=e}setPadding(e,t){this._paddingTop=e,this._paddingBottom=t}onFlushed(e){this._checkPendingChanges(),this._lineCount=e}changeWhitespace(e){let t=!1;try{const i={insertWhitespace:(e,i,n,o)=>{t=!0,e|=0,i|=0,n|=0,o|=0;const s=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new Zqe(s,e,i,n,o)),s},changeOneWhitespace:(e,i,n)=>{t=!0,i|=0,n|=0,this._pendingChanges.change({id:e,newAfterLineNumber:i,newHeight:n})},removeWhitespace:e=>{t=!0,this._pendingChanges.remove({id:e})}};e(i)}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const t of e)this._insertWhitespace(t);for(const e of t)this._changeOneWhitespace(e.id,e.newAfterLineNumber,e.newHeight);for(const e of i){const t=this._findWhitespaceIndex(e.id);-1!==t&&this._removeWhitespace(t)}return}const n=new Set;for(const e of i)n.add(e.id);const o=new Map;for(const e of t)o.set(e.id,e);const s=e=>{const t=[];for(const i of e)if(!n.has(i.id)){if(o.has(i.id)){const e=o.get(i.id);i.afterLineNumber=e.newAfterLineNumber,i.height=e.newHeight}t.push(i)}return t},r=s(this._arr).concat(s(e));r.sort(((e,t)=>e.afterLineNumber===t.afterLineNumber?e.ordinal-t.ordinal:e.afterLineNumber-t.afterLineNumber)),this._arr=r,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=Yqe.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let i=0,n=t.length;i<n;i++)if(t[i].id===e)return i;return-1}_changeOneWhitespace(e,t,i){const n=this._findWhitespaceIndex(e);if(-1!==n&&(this._arr[n].height!==i&&(this._arr[n].height=i,this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,n-1)),this._arr[n].afterLineNumber!==t)){const e=this._arr[n];this._removeWhitespace(n),e.afterLineNumber=t,this._insertWhitespace(e)}}_removeWhitespace(e){this._arr.splice(e,1),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,e-1)}onLinesDeleted(e,t){this._checkPendingChanges(),e|=0,t|=0,this._lineCount-=t-e+1;for(let i=0,n=this._arr.length;i<n;i++){const n=this._arr[i].afterLineNumber;e<=n&&n<=t?this._arr[i].afterLineNumber=e-1:n>t&&(this._arr[i].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e|=0,t|=0,this._lineCount+=t-e+1;for(let i=0,n=this._arr.length;i<n;i++)e<=this._arr[i].afterLineNumber&&(this._arr[i].afterLineNumber+=t-e+1)}getWhitespacesTotalHeight(){return this._checkPendingChanges(),0===this._arr.length?0:this.getWhitespacesAccumulatedHeight(this._arr.length-1)}getWhitespacesAccumulatedHeight(e){this._checkPendingChanges(),e|=0;let t=Math.max(0,this._prefixSumValidIndex+1);0===t&&(this._arr[0].prefixSum=this._arr[0].height,t++);for(let i=t;i<=e;i++)this._arr[i].prefixSum=this._arr[i-1].prefixSum+this._arr[i].height;return this._prefixSumValidIndex=Math.max(this._prefixSumValidIndex,e),this._arr[e].prefixSum}getLinesTotalHeight(){return this._checkPendingChanges(),this._lineHeight*this._lineCount+this.getWhitespacesTotalHeight()+this._paddingTop+this._paddingBottom}getWhitespaceAccumulatedHeightBeforeLineNumber(e){this._checkPendingChanges(),e|=0;const t=this._findLastWhitespaceBeforeLineNumber(e);return-1===t?0:this.getWhitespacesAccumulatedHeight(t)}_findLastWhitespaceBeforeLineNumber(e){e|=0;const t=this._arr;let i=0,n=t.length-1;for(;i<=n;){const o=i+((n-i|0)/2|0)|0;if(t[o].afterLineNumber<e){if(o+1>=t.length||t[o+1].afterLineNumber>=e)return o;i=o+1|0}else n=o-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e|=0;const t=this._findLastWhitespaceBeforeLineNumber(e)+1;return t<this._arr.length?t:-1}getFirstWhitespaceIndexAfterLineNumber(e){return this._checkPendingChanges(),e|=0,this._findFirstWhitespaceAfterLineNumber(e)}getVerticalOffsetForLineNumber(e,t=!1){let i;return this._checkPendingChanges(),i=(e|=0)>1?this._lineHeight*(e-1):0,i+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0))+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){return this._checkPendingChanges(),e|=0,this._lineHeight*e+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0))+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),-1===this._minWidth){let e=0;for(let t=0,i=this._arr.length;t<i;t++)e=Math.max(e,this._arr[t].minWidth);this._minWidth=e}return this._minWidth}isAfterLines(e){return this._checkPendingChanges(),e>this.getLinesTotalHeight()}isInTopPadding(e){return 0!==this._paddingTop&&(this._checkPendingChanges(),e<this._paddingTop)}isInBottomPadding(e){return 0!==this._paddingBottom&&(this._checkPendingChanges(),e>=this.getLinesTotalHeight()-this._paddingBottom)}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),(e|=0)<0)return 1;const t=0|this._lineCount,i=this._lineHeight;let n=1,o=t;for(;n<o;){const t=(n+o)/2|0,s=0|this.getVerticalOffsetForLineNumber(t);if(e>=s+i)n=t+1;else{if(e>=s)return t;o=t}}return n>t?t:n}getLinesViewportData(e,t){this._checkPendingChanges(),e|=0,t|=0;const i=this._lineHeight,n=0|this.getLineNumberAtOrAfterVerticalOffset(e),o=0|this.getVerticalOffsetForLineNumber(n);let s=0|this._lineCount,r=0|this.getFirstWhitespaceIndexAfterLineNumber(n);const a=0|this.getWhitespacesCount();let l,d;-1===r?(r=a,d=s+1,l=0):(d=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));let h=o,c=h;const u=5e5;let g=0;o>=u&&(g=Math.floor(o/u)*u,g=Math.floor(g/i)*i,c-=g);const p=[],m=e+(t-e)/2;let f=-1;for(let e=n;e<=s;e++){for(-1===f&&(h<=m&&m<h+i||h>m)&&(f=e),h+=i,p[e-n]=c,c+=i;d===e;)c+=l,h+=l,r++,r>=a?d=s+1:(d=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));if(h>=t){s=e;break}}-1===f&&(f=s);const _=0|this.getVerticalOffsetForLineNumber(s);let v=n,b=s;return v<b&&o<e&&v++,v<b&&_+i>t&&b--,{bigNumbersDelta:g,startLineNumber:n,endLineNumber:s,relativeVerticalOffset:p,centeredLineNumber:f,completelyVisibleStartLineNumber:v,completelyVisibleEndLineNumber:b}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e|=0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i,n;return i=t>=1?this._lineHeight*t:0,n=e>0?this.getWhitespacesAccumulatedHeight(e-1):0,i+n+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e|=0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;if(e>=this.getVerticalOffsetForWhitespaceIndex(i)+this.getHeightForWhitespaceIndex(i))return-1;for(;t<i;){const n=Math.floor((t+i)/2),o=this.getVerticalOffsetForWhitespaceIndex(n);if(e>=o+this.getHeightForWhitespaceIndex(n))t=n+1;else{if(e>=o)return n;i=n}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e|=0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0)return null;if(t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const n=this.getHeightForWhitespaceIndex(t);return{id:this.getIdForWhitespaceIndex(t),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(t),verticalOffset:i,height:n}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e|=0,t|=0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),n=this.getWhitespacesCount()-1;if(i<0)return[];const o=[];for(let e=i;e<=n;e++){const i=this.getVerticalOffsetForWhitespaceIndex(e),n=this.getHeightForWhitespaceIndex(e);if(i>=t)break;o.push({id:this.getIdForWhitespaceIndex(e),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(e),verticalOffset:i,height:n})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].height}}Yqe.INSTANCE_COUNT=0;class Qqe{constructor(e,t,i,n){(e|=0)<0&&(e=0),(t|=0)<0&&(t=0),(i|=0)<0&&(i=0),(n|=0)<0&&(n=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=n,this.scrollHeight=Math.max(i,n)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class Xqe extends Owe{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new $we),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new Qqe(0,0,0,0),this._scrollable=this._register(new sBe({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const i=t.contentWidth!==e.contentWidth,n=t.contentHeight!==e.contentHeight;(i||n)&&this._onDidContentSizeChange.fire(new Eqe(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}}class Jqe extends Owe{constructor(e,t,i){super(),this._configuration=e;const n=this._configuration.options,o=n.get(138),s=n.get(80);this._linesLayout=new Yqe(t,n.get(63),s.top,s.bottom),this._scrollable=this._register(new Xqe(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new Qqe(o.contentWidth,0,o.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(108)?125:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(63)&&this._linesLayout.setLineHeight(t.get(63)),e.hasChanged(80)){const e=t.get(80);this._linesLayout.setPadding(e.top,e.bottom)}if(e.hasChanged(138)){const e=t.get(138),i=e.contentWidth,n=e.height,o=this._scrollable.getScrollDimensions(),s=o.contentWidth;this._scrollable.setScrollDimensions(new Qqe(i,o.contentWidth,n,this._getContentHeight(i,n,s)))}else this._updateHeight();e.hasChanged(108)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const i=this._configuration.options.get(97);return 2===i.horizontal||e>=t?0:i.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return n.get(99)?o+=Math.max(0,t-n.get(63)-n.get(80).bottom):o+=this._getHorizontalScrollbarHeight(e,i),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,n=e.contentWidth;this._scrollable.setScrollDimensions(new Qqe(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new sIe(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new sIe(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(e){const t=this._configuration.options,i=t.get(139),n=t.get(47),o=t.get(138);if(i.isViewportWrapping){const i=t.get(69);return e>o.contentWidth+n.typicalHalfwidthCharacterWidth&&i.enabled&&"right"===i.side?e+o.verticalScrollbarWidth:e}{const i=t.get(98)*n.typicalHalfwidthCharacterWidth,s=this._linesLayout.getWhitespaceMinWidth();return Math.max(e+i+o.verticalScrollbarWidth,s)}}setMaxLineWidth(e){const t=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new Qqe(t.width,this._computeContentWidth(e),t.height,t.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t);return{scrollTop:t,scrollTopWithoutViewZones:t-this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i),scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){1===t?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class e$e{constructor(e,t,i,n,o){this._cachedOnlyMinimapDecorations=null,this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=n,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let i=this._decorationsCache[t];if(!i){const n=e.range,o=e.options;let s;if(o.isWholeLine){const e=this._coordinatesConverter.convertModelPositionToViewPosition(new lye(n.startLineNumber,1),0),t=this._coordinatesConverter.convertModelPositionToViewPosition(new lye(n.endLineNumber,this.model.getLineMaxColumn(n.endLineNumber)),1);s=new dye(e.lineNumber,e.column,t.lineNumber,t.column)}else s=this._coordinatesConverter.convertModelRangeToViewRange(n,1);i=new cIe(s,o),this._decorationsCache[t]=i}return i}getDecorationsViewportData(e,t=!1){let i=null!==this._cachedModelDecorationsResolver;return i=i&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),i=i&&this._cachedOnlyMinimapDecorations===t,i||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,t),this._cachedModelDecorationsResolverViewRange=e,this._cachedOnlyMinimapDecorations=t),this._cachedModelDecorationsResolver}getInlineDecorationsOnLine(e,t=!1){const i=new dye(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(i,t).inlineDecorations[0]}_getDecorationsInRange(e,t){const i=this._linesCollection.getDecorationsInRange(e,this.editorId,owe(this.configuration.options),t),n=e.startLineNumber,o=e.endLineNumber,s=[];let r=0;const a=[];for(let e=n;e<=o;e++)a[e-n]=[];for(let e=0,t=i.length;e<t;e++){const t=i[e],h=t.options;if(l=this.model,(d=t).options.hideInCommentTokens&&function(e,t){return t$e(e,t.range,(e=>1===e))}(l,d)||d.options.hideInStringTokens&&function(e,t){return t$e(e,t.range,(e=>2===e))}(l,d))continue;const c=this._getOrCreateViewModelDecoration(t),u=c.range;if(s[r++]=c,h.inlineClassName){const e=new dIe(u,h.inlineClassName,h.inlineClassNameAffectsLetterSpacing?3:0),t=Math.max(n,u.startLineNumber),i=Math.min(o,u.endLineNumber);for(let o=t;o<=i;o++)a[o-n].push(e)}if(h.beforeContentClassName&&n<=u.startLineNumber&&u.startLineNumber<=o){const e=new dIe(new dye(u.startLineNumber,u.startColumn,u.startLineNumber,u.startColumn),h.beforeContentClassName,1);a[u.startLineNumber-n].push(e)}if(h.afterContentClassName&&n<=u.endLineNumber&&u.endLineNumber<=o){const e=new dIe(new dye(u.endLineNumber,u.endColumn,u.endLineNumber,u.endColumn),h.afterContentClassName,2);a[u.endLineNumber-n].push(e)}}var l,d;return{decorations:s,inlineDecorations:a}}}function t$e(e,t,i){for(let n=t.startLineNumber;n<=t.endLineNumber;n++){const o=e.tokenization.getLineTokens(n),s=n===t.startLineNumber,r=n===t.endLineNumber;let a=s?o.findTokenIndexAtOffset(t.startColumn-1):0;for(;a<o.getCount()&&!(r&&o.getStartOffset(a)>t.endColumn-1);){if(!i(o.getStandardTokenType(a)))return!1;a++}}return!0}function i$e(e,t){return null===e?t?o$e.INSTANCE:s$e.INSTANCE:new n$e(e,t)}class n$e{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,i){this._assertVisible();const n=i>0?this._projectionData.breakOffsets[i-1]:0,o=this._projectionData.breakOffsets[i];let s;if(null!==this._projectionData.injectionOffsets){const i=this._projectionData.injectionOffsets.map(((e,t)=>new Eje(0,0,e+1,this._projectionData.injectionOptions[t],0)));s=Eje.applyInjectedText(e.getLineContent(t),i).substring(n,o)}else s=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:o+1});return i>0&&(s=a$e(this._projectionData.wrappedTextIndentLength)+s),s}getViewLineLength(e,t,i){return this._assertVisible(),this._projectionData.getLineLength(i)}getViewLineMinColumn(e,t,i){return this._assertVisible(),this._projectionData.getMinOutputOffset(i)+1}getViewLineMaxColumn(e,t,i){return this._assertVisible(),this._projectionData.getMaxOutputOffset(i)+1}getViewLineData(e,t,i){const n=new Array;return this.getViewLinesData(e,t,i,1,0,[!0],n),n[0]}getViewLinesData(e,t,i,n,o,s,r){this._assertVisible();const a=this._projectionData,l=a.injectionOffsets,d=a.injectionOptions;let h,c=null;if(l){c=[];let e=0,t=0;for(let i=0;i<a.getOutputLineCount();i++){const n=new Array;c[i]=n;const o=i>0?a.breakOffsets[i-1]:0,s=a.breakOffsets[i];for(;t<l.length;){const r=d[t].content.length,h=l[t]+e,c=h+r;if(h>s)break;if(o<c){const e=d[t];if(e.inlineClassName){const t=i>0?a.wrappedTextIndentLength:0,r=t+Math.max(h-o,0),l=t+Math.min(c-o,s);r!==l&&n.push(new hIe(r,l,e.inlineClassName,e.inlineClassNameAffectsLetterSpacing))}}if(!(c<=s))break;e+=r,t++}}}h=l?e.tokenization.getLineTokens(t).withInserted(l.map(((e,t)=>({offset:e,text:d[t].content,tokenMetadata:HNe.defaultTokenMetadata})))):e.tokenization.getLineTokens(t);for(let e=i;e<i+n;e++){const t=o+e-i;s[t]?r[t]=this._getViewLineData(h,c?c[e]:null,e):r[t]=null}}_getViewLineData(e,t,i){this._assertVisible();const n=this._projectionData,o=i>0?n.wrappedTextIndentLength:0,s=i>0?n.breakOffsets[i-1]:0,r=n.breakOffsets[i],a=e.sliceAndInflate(s,r,o);let l=a.getLineContent();i>0&&(l=a$e(n.wrappedTextIndentLength)+l);const d=this._projectionData.getMinOutputOffset(i)+1,h=l.length+1,c=i+1<this.getViewLineCount(),u=0===i?0:n.breakOffsetsVisibleColumn[i-1];return new aIe(l,c,d,h,u,a,t)}getModelColumnOfViewPosition(e,t){return this._assertVisible(),this._projectionData.translateToInputOffset(e,t-1)+1}getViewPositionOfModelPosition(e,t,i=2){return this._assertVisible(),this._projectionData.translateToOutputPosition(t-1,i).toPosition(e)}getViewLineNumberOfModelPosition(e,t){return this._assertVisible(),e+this._projectionData.translateToOutputPosition(t-1).outputLineIndex}normalizePosition(e,t,i){const n=t.lineNumber-e;return this._projectionData.normalizeOutputPosition(e,t.column-1,i).toPosition(n)}getInjectedTextAt(e,t){return this._projectionData.getInjectedText(e,t-1)}_assertVisible(){if(!this._isVisible)throw new Error("Not supported")}}class o$e{constructor(){}isVisible(){return!0}setVisible(e){return e?this:s$e.INSTANCE}getProjectionData(){return null}getViewLineCount(){return 1}getViewLineContent(e,t,i){return e.getLineContent(t)}getViewLineLength(e,t,i){return e.getLineLength(t)}getViewLineMinColumn(e,t,i){return e.getLineMinColumn(t)}getViewLineMaxColumn(e,t,i){return e.getLineMaxColumn(t)}getViewLineData(e,t,i){const n=e.tokenization.getLineTokens(t),o=n.getLineContent();return new aIe(o,!1,1,o.length+1,0,n.inflate(),null)}getViewLinesData(e,t,i,n,o,s,r){s[o]?r[o]=this.getViewLineData(e,t,0):r[o]=null}getModelColumnOfViewPosition(e,t){return t}getViewPositionOfModelPosition(e,t){return new lye(e,t)}getViewLineNumberOfModelPosition(e,t){return e}normalizePosition(e,t,i){return t}getInjectedTextAt(e,t){return null}}o$e.INSTANCE=new o$e;class s$e{constructor(){}isVisible(){return!1}setVisible(e){return e?o$e.INSTANCE:this}getProjectionData(){return null}getViewLineCount(){return 0}getViewLineContent(e,t,i){throw new Error("Not supported")}getViewLineLength(e,t,i){throw new Error("Not supported")}getViewLineMinColumn(e,t,i){throw new Error("Not supported")}getViewLineMaxColumn(e,t,i){throw new Error("Not supported")}getViewLineData(e,t,i){throw new Error("Not supported")}getViewLinesData(e,t,i,n,o,s,r){throw new Error("Not supported")}getModelColumnOfViewPosition(e,t){throw new Error("Not supported")}getViewPositionOfModelPosition(e,t){throw new Error("Not supported")}getViewLineNumberOfModelPosition(e,t){throw new Error("Not supported")}normalizePosition(e,t,i){throw new Error("Not supported")}getInjectedTextAt(e,t){throw new Error("Not supported")}}s$e.INSTANCE=new s$e;const r$e=[""];function a$e(e){if(e>=r$e.length)for(let t=1;t<=e;t++)r$e[t]=l$e(t);return r$e[e]}function l$e(e){return new Array(e+1).join(" ")}class d$e{constructor(e,t,i,n,o,s,r,a,l,d){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=n,this.fontInfo=o,this.tabSize=s,this.wrappingStrategy=r,this.wrappingColumn=a,this.wrappingIndent=l,this.wordBreak=d,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new u$e(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const i=this.model.getLinesContent(),n=this.model.getInjectedTextDecorations(this._editorId),o=i.length,s=this.createLineBreaksComputer(),r=new pbe(Eje.fromDecorations(n));for(let e=0;e<o;e++){const n=r.takeWhile((t=>t.lineNumber===e+1));s.addRequest(i[e],n,t?t[e]:null)}const a=s.finalize(),l=[],d=this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e))).sort(dye.compareRangesUsingStarts);let h=1,c=0,u=-1,g=u+1<d.length?c+1:o+2;for(let e=0;e<o;e++){const t=e+1;t===g&&(u++,h=d[u].startLineNumber,c=d[u].endLineNumber,g=u+1<d.length?c+1:o+2);const i=t>=h&&t<=c,n=i$e(a[e],!i);l[e]=n.getViewLineCount(),this.modelLineProjections[e]=n}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new CEe(l)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e)))}setHiddenAreas(e){const t=e.map((e=>this.model.validateRange(e))),i=function(e){if(0===e.length)return[];const t=e.slice();t.sort(dye.compareRangesUsingStarts);const i=[];let n=t[0].startLineNumber,o=t[0].endLineNumber;for(let e=1,s=t.length;e<s;e++){const s=t[e];s.startLineNumber>o+1?(i.push(new dye(n,1,o,1)),n=s.startLineNumber,o=s.endLineNumber):s.endLineNumber>o&&(o=s.endLineNumber)}return i.push(new dye(n,1,o,1)),i}(t),n=this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e))).sort(dye.compareRangesUsingStarts);if(i.length===n.length){let e=!1;for(let t=0;t<i.length;t++)if(!i[t].equalsRange(n[t])){e=!0;break}if(!e)return!1}const o=i.map((e=>({range:e,options:eqe.EMPTY})));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,o);const s=i;let r=1,a=0,l=-1,d=l+1<s.length?a+1:this.modelLineProjections.length+2,h=!1;for(let e=0;e<this.modelLineProjections.length;e++){const t=e+1;t===d&&(l++,r=s[l].startLineNumber,a=s[l].endLineNumber,d=l+1<s.length?a+1:this.modelLineProjections.length+2);let i=!1;if(t>=r&&t<=a?this.modelLineProjections[e].isVisible()&&(this.modelLineProjections[e]=this.modelLineProjections[e].setVisible(!1),i=!0):(h=!0,this.modelLineProjections[e].isVisible()||(this.modelLineProjections[e]=this.modelLineProjections[e].setVisible(!0),i=!0)),i){const t=this.modelLineProjections[e].getViewLineCount();this.projectedModelLineLineCounts.setValue(e,t)}}return h||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return!(e<1||e>this.modelLineProjections.length)&&this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize!==e&&(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,n,o){const s=this.fontInfo.equals(e),r=this.wrappingStrategy===t,a=this.wrappingColumn===i,l=this.wrappingIndent===n,d=this.wordBreak===o;if(s&&r&&a&&l&&d)return!1;const h=s&&r&&!a&&l&&d;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=n,this.wordBreak=o;let c=null;if(h){c=[];for(let e=0,t=this.modelLineProjections.length;e<t;e++)c[e]=this.modelLineProjections[e].getProjectionData()}return this._constructLines(!1,c),!0}createLineBreaksComputer(){return("advanced"===this.wrappingStrategy?this._domLineBreaksComputerFactory:this._monospaceLineBreaksComputerFactory).createLineBreaksComputer(this.fontInfo,this.tabSize,this.wrappingColumn,this.wrappingIndent,this.wordBreak)}onModelFlushed(){this._constructLines(!0,null)}onModelLinesDeleted(e,t,i){if(!e||e<=this._validModelVersionId)return null;const n=1===t?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,o=this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections.splice(t-1,i-t+1),this.projectedModelLineLineCounts.removeValues(t-1,i-t+1),new vqe(n,o)}onModelLinesInserted(e,t,i,n){if(!e||e<=this._validModelVersionId)return null;const o=t>2&&!this.modelLineProjections[t-2].isVisible(),s=1===t?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let r=0;const a=[],l=[];for(let e=0,t=n.length;e<t;e++){const t=i$e(n[e],!o);a.push(t);const i=t.getViewLineCount();r+=i,l[e]=i}return this.modelLineProjections=this.modelLineProjections.slice(0,t-1).concat(a).concat(this.modelLineProjections.slice(t-1)),this.projectedModelLineLineCounts.insertValues(t-1,l),new bqe(s,s+r-1)}onModelLineChanged(e,t,i){if(null!==e&&e<=this._validModelVersionId)return[!1,null,null,null];const n=t-1,o=this.modelLineProjections[n].getViewLineCount(),s=i$e(i,this.modelLineProjections[n].isVisible());this.modelLineProjections[n]=s;const r=this.modelLineProjections[n].getViewLineCount();let a=!1,l=0,d=-1,h=0,c=-1,u=0,g=-1;return o>r?(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=l+r-1,u=d+1,g=u+(o-r)-1,a=!0):o<r?(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=l+o-1,h=d+1,c=h+(r-o)-1,a=!0):(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=l+r-1),this.projectedModelLineLineCounts.setValue(n,r),[a,l<=d?new _qe(l,d-l+1):null,h<=c?new bqe(h,c):null,u<=g?new vqe(u,g):null]}acceptVersionId(e){this._validModelVersionId=e,1!==this.modelLineProjections.length||this.modelLineProjections[0].isVisible()||this.setHiddenAreas([])}getViewLineCount(){return this.projectedModelLineLineCounts.getTotalSum()}_toValidViewLineNumber(e){if(e<1)return 1;const t=this.getViewLineCount();return e>t?t:0|e}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),s=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),r=this.model.guides.getActiveIndentGuide(n.lineNumber,o.lineNumber,s.lineNumber),a=this.convertModelPositionToViewPosition(r.startLineNumber,1),l=this.convertModelPositionToViewPosition(r.endLineNumber,this.model.getLineMaxColumn(r.endLineNumber));return{startLineNumber:a.lineNumber,endLineNumber:l.lineNumber,indent:r.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,n=t.remainder;return new h$e(i+1,n)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new lye(e.modelLineNumber,n)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new lye(e.modelLineNumber,n)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),n=this.getViewLineInfo(t),o=new Array;let s=this.getModelStartPositionOfViewLine(i),r=new Array;for(let e=i.modelLineNumber;e<=n.modelLineNumber;e++){const t=this.modelLineProjections[e-1];if(t.isVisible()){const o=e===i.modelLineNumber?i.modelLineWrappedLineIdx:0,s=e===n.modelLineNumber?n.modelLineWrappedLineIdx+1:t.getViewLineCount();for(let t=o;t<s;t++)r.push(new h$e(e,t))}if(!t.isVisible()&&s){const t=new lye(e-1,this.model.getLineMaxColumn(e-1)+1),i=dye.fromPositions(s,t);o.push(new c$e(i,r)),r=[],s=null}else t.isVisible()&&!s&&(s=new lye(e,1))}if(s){const e=dye.fromPositions(s,this.getModelEndPositionOfViewLine(n));o.push(new c$e(e,r))}return o}getViewLinesBracketGuides(e,t,i,n){const o=i?this.convertViewPositionToModelPosition(i.lineNumber,i.column):null,s=[];for(const i of this.getViewLineInfosGroupedByModelRanges(e,t)){const e=i.modelRange.startLineNumber,t=this.model.guides.getLinesBracketGuides(e,i.modelRange.endLineNumber,o,n);for(const n of i.viewLines){const i=t[n.modelLineNumber-e].map((e=>{if(-1!==e.forWrappedLinesAfterColumn&&this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.forWrappedLinesAfterColumn).lineNumber>=n.modelLineWrappedLineIdx)return;if(-1!==e.forWrappedLinesBeforeOrAtColumn&&this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.forWrappedLinesBeforeOrAtColumn).lineNumber<n.modelLineWrappedLineIdx)return;if(!e.horizontalLine)return e;let t=-1;if(-1!==e.column){const i=this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.column);if(i.lineNumber===n.modelLineWrappedLineIdx)t=i.column;else if(i.lineNumber<n.modelLineWrappedLineIdx)t=this.getMinColumnOfViewLine(n);else if(i.lineNumber>n.modelLineWrappedLineIdx)return}const i=this.convertModelPositionToViewPosition(n.modelLineNumber,e.horizontalLine.endColumn),o=this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.horizontalLine.endColumn);return o.lineNumber===n.modelLineWrappedLineIdx?new pHe(e.visibleColumn,t,e.className,new mHe(e.horizontalLine.top,i.column),-1,-1):o.lineNumber<n.modelLineWrappedLineIdx||-1!==e.visibleColumn?void 0:new pHe(e.visibleColumn,t,e.className,new mHe(e.horizontalLine.top,this.getMaxColumnOfViewLine(n)),-1,-1)}));s.push(i.filter((e=>!!e)))}}return s}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),n=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[];const s=[],r=[],a=i.lineNumber-1,l=n.lineNumber-1;let d=null;for(let e=a;e<=l;e++){const t=this.modelLineProjections[e];if(t.isVisible()){const n=t.getViewLineNumberOfModelPosition(0,e===a?i.column:1),o=t.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(e+1)),l=o-n+1;let h=0;l>1&&1===t.getViewLineMinColumn(this.model,e+1,o)&&(h=0===n?1:2),s.push(l),r.push(h),null===d&&(d=new lye(e+1,0))}else null!==d&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,e)),d=null)}null!==d&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,n.lineNumber)),d=null);const h=t-e+1,c=new Array(h);let u=0;for(let e=0,t=o.length;e<t;e++){let t=o[e];const i=Math.min(h-u,s[e]),n=r[e];let a;a=2===n?0:1===n?1:i;for(let e=0;e<i;e++)e===a&&(t=0),c[u++]=t}return c}getViewLineContent(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineContent(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineLength(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineLength(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineMinColumn(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineMinColumn(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineMaxColumn(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineMaxColumn(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineData(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineData(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLinesData(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const n=this.projectedModelLineLineCounts.getIndexOf(e-1);let o=e;const s=n.index,r=n.remainder,a=[];for(let n=s,l=this.model.getLineCount();n<l;n++){const l=this.modelLineProjections[n];if(!l.isVisible())continue;const d=n===s?r:0;let h=l.getViewLineCount()-d,c=!1;if(o+h>t&&(c=!0,h=t-o+1),l.getViewLinesData(this.model,n+1,d,h,o-e,i,a),o+=h,c)break}return a}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const n=this.projectedModelLineLineCounts.getIndexOf(e-1),o=n.index,s=n.remainder,r=this.modelLineProjections[o],a=r.getViewLineMinColumn(this.model,o+1,s),l=r.getViewLineMaxColumn(this.model,o+1,s);t<a&&(t=a),t>l&&(t=l);const d=r.getModelColumnOfViewPosition(s,t);return this.model.validatePosition(new lye(o+1,d)).equals(i)?new lye(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),n=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new dye(i.lineNumber,i.column,n.lineNumber,n.column)}convertViewPositionToModelPosition(e,t){const i=this.getViewLineInfo(e),n=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new lye(i.modelLineNumber,n))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new dye(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2){const n=this.model.validatePosition(new lye(e,t)),o=n.lineNumber,s=n.column;let r=o-1,a=!1;for(;r>0&&!this.modelLineProjections[r].isVisible();)r--,a=!0;if(0===r&&!this.modelLineProjections[r].isVisible())return new lye(1,1);const l=1+this.projectedModelLineLineCounts.getPrefixSum(r);let d;return d=a?this.modelLineProjections[r].getViewPositionOfModelPosition(l,this.model.getLineMaxColumn(r+1),i):this.modelLineProjections[o-1].getViewPositionOfModelPosition(l,s,i),d}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return dye.fromPositions(i)}{const t=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),i=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new dye(t.lineNumber,t.column,i.lineNumber,i.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const e=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(e,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(0===i&&!this.modelLineProjections[i].isVisible())return 1;const n=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(n,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,n){const o=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),s=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(s.lineNumber-o.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new dye(o.lineNumber,1,s.lineNumber,s.column),t,i,n);let r=[];const a=o.lineNumber-1,l=s.lineNumber-1;let d=null;for(let e=a;e<=l;e++)if(this.modelLineProjections[e].isVisible())null===d&&(d=new lye(e+1,e===a?o.column:1));else if(null!==d){const o=this.model.getLineMaxColumn(e);r=r.concat(this.model.getDecorationsInRange(new dye(d.lineNumber,d.column,e,o),t,i,n)),d=null}null!==d&&(r=r.concat(this.model.getDecorationsInRange(new dye(d.lineNumber,d.column,s.lineNumber,s.column),t,i,n)),d=null),r.sort(((e,t)=>{const i=dye.compareRangesUsingStarts(e.range,t.range);return 0===i?e.id<t.id?-1:e.id>t.id?1:0:i}));const h=[];let c=0,u=null;for(const e of r){const t=e.id;u!==t&&(u=t,h[c++]=e)}return h}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const i=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[i.modelLineNumber-1].normalizePosition(i.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return 0===t.modelLineWrappedLineIdx?this.model.getLineIndentColumn(t.modelLineNumber):0}}class h$e{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class c$e{constructor(e,t){this.modelRange=e,this.viewLines=t}}class u$e{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}class g$e{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new p$e(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,n){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,i,n)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new vqe(t,i)}onModelLinesInserted(e,t,i,n){return new bqe(t,i)}onModelLineChanged(e,t,i){return[!1,new _qe(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const i=t-e+1,n=new Array(i);for(let e=0;e<i;e++)n[e]=0;return n}getViewLineContent(e){return this.model.getLineContent(e)}getViewLineLength(e){return this.model.getLineLength(e)}getViewLineMinColumn(e){return this.model.getLineMinColumn(e)}getViewLineMaxColumn(e){return this.model.getLineMaxColumn(e)}getViewLineData(e){const t=this.model.tokenization.getLineTokens(e),i=t.getLineContent();return new aIe(i,!1,1,i.length+1,0,t.inflate(),null)}getViewLinesData(e,t,i){const n=this.model.getLineCount();e=Math.min(Math.max(1,e),n),t=Math.min(Math.max(1,t),n);const o=[];for(let n=e;n<=t;n++){const t=n-e;o[t]=i[t]?this.getViewLineData(n):null}return o}getDecorationsInRange(e,t,i,n){return this.model.getDecorationsInRange(e,t,i,n)}normalizePosition(e,t){return this.model.normalizePosition(e,t)}getLineIndentColumn(e){return this.model.getLineIndentColumn(e)}getInjectedTextAt(e){return null}}class p$e{constructor(e){this._lines=e}_validPosition(e){return this._lines.model.validatePosition(e)}_validRange(e){return this._lines.model.validateRange(e)}convertViewPositionToModelPosition(e){return this._validPosition(e)}convertViewRangeToModelRange(e){return this._validRange(e)}validateViewPosition(e,t){return this._validPosition(t)}validateViewRange(e,t){return this._validRange(t)}convertModelPositionToViewPosition(e){return this._validPosition(e)}convertModelRangeToViewRange(e){return this._validRange(e)}modelPositionIsVisible(e){const t=this._lines.model.getLineCount();return!(e.lineNumber<1||e.lineNumber>t)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}class m$e extends Owe{constructor(e,t,i,n,o,s,r,a){if(super(),this.languageConfigurationService=r,this._themeService=a,this.hiddenAreasModel=new v$e,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new Lqe,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new KWe(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._tokenizeViewportSoon=this._register(new FDe((()=>this.tokenizeViewport()),50)),this._updateConfigurationViewLineCount=this._register(new FDe((()=>this._updateConfigurationViewLineCountNow()),0)),this._hasFocus=!1,this._viewportStart=f$e.create(this.model),this.model.isTooLargeForTokenization())this._lines=new g$e(this.model);else{const e=this._configuration.options,t=e.get(47),i=e.get(132),s=e.get(139),r=e.get(131),a=e.get(123);this._lines=new d$e(this._editorId,this.model,n,o,t,this.model.getOptions().tabSize,i,s.wrappingColumn,r,a)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new Hqe(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new Jqe(this._configuration,this.getLineCount(),s)),this._register(this.viewLayout.onDidScroll((e=>{e.scrollTopChanged&&this._tokenizeViewportSoon.schedule(),e.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new Cqe(e)),this._eventDispatcher.emitOutgoingEvent(new Iqe(e.oldScrollWidth,e.oldScrollLeft,e.oldScrollHeight,e.oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop))}))),this._register(this.viewLayout.onDidContentSizeChange((e=>{this._eventDispatcher.emitOutgoingEvent(e)}))),this._decorations=new e$e(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast((e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}}))),this._register(OHe.getInstance().onDidChange((()=>{this._eventDispatcher.emitSingleViewEvent(new xqe)}))),this._register(this._themeService.onDidColorThemeChange((e=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new yqe(e))}))),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}tokenizeViewport(){const e=this.viewLayout.getLinesViewportData(),t=new dye(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber)),i=this._toModelVisibleRanges(t);for(const e of i)this.model.tokenization.tokenizeViewport(e.startLineNumber,e.endLineNumber)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new pqe(e)),this._eventDispatcher.emitOutgoingEvent(new Nqe(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new lqe)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new dqe)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new lye(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new w$e(t,this._viewportStart.startLineDelta)}return new w$e(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),n=this._configuration.options,o=n.get(47),s=n.get(132),r=n.get(139),a=n.get(131),l=n.get(123);this._lines.setWrappingSettings(o,s,r.wrappingColumn,a,l)&&(e.emitViewEvent(new gqe),e.emitViewEvent(new fqe),e.emitViewEvent(new uqe(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(86)&&(this._decorations.reset(),e.emitViewEvent(new uqe(null))),e.emitViewEvent(new hqe(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),KWe.shouldRecreate(t)&&(this.cursorConfig=new KWe(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText((e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();let i=!1,n=!1;const o=e instanceof Oje?e.rawContentChangedEvent.changes:e.changes,s=e instanceof Oje?e.rawContentChangedEvent.versionId:null,r=this._lines.createLineBreaksComputer();for(const e of o)switch(e.changeType){case 4:for(let t=0;t<e.detail.length;t++){const i=e.detail[t];let n=e.injectedTexts[t];n&&(n=n.filter((e=>!e.ownerId||e.ownerId===this._editorId))),r.addRequest(i,n,null)}break;case 2:{let t=null;e.injectedText&&(t=e.injectedText.filter((e=>!e.ownerId||e.ownerId===this._editorId))),r.addRequest(e.detail,t,null);break}}const a=r.finalize(),l=new pbe(a);for(const e of o)switch(e.changeType){case 1:this._lines.onModelFlushed(),t.emitViewEvent(new gqe),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),i=!0;break;case 3:{const n=this._lines.onModelLinesDeleted(s,e.fromLineNumber,e.toLineNumber);null!==n&&(t.emitViewEvent(n),this.viewLayout.onLinesDeleted(n.fromLineNumber,n.toLineNumber)),i=!0;break}case 4:{const n=l.takeCount(e.detail.length),o=this._lines.onModelLinesInserted(s,e.fromLineNumber,e.toLineNumber,n);null!==o&&(t.emitViewEvent(o),this.viewLayout.onLinesInserted(o.fromLineNumber,o.toLineNumber)),i=!0;break}case 2:{const i=l.dequeue(),[o,r,a,d]=this._lines.onModelLineChanged(s,e.lineNumber,i);n=o,r&&t.emitViewEvent(r),a&&(t.emitViewEvent(a),this.viewLayout.onLinesInserted(a.fromLineNumber,a.toLineNumber)),d&&(t.emitViewEvent(d),this.viewLayout.onLinesDeleted(d.fromLineNumber,d.toLineNumber));break}}null!==s&&this._lines.acceptVersionId(s),this.viewLayout.onHeightMaybeChanged(),!i&&n&&(t.emitViewEvent(new fqe),t.emitViewEvent(new uqe(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){const e=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(e){const t=this.coordinatesConverter.convertModelPositionToViewPosition(e.getStartPosition()),i=this.viewLayout.getVerticalOffsetForLineNumber(t.lineNumber);this.viewLayout.setScrollPosition({scrollTop:i+this._viewportStart.startLineDelta},1)}}try{const t=this._eventDispatcher.beginEmitViewEvents();e instanceof Oje&&t.emitOutgoingEvent(new Bqe(e.contentChangedEvent)),this._cursor.onModelContentChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._tokenizeViewportSoon.schedule()}))),this._register(this.model.onDidChangeTokens((e=>{const t=[];for(let i=0,n=e.ranges.length;i<n;i++){const n=e.ranges[i],o=this.coordinatesConverter.convertModelPositionToViewPosition(new lye(n.fromLineNumber,1)).lineNumber,s=this.coordinatesConverter.convertModelPositionToViewPosition(new lye(n.toLineNumber,this.model.getLineMaxColumn(n.toLineNumber))).lineNumber;t[i]={fromLineNumber:o,toLineNumber:s}}this._eventDispatcher.emitSingleViewEvent(new Sqe(t)),e.tokenizationSupportChanged&&this._tokenizeViewportSoon.schedule(),this._eventDispatcher.emitOutgoingEvent(new Vqe(e))}))),this._register(this.model.onDidChangeLanguageConfiguration((e=>{this._eventDispatcher.emitSingleViewEvent(new mqe),this.cursorConfig=new KWe(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Fqe(e))}))),this._register(this.model.onDidChangeLanguage((e=>{this.cursorConfig=new KWe(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Pqe(e))}))),this._register(this.model.onDidChangeOptions((e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const e=this._eventDispatcher.beginEmitViewEvents();e.emitViewEvent(new gqe),e.emitViewEvent(new fqe),e.emitViewEvent(new uqe(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new KWe(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Wqe(e))}))),this._register(this.model.onDidChangeDecorations((e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new uqe(e)),this._eventDispatcher.emitOutgoingEvent(new Oqe(e))})))}setHiddenAreas(e,t){this.hiddenAreasModel.setHiddenAreas(t,e);const i=this.hiddenAreasModel.getMergedRanges();if(i===this.previousHiddenAreas)return;this.previousHiddenAreas=i;const n=this._captureStableViewport();let o=!1;try{const e=this._eventDispatcher.beginEmitViewEvents();o=this._lines.setHiddenAreas(i),o&&(e.emitViewEvent(new gqe),e.emitViewEvent(new fqe),e.emitViewEvent(new uqe(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged()),n.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),o&&this._eventDispatcher.emitOutgoingEvent(new Mqe)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(138),t=this._configuration.options.get(63),i=Math.max(20,Math.round(e.height/t)),n=this.viewLayout.getLinesViewportData(),o=Math.max(1,n.completelyVisibleStartLineNumber-i),s=Math.min(this.getLineCount(),n.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new dye(o,this.getLineMinColumn(o),s,this.getLineMaxColumn(s)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(0===i.length)return[t];const n=[];let o=0,s=t.startLineNumber,r=t.startColumn;const a=t.endLineNumber,l=t.endColumn;for(let e=0,t=i.length;e<t;e++){const t=i[e].startLineNumber,l=i[e].endLineNumber;l<s||t>a||(s<t&&(n[o++]=new dye(s,r,t-1,this.model.getLineMaxColumn(t-1))),s=l+1,r=1)}return(s<a||s===a&&r<l)&&(n[o++]=new dye(s,r,a,l)),n}getCompletelyVisibleViewRange(){const e=this.viewLayout.getLinesViewportData(),t=e.completelyVisibleStartLineNumber,i=e.completelyVisibleEndLineNumber;return new dye(t,this.getLineMinColumn(t),i,this.getLineMaxColumn(i))}getCompletelyVisibleViewRangeAtScrollTop(e){const t=this.viewLayout.getLinesViewportDataAtScrollTop(e),i=t.completelyVisibleStartLineNumber,n=t.completelyVisibleEndLineNumber;return new dye(i,this.getLineMinColumn(i),n,this.getLineMaxColumn(n))}saveState(){const e=this.viewLayout.saveState(),t=e.scrollTop,i=this.viewLayout.getLineNumberAtVerticalOffset(t),n=this.coordinatesConverter.convertViewPositionToModelPosition(new lye(i,this.getLineMinColumn(i))),o=this.viewLayout.getVerticalOffsetForLineNumber(i)-t;return{scrollLeft:e.scrollLeft,firstPosition:n,firstPositionDeltaTop:o}}reduceRestoreState(e){if(void 0===e.firstPosition)return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),n=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:n}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,n){return this._lines.getViewLinesBracketGuides(e,t,i,n)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=ESe(this.getLineContent(e));return-1===t?0:t+1}getLineLastNonWhitespaceColumn(e){const t=ISe(this.getLineContent(e));return-1===t?0:t+2}getDecorationsInViewport(e,t=!1){return this._decorations.getDecorationsViewportData(e,t).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewportViewLineRenderingData(e,t){const i=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,i)}getViewLineRenderingData(e){const t=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,t)}_getViewLineRenderingData(e,t){const i=this.model.mightContainRTL(),n=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),s=this._lines.getViewLineData(e);return s.inlineDecorations&&(t=[...t,...s.inlineDecorations.map((t=>t.toInlineDecoration(e)))]),new lIe(s.minColumn,s.maxColumn,s.content,s.continuesWithWrappedLine,i,n,s.tokens,t,o,s.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const n=this._lines.getViewLinesData(e,t,i);return new rIe(this.getTabSize(),n)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,owe(this._configuration.options)),i=new _$e;for(const n of t){const t=n.options,o=t.overviewRuler;if(!o)continue;const s=o.position;if(0===s)continue;const r=o.getColor(e.value),a=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.startLineNumber,n.range.startColumn),l=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.endLineNumber,n.range.endColumn);i.accept(r,t.zIndex,a,l,s)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const e=t.options.overviewRuler;null==e||e.invalidateCachedColor();const i=t.options.minimap;null==i||i.invalidateCachedColor()}}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getValueLengthInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(i,t)}modifyPosition(e,t){const i=this.coordinatesConverter.convertViewPositionToModelPosition(e);return this.model.modifyPosition(i,t)}deduceModelPositionRelativeToViewPosition(e,t,i){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e);2===this.model.getEOL().length&&(t<0?t-=i:t+=i);const o=this.model.getOffsetAt(n)+t;return this.model.getPositionAt(o)}getPlainTextToCopy(e,t,i){const n=i?"\r\n":this.model.getEOL();(e=e.slice(0)).sort(dye.compareRangesUsingStarts);let o=!1,s=!1;for(const t of e)t.isEmpty()?o=!0:s=!0;if(!s){if(!t)return"";const i=e.map((e=>e.startLineNumber));let o="";for(let e=0;e<i.length;e++)e>0&&i[e-1]===i[e]||(o+=this.model.getLineContent(i[e])+n);return o}if(o&&t){const t=[];let n=0;for(const o of e){const e=o.startLineNumber;o.isEmpty()?e!==n&&t.push(this.model.getLineContent(e)):t.push(this.model.getValueInRange(o,i?2:0)),n=e}return 1===t.length?t[0]:t}const r=[];for(const t of e)t.isEmpty()||r.push(this.model.getValueInRange(t,i?2:0));return 1===r.length?r[0]:r}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===tDe)return null;if(1!==e.length)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const e=n.startLineNumber;n=new dye(e,this.model.getLineMinColumn(e),e,this.model.getLineMaxColumn(e))}const o=this._configuration.options.get(47),s=this._getColorMap();let r;return/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===mwe.fontFamily?r=mwe.fontFamily:(r=o.fontFamily,r=r.replace(/"/g,"'"),/[,']/.test(r)||/[+ ]/.test(r)&&(r=`'${r}'`),r=`${r}, ${mwe.fontFamily}`),{mode:i,html:`<div style="color: ${s[1]};background-color: ${s[2]};font-family: ${r};font-weight: ${o.fontWeight};font-size: ${o.fontSize}px;line-height: ${o.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(n,s)+"</div>"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,s=e.endColumn,r=this.getTabSize();let a="";for(let e=i;e<=o;e++){const l=this.model.tokenization.getLineTokens(e),d=l.getLineContent(),h=e===i?n-1:0,c=e===o?s-1:d.length;a+=""===d?"<br>":$qe(d,l.inflate(),t,h,c,r,Lve)}return a}_getColorMap(){const e=Eye.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;i<n;i++)t[i]=hRe.Format.CSS.formatHex(e[i]);return t}getPrimaryCursorState(){return this._cursor.getPrimaryCursorState()}getLastAddedCursorIndex(){return this._cursor.getLastAddedCursorIndex()}getCursorStates(){return this._cursor.getCursorStates()}setCursorStates(e,t,i){return this._withViewEventsCollector((n=>this._cursor.setStates(n,e,t,i)))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=0){this._withViewEventsCollector((n=>this._cursor.setSelections(n,e,t,i)))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector((t=>this._cursor.restoreState(t,e)))}_executeCursorEdit(e){this._cursor.context.cursorConfig.readOnly?this._eventDispatcher.emitOutgoingEvent(new Rqe):this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit((n=>this._cursor.executeEdits(n,e,t,i)))}startComposition(){this._executeCursorEdit((e=>this._cursor.startComposition(e)))}endComposition(e){this._executeCursorEdit((t=>this._cursor.endComposition(t,e)))}type(e,t){this._executeCursorEdit((i=>this._cursor.type(i,e,t)))}compositionType(e,t,i,n,o){this._executeCursorEdit((s=>this._cursor.compositionType(s,e,t,i,n,o)))}paste(e,t,i,n){this._executeCursorEdit((o=>this._cursor.paste(o,e,t,i,n)))}cut(e){this._executeCursorEdit((t=>this._cursor.cut(t,e)))}executeCommand(e,t){this._executeCursorEdit((i=>this._cursor.executeCommand(i,e,t)))}executeCommands(e,t){this._executeCursorEdit((i=>this._cursor.executeCommands(i,e,t)))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector((n=>this._cursor.revealPrimary(n,e,i,0,t,0)))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new dye(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector((t=>t.emitViewEvent(new wqe(e,!1,i,null,0,!0,0))))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new dye(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector((t=>t.emitViewEvent(new wqe(e,!1,i,null,0,!0,0))))}revealRange(e,t,i,n,o){this._withViewEventsCollector((s=>s.emitViewEvent(new wqe(e,!1,i,null,n,t,o))))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new kqe),this._eventDispatcher.emitOutgoingEvent(new Tqe))}_withViewEventsCollector(e){try{return e(this._eventDispatcher.beginEmitViewEvents())}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}}class f$e{static create(e){const t=e._setTrackedRange(null,new dye(1,1,1,1),1);return new f$e(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,i,n,o){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=n,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new lye(t,e.getLineMinColumn(t))),n=e.model._setTrackedRange(this._modelTrackedRange,new dye(i.lineNumber,i.column,i.lineNumber,i.column),1),o=e.viewLayout.getVerticalOffsetForLineNumber(t),s=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=n,this._startLineDelta=s-o}invalidate(){this._isValid=!1}}class _$e{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,n,o){const s=this._asMap[e];if(s){const e=s.data,t=e[e.length-3],r=e[e.length-1];if(t===o&&r+1>=i)return void(n>r&&(e[e.length-1]=n));e.push(o,i,n)}else{const s=new uIe(e,t,[o,i,n]);this._asMap[e]=s,this.asArray.push(s)}}}class v$e{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&b$e(i,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;const e=Array.from(this.hiddenAreas.values()).reduce(((e,t)=>function(e,t){const i=[];let n=0,o=0;for(;n<e.length&&o<t.length;){const s=e[n],r=t[o];if(s.endLineNumber<r.startLineNumber-1)i.push(e[n++]);else if(r.endLineNumber<s.startLineNumber-1)i.push(t[o++]);else{const e=Math.min(s.startLineNumber,r.startLineNumber),t=Math.max(s.endLineNumber,r.endLineNumber);i.push(new dye(e,1,t,1)),n++,o++}}for(;n<e.length;)i.push(e[n++]);for(;o<t.length;)i.push(t[o++]);return i}(e,t)),[]);return b$e(this.ranges,e)||(this.ranges=e),this.ranges}}function b$e(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].equalsRange(t[i]))return!1;return!0}class w$e{constructor(e,t){this.viewportStartModelPosition=e,this.startLineDelta=t}recoverViewportStart(e,t){if(!this.viewportStartModelPosition)return;const i=e.convertModelPositionToViewPosition(this.viewportStartModelPosition),n=t.getVerticalOffsetForLineNumber(i.lineNumber);t.setScrollPosition({scrollTop:n+this.startLineDelta},1)}}class C$e{constructor(...e){this._entries=new Map;for(const[t,i]of e)this.set(t,i)}set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}get(e){return this._entries.get(e)}}var y$e;!function(e){e[e.Ignore=0]="Ignore",e[e.Info=1]="Info",e[e.Warning=2]="Warning",e[e.Error=3]="Error"}(y$e||(y$e={})),function(e){const t="error",i="warning",n="info";e.fromValue=function(o){return o?BSe(t,o)?e.Error:BSe(i,o)||BSe("warn",o)?e.Warning:BSe(n,o)?e.Info:e.Ignore:e.Ignore},e.toString=function(o){switch(o){case e.Error:return t;case e.Warning:return i;case e.Info:return n;default:return"ignore"}}}(y$e||(y$e={}));const S$e=y$e;var x$e=S$e;const k$e=zxe("notificationService");class L$e{constructor(e,t,i,n,o){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=n,this.wrappedTextIndentLength=o}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let i=this.breakOffsets[e]-t;return e>0&&(i+=this.wrappedTextIndentLength),i}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let i=0===e?t:this.breakOffsets[e-1]+t;if(null!==this.injectionOffsets)for(let e=0;e<this.injectionOffsets.length&&i>this.injectionOffsets[e];e++)i<this.injectionOffsets[e]+this.injectionOptions[e].content.length?i=this.injectionOffsets[e]:i-=this.injectionOptions[e].content.length;return i}translateToOutputPosition(e,t=2){let i=e;if(null!==this.injectionOffsets)for(let n=0;n<this.injectionOffsets.length&&!(e<this.injectionOffsets[n])&&(1===t||e!==this.injectionOffsets[n]);n++)i+=this.injectionOptions[n].content.length;return this.offsetInInputWithInjectionsToOutputPosition(i,t)}offsetInInputWithInjectionsToOutputPosition(e,t=2){let i=0,n=this.breakOffsets.length-1,o=0,s=0;for(;i<=n;){o=i+(n-i)/2|0;const r=this.breakOffsets[o];if(s=o>0?this.breakOffsets[o-1]:0,0===t)if(e<=s)n=o-1;else{if(!(e>r))break;i=o+1}else if(e<s)n=o-1;else{if(!(e>=r))break;i=o+1}}let r=e-s;return o>0&&(r+=this.wrappedTextIndentLength),new N$e(o,r)}normalizeOutputPosition(e,t,i){if(null!==this.injectionOffsets){const n=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(n,i);if(o!==n)return this.offsetInInputWithInjectionsToOutputPosition(o,i)}if(0===i){if(e>0&&t===this.getMinOutputOffset(e))return new N$e(e-1,this.getMaxOutputOffset(e-1))}else if(1===i&&e<this.getOutputLineCount()-1&&t===this.getMaxOutputOffset(e))return new N$e(e+1,this.getMinOutputOffset(e+1));return new N$e(e,t)}outputPositionToOffsetInInputWithInjections(e,t){return e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(2===t){if(e===i.offsetInInputWithInjections+i.length&&D$e(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let e=i.offsetInInputWithInjections;if(E$e(this.injectionOptions[i.injectedTextIndex].cursorStops))return e;let t=i.injectedTextIndex-1;for(;t>=0&&this.injectionOffsets[t]===this.injectionOffsets[i.injectedTextIndex]&&!D$e(this.injectionOptions[t].cursorStops)&&(e-=this.injectionOptions[t].content.length,!E$e(this.injectionOptions[t].cursorStops));)t--;return e}}if(1===t||4===t){let e=i.offsetInInputWithInjections+i.length,t=i.injectedTextIndex;for(;t+1<this.injectionOffsets.length&&this.injectionOffsets[t+1]===this.injectionOffsets[t];)e+=this.injectionOptions[t+1].content.length,t++;return e}if(0===t||3===t){let e=i.offsetInInputWithInjections,t=i.injectedTextIndex;for(;t-1>=0&&this.injectionOffsets[t-1]===this.injectionOffsets[t];)e-=this.injectionOptions[t-1].content.length,t--;return e}jxe()}getInjectedText(e,t){const i=this.outputPositionToOffsetInInputWithInjections(e,t),n=this.getInjectedTextAtOffset(i);return n?{options:this.injectionOptions[n.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(null!==t){let n=0;for(let o=0;o<t.length;o++){const s=i[o].content.length,r=t[o]+n,a=t[o]+n+s;if(r>e)break;if(e<=a)return{injectedTextIndex:o,offsetInInputWithInjections:r,length:s};n+=s}}}}function D$e(e){return null==e||e===Rke.Right||e===Rke.Both}function E$e(e){return null==e||e===Rke.Left||e===Rke.Both}class N$e{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new lye(e+this.outputLineIndex,this.outputOffset+1)}}class I$e{static create(e){return new I$e(e.get(127),e.get(126))}constructor(e,t){this.classifier=new T$e(e,t)}createLineBreaksComputer(e,t,i,n,o){const s=[],r=[],a=[];return{addRequest:(e,t,i)=>{s.push(e),r.push(t),a.push(i)},finalize:()=>{const l=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,d=[];for(let e=0,h=s.length;e<h;e++){const h=r[e],c=a[e];!c||c.injectionOptions||h?d[e]=O$e(this.classifier,s[e],h,t,i,l,n,o):d[e]=R$e(this.classifier,c,s[e],t,i,l,n,o)}return M$e.length=0,A$e.length=0,d}}}}class T$e extends xEe{constructor(e,t){super(0);for(let t=0;t<e.length;t++)this.set(e.charCodeAt(t),1);for(let e=0;e<t.length;e++)this.set(t.charCodeAt(e),2)}get(e){return e>=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let M$e=[],A$e=[];function R$e(e,t,i,n,o,s,r,a){if(-1===o)return null;const l=i.length;if(l<=1)return null;const d="keepAll"===a,h=t.breakOffsets,c=t.breakOffsetsVisibleColumn,u=W$e(i,n,o,s,r),g=o-u,p=M$e,m=A$e;let f=0,_=0,v=0,b=o;const w=h.length;let C=0;if(C>=0){let e=Math.abs(c[C]-b);for(;C+1<w;){const t=Math.abs(c[C+1]-b);if(t>=e)break;e=t,C++}}for(;C<w;){let t=C<0?0:h[C],o=C<0?0:c[C];_>t&&(t=_,o=v);let r=0,a=0,u=0,y=0;if(o<=b){let v=o,w=0===t?0:i.charCodeAt(t-1),C=0===t?0:e.get(w),S=!0;for(let o=t;o<l;o++){const t=o,l=i.charCodeAt(o);let h,c;if(zSe(l)?(o++,h=0,c=2):(h=e.get(l),c=P$e(l,v,n,s)),t>_&&B$e(0,C,l,h,d)&&(r=t,a=v),v+=c,v>b){t>_?(u=t,y=v-c):(u=o+1,y=v),v-a>g&&(r=0),S=!1;break}w=l,C=h}if(S){f>0&&(p[f]=h[h.length-1],m[f]=c[h.length-1],f++);break}}if(0===r){let l=o,h=i.charCodeAt(t),c=e.get(h),p=!1;for(let n=t-1;n>=_;n--){const t=n+1,o=i.charCodeAt(n);if(9===o){p=!0;break}let m,f;if(USe(o)?(n--,m=0,f=2):(m=e.get(o),f=ixe(o)?s:1),l<=b){if(0===u&&(u=t,y=l),l<=b-g)break;if(B$e(0,m,h,c,d)){r=t,a=l;break}}l-=f,h=o,c=m}if(0!==r){const e=g-(y-a);if(e<=n){const t=i.charCodeAt(u);let o;o=zSe(t)?2:P$e(t,y,n,s),e-o<0&&(r=0)}}if(p){C--;continue}}if(0===r&&(r=u,a=y),r<=_){const e=i.charCodeAt(_);zSe(e)?(r=_+2,a=v+2):(r=_+1,a=v+P$e(e,v,n,s))}for(_=r,p[f]=r,v=a,m[f]=a,f++,b=a+g;C<0||C<w&&c[C]<a;)C++;let S=Math.abs(c[C]-b);for(;C+1<w;){const e=Math.abs(c[C+1]-b);if(e>=S)break;S=e,C++}}return 0===f?null:(p.length=f,m.length=f,M$e=t.breakOffsets,A$e=t.breakOffsetsVisibleColumn,t.breakOffsets=p,t.breakOffsetsVisibleColumn=m,t.wrappedTextIndentLength=u,t)}function O$e(e,t,i,n,o,s,r,a){const l=Eje.applyInjectedText(t,i);let d,h;if(i&&i.length>0?(d=i.map((e=>e.options)),h=i.map((e=>e.column-1))):(d=null,h=null),-1===o)return d?new L$e(h,d,[l.length],[],0):null;const c=l.length;if(c<=1)return d?new L$e(h,d,[l.length],[],0):null;const u="keepAll"===a,g=W$e(l,n,o,s,r),p=o-g,m=[],f=[];let _=0,v=0,b=0,w=o,C=l.charCodeAt(0),y=e.get(C),S=P$e(C,0,n,s),x=1;zSe(C)&&(S+=1,C=l.charCodeAt(1),y=e.get(C),x++);for(let t=x;t<c;t++){const i=t,o=l.charCodeAt(t);let r,a;zSe(o)?(t++,r=0,a=2):(r=e.get(o),a=P$e(o,S,n,s)),B$e(0,y,o,r,u)&&(v=i,b=S),S+=a,S>w&&((0===v||S-b>p)&&(v=i,b=S-a),m[_]=v,f[_]=b,_++,w=b+p,v=0),C=o,y=r}return 0!==_||i&&0!==i.length?(m[_]=c,f[_]=S,new L$e(h,d,m,f,g)):null}function P$e(e,t,i,n){return 9===e?i-t%i:ixe(e)||e<32?n:1}function F$e(e,t){return t-e%t}function B$e(e,t,i,n,o){return 32!==i&&(2===t&&2!==n||1!==t&&1===n||!o&&3===t&&2!==n||!o&&3===n&&1!==t)}function W$e(e,t,i,n,o){let s=0;if(0!==o){const r=ESe(e);if(-1!==r){for(let i=0;i<r;i++)s+=9===e.charCodeAt(i)?F$e(s,t):1;const a=3===o?2:2===o?1:0;for(let e=0;e<a;e++)s+=F$e(s,t);s+n>i&&(s=0)}}return s}var V$e;const H$e=null===(V$e=window.trustedTypes)||void 0===V$e?void 0:V$e.createPolicy("domLineBreaksComputer",{createHTML:e=>e});class z$e{static create(){return new z$e}constructor(){}createLineBreaksComputer(e,t,i,n,o){const s=[],r=[];return{addRequest:(e,t,i)=>{s.push(e),r.push(t)},finalize:()=>function(e,t,i,n,o,s,r){var a;function l(t){const i=r[t];if(i){const n=Eje.applyInjectedText(e[t],i),o=i.map((e=>e.options)),s=i.map((e=>e.column-1));return new L$e(s,o,[n.length],[],0)}return null}if(-1===n){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=l(i);return t}const d=Math.round(n*t.typicalHalfwidthCharacterWidth),h=3===o?2:2===o?1:0,c=Math.round(i*h),u=Math.ceil(t.spaceWidth*c),g=document.createElement("div");Txe(g,t);const p=new dLe(1e4),m=[],f=[],_=[],v=[],b=[];for(let n=0;n<e.length;n++){const s=Eje.applyInjectedText(e[n],r[n]);let a=0,l=0,h=d;if(0!==o)if(a=ESe(s),-1===a)a=0;else{for(let e=0;e<a;e++)l+=9===s.charCodeAt(e)?i-l%i:1;const e=Math.ceil(t.spaceWidth*l);e+t.typicalFullwidthCharacterWidth>d?(a=0,l=0):h=d-e}const c=s.substr(a),g=U$e(c,l,i,h,p,u);m[n]=a,f[n]=l,_[n]=c,v[n]=g[0],b[n]=g[1]}const w=p.build(),C=null!==(a=null==H$e?void 0:H$e.createHTML(w))&&void 0!==a?a:w;g.innerHTML=C,g.style.position="absolute",g.style.top="10000","keepAll"===s?(g.style.wordBreak="keep-all",g.style.overflowWrap="anywhere"):(g.style.wordBreak="inherit",g.style.overflowWrap="break-word"),document.body.appendChild(g);const y=document.createRange(),S=Array.prototype.slice.call(g.children,0),x=[];for(let t=0;t<e.length;t++){const e=K$e(y,S[t],_[t],v[t]);if(null===e){x[t]=l(t);continue}const i=m[t],n=f[t]+c,o=b[t],s=[];for(let t=0,i=e.length;t<i;t++)s[t]=o[e[t]];if(0!==i)for(let t=0,n=e.length;t<n;t++)e[t]+=i;let a,d;const h=r[t];h?(a=h.map((e=>e.options)),d=h.map((e=>e.column-1))):(a=null,d=null),x[t]=new L$e(d,a,e,s,n)}return document.body.removeChild(g),x}(s,e,t,i,n,o,r)}}}function U$e(e,t,i,n,o,s){if(0!==s){const e=String(s);o.appendString('<div style="text-indent: -'),o.appendString(e),o.appendString("px; padding-left: "),o.appendString(e),o.appendString("px; box-sizing: border-box; width:")}else o.appendString('<div style="width:');o.appendString(String(n)),o.appendString('px;">');const r=e.length;let a=t,l=0;const d=[],h=[];let c=0<r?e.charCodeAt(0):0;o.appendString("<span>");for(let t=0;t<r;t++){0!==t&&t%16384==0&&o.appendString("</span><span>"),d[t]=l,h[t]=a;const n=c;c=t+1<r?e.charCodeAt(t+1):0;let s=1,u=1;switch(n){case 9:s=i-a%i,u=s;for(let e=1;e<=s;e++)e<s?o.appendCharCode(160):o.appendASCIICharCode(32);break;case 32:32===c?o.appendCharCode(160):o.appendASCIICharCode(32);break;case 60:o.appendString("<");break;case 62:o.appendString(">");break;case 38:o.appendString("&");break;case 0:o.appendString("�");break;case 65279:case 8232:case 8233:case 133:o.appendCharCode(65533);break;default:ixe(n)&&u++,n<32?o.appendCharCode(9216+n):o.appendCharCode(n)}l+=s,a+=u}return o.appendString("</span>"),d[e.length]=l,h[e.length]=a,o.appendString("</div>"),[d,h]}function K$e(e,t,i,n){if(i.length<=1)return null;const o=Array.prototype.slice.call(t.children,0),s=[];try{j$e(e,o,n,0,null,i.length-1,null,s)}catch(e){return console.log(e),null}return 0===s.length?null:(s.push(i.length),s)}function j$e(e,t,i,n,o,s,r,a){if(n===s)return;if(o=o||q$e(e,t,i[n],i[n+1]),r=r||q$e(e,t,i[s],i[s+1]),Math.abs(o[0].top-r[0].top)<=.1)return;if(n+1===s)return void a.push(s);const l=n+(s-n)/2|0,d=q$e(e,t,i[l],i[l+1]);j$e(e,t,i,n,o,l,d,a),j$e(e,t,i,l,d,s,r,a)}function q$e(e,t,i,n){return e.setStart(t[i/16384|0].firstChild,i%16384),e.setEnd(t[n/16384|0].firstChild,n%16384),e.getClientRects()}class $$e extends Owe{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new Wwe),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const e of t)this._pending.has(e.id)?wwe(new Error(`Cannot have two contributions with the same id ${e.id}`)):this._pending.set(e.id,e);this._instantiateSome(0),this._register(BDe((()=>{this._instantiateSome(1)}))),this._register(BDe((()=>{this._instantiateSome(2)}))),this._register(BDe((()=>{this._instantiateSome(3)}),5e3))}saveViewState(){const e={};for(const[t,i]of this._instances)"function"==typeof i.saveViewState&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(const[t,i]of this._instances)"function"==typeof i.restoreViewState&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){this._register(BDe((()=>{this._instantiateSome(1)}),50))}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const e of t)this._instantiateById(e.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const e=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,e),"function"==typeof e.restoreViewState&&0!==t.instantiation&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(e){wwe(e)}}}}var G$e=function(e,t){return function(i,n){t(i,n,e)}};let Z$e=0;class Y$e{constructor(e,t,i,n,o){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=o}dispose(){Twe(this.listenersToRemove),this.model.onBeforeDetached(),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}}let Q$e=class e extends Owe{get isSimpleWidget(){return this._configuration.isSimpleWidget}constructor(e,t,i,n,o,s,r,a,l,d,h,c){super(),this.languageConfigurationService=h,this._deliveryQueue=new Gwe,this._contributions=this._register(new $$e),this._onDidDispose=this._register(new $we),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new $we({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new $we({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new $we({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new $we({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new $we({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new $we({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new $we({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new $we({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new $we({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new $we({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new J$e(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new $we({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new X$e({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new X$e({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new J$e(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new J$e(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new J$e(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new J$e(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new J$e(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new J$e(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new J$e(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new J$e(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new J$e(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new J$e(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new J$e(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new J$e(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new J$e(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new J$e(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new J$e(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new J$e(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new J$e(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new $we({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new $we({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new $we({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new $we({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection();const u=Object.assign({},t);let g;this._domElement=e,this._overflowWidgetsDomNode=u.overflowWidgetsDomNode,delete u.overflowWidgetsDomNode,this._id=++Z$e,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,u,d)),this._register(this._configuration.onDidChange((e=>{this._onDidChangeConfiguration.fire(e);const t=this._configuration.options;if(e.hasChanged(138)){const e=t.get(138);this._onDidLayoutChange.fire(e)}}))),this._contextKeyService=this._register(r.createScoped(this._domElement)),this._notificationService=l,this._codeEditorService=o,this._commandService=s,this._themeService=a,this._register(new eGe(this,this._contextKeyService)),this._register(new tGe(this,this._contextKeyService,c)),this._instantiationService=n.createChild(new C$e([wke,this._contextKeyService])),this._modelData=null,this._focusTracker=new iGe(e),this._register(this._focusTracker.onChange((()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())}))),this._contentWidgets={},this._overlayWidgets={},g=Array.isArray(i.contributions)?i.contributions:OAe.getEditorContributions(),this._contributions.initialize(this,g,this._instantiationService);for(const e of OAe.getEditorActions()){if(this._actions.has(e.id)){wwe(new Error(`Cannot have two actions with the same id ${e.id}`));continue}const t=new Bze(e.id,e.label,e.alias,Ebe(e.precondition),(()=>this._instantiationService.invokeFunction((t=>Promise.resolve(e.runEditorCommand(t,this,null))))),this._contextKeyService);this._actions.set(t.id,t)}const p=()=>!this._configuration.options.get(86)&&this._configuration.options.get(33).enabled;this._register(new jMe(this._domElement,{onDragEnter:()=>{},onDragOver:e=>{if(!p())return;const t=this.getTargetAtClientPoint(e.clientX,e.clientY);(null==t?void 0:t.position)&&this.showDropIndicatorAt(t.position)},onDrop:e=>{return t=this,i=void 0,o=function*(){if(!p())return;if(this.removeDropIndicator(),!e.dataTransfer)return;const t=this.getTargetAtClientPoint(e.clientX,e.clientY);(null==t?void 0:t.position)&&this._onDropIntoEditor.fire({position:t.position,event:e})},new((n=void 0)||(n=Promise))((function(e,s){function r(e){try{l(o.next(e))}catch(e){s(e)}}function a(e){try{l(o.throw(e))}catch(e){s(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(r,a)}l((o=o.apply(t,i||[])).next())}));var t,i,n,o},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;null===(t=this._modelData)||void 0===t||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i){return new YAe(e,t,this._domElement,i)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return Tke.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose(),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?sVe.getWordAtPosition(this._modelData.model,this._configuration.options.get(124),e):null}getValue(e=null){if(!this._modelData)return"";const t=!(!e||!e.preserveBOM);let i=0;return e&&e.lineEnding&&"\n"===e.lineEnding?i=1:e&&e.lineEnding&&"\r\n"===e.lineEnding&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){const t=e;if(null===this._modelData&&null===t)return;if(this._modelData&&this._modelData.model===t)return;const i=this.hasTextFocus(),n=this._detachModel();this._attachModel(t),i&&this.hasModel()&&this.focus();const o={oldModelUrl:n?n.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(o),this._postDetachModelCleanup(n),this._contributions.onAfterModelAttached()}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,n){const o=e.model.validatePosition({lineNumber:t,column:i}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(s.lineNumber,n)}getTopForLineNumber(t,i=!1){return this._modelData?e._getVerticalOffsetForPosition(this._modelData,t,1,i):-1}getTopForPosition(t,i){return this._modelData?e._getVerticalOffsetForPosition(this._modelData,t,i,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const o=e.model.validatePosition({lineNumber:t,column:i}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber,n)}getBottomForLineNumber(t,i=!1){return this._modelData?e._getVerticalOffsetAfterPosition(this._modelData,t,1,i):-1}setHiddenAreas(e,t){var i;null===(i=this._modelData)||void 0===i||i.viewModel.setHiddenAreas(e.map((e=>dye.lift(e))),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return PFe.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!lye.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,n){if(!this._modelData)return;if(!dye.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),s=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,s,t,n)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if("number"!=typeof e)throw new Error("Invalid arguments");this._sendRevealRange(new dye(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,n){if(!lye.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new dye(e.lineNumber,e.column,e.lineNumber,e.column),t,i,n)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=hye.isISelection(e),n=dye.isIRange(e);if(!i&&!n)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){const i={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(i,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new hye(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,n){if("number"!=typeof e||"number"!=typeof t)throw new Error("Invalid arguments");this._sendRevealRange(new dye(e,1,t,1),i,!1,n)}revealRange(e,t=0,i=!1,n=!0){this._revealRange(e,i?1:0,n,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,n){if(!dye.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(dye.lift(e),t,i,n)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||0===e.length)throw new Error("Invalid arguments");for(let t=0,i=e.length;t<i;t++)if(!hye.isISelection(e[t]))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,e,i)}}getContentWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getContentWidth():-1}getScrollWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollWidth():-1}getScrollLeft(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollLeft():-1}getContentHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getContentHeight():-1}getScrollHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollHeight():-1}getScrollTop(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollTop():-1}setScrollLeft(e,t=1){if(this._modelData){if("number"!=typeof e)throw new Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollLeft:e},t)}}setScrollTop(e,t=1){if(this._modelData){if("number"!=typeof e)throw new Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollTop:e},t)}}setScrollPosition(e,t=1){this._modelData&&this._modelData.viewModel.viewLayout.setScrollPosition(e,t)}saveViewState(){if(!this._modelData)return null;const e=this._contributions.saveViewState();return{cursorState:this._modelData.viewModel.saveCursorState(),viewState:this._modelData.viewModel.saveState(),contributionsState:e}}restoreViewState(e){if(!this._modelData||!this._modelData.hasRealView)return;const t=e;if(t&&t.cursorState&&t.viewState){const e=t.cursorState;Array.isArray(e)?e.length>0&&this._modelData.viewModel.restoreCursorState(e):this._modelData.viewModel.restoreCursorState([e]),this._contributions.restoreViewState(t.contributionsState||{});const i=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(i)}}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter((e=>e.isSupported())),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){switch(i=i||{},t){case"compositionStart":return void this._startComposition();case"compositionEnd":return void this._endComposition(e);case"type":{const t=i;return void this._type(e,t.text||"")}case"replacePreviousChar":{const t=i;return void this._compositionType(e,t.text||"",t.replaceCharCnt||0,0,0)}case"compositionType":{const t=i;return void this._compositionType(e,t.text||"",t.replacePrevCharCnt||0,t.replaceNextCharCnt||0,t.positionDelta||0)}case"paste":{const t=i;return void this._paste(e,t.text||"",t.pasteOnNewLine||!1,t.multicursorText||null,t.mode||null)}case"cut":return void this._cut(e)}const n=this.getAction(t);n?Promise.resolve(n.run()).then(void 0,wwe):this._modelData&&(this._triggerEditorCommand(e,t,i)||this._triggerCommand(t,i))}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){this._modelData&&0!==t.length&&("keyboard"===e&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),"keyboard"===e&&this._onDidType.fire(t))}_compositionType(e,t,i,n,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,n,o,e)}_paste(e,t,i,n,o){if(!this._modelData||0===t.length)return;const s=this._modelData.viewModel,r=s.getSelection().getStartPosition();s.paste(t,i,n,e);const a=s.getSelection().getStartPosition();"keyboard"===e&&this._onDidPaste.fire({range:new dye(r.lineNumber,r.column,a.lineNumber,a.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const n=OAe.getEditorCommand(t);return!!n&&((i=i||{}).source=e,this._instantiationService.invokeFunction((e=>{Promise.resolve(n.runEditorCommand(e,this,i)).then(void 0,wwe)})),!0)}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!!this._modelData&&!this._configuration.options.get(86)&&(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!!this._modelData&&!this._configuration.options.get(86)&&(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData)return!1;if(this._configuration.options.get(86))return!1;let n;return n=i?Array.isArray(i)?()=>i:i:()=>null,this._modelData.viewModel.executeEdits(e,t,n),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new nGe(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,owe(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,owe(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?0===e.length&&0===t.length?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){this._modelData&&0!==e.length&&this._modelData.model.changeDecorations((t=>{t.deltaDecorations(e,[])}))}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.deltaDecorations(t,[]),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(138)}createOverviewRuler(e){return this._modelData&&this._modelData.hasRealView?this._modelData.view.createOverviewRuler(e):null}getContainerDomNode(){return this._domElement}getDomNode(){return this._modelData&&this._modelData.hasRealView?this._modelData.view.domNode.domNode:null}delegateVerticalScrollbarPointerDown(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e){this._configuration.observeContainer(e),this.render()}focus(){this._modelData&&this._modelData.hasRealView&&this._modelData.view.focus()}hasTextFocus(){return!(!this._modelData||!this._modelData.hasRealView)&&this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id."),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const e=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(e)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const e=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(e)}}changeViewZones(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getTargetAtClientPoint(e,t):null}getScrolledVisiblePosition(t){if(!this._modelData||!this._modelData.hasRealView)return null;const i=this._modelData.model.validatePosition(t),n=this._configuration.options,o=n.get(138);return{top:e._getVerticalOffsetForPosition(this._modelData,i.lineNumber,i.column)-this.getScrollTop(),left:this._modelData.view.getOffsetForColumn(i.lineNumber,i.column)+o.glyphMarginWidth+o.lineNumbersWidth+o.decorationsWidth-this.getScrollLeft(),height:n.get(63)}}getOffsetForColumn(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getOffsetForColumn(e,t):-1}render(e=!1){this._modelData&&this._modelData.hasRealView&&this._modelData.view.render(!0,e)}setAriaOptions(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.setAriaOptions(e)}applyFontInfo(e){Txe(e,this._configuration.options.get(47))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e)return void(this._modelData=null);const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount()),e.onBeforeAttached();const i=new m$e(this._id,this._configuration,e,z$e.create(),I$e.create(this._configuration.options),(e=>oMe(e)),this.languageConfigurationService,this._themeService);t.push(e.onWillDispose((()=>this.setModel(null)))),t.push(i.onEvent((t=>{switch(t.kind){case 0:this._onDidContentSizeChange.fire(t);break;case 1:this._editorTextFocus.setValue(t.hasFocus);break;case 2:this._onDidScrollChange.fire(t);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{if(t.reachedMaxCursorCount){const e=ove(0,"The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",this.getOption(76));this._notificationService.prompt(x$e.Warning,e,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:ove(0,"Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const e=[];for(let i=0,n=t.selections.length;i<n;i++)e[i]=t.selections[i].getPosition();const i={position:e[0],secondaryPositions:e.slice(1),reason:t.reason,source:t.source};this._onDidChangeCursorPosition.fire(i);const n={selection:t.selections[0],secondarySelections:t.selections.slice(1),modelVersionId:t.modelVersionId,oldSelections:t.oldSelections,oldModelVersionId:t.oldModelVersionId,source:t.source,reason:t.reason};this._onDidChangeCursorSelection.fire(n);break}case 7:this._onDidChangeModelDecorations.fire(t.event);break;case 8:this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._onDidChangeModelLanguage.fire(t.event);break;case 9:this._onDidChangeModelLanguageConfiguration.fire(t.event);break;case 10:this._onDidChangeModelContent.fire(t.event);break;case 11:this._onDidChangeModelOptions.fire(t.event);break;case 12:this._onDidChangeModelTokens.fire(t.event)}})));const[n,o]=this._createView(i);if(o){this._domElement.appendChild(n.domNode.domNode);let t=Object.keys(this._contentWidgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];n.addContentWidget(this._contentWidgets[i])}t=Object.keys(this._overlayWidgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];n.addOverlayWidget(this._overlayWidgets[i])}n.render(!1,!0),n.domNode.domNode.setAttribute("data-uri",e.uri.toString())}this._modelData=new Y$e(e,i,n,o,t)}_createView(e){let t;t=this.isSimpleWidget?{paste:(e,t,i,n)=>{this._paste("keyboard",e,t,i,n)},type:e=>{this._type("keyboard",e)},compositionType:(e,t,i,n)=>{this._compositionType("keyboard",e,t,i,n)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:{paste:(e,t,i,n)=>{const o={text:e,pasteOnNewLine:t,multicursorText:i,mode:n};this._commandService.executeCommand("paste",o)},type:e=>{const t={text:e};this._commandService.executeCommand("type",t)},compositionType:(e,t,i,n)=>{if(i||n){const o={text:e,replacePrevCharCnt:t,replaceNextCharCnt:i,positionDelta:n};this._commandService.executeCommand("compositionType",o)}else{const i={text:e,replaceCharCnt:t};this._commandService.executeCommand("replacePreviousChar",i)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new PVe(e.coordinatesConverter);return i.onKeyDown=e=>this._onKeyDown.fire(e),i.onKeyUp=e=>this._onKeyUp.fire(e),i.onContextMenu=e=>this._onContextMenu.fire(e),i.onMouseMove=e=>this._onMouseMove.fire(e),i.onMouseLeave=e=>this._onMouseLeave.fire(e),i.onMouseDown=e=>this._onMouseDown.fire(e),i.onMouseUp=e=>this._onMouseUp.fire(e),i.onMouseDrag=e=>this._onMouseDrag.fire(e),i.onMouseDrop=e=>this._onMouseDrop.fire(e),i.onMouseDropCanceled=e=>this._onMouseDropCanceled.fire(e),i.onMouseWheel=e=>this._onMouseWheel.fire(e),[new Fze(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode),!0]}_postDetachModelCleanup(e){null==e||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return null!==this._modelData}showDropIndicatorAt(t){const i=[{range:new dye(t.lineNumber,t.column,t.lineNumber,t.column),options:e.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(i),this.revealPosition(t,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}};Q$e.dropIntoEditorDecorationOptions=eqe.register({description:"workbench-dnd-target",className:"dnd-target"}),Q$e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([G$e(3,Hxe),G$e(4,Uxe),G$e(5,gAe),G$e(6,wke),G$e(7,VBe),G$e(8,k$e),G$e(9,Lke),G$e(10,dDe),G$e(11,ENe)],Q$e);class X$e extends Owe{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new $we(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new $we(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,2===this._value?this._onDidChangeToTrue.fire():1===this._value&&this._onDidChangeToFalse.fire())}}class J$e extends $we{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class eGe extends Owe{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=yVe.editorSimpleInput.bindTo(t),this._editorFocus=yVe.focus.bindTo(t),this._textInputFocus=yVe.textInputFocus.bindTo(t),this._editorTextFocus=yVe.editorTextFocus.bindTo(t),this._editorTabMovesFocus=yVe.tabMovesFocus.bindTo(t),this._editorReadonly=yVe.readOnly.bindTo(t),this._inDiffEditor=yVe.inDiffEditor.bindTo(t),this._editorColumnSelection=yVe.columnSelection.bindTo(t),this._hasMultipleSelections=yVe.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=yVe.hasNonEmptySelection.bindTo(t),this._canUndo=yVe.canUndo.bindTo(t),this._canRedo=yVe.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration((()=>this._updateFromConfig()))),this._register(this._editor.onDidChangeCursorSelection((()=>this._updateFromSelection()))),this._register(this._editor.onDidFocusEditorWidget((()=>this._updateFromFocus()))),this._register(this._editor.onDidBlurEditorWidget((()=>this._updateFromFocus()))),this._register(this._editor.onDidFocusEditorText((()=>this._updateFromFocus()))),this._register(this._editor.onDidBlurEditorText((()=>this._updateFromFocus()))),this._register(this._editor.onDidChangeModel((()=>this._updateFromModel()))),this._register(this._editor.onDidChangeConfiguration((()=>this._updateFromModel()))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._editorTabMovesFocus.set(e.get(137)),this._editorReadonly.set(e.get(86)),this._inDiffEditor.set(e.get(58)),this._editorColumnSelection.set(e.get(19))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some((e=>!e.isEmpty())))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(Boolean(e&&e.canUndo())),this._canRedo.set(Boolean(e&&e.canRedo()))}}class tGe extends Owe{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=yVe.languageId.bindTo(t),this._hasCompletionItemProvider=yVe.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=yVe.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=yVe.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=yVe.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=yVe.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=yVe.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=yVe.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=yVe.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=yVe.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=yVe.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=yVe.hasReferenceProvider.bindTo(t),this._hasRenameProvider=yVe.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=yVe.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=yVe.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=yVe.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=yVe.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=yVe.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=yVe.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=yVe.isInWalkThroughSnippet.bindTo(t);const n=()=>this._update();this._register(e.onDidChangeModel(n)),this._register(e.onDidChangeModelLanguage(n)),this._register(i.completionProvider.onDidChange(n)),this._register(i.codeActionProvider.onDidChange(n)),this._register(i.codeLensProvider.onDidChange(n)),this._register(i.definitionProvider.onDidChange(n)),this._register(i.declarationProvider.onDidChange(n)),this._register(i.implementationProvider.onDidChange(n)),this._register(i.typeDefinitionProvider.onDidChange(n)),this._register(i.hoverProvider.onDidChange(n)),this._register(i.documentHighlightProvider.onDidChange(n)),this._register(i.documentSymbolProvider.onDidChange(n)),this._register(i.referenceProvider.onDidChange(n)),this._register(i.renameProvider.onDidChange(n)),this._register(i.documentFormattingEditProvider.onDidChange(n)),this._register(i.documentRangeFormattingEditProvider.onDidChange(n)),this._register(i.signatureHelpProvider.onDidChange(n)),this._register(i.inlayHintsProvider.onDidChange(n)),n()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents((()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInWalkThrough.reset()}))}_update(){const e=this._editor.getModel();e?this._contextKeyService.bufferChangeEvents((()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInWalkThrough.set(e.uri.scheme===$Te.walkThroughSnippet)})):this.reset()}}class iGe extends Owe{constructor(e){super(),this._onChange=this._register(new $we),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(NMe(e)),this._register(this._domFocusTracker.onDidFocus((()=>{this._hasFocus=!0,this._onChange.fire(void 0)}))),this._register(this._domFocusTracker.onDidBlur((()=>{this._hasFocus=!1,this._onChange.fire(void 0)})))}hasFocus(){return this._hasFocus}}class nGe{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations((i=>{this._isChangingDecorations||e.call(t,i)}),i)}getRange(e){return this._editor.hasModel()?e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e]):null}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const i of this._decorationIds){const n=e.getDecorationRange(i);n&&t.push(n)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){0!==this._decorationIds.length&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations((t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)}))}finally{this._isChangingDecorations=!1}}}const oGe=encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 3' enable-background='new 0 0 6 3' height='3' width='6'><g fill='"),sGe=encodeURIComponent("'><polygon points='5.5,0 2.5,3 1.1,3 4.1,0'/><polygon points='4,0 6,2 6,0.6 5.4,0'/><polygon points='0,2 1,3 2.4,3 0,0.6'/></g></svg>");function rGe(e){return oGe+encodeURIComponent(e.toString())+sGe}const aGe=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" height="3" width="12"><g fill="'),lGe=encodeURIComponent('"><circle cx="1" cy="1" r="1"/><circle cx="5" cy="1" r="1"/><circle cx="9" cy="1" r="1"/></g></svg>');jBe(((e,t)=>{const i=e.getColor(nOe);i&&t.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${rGe(i)}") repeat-x bottom left; }`);const n=e.getColor(oOe);n&&t.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${rGe(n)}") repeat-x bottom left; }`);const o=e.getColor(rOe);o&&t.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${rGe(o)}") repeat-x bottom left; }`);const s=e.getColor(lOe);var r;s&&t.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${r=s,aGe+encodeURIComponent(r.toString())+lGe}") no-repeat bottom left; }`);const a=e.getColor(sWe);a&&t.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${a.rgba.a}; }`)}));var dGe=i(7536),hGe={};hGe.styleTagTransform=zl(),hGe.setAttributes=Bl(),hGe.insert=Pl().bind(null,"head"),hGe.domAPI=Rl(),hGe.insertStyleElement=Vl(),Ml()(dGe.A,hGe),dGe.A&&dGe.A.locals&&dGe.A.locals;var cGe,uGe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};!function(e){e.North="north",e.South="south",e.East="east",e.West="west"}(cGe||(cGe={}));const gGe=new $we,pGe=new $we;class mGe{constructor(){this.disposables=new Rwe}get onPointerMove(){return this.disposables.add(new xBe(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new xBe(window,"mouseup")).event}dispose(){this.disposables.dispose()}}uGe([iRe],mGe.prototype,"onPointerMove",null),uGe([iRe],mGe.prototype,"onPointerUp",null);class fGe{get onPointerMove(){return this.disposables.add(new xBe(this.el,nRe.Change)).event}get onPointerUp(){return this.disposables.add(new xBe(this.el,nRe.End)).event}constructor(e){this.el=e,this.disposables=new Rwe}dispose(){this.disposables.dispose()}}uGe([iRe],fGe.prototype,"onPointerMove",null),uGe([iRe],fGe.prototype,"onPointerUp",null);class _Ge{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}uGe([iRe],_Ge.prototype,"onPointerMove",null),uGe([iRe],_Ge.prototype,"onPointerUp",null);const vGe="pointer-events-disabled";class bGe extends Owe{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",0===e),this.el.classList.toggle("minimum",1===e),this.el.classList.toggle("maximum",2===e),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=t=>{this.orthogonalStartDragHandleDisposables.clear(),0!==t&&(this._orthogonalStartDragHandle=IMe(this.el,OMe(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Awe((()=>this._orthogonalStartDragHandle.remove()))),this.orthogonalStartDragHandleDisposables.add(new xBe(this._orthogonalStartDragHandle,"mouseenter")).event((()=>bGe.onMouseEnter(e)),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new xBe(this._orthogonalStartDragHandle,"mouseleave")).event((()=>bGe.onMouseLeave(e)),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}set orthogonalEndSash(e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=t=>{this.orthogonalEndDragHandleDisposables.clear(),0!==t&&(this._orthogonalEndDragHandle=IMe(this.el,OMe(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Awe((()=>this._orthogonalEndDragHandle.remove()))),this.orthogonalEndDragHandleDisposables.add(new xBe(this._orthogonalEndDragHandle,"mouseenter")).event((()=>bGe.onMouseEnter(e)),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new xBe(this._orthogonalEndDragHandle,"mouseleave")).event((()=>bGe.onMouseLeave(e)),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}constructor(e,t,i){super(),this.hoverDelay=300,this.hoverDelayer=this._register(new TDe(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new $we),this._onDidStart=this._register(new $we),this._onDidChange=this._register(new $we),this._onDidReset=this._register(new $we),this._onDidEnd=this._register(new $we),this.orthogonalStartSashDisposables=this._register(new Rwe),this.orthogonalStartDragHandleDisposables=this._register(new Rwe),this.orthogonalEndSashDisposables=this._register(new Rwe),this.orthogonalEndDragHandleDisposables=this._register(new Rwe),this.onDidStart=this._onDidStart.event,this.onDidChange=this._onDidChange.event,this.onDidReset=this._onDidReset.event,this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.el=IMe(e,OMe(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),Dve&&this.el.classList.add("mac");const n=this._register(new xBe(this.el,"mousedown")).event;this._register(n((e=>this.onPointerStart(e,new mGe)),this));const o=this._register(new xBe(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const s=this._register(new xBe(this.el,"mouseenter")).event;this._register(s((()=>bGe.onMouseEnter(this))));const r=this._register(new xBe(this.el,"mouseleave")).event;this._register(r((()=>bGe.onMouseLeave(this)))),this._register(oRe.addTarget(this.el));const a=this._register(new xBe(this.el,nRe.Start)).event;this._register(a((e=>this.onPointerStart(e,new fGe(this.el))),this));const l=this._register(new xBe(this.el,nRe.Tap)).event;let d;this._register(l((e=>{if(d)return clearTimeout(d),d=void 0,void this.onPointerDoublePress(e);clearTimeout(d),d=setTimeout((()=>d=void 0),250)}),this)),"number"==typeof i.size?(this.size=i.size,0===i.orientation?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=4,this._register(gGe.event((e=>{this.size=e,this.layout()})))),this._register(pGe.event((e=>this.hoverDelay=e))),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,1===this.orientation?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",!1),this.layout()}onPointerStart(e,t){DMe(e);let i=!1;if(!e.__orthogonalSashEvent){const n=this.getOrthogonalSash(e);n&&(i=!0,e.__orthogonalSashEvent=!0,n.onPointerStart(e,new _Ge(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new _Ge(t))),!this.state)return;const n=document.getElementsByTagName("iframe");for(const e of n)e.classList.add(vGe);const o=e.pageX,s=e.pageY,r=e.altKey,a={startX:o,currentX:o,startY:s,currentY:s,altKey:r};this.el.classList.add("active"),this._onDidStart.fire(a);const l=yMe(this.el),d=()=>{let e="";e=i?"all-scroll":1===this.orientation?1===this.state?"s-resize":2===this.state?"n-resize":Dve?"row-resize":"ns-resize":1===this.state?"e-resize":2===this.state?"w-resize":Dve?"col-resize":"ew-resize",l.textContent=`* { cursor: ${e} !important; }`},h=new Rwe;d(),i||this.onDidEnablementChange.event(d,null,h),t.onPointerMove((e=>{DMe(e,!1);const t={startX:o,currentX:e.pageX,startY:s,currentY:e.pageY,altKey:r};this._onDidChange.fire(t)}),null,h),t.onPointerUp((e=>{DMe(e,!1),this.el.removeChild(l),this.el.classList.remove("active"),this._onDidEnd.fire(),h.dispose();for(const e of n)e.classList.remove(vGe)}),null,h),h.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger((()=>e.el.classList.add("hover")),e.hoverDelay).then(void 0,(()=>{})),!t&&e.linkedSash&&bGe.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&bGe.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){bGe.onMouseLeave(this)}layout(){if(0===this.orientation){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){var t;const i=null!==(t=e.initialTarget)&&void 0!==t?t:e.target;if(i&&i instanceof HTMLElement)return i.classList.contains("orthogonal-drag-handle")?i.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash:void 0}dispose(){super.dispose(),this.el.remove()}}var wGe=i(6610),CGe={};CGe.styleTagTransform=zl(),CGe.setAttributes=Bl(),CGe.insert=Pl().bind(null,"head"),CGe.domAPI=Rl(),CGe.insertStyleElement=Vl(),Ml()(wGe.A,CGe),wGe.A&&wGe.A.locals&&wGe.A.locals;class yGe{static capture(e){let t=null,i=0;if(0!==e.getScrollTop()){const n=e.getVisibleRanges();if(n.length>0){t=n[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}}return new yGe(t,i,e.getPosition())}constructor(e,t,i){this._visiblePosition=e,this._visiblePositionScrollDelta=t,this._cursorPosition=i}restore(e){if(this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i)}}var SGe=i(8677),xGe={};xGe.styleTagTransform=zl(),xGe.setAttributes=Bl(),xGe.insert=Pl().bind(null,"head"),xGe.domAPI=Rl(),xGe.insertStyleElement=Vl(),Ml()(SGe.A,xGe),SGe.A&&SGe.A.locals&&SGe.A.locals;const kGe={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:OLe.text};var LGe,DGe;class EGe{constructor(e,t){this.uri=e,this.value=t}}class NGe{constructor(e,t){this[LGe]="ResourceMap",e instanceof NGe?(this.map=new Map(e.map),this.toKey=null!=t?t:NGe.defaultToKey):(this.map=new Map,this.toKey=null!=e?e:NGe.defaultToKey)}set(e,t){return this.map.set(this.toKey(e),new EGe(e,t)),this}get(e){var t;return null===(t=this.map.get(this.toKey(e)))||void 0===t?void 0:t.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){void 0!==t&&(e=e.bind(t));for(const[t,i]of this.map)e(i.value,i.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[(LGe=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}NGe.defaultToKey=e=>e.toString();class IGe{constructor(){this[DGe]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return null===(e=this._head)||void 0===e?void 0:e.value}get last(){var e;return null===(e=this._tail)||void 0===e?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const i=this._map.get(e);if(i)return 0!==t&&this.touch(i,t),i.value}set(e,t,i=0){let n=this._map.get(e);if(n)n.value=t,0!==i&&this.touch(n,i);else{switch(n={key:e,value:t,next:void 0,previous:void 0},i){case 0:case 2:default:this.addItemLast(n);break;case 1:this.addItemFirst(n)}this._map.set(e,n),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const i=this._state;let n=this._head;for(;n;){if(t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");n=n.next}}keys(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:i.key,done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}values(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:i.value,done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}entries(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:[i.key,i.value],done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}[(DGe=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(0===e)return void this.clear();let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e,this._state++}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(1===t||2===t)if(1===t){if(e===this._head)return;const t=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(t.previous=i,i.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(2===t){if(e===this._tail)return;const t=e.next,i=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=i,i.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}toJSON(){const e=[];return this.forEach(((t,i)=>{e.push([i,t])})),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}}class TGe extends IGe{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}function MGe(...e){return function(t,i){for(let n=0,o=e.length;n<o;n++){const o=e[n](t,i);if(o)return o}return null}}RGe.bind(void 0,!1);const AGe=RGe.bind(void 0,!0);function RGe(e,t,i){if(!i||i.length<t.length)return null;let n;return n=e?WSe(i,t):0===i.indexOf(t),n?t.length>0?[{start:0,end:t.length}]:[]:null}function OGe(e,t,i,n){if(i===e.length)return[];if(n===t.length)return null;if(e[i]===t[n]){let o=null;return(o=OGe(e,t,i+1,n+1))?zGe({start:n,end:n+1},o):null}return OGe(e,t,i,n+1)}function PGe(e){return 97<=e&&e<=122}function FGe(e){return 65<=e&&e<=90}function BGe(e){return 48<=e&&e<=57}function WGe(e){return 32===e||9===e||10===e||13===e}const VGe=new Set;function HGe(e){return PGe(e)||FGe(e)||BGe(e)}function zGe(e,t){return 0===t.length?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function UGe(e,t){for(let i=t;i<e.length;i++){const t=e.charCodeAt(i);if(FGe(t)||BGe(t)||i>0&&!HGe(e.charCodeAt(i-1)))return i}return e.length}function KGe(e,t,i,n){if(i===e.length)return[];if(n===t.length)return null;if(e[i]!==t[n].toLowerCase())return null;{let o=null,s=n+1;for(o=KGe(e,t,i+1,n+1);!o&&(s=UGe(t,s))<t.length;)o=KGe(e,t,i+1,s),s++;return null===o?null:zGe({start:n,end:n+1},o)}}function jGe(e,t){if(!t)return null;if(0===(t=t.trim()).length)return null;if(!function(e){let t=0,i=0,n=0,o=0;for(let s=0;s<e.length;s++)n=e.charCodeAt(s),FGe(n)&&t++,PGe(n)&&i++,WGe(n)&&o++;return 0!==t&&0!==i||0!==o?t<=5:e.length<=30}(e))return null;if(t.length>60)return null;const i=function(e){let t=0,i=0,n=0,o=0,s=0;for(let r=0;r<e.length;r++)s=e.charCodeAt(r),FGe(s)&&t++,PGe(s)&&i++,HGe(s)&&n++,BGe(s)&&o++;return{upperPercent:t/e.length,lowerPercent:i/e.length,alphaPercent:n/e.length,numericPercent:o/e.length}}(t);if(!function(e){const{upperPercent:t,lowerPercent:i,alphaPercent:n,numericPercent:o}=e;return i>.2&&t<.8&&n>.6&&o<.2}(i)){if(!function(e){const{upperPercent:t,lowerPercent:i}=e;return 0===i&&t>.6}(i))return null;t=t.toLowerCase()}let n=null,o=0;for(e=e.toLowerCase();o<t.length&&null===(n=KGe(e,t,0,o));)o=UGe(t,o+1);return n}"()[]{}<>`'\"-/;:,.?!".split("").forEach((e=>VGe.add(e.charCodeAt(0))));const qGe=MGe(AGe,jGe,(function(e,t){const i=t.toLowerCase().indexOf(e.toLowerCase());return-1===i?null:[{start:i,end:i+e.length}]})),$Ge=MGe(AGe,jGe,(function(e,t){return OGe(e.toLowerCase(),t.toLowerCase(),0,0)})),GGe=new TGe(1e4);function ZGe(e,t,i=!1){if("string"!=typeof e||"string"!=typeof t)return null;let n=GGe.get(e);n||(n=new RegExp(e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*"),"i"),GGe.set(e,n));const o=n.exec(t);return o?[{start:o.index,end:o.index+o[0].length}]:i?$Ge(e,t):qGe(e,t)}const YGe=128;function QGe(){const e=[],t=[];for(let e=0;e<=YGe;e++)t[e]=0;for(let i=0;i<=YGe;i++)e.push(t.slice(0));return e}function XGe(e){const t=[];for(let i=0;i<=e;i++)t[i]=0;return t}const JGe=XGe(256),eZe=XGe(256),tZe=QGe(),iZe=QGe(),nZe=QGe();function oZe(e,t){if(t<0||t>=e.length)return!1;const i=e.codePointAt(t);switch(i){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!nxe(i)}}function sZe(e,t){if(t<0||t>=e.length)return!1;switch(e.charCodeAt(t)){case 32:case 9:return!0;default:return!1}}function rZe(e,t,i){return t[e]!==i[e]}var aZe;!function(e){e.Default=[-100,0],e.isDefault=function(e){return!e||2===e.length&&-100===e[0]&&0===e[1]}}(aZe||(aZe={}));class lZe{constructor(e,t){this.firstMatchCanBeWeak=e,this.boostFullMatch=t}}function dZe(e,t,i,n,o,s,r=lZe.default){const a=e.length>YGe?YGe:e.length,l=n.length>YGe?YGe:n.length;if(i>=a||s>=l||a-i>l-s)return;if(!function(e,t,i,n,o,s,r=!1){for(;t<i&&o<s;)e[t]===n[o]&&(r&&(JGe[t]=o),t+=1),o+=1;return t===i}(t,i,a,o,s,l,!0))return;!function(e,t,i,n,o,s){let r=e-1,a=t-1;for(;r>=i&&a>=n;)o[r]===s[a]&&(eZe[r]=a,r--),a--}(a,l,i,s,t,o);let d=1,h=1,c=i,u=s;const g=[!1];for(d=1,c=i;c<a;d++,c++){const r=JGe[c],p=eZe[c],m=c+1<a?eZe[c+1]:l;for(h=r-s+1,u=r;u<m;h++,u++){let a=Number.MIN_SAFE_INTEGER,m=!1;u<=p&&(a=hZe(e,t,c,i,n,o,u,l,s,0===tZe[d-1][h-1],g));let f=0;a!==Number.MAX_SAFE_INTEGER&&(m=!0,f=a+iZe[d-1][h-1]);const _=u>r,v=_?iZe[d][h-1]+(tZe[d][h-1]>0?-5:0):0,b=u>r+1&&tZe[d][h-1]>0,w=b?iZe[d][h-2]+(tZe[d][h-2]>0?-5:0):0;if(b&&(!_||w>=v)&&(!m||w>=f))iZe[d][h]=w,nZe[d][h]=3,tZe[d][h]=0;else if(_&&(!m||v>=f))iZe[d][h]=v,nZe[d][h]=2,tZe[d][h]=0;else{if(!m)throw new Error("not possible");iZe[d][h]=f,nZe[d][h]=1,tZe[d][h]=tZe[d-1][h-1]+1}}}if(!g[0]&&!r.firstMatchCanBeWeak)return;d--,h--;const p=[iZe[d][h],s];let m=0,f=0;for(;d>=1;){let e=h;do{const t=nZe[d][e];if(3===t)e-=2;else{if(2!==t)break;e-=1}}while(e>=1);m>1&&t[i+d-1]===o[s+h-1]&&!rZe(e+s-1,n,o)&&m+1>tZe[d][e]&&(e=h),e===h?m++:m=1,f||(f=e),d--,h=e-1,p.push(h)}l===a&&r.boostFullMatch&&(p[0]+=2);const _=f-a;return p[0]-=_,p}function hZe(e,t,i,n,o,s,r,a,l,d,h){if(t[i]!==s[r])return Number.MIN_SAFE_INTEGER;let c=1,u=!1;return r===i-n?c=e[i]===o[r]?7:5:!rZe(r,o,s)||0!==r&&rZe(r-1,o,s)?!oZe(s,r)||0!==r&&oZe(s,r-1)?(oZe(s,r-1)||sZe(s,r-1))&&(c=5,u=!0):c=5:(c=e[i]===o[r]?7:5,u=!0),c>1&&i===n&&(h[0]=!0),u||(u=rZe(r,o,s)||oZe(s,r-1)||sZe(s,r-1)),i===n?r>l&&(c-=u?3:5):c+=d?u?2:0:u?0:1,r+1===a&&(c-=u?3:5),c}lZe.default={boostFullMatch:!0,firstMatchCanBeWeak:!1};const cZe=new RegExp(`\\$\\(${sAe.iconNameExpression}(?:${sAe.iconModifierExpression})?\\)`,"g"),uZe=new RegExp(`(\\\\)?${cZe.source}`,"g"),gZe=new RegExp(`\\\\${cZe.source}`,"g"),pZe=new RegExp(`(\\s)?(\\\\)?${cZe.source}(\\s)?`,"g");function mZe(e){return-1===e.indexOf("$(")?e:e.replace(pZe,((e,t,i,n)=>i?e:t||n||""))}const fZe=new RegExp(`\\$\\(${sAe.iconNameCharacter}+\\)`,"g");function _Ze(e){fZe.lastIndex=0;let t="";const i=[];let n=0;for(;;){const o=fZe.lastIndex,s=fZe.exec(e),r=e.substring(o,null==s?void 0:s.index);if(r.length>0){t+=r;for(let e=0;e<r.length;e++)i.push(n)}if(!s)break;n+=s[0].length}return{text:t,iconOffsets:i}}function vZe(e,t,i=!1){const{text:n,iconOffsets:o}=t;if(!o||0===o.length)return ZGe(e,n,i);const s=xSe(n," "),r=n.length-s.length,a=ZGe(e,s,i);if(a)for(const e of a){const t=o[e.start+r]+r;e.start+=t,e.end+=t}return a}class bZe{constructor(e="",t=!1){var i,n,o;if(this.value=e,"string"!=typeof this.value)throw Lwe("value");"boolean"==typeof t?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1):(this.isTrusted=null!==(i=t.isTrusted)&&void 0!==i?i:void 0,this.supportThemeIcons=null!==(n=t.supportThemeIcons)&&void 0!==n&&n,this.supportHtml=null!==(o=t.supportHtml)&&void 0!==o&&o)}appendText(e,t=0){var i;return this.value+=function(e){return e.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}(this.supportThemeIcons?(i=e,i.replace(uZe,((e,t)=>t?e:`\\${e}`))):e).replace(/([ \t]+)/g,((e,t)=>" ".repeat(t.length))).replace(/\>/gm,"\\>").replace(/\n/g,1===t?"\\\n":"\n\n"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+="\n",this.value+=t,this.value+="\n```\n",this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){const i=new RegExp(SSe(t),"g");return e.replace(i,((t,i)=>"\\"!==e.charAt(i-1)?`\\${t}`:t))}}function wZe(e){return e.replace(/"/g,""")}function CZe(e){return e?e.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1"):e}var yZe=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class SZe{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}update(e,t,i){var n;return yZe(this,void 0,void 0,(function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let o;if(void 0===e||fbe(e)||e instanceof HTMLElement)o=e;else if(Lbe(e.markdown)){this._hoverWidget||this.show(ove(0,"Loading..."),t),this._cancellationTokenSource=new sCe;const i=this._cancellationTokenSource.token;if(o=yield e.markdown(i),void 0===o&&(o=e.markdownNotSupportedFallback),this.isDisposed||i.isCancellationRequested)return}else o=null!==(n=e.markdown)&&void 0!==n?n:e.markdownNotSupportedFallback;this.show(o,t,i)}))}show(e,t,i){const n=this._hoverWidget;if(this.hasContent(e)){const o=Object.assign({content:e,target:this.target,showPointer:"element"===this.hoverDelegate.placement,hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!n},i);this._hoverWidget=this.hoverDelegate.showHover(o,t)}null==n||n.dispose()}hasContent(e){return!!e&&(!((t=e)instanceof bZe||t&&"object"==typeof t&&!("string"!=typeof t.value||"boolean"!=typeof t.isTrusted&&void 0!==t.isTrusted||"boolean"!=typeof t.supportThemeIcons&&void 0!==t.supportThemeIcons))||!!e.value);var t}get isDisposed(){var e;return null===(e=this._hoverWidget)||void 0===e?void 0:e.isDisposed}dispose(){var e,t;null===(e=this._hoverWidget)||void 0===e||e.dispose(),null===(t=this._cancellationTokenSource)||void 0===t||t.dispose(!0),this._cancellationTokenSource=void 0}}function xZe(e,t,i,n){let o,s;const r=(t,i)=>{var n;t&&(null==s||s.dispose(),s=void 0),i&&(null==o||o.dispose(),o=void 0),null===(n=e.onDidHideHover)||void 0===n||n.call(e)},a=(o,r,a)=>new ODe((()=>yZe(this,void 0,void 0,(function*(){s&&!s.isDisposed||(s=new SZe(e,a||t,o>0),yield s.update(i,r,n))}))),o),l=tMe(t,LMe.MOUSE_OVER,(()=>{if(o)return;const i=new Rwe;i.add(tMe(t,LMe.MOUSE_LEAVE,(e=>r(!1,e.fromElement===t)),!0)),i.add(tMe(t,LMe.MOUSE_DOWN,(()=>r(!0,!0)),!0));const n={targetElements:[t],dispose:()=>{}};if(void 0===e.placement||"mouse"===e.placement){const e=e=>{n.x=e.x+10,e.target instanceof HTMLElement&&e.target.classList.contains("action-label")&&r(!0,!0)};i.add(tMe(t,LMe.MOUSE_MOVE,e,!0))}i.add(a(e.delay,!1,n)),o=i}),!0);return{show:e=>{r(!1,!0),a(0,e)},hide:()=>{r(!0,!0)},update:(e,t)=>yZe(this,void 0,void 0,(function*(){i=e,yield null==s?void 0:s.update(i,void 0,t)})),dispose:()=>{l.dispose(),r(!0,!0)}}}function kZe(e,t={}){const i=LZe(t);return EZe(i,function(e,t){const i={type:1,children:[]};let n=0,o=i;const s=[],r=new DZe(e);for(;!r.eos();){let e=r.next();const i="\\"===e&&0!==NZe(r.peek(),t);if(i&&(e=r.next()),i||0===NZe(e,t)||e!==r.peek())if("\n"===e)2===o.type&&(o=s.pop()),o.children.push({type:8});else if(2!==o.type){const t={type:2,content:e};o.children.push(t),s.push(o),o=t}else o.content+=e;else{r.advance(),2===o.type&&(o=s.pop());const i=NZe(e,t);if(o.type===i||5===o.type&&6===i)o=s.pop();else{const e={type:i,children:[]};5===i&&(e.index=n,n++),o.children.push(e),s.push(o),o=e}}}return 2===o.type&&(o=s.pop()),s.length,i}(e,!!t.renderCodeSegments),t.actionHandler,t.renderCodeSegments),i}function LZe(e){const t=e.inline?"span":"div",i=document.createElement(t);return e.className&&(i.className=e.className),i}class DZe{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function EZe(e,t,i,n){let o;if(2===t.type)o=document.createTextNode(t.content||"");else if(3===t.type)o=document.createElement("b");else if(4===t.type)o=document.createElement("i");else if(7===t.type&&n)o=document.createElement("code");else if(5===t.type&&i){const e=document.createElement("a");i.disposables.add(iMe(e,"click",(e=>{i.callback(String(t.index),e)}))),o=e}else 8===t.type?o=document.createElement("br"):1===t.type&&(o=e);o&&e!==o&&e.appendChild(o),o&&Array.isArray(t.children)&&t.children.forEach((e=>{EZe(o,e,i,n)}))}function NZe(e,t){switch(e){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return t?7:0;default:return 0}}const IZe=new RegExp(`(\\\\)?\\$\\((${sAe.iconNameExpression}(?:${sAe.iconModifierExpression})?)\\)`,"g");function TZe(e){const t=new Array;let i,n=0,o=0;for(;null!==(i=IZe.exec(e));){o=i.index||0,n<o&&t.push(e.substring(n,o)),n=(i.index||0)+i[0].length;const[,s,r]=i;t.push(s?`$(${r})`:MZe({id:r}))}return n<e.length&&t.push(e.substring(n)),t}function MZe(e){const t=OMe("span");return t.classList.add(...sAe.asClassNameArray(e)),t}class AZe{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const RZe=new AZe("id#");let OZe={};!function(){function e(e,t){t(OZe)}e.amd=!0,function(t,i){"object"==typeof exports?i(exports):e.amd?e(0,i):i((t="undefined"!=typeof globalThis?globalThis:t||self).marked={})}(this,(function(e){function t(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function n(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.defaults={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};var s=/[&<>"']/,r=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,d={"&":"&","<":"<",">":">",'"':""","'":"'"},h=function(e){return d[e]};function c(e,t){if(t){if(s.test(e))return e.replace(r,h)}else if(a.test(e))return e.replace(l,h);return e}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function g(e){return e.replace(u,(function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))}var p=/(^|[^\[])\^/g;function m(e,t){e="string"==typeof e?e:e.source,t=t||"";var i={replace:function(t,n){return n=(n=n.source||n).replace(p,"$1"),e=e.replace(t,n),i},getRegex:function(){return new RegExp(e,t)}};return i}var f=/[^\w:]/g,_=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function v(e,t,i){if(e){var n;try{n=decodeURIComponent(g(i)).replace(f,"").toLowerCase()}catch(e){return null}if(0===n.indexOf("javascript:")||0===n.indexOf("vbscript:")||0===n.indexOf("data:"))return null}t&&!_.test(i)&&(i=function(e,t){b[" "+e]||(w.test(e)?b[" "+e]=e+"/":b[" "+e]=L(e,"/",!0));var i=-1===(e=b[" "+e]).indexOf(":");return"//"===t.substring(0,2)?i?t:e.replace(C,"$1")+t:"/"===t.charAt(0)?i?t:e.replace(y,"$1")+t:e+t}(t,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(e){return null}return i}var b={},w=/^[^:]+:\/*[^/]*$/,C=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/,S={exec:function(){}};function x(e){for(var t,i,n=1;n<arguments.length;n++)for(i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}function k(e,t){var i=e.replace(/\|/g,(function(e,t,i){for(var n=!1,o=t;--o>=0&&"\\"===i[o];)n=!n;return n?"|":" |"})).split(/ \|/),n=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(/\\\|/g,"|");return i}function L(e,t,i){var n=e.length;if(0===n)return"";for(var o=0;o<n;){var s=e.charAt(n-o-1);if(s!==t||i){if(s===t||!i)break;o++}else o++}return e.slice(0,n-o)}function D(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function E(e,t){if(t<1)return"";for(var i="";t>1;)1&t&&(i+=e),t>>=1,e+=e;return i+e}function N(e,t,i,n){var o=t.href,s=t.title?c(t.title):null,r=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;var a={type:"link",raw:i,href:o,title:s,text:r,tokens:n.inlineTokens(r)};return n.state.inLink=!1,a}return{type:"image",raw:i,href:o,title:s,text:c(r)}}var I=function(){function t(t){this.options=t||e.defaults}var i=t.prototype;return i.space=function(e){var t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}},i.code=function(e){var t=this.rules.block.code.exec(e);if(t){var i=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?i:L(i,"\n")}}},i.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var i=t[0],n=function(e,t){var i=e.match(/^(\s+)(?:```)/);if(null===i)return t;var n=i[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=n.length?e.slice(n.length):e})).join("\n")}(i,t[3]||"");return{type:"code",raw:i,lang:t[2]?t[2].trim():t[2],text:n}}},i.heading=function(e){var t=this.rules.block.heading.exec(e);if(t){var i=t[2].trim();if(/#$/.test(i)){var n=L(i,"#");this.options.pedantic?i=n.trim():n&&!/ $/.test(n)||(i=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:i,tokens:this.lexer.inline(i)}}},i.hr=function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}},i.blockquote=function(e){var t=this.rules.block.blockquote.exec(e);if(t){var i=t[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(i,[]),text:i}}},i.list=function(e){var t=this.rules.block.list.exec(e);if(t){var i,o,s,r,a,l,d,h,c,u,g,p,m=t[1].trim(),f=m.length>1,_={type:"list",raw:"",ordered:f,start:f?+m.slice(0,-1):"",loose:!1,items:[]};m=f?"\\d{1,9}\\"+m.slice(-1):"\\"+m,this.options.pedantic&&(m=f?m:"[*+-]");for(var v=new RegExp("^( {0,3}"+m+")((?:[\t ][^\\n]*)?(?:\\n|$))");e&&(p=!1,t=v.exec(e))&&!this.rules.block.hr.test(e);){if(i=t[0],e=e.substring(i.length),h=t[2].split("\n",1)[0],c=e.split("\n",1)[0],this.options.pedantic?(r=2,g=h.trimLeft()):(r=(r=t[2].search(/[^ ]/))>4?1:r,g=h.slice(r),r+=t[1].length),l=!1,!h&&/^ *$/.test(c)&&(i+=c+"\n",e=e.substring(c.length+1),p=!0),!p)for(var b=new RegExp("^ {0,"+Math.min(3,r-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),w=new RegExp("^ {0,"+Math.min(3,r-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),C=new RegExp("^ {0,"+Math.min(3,r-1)+"}(?:```|~~~)"),y=new RegExp("^ {0,"+Math.min(3,r-1)+"}#");e&&(h=u=e.split("\n",1)[0],this.options.pedantic&&(h=h.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!C.test(h))&&!y.test(h)&&!b.test(h)&&!w.test(e);){if(h.search(/[^ ]/)>=r||!h.trim())g+="\n"+h.slice(r);else{if(l)break;g+="\n"+h}l||h.trim()||(l=!0),i+=u+"\n",e=e.substring(u.length+1)}_.loose||(d?_.loose=!0:/\n *\n *$/.test(i)&&(d=!0)),this.options.gfm&&(o=/^\[[ xX]\] /.exec(g))&&(s="[ ] "!==o[0],g=g.replace(/^\[[ xX]\] +/,"")),_.items.push({type:"list_item",raw:i,task:!!o,checked:s,loose:!1,text:g}),_.raw+=i}_.items[_.items.length-1].raw=i.trimRight(),_.items[_.items.length-1].text=g.trimRight(),_.raw=_.raw.trimRight();var S=_.items.length;for(a=0;a<S;a++){this.lexer.state.top=!1,_.items[a].tokens=this.lexer.blockTokens(_.items[a].text,[]);var x=_.items[a].tokens.filter((function(e){return"space"===e.type})),k=x.every((function(e){for(var t,i=0,o=n(e.raw.split(""));!(t=o()).done;)if("\n"===t.value&&(i+=1),i>1)return!0;return!1}));!_.loose&&x.length&&k&&(_.loose=!0,_.items[a].loose=!0)}return _}},i.html=function(e){var t=this.rules.block.html.exec(e);if(t){var i={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};if(this.options.sanitize){var n=this.options.sanitizer?this.options.sanitizer(t[0]):c(t[0]);i.type="paragraph",i.text=n,i.tokens=this.lexer.inline(n)}return i}},i.def=function(e){var t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}},i.table=function(e){var t=this.rules.block.table.exec(e);if(t){var i={type:"table",header:k(t[1]).map((function(e){return{text:e}})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(i.header.length===i.align.length){i.raw=t[0];var n,o,s,r,a=i.align.length;for(n=0;n<a;n++)/^ *-+: *$/.test(i.align[n])?i.align[n]="right":/^ *:-+: *$/.test(i.align[n])?i.align[n]="center":/^ *:-+ *$/.test(i.align[n])?i.align[n]="left":i.align[n]=null;for(a=i.rows.length,n=0;n<a;n++)i.rows[n]=k(i.rows[n],i.header.length).map((function(e){return{text:e}}));for(a=i.header.length,o=0;o<a;o++)i.header[o].tokens=this.lexer.inline(i.header[o].text);for(a=i.rows.length,o=0;o<a;o++)for(r=i.rows[o],s=0;s<r.length;s++)r[s].tokens=this.lexer.inline(r[s].text);return i}}},i.lheading=function(e){var t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}},i.paragraph=function(e){var t=this.rules.block.paragraph.exec(e);if(t){var i="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:i,tokens:this.lexer.inline(i)}}},i.text=function(e){var t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}},i.escape=function(e){var t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:c(t[1])}},i.tag=function(e){var t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):c(t[0]):t[0]}},i.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var i=t[2].trim();if(!this.options.pedantic&&/^</.test(i)){if(!/>$/.test(i))return;var n=L(i.slice(0,-1),"\\");if((i.length-n.length)%2==0)return}else{var o=function(e,t){if(-1===e.indexOf(t[1]))return-1;for(var i=e.length,n=0,o=0;o<i;o++)if("\\"===e[o])o++;else if(e[o]===t[0])n++;else if(e[o]===t[1]&&--n<0)return o;return-1}(t[2],"()");if(o>-1){var s=(0===t[0].indexOf("!")?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,s).trim(),t[3]=""}}var r=t[2],a="";if(this.options.pedantic){var l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);l&&(r=l[1],a=l[3])}else a=t[3]?t[3].slice(1,-1):"";return r=r.trim(),/^</.test(r)&&(r=this.options.pedantic&&!/>$/.test(i)?r.slice(1):r.slice(1,-1)),N(t,{href:r?r.replace(this.rules.inline._escapes,"$1"):r,title:a?a.replace(this.rules.inline._escapes,"$1"):a},t[0],this.lexer)}},i.reflink=function(e,t){var i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){var n=(i[2]||i[1]).replace(/\s+/g," ");if(!(n=t[n.toLowerCase()])||!n.href){var o=i[0].charAt(0);return{type:"text",raw:o,text:o}}return N(i,n,i[0],this.lexer)}},i.emStrong=function(e,t,i){void 0===i&&(i="");var n=this.rules.inline.emStrong.lDelim.exec(e);if(n&&(!n[3]||!i.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var o=n[1]||n[2]||"";if(!o||o&&(""===i||this.rules.inline.punctuation.exec(i))){var s,r,a=n[0].length-1,l=a,d=0,h="*"===n[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+a);null!=(n=h.exec(t));)if(s=n[1]||n[2]||n[3]||n[4]||n[5]||n[6])if(r=s.length,n[3]||n[4])l+=r;else if(!((n[5]||n[6])&&a%3)||(a+r)%3){if(!((l-=r)>0)){if(r=Math.min(r,r+l+d),Math.min(a,r)%2){var c=e.slice(1,a+n.index+r);return{type:"em",raw:e.slice(0,a+n.index+r+1),text:c,tokens:this.lexer.inlineTokens(c)}}var u=e.slice(2,a+n.index+r-1);return{type:"strong",raw:e.slice(0,a+n.index+r+1),text:u,tokens:this.lexer.inlineTokens(u)}}}else d+=r}}},i.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var i=t[2].replace(/\n/g," "),n=/[^ ]/.test(i),o=/^ /.test(i)&&/ $/.test(i);return n&&o&&(i=i.substring(1,i.length-1)),i=c(i,!0),{type:"codespan",raw:t[0],text:i}}},i.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},i.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}},i.autolink=function(e,t){var i,n,o=this.rules.inline.autolink.exec(e);if(o)return n="@"===o[2]?"mailto:"+(i=c(this.options.mangle?t(o[1]):o[1])):i=c(o[1]),{type:"link",raw:o[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}},i.url=function(e,t){var i;if(i=this.rules.inline.url.exec(e)){var n,o;if("@"===i[2])o="mailto:"+(n=c(this.options.mangle?t(i[0]):i[0]));else{var s;do{s=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0]}while(s!==i[0]);n=c(i[0]),o="www."===i[1]?"http://"+n:n}return{type:"link",raw:i[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}},i.inlineText=function(e,t){var i,n=this.rules.inline.text.exec(e);if(n)return i=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):c(n[0]):n[0]:c(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:i}},t}(),T={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?<?([^\s>]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:S,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};T.def=m(T.def).replace("label",T._label).replace("title",T._title).getRegex(),T.bullet=/(?:[*+-]|\d{1,9}[.)])/,T.listItemStart=m(/^( *)(bull) */).replace("bull",T.bullet).getRegex(),T.list=m(T.list).replace(/bull/g,T.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+T.def.source+")").getRegex(),T._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",T._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,T.html=m(T.html,"i").replace("comment",T._comment).replace("tag",T._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),T.paragraph=m(T._paragraph).replace("hr",T.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",T._tag).getRegex(),T.blockquote=m(T.blockquote).replace("paragraph",T.paragraph).getRegex(),T.normal=x({},T),T.gfm=x({},T.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),T.gfm.table=m(T.gfm.table).replace("hr",T.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",T._tag).getRegex(),T.gfm.paragraph=m(T._paragraph).replace("hr",T.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",T.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",T._tag).getRegex(),T.pedantic=x({},T.normal,{html:m("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",T._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:S,paragraph:m(T.normal._paragraph).replace("hr",T.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",T.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var M={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:S,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:S,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function A(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function R(e){var t,i,n="",o=e.length;for(t=0;t<o;t++)i=e.charCodeAt(t),Math.random()>.5&&(i="x"+i.toString(16)),n+="&#"+i+";";return n}M._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",M.punctuation=m(M.punctuation).replace(/punctuation/g,M._punctuation).getRegex(),M.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,M.escapedEmSt=/\\\*|\\_/g,M._comment=m(T._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),M.emStrong.lDelim=m(M.emStrong.lDelim).replace(/punct/g,M._punctuation).getRegex(),M.emStrong.rDelimAst=m(M.emStrong.rDelimAst,"g").replace(/punct/g,M._punctuation).getRegex(),M.emStrong.rDelimUnd=m(M.emStrong.rDelimUnd,"g").replace(/punct/g,M._punctuation).getRegex(),M._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,M._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,M._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,M.autolink=m(M.autolink).replace("scheme",M._scheme).replace("email",M._email).getRegex(),M._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,M.tag=m(M.tag).replace("comment",M._comment).replace("attribute",M._attribute).getRegex(),M._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,M._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,M._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,M.link=m(M.link).replace("label",M._label).replace("href",M._href).replace("title",M._title).getRegex(),M.reflink=m(M.reflink).replace("label",M._label).replace("ref",T._label).getRegex(),M.nolink=m(M.nolink).replace("ref",T._label).getRegex(),M.reflinkSearch=m(M.reflinkSearch,"g").replace("reflink",M.reflink).replace("nolink",M.nolink).getRegex(),M.normal=x({},M),M.pedantic=x({},M.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:m(/^!?\[(label)\]\((.*?)\)/).replace("label",M._label).getRegex(),reflink:m(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",M._label).getRegex()}),M.gfm=x({},M.normal,{escape:m(M.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),M.gfm.url=m(M.gfm.url,"i").replace("email",M.gfm._extended_email).getRegex(),M.breaks=x({},M.gfm,{br:m(M.br).replace("{2,}","*").getRegex(),text:m(M.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var O=function(){function i(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||e.defaults,this.options.tokenizer=this.options.tokenizer||new I,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var i={block:T.normal,inline:M.normal};this.options.pedantic?(i.block=T.pedantic,i.inline=M.pedantic):this.options.gfm&&(i.block=T.gfm,this.options.breaks?i.inline=M.breaks:i.inline=M.gfm),this.tokenizer.rules=i}i.lex=function(e,t){return new i(t).lex(e)},i.lexInline=function(e,t){return new i(t).inlineTokens(e)};var n,o,s=i.prototype;return s.lex=function(e){var t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens},s.blockTokens=function(e,t){var i,n,o,s,r=this;for(void 0===t&&(t=[]),e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,(function(e,t,i){return t+" ".repeat(i.length)}));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((function(n){return!!(i=n.call({lexer:r},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)}))))if(i=this.tokenizer.space(e))e=e.substring(i.raw.length),1===i.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(i);else if(i=this.tokenizer.code(e))e=e.substring(i.raw.length),!(n=t[t.length-1])||"paragraph"!==n.type&&"text"!==n.type?t.push(i):(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(i=this.tokenizer.fences(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.heading(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.hr(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.blockquote(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.list(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.html(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.def(e))e=e.substring(i.raw.length),!(n=t[t.length-1])||"paragraph"!==n.type&&"text"!==n.type?this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title}):(n.raw+="\n"+i.raw,n.text+="\n"+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(i=this.tokenizer.table(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.lheading(e))e=e.substring(i.raw.length),t.push(i);else if(o=e,this.options.extensions&&this.options.extensions.startBlock&&function(){var t=1/0,i=e.slice(1),n=void 0;r.options.extensions.startBlock.forEach((function(e){"number"==typeof(n=e.call({lexer:this},i))&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}(),this.state.top&&(i=this.tokenizer.paragraph(o)))n=t[t.length-1],s&&"paragraph"===n.type?(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i),s=o.length!==e.length,e=e.substring(i.raw.length);else if(i=this.tokenizer.text(e))e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===n.type?(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i);else if(e){var a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}throw new Error(a)}return this.state.top=!0,t},s.inline=function(e,t){return void 0===t&&(t=[]),this.inlineQueue.push({src:e,tokens:t}),t},s.inlineTokens=function(e,t){var i,n,o,s=this;void 0===t&&(t=[]);var r,a,l,d=e;if(this.tokens.links){var h=Object.keys(this.tokens.links);if(h.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(d));)h.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(d=d.slice(0,r.index)+"["+E("a",r[0].length-2)+"]"+d.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(d));)d=d.slice(0,r.index)+"["+E("a",r[0].length-2)+"]"+d.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.escapedEmSt.exec(d));)d=d.slice(0,r.index)+"++"+d.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(a||(l=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((function(n){return!!(i=n.call({lexer:s},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)}))))if(i=this.tokenizer.escape(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.tag(e))e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.link(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.emStrong(e,d,l))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.codespan(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.br(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.del(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.autolink(e,R))e=e.substring(i.raw.length),t.push(i);else if(this.state.inLink||!(i=this.tokenizer.url(e,R))){if(o=e,this.options.extensions&&this.options.extensions.startInline&&function(){var t=1/0,i=e.slice(1),n=void 0;s.options.extensions.startInline.forEach((function(e){"number"==typeof(n=e.call({lexer:this},i))&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}(),i=this.tokenizer.inlineText(o,A))e=e.substring(i.raw.length),"_"!==i.raw.slice(-1)&&(l=i.raw.slice(-1)),a=!0,(n=t[t.length-1])&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(e){var c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}else e=e.substring(i.raw.length),t.push(i);return t},n=i,o=[{key:"rules",get:function(){return{block:T,inline:M}}}],null&&t(n.prototype,null),o&&t(n,o),Object.defineProperty(n,"prototype",{writable:!1}),i}(),P=function(){function t(t){this.options=t||e.defaults}var i=t.prototype;return i.code=function(e,t,i){var n=(t||"").match(/\S*/)[0];if(this.options.highlight){var o=this.options.highlight(e,n);null!=o&&o!==e&&(i=!0,e=o)}return e=e.replace(/\n$/,"")+"\n",n?'<pre><code class="'+this.options.langPrefix+c(n,!0)+'">'+(i?e:c(e,!0))+"</code></pre>\n":"<pre><code>"+(i?e:c(e,!0))+"</code></pre>\n"},i.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},i.html=function(e){return e},i.heading=function(e,t,i,n){return this.options.headerIds?"<h"+t+' id="'+(this.options.headerPrefix+n.slug(i))+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},i.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},i.list=function(e,t,i){var n=t?"ol":"ul";return"<"+n+(t&&1!==i?' start="'+i+'"':"")+">\n"+e+"</"+n+">\n"},i.listitem=function(e){return"<li>"+e+"</li>\n"},i.checkbox=function(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},i.paragraph=function(e){return"<p>"+e+"</p>\n"},i.table=function(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"},i.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},i.tablecell=function(e,t){var i=t.header?"th":"td";return(t.align?"<"+i+' align="'+t.align+'">':"<"+i+">")+e+"</"+i+">\n"},i.strong=function(e){return"<strong>"+e+"</strong>"},i.em=function(e){return"<em>"+e+"</em>"},i.codespan=function(e){return"<code>"+e+"</code>"},i.br=function(){return this.options.xhtml?"<br/>":"<br>"},i.del=function(e){return"<del>"+e+"</del>"},i.link=function(e,t,i){if(null===(e=v(this.options.sanitize,this.options.baseUrl,e)))return i;var n='<a href="'+c(e)+'"';return t&&(n+=' title="'+t+'"'),n+">"+i+"</a>"},i.image=function(e,t,i){if(null===(e=v(this.options.sanitize,this.options.baseUrl,e)))return i;var n='<img src="'+e+'" alt="'+i+'"';return t&&(n+=' title="'+t+'"'),n+(this.options.xhtml?"/>":">")},i.text=function(e){return e},t}(),F=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,i){return""+i},t.image=function(e,t,i){return""+i},t.br=function(){return""},e}(),B=function(){function e(){this.seen={}}var t=e.prototype;return t.serialize=function(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},t.getNextSafeSlug=function(e,t){var i=e,n=0;if(this.seen.hasOwnProperty(i)){n=this.seen[e];do{i=e+"-"+ ++n}while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=n,this.seen[i]=0),i},t.slug=function(e,t){void 0===t&&(t={});var i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)},e}(),W=function(){function t(t){this.options=t||e.defaults,this.options.renderer=this.options.renderer||new P,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new F,this.slugger=new B}t.parse=function(e,i){return new t(i).parse(e)},t.parseInline=function(e,i){return new t(i).parseInline(e)};var i=t.prototype;return i.parse=function(e,t){void 0===t&&(t=!0);var i,n,o,s,r,a,l,d,h,c,u,p,m,f,_,v,b,w,C,y="",S=e.length;for(i=0;i<S;i++)if(c=e[i],!(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[c.type])||!1===(C=this.options.extensions.renderers[c.type].call({parser:this},c))&&["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(c.type))switch(c.type){case"space":continue;case"hr":y+=this.renderer.hr();continue;case"heading":y+=this.renderer.heading(this.parseInline(c.tokens),c.depth,g(this.parseInline(c.tokens,this.textRenderer)),this.slugger);continue;case"code":y+=this.renderer.code(c.text,c.lang,c.escaped);continue;case"table":for(d="",l="",s=c.header.length,n=0;n<s;n++)l+=this.renderer.tablecell(this.parseInline(c.header[n].tokens),{header:!0,align:c.align[n]});for(d+=this.renderer.tablerow(l),h="",s=c.rows.length,n=0;n<s;n++){for(l="",r=(a=c.rows[n]).length,o=0;o<r;o++)l+=this.renderer.tablecell(this.parseInline(a[o].tokens),{header:!1,align:c.align[o]});h+=this.renderer.tablerow(l)}y+=this.renderer.table(d,h);continue;case"blockquote":h=this.parse(c.tokens),y+=this.renderer.blockquote(h);continue;case"list":for(u=c.ordered,p=c.start,m=c.loose,s=c.items.length,h="",n=0;n<s;n++)v=(_=c.items[n]).checked,b=_.task,f="",_.task&&(w=this.renderer.checkbox(v),m?_.tokens.length>0&&"paragraph"===_.tokens[0].type?(_.tokens[0].text=w+" "+_.tokens[0].text,_.tokens[0].tokens&&_.tokens[0].tokens.length>0&&"text"===_.tokens[0].tokens[0].type&&(_.tokens[0].tokens[0].text=w+" "+_.tokens[0].tokens[0].text)):_.tokens.unshift({type:"text",text:w}):f+=w),f+=this.parse(_.tokens,m),h+=this.renderer.listitem(f,b,v);y+=this.renderer.list(h,u,p);continue;case"html":y+=this.renderer.html(c.text);continue;case"paragraph":y+=this.renderer.paragraph(this.parseInline(c.tokens));continue;case"text":for(h=c.tokens?this.parseInline(c.tokens):c.text;i+1<S&&"text"===e[i+1].type;)h+="\n"+((c=e[++i]).tokens?this.parseInline(c.tokens):c.text);y+=t?this.renderer.paragraph(h):h;continue;default:var x='Token with "'+c.type+'" type was not found.';if(this.options.silent)return void console.error(x);throw new Error(x)}else y+=C||"";return y},i.parseInline=function(e,t){t=t||this.renderer;var i,n,o,s="",r=e.length;for(i=0;i<r;i++)if(n=e[i],!(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[n.type])||!1===(o=this.options.extensions.renderers[n.type].call({parser:this},n))&&["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type))switch(n.type){case"escape":case"text":s+=t.text(n.text);break;case"html":s+=t.html(n.text);break;case"link":s+=t.link(n.href,n.title,this.parseInline(n.tokens,t));break;case"image":s+=t.image(n.href,n.title,n.text);break;case"strong":s+=t.strong(this.parseInline(n.tokens,t));break;case"em":s+=t.em(this.parseInline(n.tokens,t));break;case"codespan":s+=t.codespan(n.text);break;case"br":s+=t.br();break;case"del":s+=t.del(this.parseInline(n.tokens,t));break;default:var a='Token with "'+n.type+'" type was not found.';if(this.options.silent)return void console.error(a);throw new Error(a)}else s+=o||"";return s},t}();function V(e,t,i){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(i=t,t=null),D(t=x({},V.defaults,t||{})),i){var n,o=t.highlight;try{n=O.lex(e,t)}catch(e){return i(e)}var s=function(e){var s;if(!e)try{t.walkTokens&&V.walkTokens(n,t.walkTokens),s=W.parse(n,t)}catch(t){e=t}return t.highlight=o,e?i(e):i(null,s)};if(!o||o.length<3)return s();if(delete t.highlight,!n.length)return s();var r=0;return V.walkTokens(n,(function(e){"code"===e.type&&(r++,setTimeout((function(){o(e.text,e.lang,(function(t,i){if(t)return s(t);null!=i&&i!==e.text&&(e.text=i,e.escaped=!0),0==--r&&s()}))}),0))})),void(0===r&&s())}function a(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+c(e.message+"",!0)+"</pre>";throw e}try{var l=O.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(V.walkTokens(l,t.walkTokens)).then((function(){return W.parse(l,t)})).catch(a);V.walkTokens(l,t.walkTokens)}return W.parse(l,t)}catch(e){a(e)}}V.options=V.setOptions=function(t){var i;return x(V.defaults,t),i=V.defaults,e.defaults=i,V},V.getDefaults=o,V.defaults=e.defaults,V.use=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var n,o=x.apply(void 0,[{}].concat(t)),s=V.defaults.extensions||{renderers:{},childTokens:{}};t.forEach((function(e){if(e.extensions&&(n=!0,e.extensions.forEach((function(e){if(!e.name)throw new Error("extension name required");if(e.renderer){var t=s.renderers?s.renderers[e.name]:null;s.renderers[e.name]=t?function(){for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];var s=e.renderer.apply(this,n);return!1===s&&(s=t.apply(this,n)),s}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");s[e.level]?s[e.level].unshift(e.tokenizer):s[e.level]=[e.tokenizer],e.start&&("block"===e.level?s.startBlock?s.startBlock.push(e.start):s.startBlock=[e.start]:"inline"===e.level&&(s.startInline?s.startInline.push(e.start):s.startInline=[e.start]))}e.childTokens&&(s.childTokens[e.name]=e.childTokens)}))),e.renderer&&function(){var t=V.defaults.renderer||new P,i=function(i){var n=t[i];t[i]=function(){for(var o=arguments.length,s=new Array(o),r=0;r<o;r++)s[r]=arguments[r];var a=e.renderer[i].apply(t,s);return!1===a&&(a=n.apply(t,s)),a}};for(var n in e.renderer)i(n);o.renderer=t}(),e.tokenizer&&function(){var t=V.defaults.tokenizer||new I,i=function(i){var n=t[i];t[i]=function(){for(var o=arguments.length,s=new Array(o),r=0;r<o;r++)s[r]=arguments[r];var a=e.tokenizer[i].apply(t,s);return!1===a&&(a=n.apply(t,s)),a}};for(var n in e.tokenizer)i(n);o.tokenizer=t}(),e.walkTokens){var t=V.defaults.walkTokens;o.walkTokens=function(i){var n=[];return n.push(e.walkTokens.call(this,i)),t&&(n=n.concat(t.call(this,i))),n}}n&&(o.extensions=s),V.setOptions(o)}))},V.walkTokens=function(e,t){for(var i,o=[],s=function(){var e=i.value;switch(o=o.concat(t.call(V,e)),e.type){case"table":for(var s,r=n(e.header);!(s=r()).done;){var a=s.value;o=o.concat(V.walkTokens(a.tokens,t))}for(var l,d=n(e.rows);!(l=d()).done;)for(var h,c=n(l.value);!(h=c()).done;){var u=h.value;o=o.concat(V.walkTokens(u.tokens,t))}break;case"list":o=o.concat(V.walkTokens(e.items,t));break;default:V.defaults.extensions&&V.defaults.extensions.childTokens&&V.defaults.extensions.childTokens[e.type]?V.defaults.extensions.childTokens[e.type].forEach((function(i){o=o.concat(V.walkTokens(e[i],t))})):e.tokens&&(o=o.concat(V.walkTokens(e.tokens,t)))}},r=n(e);!(i=r()).done;)s();return o},V.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");D(t=x({},V.defaults,t||{}));try{var i=O.lexInline(e,t);return t.walkTokens&&V.walkTokens(i,t.walkTokens),W.parseInline(i,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+c(e.message+"",!0)+"</pre>";throw e}},V.Parser=W,V.parser=W.parse,V.Renderer=P,V.TextRenderer=F,V.Lexer=O,V.lexer=O.lex,V.Tokenizer=I,V.Slugger=B,V.parse=V;var H=V.options,z=V.setOptions,U=V.use,K=V.walkTokens,j=V.parseInline,q=V,$=W.parse,G=O.lex;e.Lexer=O,e.Parser=W,e.Renderer=P,e.Slugger=B,e.TextRenderer=F,e.Tokenizer=I,e.getDefaults=o,e.lexer=G,e.marked=V,e.options=H,e.parse=q,e.parseInline=j,e.parser=$,e.setOptions=z,e.use=U,e.walkTokens=K,Object.defineProperty(e,"__esModule",{value:!0})}))}(),OZe.Lexer||exports.Lexer,OZe.Parser||exports.Parser,OZe.Renderer||exports.Renderer,OZe.Slugger||exports.Slugger,OZe.TextRenderer||exports.TextRenderer,OZe.Tokenizer||exports.Tokenizer,OZe.getDefaults||exports.getDefaults,OZe.lexer||exports.lexer;var PZe=OZe.marked||exports.marked;function FZe(e){let t=JSON.parse(e);return t=BZe(t),t}function BZe(e,t=0){if(!e||t>200)return e;if("object"==typeof e){switch(e.$mid){case 1:return QCe.revive(e);case 2:return new RegExp(e.source,e.flags);case 16:return new Date(e.source)}if(e instanceof eLe||e instanceof Uint8Array)return e;if(Array.isArray(e))for(let i=0;i<e.length;++i)e[i]=BZe(e[i],t+1);else for(const i in e)Object.hasOwnProperty.call(e,i)&&(e[i]=BZe(e[i],t+1))}return e}OZe.options||exports.options,OZe.parse||exports.parse,OZe.parseInline||exports.parseInline,OZe.parser||exports.parser,OZe.setOptions||exports.setOptions,OZe.use||exports.use,OZe.walkTokens||exports.walkTokens;const WZe=Object.freeze({image:(e,t,i)=>{let n=[],o=[];return e&&(({href:e,dimensions:n}=function(e){const t=[],i=e.split("|").map((e=>e.trim()));e=i[0];const n=i[1];if(n){const e=/height=(\d+)/.exec(n),i=/width=(\d+)/.exec(n),o=e?e[1]:"",s=i?i[1]:"",r=isFinite(parseInt(s)),a=isFinite(parseInt(o));r&&t.push(`width="${s}"`),a&&t.push(`height="${o}"`)}return{href:e,dimensions:t}}(e)),o.push(`src="${wZe(e)}"`)),i&&o.push(`alt="${wZe(i)}"`),t&&o.push(`title="${wZe(t)}"`),n.length&&(o=o.concat(n)),"<img "+o.join(" ")+">"},paragraph:e=>`<p>${e}</p>`,link:(e,t,i)=>"string"!=typeof e?"":(e===i&&(i=CZe(i)),t="string"==typeof t?wZe(CZe(t)):"",`<a href="${e=(e=CZe(e)).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}" title="${t||e}">${i}</a>`)});function VZe(e,t){return/^\w[\w\d+.-]*:/.test(t)?t:e.path.endsWith("/")?lKe(e,t).toString():lKe(rKe(e),t).toString()}function HZe(e,t){const{config:i,allowedSchemes:n}=function(e){const t=[$Te.http,$Te.https,$Te.mailto,$Te.data,$Te.file,$Te.vscodeFileResource,$Te.vscodeRemote,$Te.vscodeRemoteResource];return e.isTrusted&&t.push($Te.command),{config:{ALLOWED_TAGS:[...UMe],ALLOWED_ATTR:zZe,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:t}}(e);jTe("uponSanitizeAttribute",((e,t)=>{if("style"!==t.attrName&&"class"!==t.attrName);else{if("SPAN"===e.tagName){if("style"===t.attrName)return void(t.keepAttr=/^(color\:#[0-9a-fA-F]+;)?(background-color\:#[0-9a-fA-F]+;)?$/.test(t.attrValue));if("class"===t.attrName)return void(t.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(t.attrValue))}t.keepAttr=!1}}));const o=function(e,t=!1){const i=document.createElement("a");return jTe("afterSanitizeAttributes",(n=>{for(const o of["href","src"])if(n.hasAttribute(o)){const s=n.getAttribute(o);if("href"===o&&s.startsWith("#"))continue;if(i.href=s,!e.includes(i.protocol.replace(/:$/,""))){if(t&&"src"===o&&i.href.startsWith("data:"))continue;n.removeAttribute(o)}}})),Awe((()=>{qTe("afterSanitizeAttributes")}))}(n);try{return KTe(t,Object.assign(Object.assign({},i),{RETURN_TRUSTED_TYPE:!0}))}finally{qTe("uponSanitizeAttribute"),o.dispose()}}const zZe=["align","autoplay","alt","class","controls","data-code","data-href","height","href","loop","muted","playsinline","poster","src","style","target","title","width"];new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]),new bSe((()=>{const e=new PZe.Renderer;return e.code=e=>e,e.blockquote=e=>e,e.html=e=>"",e.heading=(e,t,i)=>e+"\n",e.hr=()=>"",e.list=(e,t)=>e,e.listitem=e=>e+"\n",e.paragraph=e=>e+"\n",e.table=(e,t)=>e+t+"\n",e.tablerow=e=>e,e.tablecell=(e,t)=>e+" ",e.strong=e=>e,e.em=e=>e,e.codespan=e=>e,e.br=()=>"\n",e.del=e=>e,e.image=(e,t,i)=>"",e.text=e=>e,e.link=(e,t,i)=>i,e}));class UZe{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach((n=>n.splice(e,t,i)))}}function KZe(e,t,i){return Math.min(Math.max(e,t),i)}class jZe{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}}class qZe{constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){const t=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=t,this._sum+=e,this._n<this._values.length&&(this._n+=1),this._val=this._sum/this._n,this._val}get value(){return this._val}}var $Ze,GZe=i(4318),ZZe={};ZZe.styleTagTransform=zl(),ZZe.setAttributes=Bl(),ZZe.insert=Pl().bind(null,"head"),ZZe.domAPI=Rl(),ZZe.insertStyleElement=Vl(),Ml()(GZe.A,ZZe),GZe.A&&GZe.A.locals&&GZe.A.locals;class YZe extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function QZe(e,t){const i=[];for(const n of t){if(e.start>=n.range.end)continue;if(e.end<n.range.start)break;const t=$Ze.intersect(e,n.range);$Ze.isEmpty(t)||i.push({range:t,size:n.size})}return i}function XZe({start:e,end:t},i){return{start:e+i,end:t+i}}!function(e){function t(e,t){if(e.start>=t.end||t.start>=e.end)return{start:0,end:0};const i=Math.max(e.start,t.start),n=Math.min(e.end,t.end);return n-i<=0?{start:0,end:0}:{start:i,end:n}}function i(e){return e.end-e.start<=0}e.intersect=t,e.isEmpty=i,e.intersects=function(e,n){return!i(t(e,n))},e.relativeComplement=function(e,t){const n=[],o={start:e.start,end:Math.min(t.start,e.end)},s={start:Math.max(t.end,e.start),end:e.end};return i(o)||n.push(o),i(s)||n.push(s),n}}($Ze||($Ze={}));class JZe{constructor(){this.groups=[],this._size=0}splice(e,t,i=[]){const n=i.length-t,o=QZe({start:0,end:e},this.groups),s=QZe({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map((e=>({range:XZe(e.range,n),size:e.size}))),r=i.map(((t,i)=>({range:{start:e+i,end:e+i+1},size:t.size})));this.groups=function(...e){return function(e){const t=[];let i=null;for(const n of e){const e=n.range.start,o=n.range.end,s=n.size;i&&s===i.size?i.range.end=o:(i={range:{start:e,end:o},size:s},t.push(i))}return t}(e.reduce(((e,t)=>e.concat(t)),[]))}(o,r,s),this._size=this.groups.reduce(((e,t)=>e+t.size*(t.range.end-t.range.start)),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;let t=0,i=0;for(const n of this.groups){const o=n.range.end-n.range.start,s=i+o*n.size;if(e<s)return t+Math.floor((e-i)/n.size);t+=o,i=s}return t}indexAfter(e){return Math.min(this.indexAt(e)+1,this.count)}positionAt(e){if(e<0)return-1;let t=0,i=0;for(const n of this.groups){const o=n.range.end-n.range.start,s=i+o;if(e<s)return t+(e-i)*n.size;t+=o*n.size,i=s}return-1}}class eYe{constructor(e){this.renderers=e,this.cache=new Map,this.transactionNodesPendingRemoval=new Set,this.inTransaction=!1}alloc(e){let t=this.getTemplateCache(e).pop(),i=!1;if(t)i=this.transactionNodesPendingRemoval.has(t.domNode),i&&this.transactionNodesPendingRemoval.delete(t.domNode);else{const i=OMe(".monaco-list-row");t={domNode:i,templateId:e,templateData:this.getRenderer(e).renderTemplate(i)}}return{row:t,isReusingConnectedDomNode:i}}release(e){e&&this.releaseRow(e)}transact(e){if(this.inTransaction)throw new Error("Already in transaction");this.inTransaction=!0;try{e()}finally{for(const e of this.transactionNodesPendingRemoval)this.doRemoveNode(e);this.transactionNodesPendingRemoval.clear(),this.inTransaction=!1}}releaseRow(e){const{domNode:t,templateId:i}=e;t&&(this.inTransaction?this.transactionNodesPendingRemoval.add(t):this.doRemoveNode(t)),this.getTemplateCache(i).push(e)}doRemoveNode(e){e.classList.remove("scrolling"),function(e){var t;try{null===(t=e.parentElement)||void 0===t||t.removeChild(e)}catch(e){}}(e)}getTemplateCache(e){let t=this.cache.get(e);return t||(t=[],this.cache.set(e,t)),t}dispose(){this.cache.forEach(((e,t)=>{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null})),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var tYe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};const iYe={CurrentDragAndDropData:void 0},nYe={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements:e=>[e],getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class oYe{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class sYe{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class rYe{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;t<e.files.length;t++){const i=e.files.item(t);i&&(i.size||i.type)&&this.files.push(i)}}}getData(){return{types:this.types,files:this.files}}}class aYe{constructor(e){(null==e?void 0:e.getSetSize)?this.getSetSize=e.getSetSize.bind(e):this.getSetSize=(e,t,i)=>i,(null==e?void 0:e.getPosInSet)?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(e,t)=>t+1,(null==e?void 0:e.getRole)?this.getRole=e.getRole.bind(e):this.getRole=e=>"listitem",(null==e?void 0:e.isChecked)?this.isChecked=e.isChecked.bind(e):this.isChecked=e=>{}}}class lYe{get contentHeight(){return this.rangeMap.size}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const e of this.items)this.measureItemWidth(e);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:uMe(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,i,n=nYe){var o,s,r,a,l,d,h,c,u,g,p,m;if(this.virtualDelegate=t,this.domId="list_id_"+ ++lYe.InstanceCount,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new TDe(50),this.splicing=!1,this.dragOverAnimationStopDisposable=Owe.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=Owe.None,this.onDragLeaveTimeout=Owe.None,this.disposables=new Rwe,this._onDidChangeContentHeight=new $we,this._horizontalScrolling=!1,n.horizontalScrolling&&n.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=new JZe;for(const e of i)this.renderers.set(e.templateId,e);this.cache=this.disposables.add(new eYe(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support","boolean"!=typeof n.mouseSupport||n.mouseSupport),this._horizontalScrolling=null!==(o=n.horizontalScrolling)&&void 0!==o?o:nYe.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.additionalScrollHeight=void 0===n.additionalScrollHeight?0:n.additionalScrollHeight,this.accessibilityProvider=new aYe(n.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",(null!==(s=n.transformOptimization)&&void 0!==s?s:nYe.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(oRe.addTarget(this.rowsContainer)),this.scrollable=new sBe({forceIntegerValues:!0,smoothScrollDuration:null!==(r=n.smoothScrolling)&&void 0!==r&&r?125:0,scheduleAtNextAnimationFrame:e=>oMe(e)}),this.scrollableElement=this.disposables.add(new _Be(this.rowsContainer,{alwaysConsumeMouseWheel:null!==(a=n.alwaysConsumeMouseWheel)&&void 0!==a?a:nYe.alwaysConsumeMouseWheel,horizontal:1,vertical:null!==(l=n.verticalScrollMode)&&void 0!==l?l:nYe.verticalScrollMode,useShadows:null!==(d=n.useShadows)&&void 0!==d?d:nYe.useShadows,mouseWheelScrollSensitivity:n.mouseWheelScrollSensitivity,fastScrollSensitivity:n.fastScrollSensitivity,scrollByPage:n.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(tMe(this.rowsContainer,nRe.Change,(e=>this.onTouchChange(e)))),this.disposables.add(tMe(this.scrollableElement.getDomNode(),"scroll",(e=>e.target.scrollTop=0))),this.disposables.add(tMe(this.domNode,"dragover",(e=>this.onDragOver(this.toDragEvent(e))))),this.disposables.add(tMe(this.domNode,"drop",(e=>this.onDrop(this.toDragEvent(e))))),this.disposables.add(tMe(this.domNode,"dragleave",(e=>this.onDragLeave(this.toDragEvent(e))))),this.disposables.add(tMe(this.domNode,"dragend",(e=>this.onDragEnd(e)))),this.setRowLineHeight=null!==(h=n.setRowLineHeight)&&void 0!==h?h:nYe.setRowLineHeight,this.setRowHeight=null!==(c=n.setRowHeight)&&void 0!==c?c:nYe.setRowHeight,this.supportDynamicHeights=null!==(u=n.supportDynamicHeights)&&void 0!==u?u:nYe.supportDynamicHeights,this.dnd=null!==(g=n.dnd)&&void 0!==g?g:nYe.dnd,this.layout(null===(p=n.initialSize)||void 0===p?void 0:p.height,null===(m=n.initialSize)||void 0===m?void 0:m.width)}updateOptions(e){let t;void 0!==e.additionalScrollHeight&&(this.additionalScrollHeight=e.additionalScrollHeight,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),void 0!==e.smoothScrolling&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),void 0!==e.horizontalScrolling&&(this.horizontalScrolling=e.horizontalScrolling),void 0!==e.scrollByPage&&(t=Object.assign(Object.assign({},null!=t?t:{}),{scrollByPage:e.scrollByPage})),void 0!==e.mouseWheelScrollSensitivity&&(t=Object.assign(Object.assign({},null!=t?t:{}),{mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity})),void 0!==e.fastScrollSensitivity&&(t=Object.assign(Object.assign({},null!=t?t:{}),{fastScrollSensitivity:e.fastScrollSensitivity})),t&&this.scrollableElement.updateOptions(t)}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o={start:e,end:e+t},s=$Ze.intersect(n,o),r=new Map;for(let e=s.end-1;e>=s.start;e--){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){let i=r.get(t.templateId);i||(i=[],r.set(t.templateId,i));const n=this.renderers.get(t.templateId);n&&n.disposeElement&&n.disposeElement(t.element,e,t.row.templateData,t.size),i.push(t.row)}t.row=null}const a={start:e+t,end:this.items.length},l=$Ze.intersect(a,n),d=$Ze.relativeComplement(a,n),h=i.map((e=>({id:String(this.itemId++),element:e,templateId:this.virtualDelegate.getTemplateId(e),size:this.virtualDelegate.getHeight(e),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(e),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:Owe.None,checkedDisposable:Owe.None})));let c;0===e&&t>=this.items.length?(this.rangeMap=new JZe,this.rangeMap.splice(0,0,h),c=this.items,this.items=h):(this.rangeMap.splice(e,t,h),c=this.items.splice(e,t,...h));const u=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=XZe(l,u),m=$Ze.intersect(g,p);for(let e=m.start;e<m.end;e++)this.updateItemInDOM(this.items[e],e);const f=$Ze.relativeComplement(p,g);for(const e of f)for(let t=e.start;t<e.end;t++)this.removeItemFromDOM(t);const _=d.map((e=>XZe(e,u))),v=[{start:e,end:e+i.length},..._].map((e=>$Ze.intersect(g,e))),b=this.getNextToLastElement(v);for(const e of v)for(let t=e.start;t<e.end;t++){const e=this.items[t],i=r.get(e.templateId),n=null==i?void 0:i.pop();this.insertItemInDOM(t,b,n)}for(const e of r.values())for(const t of e)this.cache.release(t);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),c.map((e=>e.element))}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=oMe((()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null})))}eventuallyUpdateScrollWidth(){this.horizontalScrolling?this.scrollableElementWidthDelayer.trigger((()=>this.updateScrollWidth())):this.scrollableElementWidthDelayer.cancel()}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)void 0!==t.width&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:0===e?0:e+10})}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){const e=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),t=this.rangeMap.positionAt(e.start),i=this.rangeMap.positionAt(e.start+1);return-1!==i&&(i-t)/2+t<this.scrollTop?e.start+1:e.start}element(e){return this.items[e].element}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){const i={height:"number"==typeof e?e:gMe(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),void 0!==t&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:"number"==typeof t?t:uMe(this.domNode)})}render(e,t,i,n,o,s=!1){const r=this.getRenderRange(t,i),a=$Ze.relativeComplement(r,e),l=$Ze.relativeComplement(e,r),d=this.getNextToLastElement(a);if(s){const t=$Ze.intersect(e,r);for(let e=t.start;e<t.end;e++)this.updateItemInDOM(this.items[e],e)}this.cache.transact((()=>{for(const e of l)for(let t=e.start;t<e.end;t++)this.removeItemFromDOM(t);for(const e of a)for(let t=e.start;t<e.end;t++)this.insertItemInDOM(t,d)})),void 0!==n&&(this.rowsContainer.style.left=`-${n}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&void 0!==o&&(this.rowsContainer.style.width=`${Math.max(o,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t,i){const n=this.items[e];let o=!1;if(!n.row)if(i)n.row=i;else{const e=this.cache.alloc(n.templateId);n.row=e.row,o=e.isReusingConnectedDomNode}const s=this.accessibilityProvider.getRole(n.element)||"listitem";n.row.domNode.setAttribute("role",s);const r=this.accessibilityProvider.isChecked(n.element);if("boolean"==typeof r)n.row.domNode.setAttribute("aria-checked",String(!!r));else if(r){const e=e=>n.row.domNode.setAttribute("aria-checked",String(!!e));e(r.value),n.checkedDisposable=r.onDidChange(e)}!o&&n.row.domNode.parentElement||(t?this.rowsContainer.insertBefore(n.row.domNode,t):this.rowsContainer.appendChild(n.row.domNode)),this.updateItemInDOM(n,e);const a=this.renderers.get(n.templateId);if(!a)throw new Error(`No renderer found for template id ${n.templateId}`);null==a||a.renderElement(n.element,e,n.row.templateData,n.size);const l=this.dnd.getDragURI(n.element);n.dragStartDisposable.dispose(),n.row.domNode.draggable=!!l,l&&(n.dragStartDisposable=tMe(n.row.domNode,"dragstart",(e=>this.onDragStart(n.element,l,e)))),this.horizontalScrolling&&(this.measureItemWidth(n),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=uMe(e.row.domNode);const t=window.getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2==0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){const i=this.renderers.get(t.templateId);i&&i.disposeElement&&i.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.additionalScrollHeight}get onMouseClick(){return zwe.map(this.disposables.add(new xBe(this.domNode,"click")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onMouseDblClick(){return zwe.map(this.disposables.add(new xBe(this.domNode,"dblclick")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onMouseMiddleClick(){return zwe.filter(zwe.map(this.disposables.add(new xBe(this.domNode,"auxclick")).event,(e=>this.toMouseEvent(e)),this.disposables),(e=>1===e.browserEvent.button),this.disposables)}get onMouseDown(){return zwe.map(this.disposables.add(new xBe(this.domNode,"mousedown")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onMouseOver(){return zwe.map(this.disposables.add(new xBe(this.domNode,"mouseover")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onContextMenu(){return zwe.any(zwe.map(this.disposables.add(new xBe(this.domNode,"contextmenu")).event,(e=>this.toMouseEvent(e)),this.disposables),zwe.map(this.disposables.add(new xBe(this.domNode,nRe.Contextmenu)).event,(e=>this.toGestureEvent(e)),this.disposables))}get onTouchStart(){return zwe.map(this.disposables.add(new xBe(this.domNode,"touchstart")).event,(e=>this.toTouchEvent(e)),this.disposables)}get onTap(){return zwe.map(this.disposables.add(new xBe(this.rowsContainer,nRe.Tap)).event,(e=>this.toGestureEvent(e)),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){var n,o;if(!i.dataTransfer)return;const s=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(kGe.TEXT,t),i.dataTransfer.setDragImage){let e;this.dnd.getDragLabel&&(e=this.dnd.getDragLabel(s,i)),void 0===e&&(e=String(s.length));const t=OMe(".monaco-drag-image");t.textContent=e;const n=(e=>{for(;e&&!e.classList.contains("monaco-workbench");)e=e.parentElement;return e||document.body})(this.domNode);n.appendChild(t),i.dataTransfer.setDragImage(t,-10,-10),setTimeout((()=>n.removeChild(t)),0)}this.domNode.classList.add("dragging"),this.currentDragData=new oYe(s),iYe.CurrentDragAndDropData=new sYe(s),null===(o=(n=this.dnd).onDragStart)||void 0===o||o.call(n,this.currentDragData,i)}onDragOver(e){var t;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),iYe.CurrentDragAndDropData&&"vscode-ui"===iYe.CurrentDragAndDropData.getData())return!1;if(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer)return!1;if(!this.currentDragData)if(iYe.CurrentDragAndDropData)this.currentDragData=iYe.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new rYe}const i=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop="boolean"==typeof i?i:i.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;let n;if(e.browserEvent.dataTransfer.dropEffect="boolean"!=typeof i&&0===i.effect?"copy":"move",n="boolean"!=typeof i&&i.feedback?i.feedback:void 0===e.index?[-1]:[e.index],n=nbe(n).filter((e=>e>=-1&&e<this.length)).sort(((e,t)=>e-t)),n=-1===n[0]?[-1]:n,o=this.currentDragFeedback,s=n,Array.isArray(o)&&Array.isArray(s)?tbe(o,s):o===s)return!0;var o,s;if(this.currentDragFeedback=n,this.currentDragFeedbackDisposable.dispose(),-1===n[0])this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=Awe((()=>{this.domNode.classList.remove("drop-target"),this.rowsContainer.classList.remove("drop-target")}));else{for(const e of n){const i=this.items[e];i.dropTarget=!0,null===(t=i.row)||void 0===t||t.domNode.classList.add("drop-target")}this.currentDragFeedbackDisposable=Awe((()=>{var e;for(const t of n){const i=this.items[t];i.dropTarget=!1,null===(e=i.row)||void 0===e||e.domNode.classList.remove("drop-target")}}))}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=RDe((()=>this.clearDragOverFeedback()),100),this.currentDragData&&(null===(i=(t=this.dnd).onDragLeave)||void 0===i||i.call(t,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,iYe.CurrentDragAndDropData=void 0,t&&e.browserEvent.dataTransfer&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.browserEvent))}onDragEnd(e){var t,i;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,iYe.CurrentDragAndDropData=void 0,null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=Owe.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const e=function(e){let t=e.offsetParent,i=e.offsetTop,n=e.offsetLeft;for(;null!==(e=e.parentNode)&&e!==document.body&&e!==document.documentElement;){i-=e.scrollTop;const o=vMe(e)?null:rMe(e);o&&(n-="rtl"!==o.direction?e.scrollLeft:-e.scrollLeft),e===t&&(n+=lMe.getBorderLeftWidth(e),i+=lMe.getBorderTopWidth(e),i+=e.offsetTop,n+=e.offsetLeft,t=e.offsetParent)}return{left:n,top:i}}(this.domNode).top;this.dragOverAnimationDisposable=function(e){const t=()=>{e(),i=oMe(t)};let i=oMe(t);return Awe((()=>i.dispose()))}(this.animateDragAndDropScrollTop.bind(this,e))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=RDe((()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}),1e3),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(void 0===this.dragOverMouseY)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;i instanceof HTMLElement&&i!==this.rowsContainer&&t.contains(i);){const e=i.getAttribute("data-index");if(e){const t=Number(e);if(!isNaN(t))return t}i=i.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,i){const n=this.getRenderRange(e,t);let o,s;e===this.elementTop(n.start)?(o=n.start,s=0):n.end-n.start>1&&(o=n.start+1,s=this.elementTop(o)-e);let r=0;for(;;){const a=this.getRenderRange(e,t);let l=!1;for(let e=a.start;e<a.end;e++){const t=this.probeDynamicHeight(e);0!==t&&this.rangeMap.splice(e,1,[this.items[e]]),r+=t,l=l||0!==t}if(!l){0!==r&&this.eventuallyUpdateScrollDimensions();const t=$Ze.relativeComplement(n,a);for(const e of t)for(let t=e.start;t<e.end;t++)this.items[t].row&&this.removeItemFromDOM(t);const l=$Ze.relativeComplement(a,n);for(const e of l)for(let t=e.start;t<e.end;t++){const e=t+1,i=e<this.items.length?this.items[e].row:null,n=i?i.domNode:null;this.insertItemInDOM(t,n)}for(let e=a.start;e<a.end;e++)this.items[e].row&&this.updateItemInDOM(this.items[e],e);if("number"==typeof o){const t=this.scrollable.getFutureScrollPosition().scrollTop-e,n=this.elementTop(o)-s+t;this.setScrollTop(n,i)}return void this._onDidChangeContentHeight.fire(this.contentHeight)}}}probeDynamicHeight(e){var t,i,n;const o=this.items[e];if(this.virtualDelegate.getDynamicHeight){const e=this.virtualDelegate.getDynamicHeight(o.element);if(null!==e){const t=o.size;return o.size=e,o.lastDynamicHeightWidth=this.renderWidth,e-t}}if(!o.hasDynamicHeight||o.lastDynamicHeightWidth===this.renderWidth)return 0;if(this.virtualDelegate.hasDynamicHeight&&!this.virtualDelegate.hasDynamicHeight(o.element))return 0;const s=o.size;if(o.row)return o.row.domNode.style.height="",o.size=o.row.domNode.offsetHeight,o.lastDynamicHeightWidth=this.renderWidth,o.size-s;const{row:r}=this.cache.alloc(o.templateId);r.domNode.style.height="",this.rowsContainer.appendChild(r.domNode);const a=this.renderers.get(o.templateId);if(!a)throw new Nwe("Missing renderer for templateId: "+o.templateId);return a.renderElement(o.element,e,r.templateData,void 0),o.size=r.domNode.offsetHeight,null===(t=a.disposeElement)||void 0===t||t.call(a,o.element,e,r.templateData,void 0),null===(n=(i=this.virtualDelegate).setDynamicHeight)||void 0===n||n.call(i,o.element,o.size),o.lastDynamicHeightWidth=this.renderWidth,this.rowsContainer.removeChild(r.domNode),this.cache.release(r),o.size-s}getNextToLastElement(e){const t=e[e.length-1];if(!t)return null;const i=this.items[t.end];return i&&i.row?i.row.domNode:null}getElementDomId(e){return`${this.domId}_${e}`}dispose(){var e;if(this.items){for(const t of this.items)if(t.row){const i=this.renderers.get(t.row.templateId);i&&(null===(e=i.disposeElement)||void 0===e||e.call(i,t.element,-1,t.row.templateData,void 0),i.disposeTemplate(t.row.templateData))}this.items=[]}this.domNode&&this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),Twe(this.disposables)}}lYe.InstanceCount=0,tYe([iRe],lYe.prototype,"onMouseClick",null),tYe([iRe],lYe.prototype,"onMouseDblClick",null),tYe([iRe],lYe.prototype,"onMouseMiddleClick",null),tYe([iRe],lYe.prototype,"onMouseDown",null),tYe([iRe],lYe.prototype,"onMouseOver",null),tYe([iRe],lYe.prototype,"onContextMenu",null),tYe([iRe],lYe.prototype,"onTouchStart",null),tYe([iRe],lYe.prototype,"onTap",null);var dYe,hYe,cYe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},uYe=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class gYe{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){const n=this.renderedElements.findIndex((e=>e.templateData===i));if(n>=0){const e=this.renderedElements[n];this.trait.unrender(i),e.index=t}else{const e={index:t,templateData:i};this.renderedElements.push(e)}this.trait.renderIndex(t,i)}splice(e,t,i){const n=[];for(const o of this.renderedElements)o.index<e?n.push(o):o.index>=e+t&&n.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=n}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex((t=>t.templateData===e));t<0||this.renderedElements.splice(t,1)}}class pYe{get name(){return this._trait}get renderer(){return new gYe(this)}constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new $we,this.onChange=this._onChange.event}splice(e,t,i){var n;t=Math.max(0,Math.min(t,this.length-e));const o=i.length-t,s=e+t,r=[...this.sortedIndexes.filter((t=>t<e)),...i.map(((t,i)=>t?i+e:-1)).filter((e=>-1!==e)),...this.sortedIndexes.filter((e=>e>=s)).map((e=>e+o))],a=this.length+o;if(this.sortedIndexes.length>0&&0===r.length&&a>0){const t=null!==(n=this.sortedIndexes.find((t=>t>=e)))&&void 0!==n?n:a-1;r.push(Math.min(t,a-1))}this.renderer.splice(e,t,i.length),this._set(r,r),this.length=a}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(MYe),t)}_set(e,t,i){const n=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const s=TYe(o,e);return this.renderer.renderIndexes(s),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return function(e,t,i){return function(e,t){let i=0,n=e-1;for(;i<=n;){const e=(i+n)/2|0,o=t(e);if(o<0)i=e+1;else{if(!(o>0))return e;n=e-1}}return-(i+1)}(e.length,(n=>i(e[n],t)))}(this.sortedIndexes,e,MYe)>=0}dispose(){Twe(this._onChange)}}cYe([iRe],pYe.prototype,"renderer",null);class mYe extends pYe{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class fYe{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,i.map((()=>!1)));const n=this.trait.get().map((e=>this.identityProvider.getId(this.view.element(e)).toString())),o=i.map((e=>n.indexOf(this.identityProvider.getId(e).toString())>-1));this.trait.splice(e,t,o)}}function _Ye(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName}function vYe(e){return!!e.classList.contains("monaco-editor")||!e.classList.contains("monaco-list")&&!!e.parentElement&&vYe(e.parentElement)}function bYe(e){return!!("A"===e.tagName&&e.classList.contains("monaco-button")||"DIV"===e.tagName&&e.classList.contains("monaco-button-dropdown"))||!e.classList.contains("monaco-list")&&!!e.parentElement&&bYe(e.parentElement)}class wYe{get onKeyDown(){return this.disposables.add(zwe.chain(this.disposables.add(new xBe(this.view.domNode,"keydown")).event).filter((e=>!_Ye(e.target))).map((e=>new KIe(e))))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new Rwe,this.multipleSelectionDisposables=new Rwe,this.onKeyDown.filter((e=>3===e.keyCode)).on(this.onEnter,this,this.disposables),this.onKeyDown.filter((e=>16===e.keyCode)).on(this.onUpArrow,this,this.disposables),this.onKeyDown.filter((e=>18===e.keyCode)).on(this.onDownArrow,this,this.disposables),this.onKeyDown.filter((e=>11===e.keyCode)).on(this.onPageUpArrow,this,this.disposables),this.onKeyDown.filter((e=>12===e.keyCode)).on(this.onPageDownArrow,this,this.disposables),this.onKeyDown.filter((e=>9===e.keyCode)).on(this.onEscape,this,this.disposables),!1!==i.multipleSelectionSupport&&this.onKeyDown.filter((e=>(Dve?e.metaKey:e.ctrlKey)&&31===e.keyCode)).on(this.onCtrlA,this,this.multipleSelectionDisposables)}updateOptions(e){void 0!==e.multipleSelectionSupport&&(this.multipleSelectionDisposables.clear(),e.multipleSelectionSupport&&this.onKeyDown.filter((e=>(Dve?e.metaKey:e.ctrlKey)&&31===e.keyCode)).on(this.onCtrlA,this,this.multipleSelectionDisposables))}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(sbe(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}cYe([iRe],wYe.prototype,"onKeyDown",null),function(e){e[e.Automatic=0]="Automatic",e[e.Trigger=1]="Trigger"}(dYe||(dYe={})),function(e){e[e.Idle=0]="Idle",e[e.Typing=1]="Typing"}(hYe||(hYe={}));const CYe=new class{mightProducePrintableCharacter(e){return!(e.ctrlKey||e.metaKey||e.altKey)&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30||e.keyCode>=93&&e.keyCode<=102||e.keyCode>=80&&e.keyCode<=90)}};class yYe{constructor(e,t,i,n,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=n,this.delegate=o,this.enabled=!1,this.state=hYe.Idle,this.mode=dYe.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new Rwe,this.disposables=new Rwe,this.updateOptions(e.options)}updateOptions(e){var t,i;null===(t=e.typeNavigationEnabled)||void 0===t||t?this.enable():this.disable(),this.mode=null!==(i=e.typeNavigationMode)&&void 0!==i?i:dYe.Automatic}enable(){if(this.enabled)return;let e=!1;const t=this.enabledDisposables.add(zwe.chain(this.enabledDisposables.add(new xBe(this.view.domNode,"keydown")).event)).filter((e=>!_Ye(e.target))).filter((()=>this.mode===dYe.Automatic||this.triggered)).map((e=>new KIe(e))).filter((t=>e||this.keyboardNavigationEventFilter(t))).filter((e=>this.delegate.mightProducePrintableCharacter(e))).forEach((e=>DMe(e,!0))).map((e=>e.browserEvent.key)).event,i=zwe.debounce(t,(()=>null),800,void 0,void 0,this.enabledDisposables),n=zwe.reduce(zwe.any(t,i),((e,t)=>null===t?null:(e||"")+t),void 0,this.enabledDisposables);n(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t((()=>e=!0),void 0,this.enabledDisposables),i((()=>e=!1),void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const i=null===(e=this.list.options.accessibilityProvider)||void 0===e?void 0:e.getAriaLabel(this.list.element(t[0]));i&&JMe(i)}this.previouslyFocused=-1}onInput(e){if(!e)return this.state=hYe.Idle,void(this.triggered=!1);const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===hYe.Idle?1:0;this.state=hYe.Typing;for(let t=0;t<this.list.length;t++){const o=(i+t+n)%this.list.length,s=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(o)),r=s&&s.toString();if(void 0===r||AGe(e,r))return this.previouslyFocused=i,this.list.setFocus([o]),void this.list.reveal(o)}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class SYe{constructor(e,t){this.list=e,this.view=t,this.disposables=new Rwe,this.disposables.add(zwe.chain(this.disposables.add(new xBe(t.domNode,"keydown")).event)).filter((e=>!_Ye(e.target))).map((e=>new KIe(e))).filter((e=>!(2!==e.keyCode||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey))).on(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(0===t.length)return;const i=this.view.domElement(t[0]);if(!i)return;const n=i.querySelector("[tabIndex]");if(!(n&&n instanceof HTMLElement&&-1!==n.tabIndex))return;const o=window.getComputedStyle(n);"hidden"!==o.visibility&&"none"!==o.display&&(e.preventDefault(),e.stopPropagation(),n.focus())}dispose(){this.disposables.dispose()}}function xYe(e){return Dve?e.browserEvent.metaKey:e.browserEvent.ctrlKey}function kYe(e){return e.browserEvent.shiftKey}const LYe={isSelectionSingleChangeEvent:xYe,isSelectionRangeChangeEvent:kYe};class DYe{constructor(e){this.list=e,this.disposables=new Rwe,this._onPointer=new $we,this.onPointer=this._onPointer.event,!1!==e.options.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||LYe),this.mouseSupport=void 0===e.options.mouseSupport||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(oRe.addTarget(e.getHTMLElement()))),zwe.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){void 0!==e.multipleSelectionSupport&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||LYe))}isSelectionSingleChangeEvent(e){return!!this.multipleSelectionController&&this.multipleSelectionController.isSelectionSingleChangeEvent(e)}isSelectionRangeChangeEvent(e){return!!this.multipleSelectionController&&this.multipleSelectionController.isSelectionRangeChangeEvent(e)}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){vYe(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(_Ye(e.browserEvent.target)||vYe(e.browserEvent.target))return;const t=void 0===e.index?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport)return;if(_Ye(e.browserEvent.target)||vYe(e.browserEvent.target))return;const t=e.index;return void 0===t?(this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),void this.list.setAnchor(void 0)):this.isSelectionRangeChangeEvent(e)||this.isSelectionChangeEvent(e)?this.changeSelection(e):(this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),(i=e.browserEvent)instanceof MouseEvent&&2===i.button||this.list.setSelection([t],e.browserEvent),void this._onPointer.fire(e));var i}onDoubleClick(e){if(_Ye(e.browserEvent.target)||vYe(e.browserEvent.target))return;if(this.isSelectionChangeEvent(e))return;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(void 0===i){const e=this.list.getFocus()[0];i=null!=e?e:t,this.list.setAnchor(i)}const n=sbe(Math.min(i,t),Math.max(i,t)+1),o=this.list.getSelection(),s=function(e,t){const i=e.indexOf(t);if(-1===i)return[];const n=[];let o=i-1;for(;o>=0&&e[o]===t-(i-o);)n.push(e[o--]);for(n.reverse(),o=i;o<e.length&&e[o]===t+(o-i);)n.push(e[o++]);return n}(TYe(o,[i]),i);if(0===s.length)return;const r=TYe(n,function(e,t){const i=[];let n=0,o=0;for(;n<e.length||o<t.length;)if(n>=e.length)i.push(t[o++]);else if(o>=t.length)i.push(e[n++]);else{if(e[n]===t[o]){n++,o++;continue}e[n]<t[o]?i.push(e[n++]):o++}return i}(o,s));this.list.setSelection(r,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const i=this.list.getSelection(),n=i.filter((e=>e!==t));this.list.setFocus([t]),this.list.setAnchor(t),i.length===n.length?this.list.setSelection([...n,t],e.browserEvent):this.list.setSelection(n,e.browserEvent)}}dispose(){this.disposables.dispose()}}class EYe{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,i;const n=this.selectorSuffix&&`.${this.selectorSuffix}`,o=[];e.listBackground&&o.push(`.monaco-list${n} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(o.push(`.monaco-list${n}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),o.push(`.monaco-list${n}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&o.push(`.monaco-list${n}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(o.push(`.monaco-list${n}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),o.push(`.monaco-list${n}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&o.push(`.monaco-list${n}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&o.push(`.monaco-list${n}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&o.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${n}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }\n\t\t\t`),e.listFocusAndSelectionForeground&&o.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${n}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }\n\t\t\t`),e.listInactiveFocusForeground&&(o.push(`.monaco-list${n} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),o.push(`.monaco-list${n} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&o.push(`.monaco-list${n} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(o.push(`.monaco-list${n} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),o.push(`.monaco-list${n} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(o.push(`.monaco-list${n} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),o.push(`.monaco-list${n} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&o.push(`.monaco-list${n} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&o.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&o.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const s=zMe(e.listFocusAndSelectionOutline,zMe(e.listSelectionOutline,null!==(t=e.listFocusOutline)&&void 0!==t?t:""));s&&o.push(`.monaco-list${n}:focus .monaco-list-row.focused.selected { outline: 1px solid ${s}; outline-offset: -1px;}`),e.listFocusOutline&&o.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${n}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }\n\t\t\t\t.monaco-workbench.context-menu-visible .monaco-list${n}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }\n\t\t\t`);const r=zMe(e.listSelectionOutline,null!==(i=e.listInactiveFocusOutline)&&void 0!==i?i:"");r&&o.push(`.monaco-list${n} .monaco-list-row.focused.selected { outline: 1px dotted ${r}; outline-offset: -1px; }`),e.listSelectionOutline&&o.push(`.monaco-list${n} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&o.push(`.monaco-list${n} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&o.push(`.monaco-list${n} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropBackground&&o.push(`\n\t\t\t\t.monaco-list${n}.drop-target,\n\t\t\t\t.monaco-list${n} .monaco-list-rows.drop-target,\n\t\t\t\t.monaco-list${n} .monaco-list-row.drop-target { background-color: ${e.listDropBackground} !important; color: inherit !important; }\n\t\t\t`),e.tableColumnsBorder&&o.push(`\n\t\t\t\t.monaco-table > .monaco-split-view2,\n\t\t\t\t.monaco-table > .monaco-split-view2 .monaco-sash.vertical::before,\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2,\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\t\t\tborder-color: ${e.tableColumnsBorder};\n\t\t\t\t}\n\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2,\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\t\t\tborder-color: transparent;\n\t\t\t\t}\n\t\t\t`),e.tableOddRowsBackgroundColor&&o.push(`\n\t\t\t\t.monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {\n\t\t\t\t\tbackground-color: ${e.tableOddRowsBackgroundColor};\n\t\t\t\t}\n\t\t\t`),this.styleElement.textContent=o.join("\n")}}const NYe={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropBackground:"#383B3D",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:hRe.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:hRe.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:hRe.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0},IYe={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){}}};function TYe(e,t){const i=[];let n=0,o=0;for(;n<e.length||o<t.length;)if(n>=e.length)i.push(t[o++]);else if(o>=t.length)i.push(e[n++]);else{if(e[n]===t[o]){i.push(e[n]),n++,o++;continue}e[n]<t[o]?i.push(e[n++]):i.push(t[o++])}return i}const MYe=(e,t)=>e-t;class AYe{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map((t=>t.renderTemplate(e)))}renderElement(e,t,i,n){let o=0;for(const s of this.renderers)s.renderElement(e,t,i[o++],n)}disposeElement(e,t,i,n){var o;let s=0;for(const r of this.renderers)null===(o=r.disposeElement)||void 0===o||o.call(r,e,t,i[s],n),s+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class RYe{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e);n?i.setAttribute("aria-label",n):i.removeAttribute("aria-label");const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);"number"==typeof o?i.setAttribute("aria-level",`${o}`):i.removeAttribute("aria-level")}disposeTemplate(e){}}class OYe{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){var i,n;null===(n=(i=this.dnd).onDragStart)||void 0===n||n.call(i,e,t)}onDragOver(e,t,i,n){return this.dnd.onDragOver(e,t,i,n)}onDragLeave(e,t,i,n){var o,s;null===(s=(o=this.dnd).onDragLeave)||void 0===s||s.call(o,e,t,i,n)}onDragEnd(e){var t,i;null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}drop(e,t,i,n){this.dnd.drop(e,t,i,n)}}class PYe{get onDidChangeFocus(){return zwe.map(this.eventBufferer.wrapEvent(this.focus.onChange),(e=>this.toListEvent(e)),this.disposables)}get onDidChangeSelection(){return zwe.map(this.eventBufferer.wrapEvent(this.selection.onChange),(e=>this.toListEvent(e)),this.disposables)}get domId(){return this.view.domId}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=this.disposables.add(zwe.chain(this.disposables.add(new xBe(this.view.domNode,"keydown")).event)).map((e=>new KIe(e))).filter((t=>e=58===t.keyCode||t.shiftKey&&68===t.keyCode)).map((e=>DMe(e,!0))).filter((()=>!1)).event,i=this.disposables.add(zwe.chain(this.disposables.add(new xBe(this.view.domNode,"keyup")).event)).forEach((()=>e=!1)).map((e=>new KIe(e))).filter((e=>58===e.keyCode||e.shiftKey&&68===e.keyCode)).map((e=>DMe(e,!0))).map((({browserEvent:e})=>{const t=this.getFocus(),i=t.length?t[0]:void 0;return{index:i,element:void 0!==i?this.view.element(i):void 0,anchor:void 0!==i?this.view.domElement(i):this.view.domNode,browserEvent:e}})).event,n=this.disposables.add(zwe.chain(this.view.onContextMenu)).filter((t=>!e)).map((({element:e,index:t,browserEvent:i})=>({element:e,index:t,anchor:{x:i.pageX+1,y:i.pageY},browserEvent:i}))).event;return zwe.any(t,i,n)}get onKeyDown(){return this.disposables.add(new xBe(this.view.domNode,"keydown")).event}get onDidFocus(){return zwe.signal(this.disposables.add(new xBe(this.view.domNode,"focus",!0)).event)}constructor(e,t,i,n,o=IYe){var s,r,a,l;this.user=e,this._options=o,this.focus=new pYe("focused"),this.anchor=new pYe("anchor"),this.eventBufferer=new eCe,this._ariaLabel="",this.disposables=new Rwe,this._onDidDispose=new $we,this.onDidDispose=this._onDidDispose.event;const d=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?null===(s=this._options.accessibilityProvider)||void 0===s?void 0:s.getWidgetRole():"list";this.selection=new mYe("listbox"!==d);const h=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(h.push(new RYe(this.accessibilityProvider)),null===(a=(r=this.accessibilityProvider).onDidChangeActiveDescendant)||void 0===a||a.call(r,this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map((e=>new AYe(e.templateId,[...h,e])));const c=Object.assign(Object.assign({},o),{dnd:o.dnd&&new OYe(this,o.dnd)});if(this.view=this.createListView(t,i,n,c),this.view.domNode.setAttribute("role",d),o.styleController)this.styleController=o.styleController(this.view.domId);else{const e=yMe(this.view.domNode);this.styleController=new EYe(e,this.view.domId)}if(this.spliceable=new UZe([new fYe(this.focus,this.view,o.identityProvider),new fYe(this.selection,this.view,o.identityProvider),new fYe(this.anchor,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new SYe(this,this.view)),("boolean"!=typeof o.keyboardSupport||o.keyboardSupport)&&(this.keyboardController=new wYe(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const e=o.keyboardNavigationDelegate||CYe;this.typeNavigationController=new yYe(this,this.view,o.keyboardNavigationLabelProvider,null!==(l=o.keyboardNavigationEventFilter)&&void 0!==l?l:()=>!0,e),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),!1!==this._options.multipleSelectionSupport&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,n){return new lYe(e,t,i,n)}createMouseController(e){return new DYe(this)}updateOptions(e={}){var t,i;this._options=Object.assign(Object.assign({},this._options),e),null===(t=this.typeNavigationController)||void 0===t||t.updateOptions(this._options),void 0!==this._options.multipleSelectionController&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),null===(i=this.keyboardController)||void 0===i||i.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new YZe(this.user,`Invalid start index: ${e}`);if(t<0)throw new YZe(this.user,`Invalid delete count: ${t}`);0===t&&0===i.length||this.eventBufferer.bufferEvents((()=>this.spliceable.splice(e,t,i)))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const t of e)if(t<0||t>=this.length)throw new YZe(this.user,`Invalid index ${t}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map((e=>this.view.element(e)))}setAnchor(e){if(void 0!==e){if(e<0||e>=this.length)throw new YZe(this.user,`Invalid index ${e}`);this.anchor.set([e])}else this.anchor.set([])}getAnchor(){return obe(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return void 0===e?void 0:this.element(e)}setFocus(e,t){for(const t of e)if(t<0||t>=this.length)throw new YZe(this.user,`Invalid index ${t}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,n){if(0===this.length)return;const o=this.focus.get(),s=this.findNextIndex(o.length>0?o[0]+e:0,t,n);s>-1&&this.setFocus([s],i)}focusPrevious(e=1,t=!1,i,n){if(0===this.length)return;const o=this.focus.get(),s=this.findPreviousIndex(o.length>0?o[0]-e:0,t,n);s>-1&&this.setFocus([s],i)}focusNextPage(e,t){return uYe(this,void 0,void 0,(function*(){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=0===i?0:i-1;const n=this.getFocus()[0];if(n!==i&&(void 0===n||i>n)){const o=this.findPreviousIndex(i,!1,t);o>-1&&n!==o?this.setFocus([o],e):this.setFocus([i],e)}else{const o=this.view.getScrollTop();let s=o+this.view.renderHeight;i>n&&(s-=this.view.elementHeight(i)),this.view.setScrollTop(s),this.view.getScrollTop()!==o&&(this.setFocus([]),yield ADe(0),yield this.focusNextPage(e,t))}}))}focusPreviousPage(e,t){return uYe(this,void 0,void 0,(function*(){let i;const n=this.view.getScrollTop();i=0===n?this.view.indexAt(n):this.view.indexAfter(n-1);const o=this.getFocus()[0];if(o!==i&&(void 0===o||o>=i)){const n=this.findNextIndex(i,!1,t);n>-1&&o!==n?this.setFocus([n],e):this.setFocus([i],e)}else{const i=n;this.view.setScrollTop(n-this.view.renderHeight),this.view.getScrollTop()!==i&&(this.setFocus([]),yield ADe(0),yield this.focusPreviousPage(e,t))}}))}focusLast(e,t){if(0===this.length)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(0===this.length)return;const n=this.findNextIndex(e,!1,i);n>-1&&this.setFocus([n],t)}findNextIndex(e,t=!1,i){for(let n=0;n<this.length;n++){if(e>=this.length&&!t)return-1;if(e%=this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let n=0;n<this.length;n++){if(e<0&&!t)return-1;if(e=(this.length+e%this.length)%this.length,!i||i(this.element(e)))return e;e--}return-1}getFocus(){return this.focus.get()}getFocusedElements(){return this.getFocus().map((e=>this.view.element(e)))}reveal(e,t){if(e<0||e>=this.length)throw new YZe(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),n=this.view.elementTop(e),o=this.view.elementHeight(e);if(bbe(t)){const e=o-this.view.renderHeight;this.view.setScrollTop(e*KZe(t,0,1)+n)}else{const e=n+o,t=i+this.view.renderHeight;n<i&&e>=t||(n<i||e>=t&&o>=this.view.renderHeight?this.view.setScrollTop(n):e>=t&&this.view.setScrollTop(e-this.view.renderHeight))}}getHTMLElement(){return this.view.domNode}getElementID(e){return this.view.getElementDomId(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map((e=>this.view.element(e))),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var e;const t=this.focus.get();if(t.length>0){let i;(null===(e=this.accessibilityProvider)||void 0===e?void 0:e.getActiveDescendantId)&&(i=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",i||this.view.getElementDomId(t[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",0===e.length),this.view.domNode.classList.toggle("selection-single",1===e.length),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}cYe([iRe],PYe.prototype,"onDidChangeFocus",null),cYe([iRe],PYe.prototype,"onDidChangeSelection",null),cYe([iRe],PYe.prototype,"onContextMenu",null),cYe([iRe],PYe.prototype,"onKeyDown",null),cYe([iRe],PYe.prototype,"onDidFocus",null);var FYe=i(3953),BYe={};BYe.styleTagTransform=zl(),BYe.setAttributes=Bl(),BYe.insert=Pl().bind(null,"head"),BYe.domAPI=Rl(),BYe.insertStyleElement=Vl(),Ml()(FYe.A,BYe),FYe.A&&FYe.A.locals&&FYe.A.locals;const WYe=OMe,VYe="selectOption.entry.template";class HYe{get templateId(){return VYe}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=IMe(e,WYe(".option-text")),t.detail=IMe(e,WYe(".option-detail")),t.decoratorRight=IMe(e,WYe(".option-decorator-right")),t}renderElement(e,t,i){const n=i,o=e.text,s=e.detail,r=e.decoratorRight,a=e.isDisabled;n.text.textContent=o,n.detail.textContent=s||"",n.decoratorRight.innerText=r||"",a?n.root.classList.add("option-disabled"):n.root.classList.remove("option-disabled")}disposeTemplate(e){}}class zYe extends Owe{constructor(e,t,i,n,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=n,this.selectBoxOptions=o||Object.create(null),"number"!=typeof this.selectBoxOptions.minBottomMargin?this.selectBoxOptions.minBottomMargin=zYe.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding","string"==typeof this.selectBoxOptions.ariaLabel&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),"string"==typeof this.selectBoxOptions.ariaDescription&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new $we,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}getHeight(){return 22}getTemplateId(){return VYe}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=OMe(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=IMe(this.selectDropDownContainer,WYe(".select-box-details-pane"));const t=IMe(this.selectDropDownContainer,WYe(".select-box-dropdown-container-width-control")),i=IMe(t,WYe(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",IMe(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=yMe(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(tMe(this.selectDropDownContainer,LMe.DRAG_START,(e=>{DMe(e,!0)})))}registerListeners(){let e;this._register(iMe(this.selectElement,"change",(e=>{this.selected=e.target.selectedIndex,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)}))),this._register(tMe(this.selectElement,LMe.CLICK,(e=>{DMe(e),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()}))),this._register(tMe(this.selectElement,LMe.MOUSE_DOWN,(e=>{DMe(e)}))),this._register(tMe(this.selectElement,"touchstart",(t=>{e=this._isVisible}))),this._register(tMe(this.selectElement,"touchend",(t=>{DMe(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()}))),this._register(tMe(this.selectElement,LMe.KEY_DOWN,(e=>{const t=new KIe(e);let i=!1;Dve?18!==t.keyCode&&16!==t.keyCode&&10!==t.keyCode&&3!==t.keyCode||(i=!0):(18===t.keyCode&&t.altKey||16===t.keyCode&&t.altKey||10===t.keyCode||3===t.keyCode)&&(i=!0),i&&(this.showSelectDropDown(),DMe(e,!0))})))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){tbe(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach(((e,t)=>{this.selectElement.add(this.createOption(e.text,t,e.isDisabled)),"string"==typeof e.description&&(this._hasDetails=!0)}))),void 0!==t&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;null===(e=this.selectList)||void 0===e||e.splice(0,this.selectList.length,this.options)}select(e){e>=0&&e<this.options.length?this.selected=e:e>this.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join("\n")}styleSelectElement(){var e,t,i;const n=null!==(e=this.styles.selectBackground)&&void 0!==e?e:"",o=null!==(t=this.styles.selectForeground)&&void 0!==t?t:"",s=null!==(i=this.styles.selectBorder)&&void 0!==i?i:"";this.selectElement.style.backgroundColor=n,this.selectElement.style.color=o,this.selectElement.style.borderColor=s}styleList(){var e,t;const i=null!==(e=this.styles.selectBackground)&&void 0!==e?e:"",n=zMe(this.styles.selectListBackground,i);this.selectDropDownListContainer.style.backgroundColor=n,this.selectionDetailsPane.style.backgroundColor=n;const o=null!==(t=this.styles.focusBorder)&&void 0!==t?t:"";this.selectDropDownContainer.style.outlineColor=o,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}showSelectDropDown(){this.selectionDetailsPane.innerText="",this.contextViewProvider&&!this._isVisible&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){this.contextViewProvider&&this._isVisible&&(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch(e){}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach(((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)})),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=hMe(this.selectElement),i=getComputedStyle(this.selectElement),n=parseFloat(i.getPropertyValue("--dropdown-padding-top"))+parseFloat(i.getPropertyValue("--dropdown-padding-bottom")),o=window.innerHeight-t.top-t.height-(this.selectBoxOptions.minBottomMargin||0),s=t.top-zYe.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,r=this.selectElement.offsetWidth,a=this.setWidthControlElement(this.widthControlElement),l=Math.max(a,Math.round(r)).toString()+"px";this.selectDropDownContainer.style.width=l,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let d=this.selectList.contentHeight;this._hasDetails&&void 0===this._cachedMaxDetailsHeight&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const h=this._hasDetails?this._cachedMaxDetailsHeight:0,c=d+n+h,u=Math.floor((o-n-h)/this.getHeight()),g=Math.floor((s-n-h)/this.getHeight());if(e)return!(t.top+t.height>window.innerHeight-22||t.top<zYe.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||u<1&&g<1||(u<zYe.DEFAULT_MINIMUM_VISIBLE_OPTIONS&&g>u&&this.options.length>u?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),0));if(t.top+t.height>window.innerHeight-22||t.top<zYe.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||0===this._dropDownPosition&&u<1||1===this._dropDownPosition&&g<1)return this.hideSelectDropDown(!0),!1;if(0===this._dropDownPosition){if(this._isVisible&&u+g<1)return this.hideSelectDropDown(!0),!1;c>o&&(d=u*this.getHeight())}else c>s&&(d=g*this.getHeight());return this.selectList.layout(d),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=d+n+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=d+n+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=l,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}return!1}setWidthControlElement(e){let t=0;if(e){let i=0,n=0;this.options.forEach(((e,t)=>{const o=e.detail?e.detail.length:0,s=e.decoratorRight?e.decoratorRight.length:0,r=e.text.length+o+s;r>n&&(i=t,n=r)})),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=cMe(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=IMe(e,WYe(".select-box-dropdown-list-container")),this.listRenderer=new HYe,this.selectList=new PYe("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:e=>{let t=e.text;return e.detail&&(t+=`. ${e.detail}`),e.decoratorRight&&(t+=`. ${e.decoratorRight}`),e.description&&(t+=`. ${e.description}`),t},getWidgetAriaLabel:()=>ove(0,"Select Box"),getRole:()=>"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new xBe(this.selectDropDownListContainer,"keydown")),i=zwe.chain(t.event).filter((()=>this.selectList.length>0)).map((e=>new KIe(e)));this._register(i.filter((e=>3===e.keyCode)).on((e=>this.onEnter(e)),this)),this._register(i.filter((e=>2===e.keyCode)).on((e=>this.onEnter(e)),this)),this._register(i.filter((e=>9===e.keyCode)).on((e=>this.onEscape(e)),this)),this._register(i.filter((e=>16===e.keyCode)).on((e=>this.onUpArrow(e)),this)),this._register(i.filter((e=>18===e.keyCode)).on((e=>this.onDownArrow(e)),this)),this._register(i.filter((e=>12===e.keyCode)).on(this.onPageDown,this)),this._register(i.filter((e=>11===e.keyCode)).on(this.onPageUp,this)),this._register(i.filter((e=>14===e.keyCode)).on(this.onHome,this)),this._register(i.filter((e=>13===e.keyCode)).on(this.onEnd,this)),this._register(i.filter((e=>e.keyCode>=21&&e.keyCode<=56||e.keyCode>=80&&e.keyCode<=108)).on(this.onCharacter,this)),this._register(tMe(this.selectList.getHTMLElement(),LMe.POINTER_UP,(e=>this.onPointerUp(e)))),this._register(this.selectList.onMouseOver((e=>void 0!==e.index&&this.selectList.setFocus([e.index])))),this._register(this.selectList.onDidChangeFocus((e=>this.onListFocus(e)))),this._register(tMe(this.selectDropDownContainer,LMe.FOCUS_OUT,(e=>{this._isVisible&&!mMe(e.relatedTarget,this.selectDropDownContainer)&&this.onListBlur()}))),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;DMe(e);const t=e.target;if(!t)return;if(t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const n=Number(i.getAttribute("data-index")),o=i.classList.contains("option-disabled");n>=0&&n<this.options.length&&!o&&(this.selected=n,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]),this.selected!==this._currentSelection&&(this._currentSelection=this.selected,this._onDidSelect.fire({index:this.selectElement.selectedIndex,selected:this.options[this.selected].text}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)),this.hideSelectDropDown(!0))}onListBlur(){this._sticky||(this.selected!==this._currentSelection&&this.select(this._currentSelection),this.hideSelectDropDown(!1))}renderDescriptionMarkdown(e,t){const i=e=>{for(let t=0;t<e.childNodes.length;t++){const n=e.childNodes.item(t);"img"===(n.tagName&&n.tagName.toLowerCase())?e.removeChild(n):i(n)}},n=function(e,t={},i={}){var n;const o=new Rwe;let s=!1;const r=LZe(t),a=function(t){let i;try{i=FZe(decodeURIComponent(t))}catch(e){}return i?(i=Tbe(i,(t=>e.uris&&e.uris[t]?QCe.revive(e.uris[t]):void 0)),encodeURIComponent(JSON.stringify(i))):t},l=function(t,i){const n=e.uris&&e.uris[t];let o=QCe.revive(n);return i?t.startsWith($Te.data+":")?t:(o||(o=QCe.parse(t)),YTe.uriToBrowserUri(o).toString(!0)):o?QCe.parse(t).toString()===o.toString()?t:(o.query&&(o=o.with({query:a(o.query)})),o.toString()):t},d=new PZe.Renderer;d.image=WZe.image,d.link=WZe.link,d.paragraph=WZe.paragraph;const h=[];if(t.codeBlockRenderer&&(d.code=(e,i)=>{const n=RZe.nextId(),o=t.codeBlockRenderer(function(e){if(!e)return"";const t=e.split(/[\s+|:|,|\{|\?]/,1);return t.length?t[0]:e}(i),e);return h.push(o.then((e=>[n,e]))),`<div class="code" data-code="${n}">${ySe(e)}</div>`}),t.actionHandler){const i=function(i){let n=i.target;if("A"===n.tagName||(n=n.parentElement,n&&"A"===n.tagName))try{let o=n.dataset.href;o&&(e.baseUri&&(o=VZe(QCe.from(e.baseUri),o)),t.actionHandler.callback(o,i))}catch(e){wwe(e)}finally{i.preventDefault()}},n=t.actionHandler.disposables.add(new xBe(r,"click")),o=t.actionHandler.disposables.add(new xBe(r,"auxclick"));t.actionHandler.disposables.add(zwe.any(n.event,o.event)((e=>{const t=new ZIe(e);(t.leftButton||t.middleButton)&&i(t)}))),t.actionHandler.disposables.add(tMe(r,"keydown",(e=>{const t=new KIe(e);(t.equals(10)||t.equals(3))&&i(t)})))}e.supportHtml||(i.sanitizer=t=>(e.isTrusted?t.match(/^(<span[^>]+>)|(<\/\s*span>)$/):void 0)?t:"",i.sanitize=!0,i.silent=!0),i.renderer=d;let c=null!==(n=e.value)&&void 0!==n?n:"";c.length>1e5&&(c=`${c.substr(0,1e5)}…`),e.supportThemeIcons&&(c=c.replace(gZe,(e=>`\\${e}`)));let u=PZe.parse(c,i);e.supportThemeIcons&&(u=TZe(u).map((e=>"string"==typeof e?e:e.outerHTML)).join(""));const g=(new DOMParser).parseFromString(HZe(e,u),"text/html");if(g.body.querySelectorAll("img").forEach((t=>{const i=t.getAttribute("src");if(i){let n=i;try{e.baseUri&&(n=VZe(QCe.from(e.baseUri),n))}catch(e){}t.src=l(n,!0)}})),g.body.querySelectorAll("a").forEach((t=>{const i=t.getAttribute("href");if(t.removeAttribute("href"),!i||/^data:|javascript:/i.test(i)||/^command:/i.test(i)&&!e.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(i))t.replaceWith(...t.childNodes);else{let n=l(i,!1);e.baseUri&&(n=VZe(QCe.from(e.baseUri),i)),t.dataset.href=n}})),r.innerHTML=HZe(e,g.body.innerHTML),h.length>0&&Promise.all(h).then((e=>{var i,n;if(s)return;const o=new Map(e),a=r.querySelectorAll("div[data-code]");for(const e of a){const t=o.get(null!==(i=e.dataset.code)&&void 0!==i?i:"");t&&TMe(e,t)}null===(n=t.asyncRenderCallback)||void 0===n||n.call(t)})),t.asyncRenderCallback)for(const e of r.getElementsByTagName("img")){const i=o.add(tMe(e,"load",(()=>{i.dispose(),t.asyncRenderCallback()})))}return{element:r,dispose:()=>{s=!0,o.dispose()}}}({value:e,supportThemeIcons:!0},{actionHandler:t});return n.element.classList.add("select-box-description-markdown"),i(n.element),n.element}onListFocus(e){this._isVisible&&this._hasDetails&&this.updateDetail(e.indexes[0])}updateDetail(e){var t,i;this.selectionDetailsPane.innerText="";const n=this.options[e],o=null!==(t=null==n?void 0:n.description)&&void 0!==t?t:"",s=null!==(i=null==n?void 0:n.descriptionIsMarkdown)&&void 0!==i&&i;if(o){if(s){const e=n.descriptionMarkdownActionHandler;this.selectionDetailsPane.appendChild(this.renderDescriptionMarkdown(o,e))}else this.selectionDetailsPane.innerText=o;this.selectionDetailsPane.style.display="block"}else this.selectionDetailsPane.style.display="none";this._skipLayout=!0,this.contextViewProvider.layout(),this._skipLayout=!1}onEscape(e){DMe(e),this.select(this._currentSelection),this.hideSelectDropDown(!0)}onEnter(e){DMe(e),this.selected!==this._currentSelection&&(this._currentSelection=this.selected,this._onDidSelect.fire({index:this.selectElement.selectedIndex,selected:this.options[this.selected].text}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)),this.hideSelectDropDown(!0)}onDownArrow(e){if(this.selected<this.options.length-1){DMe(e,!0);const t=this.options[this.selected+1].isDisabled;if(t&&this.options.length>this.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(DMe(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){DMe(e),this.selectList.focusPreviousPage(),setTimeout((()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected<this.options.length-1&&(this.selected++,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)}),1)}onPageDown(e){DMe(e),this.selectList.focusNextPage(),setTimeout((()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)}),1)}onHome(e){DMe(e),this.options.length<2||(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){DMe(e),this.options.length<2||(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=_Ce.toString(e.keyCode);let i=-1;for(let n=0;n<this.options.length-1;n++)if(i=(n+this.selected+1)%this.options.length,this.options[i].text.charAt(0).toUpperCase()===t&&!this.options[i].isDisabled){this.select(i),this.selectList.setFocus([i]),this.selectList.reveal(this.selectList.getFocus()[0]),DMe(e);break}}dispose(){this.hideSelectDropDown(!1),super.dispose()}}zYe.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN=32,zYe.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN=2,zYe.DEFAULT_MINIMUM_VISIBLE_OPTIONS=3;class UYe extends Owe{constructor(e,t,i,n){super(),this.selected=0,this.selectBoxOptions=n||Object.create(null),this.options=[],this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box","string"==typeof this.selectBoxOptions.ariaLabel&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),"string"==typeof this.selectBoxOptions.ariaDescription&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=this._register(new $we),this.styles=i,this.registerListeners(),this.setOptions(e,t)}registerListeners(){this._register(oRe.addTarget(this.selectElement)),[nRe.Tap].forEach((e=>{this._register(tMe(this.selectElement,e,(e=>{this.selectElement.focus()})))})),this._register(iMe(this.selectElement,"click",(e=>{DMe(e,!0)}))),this._register(iMe(this.selectElement,"change",(e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})}))),this._register(iMe(this.selectElement,"keydown",(e=>{let t=!1;Dve?18!==e.keyCode&&16!==e.keyCode&&10!==e.keyCode||(t=!0):(18===e.keyCode&&e.altKey||10===e.keyCode||3===e.keyCode)&&(t=!0),t&&e.stopPropagation()})))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){this.options&&tbe(this.options,e)||(this.options=e,this.selectElement.options.length=0,this.options.forEach(((e,t)=>{this.selectElement.add(this.createOption(e.text,t,e.isDisabled))}))),void 0!==t&&this.select(t)}select(e){0===this.options.length?this.selected=0:e>=0&&e<this.options.length?this.selected=e:e>this.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected<this.options.length&&"string"==typeof this.options[this.selected].text?this.selectElement.title=this.options[this.selected].text:this.selectElement.title=""}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){e.classList.add("select-container"),e.appendChild(this.selectElement),this.setOptions(this.options,this.selected),this.applyStyles()}applyStyles(){var e,t,i;this.selectElement&&(this.selectElement.style.backgroundColor=null!==(e=this.styles.selectBackground)&&void 0!==e?e:"",this.selectElement.style.color=null!==(t=this.styles.selectForeground)&&void 0!==t?t:"",this.selectElement.style.borderColor=null!==(i=this.styles.selectBorder)&&void 0!==i?i:"")}createOption(e,t,i){const n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}}var KYe=i(6312),jYe={};jYe.styleTagTransform=zl(),jYe.setAttributes=Bl(),jYe.insert=Pl().bind(null,"head"),jYe.domAPI=Rl(),jYe.insertStyleElement=Vl(),Ml()(KYe.A,jYe),KYe.A&&KYe.A.locals&&KYe.A.locals;class qYe extends QFe{constructor(e,t,i,n,o){super(),Dve&&!(null==o?void 0:o.useCustomDrawn)?this.selectBoxDelegate=new UYe(e,t,n,o):this.selectBoxDelegate=new zYe(e,t,i,n,o),this._register(this.selectBoxDelegate)}get onDidSelect(){return this.selectBoxDelegate.onDidSelect}setOptions(e,t){this.selectBoxDelegate.setOptions(e,t)}select(e){this.selectBoxDelegate.select(e)}focus(){this.selectBoxDelegate.focus()}blur(){this.selectBoxDelegate.blur()}setFocusable(e){this.selectBoxDelegate.setFocusable(e)}render(e){this.selectBoxDelegate.render(e)}}var $Ye=i(6288),GYe={};GYe.styleTagTransform=zl(),GYe.setAttributes=Bl(),GYe.insert=Pl().bind(null,"head"),GYe.domAPI=Rl(),GYe.insertStyleElement=Vl(),Ml()($Ye.A,GYe),$Ye.A&&$Ye.A.locals&&$Ye.A.locals;class ZYe extends Owe{get action(){return this._action}constructor(e,t,i={}){super(),this.options=i,this._context=e||this,this._action=t,t instanceof aAe&&this._register(t.onDidChange((e=>{this.element&&this.handleActionChangeEvent(e)})))}handleActionChangeEvent(e){void 0!==e.enabled&&this.updateEnabled(),void 0!==e.checked&&this.updateChecked(),void 0!==e.class&&this.updateClass(),void 0!==e.label&&(this.updateLabel(),this.updateTooltip()),void 0!==e.tooltip&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new lAe)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(oRe.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,bxe&&this._register(tMe(e,LMe.DRAG_START,(e=>{var t;return null===(t=e.dataTransfer)||void 0===t?void 0:t.setData(kGe.TEXT,this._action.label)})))),this._register(tMe(t,nRe.Tap,(e=>this.onClick(e,!0)))),this._register(tMe(t,LMe.MOUSE_DOWN,(e=>{i||DMe(e,!0),this._action.enabled&&0===e.button&&t.classList.add("active")}))),Dve&&this._register(tMe(t,LMe.CONTEXT_MENU,(e=>{0===e.button&&!0===e.ctrlKey&&this.onClick(e)}))),this._register(tMe(t,LMe.CLICK,(e=>{DMe(e,!0),this.options&&this.options.isMenu||this.onClick(e)}))),this._register(tMe(t,LMe.DBLCLICK,(e=>{DMe(e,!0)}))),[LMe.MOUSE_UP,LMe.MOUSE_OUT].forEach((e=>{this._register(tMe(t,e,(e=>{DMe(e),t.classList.remove("active")})))}))}onClick(e,t=!1){var i;DMe(e,!0);const n=xbe(this._context)?(null===(i=this.options)||void 0===i?void 0:i.useEventAsContext)?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,n)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getTooltip(){return this.action.tooltip}updateTooltip(){var e;if(!this.element)return;const t=null!==(e=this.getTooltip())&&void 0!==e?e:"";this.updateAriaLabel(),this.options.hoverDelegate?(this.element.title="",this.customHover?this.customHover.update(t):(this.customHover=xZe(this.options.hoverDelegate,this.element,t),this._store.add(this.customHover))):this.element.title=t}updateAriaLabel(){var e;if(this.element){const t=null!==(e=this.getTooltip())&&void 0!==e?e:"";this.element.setAttribute("aria-label",t)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class YYe extends ZYe{constructor(e,t,i){super(e,t,i),this.options=i,this.options.icon=void 0!==i.icon&&i.icon,this.options.label=void 0===i.label||i.label,this.cssClass=""}render(e){super.render(e),this.element&&(this.label=IMe(this.element,OMe("a.action-label"))),this.label&&(this._action.id===dAe.ID?this.label.setAttribute("role","presentation"):this.options.isMenu?this.label.setAttribute("role","menuitem"):this.label.setAttribute("role","button")),this.options.label&&this.options.keybinding&&this.element&&(IMe(this.element,OMe("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:!this.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=ove(0,"{0} ({1})",e,this.options.keybinding))),null!=e?e:void 0}updateClass(){var e;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.action.class,this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):null===(e=this.label)||void 0===e||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),null===(e=this.element)||void 0===e||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),null===(t=this.element)||void 0===t||t.classList.add("disabled"))}updateAriaLabel(){var e;if(this.label){const t=null!==(e=this.getTooltip())&&void 0!==e?e:"";this.label.setAttribute("aria-label",t)}}updateChecked(){this.label&&(this.action.checked?this.label.classList.add("checked"):this.label.classList.remove("checked"))}}class QYe extends ZYe{constructor(e,t,i,n,o,s,r){super(e,t),this.selectBox=new qYe(i,n,o,s,r),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect((e=>this.runAction(e.selected,e.index))))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){var e;null===(e=this.selectBox)||void 0===e||e.focus()}blur(){var e;null===(e=this.selectBox)||void 0===e||e.blur()}render(e){this.selectBox.render(e)}}var XYe,JYe;class eQe extends Owe{constructor(e,t={}){var i,n,o,s,r,a;let l,d;switch(super(),this._actionRunnerDisposables=this._register(new Rwe),this.viewItemDisposables=this._register(new Wwe),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new $we),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new $we({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new $we),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new $we),this.onWillRun=this._onWillRun.event,this.options=t,this._context=null!==(i=t.context)&&void 0!==i?i:null,this._orientation=null!==(n=this.options.orientation)&&void 0!==n?n:0,this._triggerKeys={keyDown:null!==(s=null===(o=this.options.triggerKeys)||void 0===o?void 0:o.keyDown)&&void 0!==s&&s,keys:null!==(a=null===(r=this.options.triggerKeys)||void 0===r?void 0:r.keys)&&void 0!==a?a:[3,10]},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new lAe,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun((e=>this._onDidRun.fire(e)))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun((e=>this._onWillRun.fire(e)))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",!1!==t.animated&&this.domNode.classList.add("animated"),this._orientation){case 0:l=[15],d=[17];break;case 1:l=[16],d=[18],this.domNode.className+=" vertical"}this._register(tMe(this.domNode,LMe.KEY_DOWN,(e=>{const t=new KIe(e);let i=!0;const n="number"==typeof this.focusedItem?this.viewItems[this.focusedItem]:void 0;l&&(t.equals(l[0])||t.equals(l[1]))?i=this.focusPrevious():d&&(t.equals(d[0])||t.equals(d[1]))?i=this.focusNext():t.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():t.equals(14)?i=this.focusFirst():t.equals(13)?i=this.focusLast():t.equals(2)&&n instanceof ZYe&&n.trapsArrowNavigation?i=this.focusNext():this.isTriggerKeyEvent(t)?this._triggerKeys.keyDown?this.doTrigger(t):this.triggerKeyDown=!0:i=!1,i&&(t.preventDefault(),t.stopPropagation())}))),this._register(tMe(this.domNode,LMe.KEY_UP,(e=>{const t=new KIe(e);this.isTriggerKeyEvent(t)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(t)),t.preventDefault(),t.stopPropagation()):(t.equals(2)||t.equals(1026))&&this.updateFocusedItem()}))),this.focusTracker=this._register(NMe(this.domNode)),this._register(this.focusTracker.onDidBlur((()=>{CMe()!==this.domNode&&mMe(CMe(),this.domNode)||(this._onDidBlur.fire(),this.focusedItem=void 0,this.previouslyFocusedItem=void 0,this.triggerKeyDown=!1)}))),this._register(this.focusTracker.onDidFocus((()=>this.updateFocusedItem()))),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=2?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const e=this.viewItems.find((e=>e instanceof ZYe&&e.isEnabled()));e instanceof ZYe&&e.setFocusable(!0)}else this.viewItems.forEach((e=>{e instanceof ZYe&&e.setFocusable(!1)}))}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach((i=>{t=t||e.equals(i)})),t}updateFocusedItem(){for(let e=0;e<this.actionsList.children.length;e++){const t=this.actionsList.children[e];if(mMe(CMe(),t)){this.focusedItem=e;break}}}get context(){return this._context}set context(e){this._context=e,this.viewItems.forEach((t=>t.setActionContext(e)))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun((e=>this._onDidRun.fire(e)))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun((e=>this._onWillRun.fire(e)))),this.viewItems.forEach((t=>t.actionRunner=e))}getContainer(){return this.domNode}getAction(e){var t;if("number"==typeof e)return null===(t=this.viewItems[e])||void 0===t?void 0:t.action;if(e instanceof HTMLElement){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let t=0;t<this.actionsList.childNodes.length;t++)if(this.actionsList.childNodes[t]===e)return this.viewItems[t].action}}push(e,t={}){const i=Array.isArray(e)?e:[e];let n=bbe(t.index)?t.index:null;i.forEach((e=>{const i=document.createElement("li");let o;i.className="action-item",i.setAttribute("role","presentation");const s=Object.assign({hoverDelegate:this.options.hoverDelegate},t);this.options.actionViewItemProvider&&(o=this.options.actionViewItemProvider(e,s)),o||(o=new YYe(this.context,e,s)),this.options.allowContextMenu||this.viewItemDisposables.set(o,tMe(i,LMe.CONTEXT_MENU,(e=>{DMe(e,!0)}))),o.actionRunner=this._actionRunner,o.setActionContext(this.context),o.render(i),this.focusable&&o instanceof ZYe&&0===this.viewItems.length&&o.setFocusable(!0),null===n||n<0||n>=this.actionsList.children.length?(this.actionsList.appendChild(i),this.viewItems.push(o)):(this.actionsList.insertBefore(i,this.actionsList.children[n]),this.viewItems.splice(n,0,o),n++)})),"number"==typeof this.focusedItem&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=Twe(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),XTe(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return 0===this.viewItems.length}focus(e){let t,i=!1;if(void 0===e?i=!0:"number"==typeof e?t=e:"boolean"==typeof e&&(i=e),i&&void 0===this.focusedItem){const e=this.viewItems.findIndex((e=>e.isEnabled()));this.focusedItem=-1===e?void 0:e,this.updateFocus(void 0,void 0,!0)}else void 0!==t&&(this.focusedItem=t),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e){if(void 0===this.focusedItem)this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=t,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===dAe.ID));return this.updateFocus(),!0}focusPrevious(e){if(void 0===this.focusedItem)this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===dAe.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){var n;void 0===this.focusedItem&&this.actionsList.focus({preventScroll:t}),void 0!==this.previouslyFocusedItem&&this.previouslyFocusedItem!==this.focusedItem&&(null===(n=this.viewItems[this.previouslyFocusedItem])||void 0===n||n.blur());const o=void 0!==this.focusedItem&&this.viewItems[this.focusedItem];if(o){let n=!0;Lbe(o.focus)||(n=!1),this.options.focusOnlyEnabledItems&&Lbe(o.isEnabled)&&!o.isEnabled()&&(n=!1),o.action.id===dAe.ID&&(n=!1),n?(i||this.previouslyFocusedItem!==this.focusedItem)&&(o.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0)}}doTrigger(e){if(void 0===this.focusedItem)return;const t=this.viewItems[this.focusedItem];if(t instanceof ZYe){const i=null===t._context||void 0===t._context?e:t._context;this.run(t._action,i)}}run(e,t){return i=this,n=void 0,s=function*(){yield this._actionRunner.run(e,t)},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o((function(e){e(i)}))).then(r,a)}l((s=s.apply(i,n||[])).next())}));var i,n,o,s}dispose(){this._context=void 0,this.viewItems=Twe(this.viewItems),this.getContainer().remove(),super.dispose()}}!function(e){e.getDefinition=function(e,t){let i=e.defaults;for(;sAe.isThemeIcon(i);){const e=tQe.getIcon(i.id);if(!e)return;i=e.defaults}return i}}(XYe||(XYe={})),function(e){e.toJSONObject=function(e){return{weight:e.weight,style:e.style,src:e.src.map((e=>({format:e.format,location:e.location.toString()})))}},e.fromJSONObject=function(e){const t=e=>fbe(e)?e:void 0;if(e&&Array.isArray(e.src)&&e.src.every((e=>fbe(e.format)&&fbe(e.location))))return{weight:t(e.weight),style:t(e.style),src:e.src.map((e=>({format:e.format,location:QCe.parse(e.location)})))}}}(JYe||(JYe={}));const tQe=new class{constructor(){this._onDidChange=new $we,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:ove(0,"The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:ove(0,"The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${sAe.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,n){const o=this.iconsById[e];if(o){if(i&&!o.description){o.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const t=this.iconReferenceSchema.enum.indexOf(e);-1!==t&&(this.iconReferenceSchema.enumDescriptions[t]=i),this._onDidChange.fire()}return o}const s={id:e,description:i,defaults:t,deprecationMessage:n};this.iconsById[e]=s;const r={$ref:"#/definitions/icons"};return n&&(r.deprecationMessage=n),i&&(r.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=r,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map((e=>this.iconsById[e]))}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(e,t)=>e.id.localeCompare(t.id),t=e=>{for(;sAe.isThemeIcon(e.defaults);)e=this.iconsById[e.defaults.id];return`codicon codicon-${e?e.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const n=Object.keys(this.iconsById).map((e=>this.iconsById[e]));for(const o of n.filter((e=>!!e.description)).sort(e))i.push(`|<i class="${t(o)}"></i>|${o.id}|${sAe.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of n.filter((e=>!sAe.isThemeIcon(e.defaults))).sort(e))i.push(`|<i class="${t(o)}"></i>|${o.id}|`);return i.join("\n")}};function iQe(e,t,i,n){return tQe.registerIcon(e,t,i,n)}function nQe(){return tQe}RLe.add("base.contributions.icons",tQe),function(){const e=gye();for(const t in e){const i="\\"+e[t].toString(16);tQe.registerIcon(t,{fontCharacter:i})}}();const oQe="vscode://schemas/icons",sQe=RLe.as(PLe);sQe.registerSchema(oQe,tQe.getIconSchema());const rQe=new FDe((()=>sQe.notifySchemaChanged(oQe)),200);tQe.onDidChange((()=>{rQe.isScheduled()||rQe.schedule()})),iQe("widget-close",pye.close,ove(0,"Icon for the close action in widgets.")),iQe("goto-previous-location",pye.arrowUp,ove(0,"Icon for goto previous editor location.")),iQe("goto-next-location",pye.arrowDown,ove(0,"Icon for goto next editor location.")),sAe.modify(pye.sync,"spin"),sAe.modify(pye.loading,"spin");var aQe,lQe=function(e,t){return function(i,n){t(i,n,e)}};class dQe{constructor(e,t,i,n){this.originalLineStart=e,this.originalLineEnd=t,this.modifiedLineStart=i,this.modifiedLineEnd=n}getType(){return 0===this.originalLineStart?1:0===this.modifiedLineStart?2:0}}class hQe{constructor(e){this.entries=e}}const cQe=iQe("diff-review-insert",pye.add,ove(0,"Icon for 'Insert' in diff review.")),uQe=iQe("diff-review-remove",pye.remove,ove(0,"Icon for 'Remove' in diff review.")),gQe=iQe("diff-review-close",pye.close,ove(0,"Icon for 'Close' in diff review."));let pQe=class e extends Owe{constructor(e,t,i){super(),this._languageService=t,this._audioCueService=i,this._width=0,this._diffEditor=e,this._isVisible=!1,this.shadow=Ixe(document.createElement("div")),this.shadow.setClassName("diff-review-shadow"),this.actionBarContainer=Ixe(document.createElement("div")),this.actionBarContainer.setClassName("diff-review-actions"),this._actionBar=this._register(new eQe(this.actionBarContainer.domNode)),this._actionBar.push(new aAe("diffreview.close",ove(0,"Close"),"close-diff-review "+sAe.asClassName(gQe),!0,(()=>{return e=this,t=void 0,n=function*(){return this.hide()},new((i=void 0)||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}));var e,t,i,n})),{label:!1,icon:!0}),this.domNode=Ixe(document.createElement("div")),this.domNode.setClassName("diff-review monaco-editor-background"),this._content=Ixe(document.createElement("div")),this._content.setClassName("diff-review-content"),this._content.setAttribute("role","code"),this.scrollbar=this._register(new vBe(this._content.domNode,{})),this.domNode.domNode.appendChild(this.scrollbar.getDomNode()),this._register(e.onDidUpdateDiff((()=>{this._isVisible&&(this._diffs=this._compute(),this._render())}))),this._register(e.getModifiedEditor().onDidChangeCursorPosition((()=>{this._isVisible&&this._render()}))),this._register(iMe(this.domNode.domNode,"click",(e=>{e.preventDefault();const t=fMe(e.target,"diff-review-row");t&&this._goToRow(t)}))),this._register(iMe(this.domNode.domNode,"keydown",(e=>{(e.equals(18)||e.equals(2066)||e.equals(530))&&(e.preventDefault(),this._goToRow(this._getNextRow(),"next")),(e.equals(16)||e.equals(2064)||e.equals(528))&&(e.preventDefault(),this._goToRow(this._getPrevRow(),"previous")),(e.equals(9)||e.equals(2057)||e.equals(521)||e.equals(1033)||e.equals(10)||e.equals(3))&&(e.preventDefault(),this.accept())}))),this._diffs=[],this._currentDiff=null}prev(){let e=0;if(this._isVisible||(this._diffs=this._compute()),this._isVisible){let t=-1;for(let e=0,i=this._diffs.length;e<i;e++)if(this._diffs[e]===this._currentDiff){t=e;break}e=this._diffs.length+t-1}else e=this._findDiffIndex(this._diffEditor.getPosition());if(0===this._diffs.length)return;e%=this._diffs.length;const t=this._diffs[e].entries;this._diffEditor.setPosition(new lye(t[0].modifiedLineStart,1)),this._diffEditor.setSelection({startColumn:1,startLineNumber:t[0].modifiedLineStart,endColumn:1073741824,endLineNumber:t[t.length-1].modifiedLineEnd}),this._isVisible=!0,this._diffEditor.doLayout(),this._render(),this._goToRow(this._getPrevRow(),"previous")}next(){let e=0;if(this._isVisible||(this._diffs=this._compute()),this._isVisible){let t=-1;for(let e=0,i=this._diffs.length;e<i;e++)if(this._diffs[e]===this._currentDiff){t=e;break}e=t+1}else e=this._findDiffIndex(this._diffEditor.getPosition());if(0===this._diffs.length)return;e%=this._diffs.length;const t=this._diffs[e].entries;this._diffEditor.setPosition(new lye(t[0].modifiedLineStart,1)),this._diffEditor.setSelection({startColumn:1,startLineNumber:t[0].modifiedLineStart,endColumn:1073741824,endLineNumber:t[t.length-1].modifiedLineEnd}),this._isVisible=!0,this._diffEditor.doLayout(),this._render(),this._goToRow(this._getNextRow(),"next")}accept(){let e=-1;const t=this._getCurrentFocusedRow();if(t){const i=parseInt(t.getAttribute("data-line"),10);isNaN(i)||(e=i)}this.hide(),-1!==e&&(this._diffEditor.setPosition(new lye(e,1)),this._diffEditor.revealPosition(new lye(e,1),1))}hide(){this._isVisible=!1,this._diffEditor.updateOptions({readOnly:!1}),this._diffEditor.focus(),this._diffEditor.doLayout(),this._render()}_getPrevRow(){const e=this._getCurrentFocusedRow();return e?e.previousElementSibling?e.previousElementSibling:e:this._getFirstRow()}_getNextRow(){const e=this._getCurrentFocusedRow();return e?e.nextElementSibling?e.nextElementSibling:e:this._getFirstRow()}_getFirstRow(){return this.domNode.domNode.querySelector(".diff-review-row")}_getCurrentFocusedRow(){const e=document.activeElement;return e&&/diff-review-row/.test(e.className)?e:null}_goToRow(e,t){const i=this._getCurrentFocusedRow();e.tabIndex=0,e.focus(),i&&i!==e&&(i.tabIndex=-1);const n=t?"next"===t?null==i?void 0:i.nextElementSibling:null==i?void 0:i.previousElementSibling:i;(null==n?void 0:n.classList.contains("line-insert"))?this._audioCueService.playAudioCue(Yxe.diffLineInserted,!0):(null==n?void 0:n.classList.contains("line-delete"))&&this._audioCueService.playAudioCue(Yxe.diffLineDeleted,!0),this.scrollbar.scanDomNode()}isVisible(){return this._isVisible}layout(e,t,i){this._width=t,this.shadow.setTop(e-6),this.shadow.setWidth(t),this.shadow.setHeight(this._isVisible?6:0),this.domNode.setTop(e),this.domNode.setWidth(t),this.domNode.setHeight(i),this._content.setHeight(i),this._content.setWidth(t),this._isVisible?(this.actionBarContainer.setAttribute("aria-hidden","false"),this.actionBarContainer.setDisplay("block")):(this.actionBarContainer.setAttribute("aria-hidden","true"),this.actionBarContainer.setDisplay("none"))}_compute(){const t=this._diffEditor.getLineChanges();if(!t||0===t.length)return[];const i=this._diffEditor.getOriginalEditor().getModel(),n=this._diffEditor.getModifiedEditor().getModel();return i&&n?e._mergeAdjacent(t,i.getLineCount(),n.getLineCount()):[]}static _mergeAdjacent(e,t,i){if(!e||0===e.length)return[];const n=[];let o=0;for(let s=0,r=e.length;s<r;s++){const a=e[s],l=a.originalStartLineNumber,d=a.originalEndLineNumber,h=a.modifiedStartLineNumber,c=a.modifiedEndLineNumber,u=[];let g=0;{const t=0===d?l:l-1,i=0===c?h:h-1;let n=1,o=1;if(s>0){const t=e[s-1];n=0===t.originalEndLineNumber?t.originalStartLineNumber+1:t.originalEndLineNumber+1,o=0===t.modifiedEndLineNumber?t.modifiedStartLineNumber+1:t.modifiedEndLineNumber+1}let r=t-3+1,a=i-3+1;if(r<n){const e=n-r;r+=e,a+=e}if(a<o){const e=o-a;r+=e,a+=e}u[g++]=new dQe(r,t,a,i)}0!==d&&(u[g++]=new dQe(l,d,0,0)),0!==c&&(u[g++]=new dQe(0,0,h,c));{const n=0===d?l+1:d+1,o=0===c?h+1:c+1;let a=t,p=i;if(s+1<r){const t=e[s+1];a=0===t.originalEndLineNumber?t.originalStartLineNumber:t.originalStartLineNumber-1,p=0===t.modifiedEndLineNumber?t.modifiedStartLineNumber:t.modifiedStartLineNumber-1}let m=n+3-1,f=o+3-1;if(m>a){const e=a-m;m+=e,f+=e}if(f>p){const e=p-f;m+=e,f+=e}u[g++]=new dQe(n,m,o,f)}n[o++]=new hQe(u)}let s=n[0].entries;const r=[];let a=0;for(let e=1,t=n.length;e<t;e++){const t=n[e].entries,i=s[s.length-1],o=t[0];0===i.getType()&&0===o.getType()&&o.originalLineStart<=i.originalLineEnd?(s[s.length-1]=new dQe(i.originalLineStart,o.originalLineEnd,i.modifiedLineStart,o.modifiedLineEnd),s=s.concat(t.slice(1))):(r[a++]=new hQe(s),s=t)}return r[a++]=new hQe(s),r}_findDiffIndex(e){const t=e.lineNumber;for(let e=0,i=this._diffs.length;e<i;e++){const i=this._diffs[e].entries;if(t<=i[i.length-1].modifiedLineEnd)return e}return 0}_render(){const t=this._diffEditor.getOriginalEditor().getOptions(),i=this._diffEditor.getModifiedEditor().getOptions(),n=this._diffEditor.getOriginalEditor().getModel(),o=this._diffEditor.getModifiedEditor().getModel(),s=n.getOptions(),r=o.getOptions();if(!this._isVisible||!n||!o)return XTe(this._content.domNode),this._currentDiff=null,void this.scrollbar.scanDomNode();this._diffEditor.updateOptions({readOnly:!0});const a=this._findDiffIndex(this._diffEditor.getPosition());if(this._diffs[a]===this._currentDiff)return;this._currentDiff=this._diffs[a];const l=this._diffs[a].entries,d=document.createElement("div");d.className="diff-review-table",d.setAttribute("role","list"),d.setAttribute("aria-label",'Difference review. Use "Stage | Unstage | Revert Selected Ranges" commands'),Txe(d,i.get(47));let h=0,c=0,u=0,g=0;for(let e=0,t=l.length;e<t;e++){const t=l[e],i=t.originalLineStart,n=t.originalLineEnd,o=t.modifiedLineStart,s=t.modifiedLineEnd;0!==i&&(0===h||i<h)&&(h=i),0!==n&&(0===c||n>c)&&(c=n),0!==o&&(0===u||o<u)&&(u=o),0!==s&&(0===g||s>g)&&(g=s)}const p=document.createElement("div");p.className="diff-review-row";const m=document.createElement("div");m.className="diff-review-cell diff-review-summary";const f=c-h+1,_=g-u+1;m.appendChild(document.createTextNode(`${a+1}/${this._diffs.length}: @@ -${h},${f} +${u},${_} @@`)),p.setAttribute("data-line",String(u));const v=e=>0===e?ove(0,"no lines changed"):1===e?ove(0,"1 line changed"):ove(0,"{0} lines changed",e),b=v(f),w=v(_);p.setAttribute("aria-label",ove(0,"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",a+1,this._diffs.length,h,b,u,w)),p.appendChild(m),p.setAttribute("role","listitem"),d.appendChild(p);const C=i.get(63);let y=u;for(let a=0,h=l.length;a<h;a++){const h=l[a];e._renderSection(d,h,y,C,this._width,t,n,s,i,o,r,this._languageService.languageIdCodec),0!==h.modifiedLineStart&&(y=h.modifiedLineEnd)}XTe(this._content.domNode),this._content.domNode.appendChild(d),this.scrollbar.scanDomNode()}static _renderSection(t,i,n,o,s,r,a,l,d,h,c,u){const g=i.getType();let p="diff-review-row",m="",f=null;switch(g){case 1:p="diff-review-row line-insert",m=" char-insert",f=cQe;break;case 2:p="diff-review-row line-delete",m=" char-delete",f=uQe}const _=i.originalLineStart,v=i.originalLineEnd,b=i.modifiedLineStart,w=i.modifiedLineEnd,C=Math.max(w-b,v-_),y=r.get(138),S=y.glyphMarginWidth+y.lineNumbersWidth,x=d.get(138),k=10+x.glyphMarginWidth+x.lineNumbersWidth;for(let i=0;i<=C;i++){const v=0===_?0:_+i,w=0===b?0:b+i,C=document.createElement("div");C.style.minWidth=s+"px",C.className=p,C.setAttribute("role","listitem"),0!==w&&(n=w),C.setAttribute("data-line",String(n));const y=document.createElement("div");y.className="diff-review-cell",y.style.height=`${o}px`,C.appendChild(y);const x=document.createElement("span");x.style.width=S+"px",x.style.minWidth=S+"px",x.className="diff-review-line-number"+m,0!==v?x.appendChild(document.createTextNode(String(v))):x.innerText=" ",y.appendChild(x);const L=document.createElement("span");L.style.width=k+"px",L.style.minWidth=k+"px",L.style.paddingRight="10px",L.className="diff-review-line-number"+m,0!==w?L.appendChild(document.createTextNode(String(w))):L.innerText=" ",y.appendChild(L);const D=document.createElement("span");if(D.className="diff-review-spacer",f){const e=document.createElement("span");e.className=sAe.asClassName(f),e.innerText=" ",D.appendChild(e)}else D.innerText=" ";let E;if(y.appendChild(D),0!==w){let t=this._renderLine(h,d,c.tabSize,w,u);e._ttPolicy&&(t=e._ttPolicy.createHTML(t)),y.insertAdjacentHTML("beforeend",t),E=h.getLineContent(w)}else{let t=this._renderLine(a,r,l.tabSize,v,u);e._ttPolicy&&(t=e._ttPolicy.createHTML(t)),y.insertAdjacentHTML("beforeend",t),E=a.getLineContent(v)}0===E.length&&(E=ove(0,"blank"));let N="";switch(g){case 0:N=v===w?ove(0,"{0} unchanged line {1}",E,v):ove(0,"{0} original line {1} modified line {2}",E,v,w);break;case 1:N=ove(0,"+ {0} modified line {1}",E,w);break;case 2:N=ove(0,"- {0} original line {1}",E,v)}C.setAttribute("aria-label",N),t.appendChild(C)}}static _renderLine(e,t,i,n,o){const s=e.getLineContent(n),r=t.get(47),a=HNe.createEmpty(s,o),l=lIe.isBasicASCII(s,e.mightContainNonBasicASCII()),d=lIe.containsRTL(s,l,e.mightContainRTL());return tIe(new ZNe(r.isMonospace&&!t.get(30),r.canUseHalfwidthRightwardsArrow,s,!1,l,d,0,a,[],i,0,r.spaceWidth,r.middotWidth,r.wsmiddotWidth,t.get(111),t.get(93),t.get(88),t.get(48)!==ewe.OFF,null)).html}};function mQe(e){const t=e.get(Uxe),i=t.listDiffEditors(),n=t.getActiveCodeEditor();if(!n)return null;for(let e=0,t=i.length;e<t;e++){const t=i[e];if(t.getModifiedEditor().getId()===n.getId()||t.getOriginalEditor().getId()===n.getId())return t}return null}pQe._ttPolicy=null===(aQe=window.trustedTypes)||void 0===aQe?void 0:aQe.createPolicy("diffReview",{createHTML:e=>e}),pQe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([lQe(1,NLe),lQe(2,Gxe)],pQe),AAe(class extends TAe{constructor(){super({id:"editor.action.diffReview.next",label:ove(0,"Go to Next Difference"),alias:"Go to Next Difference",precondition:Jxe.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:65,weight:100}})}run(e,t){const i=mQe(e);null==i||i.diffReviewNext()}}),AAe(class extends TAe{constructor(){super({id:"editor.action.diffReview.prev",label:ove(0,"Go to Previous Difference"),alias:"Go to Previous Difference",precondition:Jxe.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:1089,weight:100}})}run(e,t){const i=mQe(e);null==i||i.diffReviewPrev()}});var fQe=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class _Qe extends Owe{get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}constructor(e,t,i,n,o,s){super(),this._viewZoneId=e,this._marginDomNode=t,this.editor=i,this.diff=n,this._contextMenuService=o,this._clipboardService=s,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=sAe.asClassName(pye.lightBulb)+" lightbulb-glyph",this._diffActions.style.position="absolute";const r=i.getOption(63),a=i.getModel().getEOL();this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=`${r}px`,this._diffActions.style.lineHeight=`${r}px`,this._marginDomNode.appendChild(this._diffActions);const l=[],d=0===n.modifiedEndLineNumber;l.push(new aAe("diff.clipboard.copyDeletedContent",d?n.originalEndLineNumber>n.modifiedStartLineNumber?ove(0,"Copy deleted lines"):ove(0,"Copy deleted line"):n.originalEndLineNumber>n.modifiedStartLineNumber?ove(0,"Copy changed lines"):ove(0,"Copy changed line"),void 0,!0,(()=>fQe(this,void 0,void 0,(function*(){const e=new dye(n.originalStartLineNumber,1,n.originalEndLineNumber+1,1),t=n.originalModel.getValueInRange(e);yield this._clipboardService.writeText(t)})))));let h,c=0;n.originalEndLineNumber>n.modifiedStartLineNumber&&(h=new aAe("diff.clipboard.copyDeletedLineContent",ove(0,d?"Copy deleted line ({0})":"Copy changed line ({0})",n.originalStartLineNumber),void 0,!0,(()=>fQe(this,void 0,void 0,(function*(){const e=n.originalModel.getLineContent(n.originalStartLineNumber+c);if(""===e){const e=n.originalModel.getEndOfLineSequence();yield this._clipboardService.writeText(0===e?"\n":"\r\n")}else yield this._clipboardService.writeText(e)})))),l.push(h)),i.getOption(86)||l.push(new aAe("diff.inline.revertChange",ove(0,"Revert this change"),void 0,!0,(()=>fQe(this,void 0,void 0,(function*(){const e=new dye(n.originalStartLineNumber,1,n.originalEndLineNumber,n.originalModel.getLineMaxColumn(n.originalEndLineNumber)),t=n.originalModel.getValueInRange(e);if(0===n.modifiedEndLineNumber){const e=i.getModel().getLineMaxColumn(n.modifiedStartLineNumber);i.executeEdits("diffEditor",[{range:new dye(n.modifiedStartLineNumber,e,n.modifiedStartLineNumber,e),text:a+t}])}else{const e=i.getModel().getLineMaxColumn(n.modifiedEndLineNumber);i.executeEdits("diffEditor",[{range:new dye(n.modifiedStartLineNumber,1,n.modifiedEndLineNumber,e),text:t}])}})))));const u=(e,t)=>{this._contextMenuService.showContextMenu({getAnchor:()=>({x:e,y:t}),getActions:()=>(h&&(h.label=ove(0,d?"Copy deleted line ({0})":"Copy changed line ({0})",n.originalStartLineNumber+c)),l),autoSelectFirstItem:!0})};this._register(iMe(this._diffActions,"mousedown",(e=>{const{top:t,height:i}=hMe(this._diffActions),n=Math.floor(r/3);e.preventDefault(),u(e.posx,t+i+n)}))),this._register(i.onMouseMove((e=>{(8===e.target.type||5===e.target.type)&&e.target.detail.viewZoneId===this._viewZoneId?(this.visibility=!0,c=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,r)):this.visibility=!1}))),this._register(i.onMouseDown((e=>{!e.event.rightButton||8!==e.target.type&&5!==e.target.type||e.target.detail.viewZoneId===this._viewZoneId&&(e.event.preventDefault(),c=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,r),u(e.event.posx,e.event.posy+r))})))}_updateLightBulbPosition(e,t,i){const{top:n}=hMe(e),o=t-n,s=Math.floor(o/i),r=s*i;if(this._diffActions.style.top=`${r}px`,this.diff.viewLineCounts){let e=0;for(let t=0;t<this.diff.viewLineCounts.length;t++)if(e+=this.diff.viewLineCounts[t],s<e)return t}return s}}const vQe=zxe("editorWorkerService");let bQe=class{constructor(e,t){this.editorWorkerService=t,this.onDidChangeEventEmitter=new $we,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="smart",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;null===(e=this.diffAlgorithmOnDidChangeSubscription)||void 0===e||e.dispose()}computeDiff(e,t,i){return n=this,o=void 0,r=function*(){if("string"!=typeof this.diffAlgorithm)return this.diffAlgorithm.computeDiff(e,t,i);const n=yield this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm);if(!n)throw new Error("no diff result available");return n},new((s=void 0)||(s=Promise))((function(e,t){function i(e){try{l(r.next(e))}catch(e){t(e)}}function a(e){try{l(r.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof s?n:new s((function(e){e(n)}))).then(i,a)}l((r=r.apply(n,o||[])).next())}));var n,o,s,r}setOptions(e){var t;let i=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&(null===(t=this.diffAlgorithmOnDidChangeSubscription)||void 0===t||t.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,"string"!=typeof e.diffAlgorithm&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange((()=>this.onDidChangeEventEmitter.fire()))),i=!0),i&&this.onDidChangeEventEmitter.fire()}};bQe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,vQe)],bQe);const wQe=zxe("clipboardService"),CQe=zxe("contextViewService"),yQe=zxe("contextMenuService"),SQe=zxe("progressService");Object.freeze({total(){},worked(){},done(){}}),Object.freeze({report(){}});const xQe=zxe("editorProgressService");var kQe,LQe=function(e,t){return function(i,n){t(i,n,e)}};class DQe{constructor(e,t){this._contextMenuService=e,this._clipboardService=t,this._zones=[],this._inlineDiffMargins=[],this._zonesMap={},this._decorations=[]}getForeignViewZones(e){return e.filter((e=>!this._zonesMap[String(e.id)]))}clean(e){this._zones.length>0&&e.changeViewZones((e=>{for(const t of this._zones)e.removeZone(t)})),this._zones=[],this._zonesMap={},e.changeDecorations((e=>{this._decorations=e.deltaDecorations(this._decorations,[])}))}apply(e,t,i,n){const o=n?yGe.capture(e):null;e.changeViewZones((t=>{var n;for(const e of this._zones)t.removeZone(e);for(const e of this._inlineDiffMargins)e.dispose();this._zones=[],this._zonesMap={},this._inlineDiffMargins=[];for(let o=0,s=i.zones.length;o<s;o++){const s=i.zones[o];s.suppressMouseDown=!0;const r=t.addZone(s);this._zones.push(r),this._zonesMap[String(r)]=!0,i.zones[o].diff&&s.marginDomNode&&(s.suppressMouseDown=!1,0!==(null===(n=i.zones[o].diff)||void 0===n?void 0:n.originalModel.getValueLength())&&this._inlineDiffMargins.push(new _Qe(r,s.marginDomNode,e,i.zones[o].diff,this._contextMenuService,this._clipboardService)))}})),null==o||o.restore(e),e.changeDecorations((e=>{this._decorations=e.deltaDecorations(this._decorations,i.decorations)})),null==t||t.setZones(i.overviewZones)}}let EQe=0;const NQe=iQe("diff-insert",pye.add,ove(0,"Line decoration for inserts in the diff editor.")),IQe=iQe("diff-remove",pye.remove,ove(0,"Line decoration for removals in the diff editor.")),TQe=null===(kQe=window.trustedTypes)||void 0===kQe?void 0:kQe.createPolicy("diffEditorWidget",{createHTML:e=>e}),MQe=ove(0," use Shift + F7 to navigate changes");let AQe=class e extends Owe{constructor(t,i,n,o,s,r,a,l,d,h,c){super(),this._editorProgressService=c,this._onDidDispose=this._register(new $we),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModel=this._register(new $we),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidUpdateDiff=this._register(new $we),this.onDidUpdateDiff=this._onDidUpdateDiff.event,this._onDidContentSizeChange=this._register(new $we),this._lastOriginalWarning=null,this._lastModifiedWarning=null,this._documentDiffProvider=this._register(r.createInstance(bQe,i)),this._register(this._documentDiffProvider.onDidChange((e=>this._beginUpdateDecorationsSoon()))),this._codeEditorService=a,this._contextKeyService=this._register(s.createScoped(t)),this._instantiationService=r.createChild(new C$e([wke,this._contextKeyService])),this._contextKeyService.createKey("isInDiffEditor",!0),this._themeService=l,this._notificationService=d,this._id=++EQe,this._state=0,this._updatingDiffProgress=null,this._domElement=t,i=i||{},this._options=YQe(i,{enableSplitViewResizing:!0,renderSideBySide:!0,renderMarginRevertIcon:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"smart"}),void 0!==i.isInEmbeddedEditor?this._contextKeyService.createKey("isInEmbeddedDiffEditor",i.isInEmbeddedEditor):this._contextKeyService.createKey("isInEmbeddedDiffEditor",!1),this._updateDecorationsRunner=this._register(new FDe((()=>this._updateDecorations()),0)),this._containerDomElement=document.createElement("div"),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide),this._containerDomElement.style.position="relative",this._containerDomElement.style.height="100%",this._domElement.appendChild(this._containerDomElement),this._overviewViewportDomElement=Ixe(document.createElement("div")),this._overviewViewportDomElement.setClassName("diffViewport"),this._overviewViewportDomElement.setPosition("absolute"),this._overviewDomElement=document.createElement("div"),this._overviewDomElement.className="diffOverview",this._overviewDomElement.style.position="absolute",this._overviewDomElement.appendChild(this._overviewViewportDomElement.domNode),this._register(iMe(this._overviewDomElement,LMe.POINTER_DOWN,(e=>{this._modifiedEditor.delegateVerticalScrollbarPointerDown(e)}))),this._register(tMe(this._overviewDomElement,LMe.MOUSE_WHEEL,(e=>{this._modifiedEditor.delegateScrollFromMouseWheelEvent(e)}),{passive:!1})),this._options.renderOverviewRuler&&this._containerDomElement.appendChild(this._overviewDomElement),this._originalDomNode=document.createElement("div"),this._originalDomNode.className="editor original",this._originalDomNode.style.position="absolute",this._originalDomNode.style.height="100%",this._containerDomElement.appendChild(this._originalDomNode),this._modifiedDomNode=document.createElement("div"),this._modifiedDomNode.className="editor modified",this._modifiedDomNode.style.position="absolute",this._modifiedDomNode.style.height="100%",this._containerDomElement.appendChild(this._modifiedDomNode),this._beginUpdateDecorationsTimeout=-1,this._currentlyChangingViewZones=!1,this._diffComputationToken=0,this._originalEditorState=new DQe(h,o),this._modifiedEditorState=new DQe(h,o),this._isVisible=!0,this._isHandlingScrollEvent=!1,this._elementSizeObserver=this._register(new KAe(this._containerDomElement,i.dimension)),this._register(this._elementSizeObserver.onDidChange((()=>this._onDidContainerSizeChanged()))),i.automaticLayout&&this._elementSizeObserver.startObserving(),this._diffComputationResult=null,this._originalEditor=this._createLeftHandSideEditor(i,n.originalEditor||{}),this._modifiedEditor=this._createRightHandSideEditor(i,n.modifiedEditor||{}),this._originalOverviewRuler=null,this._modifiedOverviewRuler=null,this._reviewPane=r.createInstance(pQe,this),this._containerDomElement.appendChild(this._reviewPane.domNode.domNode),this._containerDomElement.appendChild(this._reviewPane.shadow.domNode),this._containerDomElement.appendChild(this._reviewPane.actionBarContainer.domNode),this._options.renderSideBySide?this._setStrategy(new WQe(this._createDataSource(),this._options.enableSplitViewResizing)):this._setStrategy(new HQe(this._createDataSource(),this._options.enableSplitViewResizing)),this._register(l.onDidColorThemeChange((t=>{this._strategy&&this._strategy.applyColors(t)&&this._updateDecorationsRunner.schedule(),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide)})));const u=OAe.getDiffEditorContributions();for(const e of u)try{this._register(r.createInstance(e.ctor,this))}catch(e){wwe(e)}this._codeEditorService.addDiffEditor(this)}_setState(e){this._state!==e&&(this._state=e,this._updatingDiffProgress&&(this._updatingDiffProgress.done(),this._updatingDiffProgress=null),1===this._state&&(this._updatingDiffProgress=this._editorProgressService.show(!0,1e3)))}diffReviewNext(){this._reviewPane.next()}diffReviewPrev(){this._reviewPane.prev()}static _getClassName(e,t){let i="monaco-diff-editor monaco-editor-background ";return t&&(i+="side-by-side "),i+=zBe(e.type),i}_disposeOverviewRulers(){this._originalOverviewRuler&&(this._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode()),this._originalOverviewRuler.dispose(),this._originalOverviewRuler=null),this._modifiedOverviewRuler&&(this._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode()),this._modifiedOverviewRuler.dispose(),this._modifiedOverviewRuler=null)}_createOverviewRulers(){this._options.renderOverviewRuler&&(Kxe(!this._originalOverviewRuler&&!this._modifiedOverviewRuler),this._originalEditor.hasModel()&&(this._originalOverviewRuler=this._originalEditor.createOverviewRuler("original diffOverviewRuler"),this._overviewDomElement.appendChild(this._originalOverviewRuler.getDomNode())),this._modifiedEditor.hasModel()&&(this._modifiedOverviewRuler=this._modifiedEditor.createOverviewRuler("modified diffOverviewRuler"),this._overviewDomElement.appendChild(this._modifiedOverviewRuler.getDomNode())),this._layoutOverviewRulers())}_createLeftHandSideEditor(t,i){const n=this._createInnerEditor(this._instantiationService,this._originalDomNode,this._adjustOptionsForLeftHandSide(t),i);this._register(n.onDidScrollChange((e=>{this._isHandlingScrollEvent||(e.scrollTopChanged||e.scrollLeftChanged||e.scrollHeightChanged)&&(this._isHandlingScrollEvent=!0,this._modifiedEditor.setScrollPosition({scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}),this._isHandlingScrollEvent=!1,this._layoutOverviewViewport())}))),this._register(n.onDidChangeViewZones((()=>{this._onViewZonesChanged()}))),this._register(n.onDidChangeConfiguration((e=>{n.getModel()&&(e.hasChanged(47)&&this._updateDecorationsRunner.schedule(),e.hasChanged(139)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))}))),this._register(n.onDidChangeHiddenAreas((()=>{this._updateDecorationsRunner.cancel(),this._updateDecorations()}))),this._register(n.onDidChangeModelContent((()=>{this._isVisible&&this._beginUpdateDecorationsSoon()})));const o=this._contextKeyService.createKey("isInDiffLeftEditor",n.hasWidgetFocus());return this._register(n.onDidFocusEditorWidget((()=>o.set(!0)))),this._register(n.onDidBlurEditorWidget((()=>o.set(!1)))),this._register(n.onDidContentSizeChange((t=>{const i=this._originalEditor.getContentWidth()+this._modifiedEditor.getContentWidth()+e.ONE_OVERVIEW_WIDTH,n=Math.max(this._modifiedEditor.getContentHeight(),this._originalEditor.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:n,contentWidth:i,contentHeightChanged:t.contentHeightChanged,contentWidthChanged:t.contentWidthChanged})}))),n}_createRightHandSideEditor(t,i){const n=this._createInnerEditor(this._instantiationService,this._modifiedDomNode,this._adjustOptionsForRightHandSide(t),i);this._register(n.onDidScrollChange((e=>{this._isHandlingScrollEvent||(e.scrollTopChanged||e.scrollLeftChanged||e.scrollHeightChanged)&&(this._isHandlingScrollEvent=!0,this._originalEditor.setScrollPosition({scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}),this._isHandlingScrollEvent=!1,this._layoutOverviewViewport())}))),this._register(n.onDidChangeViewZones((()=>{this._onViewZonesChanged()}))),this._register(n.onDidChangeConfiguration((e=>{n.getModel()&&(e.hasChanged(47)&&this._updateDecorationsRunner.schedule(),e.hasChanged(139)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))}))),this._register(n.onDidChangeHiddenAreas((()=>{this._updateDecorationsRunner.cancel(),this._updateDecorations()}))),this._register(n.onDidChangeModelContent((()=>{this._isVisible&&this._beginUpdateDecorationsSoon()}))),this._register(n.onDidChangeModelOptions((e=>{e.tabSize&&this._updateDecorationsRunner.schedule()})));const o=this._contextKeyService.createKey("isInDiffRightEditor",n.hasWidgetFocus());return this._register(n.onDidFocusEditorWidget((()=>o.set(!0)))),this._register(n.onDidBlurEditorWidget((()=>o.set(!1)))),this._register(n.onDidContentSizeChange((t=>{const i=this._originalEditor.getContentWidth()+this._modifiedEditor.getContentWidth()+e.ONE_OVERVIEW_WIDTH,n=Math.max(this._modifiedEditor.getContentHeight(),this._originalEditor.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:n,contentWidth:i,contentHeightChanged:t.contentHeightChanged,contentWidthChanged:t.contentWidthChanged})}))),this._register(n.onMouseDown((e=>{var t,i;if(!e.event.rightButton&&e.target.position&&(null===(t=e.target.element)||void 0===t?void 0:t.className.includes("arrow-revert-change"))){const t=e.target.position.lineNumber,n=e.target,o=null===(i=this._diffComputationResult)||void 0===i?void 0:i.changes.find((e=>(null==n?void 0:n.detail.afterLineNumber)===e.modifiedStartLineNumber||e.modifiedEndLineNumber>0&&e.modifiedStartLineNumber===t));return o&&this.revertChange(o),e.event.stopPropagation(),void this._updateDecorations()}}))),n}revertChange(e){const t=this._modifiedEditor,i=this._originalEditor.getModel(),n=this._modifiedEditor.getModel();if(!i||!n||!t)return;const o=e.originalEndLineNumber>0?new dye(e.originalStartLineNumber,1,e.originalEndLineNumber,i.getLineMaxColumn(e.originalEndLineNumber)):null,s=o?i.getValueInRange(o):null,r=e.modifiedEndLineNumber>0?new dye(e.modifiedStartLineNumber,1,e.modifiedEndLineNumber,n.getLineMaxColumn(e.modifiedEndLineNumber)):null,a=n.getEOL();if(0===e.originalEndLineNumber&&r){let i=r;e.modifiedStartLineNumber>1?i=r.setStartPosition(e.modifiedStartLineNumber-1,n.getLineMaxColumn(e.modifiedStartLineNumber-1)):e.modifiedEndLineNumber<n.getLineCount()&&(i=r.setEndPosition(e.modifiedEndLineNumber+1,1)),t.executeEdits("diffEditor",[{range:i,text:""}])}else if(0===e.modifiedEndLineNumber&&null!==s){const i=e.modifiedStartLineNumber<n.getLineCount()?new lye(e.modifiedStartLineNumber+1,1):new lye(e.modifiedStartLineNumber,n.getLineMaxColumn(e.modifiedStartLineNumber));t.executeEdits("diffEditor",[{range:dye.fromPositions(i,i),text:e.modifiedStartLineNumber<n.getLineCount()?s+a:a+s}])}else r&&null!==s&&t.executeEdits("diffEditor",[{range:r,text:s}])}_createInnerEditor(e,t,i,n){return e.createInstance(Q$e,t,i,n)}dispose(){this._codeEditorService.removeDiffEditor(this),-1!==this._beginUpdateDecorationsTimeout&&(window.clearTimeout(this._beginUpdateDecorationsTimeout),this._beginUpdateDecorationsTimeout=-1),this._cleanViewZonesAndDecorations(),this._originalOverviewRuler&&(this._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode()),this._originalOverviewRuler.dispose()),this._modifiedOverviewRuler&&(this._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode()),this._modifiedOverviewRuler.dispose()),this._overviewDomElement.removeChild(this._overviewViewportDomElement.domNode),this._options.renderOverviewRuler&&this._containerDomElement.removeChild(this._overviewDomElement),this._containerDomElement.removeChild(this._originalDomNode),this._originalEditor.dispose(),this._containerDomElement.removeChild(this._modifiedDomNode),this._modifiedEditor.dispose(),this._strategy.dispose(),this._containerDomElement.removeChild(this._reviewPane.domNode.domNode),this._containerDomElement.removeChild(this._reviewPane.shadow.domNode),this._containerDomElement.removeChild(this._reviewPane.actionBarContainer.domNode),this._reviewPane.dispose(),this._domElement.removeChild(this._containerDomElement),this._onDidDispose.fire(),super.dispose()}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return Tke.IDiffEditor}getLineChanges(){return this._diffComputationResult?this._diffComputationResult.changes:null}getOriginalEditor(){return this._originalEditor}getModifiedEditor(){return this._modifiedEditor}updateOptions(t){const i=YQe(t,this._options),n=function(e,t){return{enableSplitViewResizing:e.enableSplitViewResizing!==t.enableSplitViewResizing,renderSideBySide:e.renderSideBySide!==t.renderSideBySide,renderMarginRevertIcon:e.renderMarginRevertIcon!==t.renderMarginRevertIcon,maxComputationTime:e.maxComputationTime!==t.maxComputationTime,maxFileSize:e.maxFileSize!==t.maxFileSize,ignoreTrimWhitespace:e.ignoreTrimWhitespace!==t.ignoreTrimWhitespace,renderIndicators:e.renderIndicators!==t.renderIndicators,originalEditable:e.originalEditable!==t.originalEditable,diffCodeLens:e.diffCodeLens!==t.diffCodeLens,renderOverviewRuler:e.renderOverviewRuler!==t.renderOverviewRuler,diffWordWrap:e.diffWordWrap!==t.diffWordWrap,diffAlgorithm:e.diffAlgorithm!==t.diffAlgorithm}}(this._options,i);this._options=i;const o=n.ignoreTrimWhitespace||n.renderIndicators||n.renderMarginRevertIcon,s=this._isVisible&&(n.maxComputationTime||n.maxFileSize);this._documentDiffProvider.setOptions(i),o?this._beginUpdateDecorations():s&&this._beginUpdateDecorationsSoon(),this._modifiedEditor.updateOptions(this._adjustOptionsForRightHandSide(t)),this._originalEditor.updateOptions(this._adjustOptionsForLeftHandSide(t)),this._strategy.setEnableSplitViewResizing(this._options.enableSplitViewResizing),n.renderSideBySide&&(this._options.renderSideBySide?this._setStrategy(new WQe(this._createDataSource(),this._options.enableSplitViewResizing)):this._setStrategy(new HQe(this._createDataSource(),this._options.enableSplitViewResizing)),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide)),n.renderOverviewRuler&&(this._options.renderOverviewRuler?this._containerDomElement.appendChild(this._overviewDomElement):this._containerDomElement.removeChild(this._overviewDomElement))}getModel(){return{original:this._originalEditor.getModel(),modified:this._modifiedEditor.getModel()}}setModel(e){if(e&&(!e.original||!e.modified))throw new Error(e.original?"DiffEditorWidget.setModel: Modified model is null":"DiffEditorWidget.setModel: Original model is null");this._cleanViewZonesAndDecorations(),this._disposeOverviewRulers(),this._originalEditor.setModel(e?e.original:null),this._modifiedEditor.setModel(e?e.modified:null),this._updateDecorationsRunner.cancel(),e&&(this._originalEditor.setScrollTop(0),this._modifiedEditor.setScrollTop(0)),this._diffComputationResult=null,this._diffComputationToken++,this._setState(0),e&&(this._createOverviewRulers(),this._beginUpdateDecorations()),this._layoutOverviewViewport(),this._onDidChangeModel.fire()}getContainerDomNode(){return this._domElement}getVisibleColumnFromPosition(e){return this._modifiedEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._modifiedEditor.getPosition()}setPosition(e,t="api"){this._modifiedEditor.setPosition(e,t)}revealLine(e,t=0){this._modifiedEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._modifiedEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._modifiedEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._modifiedEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._modifiedEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._modifiedEditor.revealPositionNearTop(e,t)}getSelection(){return this._modifiedEditor.getSelection()}getSelections(){return this._modifiedEditor.getSelections()}setSelection(e,t="api"){this._modifiedEditor.setSelection(e,t)}setSelections(e,t="api"){this._modifiedEditor.setSelections(e,t)}revealLines(e,t,i=0){this._modifiedEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._modifiedEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._modifiedEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._modifiedEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,n=!0){this._modifiedEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=0){this._modifiedEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._modifiedEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._modifiedEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._modifiedEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._modifiedEditor.getSupportedActions()}saveViewState(){return{original:this._originalEditor.saveViewState(),modified:this._modifiedEditor.saveViewState()}}restoreViewState(e){if(e&&e.original&&e.modified){const t=e;this._originalEditor.restoreViewState(t.original),this._modifiedEditor.restoreViewState(t.modified)}}layout(e){this._elementSizeObserver.observe(e)}focus(){this._modifiedEditor.focus()}hasTextFocus(){return this._originalEditor.hasTextFocus()||this._modifiedEditor.hasTextFocus()}trigger(e,t,i){this._modifiedEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._modifiedEditor.createDecorationsCollection(e)}changeDecorations(e){return this._modifiedEditor.changeDecorations(e)}_onDidContainerSizeChanged(){this._doLayout()}_getReviewHeight(){return this._reviewPane.isVisible()?this._elementSizeObserver.getHeight():0}_layoutOverviewRulers(){if(!this._options.renderOverviewRuler)return;if(!this._originalOverviewRuler||!this._modifiedOverviewRuler)return;const t=this._elementSizeObserver.getHeight(),i=this._getReviewHeight(),n=e.ENTIRE_DIFF_OVERVIEW_WIDTH-2*e.ONE_OVERVIEW_WIDTH;this._modifiedEditor.getLayoutInfo()&&(this._originalOverviewRuler.setLayout({top:0,width:e.ONE_OVERVIEW_WIDTH,right:n+e.ONE_OVERVIEW_WIDTH,height:t-i}),this._modifiedOverviewRuler.setLayout({top:0,right:0,width:e.ONE_OVERVIEW_WIDTH,height:t-i}))}_onViewZonesChanged(){this._currentlyChangingViewZones||this._updateDecorationsRunner.schedule()}_beginUpdateDecorationsSoon(){-1!==this._beginUpdateDecorationsTimeout&&(window.clearTimeout(this._beginUpdateDecorationsTimeout),this._beginUpdateDecorationsTimeout=-1),this._beginUpdateDecorationsTimeout=window.setTimeout((()=>this._beginUpdateDecorations()),e.UPDATE_DIFF_DECORATIONS_DELAY)}static _equals(e,t){return!e&&!t||!(!e||!t)&&e.toString()===t.toString()}_beginUpdateDecorations(){-1!==this._beginUpdateDecorationsTimeout&&(window.clearTimeout(this._beginUpdateDecorationsTimeout),this._beginUpdateDecorationsTimeout=-1);const t=this._originalEditor.getModel(),i=this._modifiedEditor.getModel();if(!t||!i)return;this._diffComputationToken++;const n=this._diffComputationToken,o=1024*this._options.maxFileSize*1024,s=e=>{const t=e.getValueLength();return 0===o||t<=o};s(t)&&s(i)?(this._setState(1),this._documentDiffProvider.computeDiff(t,i,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace,maxComputationTimeMs:this._options.maxComputationTime}).then((e=>{n===this._diffComputationToken&&t===this._originalEditor.getModel()&&i===this._modifiedEditor.getModel()&&(this._setState(2),this._diffComputationResult={identical:e.identical,quitEarly:e.quitEarly,changes:e.changes.map((e=>{let t,i,n,o,s=e.innerChanges;return e.originalRange.isEmpty?(t=e.originalRange.startLineNumber-1,i=0,s=void 0):(t=e.originalRange.startLineNumber,i=e.originalRange.endLineNumberExclusive-1),e.modifiedRange.isEmpty?(n=e.modifiedRange.startLineNumber-1,o=0,s=void 0):(n=e.modifiedRange.startLineNumber,o=e.modifiedRange.endLineNumberExclusive-1),{originalStartLineNumber:t,originalEndLineNumber:i,modifiedStartLineNumber:n,modifiedEndLineNumber:o,charChanges:null==s?void 0:s.map((e=>({originalStartLineNumber:e.originalRange.startLineNumber,originalStartColumn:e.originalRange.startColumn,originalEndLineNumber:e.originalRange.endLineNumber,originalEndColumn:e.originalRange.endColumn,modifiedStartLineNumber:e.modifiedRange.startLineNumber,modifiedStartColumn:e.modifiedRange.startColumn,modifiedEndLineNumber:e.modifiedRange.endLineNumber,modifiedEndColumn:e.modifiedRange.endColumn})))}}))},this._updateDecorationsRunner.schedule(),this._onDidUpdateDiff.fire())}),(e=>{n===this._diffComputationToken&&t===this._originalEditor.getModel()&&i===this._modifiedEditor.getModel()&&(this._setState(2),this._diffComputationResult=null,this._updateDecorationsRunner.schedule())}))):e._equals(t.uri,this._lastOriginalWarning)&&e._equals(i.uri,this._lastModifiedWarning)||(this._lastOriginalWarning=t.uri,this._lastModifiedWarning=i.uri,this._notificationService.warn(ove(0,"Cannot compare files because one file is too large.")))}_cleanViewZonesAndDecorations(){this._originalEditorState.clean(this._originalEditor),this._modifiedEditorState.clean(this._modifiedEditor)}_updateDecorations(){if(!this._originalEditor.getModel()||!this._modifiedEditor.getModel())return;const e=this._diffComputationResult?this._diffComputationResult.changes:[],t=this._originalEditorState.getForeignViewZones(this._originalEditor.getWhitespaces()),i=this._modifiedEditorState.getForeignViewZones(this._modifiedEditor.getWhitespaces()),n=this._options.renderMarginRevertIcon&&!this._modifiedEditor.getOption(86),o=this._strategy.getEditorsDiffDecorations(e,this._options.ignoreTrimWhitespace,this._options.renderIndicators,n,t,i);try{this._currentlyChangingViewZones=!0,this._originalEditorState.apply(this._originalEditor,this._originalOverviewRuler,o.original,!1),this._modifiedEditorState.apply(this._modifiedEditor,this._modifiedOverviewRuler,o.modified,!0)}finally{this._currentlyChangingViewZones=!1}}_adjustOptionsForSubEditor(e){const t=Object.assign({},e);return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar=Object.assign({},t.scrollbar||{}),t.scrollbar.vertical="visible",t.folding=!1,t.codeLens=this._options.diffCodeLens,t.fixedOverflowWidgets=!0,t.minimap=Object.assign({},t.minimap||{}),t.minimap.enabled=!1,t}_adjustOptionsForLeftHandSide(e){const t=this._adjustOptionsForSubEditor(e);return this._options.renderSideBySide?t.wordWrapOverride1=this._options.diffWordWrap:(t.wordWrapOverride1="off",t.wordWrapOverride2="off"),e.originalAriaLabel&&(t.ariaLabel=e.originalAriaLabel),t.ariaLabel+=MQe,t.readOnly=!this._options.originalEditable,t.dropIntoEditor={enabled:!t.readOnly},t.extraEditorClassName="original-in-monaco-diff-editor",Object.assign(Object.assign({},t),{dimension:{height:0,width:0}})}_adjustOptionsForRightHandSide(t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel+=MQe,i.wordWrapOverride1=this._options.diffWordWrap,i.revealHorizontalRightPadding=vwe.revealHorizontalRightPadding.defaultValue+e.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",Object.assign(Object.assign({},i),{dimension:{height:0,width:0}})}doLayout(){this._elementSizeObserver.observe(),this._doLayout()}_doLayout(){const t=this._elementSizeObserver.getWidth(),i=this._elementSizeObserver.getHeight(),n=this._getReviewHeight(),o=this._strategy.layout();this._originalDomNode.style.width=o+"px",this._originalDomNode.style.left="0px",this._modifiedDomNode.style.width=t-o+"px",this._modifiedDomNode.style.left=o+"px",this._overviewDomElement.style.top="0px",this._overviewDomElement.style.height=i-n+"px",this._overviewDomElement.style.width=e.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",this._overviewDomElement.style.left=t-e.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",this._overviewViewportDomElement.setWidth(e.ENTIRE_DIFF_OVERVIEW_WIDTH),this._overviewViewportDomElement.setHeight(30),this._originalEditor.layout({width:o,height:i-n}),this._modifiedEditor.layout({width:t-o-(this._options.renderOverviewRuler?e.ENTIRE_DIFF_OVERVIEW_WIDTH:0),height:i-n}),(this._originalOverviewRuler||this._modifiedOverviewRuler)&&this._layoutOverviewRulers(),this._reviewPane.layout(i-n,t,n),this._layoutOverviewViewport()}_layoutOverviewViewport(){const e=this._computeOverviewViewport();e?(this._overviewViewportDomElement.setTop(e.top),this._overviewViewportDomElement.setHeight(e.height)):(this._overviewViewportDomElement.setTop(0),this._overviewViewportDomElement.setHeight(0))}_computeOverviewViewport(){const e=this._modifiedEditor.getLayoutInfo();if(!e)return null;const t=this._modifiedEditor.getScrollTop(),i=this._modifiedEditor.getScrollHeight(),n=Math.max(0,e.height),o=Math.max(0,n-0),s=i>0?o/i:0;return{height:Math.max(0,Math.floor(e.height*s)),top:Math.floor(t*s)}}_createDataSource(){return{getWidth:()=>this._elementSizeObserver.getWidth(),getHeight:()=>this._elementSizeObserver.getHeight()-this._getReviewHeight(),getOptions:()=>({renderOverviewRuler:this._options.renderOverviewRuler}),getContainerDomNode:()=>this._containerDomElement,relayoutEditors:()=>{this._doLayout()},getOriginalEditor:()=>this._originalEditor,getModifiedEditor:()=>this._modifiedEditor}}_setStrategy(e){var t;null===(t=this._strategy)||void 0===t||t.dispose(),this._strategy=e,this._boundarySashes&&e.setBoundarySashes(this._boundarySashes),e.applyColors(this._themeService.getColorTheme()),this._diffComputationResult&&this._updateDecorations(),this._doLayout()}_getLineChangeAtOrBeforeLineNumber(e,t){const i=this._diffComputationResult?this._diffComputationResult.changes:[];if(0===i.length||e<t(i[0]))return null;let n=0,o=i.length-1;for(;n<o;){const s=Math.floor((n+o)/2),r=t(i[s]),a=s+1<=o?t(i[s+1]):1073741824;e<r?o=s-1:e>=a?n=s+1:(n=s,o=s)}return i[n]}_getEquivalentLineForOriginalLineNumber(e){const t=this._getLineChangeAtOrBeforeLineNumber(e,(e=>e.originalStartLineNumber));if(!t)return e;const i=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),n=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,s=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,r=e-i;return r<=o?n+Math.min(r,s):n+s-o+r}_getEquivalentLineForModifiedLineNumber(e){const t=this._getLineChangeAtOrBeforeLineNumber(e,(e=>e.modifiedStartLineNumber));if(!t)return e;const i=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),n=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,s=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,r=e-n;return r<=s?i+Math.min(r,o):i+o-s+r}getDiffLineInformationForOriginal(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForOriginalLineNumber(e)}:null}getDiffLineInformationForModified(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForModifiedLineNumber(e)}:null}};AQe.ONE_OVERVIEW_WIDTH=15,AQe.ENTIRE_DIFF_OVERVIEW_WIDTH=30,AQe.UPDATE_DIFF_DECORATIONS_DELAY=200,AQe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([LQe(3,wQe),LQe(4,wke),LQe(5,Hxe),LQe(6,Uxe),LQe(7,VBe),LQe(8,k$e),LQe(9,yQe),LQe(10,xQe)],AQe);class RQe extends Owe{constructor(e){super(),this._dataSource=e,this._insertColor=null,this._removeColor=null}applyColors(e){const t=e.getColor(POe)||(e.getColor(ROe)||MOe).transparent(2),i=e.getColor(FOe)||(e.getColor(OOe)||AOe).transparent(2),n=!t.equals(this._insertColor)||!i.equals(this._removeColor);return this._insertColor=t,this._removeColor=i,n}getEditorsDiffDecorations(e,t,i,n,o,s){s=s.sort(((e,t)=>e.afterLineNumber-t.afterLineNumber)),o=o.sort(((e,t)=>e.afterLineNumber-t.afterLineNumber));const r=this._getViewZones(e,o,s,i),a=this._getOriginalEditorDecorations(r,e,t,i),l=this._getModifiedEditorDecorations(r,e,t,i,n);return{original:{decorations:a.decorations,overviewZones:a.overviewZones,zones:r.original},modified:{decorations:l.decorations,overviewZones:l.overviewZones,zones:r.modified}}}setBoundarySashes(e){}}class OQe{constructor(e){this._source=e,this._index=-1,this.current=null,this.advance()}advance(){this._index++,this._index<this._source.length?this.current=this._source[this._index]:this.current=null}}class PQe{constructor(e,t,i,n,o){this._lineChanges=e,this._originalForeignVZ=t,this._modifiedForeignVZ=i,this._originalEditor=n,this._modifiedEditor=o}static _getViewLineCount(e,t,i){const n=e.getModel(),o=e._getViewModel();if(n&&o){const e=ZQe(n,o,t,i);return e.endLineNumber-e.startLineNumber+1}return i-t+1}getViewZones(){const e=this._originalEditor.getOption(63),t=this._modifiedEditor.getOption(63),i=-1!==this._originalEditor.getOption(139).wrappingColumn,n=-1!==this._modifiedEditor.getOption(139).wrappingColumn,o=i||n,s=this._originalEditor.getModel(),r=this._originalEditor._getViewModel().coordinatesConverter,a=this._modifiedEditor._getViewModel().coordinatesConverter,l=[],d=[];let h=0,c=0,u=0,g=0,p=0,m=0;const f=(e,t)=>e.afterLineNumber-t.afterLineNumber,_=(e,t)=>{if(null===t.domNode&&e.length>0){const i=e[e.length-1];if(i.afterLineNumber===t.afterLineNumber&&null===i.domNode)return void(i.heightInLines+=t.heightInLines)}e.push(t)},v=new OQe(this._modifiedForeignVZ),b=new OQe(this._originalForeignVZ);let w=1,C=1;for(let i=0,n=this._lineChanges.length;i<=n;i++){const y=i<n?this._lineChanges[i]:null;null!==y?(u=y.originalStartLineNumber+(y.originalEndLineNumber>0?-1:0),g=y.modifiedStartLineNumber+(y.modifiedEndLineNumber>0?-1:0),c=y.originalEndLineNumber>0?PQe._getViewLineCount(this._originalEditor,y.originalStartLineNumber,y.originalEndLineNumber):0,h=y.modifiedEndLineNumber>0?PQe._getViewLineCount(this._modifiedEditor,y.modifiedStartLineNumber,y.modifiedEndLineNumber):0,p=Math.max(y.originalStartLineNumber,y.originalEndLineNumber),m=Math.max(y.modifiedStartLineNumber,y.modifiedEndLineNumber)):(u+=1e7+c,g+=1e7+h,p=u,m=g);let S=[],x=[];if(o){let e;e=y?y.originalEndLineNumber>0?y.originalStartLineNumber-w:y.modifiedStartLineNumber-C:s.getLineCount()-w+1;for(let t=0;t<e;t++){const e=w+t,i=C+t,n=r.getModelLineViewLineCount(e),o=a.getModelLineViewLineCount(i);n<o?S.push({afterLineNumber:e,heightInLines:o-n,domNode:null,marginDomNode:null}):n>o&&x.push({afterLineNumber:i,heightInLines:n-o,domNode:null,marginDomNode:null})}y&&(w=(y.originalEndLineNumber>0?y.originalEndLineNumber:y.originalStartLineNumber)+1,C=(y.modifiedEndLineNumber>0?y.modifiedEndLineNumber:y.modifiedStartLineNumber)+1)}for(;v.current&&v.current.afterLineNumber<=m;){let e;e=v.current.afterLineNumber<=g?u-g+v.current.afterLineNumber:p;let i=null;y&&y.modifiedStartLineNumber<=v.current.afterLineNumber&&v.current.afterLineNumber<=y.modifiedEndLineNumber&&(i=this._createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion()),S.push({afterLineNumber:e,heightInLines:v.current.height/t,domNode:null,marginDomNode:i}),v.advance()}for(;b.current&&b.current.afterLineNumber<=p;){let t;t=b.current.afterLineNumber<=u?g-u+b.current.afterLineNumber:m,x.push({afterLineNumber:t,heightInLines:b.current.height/e,domNode:null}),b.advance()}if(null!==y&&UQe(y)){const e=this._produceOriginalFromDiff(y,c,h);e&&S.push(e)}if(null!==y&&KQe(y)){const e=this._produceModifiedFromDiff(y,c,h);e&&x.push(e)}let k=0,L=0;for(S=S.sort(f),x=x.sort(f);k<S.length&&L<x.length;){const e=S[k],t=x[L],i=e.afterLineNumber-u,n=t.afterLineNumber-g;i<n?(_(l,e),k++):n<i?(_(d,t),L++):e.shouldNotShrink?(_(l,e),k++):t.shouldNotShrink?(_(d,t),L++):e.heightInLines>=t.heightInLines?(e.heightInLines-=t.heightInLines,L++):(t.heightInLines-=e.heightInLines,k++)}for(;k<S.length;)_(l,S[k]),k++;for(;L<x.length;)_(d,x[L]),L++}return{original:PQe._ensureDomNodes(l),modified:PQe._ensureDomNodes(d)}}static _ensureDomNodes(e){return e.map((e=>(e.domNode||(e.domNode=$Qe()),e)))}}function FQe(e,t,i,n,o){return{range:new dye(e,t,i,n),options:o}}const BQe={arrowRevertChange:eqe.register({description:"diff-editor-arrow-revert-change",glyphMarginClassName:"arrow-revert-change "+sAe.asClassName(pye.arrowRight)}),charDelete:eqe.register({description:"diff-editor-char-delete",className:"char-delete"}),charDeleteWholeLine:eqe.register({description:"diff-editor-char-delete-whole-line",className:"char-delete",isWholeLine:!0}),charInsert:eqe.register({description:"diff-editor-char-insert",className:"char-insert"}),charInsertWholeLine:eqe.register({description:"diff-editor-char-insert-whole-line",className:"char-insert",isWholeLine:!0}),lineInsert:eqe.register({description:"diff-editor-line-insert",className:"line-insert",marginClassName:"gutter-insert",isWholeLine:!0}),lineInsertWithSign:eqe.register({description:"diff-editor-line-insert-with-sign",className:"line-insert",linesDecorationsClassName:"insert-sign "+sAe.asClassName(NQe),marginClassName:"gutter-insert",isWholeLine:!0}),lineDelete:eqe.register({description:"diff-editor-line-delete",className:"line-delete",marginClassName:"gutter-delete",isWholeLine:!0}),lineDeleteWithSign:eqe.register({description:"diff-editor-line-delete-with-sign",className:"line-delete",linesDecorationsClassName:"delete-sign "+sAe.asClassName(IQe),marginClassName:"gutter-delete",isWholeLine:!0}),lineDeleteMargin:eqe.register({description:"diff-editor-line-delete-margin",marginClassName:"gutter-delete"})};class WQe extends RQe{constructor(e,t){super(e),this._disableSash=!1===t,this._sashRatio=null,this._sashPosition=null,this._startSashPosition=null,this._sash=this._register(new bGe(this._dataSource.getContainerDomNode(),this,{orientation:0})),this._disableSash&&(this._sash.state=0),this._sash.onDidStart((()=>this._onSashDragStart())),this._sash.onDidChange((e=>this._onSashDrag(e))),this._sash.onDidEnd((()=>this._onSashDragEnd())),this._sash.onDidReset((()=>this._onSashReset()))}setEnableSplitViewResizing(e){const t=!1===e;this._disableSash!==t&&(this._disableSash=t,this._sash.state=this._disableSash?0:3)}layout(e=this._sashRatio){const t=this._dataSource.getWidth()-(this._dataSource.getOptions().renderOverviewRuler?AQe.ENTIRE_DIFF_OVERVIEW_WIDTH:0);let i=Math.floor((e||.5)*t);const n=Math.floor(.5*t);return i=this._disableSash?n:i||n,t>2*WQe.MINIMUM_EDITOR_WIDTH?(i<WQe.MINIMUM_EDITOR_WIDTH&&(i=WQe.MINIMUM_EDITOR_WIDTH),i>t-WQe.MINIMUM_EDITOR_WIDTH&&(i=t-WQe.MINIMUM_EDITOR_WIDTH)):i=n,this._sashPosition!==i&&(this._sashPosition=i),this._sash.layout(),this._sashPosition}_onSashDragStart(){this._startSashPosition=this._sashPosition}_onSashDrag(e){const t=this._dataSource.getWidth()-(this._dataSource.getOptions().renderOverviewRuler?AQe.ENTIRE_DIFF_OVERVIEW_WIDTH:0),i=this.layout((this._startSashPosition+(e.currentX-e.startX))/t);this._sashRatio=i/t,this._dataSource.relayoutEditors()}_onSashDragEnd(){this._sash.layout()}_onSashReset(){this._sashRatio=.5,this._dataSource.relayoutEditors(),this._sash.layout()}getVerticalSashTop(e){return 0}getVerticalSashLeft(e){return this._sashPosition}getVerticalSashHeight(e){return this._dataSource.getHeight()}setBoundarySashes(e){this._sash.orthogonalEndSash=e.bottom}_getViewZones(e,t,i){const n=this._dataSource.getOriginalEditor(),o=this._dataSource.getModifiedEditor();return new VQe(e,t,i,n,o).getViewZones()}_getOriginalEditorDecorations(e,t,i,n){const o=this._dataSource.getOriginalEditor(),s=String(this._removeColor),r={decorations:[],overviewZones:[]},a=o.getModel(),l=o._getViewModel();for(const e of t)if(KQe(e)){r.decorations.push({range:new dye(e.originalStartLineNumber,1,e.originalEndLineNumber,1073741824),options:n?BQe.lineDeleteWithSign:BQe.lineDelete}),UQe(e)&&e.charChanges||r.decorations.push(FQe(e.originalStartLineNumber,1,e.originalEndLineNumber,1073741824,BQe.charDeleteWholeLine));const t=ZQe(a,l,e.originalStartLineNumber,e.originalEndLineNumber);if(r.overviewZones.push(new nze(t.startLineNumber,t.endLineNumber,0,s)),e.charChanges)for(const t of e.charChanges)if(qQe(t))if(i)for(let e=t.originalStartLineNumber;e<=t.originalEndLineNumber;e++){let i,n;i=e===t.originalStartLineNumber?t.originalStartColumn:a.getLineFirstNonWhitespaceColumn(e),n=e===t.originalEndLineNumber?t.originalEndColumn:a.getLineLastNonWhitespaceColumn(e),r.decorations.push(FQe(e,i,e,n,BQe.charDelete))}else r.decorations.push(FQe(t.originalStartLineNumber,t.originalStartColumn,t.originalEndLineNumber,t.originalEndColumn,BQe.charDelete))}return r}_getModifiedEditorDecorations(e,t,i,n,o){const s=this._dataSource.getModifiedEditor(),r=String(this._insertColor),a={decorations:[],overviewZones:[]},l=s.getModel(),d=s._getViewModel();for(const s of t){if(o)if(s.modifiedEndLineNumber>0)a.decorations.push({range:new dye(s.modifiedStartLineNumber,1,s.modifiedStartLineNumber,1),options:BQe.arrowRevertChange});else{const t=e.modified.find((e=>e.afterLineNumber===s.modifiedStartLineNumber));t&&(t.marginDomNode=GQe())}if(UQe(s)){a.decorations.push({range:new dye(s.modifiedStartLineNumber,1,s.modifiedEndLineNumber,1073741824),options:n?BQe.lineInsertWithSign:BQe.lineInsert}),KQe(s)&&s.charChanges||a.decorations.push(FQe(s.modifiedStartLineNumber,1,s.modifiedEndLineNumber,1073741824,BQe.charInsertWholeLine));const e=ZQe(l,d,s.modifiedStartLineNumber,s.modifiedEndLineNumber);if(a.overviewZones.push(new nze(e.startLineNumber,e.endLineNumber,0,r)),s.charChanges)for(const e of s.charChanges)if(jQe(e))if(i)for(let t=e.modifiedStartLineNumber;t<=e.modifiedEndLineNumber;t++){let i,n;i=t===e.modifiedStartLineNumber?e.modifiedStartColumn:l.getLineFirstNonWhitespaceColumn(t),n=t===e.modifiedEndLineNumber?e.modifiedEndColumn:l.getLineLastNonWhitespaceColumn(t),a.decorations.push(FQe(t,i,t,n,BQe.charInsert))}else a.decorations.push(FQe(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn,BQe.charInsert))}}return a}}WQe.MINIMUM_EDITOR_WIDTH=100;class VQe extends PQe{constructor(e,t,i,n,o){super(e,t,i,n,o)}_createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(){return null}_produceOriginalFromDiff(e,t,i){return i>t?{afterLineNumber:Math.max(e.originalStartLineNumber,e.originalEndLineNumber),heightInLines:i-t,domNode:null}:null}_produceModifiedFromDiff(e,t,i){return t>i?{afterLineNumber:Math.max(e.modifiedStartLineNumber,e.modifiedEndLineNumber),heightInLines:t-i,domNode:null}:null}}class HQe extends RQe{constructor(e,t){super(e),this._decorationsLeft=e.getOriginalEditor().getLayoutInfo().decorationsLeft,this._register(e.getOriginalEditor().onDidLayoutChange((t=>{this._decorationsLeft!==t.decorationsLeft&&(this._decorationsLeft=t.decorationsLeft,e.relayoutEditors())})))}setEnableSplitViewResizing(e){}_getViewZones(e,t,i,n){const o=this._dataSource.getOriginalEditor(),s=this._dataSource.getModifiedEditor();return new zQe(e,t,i,o,s,n).getViewZones()}_getOriginalEditorDecorations(e,t,i,n){const o=String(this._removeColor),s={decorations:[],overviewZones:[]},r=this._dataSource.getOriginalEditor(),a=r.getModel(),l=r._getViewModel();let d=0;for(const i of t)if(KQe(i)){for(s.decorations.push({range:new dye(i.originalStartLineNumber,1,i.originalEndLineNumber,1073741824),options:BQe.lineDeleteMargin});d<e.modified.length;){const t=e.modified[d];if(t.diff&&t.diff.originalStartLineNumber>=i.originalStartLineNumber)break;d++}let t=0;if(d<e.modified.length){const n=e.modified[d];n.diff&&n.diff.originalStartLineNumber===i.originalStartLineNumber&&n.diff.originalEndLineNumber===i.originalEndLineNumber&&n.diff.modifiedStartLineNumber===i.modifiedStartLineNumber&&n.diff.modifiedEndLineNumber===i.modifiedEndLineNumber&&(t=n.heightInLines)}const n=ZQe(a,l,i.originalStartLineNumber,i.originalEndLineNumber);s.overviewZones.push(new nze(n.startLineNumber,n.endLineNumber,t,o))}return s}_getModifiedEditorDecorations(e,t,i,n,o){const s=this._dataSource.getModifiedEditor(),r=String(this._insertColor),a={decorations:[],overviewZones:[]},l=s.getModel(),d=s._getViewModel();for(const e of t)if(UQe(e)){a.decorations.push({range:new dye(e.modifiedStartLineNumber,1,e.modifiedEndLineNumber,1073741824),options:n?BQe.lineInsertWithSign:BQe.lineInsert});const t=ZQe(l,d,e.modifiedStartLineNumber,e.modifiedEndLineNumber);if(a.overviewZones.push(new nze(t.startLineNumber,t.endLineNumber,0,r)),e.charChanges){for(const t of e.charChanges)if(jQe(t))if(i)for(let e=t.modifiedStartLineNumber;e<=t.modifiedEndLineNumber;e++){let i,n;i=e===t.modifiedStartLineNumber?t.modifiedStartColumn:l.getLineFirstNonWhitespaceColumn(e),n=e===t.modifiedEndLineNumber?t.modifiedEndColumn:l.getLineLastNonWhitespaceColumn(e),a.decorations.push(FQe(e,i,e,n,BQe.charInsert))}else a.decorations.push(FQe(t.modifiedStartLineNumber,t.modifiedStartColumn,t.modifiedEndLineNumber,t.modifiedEndColumn,BQe.charInsert))}else a.decorations.push(FQe(e.modifiedStartLineNumber,1,e.modifiedEndLineNumber,1073741824,BQe.charInsertWholeLine))}return a}layout(){return Math.max(5,this._decorationsLeft)}}class zQe extends PQe{constructor(e,t,i,n,o,s){super(e,t,i,n,o),this._originalModel=n.getModel(),this._renderIndicators=s,this._pendingLineChange=[],this._pendingViewZones=[],this._lineBreaksComputer=this._modifiedEditor._getViewModel().createLineBreaksComputer()}getViewZones(){const e=super.getViewZones();return this._finalize(e),e}_createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(){const e=document.createElement("div");return e.className="inline-added-margin-view-zone",e}_produceOriginalFromDiff(e,t,i){const n=document.createElement("div");return n.className="inline-added-margin-view-zone",{afterLineNumber:Math.max(e.originalStartLineNumber,e.originalEndLineNumber),heightInLines:i,domNode:document.createElement("div"),marginDomNode:n}}_produceModifiedFromDiff(e,t,i){const n=document.createElement("div");n.className=`view-lines line-delete ${OWe}`;const o=document.createElement("div");o.className="inline-deleted-margin-view-zone";const s={shouldNotShrink:!0,afterLineNumber:0===e.modifiedEndLineNumber?e.modifiedStartLineNumber:e.modifiedStartLineNumber-1,heightInLines:t,minWidthInPx:0,domNode:n,marginDomNode:o,diff:{originalStartLineNumber:e.originalStartLineNumber,originalEndLineNumber:e.originalEndLineNumber,modifiedStartLineNumber:e.modifiedStartLineNumber,modifiedEndLineNumber:e.modifiedEndLineNumber,originalModel:this._originalModel,viewLineCounts:null}};for(let t=e.originalStartLineNumber;t<=e.originalEndLineNumber;t++)this._lineBreaksComputer.addRequest(this._originalModel.getLineContent(t),null,null);return this._pendingLineChange.push(e),this._pendingViewZones.push(s),s}_finalize(e){const t=this._modifiedEditor.getOptions(),i=this._modifiedEditor.getModel().getOptions().tabSize,n=t.get(47),o=t.get(30),s=n.typicalHalfwidthCharacterWidth,r=t.get(98),a=this._originalModel.mightContainNonBasicASCII(),l=this._originalModel.mightContainRTL(),d=t.get(63),h=t.get(138).decorationsWidth,c=t.get(111),u=t.get(93),g=t.get(88),p=t.get(48),m=this._lineBreaksComputer.finalize();let f=0;for(let t=0;t<this._pendingLineChange.length;t++){const _=this._pendingLineChange[t],v=this._pendingViewZones[t],b=v.domNode;Txe(b,n);const w=v.marginDomNode;Txe(w,n);const C=[];if(_.charChanges)for(const e of _.charChanges)qQe(e)&&C.push(new dIe(new dye(e.originalStartLineNumber,e.originalStartColumn,e.originalEndLineNumber,e.originalEndColumn),"char-delete",0));const y=C.length>0,S=new dLe(1e4);let x=0,k=0,L=null;for(let t=_.originalStartLineNumber;t<=_.originalEndLineNumber;t++){const s=t-_.originalStartLineNumber,r=this._originalModel.tokenization.getLineTokens(t),b=r.getLineContent(),D=m[f++],E=UNe.filter(C,t,1,b.length+1);if(D){let m=0;for(const e of D.breakOffsets){const t=r.sliceAndInflate(m,e,0),s=b.substring(m,e);x=Math.max(x,this._renderOriginalLine(k++,s,t,UNe.extractWrapped(E,m,e),y,a,l,n,o,d,h,c,u,g,p,i,S,w)),m=e}for(L||(L=[]);L.length<s;)L[L.length]=1;L[s]=D.breakOffsets.length,v.heightInLines+=D.breakOffsets.length-1;const f=document.createElement("div");f.className="gutter-delete",e.original.push({afterLineNumber:t,afterColumn:0,heightInLines:D.breakOffsets.length-1,domNode:$Qe(),marginDomNode:f})}else x=Math.max(x,this._renderOriginalLine(k++,b,r,E,y,a,l,n,o,d,h,c,u,g,p,i,S,w))}x+=r;const D=S.build(),E=TQe?TQe.createHTML(D):D;if(b.innerHTML=E,v.minWidthInPx=x*s,L){const e=_.originalEndLineNumber-_.originalStartLineNumber;for(;L.length<=e;)L[L.length]=1}v.diff.viewLineCounts=L}e.original.sort(((e,t)=>e.afterLineNumber-t.afterLineNumber))}_renderOriginalLine(e,t,i,n,o,s,r,a,l,d,h,c,u,g,p,m,f,_){f.appendString('<div class="view-line'),o||f.appendString(" char-delete"),f.appendString('" style="top:'),f.appendString(String(e*d)),f.appendString('px;width:1000000px;">');const v=lIe.isBasicASCII(t,s),b=lIe.containsRTL(t,v,r),w=JNe(new ZNe(a.isMonospace&&!l,a.canUseHalfwidthRightwardsArrow,t,!1,v,b,0,i,n,m,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,c,u,g,p!==ewe.OFF,null),f);if(f.appendString("</div>"),this._renderIndicators){const t=document.createElement("div");t.className=`delete-sign ${sAe.asClassName(IQe)}`,t.setAttribute("style",`position:absolute;top:${e*d}px;width:${h}px;height:${d}px;right:0;`),_.appendChild(t)}return w.characterMapping.getHorizontalOffset(w.characterMapping.length)}}function UQe(e){return e.modifiedEndLineNumber>0}function KQe(e){return e.originalEndLineNumber>0}function jQe(e){return e.modifiedStartLineNumber===e.modifiedEndLineNumber?e.modifiedEndColumn-e.modifiedStartColumn>0:e.modifiedEndLineNumber-e.modifiedStartLineNumber>0}function qQe(e){return e.originalStartLineNumber===e.originalEndLineNumber?e.originalEndColumn-e.originalStartColumn>0:e.originalEndLineNumber-e.originalStartLineNumber>0}function $Qe(){const e=document.createElement("div");return e.className="diagonal-fill",e}function GQe(){const e=document.createElement("div");return e.className="arrow-revert-change "+sAe.asClassName(pye.arrowRight),OMe("div",{},e)}function ZQe(e,t,i,n){const o=e.getLineCount();return i=Math.min(o,Math.max(1,i)),n=Math.min(o,Math.max(1,n)),t.coordinatesConverter.convertModelRangeToViewRange(new dye(i,e.getLineMinColumn(i),n,e.getLineMaxColumn(n)))}function YQe(e,t){return{enableSplitViewResizing:Kbe(e.enableSplitViewResizing,t.enableSplitViewResizing),renderSideBySide:Kbe(e.renderSideBySide,t.renderSideBySide),renderMarginRevertIcon:Kbe(e.renderMarginRevertIcon,t.renderMarginRevertIcon),maxComputationTime:qbe(e.maxComputationTime,t.maxComputationTime,0,1073741824),maxFileSize:qbe(e.maxFileSize,t.maxFileSize,0,1073741824),ignoreTrimWhitespace:Kbe(e.ignoreTrimWhitespace,t.ignoreTrimWhitespace),renderIndicators:Kbe(e.renderIndicators,t.renderIndicators),originalEditable:Kbe(e.originalEditable,t.originalEditable),diffCodeLens:Kbe(e.diffCodeLens,t.diffCodeLens),renderOverviewRuler:Kbe(e.renderOverviewRuler,t.renderOverviewRuler),diffWordWrap:(i=e.diffWordWrap,n=t.diffWordWrap,Ybe(i,n,["off","on","inherit"])),diffAlgorithm:Ybe(e.diffAlgorithm,t.diffAlgorithm,["smart","experimental"])};var i,n}jBe(((e,t)=>{const i=e.getColor(BOe);t.addRule(`\n\t.monaco-editor .diagonal-fill {\n\t\tbackground-image: linear-gradient(\n\t\t\t-45deg,\n\t\t\t${i} 12.5%,\n\t\t\t#0000 12.5%, #0000 50%,\n\t\t\t${i} 50%, ${i} 62.5%,\n\t\t\t#0000 62.5%, #0000 100%\n\t\t);\n\t\tbackground-size: 8px 8px;\n\t}\n\t`)}));let QQe=class extends Owe{constructor(e){super(),this._themeService=e,this._onCodeEditorAdd=this._register(new $we),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new $we),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onDiffEditorAdd=this._register(new $we),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new $we),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new $ve,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map((e=>this._codeEditors[e]))}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}removeDiffEditor(e){delete this._diffEditors[e.getId()]&&this._onDiffEditorRemove.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map((e=>this._diffEditors[e]))}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach((t=>t.removeDecorationsByType(e)))))}setModelProperty(e,t,i){const n=e.toString();let o;this._modelProperties.has(n)?o=this._modelProperties.get(n):(o=new Map,this._modelProperties.set(n,o)),o.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}openCodeEditor(e,t,i){return n=this,o=void 0,r=function*(){for(const n of this._codeEditorOpenHandlers){const o=yield n(e,t,i);if(null!==o)return o}return null},new((s=void 0)||(s=Promise))((function(e,t){function i(e){try{l(r.next(e))}catch(e){t(e)}}function a(e){try{l(r.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof s?n:new s((function(e){e(n)}))).then(i,a)}l((r=r.apply(n,o||[])).next())}));var n,o,s,r}registerCodeEditorOpenHandler(e){return Awe(this._codeEditorOpenHandlers.unshift(e))}};QQe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,VBe)],QQe);var XQe=function(e,t){return function(i,n){t(i,n,e)}};let JQe=class extends QQe{constructor(e,t){super(t),this.onCodeEditorAdd((()=>this._checkContextKey())),this.onCodeEditorRemove((()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this.registerCodeEditorOpenHandler(((e,t,i)=>{return n=this,o=void 0,r=function*(){return t?this.doOpenEditor(t,e):null},new((s=void 0)||(s=Promise))((function(e,t){function i(e){try{l(r.next(e))}catch(e){t(e)}}function a(e){try{l(r.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof s?n:new s((function(e){e(n)}))).then(i,a)}l((r=r.apply(n,o||[])).next())}));var n,o,s,r}))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const i=t.resource.scheme;if(i===$Te.http||i===$Te.https)return WMe(t.resource.toString()),e}return null}const i=t.options?t.options.selection:null;if(i)if("number"==typeof i.endLineNumber&&"number"==typeof i.endColumn)e.setSelection(i),e.revealRangeInCenter(i,1);else{const t={lineNumber:i.startLineNumber,column:i.startColumn};e.setPosition(t),e.revealPositionInCenter(t,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};JQe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([XQe(0,wke),XQe(1,VBe)],JQe),MLe(Uxe,JQe,0);const eXe=zxe("layoutService");var tXe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},iXe=function(e,t){return function(i,n){t(i,n,e)}};let nXe=class{get dimension(){return this._dimension||(this._dimension=aMe(window.document.body)),this._dimension}get hasContainer(){return!1}get container(){throw new Error("ILayoutService.container is not available in the standalone editor!")}focus(){var e;null===(e=this._codeEditorService.getFocusedCodeEditor())||void 0===e||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayout=zwe.None,this.offset={top:0,quickPickTop:0}}};nXe=tXe([iXe(0,Uxe)],nXe);let oXe=class extends nXe{get hasContainer(){return!1}get container(){return this._container}constructor(e,t){super(t),this._container=e}};oXe=tXe([iXe(1,Uxe)],oXe),MLe(eXe,nXe,1);const sXe=zxe("dialogService");var rXe=function(e,t){return function(i,n){t(i,n,e)}},aXe=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function lXe(e){return e.scheme===$Te.file?e.fsPath:e.path}let dXe=0;class hXe{constructor(e,t,i,n,o,s,r){this.id=++dXe,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=n,this.groupOrder=o,this.sourceId=s,this.sourceOrder=r,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class cXe{constructor(e,t){this.resourceLabel=e,this.reason=t}}class uXe{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,i]of this.elements)(0===i.reason?e:t).push(i.resourceLabel);const i=[];return e.length>0&&i.push(ove(0,"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(ove(0,"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join("\n")}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class gXe{constructor(e,t,i,n,o,s,r){this.id=++dXe,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,this.groupOrder=o,this.sourceId=s,this.sourceOrder=r,this.removedResources=null,this.invalidatedResources=null}canSplit(){return"function"==typeof this.actual.split}removeResource(e,t,i){this.removedResources||(this.removedResources=new uXe),this.removedResources.has(t)||this.removedResources.set(t,new cXe(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),0===this.invalidatedResources.size&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new uXe),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new cXe(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class pXe{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t<this._past.length;t++)e.push(` * [UNDO] ${this._past[t]}`);for(let t=this._future.length-1;t>=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join("\n")}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){1===e.type?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const e of this._future)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let e=0,i=this._past.length;e<i;e++)t.push(this._past[e].id);for(let e=this._future.length-1;e>=0;e--)t.push(this._future[e].id);return new Fje(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,o=-1;for(let s=0,r=this._past.length;s<r;s++,n++){const r=this._past[s];i&&(n>=t||r.id!==e.elements[n])&&(i=!1,o=0),i||1!==r.type||r.removeResource(this.resourceLabel,this.strResource,0)}let s=-1;for(let o=this._future.length-1;o>=0;o--,n++){const r=this._future[o];i&&(n>=t||r.id!==e.elements[n])&&(i=!1,s=o),i||1!==r.type||r.removeResource(this.resourceLabel,this.strResource,0)}-1!==o&&(this._past=this._past.slice(0,o)),-1!==s&&(this._future=this._future.slice(s+1)),this.versionId++}getElements(){const e=[],t=[];for(const t of this._past)e.push(t.actual);for(const e of this._future)t.push(e.actual);return{past:e,future:t}}getClosestPastElement(){return 0===this._past.length?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return 0===this._future.length?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class mXe{constructor(e){this.editStacks=e,this._versionIds=[];for(let e=0,t=this.editStacks.length;e<t;e++)this._versionIds[e]=this.editStacks[e].versionId}isValid(){for(let e=0,t=this.editStacks.length;e<t;e++)if(this._versionIds[e]!==this.editStacks[e].versionId)return!1;return!0}}const fXe=new pXe("","");fXe.locked=!0;let _Xe=class{constructor(e,t){this._dialogService=e,this._notificationService=t,this._editStacks=new Map,this._uriComparisonKeyComputers=[]}getUriComparisonKey(e){for(const t of this._uriComparisonKeyComputers)if(t[0]===e.scheme)return t[1].getComparisonKey(e);return e.toString()}_print(e){console.log("------------------------------------"),console.log(`AFTER ${e}: `);const t=[];for(const e of this._editStacks)t.push(e[1].toString());console.log(t.join("\n"))}pushElement(e,t=Bje.None,i=Wje.None){if(0===e.type){const n=lXe(e.resource),o=this.getUriComparisonKey(e.resource);this._pushElement(new hXe(e,n,o,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{const n=new Set,o=[],s=[];for(const t of e.resources){const e=lXe(t),i=this.getUriComparisonKey(t);n.has(i)||(n.add(i),o.push(e),s.push(i))}1===o.length?this._pushElement(new hXe(e,o[0],s[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new gXe(e,o,s,t.id,t.nextOrder(),i.id,i.nextOrder()))}}_pushElement(e){for(let t=0,i=e.strResources.length;t<i;t++){const i=e.resourceLabels[t],n=e.strResources[t];let o;this._editStacks.has(n)?o=this._editStacks.get(n):(o=new pXe(i,n),this._editStacks.set(n,o)),o.pushElement(e)}}getLastElement(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const e=this._editStacks.get(t);if(e.hasFutureElements())return null;const i=e.getClosestPastElement();return i?i.actual:null}return null}_splitPastWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const e of i){const t=lXe(e.resource),i=this.getUriComparisonKey(e.resource),o=new hXe(e,t,i,0,0,0,0);n.set(o.strResource,o)}for(const i of e.strResources)t&&t.has(i)||this._editStacks.get(i).splitPastWorkspaceElement(e,n)}_splitFutureWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const e of i){const t=lXe(e.resource),i=this.getUriComparisonKey(e.resource),o=new hXe(e,t,i,0,0,0,0);n.set(o.strResource,o)}for(const i of e.strResources)t&&t.has(i)||this._editStacks.get(i).splitFutureWorkspaceElement(e,n)}removeElements(e){const t="string"==typeof e?e:this.getUriComparisonKey(e);this._editStacks.has(t)&&(this._editStacks.get(t).dispose(),this._editStacks.delete(t))}setElementsValidFlag(e,t,i){const n=this.getUriComparisonKey(e);this._editStacks.has(n)&&this._editStacks.get(n).setElementsValidFlag(t,i)}createSnapshot(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).createSnapshot(e):new Fje(e,[])}restoreSnapshot(e){const t=this.getUriComparisonKey(e.resource);if(this._editStacks.has(t)){const i=this._editStacks.get(t);i.restoreSnapshot(e),i.hasPastElements()||i.hasFutureElements()||(i.dispose(),this._editStacks.delete(t))}}getElements(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).getElements():{past:[],future:[]}}_findClosestUndoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestPastElement();s&&s.sourceId===e&&(!t||s.sourceOrder>t.sourceOrder)&&(t=s,i=n)}return[t,i]}canUndo(e){if(e instanceof Wje){const[,t]=this._findClosestUndoElementWithSource(e.id);return!!t}const t=this.getUriComparisonKey(e);return!!this._editStacks.has(t)&&this._editStacks.get(t).hasPastElements()}_onError(e,t){wwe(e);for(const e of t.strResources)this.removeElements(e);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,n,o){const s=this._acquireLocks(i);let r;try{r=t()}catch(t){return s(),n.dispose(),this._onError(t,e)}return r?r.then((()=>(s(),n.dispose(),o())),(t=>(s(),n.dispose(),this._onError(t,e)))):(s(),n.dispose(),o())}_invokeWorkspacePrepare(e){return aXe(this,void 0,void 0,(function*(){if(void 0===e.actual.prepareUndoRedo)return Owe.None;const t=e.actual.prepareUndoRedo();return void 0===t?Owe.None:t}))}_invokeResourcePrepare(e,t){if(1!==e.actual.type||void 0===e.actual.prepareUndoRedo)return t(Owe.None);const i=e.actual.prepareUndoRedo();return i?"function"==typeof(n=i).dispose&&0===n.dispose.length?t(i):i.then((e=>t(e))):t(Owe.None);var n}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||fXe);return new mXe(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new vXe(this._undo(e,0,!0));for(const e of t.strResources)this.removeElements(e);return this._notificationService.warn(n),new vXe}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,ove(0,"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,ove(0,"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const e of i.editStacks)e.getClosestPastElement()!==t&&o.push(e.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,ove(0,"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const e of i.editStacks)e.locked&&s.push(e.resourceLabel);return s.length>0?this._tryToSplitAndUndo(e,t,null,ove(0,"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,ove(0,"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const n=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,n,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,n,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const i=t.getSecondClosestPastElement();if(i&&i.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}_confirmAndExecuteWorkspaceUndo(e,t,i,n){return aXe(this,void 0,void 0,(function*(){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){const o=yield this._dialogService.show(S$e.Info,ove(0,"Would you like to undo '{0}' across all files?",t.label),[ove(0,"Undo in {0} Files",i.editStacks.length),ove(0,"Undo this File"),ove(0,"Cancel")],{cancelId:2});if(2===o.choice)return;if(1===o.choice)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const s=this._checkWorkspaceUndo(e,t,i,!1);if(s)return s.returnValue;n=!0}let o;try{o=yield this._invokeWorkspacePrepare(t)}catch(e){return this._onError(e,t)}const s=this._checkWorkspaceUndo(e,t,i,!0);if(s)return o.dispose(),s.returnValue;for(const e of i.editStacks)e.moveBackward(t);return this._safeInvokeWithLocks(t,(()=>t.actual.undo()),i,o,(()=>this._continueUndoInGroup(t.groupId,n)))}))}_resourceUndo(e,t,i){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,(n=>(e.moveBackward(t),this._safeInvokeWithLocks(t,(()=>t.actual.undo()),new mXe([e]),n,(()=>this._continueUndoInGroup(t.groupId,i))))));{const e=ove(0,"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(e)}}else e.flushAllElements()}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestPastElement();s&&s.groupId===e&&(!t||s.groupOrder>t.groupOrder)&&(t=s,i=n)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);return i?this._undo(i,0,t):void 0}undo(e){if(e instanceof Wje){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return"string"==typeof e?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const n=this._editStacks.get(e),o=n.getClosestPastElement();if(o){if(o.groupId){const[e,n]=this._findClosestUndoElementInGroup(o.groupId);if(o!==e&&n)return this._undo(n,t,i)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,o);try{return 1===o.type?this._workspaceUndo(e,o,i):this._resourceUndo(n,o,i)}finally{}}}_confirmAndContinueUndo(e,t,i){return aXe(this,void 0,void 0,(function*(){if(1!==(yield this._dialogService.show(S$e.Info,ove(0,"Would you like to undo '{0}'?",i.label),[ove(0,"Yes"),ove(0,"No")],{cancelId:1})).choice)return this._undo(e,t,!0)}))}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.sourceId===e&&(!t||s.sourceOrder<t.sourceOrder)&&(t=s,i=n)}return[t,i]}canRedo(e){if(e instanceof Wje){const[,t]=this._findClosestRedoElementWithSource(e.id);return!!t}const t=this.getUriComparisonKey(e);return!!this._editStacks.has(t)&&this._editStacks.get(t).hasFutureElements()}_tryToSplitAndRedo(e,t,i,n){if(t.canSplit())return this._splitFutureWorkspaceElement(t,i),this._notificationService.warn(n),new vXe(this._redo(e));for(const e of t.strResources)this.removeElements(e);return this._notificationService.warn(n),new vXe}_checkWorkspaceRedo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndRedo(e,t,t.removedResources,ove(0,"Could not redo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndRedo(e,t,t.invalidatedResources,ove(0,"Could not redo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const e of i.editStacks)e.getClosestFutureElement()!==t&&o.push(e.resourceLabel);if(o.length>0)return this._tryToSplitAndRedo(e,t,null,ove(0,"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const e of i.editStacks)e.locked&&s.push(e.resourceLabel);return s.length>0?this._tryToSplitAndRedo(e,t,null,ove(0,"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,ove(0,"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),n=this._checkWorkspaceRedo(e,t,i,!1);return n?n.returnValue:this._executeWorkspaceRedo(e,t,i)}_executeWorkspaceRedo(e,t,i){return aXe(this,void 0,void 0,(function*(){let n;try{n=yield this._invokeWorkspacePrepare(t)}catch(e){return this._onError(e,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return n.dispose(),o.returnValue;for(const e of i.editStacks)e.moveForward(t);return this._safeInvokeWithLocks(t,(()=>t.actual.redo()),i,n,(()=>this._continueRedoInGroup(t.groupId)))}))}_resourceRedo(e,t){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,(i=>(e.moveForward(t),this._safeInvokeWithLocks(t,(()=>t.actual.redo()),new mXe([e]),i,(()=>this._continueRedoInGroup(t.groupId))))));{const e=ove(0,"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(e)}}else e.flushAllElements()}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.groupId===e&&(!t||s.groupOrder<t.groupOrder)&&(t=s,i=n)}return[t,i]}_continueRedoInGroup(e){if(!e)return;const[,t]=this._findClosestRedoElementInGroup(e);return t?this._redo(t):void 0}redo(e){if(e instanceof Wje){const[,t]=this._findClosestRedoElementWithSource(e.id);return t?this._redo(t):void 0}return"string"==typeof e?this._redo(e):this._redo(this.getUriComparisonKey(e))}_redo(e){if(!this._editStacks.has(e))return;const t=this._editStacks.get(e),i=t.getClosestFutureElement();if(i){if(i.groupId){const[e,t]=this._findClosestRedoElementInGroup(i.groupId);if(i!==e&&t)return this._redo(t)}try{return 1===i.type?this._workspaceRedo(e,i):this._resourceRedo(t,i)}finally{}}}};_Xe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([rXe(0,sXe),rXe(1,k$e)],_Xe);class vXe{constructor(e){this.returnValue=e}}MLe(Pje,_Xe,1);const bXe=zxe("openerService");function wXe(e,t){return QCe.isUri(e)?BSe(e.scheme,t):WSe(e,t+":")}function CXe(e,...t){return t.some((t=>wXe(e,t)))}const yXe=zxe("ILanguageFeatureDebounceService");var SXe;!function(e){const t=new WeakMap;let i=0;e.of=function(e){let n=t.get(e);return void 0===n&&(n=++i,t.set(e,n)),n}}(SXe||(SXe={}));class xXe{constructor(e,t,i,n,o,s){this._logService=e,this._name=t,this._registry=i,this._default=n,this._min=o,this._max=s,this._cache=new TGe(50,.7)}_key(e){return e.id+this._registry.all(e).reduce(((e,t)=>sEe(SXe.of(t),e)),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?KZe(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let n=this._cache.get(i);n||(n=new qZe(6),this._cache.set(i,n));const o=KZe(n.update(t),this._min,this._max);return wXe(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new jZe;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){return KZe(0|this._overall()||this._default,this._min,this._max)}}let kXe=class{constructor(e){this._logService=e,this._data=new Map}for(e,t,i){var n,o,s;const r=null!==(n=null==i?void 0:i.min)&&void 0!==n?n:50,a=null!==(o=null==i?void 0:i.max)&&void 0!==o?o:Math.pow(r,2),l=null!==(s=null==i?void 0:i.key)&&void 0!==s?s:void 0,d=`${SXe.of(e)},${r}${l?","+l:""}`;let h=this._data.get(d);return h||(h=new xXe(this._logService,t,e,0|this._overallAverage()||1.5*r,r,a),this._data.set(d,h)),h}_overallAverage(){const e=new jZe;for(const t of this._data.values())e.update(t.default());return e.value}};kXe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,yNe)],kXe),MLe(yXe,kXe,1);const LXe=zxe("IWorkspaceEditService");class DXe{constructor(e){this.metadata=e}static convert(e){return e.edits.map((e=>{if(EXe.is(e))return EXe.lift(e);if(NXe.is(e))return NXe.lift(e);throw new Error("Unsupported edit")}))}}class EXe extends DXe{static is(e){return e instanceof EXe||_be(e)&&QCe.isUri(e.resource)&&_be(e.textEdit)}static lift(e){return e instanceof EXe?e:new EXe(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i}}class NXe extends DXe{static is(e){return e instanceof NXe||_be(e)&&(Boolean(e.newResource)||Boolean(e.oldResource))}static lift(e){return e instanceof NXe?e:new NXe(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},n){super(n),this.oldResource=e,this.newResource=t,this.options=i}}const IXe=Object.freeze({id:"editor",order:5,type:"object",title:ove(0,"Editor"),scope:5}),TXe=Object.assign(Object.assign({},IXe),{properties:{"editor.tabSize":{type:"number",default:Pbe.tabSize,minimum:1,markdownDescription:ove(0,"The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:ove(0,'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:Pbe.insertSpaces,markdownDescription:ove(0,"Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:Pbe.detectIndentation,markdownDescription:ove(0,"Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:Pbe.trimAutoWhitespace,description:ove(0,"Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:Pbe.largeFileOptimizations,description:ove(0,"Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:ove(0,"Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[ove(0,"Only suggest words from the active document."),ove(0,"Suggest words from all open documents of the same language."),ove(0,"Suggest words from all open documents.")],description:ove(0,"Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[ove(0,"Semantic highlighting enabled for all color themes."),ove(0,"Semantic highlighting disabled for all color themes."),ove(0,"Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:ove(0,"Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:ove(0,"Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:ove(0,"Lines above this length will not be tokenized for performance reasons")},"editor.language.brackets":{type:["array","null"],default:null,description:ove(0,"Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:ove(0,"The opening bracket character or string sequence.")},{type:"string",description:ove(0,"The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:ove(0,"Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:ove(0,"The opening bracket character or string sequence.")},{type:"string",description:ove(0,"The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:5e3,description:ove(0,"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:50,description:ove(0,"Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:!0,description:ove(0,"Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:!0,description:ove(0,"When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:!0,description:ove(0,"When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:!0,description:ove(0,"Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:!1,description:ove(0,"Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:"inherit",markdownEnumDescriptions:[ove(0,"Lines will never wrap."),ove(0,"Lines will wrap at the viewport width."),ove(0,"Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["smart","experimental"],default:"smart",markdownEnumDescriptions:[ove(0,"Uses the default diffing algorithm."),ove(0,"Uses an experimental diffing algorithm.")]}}});function MXe(e){return void 0!==e.type||void 0!==e.anyOf}for(const e of fwe){const t=e.schema;if(void 0!==t)if(MXe(t))TXe.properties[`editor.${e.name}`]=t;else for(const e in t)Object.hasOwnProperty.call(t,e)&&(TXe.properties[e]=t[e])}let AXe=null;function RXe(){return null===AXe&&(AXe=Object.create(null),Object.keys(TXe.properties).forEach((e=>{AXe[e]=!0}))),AXe}RLe.as(BLe).registerConfiguration(TXe);class OXe{static insert(e,t){return{range:new dye(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}function PXe(e){return Object.isFrozen(e)?e:function(e){if(!e||"object"!=typeof e)return e;const t=[e];for(;t.length>0;){const e=t.shift();Object.freeze(e);for(const i in e)if(Ibe.call(e,i)){const n=e[i];"object"!=typeof n||Object.isFrozen(n)||vbe(n)||t.push(n)}}return e}(e)}class FXe{constructor(e={},t=[],i=[],n){this._contents=e,this._keys=t,this._overrides=i,this.raw=n,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if(null===(e=this.raw)||void 0===e?void 0:e.length){const e=this.raw.map((e=>{if(e instanceof FXe)return e;const t=new BXe("");return t.parseRaw(e),t.configurationModel}));this._rawConfiguration=e.reduce(((e,t)=>t===e?t:e.merge(t)),e[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return 0===this._keys.length&&0===Object.keys(this._contents).length&&0===this._overrides.length}getValue(e){return e?ELe(this.contents,e):this.contents}inspect(e,t){const i=this.rawConfiguration.getValue(e);return{value:i,override:t?this.rawConfiguration.getOverrideValue(e,t):void 0,merged:t?this.rawConfiguration.override(t).getValue(e):i}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?ELe(i,e):i:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){var t,i;const n=Nbe(this.contents),o=Nbe(this.overrides),s=[...this.keys],r=(null===(t=this.raw)||void 0===t?void 0:t.length)?[...this.raw]:[this];for(const t of e)if(r.push(...(null===(i=t.raw)||void 0===i?void 0:i.length)?t.raw:[t]),!t.isEmpty()){this.mergeContents(n,t.contents);for(const e of t.overrides){const[t]=o.filter((t=>tbe(t.identifiers,e.identifiers)));t?(this.mergeContents(t.contents,e.contents),t.keys.push(...e.keys),t.keys=nbe(t.keys)):o.push(Nbe(e))}for(const e of t.keys)-1===s.indexOf(e)&&s.push(e)}return new FXe(n,s,o,r.every((e=>e instanceof FXe))?void 0:r)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||"object"!=typeof t||!Object.keys(t).length)return this;const i={};for(const e of nbe([...Object.keys(this.contents),...Object.keys(t)])){let n=this.contents[e];const o=t[e];o&&("object"==typeof n&&"object"==typeof o?(n=Nbe(n),this.mergeContents(n,o)):n=o),i[e]=n}return new FXe(i,this.keys,this.overrides)}mergeContents(e,t){for(const i of Object.keys(t))i in e&&_be(e[i])&&_be(t[i])?this.mergeContents(e[i],t[i]):e[i]=Nbe(t[i])}getContentsForOverrideIdentifer(e){let t=null,i=null;const n=e=>{e&&(i?this.mergeContents(i,e):i=Nbe(e))};for(const i of this.overrides)tbe(i.identifiers,[e])?t=i.contents:i.identifiers.includes(e)&&n(i.contents);return n(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);-1!==t&&(this.keys.splice(t,1),LLe(this.contents,e),YLe.test(e)&&this.overrides.splice(this.overrides.findIndex((t=>tbe(t.identifiers,QLe(e)))),1))}updateValue(e,t,i){kLe(this.contents,e,t,(e=>console.error(e))),(i=i||-1===this.keys.indexOf(e))&&this.keys.push(e),YLe.test(e)&&this.overrides.push({identifiers:QLe(e),keys:Object.keys(this.contents[e]),contents:xLe(this.contents[e],(e=>console.error(e)))})}}class BXe{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new FXe}parseRaw(e,t){this._raw=e;const{contents:i,keys:n,overrides:o,restricted:s,hasExcludedProperties:r}=this.doParseRaw(e,t);this._configurationModel=new FXe(i,n,o,r?[e]:void 0),this._restrictedConfigurations=s||[]}doParseRaw(e,t){const i=RLe.as(BLe).getConfigurationProperties(),n=this.filter(e,i,!0,t);return{contents:xLe(e=n.raw,(e=>console.error(`Conflict in settings file ${this._name}: ${e}`))),keys:Object.keys(e),overrides:this.toOverrides(e,(e=>console.error(`Conflict in settings file ${this._name}: ${e}`))),restricted:n.restricted,hasExcludedProperties:n.hasExcludedProperties}}filter(e,t,i,n){let o=!1;if(!(null==n?void 0:n.scopes)&&!(null==n?void 0:n.skipRestricted))return{raw:e,restricted:[],hasExcludedProperties:o};const s={},r=[];for(const a in e)if(YLe.test(a)&&i){const i=this.filter(e[a],t,!1,n);s[a]=i.raw,o=o||i.hasExcludedProperties,r.push(...i.restricted)}else{const i=t[a],l=i?void 0!==i.scope?i.scope:3:void 0;(null==i?void 0:i.restricted)&&r.push(a),void 0!==l&&void 0!==n.scopes&&!n.scopes.includes(l)||n.skipRestricted&&(null==i?void 0:i.restricted)?o=!0:s[a]=e[a]}return{raw:s,restricted:r,hasExcludedProperties:o}}toOverrides(e,t){const i=[];for(const n of Object.keys(e))if(YLe.test(n)){const o={};for(const t in e[n])o[t]=e[n][t];i.push({identifiers:QLe(n),keys:Object.keys(o),contents:xLe(o,t)})}return i}}class WXe{constructor(e,t,i,n,o,s,r,a,l,d,h,c,u){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=n,this.defaultConfiguration=o,this.policyConfiguration=s,this.applicationConfiguration=r,this.userConfiguration=a,this.localUserConfiguration=l,this.remoteUserConfiguration=d,this.workspaceConfiguration=h,this.folderConfigurationModel=c,this.memoryConfigurationModel=u}inspect(e,t,i){const n=e.inspect(t,i);return{get value(){return PXe(n.value)},get override(){return PXe(n.override)},get merged(){return PXe(n.merged)}}}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.inspect(this.userConfiguration,this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return void 0!==this.userInspectValue.value||void 0!==this.userInspectValue.override?{value:this.userInspectValue.value,override:this.userInspectValue.override}:void 0}}class VXe{constructor(e,t,i,n,o=new FXe,s=new FXe,r=new NGe,a=new FXe,l=new NGe){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=n,this._remoteUserConfiguration=o,this._workspaceConfiguration=s,this._folderConfigurations=r,this._memoryConfiguration=a,this._memoryConfigurationByResource=l,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new NGe,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let n;i.resource?(n=this._memoryConfigurationByResource.get(i.resource),n||(n=new FXe,this._memoryConfigurationByResource.set(i.resource,n))):n=this._memoryConfiguration,void 0===t?n.removeValue(e):n.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const n=this.getConsolidatedConfigurationModel(e,t,i),o=this.getFolderConfigurationModelForResource(t.resource,i),s=t.resource&&this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration,r=new Set;for(const t of n.overrides)for(const i of t.identifiers)void 0!==n.getOverrideValue(e,i)&&r.add(i);return new WXe(e,t,n.getValue(e),r.size?[...r]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,o||void 0,s)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,i){let n=this.getConsolidatedConfigurationModelForResource(t,i);return t.overrideIdentifier&&(n=n.override(t.overrideIdentifier)),this._policyConfiguration.isEmpty()||void 0===this._policyConfiguration.getValue(e)||(n=n.merge(this._policyConfiguration)),n}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const n=t.getFolder(e);n&&(i=this.getFolderConsolidatedConfiguration(n.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),n=this._folderConfigurations.get(e);n?(t=i.merge(n),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce(((e,t)=>{const{contents:i,overrides:n,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:n,keys:o}]),e}),[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),i=this.parseConfigurationModel(e.policy),n=this.parseConfigurationModel(e.application),o=this.parseConfigurationModel(e.user),s=this.parseConfigurationModel(e.workspace),r=e.folders.reduce(((e,t)=>(e.set(QCe.revive(t[0]),this.parseConfigurationModel(t[1])),e)),new NGe);return new VXe(t,i,n,o,new FXe,s,r,new FXe,new NGe)}static parseConfigurationModel(e){return new FXe(e.contents,e.keys,e.overrides)}}class HXe{constructor(e,t,i,n){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=n,this._marker="\n",this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const t of e.keys)this.affectedKeys.add(t);for(const[,t]of e.overrides)for(const e of t)this.affectedKeys.add(e);this._affectsConfigStr=this._marker;for(const e of this.affectedKeys)this._affectsConfigStr+=e+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=VXe.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var i;const n=this._marker+e,o=this._affectsConfigStr.indexOf(n);if(o<0)return!1;const s=o+n.length;if(s>=this._affectsConfigStr.length)return!1;const r=this._affectsConfigStr.charCodeAt(s);return(r===this._markerCode1||r===this._markerCode2)&&(!t||!Rbe(this.previousConfiguration?this.previousConfiguration.getValue(e,t,null===(i=this.previous)||void 0===i?void 0:i.workspace):void 0,this.currentConfiguraiton.getValue(e,t,this.currentWorkspace)))}}const zXe=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class UXe extends Owe{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:zwe.None}constructor(e,t,i,n,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=n,this._logService=o,this._onDidUpdateKeybindings=this._register(new $we),this._currentChord=null,this._currentChordChecker=new PDe,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=KXe.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new ODe,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t){const i=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(i)return i.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),null;const[n]=i.getDispatchChords();if(null===n)return this._log("\\ Keyboard event cannot be dispatched"),null;const o=this._contextKeyService.getContext(t),s=this._currentChord?this._currentChord.keypress:null;return this._getResolver().resolve(o,s,n)}_enterMultiChordMode(e,t){this._currentChord={keypress:e,label:t},this._currentChordStatusMessage=this._notificationService.status(ove(0,"({0}) was pressed. Waiting for second key of chord...",t));const i=Date.now();this._currentChordChecker.cancelAndSet((()=>{this._documentHasFocus()?Date.now()-i>5e3&&this._leaveChordMode():this._leaveChordMode()}),500),PWe.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChord=null,PWe.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[n]=i.getSingleModifierDispatchChords();if(n)return this._ignoreSingleModifiers.has(n)?(this._log(`+ Ignoring single modifier ${n} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=KXe.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=KXe.EMPTY,null===this._currentSingleModifier?(this._log(`+ Storing single modifier for possible chord ${n}.`),this._currentSingleModifier=n,this._currentSingleModifierClearTimeout.cancelAndSet((()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null}),300),!1):n===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${n} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getChords();return this._ignoreSingleModifiers=new KXe(o),null!==this._currentSingleModifier&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){let n=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let o=null,s=null;if(i){const[t]=e.getSingleModifierDispatchChords();o=t,s=t}else[o]=e.getDispatchChords(),s=this._currentChord?this._currentChord.keypress:null;if(null===o)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),n;const r=this._contextKeyService.getContext(t),a=e.getLabel(),l=this._getResolver().resolve(r,s,o);return this._logService.trace("KeybindingService#dispatch",a,null==l?void 0:l.commandId),l&&l.enterMultiChord?(n=!0,this._enterMultiChordMode(o,a),this._log("+ Entering chord mode..."),n):(this._currentChord&&(l&&l.commandId||(this._log(`+ Leaving chord mode: Nothing bound to "${this._currentChord.label} ${a}".`),this._notificationService.status(ove(0,"The key combination ({0}, {1}) is not a command.",this._currentChord.label,a),{hideAfter:1e4}),n=!0)),this._leaveChordMode(),l&&l.commandId&&(l.bubble||(n=!0),this._log(`+ Invoking command ${l.commandId}.`),void 0===l.commandArgs?this._commandService.executeCommand(l.commandId).then(void 0,(e=>this._notificationService.warn(e))):this._commandService.executeCommand(l.commandId,l.commandArgs).then(void 0,(e=>this._notificationService.warn(e))),zXe.test(l.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:l.commandId,from:"keybinding"})),n)}mightProducePrintableCharacter(e){return!e.ctrlKey&&!e.metaKey&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30)}}class KXe{constructor(e){this._ctrlKey=!!e&&e.ctrlKey,this._shiftKey=!!e&&e.shiftKey,this._altKey=!!e&&e.altKey,this._metaKey=!!e&&e.metaKey}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}KXe.EMPTY=new KXe(null);const jXe=zxe("keybindingService");class qXe{constructor(e,t,i){this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const t of e){const e=t.command;e&&"-"!==e.charAt(0)&&this._defaultBoundCommands.set(e,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=qXe.handleRemovals([].concat(e).concat(t));for(let e=0,t=this._keybindings.length;e<t;e++){const t=this._keybindings[e];0!==t.chords.length&&(t.when&&0===t.when.type||this._addKeyPress(t.chords[0],t))}}static _isTargetedForRemoval(e,t,i,n){if(t&&e.chords[0]!==t)return!1;if(i&&e.chords[1]!==i)return!1;if(n&&1!==n.type){if(!e.when)return!1;if(!function(e,t){const i=e?e.substituteConstants():void 0,n=t?t.substituteConstants():void 0;return!i&&!n||!(!i||!n)&&i.equals(n)}(n,e.when))return!1}return!0}static handleRemovals(e){const t=new Map;for(let i=0,n=e.length;i<n;i++){const n=e[i];if(n.command&&"-"===n.command.charAt(0)){const e=n.command.substring(1);t.has(e)?t.get(e).push(n):t.set(e,[n])}}if(0===t.size)return e;const i=[];for(let n=0,o=e.length;n<o;n++){const o=e[n];if(!o.command||0===o.command.length){i.push(o);continue}if("-"===o.command.charAt(0))continue;const s=t.get(o.command);if(!s||!o.isDefault){i.push(o);continue}let r=!1;for(const e of s){const t=e.chords[0],i=e.chords[1],n=e.when;if(this._isTargetedForRemoval(o,t,i,n)){r=!0;break}}r||i.push(o)}return i}_addKeyPress(e,t){const i=this._map.get(e);if(void 0===i)return this._map.set(e,[t]),void this._addToLookupMap(t);for(let e=i.length-1;e>=0;e--){const n=i[e];if(n.command===t.command)continue;const o=n.chords.length>1,s=t.chords.length>1;o&&s&&n.chords[1]!==t.chords[1]||qXe.whenIsEntirelyIncluded(n.when,t.when)&&this._removeFromLookupMap(n)}i.push(t),this._addToLookupMap(t)}_addToLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);void 0===t?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(void 0!==t)for(let i=0,n=t.length;i<n;i++)if(t[i]===e)return void t.splice(i,1)}static whenIsEntirelyIncluded(e,t){return!t||1===t.type||!(!e||1===e.type)&&Ske(e,t)}getKeybindings(){return this._keybindings}lookupPrimaryKeybinding(e,t){const i=this._lookupMap.get(e);if(void 0===i||0===i.length)return null;if(1===i.length)return i[0];for(let e=i.length-1;e>=0;e--){const n=i[e];if(t.contextMatchesRules(n.when))return n}return i[i.length-1]}resolve(e,t,i){this._log(`| Resolving ${i}${t?` chorded from ${t}`:""}`);let n=null;if(null!==t){const e=this._map.get(t);if(void 0===e)return this._log("\\ No keybinding entries."),null;n=[];for(let t=0,o=e.length;t<o;t++){const o=e[t];o.chords[1]===i&&n.push(o)}}else{const e=this._map.get(i);if(void 0===e)return this._log("\\ No keybinding entries."),null;n=e}const o=this._findCommand(e,n);return o?null===t&&o.chords.length>1&&null!==o.chords[1]?(this._log(`\\ From ${n.length} keybinding entries, matched chord, when: ${$Xe(o.when)}, source: ${GXe(o)}.`),{enterMultiChord:!0,leaveMultiChord:!1,commandId:null,commandArgs:null,bubble:!1}):(this._log(`\\ From ${n.length} keybinding entries, matched ${o.command}, when: ${$Xe(o.when)}, source: ${GXe(o)}.`),{enterMultiChord:!1,leaveMultiChord:o.chords.length>1,commandId:o.command,commandArgs:o.commandArgs,bubble:o.bubble}):(this._log(`\\ From ${n.length} keybinding entries, no when clauses matched the context.`),null)}_findCommand(e,t){for(let i=t.length-1;i>=0;i--){const n=t[i];if(qXe._contextMatchesRules(e,n.when))return n}return null}static _contextMatchesRules(e,t){return!t||t.evaluate(e)}}function $Xe(e){return e?`${e.serialize()}`:"no when condition"}function GXe(e){return e.extensionId?e.isBuiltinExtension?`built-in extension ${e.extensionId}`:`user extension ${e.extensionId}`:e.isDefault?"built-in":"user"}class ZXe{constructor(e,t,i,n,o,s,r){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?YXe(e.getDispatchChords()):[],e&&0===this.chords.length&&(this.chords=YXe(e.getSingleModifierDispatchChords())),this.bubble=!!t&&94===t.charCodeAt(0),this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=n,this.isDefault=o,this.extensionId=s,this.isBuiltinExtension=r}}function YXe(e){const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];if(!n)return[];t.push(n)}return t}class QXe{constructor(e,t,i=t){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=i}toLabel(e,t,i){if(0===t.length)return null;const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=i(s);if(null===r)return null;n[o]=tJe(s,r,this.modifierLabels[e])}return n.join(" ")}}const XXe=new QXe({ctrlKey:"⌃",shiftKey:"⇧",altKey:"⌥",metaKey:"⌘",separator:""},{ctrlKey:ove(0,"Ctrl"),shiftKey:ove(0,"Shift"),altKey:ove(0,"Alt"),metaKey:ove(0,"Windows"),separator:"+"},{ctrlKey:ove(0,"Ctrl"),shiftKey:ove(0,"Shift"),altKey:ove(0,"Alt"),metaKey:ove(0,"Super"),separator:"+"}),JXe=new QXe({ctrlKey:ove(0,"Control"),shiftKey:ove(0,"Shift"),altKey:ove(0,"Option"),metaKey:ove(0,"Command"),separator:"+"},{ctrlKey:ove(0,"Control"),shiftKey:ove(0,"Shift"),altKey:ove(0,"Alt"),metaKey:ove(0,"Windows"),separator:"+"},{ctrlKey:ove(0,"Control"),shiftKey:ove(0,"Shift"),altKey:ove(0,"Alt"),metaKey:ove(0,"Super"),separator:"+"}),eJe=new QXe({ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Cmd",separator:"+"},{ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Super",separator:"+"});function tJe(e,t,i){if(null===t)return"";const n=[];return e.ctrlKey&&n.push(i.ctrlKey),e.shiftKey&&n.push(i.shiftKey),e.altKey&&n.push(i.altKey),e.metaKey&&n.push(i.metaKey),""!==t&&n.push(t),n.join(i.separator)}new QXe({ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"cmd",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"win",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"meta",separator:"+"});class iJe extends HIe{constructor(e,t){if(super(),0===t.length)throw Lwe("chords");this._os=e,this._chords=t}getLabel(){return XXe.toLabel(this._os,this._chords,(e=>this._getLabel(e)))}getAriaLabel(){return JXe.toLabel(this._os,this._chords,(e=>this._getAriaLabel(e)))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:eJe.toLabel(this._os,this._chords,(e=>this._getElectronAccelerator(e)))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map((e=>this._getChord(e)))}_getChord(e){return new VIe(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map((e=>this._getChordDispatch(e)))}getSingleModifierDispatchChords(){return this._chords.map((e=>this._getSingleModifierChordDispatch(e)))}}class nJe extends iJe{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(2===this._os)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return _Ce.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":_Ce.toString(e.keyCode)}_getElectronAccelerator(e){return _Ce.toElectronAccelerator(e.keyCode)}_getChordDispatch(e){return nJe.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=_Ce.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return 5!==e.keyCode||e.shiftKey||e.altKey||e.metaKey?4!==e.keyCode||e.ctrlKey||e.altKey||e.metaKey?6!==e.keyCode||e.ctrlKey||e.shiftKey||e.metaKey?57!==e.keyCode||e.ctrlKey||e.shiftKey||e.altKey?null:"meta":"alt":"shift":"ctrl"}static _scanCodeToKeyCode(e){const t=mCe[e];if(-1!==t)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 83;case 52:return 81;case 53:return 87;case 54:return 89;case 55:return 88;case 56:return 0;case 57:return 80;case 58:return 90;case 59:return 86;case 60:return 82;case 61:return 84;case 62:return 85;case 106:return 92}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof BIe)return e;const t=this._scanCodeToKeyCode(e.scanCode);return 0===t?null:new BIe(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=YXe(e.chords.map((e=>this._toKeyCodeChord(e))));return i.length>0?[new nJe(i,t)]:[]}}const oJe=zxe("labelService");class sJe{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos<this._value.length-1}cmp(e){return e.charCodeAt(0)-this._value.charCodeAt(this._pos)}value(){return this._value[this._pos]}}class rJe{constructor(e=!0){this._caseSensitive=e}reset(e){return this._value=e,this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let e=!0;for(;this._to<this._value.length;this._to++)if(46===this._value.charCodeAt(this._to)){if(!e)break;this._from++}else e=!1;return this}cmp(e){return this._caseSensitive?MSe(e,this._value,0,e.length,this._from,this._to):RSe(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class aJe{constructor(e=!0,t=!0){this._splitOnBackslash=e,this._caseSensitive=t}reset(e){this._from=0,this._to=0,this._value=e,this._valueLen=e.length;for(let t=e.length-1;t>=0;t--,this._valueLen--){const e=this._value.charCodeAt(t);if(!(47===e||this._splitOnBackslash&&92===e))break}return this.next()}hasNext(){return this._to<this._valueLen}next(){this._from=this._to;let e=!0;for(;this._to<this._valueLen;this._to++){const t=this._value.charCodeAt(this._to);if(47===t||this._splitOnBackslash&&92===t){if(!e)break;this._from++}else e=!1}return this}cmp(e){return this._caseSensitive?MSe(e,this._value,0,e.length,this._from,this._to):RSe(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class lJe{constructor(e,t){this._ignorePathCasing=e,this._ignoreQueryAndFragment=t,this._states=[],this._stateIdx=0}reset(e){return this._value=e,this._states=[],this._value.scheme&&this._states.push(1),this._value.authority&&this._states.push(2),this._value.path&&(this._pathIterator=new aJe(!1,!this._ignorePathCasing(e)),this._pathIterator.reset(e.path),this._pathIterator.value()&&this._states.push(3)),this._ignoreQueryAndFragment(e)||(this._value.query&&this._states.push(4),this._value.fragment&&this._states.push(5)),this._stateIdx=0,this}next(){return 3===this._states[this._stateIdx]&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return 3===this._states[this._stateIdx]&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(e){if(1===this._states[this._stateIdx])return ASe(e,this._value.scheme);if(2===this._states[this._stateIdx])return ASe(e,this._value.authority);if(3===this._states[this._stateIdx])return this._pathIterator.cmp(e);if(4===this._states[this._stateIdx])return TSe(e,this._value.query);if(5===this._states[this._stateIdx])return TSe(e,this._value.fragment);throw new Error}value(){if(1===this._states[this._stateIdx])return this._value.scheme;if(2===this._states[this._stateIdx])return this._value.authority;if(3===this._states[this._stateIdx])return this._pathIterator.value();if(4===this._states[this._stateIdx])return this._value.query;if(5===this._states[this._stateIdx])return this._value.fragment;throw new Error}}class dJe{constructor(){this.height=1}rotateLeft(){const e=this.right;return this.right=e.left,e.left=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){const e=this.left;return this.left=e.right,e.right=this,this.updateHeight(),e.updateHeight(),e}updateHeight(){this.height=1+Math.max(this.heightLeft,this.heightRight)}balanceFactor(){return this.heightRight-this.heightLeft}get heightLeft(){var e,t;return null!==(t=null===(e=this.left)||void 0===e?void 0:e.height)&&void 0!==t?t:0}get heightRight(){var e,t;return null!==(t=null===(e=this.right)||void 0===e?void 0:e.height)&&void 0!==t?t:0}}class hJe{static forUris(e=()=>!1,t=()=>!1){return new hJe(new lJe(e,t))}static forStrings(){return new hJe(new sJe)}static forConfigKeys(){return new hJe(new rJe)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let n;this._root||(this._root=new dJe,this._root.segment=i.value());const o=[];for(n=this._root;;){const e=i.cmp(n.segment);if(e>0)n.left||(n.left=new dJe,n.left.segment=i.value()),o.push([-1,n]),n=n.left;else if(e<0)n.right||(n.right=new dJe,n.right.segment=i.value()),o.push([1,n]),n=n.right;else{if(!i.hasNext())break;i.next(),n.mid||(n.mid=new dJe,n.mid.segment=i.value()),o.push([0,n]),n=n.mid}}const s=n.value;n.value=t,n.key=e;for(let e=o.length-1;e>=0;e--){const t=o[e][1];t.updateHeight();const i=t.balanceFactor();if(i<-1||i>1){const i=o[e][0],n=o[e+1][0];if(1===i&&1===n)o[e][1]=t.rotateLeft();else if(-1===i&&-1===n)o[e][1]=t.rotateRight();else if(1===i&&-1===n)t.right=o[e+1][1]=o[e+1][1].rotateRight(),o[e][1]=t.rotateLeft();else{if(-1!==i||1!==n)throw new Error;t.left=o[e+1][1]=o[e+1][1].rotateLeft(),o[e][1]=t.rotateRight()}if(e>0)switch(o[e-1][0]){case-1:o[e-1][1].left=o[e][1];break;case 1:o[e-1][1].right=o[e][1];break;case 0:o[e-1][1].mid=o[e][1]}else this._root=o[0][1]}}return s}get(e){var t;return null===(t=this._getNode(e))||void 0===t?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const e=t.cmp(i.segment);if(e>0)i=i.left;else if(e<0)i=i.right;else{if(!t.hasNext())break;t.next(),i=i.mid}}return i}has(e){const t=this._getNode(e);return!(void 0===(null==t?void 0:t.value)&&void 0===(null==t?void 0:t.mid))}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var i;const n=this._iter.reset(e),o=[];let s=this._root;for(;s;){const e=n.cmp(s.segment);if(e>0)o.push([-1,s]),s=s.left;else if(e<0)o.push([1,s]),s=s.right;else{if(!n.hasNext())break;n.next(),o.push([0,s]),s=s.mid}}if(s){if(t?(s.left=void 0,s.mid=void 0,s.right=void 0,s.height=1):(s.key=void 0,s.value=void 0),!s.mid&&!s.value)if(s.left&&s.right){const e=this._min(s.right);if(e.key){const{key:t,value:i,segment:n}=e;this._delete(e.key,!1),s.key=t,s.value=i,s.segment=n}}else{const e=null!==(i=s.left)&&void 0!==i?i:s.right;if(o.length>0){const[t,i]=o[o.length-1];switch(t){case-1:i.left=e;break;case 0:i.mid=e;break;case 1:i.right=e}}else this._root=e}for(let e=o.length-1;e>=0;e--){const t=o[e][1];t.updateHeight();const i=t.balanceFactor();if(i>1?(t.right.balanceFactor()>=0||(t.right=t.right.rotateRight()),o[e][1]=t.rotateLeft()):i<-1&&(t.left.balanceFactor()<=0||(t.left=t.left.rotateLeft()),o[e][1]=t.rotateRight()),e>0)switch(o[e-1][0]){case-1:o[e-1][1].left=o[e][1];break;case 1:o[e-1][1].right=o[e][1];break;case 0:o[e-1][1].mid=o[e][1]}else this._root=o[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i,n=this._root;for(;n;){const e=t.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else{if(!t.hasNext())break;t.next(),i=n.value||i,n=n.mid}}return n&&n.value||i}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let n=this._root;for(;n;){const e=i.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else{if(!i.hasNext())return n.mid?this._entries(n.mid):t?n.value:void 0;i.next(),n=n.mid}}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value&&t.push([e.key,e.value]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}const cJe=zxe("contextService");class uJe{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}var gJe,pJe,mJe,fJe,_Je,vJe,bJe,wJe,CJe;ove(0,"Code Workspace"),function(e){e.noSelection=ove(0,"No selection"),e.singleSelectionRange=ove(0,"Line {0}, Column {1} ({2} selected)"),e.singleSelection=ove(0,"Line {0}, Column {1}"),e.multiSelectionRange=ove(0,"{0} selections ({1} characters selected)"),e.multiSelection=ove(0,"{0} selections"),e.emergencyConfOn=ove(0,"Now changing the setting `accessibilitySupport` to 'on'."),e.openingDocs=ove(0,"Now opening the Editor Accessibility documentation page."),e.readonlyDiffEditor=ove(0," in a read-only pane of a diff editor."),e.editableDiffEditor=ove(0," in a pane of a diff editor."),e.readonlyEditor=ove(0," in a read-only code editor"),e.editableEditor=ove(0," in a code editor"),e.changeConfigToOnMac=ove(0,"To configure the editor to be optimized for usage with a Screen Reader press Command+E now."),e.changeConfigToOnWinLinux=ove(0,"To configure the editor to be optimized for usage with a Screen Reader press Control+E now."),e.auto_on=ove(0,"The editor is configured to be optimized for usage with a Screen Reader."),e.auto_off=ove(0,"The editor is configured to never be optimized for usage with a Screen Reader, which is not the case at this time."),e.tabFocusModeOnMsg=ove(0,"Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior by pressing {0}."),e.tabFocusModeOnMsgNoKb=ove(0,"Pressing Tab in the current editor will move focus to the next focusable element. The command {0} is currently not triggerable by a keybinding."),e.tabFocusModeOffMsg=ove(0,"Pressing Tab in the current editor will insert the tab character. Toggle this behavior by pressing {0}."),e.tabFocusModeOffMsgNoKb=ove(0,"Pressing Tab in the current editor will insert the tab character. The command {0} is currently not triggerable by a keybinding."),e.openDocMac=ove(0,"Press Command+H now to open a browser window with more information related to editor accessibility."),e.openDocWinLinux=ove(0,"Press Control+H now to open a browser window with more information related to editor accessibility."),e.outroMsg=ove(0,"You can dismiss this tooltip and return to the editor by pressing Escape or Shift+Escape."),e.showAccessibilityHelpAction=ove(0,"Show Accessibility Help")}(gJe||(gJe={})),function(e){e.inspectTokensAction=ove(0,"Developer: Inspect Tokens")}(pJe||(pJe={})),function(e){e.gotoLineActionLabel=ove(0,"Go to Line/Column...")}(mJe||(mJe={})),function(e){e.helpQuickAccessActionLabel=ove(0,"Show all Quick Access Providers")}(fJe||(fJe={})),function(e){e.quickCommandActionLabel=ove(0,"Command Palette"),e.quickCommandHelp=ove(0,"Show And Run Commands")}(_Je||(_Je={})),function(e){e.quickOutlineActionLabel=ove(0,"Go to Symbol..."),e.quickOutlineByCategoryActionLabel=ove(0,"Go to Symbol by Category...")}(vJe||(vJe={})),function(e){e.editorViewAccessibleLabel=ove(0,"Editor content"),e.accessibilityHelpMessage=ove(0,"Press Alt+F1 for Accessibility Options.")}(bJe||(bJe={})),function(e){e.toggleHighContrast=ove(0,"Toggle High Contrast Theme")}(wJe||(wJe={})),function(e){e.bulkEditServiceSummary=ove(0,"Made {0} edits in {1} files")}(CJe||(CJe={}));const yJe=zxe("workspaceTrustManagementService");var SJe,xJe=i(1452),kJe={};function LJe(e,t,i){const n=i.mode===SJe.ALIGN?i.offset:i.offset+i.size,o=i.mode===SJe.ALIGN?i.offset+i.size:i.offset;return 0===i.position?t<=e-n?n:t<=o?o-t:Math.max(e-t,0):t<=o?o-t:t<=e-n?n:0}kJe.styleTagTransform=zl(),kJe.setAttributes=Bl(),kJe.insert=Pl().bind(null,"head"),kJe.domAPI=Rl(),kJe.insertStyleElement=Vl(),Ml()(xJe.A,kJe),xJe.A&&xJe.A.locals&&xJe.A.locals,function(e){e[e.AVOID=0]="AVOID",e[e.ALIGN=1]="ALIGN"}(SJe||(SJe={}));class DJe extends Owe{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=Owe.None,this.toDisposeOnSetContainer=Owe.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=OMe(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,FMe(this.view),this.setContainer(e,t),this._register(Awe((()=>this.setContainer(null,1))))}setContainer(e,t){var i;if(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,null===(i=this.shadowRootHostElement)||void 0===i||i.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e){if(this.container=e,this.useFixedPosition=1!==t,this.useShadowDOM=3===t,this.useShadowDOM){this.shadowRootHostElement=OMe(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=EJe,this.shadowRoot.appendChild(e),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(OMe("slot"))}else this.container.appendChild(this.view);const i=new Rwe;DJe.BUBBLE_UP_EVENTS.forEach((e=>{i.add(iMe(this.container,e,(e=>{this.onDOMEvent(e,!1)})))})),DJe.BUBBLE_DOWN_EVENTS.forEach((e=>{i.add(iMe(this.container,e,(e=>{this.onDOMEvent(e,!0)}),!0))})),this.toDisposeOnSetContainer=i}}show(e){var t,i;this.isVisible()&&this.hide(),XTe(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2575",this.view.style.position=this.useFixedPosition?"fixed":"absolute",PMe(this.view),this.toDisposeOnClean=e.render(this.view)||Owe.None,this.delegate=e,this.doLayout(),null===(i=(t=this.delegate).focus)||void 0===i||i.call(t)}getViewElement(){return this.view}layout(){this.isVisible()&&(!1!==this.delegate.canRelayout||Mve&&OIe?(this.delegate.layout&&this.delegate.layout(),this.doLayout()):this.hide())}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(kMe(e)){const i=hMe(e),n=function(e){let t=e,i=1;do{const e=rMe(t).zoom;null!=e&&"1"!==e&&(i*=e),t=t.parentElement}while(null!==t&&t!==document.documentElement);return i}(e);t={top:i.top*n,left:i.left*n,width:i.width*n,height:i.height*n}}else t={top:e.y,left:e.x,width:e.width||1,height:e.height||2};const i=cMe(this.view),n=pMe(this.view),o=this.delegate.anchorPosition||0,s=this.delegate.anchorAlignment||0;let r,a;if(0===(this.delegate.anchorAxisAlignment||0)){const e={offset:t.top-window.pageYOffset,size:t.height,position:0===o?0:1},l={offset:t.left,size:t.width,position:0===s?0:1,mode:SJe.ALIGN};r=LJe(window.innerHeight,n,e)+window.pageYOffset,$Ze.intersects({start:r,end:r+n},{start:e.offset,end:e.offset+e.size})&&(l.mode=SJe.AVOID),a=LJe(window.innerWidth,i,l)}else{const e={offset:t.left,size:t.width,position:0===s?0:1},l={offset:t.top,size:t.height,position:0===o?0:1,mode:SJe.ALIGN};a=LJe(window.innerWidth,i,e),$Ze.intersects({start:a,end:a+i},{start:e.offset,end:e.offset+e.size})&&(l.mode=SJe.AVOID),r=LJe(window.innerHeight,n,l)+window.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(0===o?"bottom":"top"),this.view.classList.add(0===s?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const l=hMe(this.container);this.view.style.top=r-(this.useFixedPosition?hMe(this.view).top:l.top)+"px",this.view.style.left=a-(this.useFixedPosition?hMe(this.view).left:l.left)+"px",this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,(null==t?void 0:t.onHide)&&t.onHide(e),this.toDisposeOnClean.dispose(),FMe(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!mMe(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}DJe.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],DJe.BUBBLE_DOWN_EVENTS=["click"];const EJe='\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t.codicon[class*=\'codicon-\'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }\n\n\t:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }\n';let NJe=class extends Owe{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=Owe.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new DJe(this.container,1)),this.layout(),this._register(e.onDidLayout((()=>this.layout())))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,i){t?t===this.container&&this.shadowRoot===i||(this.container=t,this.setContainer(t,i?3:2)):this.layoutService.hasContainer&&this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.shadowRoot=i,this.contextView.show(e);const n=Awe((()=>{this.currentViewDisposable===n&&this.hideContextView()}));return this.currentViewDisposable=n,n}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};NJe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,eXe)],NJe);var IJe=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const TJe="**",MJe="[/\\\\]",AJe="[^/\\\\]",RJe=/\//g;function OJe(e,t){switch(e){case 0:return"";case 1:return`${AJe}*?`;default:return`(?:${MJe}|${AJe}+${MJe}${t?`|${MJe}${AJe}+`:""})*?`}}function PJe(e,t){if(!e)return[];const i=[];let n=!1,o=!1,s="";for(const r of e){switch(r){case t:if(!n&&!o){i.push(s),s="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1}s+=r}return s&&i.push(s),i}function FJe(e){if(!e)return"";let t="";const i=PJe(e,"/");if(i.every((e=>e===TJe)))t=".*";else{let e=!1;i.forEach(((n,o)=>{if(n===TJe){if(e)return;t+=OJe(2,o===i.length-1)}else{let e=!1,s="",r=!1,a="";for(const i of n)if("}"!==i&&e)s+=i;else if(!r||"]"===i&&a)switch(i){case"{":e=!0;continue;case"[":r=!0;continue;case"}":{const i=`(?:${PJe(s,",").map((e=>FJe(e))).join("|")})`;t+=i,e=!1,s="";break}case"]":t+="["+a+"]",r=!1,a="";break;case"?":t+=AJe;continue;case"*":t+=OJe(1);continue;default:t+=SSe(i)}else{let e;e="-"===i?i:"^"!==i&&"!"!==i||a?"/"===i?"":SSe(i):"^",a+=e}o<i.length-1&&(i[o+1]!==TJe||o+2<i.length)&&(t+=MJe)}e=n===TJe}))}return t}const BJe=/^\*\*\/\*\.[\w\.-]+$/,WJe=/^\*\*\/([\w\.-]+)\/?$/,VJe=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,HJe=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,zJe=/^\*\*((\/[\w\.-]+)+)\/?$/,UJe=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,KJe=new TGe(1e4),jJe=function(){return!1},qJe=function(){return null};function $Je(e,t){if(!e)return qJe;let i;i="string"!=typeof e?e.pattern:e,i=i.trim();const n=`${i}_${!!t.trimForExclusions}`;let o,s=KJe.get(n);return s||(s=BJe.test(i)?function(e,t){return function(i,n){return"string"==typeof i&&i.endsWith(e)?t:null}}(i.substr(4),i):(o=WJe.exec(GJe(i,t)))?function(e,t){const i=`/${e}`,n=`\\${e}`,o=function(o,s){return"string"!=typeof o?null:s?s===e?t:null:o===e||o.endsWith(i)||o.endsWith(n)?t:null},s=[e];return o.basenames=s,o.patterns=[t],o.allBasenames=s,o}(o[1],i):(t.trimForExclusions?HJe:VJe).test(i)?function(e,t){const i=QJe(e.slice(1,-1).split(",").map((e=>$Je(e,t))).filter((e=>e!==qJe)),e),n=i.length;if(!n)return qJe;if(1===n)return i[0];const o=function(t,n){for(let o=0,s=i.length;o<s;o++)if(i[o](t,n))return e;return null},s=i.find((e=>!!e.allBasenames));s&&(o.allBasenames=s.allBasenames);const r=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);return r.length&&(o.allPaths=r),o}(i,t):(o=zJe.exec(GJe(i,t)))?ZJe(o[1].substr(1),i,!0):(o=UJe.exec(GJe(i,t)))?ZJe(o[1],i,!1):function(e){try{const t=new RegExp(`^${FJe(e)}$`);return function(i){return t.lastIndex=0,"string"==typeof i&&t.test(i)?e:null}}catch(e){return qJe}}(i),KJe.set(n,s)),function(e,t){if("string"==typeof t)return e;const i=function(i,n){return tKe(i,t.base,!Eve)?e(xSe(i.substr(t.base.length),UCe),n):null};return i.allBasenames=e.allBasenames,i.allPaths=e.allPaths,i.basenames=e.basenames,i.patterns=e.patterns,i}(s,e)}function GJe(e,t){return t.trimForExclusions&&e.endsWith("/**")?e.substr(0,e.length-2):e}function ZJe(e,t,i){const n=UCe===PCe.sep,o=n?e:e.replace(RJe,UCe),s=UCe+o,r=PCe.sep+e;let a;return a=i?function(i,a){return"string"!=typeof i||i!==o&&!i.endsWith(s)&&(n||i!==e&&!i.endsWith(r))?null:t}:function(i,s){return"string"!=typeof i||i!==o&&(n||i!==e)?null:t},a.allPaths=[(i?"*/":"./")+e],a}function YJe(e,t={}){if(!e)return jJe;if("string"==typeof e||function(e){const t=e;return!!t&&("string"==typeof t.base&&"string"==typeof t.pattern)}(e)){const i=$Je(e,t);if(i===qJe)return jJe;const n=function(e,t){return!!i(e,t)};return i.allBasenames&&(n.allBasenames=i.allBasenames),i.allPaths&&(n.allPaths=i.allPaths),n}return function(e,t){const i=QJe(Object.getOwnPropertyNames(e).map((i=>function(e,t,i){if(!1===t)return qJe;const n=$Je(e,i);if(n===qJe)return qJe;if("boolean"==typeof t)return n;if(t){const i=t.when;if("string"==typeof i){const t=(t,o,s,r)=>{if(!r||!n(t,o))return null;const a=r(i.replace("$(basename)",(()=>s)));return EDe(a)?a.then((t=>t?e:null)):a?e:null};return t.requiresSiblings=!0,t}}return n}(i,e[i],t))).filter((e=>e!==qJe))),n=i.length;if(!n)return qJe;if(!i.some((e=>!!e.requiresSiblings))){if(1===n)return i[0];const e=function(e,t){let n;for(let o=0,s=i.length;o<s;o++){const s=i[o](e,t);if("string"==typeof s)return s;EDe(s)&&(n||(n=[]),n.push(s))}return n?(()=>IJe(this,void 0,void 0,(function*(){for(const e of n){const t=yield e;if("string"==typeof t)return t}return null})))():null},t=i.find((e=>!!e.allBasenames));t&&(e.allBasenames=t.allBasenames);const o=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);return o.length&&(e.allPaths=o),e}const o=function(e,t,n){let o,s;for(let r=0,a=i.length;r<a;r++){const a=i[r];a.requiresSiblings&&n&&(t||(t=HCe(e)),o||(o=t.substr(0,t.length-zCe(e).length)));const l=a(e,t,o,n);if("string"==typeof l)return l;EDe(l)&&(s||(s=[]),s.push(l))}return s?(()=>IJe(this,void 0,void 0,(function*(){for(const e of s){const t=yield e;if("string"==typeof t)return t}return null})))():null},s=i.find((e=>!!e.allBasenames));s&&(o.allBasenames=s.allBasenames);const r=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);return r.length&&(o.allPaths=r),o}(e,t)}function QJe(e,t){const i=e.filter((e=>!!e.basenames));if(i.length<2)return e;const n=i.reduce(((e,t)=>{const i=t.basenames;return i?e.concat(i):e}),[]);let o;if(t){o=[];for(let e=0,i=n.length;e<i;e++)o.push(t)}else o=i.reduce(((e,t)=>{const i=t.patterns;return i?e.concat(i):e}),[]);const s=function(e,t){if("string"!=typeof e)return null;if(!t){let i;for(i=e.length;i>0;i--){const t=e.charCodeAt(i-1);if(47===t||92===t)break}t=e.substr(i)}const i=n.indexOf(t);return-1!==i?o[i]:null};s.basenames=n,s.patterns=o,s.allBasenames=n;const r=e.filter((e=>!e.basenames));return r.push(s),r}let XJe=[],JJe=[],e0e=[];function t0e(e,t=!1){!function(e,t,i){const n=function(e){return{id:e.id,mime:e.mime,filename:e.filename,extension:e.extension,filepattern:e.filepattern,firstline:e.firstline,userConfigured:false,filenameLowercase:e.filename?e.filename.toLowerCase():void 0,extensionLowercase:e.extension?e.extension.toLowerCase():void 0,filepatternLowercase:e.filepattern?YJe(e.filepattern.toLowerCase()):void 0,filepatternOnPath:!!e.filepattern&&e.filepattern.indexOf(PCe.sep)>=0}}(e);XJe.push(n),n.userConfigured?e0e.push(n):JJe.push(n),i&&!n.userConfigured&&XJe.forEach((e=>{e.mime===n.mime||e.userConfigured||(n.extension&&e.extension===n.extension&&console.warn(`Overwriting extension <<${n.extension}>> to now point to mime <<${n.mime}>>`),n.filename&&e.filename===n.filename&&console.warn(`Overwriting filename <<${n.filename}>> to now point to mime <<${n.mime}>>`),n.filepattern&&e.filepattern===n.filepattern&&console.warn(`Overwriting filepattern <<${n.filepattern}>> to now point to mime <<${n.mime}>>`),n.firstline&&e.firstline===n.firstline&&console.warn(`Overwriting firstline <<${n.firstline}>> to now point to mime <<${n.mime}>>`))}))}(e,0,t)}function i0e(e,t,i){var n;let o,s,r;for(let a=i.length-1;a>=0;a--){const l=i[a];if(t===l.filenameLowercase){o=l;break}if(l.filepattern&&(!s||l.filepattern.length>s.filepattern.length)){const i=l.filepatternOnPath?e:t;(null===(n=l.filepatternLowercase)||void 0===n?void 0:n.call(l,i))&&(s=l)}l.extension&&(!r||l.extension.length>r.extension.length)&&t.endsWith(l.extensionLowercase)&&(r=l)}return o||s||r||void 0}const n0e=Object.prototype.hasOwnProperty,o0e="vs.editor.nullLanguage";class s0e{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(o0e,0),this._register(tDe,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||o0e}}class r0e extends Owe{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new $we),this.onDidChange=this._onDidChange.event,r0e.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new s0e,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(eDe.onDidChangeLanguages((e=>{this._initializeFromRegistry()}))))}dispose(){r0e.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},XJe=XJe.filter((e=>e.userConfigured)),JJe=[];const e=[].concat(eDe.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach((e=>{const t=this._languages[e];t.name&&(this._nameMap[t.name]=t.identifier),t.aliases.forEach((e=>{this._lowercaseNameMap[e.toLowerCase()]=t.identifier})),t.mimetypes.forEach((e=>{this._mimeTypesMap[e]=t.identifier}))})),RLe.as(BLe).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;n0e.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let n=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),n=t.mimetypes[0]),n||(n=`text/x-${i}`,e.mimetypes.push(n)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const e of t.extensions)t0e({id:i,mime:n,extension:e},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const o of t.filenames)t0e({id:i,mime:n,filename:o},this._warnOnOverwrite),e.filenames.push(o);if(Array.isArray(t.filenamePatterns))for(const e of t.filenamePatterns)t0e({id:i,mime:n,filepattern:e},this._warnOnOverwrite);if("string"==typeof t.firstLine&&t.firstLine.length>0){let e=t.firstLine;"^"!==e.charAt(0)&&(e="^"+e);try{const t=new RegExp(e);"^"!==(o=t).source&&"^$"!==o.source&&"$"!==o.source&&"^\\s*$"!==o.source&&o.exec("")&&0===o.lastIndex||t0e({id:i,mime:n,firstline:t},this._warnOnOverwrite)}catch(i){console.warn(`[${t.id}]: Invalid regular expression \`${e}\`: `,i)}}var o;e.aliases.push(i);let s=null;if(void 0!==t.aliases&&Array.isArray(t.aliases)&&(s=0===t.aliases.length?[null]:t.aliases),null!==s)for(const t of s)t&&0!==t.length&&e.aliases.push(t);const r=null!==s&&s.length>0;if(r&&null===s[0]);else{const t=(r?s[0]:null)||i;!r&&e.name||(e.name=t)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return!!e&&n0e.call(this._languages,e)}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return n0e.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&n0e.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return e||t?function(e,t){return function(e,t){let i;if(e)switch(e.scheme){case $Te.file:i=e.fsPath;break;case $Te.data:i=cKe.parseMetaData(e).get(cKe.META_DATA_LABEL);break;case $Te.vscodeNotebookCell:i=void 0;break;default:i=e.path}if(!i)return[{id:"unknown",mime:OLe.unknown}];i=i.toLowerCase();const n=HCe(i),o=i0e(i,n,e0e);if(o)return[o,{id:tDe,mime:OLe.text}];const s=i0e(i,n,JJe);if(s)return[s,{id:tDe,mime:OLe.text}];if(t){const e=function(e){if(sxe(e)&&(e=e.substr(1)),e.length>0)for(let t=XJe.length-1;t>=0;t--){const i=XJe[t];if(!i.firstline)continue;const n=e.match(i.firstline);if(n&&n.length>0)return i}}(t);if(e)return[e,{id:tDe,mime:OLe.text}]}return[{id:"unknown",mime:OLe.unknown}]}(e,t).map((e=>e.id))}(e,t):[]}}r0e.instanceCount=0;class a0e extends Owe{constructor(e=!1){super(),this._onDidEncounterLanguage=this._register(new $we),this.onDidEncounterLanguage=this._onDidEncounterLanguage.event,this._onDidChange=this._register(new $we({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,a0e.instanceCount++,this._encounteredLanguages=new Set,this._registry=this._register(new r0e(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange((()=>this._onDidChange.fire())))}dispose(){a0e.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){return obe(this._registry.guessLanguageIdByFilepathOrFirstLine(e,t),null)}createById(e){return new l0e(this.onDidChange,(()=>this._createAndGetLanguageIdentifier(e)))}createByFilepathOrFirstLine(e,t){return new l0e(this.onDidChange,(()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)}))}_createAndGetLanguageIdentifier(e){return e&&this.isRegisteredLanguageId(e)||(e=tDe),this._encounteredLanguages.has(e)||(this._encounteredLanguages.add(e),Eye.getOrCreate(e),this._onDidEncounterLanguage.fire(e)),e}}a0e.instanceCount=0;class l0e{constructor(e,t){this._onDidChangeLanguages=e,this._selector=t,this._listener=null,this._emitter=null,this.languageId=this._selector()}_dispose(){this._listener&&(this._listener.dispose(),this._listener=null),this._emitter&&(this._emitter.dispose(),this._emitter=null)}get onDidChange(){return this._listener||(this._listener=this._onDidChangeLanguages((()=>this._evaluate()))),this._emitter||(this._emitter=new $we({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){var e;const t=this._selector();t!==this.languageId&&(this.languageId=t,null===(e=this._emitter)||void 0===e||e.fire(this.languageId))}}var d0e=i(7568),h0e={};h0e.styleTagTransform=zl(),h0e.setAttributes=Bl(),h0e.insert=Pl().bind(null,"head"),h0e.domAPI=Rl(),h0e.insertStyleElement=Vl(),Ml()(d0e.A,h0e),d0e.A&&d0e.A.locals&&d0e.A.locals;class c0e extends lAe{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new $we),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=IMe(e,OMe(".monaco-dropdown")),this._label=IMe(this._element,OMe(".dropdown-label"));let i=t.labelRenderer;i||(i=e=>(e.textContent=t.label||"",null));for(const e of[LMe.CLICK,LMe.MOUSE_DOWN,nRe.Tap])this._register(tMe(this.element,e,(e=>DMe(e,!0))));for(const e of[LMe.MOUSE_DOWN,nRe.Tap])this._register(tMe(this._label,e,(e=>{e instanceof MouseEvent&&(e.detail>1||0!==e.button)||(this.visible?this.hide():this.show())})));this._register(tMe(this._label,LMe.KEY_UP,(e=>{const t=new KIe(e);(t.equals(3)||t.equals(10))&&(DMe(e,!0),this.visible?this.hide():this.show())})));const n=i(this._label);n&&this._register(n),this._register(oRe.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class u0e extends c0e{constructor(e,t){super(e,t),this._actions=[],this._contextMenuProvider=t.contextMenuProvider,this.actions=t.actions||[],this.actionProvider=t.actionProvider,this.menuClassName=t.menuClassName||"",this.menuAsChild=!!t.menuAsChild}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this.actionProvider?this.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this.menuClassName,onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this.menuAsChild?this.element:void 0})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class g0e extends ZYe{constructor(e,t,i,n=Object.create(null)){super(null,e,n),this.actionItem=null,this._onDidChangeVisibility=this._register(new $we),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=n,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=Array.isArray(this.menuActionsOrProvider),i={contextMenuProvider:this.contextMenuProvider,labelRenderer:e=>{this.element=IMe(e,OMe("a.action-label"));let t=[];return"string"==typeof this.options.classNames?t=this.options.classNames.split(/\s+/g).filter((e=>!!e)):this.options.classNames&&(t=this.options.classNames),t.find((e=>"icon"===e))||t.push("codicon"),this.element.classList.add(...t),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this.element.title=this._action.label||"",this.element.ariaLabel=this._action.label||"",null},menuAsChild:this.options.menuAsChild,actions:t?this.menuActionsOrProvider:void 0,actionProvider:t?void 0:this.menuActionsOrProvider};if(this.dropdownMenu=this._register(new u0e(e,i)),this._register(this.dropdownMenu.onDidChangeVisibility((e=>{var t;null===(t=this.element)||void 0===t||t.setAttribute("aria-expanded",`${e}`),this._onDidChangeVisibility.fire(e)}))),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const e=this;this.dropdownMenu.menuOptions=Object.assign(Object.assign({},this.dropdownMenu.menuOptions),{get anchorAlignment(){return e.options.anchorAlignmentProvider()}})}this.updateTooltip(),this.updateEnabled()}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),null!=e?e:void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;null===(e=this.dropdownMenu)||void 0===e||e.show()}updateEnabled(){var e,t;const i=!this.action.enabled;null===(e=this.actionItem)||void 0===e||e.classList.toggle("disabled",i),null===(t=this.element)||void 0===t||t.classList.toggle("disabled",i)}}var p0e=i(2829),m0e={};m0e.styleTagTransform=zl(),m0e.setAttributes=Bl(),m0e.insert=Pl().bind(null,"head"),m0e.domAPI=Rl(),m0e.insertStyleElement=Vl(),Ml()(p0e.A,m0e),p0e.A&&p0e.A.locals&&p0e.A.locals;var f0e,_0e,v0e=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};!function(e){e[e.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",e[e.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"}(f0e||(f0e={})),function(e){e[e.None=0]="None",e[e.Initialized=1]="Initialized",e[e.Closed=2]="Closed"}(_0e||(_0e={}));class b0e extends Owe{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new $we),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=_0e.None,this.cache=new Map,this.flushDelayer=new MDe(b0e.DEFAULT_FLUSH_DELAY),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal((e=>this.onDidChangeItemsExternal(e))))}onDidChangeItemsExternal(e){var t,i;null===(t=e.changed)||void 0===t||t.forEach(((e,t)=>this.accept(t,e))),null===(i=e.deleted)||void 0===i||i.forEach((e=>this.accept(e,void 0)))}accept(e,t){if(this.state===_0e.Closed)return;let i=!1;xbe(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire(e)}get(e,t){const i=this.cache.get(e);return xbe(i)?t:i}getBoolean(e,t){const i=this.get(e);return xbe(i)?t:"true"===i}getNumber(e,t){const i=this.get(e);return xbe(i)?t:parseInt(i,10)}set(e,t){return v0e(this,void 0,void 0,(function*(){if(this.state===_0e.Closed)return;if(xbe(t))return this.delete(e);const i=String(t);return this.cache.get(e)!==i?(this.cache.set(e,i),this.pendingInserts.set(e,i),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire(e),this.doFlush()):void 0}))}delete(e){return v0e(this,void 0,void 0,(function*(){if(this.state!==_0e.Closed)return this.cache.delete(e)?(this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire(e),this.doFlush()):void 0}))}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}flushPending(){return v0e(this,void 0,void 0,(function*(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally((()=>{var e;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)null===(e=this.whenFlushedCallbacks.pop())||void 0===e||e()}))}))}doFlush(e){return v0e(this,void 0,void 0,(function*(){return this.flushDelayer.trigger((()=>this.flushPending()),e)}))}dispose(){this.flushDelayer.dispose(),super.dispose()}}b0e.DEFAULT_FLUSH_DELAY=100;class w0e{constructor(){this.onDidChangeItemsExternal=zwe.None,this.items=new Map}updateItems(e){var t,i;return v0e(this,void 0,void 0,(function*(){null===(t=e.insert)||void 0===t||t.forEach(((e,t)=>this.items.set(t,e))),null===(i=e.delete)||void 0===i||i.forEach((e=>this.items.delete(e)))}))}}const C0e="__$__targetStorageMarker",y0e=zxe("storageService");var S0e;!function(e){e[e.NONE=0]="NONE",e[e.SHUTDOWN=1]="SHUTDOWN"}(S0e||(S0e={}));class x0e extends Owe{constructor(e={flushInterval:x0e.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new Qwe),this.onDidChangeValue=this._onDidChangeValue.event,this._onDidChangeTarget=this._register(new Qwe),this._onWillSaveState=this._register(new $we),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}emitDidChangeValue(e,t){if(t===C0e){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:t,target:this.getKeyTargets(e)[t]})}get(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.get(e,i)}getBoolean(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.getBoolean(e,i)}getNumber(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.getNumber(e,i)}store(e,t,i,n){xbe(t)?this.remove(e,i):this.withPausedEmitters((()=>{var o;this.updateKeyTarget(e,i,n),null===(o=this.getStorage(i))||void 0===o||o.set(e,t)}))}remove(e,t){this.withPausedEmitters((()=>{var i;this.updateKeyTarget(e,t,void 0),null===(i=this.getStorage(t))||void 0===i||i.delete(e)}))}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i){var n,o;const s=this.getKeyTargets(t);"number"==typeof i?s[e]!==i&&(s[e]=i,null===(n=this.getStorage(t))||void 0===n||n.set(C0e,JSON.stringify(s))):"number"==typeof s[e]&&(delete s[e],null===(o=this.getStorage(t))||void 0===o||o.set(C0e,JSON.stringify(s)))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?function(e){const t=e.get(C0e);if(t)try{return JSON.parse(t)}catch(e){}return Object.create(null)}(t):Object.create(null)}}x0e.DEFAULT_FLUSH_INTERVAL=6e4;const k0e=function(e){var t,i,n,o,s;return{keybindingLabelBackground:uRe(null!==(t=e.keybindingLabelBackground)&&void 0!==t?t:bOe),keybindingLabelForeground:uRe(null!==(i=e.keybindingLabelForeground)&&void 0!==i?i:wOe),keybindingLabelBorder:uRe(null!==(n=e.keybindingLabelBorder)&&void 0!==n?n:COe),keybindingLabelBottomBorder:uRe(null!==(o=e.keybindingLabelBottomBorder)&&void 0!==o?o:yOe),keybindingLabelShadow:uRe(null!==(s=e.keybindingLabelShadow)&&void 0!==s?s:CRe)}}({}),L0e=function(e){var t,i,n,o,s,r,a,l;return{buttonForeground:uRe(null!==(t=e.buttonForeground)&&void 0!==t?t:zRe),buttonSeparator:uRe(null!==(i=e.buttonSeparator)&&void 0!==i?i:URe),buttonBackground:uRe(null!==(n=e.buttonBackground)&&void 0!==n?n:KRe),buttonHoverBackground:uRe(null!==(o=e.buttonHoverBackground)&&void 0!==o?o:jRe),buttonSecondaryForeground:uRe(null!==(s=e.buttonSecondaryForeground)&&void 0!==s?s:$Re),buttonSecondaryBackground:uRe(null!==(r=e.buttonSecondaryBackground)&&void 0!==r?r:GRe),buttonSecondaryHoverBackground:uRe(null!==(a=e.buttonSecondaryHoverBackground)&&void 0!==a?a:ZRe),buttonBorder:uRe(null!==(l=e.buttonBorder)&&void 0!==l?l:qRe)}}({}),D0e=function(){var e;return{progressBarBackground:uRe(null!==(e={}.progressBarBackground)&&void 0!==e?e:iOe)}}(),E0e=function(e){var t,i,n;return{inputActiveOptionBorder:uRe(null!==(t=e.inputActiveOptionBorder)&&void 0!==t?t:LRe),inputActiveOptionForeground:uRe(null!==(i=e.inputActiveOptionForeground)&&void 0!==i?i:ERe),inputActiveOptionBackground:uRe(null!==(n=e.inputActiveOptionBackground)&&void 0!==n?n:DRe)}}({});!function(e){var t,i,n;uRe(null!==(t=e.checkboxBackground)&&void 0!==t?t:dPe),uRe(null!==(i=e.checkboxBorder)&&void 0!==i?i:cPe),uRe(null!==(n=e.checkboxForeground)&&void 0!==n?n:hPe)}({}),function(e){var t,i,n,o,s,r,a,l;uRe(null!==(t=e.dialogBackground)&&void 0!==t?t:cOe),uRe(null!==(i=e.dialogForeground)&&void 0!==i?i:uOe),uRe(null!==(n=e.dialogShadow)&&void 0!==n?n:CRe),uRe(null!==(o=e.dialogBorder)&&void 0!==o?o:vRe),uRe(null!==(s=e.errorIconForeground)&&void 0!==s?s:zPe),uRe(null!==(r=e.warningIconForeground)&&void 0!==r?r:UPe),uRe(null!==(a=e.infoIconForeground)&&void 0!==a?a:KPe),uRe(null!==(l=e.textLinkForeground)&&void 0!==l?l:wRe)}({});const N0e=function(e){var t,i,n,o,s,r,a,l,d,h,c,u;return{inputBackground:uRe(null!==(t=e.inputBackground)&&void 0!==t?t:SRe),inputForeground:uRe(null!==(i=e.inputForeground)&&void 0!==i?i:xRe),inputBorder:uRe(null!==(n=e.inputBorder)&&void 0!==n?n:kRe),inputValidationInfoBorder:uRe(null!==(o=e.inputValidationInfoBorder)&&void 0!==o?o:TRe),inputValidationInfoBackground:uRe(null!==(s=e.inputValidationInfoBackground)&&void 0!==s?s:NRe),inputValidationInfoForeground:uRe(null!==(r=e.inputValidationInfoForeground)&&void 0!==r?r:IRe),inputValidationWarningBorder:uRe(null!==(a=e.inputValidationWarningBorder)&&void 0!==a?a:RRe),inputValidationWarningBackground:uRe(null!==(l=e.inputValidationWarningBackground)&&void 0!==l?l:MRe),inputValidationWarningForeground:uRe(null!==(d=e.inputValidationWarningForeground)&&void 0!==d?d:ARe),inputValidationErrorBorder:uRe(null!==(h=e.inputValidationErrorBorder)&&void 0!==h?h:FRe),inputValidationErrorBackground:uRe(null!==(c=e.inputValidationErrorBackground)&&void 0!==c?c:ORe),inputValidationErrorForeground:uRe(null!==(u=e.inputValidationErrorForeground)&&void 0!==u?u:PRe)}}({}),I0e={listFilterWidgetBackground:uRe(tPe),listFilterWidgetOutline:uRe(iPe),listFilterWidgetNoMatchesOutline:uRe(nPe),listFilterWidgetShadow:uRe(oPe),inputBoxStyles:N0e,toggleStyles:E0e},T0e=function(e){var t,i;return{badgeBackground:uRe(null!==(t=e.badgeBackground)&&void 0!==t?t:YRe),badgeForeground:uRe(null!==(i=e.badgeForeground)&&void 0!==i?i:QRe),badgeBorder:uRe(vRe)}}({});!function(e){var t,i,n,o,s;uRe(null!==(t=e.breadcrumbsBackground)&&void 0!==t?t:kPe),uRe(null!==(i=e.breadcrumbsForeground)&&void 0!==i?i:xPe),uRe(null!==(n=e.breadcrumbsFocusForeground)&&void 0!==n?n:LPe),uRe(null!==(o=e.breadcrumbsFocusForeground)&&void 0!==o?o:LPe),uRe(null!==(s=e.breadcrumbsFocusAndSelectionForeground)&&void 0!==s?s:DPe)}({});const M0e=A0e({});function A0e(e){var t,i,n,o,s,r,a,l,d,h,c,u,g,p,m,f,_,v,b,w,C,y,S;return{listBackground:e.listBackground?uRe(e.listBackground):void 0,listInactiveFocusForeground:e.listInactiveFocusForeground?uRe(e.listInactiveFocusForeground):void 0,listFocusBackground:uRe(null!==(t=e.listFocusBackground)&&void 0!==t?t:WOe),listFocusForeground:uRe(null!==(i=e.listFocusForeground)&&void 0!==i?i:VOe),listFocusOutline:uRe(null!==(n=e.listFocusOutline)&&void 0!==n?n:HOe),listActiveSelectionBackground:uRe(null!==(o=e.listActiveSelectionBackground)&&void 0!==o?o:UOe),listActiveSelectionForeground:uRe(null!==(s=e.listActiveSelectionForeground)&&void 0!==s?s:KOe),listActiveSelectionIconForeground:uRe(null!==(r=e.listActiveSelectionIconForeground)&&void 0!==r?r:jOe),listFocusAndSelectionOutline:uRe(null!==(a=e.listFocusAndSelectionOutline)&&void 0!==a?a:zOe),listFocusAndSelectionBackground:uRe(null!==(l=e.listFocusAndSelectionBackground)&&void 0!==l?l:UOe),listFocusAndSelectionForeground:uRe(null!==(d=e.listFocusAndSelectionForeground)&&void 0!==d?d:KOe),listInactiveSelectionBackground:uRe(null!==(h=e.listInactiveSelectionBackground)&&void 0!==h?h:qOe),listInactiveSelectionIconForeground:uRe(null!==(c=e.listInactiveSelectionIconForeground)&&void 0!==c?c:GOe),listInactiveSelectionForeground:uRe(null!==(u=e.listInactiveSelectionForeground)&&void 0!==u?u:$Oe),listInactiveFocusBackground:uRe(null!==(g=e.listInactiveFocusBackground)&&void 0!==g?g:ZOe),listInactiveFocusOutline:uRe(null!==(p=e.listInactiveFocusOutline)&&void 0!==p?p:YOe),listHoverBackground:uRe(null!==(m=e.listHoverBackground)&&void 0!==m?m:QOe),listHoverForeground:uRe(null!==(f=e.listHoverForeground)&&void 0!==f?f:XOe),listDropBackground:uRe(null!==(_=e.listDropBackground)&&void 0!==_?_:JOe),listSelectionOutline:uRe(null!==(v=e.listSelectionOutline)&&void 0!==v?v:bRe),listHoverOutline:uRe(null!==(b=e.listHoverOutline)&&void 0!==b?b:bRe),treeIndentGuidesStroke:uRe(null!==(w=e.treeIndentGuidesStroke)&&void 0!==w?w:sPe),treeInactiveIndentGuidesStroke:uRe(null!==(C=e.treeInactiveIndentGuidesStroke)&&void 0!==C?C:rPe),tableColumnsBorder:uRe(null!==(y=e.tableColumnsBorder)&&void 0!==y?y:aPe),tableOddRowsBackgroundColor:uRe(null!==(S=e.tableOddRowsBackgroundColor)&&void 0!==S?S:lPe)}}const R0e=function(e){var t,i,n;return{selectBackground:uRe(e.selectBackground||BRe),selectListBackground:uRe(e.selectListBackground||WRe),selectForeground:uRe(e.selectForeground||VRe),decoratorRightForeground:uRe(e.decoratorRightForeground||_Oe),selectBorder:uRe(e.selectBorder||HRe),focusBorder:uRe(e.focusBorder||_Re),listFocusBackground:uRe(e.listFocusBackground||mPe),listInactiveSelectionIconForeground:uRe(e.listInactiveSelectionIconForeground||pPe),listFocusForeground:uRe(e.listFocusForeground||gPe),listFocusOutline:(i=null!==(t=e.listFocusOutline)&&void 0!==t?t:bRe,n=hRe.transparent.toString(),`var(${cRe(i)}, ${n})`),listHoverBackground:uRe(e.listHoverBackground||QOe),listHoverForeground:uRe(e.listHoverForeground||XOe),listHoverOutline:uRe(e.listFocusOutline||bRe),selectListBorder:uRe(e.selectListBorder||gOe),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0}}({}),O0e=function(e){var t,i,n,o,s,r,a,l,d,h,c,u;return{shadowColor:uRe(null!==(t=e.shadowColor)&&void 0!==t?t:CRe),borderColor:uRe(null!==(i=e.borderColor)&&void 0!==i?i:fPe),foregroundColor:uRe(null!==(n=e.foregroundColor)&&void 0!==n?n:_Pe),backgroundColor:uRe(null!==(o=e.backgroundColor)&&void 0!==o?o:vPe),selectionForegroundColor:uRe(null!==(s=e.selectionForegroundColor)&&void 0!==s?s:bPe),selectionBackgroundColor:uRe(null!==(r=e.selectionBackgroundColor)&&void 0!==r?r:wPe),selectionBorderColor:uRe(null!==(a=e.selectionBorderColor)&&void 0!==a?a:CPe),separatorColor:uRe(null!==(l=e.separatorColor)&&void 0!==l?l:yPe),scrollbarShadow:uRe(null!==(d=e.scrollbarShadow)&&void 0!==d?d:XRe),scrollbarSliderBackground:uRe(null!==(h=e.scrollbarSliderBackground)&&void 0!==h?h:JRe),scrollbarSliderHoverBackground:uRe(null!==(c=e.scrollbarSliderHoverBackground)&&void 0!==c?c:eOe),scrollbarSliderActiveBackground:uRe(null!==(u=e.scrollbarSliderActiveBackground)&&void 0!==u?u:tOe)}}({});var P0e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},F0e=function(e,t){return function(i,n){t(i,n,e)}},B0e=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let W0e=class extends YYe{constructor(e,t,i,n,o,s,r){super(void 0,e,{icon:!(!e.class&&!e.item.icon),label:!e.class&&!e.item.icon,draggable:null==t?void 0:t.draggable,keybinding:null==t?void 0:t.keybinding,hoverDelegate:null==t?void 0:t.hoverDelegate}),this._keybindingService=i,this._notificationService=n,this._contextKeyService=o,this._themeService=s,this._contextMenuService=r,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Pwe),this._altKey=KMe.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return B0e(this,void 0,void 0,(function*(){e.preventDefault(),e.stopPropagation();try{yield this.actionRunner.run(this._commandAction,this._context)}catch(e){this._notificationService.error(e)}}))}render(e){super.render(e),e.classList.add("menu-entry"),this._updateItemClass(this._menuItemAction.item);let t=!1,i=this._altKey.keyStatus.altKey||(Lve||Eve)&&this._altKey.keyStatus.shiftKey;const n=()=>{var e;const n=t&&i&&!!(null===(e=this._commandAction.alt)||void 0===e?void 0:e.enabled);n!==this._wantsAltCommand&&(this._wantsAltCommand=n,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._menuItemAction.alt&&this._register(this._altKey.event((e=>{i=e.altKey||(Lve||Eve)&&e.shiftKey,n()}))),this._register(tMe(e,"mouseleave",(e=>{t=!1,n()}))),this._register(tMe(e,"mouseenter",(e=>{t=!0,n()})))}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var e;const t=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),i=t&&t.getLabel(),n=this._commandAction.tooltip||this._commandAction.label;let o=i?ove(0,"{0} ({1})",n,i):n;if(!this._wantsAltCommand&&(null===(e=this._menuItemAction.alt)||void 0===e?void 0:e.enabled)){const e=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,t=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),i=t&&t.getLabel(),n=i?ove(0,"{0} ({1})",e,i):e;o=ove(0,"{0}\n[{1}] {2}",o,XXe.modifierLabels[Fve].altKey,n)}return o}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const n=this._commandAction.checked&&(o=e.toggled)&&void 0!==o.condition&&e.toggled.icon?e.toggled.icon:e.icon;var o;if(n)if(sAe.isThemeIcon(n)){const e=sAe.asClassNameArray(n);i.classList.add(...e),this._itemClassDispose.value=Awe((()=>{i.classList.remove(...e)}))}else i.style.backgroundImage=LFe(this._themeService.getColorTheme().type)?VMe(n.dark):VMe(n.light),i.classList.add("icon"),this._itemClassDispose.value=Mwe(Awe((()=>{i.style.backgroundImage="",i.classList.remove("icon")})),this._themeService.onDidColorThemeChange((()=>{this.updateClass()})))}};W0e=P0e([F0e(2,jXe),F0e(3,k$e),F0e(4,wke),F0e(5,VBe),F0e(6,yQe)],W0e);let V0e=class extends g0e{constructor(e,t,i,n){var o,s;const r=Object.assign({},null!=t?t:Object.create(null),{menuAsChild:null!==(o=null==t?void 0:t.menuAsChild)&&void 0!==o&&o,classNames:null!==(s=null==t?void 0:t.classNames)&&void 0!==s?s:sAe.isThemeIcon(e.item.icon)?sAe.asClassName(e.item.icon):void 0});super(e,{getActions:()=>e.actions},i,r),this._contextMenuService=i,this._themeService=n}render(e){super.render(e),kbe(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!sAe.isThemeIcon(i)){this.element.classList.add("icon");const e=()=>{this.element&&(this.element.style.backgroundImage=LFe(this._themeService.getColorTheme().type)?VMe(i.dark):VMe(i.light))};e(),this._register(this._themeService.onDidColorThemeChange((()=>{e()})))}}};V0e=P0e([F0e(2,yQe),F0e(3,VBe)],V0e);let H0e=class extends ZYe{constructor(e,t,i,n,o,s,r,a){var l,d,h;let c;super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=o,this._menuService=s,this._instaService=r,this._storageService=a,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;const u=a.get(this._storageKey,1);u&&(c=e.actions.find((e=>u===e.id))),c||(c=e.actions[0]),this._defaultAction=this._instaService.createInstance(W0e,c,{keybinding:this._getDefaultActionKeybindingLabel(c)});const g=Object.assign({},null!=t?t:Object.create(null),{menuAsChild:null===(l=null==t?void 0:t.menuAsChild)||void 0===l||l,classNames:null!==(d=null==t?void 0:t.classNames)&&void 0!==d?d:["codicon","codicon-chevron-down"],actionRunner:null!==(h=null==t?void 0:t.actionRunner)&&void 0!==h?h:new lAe});this._dropdown=new g0e(e,e.actions,this._contextMenuService,g),this._dropdown.actionRunner.onDidRun((e=>{e.action instanceof kAe&&this.update(e.action)}))}update(e){var t,i;this._storageService.store(this._storageKey,e.id,1,0),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(W0e,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends lAe{runAction(e,t){return B0e(this,void 0,void 0,(function*(){yield e.run(void 0)}))}},this._container&&this._defaultAction.render((t=this._container,i=OMe(".action-container"),t.insertBefore(i,t.firstChild),i))}_getDefaultActionKeybindingLabel(e){var t;let i;if(null===(t=this._options)||void 0===t?void 0:t.renderKeybindingWithDefaultActionLabel){const t=this._keybindingService.lookupKeybinding(e.id);t&&(i=`(${t.getLabel()})`)}return i}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=OMe(".action-container");this._defaultAction.render(IMe(this._container,t)),this._register(tMe(t,LMe.KEY_DOWN,(e=>{const t=new KIe(e);t.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),t.stopPropagation())})));const i=OMe(".dropdown-action-container");this._dropdown.render(IMe(this._container,i)),this._register(tMe(i,LMe.KEY_DOWN,(e=>{var t;const i=new KIe(e);i.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),null===(t=this._defaultAction.element)||void 0===t||t.focus(),i.stopPropagation())})))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};H0e=P0e([F0e(2,jXe),F0e(3,k$e),F0e(4,yQe),F0e(5,CAe),F0e(6,Hxe),F0e(7,y0e)],H0e);let z0e=class extends QYe{constructor(e,t){super(null,e,e.actions.map((e=>({text:e.id===dAe.ID?"─────────":e.label,isDisabled:!e.enabled}))),0,t,R0e,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex((e=>e.checked))))}render(e){super.render(e),e.style.borderColor=uRe(HRe)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};z0e=P0e([F0e(1,CQe)],z0e);const U0e=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,K0e=/(&)?(&)([^\s&])/g;var j0e;!function(e){e[e.Right=0]="Right",e[e.Left=1]="Left"}(j0e||(j0e={}));class q0e extends eQe{constructor(e,t,i,n){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:1,actionViewItemProvider:e=>this.doGetActionViewItem(e,i,s),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...Dve||Eve?[10]:[]],keyDown:!0}}),this.menuStyles=n,this.menuElement=o,this.actionsList.tabIndex=0,this.menuDisposables=this._register(new Rwe),this.initializeOrUpdateStyleSheet(e,n),this._register(oRe.addTarget(o)),tMe(o,LMe.KEY_DOWN,(e=>{new KIe(e).equals(2)&&e.preventDefault()})),i.enableMnemonics&&this.menuDisposables.add(tMe(o,LMe.KEY_DOWN,(e=>{const t=e.key.toLocaleLowerCase();if(this.mnemonics.has(t)){DMe(e,!0);const i=this.mnemonics.get(t);if(1===i.length&&(i[0]instanceof G0e&&i[0].container&&this.focusItemByElement(i[0].container),i[0].onClick(e)),i.length>1){const e=i.shift();e&&e.container&&(this.focusItemByElement(e.container),i.push(e)),this.mnemonics.set(t,i)}}}))),Eve&&this._register(tMe(o,LMe.KEY_DOWN,(e=>{const t=new KIe(e);t.equals(14)||t.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),DMe(e,!0)):(t.equals(13)||t.equals(12))&&(this.focusedItem=0,this.focusPrevious(),DMe(e,!0))}))),this._register(tMe(this.domNode,LMe.MOUSE_OUT,(e=>{mMe(e.relatedTarget,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),e.stopPropagation())}))),this._register(tMe(this.actionsList,LMe.MOUSE_OVER,(e=>{let t=e.target;if(t&&mMe(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(t.classList.contains("action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}}))),this._register(oRe.addTarget(this.actionsList)),this._register(tMe(this.actionsList,nRe.Tap,(e=>{let t=e.initialTarget;if(t&&mMe(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(t.classList.contains("action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}})));const s={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new vBe(o,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const r=this.scrollableElement.getDomNode();r.style.position="",this.styleScrollElement(r,n),this._register(tMe(o,nRe.Change,(e=>{DMe(e,!0);const t=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:t-e.translationY})}))),this._register(tMe(r,LMe.MOUSE_UP,(e=>{e.preventDefault()}))),o.style.maxHeight=`${Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((e=>{var t;return!(null===(t=i.submenuIds)||void 0===t?void 0:t.has(e.id))||(console.warn(`Found submenu cycle: ${e.id}`),!1)})),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter((e=>!(e instanceof Z0e))).forEach(((e,t,i)=>{e.updatePositionInSet(t+1,i.length)}))}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(bMe(e)?this.styleSheet=yMe(e):(q0e.globalStyleSheet||(q0e.globalStyleSheet=yMe()),this.styleSheet=q0e.globalStyleSheet)),this.styleSheet.textContent=function(e,t){let i=`\n.monaco-menu {\n\tfont-size: 13px;\n\tborder-radius: 5px;\n\tmin-width: 160px;\n}\n\n${Y0e(pye.menuSelection)}\n${Y0e(pye.menuSubmenu)}\n\n.monaco-menu .monaco-action-bar {\n\ttext-align: right;\n\toverflow: hidden;\n\twhite-space: nowrap;\n}\n\n.monaco-menu .monaco-action-bar .actions-container {\n\tdisplay: flex;\n\tmargin: 0 auto;\n\tpadding: 0;\n\twidth: 100%;\n\tjustify-content: flex-end;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar.reverse .actions-container {\n\tflex-direction: row-reverse;\n}\n\n.monaco-menu .monaco-action-bar .action-item {\n\tcursor: pointer;\n\tdisplay: inline-block;\n\ttransition: transform 50ms ease;\n\tposition: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled {\n\tcursor: default;\n}\n\n.monaco-menu .monaco-action-bar.animated .action-item.active {\n\ttransform: scale(1.272019649, 1.272019649); /* 1.272019649 = √φ */\n}\n\n.monaco-menu .monaco-action-bar .action-item .icon,\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar .action-label {\n\tfont-size: 11px;\n\tmargin-right: 4px;\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label,\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {\n\tcolor: var(--vscode-disabledForeground);\n}\n\n/* Vertical actions */\n\n.monaco-menu .monaco-action-bar.vertical {\n\ttext-align: left;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tdisplay: block;\n\tborder-bottom: 1px solid var(--vscode-menu-separatorBackground);\n\tpadding-top: 1px;\n\tpadding: 30px;\n}\n\n.monaco-menu .secondary-actions .monaco-action-bar .action-label {\n\tmargin-left: 6px;\n}\n\n/* Action Items */\n.monaco-menu .monaco-action-bar .action-item.select-container {\n\toverflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */\n\tflex: 1;\n\tmax-width: 170px;\n\tmin-width: 60px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin-right: 10px;\n}\n\n.monaco-menu .monaco-action-bar.vertical {\n\tmargin-left: 0;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tpadding: 0;\n\ttransform: none;\n\tdisplay: flex;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.active {\n\ttransform: none;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\tflex: 1 1 auto;\n\tdisplay: flex;\n\theight: 2em;\n\talign-items: center;\n\tposition: relative;\n\tmargin: 0 4px;\n\tborder-radius: 4px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding {\n\topacity: unset;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label {\n\tflex: 1 1 auto;\n\ttext-decoration: none;\n\tpadding: 0 1em;\n\tbackground: none;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .keybinding,\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tdisplay: inline-block;\n\tflex: 2 1 auto;\n\tpadding: 0 1em;\n\ttext-align: right;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {\n\tfont-size: 16px !important;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {\n\tmargin-left: auto;\n\tmargin-right: -20px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {\n\topacity: 0.4;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n\tmargin: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tposition: static;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {\n\tposition: absolute;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\twidth: 100%;\n\theight: 0px !important;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {\n\tpadding: 0.7em 1em 0.1em 1em;\n\tfont-weight: bold;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:hover {\n\tcolor: inherit;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tposition: absolute;\n\tvisibility: hidden;\n\twidth: 1em;\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {\n\tvisibility: visible;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n/* Context Menu */\n\n.context-view.monaco-menu-container {\n\toutline: 0;\n\tborder: none;\n\tanimation: fadeIn 0.083s linear;\n\t-webkit-app-region: no-drag;\n}\n\n.context-view.monaco-menu-container :focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {\n\toutline: 0;\n}\n\n.hc-black .context-view.monaco-menu-container,\n.hc-light .context-view.monaco-menu-container,\n:host-context(.hc-black) .context-view.monaco-menu-container,\n:host-context(.hc-light) .context-view.monaco-menu-container {\n\tbox-shadow: none;\n}\n\n.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused {\n\tbackground: none;\n}\n\n/* Vertical Action Bar Styles */\n\n.monaco-menu .monaco-action-bar.vertical {\n\tpadding: 4px 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\theight: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),\n.monaco-menu .monaco-action-bar.vertical .keybinding {\n\tfont-size: inherit;\n\tpadding: 0 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tfont-size: inherit;\n\twidth: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tfont-size: inherit;\n\tmargin: 5px 0 !important;\n\tpadding: 0;\n\tborder-radius: 0;\n}\n\n.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator,\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tmargin-left: 0;\n\tmargin-right: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tfont-size: 60%;\n\tpadding: 0 1.8em;\n}\n\n.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n\tmask-size: 10px 10px;\n\t-webkit-mask-size: 10px 10px;\n}\n\n.monaco-menu .action-item {\n\tcursor: default;\n}`;if(t){i+="\n\t\t\t/* Arrows */\n\t\t\t.monaco-scrollable-element > .scrollbar > .scra {\n\t\t\t\tcursor: pointer;\n\t\t\t\tfont-size: 11px !important;\n\t\t\t}\n\n\t\t\t.monaco-scrollable-element > .visible {\n\t\t\t\topacity: 1;\n\n\t\t\t\t/* Background rule added for IE9 - to allow clicks on dom node */\n\t\t\t\tbackground:rgba(0,0,0,0);\n\n\t\t\t\ttransition: opacity 100ms linear;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible {\n\t\t\t\topacity: 0;\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible.fade {\n\t\t\t\ttransition: opacity 800ms linear;\n\t\t\t}\n\n\t\t\t/* Scrollable Content Inset Shadow */\n\t\t\t.monaco-scrollable-element > .shadow {\n\t\t\t\tposition: absolute;\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 3px;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 3px;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 100%;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top-left-corner {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t";const t=e.scrollbarShadow;t&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\t\tbox-shadow: ${t} 0 6px 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\t\tbox-shadow: ${t} 6px 0 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.top.left {\n\t\t\t\t\tbox-shadow: ${t} 6px 6px 6px -6px inset;\n\t\t\t\t}\n\t\t\t`);const n=e.scrollbarSliderBackground;n&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider {\n\t\t\t\t\tbackground: ${n};\n\t\t\t\t}\n\t\t\t`);const o=e.scrollbarSliderHoverBackground;o&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider:hover {\n\t\t\t\t\tbackground: ${o};\n\t\t\t\t}\n\t\t\t`);const s=e.scrollbarSliderActiveBackground;s&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider.active {\n\t\t\t\t\tbackground: ${s};\n\t\t\t\t}\n\t\t\t`)}return i}(t,bMe(e))}styleScrollElement(e,t){var i,n;const o=null!==(i=t.foregroundColor)&&void 0!==i?i:"",s=null!==(n=t.backgroundColor)&&void 0!==n?n:"",r=t.borderColor?`1px solid ${t.borderColor}`:"",a=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=r,e.style.borderRadius="5px",e.style.color=o,e.style.backgroundColor=s,e.style.boxShadow=a}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t<this.actionsList.children.length;t++)if(e===this.actionsList.children[t]){this.focusedItem=t;break}}updateFocus(e){super.updateFocus(e,!0,!0),void 0!==this.focusedItem&&this.scrollableElement.setScrollPosition({scrollTop:Math.round(this.menuElement.scrollTop)})}doGetActionViewItem(e,t,i){if(e instanceof dAe)return new Z0e(t.context,e,{icon:!0},this.menuStyles);if(e instanceof hAe){const n=new G0e(e,e.actions,i,Object.assign(Object.assign({},t),{submenuIds:new Set([...t.submenuIds||[],e.id])}),this.menuStyles);if(t.enableMnemonics){const e=n.getMnemonic();if(e&&n.isEnabled()){let t=[];this.mnemonics.has(e)&&(t=this.mnemonics.get(e)),t.push(n),this.mnemonics.set(e,t)}}return n}{const i={enableMnemonics:t.enableMnemonics,useEventAsContext:t.useEventAsContext};if(t.getKeyBinding){const n=t.getKeyBinding(e);if(n){const e=n.getLabel();e&&(i.keybinding=e)}}const n=new $0e(t.context,e,i,this.menuStyles);if(t.enableMnemonics){const e=n.getMnemonic();if(e&&n.isEnabled()){let t=[];this.mnemonics.has(e)&&(t=this.mnemonics.get(e)),t.push(n),this.mnemonics.set(e,t)}}return n}}}class $0e extends ZYe{constructor(e,t,i,n){if(i.isMenu=!0,super(t,t,i),this.menuStyle=n,this.options=i,this.options.icon=void 0!==i.icon&&i.icon,this.options.label=void 0===i.label||i.label,this.cssClass="",this.options.label&&i.enableMnemonics){const e=this.action.label;if(e){const t=U0e.exec(e);t&&(this.mnemonic=(t[1]?t[1]:t[3]).toLocaleLowerCase())}}this.runOnceToEnableMouseUp=new FDe((()=>{this.element&&(this._register(tMe(this.element,LMe.MOUSE_UP,(e=>{if(DMe(e,!0),bxe){if(new ZIe(e).rightButton)return;this.onClick(e)}else setTimeout((()=>{this.onClick(e)}),0)}))),this._register(tMe(this.element,LMe.CONTEXT_MENU,(e=>{DMe(e,!0)}))))}),100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=IMe(this.element,OMe("a.action-menu-item")),this._action.id===dAe.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=IMe(this.item,OMe("span.menu-item-check"+sAe.asCSSSelector(pye.menuSelection))),this.check.setAttribute("role","none"),this.label=IMe(this.item,OMe("span.action-label")),this.options.label&&this.options.keybinding&&(IMe(this.item,OMe("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){var e;super.focus(),null===(e=this.item)||void 0===e||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(this.label&&this.options.label){XTe(this.label);let t=mZe(this.action.label);if(t){const i=function(e){const t=U0e,i=t.exec(e);if(!i)return e;const n=!i[1];return e.replace(t,n?"$2$3":"").trim()}(t);this.options.enableMnemonics||(t=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));const n=U0e.exec(t);if(n){t=ySe(t),K0e.lastIndex=0;let i=K0e.exec(t);for(;i&&i[1];)i=K0e.exec(t);const o=e=>e.replace(/&&/g,"&");i?this.label.append(xSe(o(t.substr(0,i.index))," "),OMe("u",{"aria-hidden":"true"},i[3]),function(e,t){if(!e||!t)return e;const i=t.length,n=e.length;if(0===i||0===n)return e;let o=n,s=-1;for(;s=e.lastIndexOf(t,o-1),-1!==s&&s+i===o;){if(0===s)return"";o=s}return e.substring(0,o)}(o(t.substr(i.index+i[0].length))," ")):this.label.innerText=o(t).trim(),null===(e=this.item)||void 0===e||e.setAttribute("aria-keyshortcuts",(n[1]?n[1]:n[3]).toLocaleLowerCase())}else this.label.innerText=t.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),void 0!==e?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,n=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=null!=t?t:"",this.item.style.backgroundColor=null!=i?i:"",this.item.style.outline=n,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=null!=t?t:"")}}class G0e extends $0e{constructor(e,t,i,n,o){super(e,e,n,o),this.submenuActions=t,this.parentData=i,this.submenuOptions=n,this.mysubmenu=null,this.submenuDisposables=this._register(new Rwe),this.mouseOver=!1,this.expandDirection=n&&void 0!==n.expandDirection?n.expandDirection:j0e.Right,this.showScheduler=new FDe((()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))}),250),this.hideScheduler=new FDe((()=>{this.element&&!mMe(CMe(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))}),750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=IMe(this.item,OMe("span.submenu-indicator"+sAe.asCSSSelector(pye.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(tMe(this.element,LMe.KEY_UP,(e=>{const t=new KIe(e);(t.equals(17)||t.equals(3))&&(DMe(e,!0),this.createSubmenu(!0))}))),this._register(tMe(this.element,LMe.KEY_DOWN,(e=>{const t=new KIe(e);CMe()===this.item&&(t.equals(17)||t.equals(3))&&DMe(e,!0)}))),this._register(tMe(this.element,LMe.MOUSE_OVER,(e=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())}))),this._register(tMe(this.element,LMe.MOUSE_LEAVE,(e=>{this.mouseOver=!1}))),this._register(tMe(this.element,LMe.FOCUS_OUT,(e=>{this.element&&!mMe(CMe(),this.element)&&this.hideScheduler.schedule()}))),this._register(this.parentData.parent.onScroll((()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))}))))}updateEnabled(){}onClick(e){DMe(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch(e){}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,n){const o={top:0,left:0};return o.left=LJe(e.width,t.width,{position:n===j0e.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left<i.left+i.width&&(i.left+10+t.width<=e.width&&(o.left=i.left+10),i.top+=10,i.height=0),o.top=LJe(e.height,t.height,{position:0,offset:i.top,size:0}),o.top+t.height===i.top&&o.top+i.height+t.height<=e.height&&(o.top+=i.height),o}createSubmenu(e=!0){if(this.element)if(this.parentData.submenu)this.parentData.submenu.focus(!1);else{this.updateAriaExpanded("true"),this.submenuContainer=IMe(this.element,OMe("div.monaco-submenu")),this.submenuContainer.classList.add("menubar-menu-items-holder","context-view");const t=getComputedStyle(this.parentData.parent.domNode),i=parseFloat(t.paddingTop||"0")||0;this.submenuContainer.style.zIndex="1",this.submenuContainer.style.position="fixed",this.submenuContainer.style.top="0",this.submenuContainer.style.left="0",this.parentData.submenu=new q0e(this.submenuContainer,this.submenuActions.length?this.submenuActions:[new cAe],this.submenuOptions,this.menuStyle);const n=this.element.getBoundingClientRect(),o={top:n.top-i,left:n.left,height:n.height+2*i,width:n.width},s=this.submenuContainer.getBoundingClientRect(),{top:r,left:a}=this.calculateSubmenuMenuLayout(new dMe(window.innerWidth,window.innerHeight),dMe.lift(s),o,this.expandDirection);this.submenuContainer.style.left=a-s.left+"px",this.submenuContainer.style.top=r-s.top+"px",this.submenuDisposables.add(tMe(this.submenuContainer,LMe.KEY_UP,(e=>{new KIe(e).equals(15)&&(DMe(e,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))}))),this.submenuDisposables.add(tMe(this.submenuContainer,LMe.KEY_DOWN,(e=>{new KIe(e).equals(15)&&DMe(e,!0)}))),this.submenuDisposables.add(this.parentData.submenu.onDidCancel((()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)}))),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var t;this.item&&(null===(t=this.item)||void 0===t||t.setAttribute("aria-expanded",e))}applyStyle(){super.applyStyle();const e=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=null!=e?e:"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class Z0e extends YYe{constructor(e,t,i,n){super(e,t,i),this.menuStyles=n}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function Y0e(e){const t=gye()[e.id];return`.codicon-${e.id}:before { content: '\\${t.toString(16)}'; }`}class Q0e{constructor(e,t,i,n){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;let i;this.focusToReturn=document.activeElement;const n=kMe(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:n=>{var o;this.lastContainer=n;const s=e.getMenuClassName?e.getMenuClassName():"";s&&(n.className+=" "+s),this.options.blockMouse&&(this.block=n.appendChild(OMe(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",null===(o=this.blockDisposable)||void 0===o||o.dispose(),this.blockDisposable=tMe(this.block,LMe.MOUSE_DOWN,(e=>e.stopPropagation())));const r=new Rwe,a=e.actionRunner||new lAe;return a.onWillRun(this.onActionRun,this,r),a.onDidRun(this.onDidActionRun,this,r),i=new q0e(n,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:a,getKeyBinding:e.getKeyBinding?e.getKeyBinding:e=>this.keybindingService.lookupKeybinding(e.id)},O0e),i.onDidCancel((()=>this.contextViewService.hideContextView(!0)),null,r),i.onDidBlur((()=>this.contextViewService.hideContextView(!0)),null,r),r.add(tMe(window,LMe.BLUR,(()=>this.contextViewService.hideContextView(!0)))),r.add(tMe(window,LMe.MOUSE_DOWN,(e=>{if(e.defaultPrevented)return;const t=new ZIe(e);let i=t.target;if(!t.rightButton){for(;i;){if(i===n)return;i=i.parentElement}this.contextViewService.hideContextView(!0)}}))),Mwe(r,i)},focus:()=>{null==i||i.focus(!!e.autoSelectFirstItem)},onHide:t=>{var i,n,o;null===(i=e.onHide)||void 0===i||i.call(e,!!t),this.block&&(this.block.remove(),this.block=null),null===(n=this.blockDisposable)||void 0===n||n.dispose(),this.blockDisposable=null,this.lastContainer&&(CMe()===this.lastContainer||mMe(CMe(),this.lastContainer))&&(null===(o=this.focusToReturn)||void 0===o||o.focus()),this.lastContainer=null}},n,!!n)}onActionRun(e){this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!xwe(e.error)&&this.notificationService.error(e.error)}}var X0e=function(e,t){return function(i,n){t(i,n,e)}};let J0e=class extends Owe{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new Q0e(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,o,s){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=o,this.contextKeyService=s,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new $we),this._onDidHideContextMenu=this._store.add(new $we)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=e1e.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu(Object.assign(Object.assign({},e),{onHide:t=>{var i;null===(i=e.onHide)||void 0===i||i.call(e,t),this._onDidHideContextMenu.fire()}})),KMe.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};var e1e,t1e;J0e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([X0e(0,LAe),X0e(1,k$e),X0e(2,CQe),X0e(3,jXe),X0e(4,CAe),X0e(5,wke)],J0e),function(e){e.transform=function(e,t,i){if(!((n=e)&&n.menuId instanceof wAe))return e;var n;const{menuId:o,menuActionOptions:s,contextKeyService:r}=e;return Object.assign(Object.assign({},e),{getActions:()=>{const n=[];if(o){const e=t.createMenu(o,null!=r?r:i);!function(e,t,i){const n=e.getActions(t),o=KMe.getInstance();!function(e,t,i,n=e=>"navigation"===e,o=()=>!1,s=!1){let r,a;Array.isArray(t)?(r=t,a=t):(r=t.primary,a=t.secondary);const l=new Set;for(const[t,o]of e){let e;n(t)?(e=r,e.length>0&&s&&e.push(new dAe)):(e=a,e.length>0&&e.push(new dAe));for(let n of o){i&&(n=n instanceof kAe&&n.alt?n.alt:n);const o=e.push(n);n instanceof hAe&&l.add({group:t,action:n,index:o-1})}}for(const{group:e,action:t,index:i}of l){const s=n(e)?r:a,l=t.actions;l.length<=1&&o(t,e,s.length)&&s.splice(i,1,...l)}}(n,i,o.keyStatus.altKey||(Lve||Eve)&&o.keyStatus.shiftKey,(e=>"navigation"===e))}(e,s,n),e.dispose()}return e.getActions?dAe.join(e.getActions(),n):n}})}}(e1e||(e1e={})),function(e){e[e.API=0]="API",e[e.USER=1]="USER"}(t1e||(t1e={}));var i1e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},n1e=function(e,t){return function(i,n){t(i,n,e)}},o1e=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let s1e=class{constructor(e){this._commandService=e}open(e,t){return o1e(this,void 0,void 0,(function*(){if(!wXe(e,$Te.command))return!1;if(!(null==t?void 0:t.allowCommands))return!0;if("string"==typeof e&&(e=QCe.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path))return!0;let i=[];try{i=FZe(decodeURIComponent(e.query))}catch(t){try{i=FZe(e.query)}catch(e){}}return Array.isArray(i)||(i=[i]),yield this._commandService.executeCommand(e.path,...i),!0}))}};s1e=i1e([n1e(0,gAe)],s1e);let r1e=class{constructor(e){this._editorService=e}open(e,t){return o1e(this,void 0,void 0,(function*(){"string"==typeof e&&(e=QCe.parse(e));const{selection:i,uri:n}=function(e){let t;const i=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(e.fragment);return i&&(t={startLineNumber:parseInt(i[1]),startColumn:i[2]?parseInt(i[2]):1,endLineNumber:i[4]?parseInt(i[4]):void 0,endColumn:i[4]?i[5]?parseInt(i[5]):1:void 0},e=e.with({fragment:""})),{selection:t,uri:e}}(e);return(e=n).scheme===$Te.file&&(e=aKe(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:i,source:(null==t?void 0:t.fromUserGesture)?t1e.USER:t1e.API},null==t?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),null==t?void 0:t.openToSide),!0}))}};r1e=i1e([n1e(0,Uxe)],r1e);let a1e=class{constructor(e,t){this._openers=new $ve,this._validators=new $ve,this._resolvers=new $ve,this._resolvedUriTargets=new NGe((e=>e.with({path:null,fragment:null,query:null}).toString())),this._externalOpeners=new $ve,this._defaultExternalOpener={openExternal:e=>o1e(this,void 0,void 0,(function*(){return CXe(e,$Te.http,$Te.https)?WMe(e):window.location.href=e,!0}))},this._openers.push({open:(e,t)=>o1e(this,void 0,void 0,(function*(){return!(!(null==t?void 0:t.openExternal)&&!CXe(e,$Te.mailto,$Te.http,$Te.https,$Te.vsls)||(yield this._doOpenExternal(e,t),0))}))}),this._openers.push(new s1e(t)),this._openers.push(new r1e(e))}open(e,t){var i;return o1e(this,void 0,void 0,(function*(){const n="string"==typeof e?QCe.parse(e):e,o=null!==(i=this._resolvedUriTargets.get(n))&&void 0!==i?i:e;for(const e of this._validators)if(!(yield e.shouldOpen(o,t)))return!1;for(const i of this._openers)if(yield i.open(e,t))return!0;return!1}))}resolveExternalUri(e,t){return o1e(this,void 0,void 0,(function*(){for(const i of this._resolvers)try{const n=yield i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.has(n.resolved)||this._resolvedUriTargets.set(n.resolved,e),n}catch(e){}throw new Error("Could not resolve external URI: "+e.toString())}))}_doOpenExternal(e,t){return o1e(this,void 0,void 0,(function*(){const i="string"==typeof e?QCe.parse(e):e;let n,o;try{n=(yield this.resolveExternalUri(i,t)).resolved}catch(e){n=i}if(o="string"==typeof e&&i.toString()===n.toString()?e:encodeURI(n.toString(!0)),null==t?void 0:t.allowContributedOpeners){const e="string"==typeof(null==t?void 0:t.allowContributedOpeners)?null==t?void 0:t.allowContributedOpeners:void 0;for(const t of this._externalOpeners)if(yield t.openExternal(o,{sourceUri:i,preferredOpenerId:e},nCe.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},nCe.None)}))}dispose(){this._validators.clear()}};var l1e,d1e;a1e=i1e([n1e(0,Uxe),n1e(1,gAe)],a1e),function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"}(l1e||(l1e={})),function(e){e.compare=function(e,t){return t-e};const t=Object.create(null);t[e.Error]=ove(0,"Error"),t[e.Warning]=ove(0,"Warning"),t[e.Info]=ove(0,"Info"),e.toString=function(e){return t[e]||""},e.fromSeverity=function(t){switch(t){case S$e.Error:return e.Error;case S$e.Warning:return e.Warning;case S$e.Info:return e.Info;case S$e.Ignore:return e.Hint}},e.toSeverity=function(t){switch(t){case e.Error:return S$e.Error;case e.Warning:return S$e.Warning;case e.Info:return S$e.Info;case e.Hint:return S$e.Ignore}}}(l1e||(l1e={})),function(e){const t="";function i(e,i){const n=[t];return e.source?n.push(e.source.replace("¦","\\¦")):n.push(t),e.code?"string"==typeof e.code?n.push(e.code.replace("¦","\\¦")):n.push(e.code.value.replace("¦","\\¦")):n.push(t),void 0!==e.severity&&null!==e.severity?n.push(l1e.toString(e.severity)):n.push(t),e.message&&i?n.push(e.message.replace("¦","\\¦")):n.push(t),void 0!==e.startLineNumber&&null!==e.startLineNumber?n.push(e.startLineNumber.toString()):n.push(t),void 0!==e.startColumn&&null!==e.startColumn?n.push(e.startColumn.toString()):n.push(t),void 0!==e.endLineNumber&&null!==e.endLineNumber?n.push(e.endLineNumber.toString()):n.push(t),void 0!==e.endColumn&&null!==e.endColumn?n.push(e.endColumn.toString()):n.push(t),n.push(t),n.join("¦")}e.makeKey=function(e){return i(e,!0)},e.makeKeyOptionalMessage=i}(d1e||(d1e={}));const h1e=zxe("markerService");var c1e=function(e,t){return function(i,n){t(i,n,e)}};class u1e extends Owe{constructor(e){super(),this.model=e,this._markersData=new Map,this._register(Awe((()=>{this.model.deltaDecorations([...this._markersData.keys()],[]),this._markersData.clear()})))}update(e,t){const i=[...this._markersData.keys()];this._markersData.clear();const n=this.model.deltaDecorations(i,t);for(let t=0;t<n.length;t++)this._markersData.set(n[t],e[t]);return 0!==i.length||0!==n.length}getMarker(e){return this._markersData.get(e.id)}}let g1e=class extends Owe{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new $we),this._markerDecorations=new NGe,e.getModels().forEach((e=>this._onModelAdded(e))),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach((e=>e.dispose())),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach((e=>{const t=this._markerDecorations.get(e);t&&this._updateDecorations(t)}))}_onModelAdded(e){const t=new u1e(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var t;const i=this._markerDecorations.get(e.uri);i&&(i.dispose(),this._markerDecorations.delete(e.uri)),e.uri.scheme!==$Te.inMemory&&e.uri.scheme!==$Te.internal&&e.uri.scheme!==$Te.vscode||null===(t=this._markerService)||void 0===t||t.read({resource:e.uri}).map((e=>e.owner)).forEach((t=>this._markerService.remove(t,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500}),i=t.map((t=>({range:this._createDecorationRange(e.model,t),options:this._createDecorationOption(t)})));e.update(t,i)&&this._onDidChangeMarker.fire(e.model)}_createDecorationRange(e,t){let i=dye.lift(t);if(t.severity!==l1e.Hint||this._hasMarkerTag(t,1)||this._hasMarkerTag(t,2)||(i=i.setEndPosition(i.startLineNumber,i.startColumn+2)),i=e.validateRange(i),i.isEmpty()){const t=e.getLineLastNonWhitespaceColumn(i.startLineNumber)||e.getLineMaxColumn(i.startLineNumber);if(1===t||i.endColumn>=t)return i;const n=e.getWordAtPosition(i.getStartPosition());n&&(i=new dye(i.startLineNumber,n.startColumn,i.endLineNumber,n.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&1===t.startColumn&&i.startLineNumber===i.endLineNumber){const n=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);n<i.endColumn&&(i=new dye(i.startLineNumber,n,i.endLineNumber,i.endColumn),t.startColumn=n)}return i}_createDecorationOption(e){let t,i,n,o,s;switch(e.severity){case l1e.Hint:t=this._hasMarkerTag(e,2)?void 0:this._hasMarkerTag(e,1)?"squiggly-unnecessary":"squiggly-hint",n=0;break;case l1e.Warning:t="squiggly-warning",i=HBe(lWe),n=20,s={color:HBe(WPe),position:Ake.Inline};break;case l1e.Info:t="squiggly-info",i=HBe(dWe),n=10;break;case l1e.Error:default:t="squiggly-error",i=HBe(aWe),n=30,s={color:HBe(BPe),position:Ake.Inline}}return e.tags&&(-1!==e.tags.indexOf(1)&&(o="squiggly-inline-unnecessary"),-1!==e.tags.indexOf(2)&&(o="squiggly-inline-deprecated")),{description:"marker-decoration",stickiness:1,className:t,showIfCollapsed:!0,overviewRuler:{color:i,position:Mke.Right},minimap:s,zIndex:n,inlineClassName:o}}_hasMarkerTag(e,t){return!!e.tags&&e.tags.indexOf(t)>=0}};g1e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([c1e(0,xDe),c1e(1,h1e)],g1e);class p1e{static create(e,t){return new p1e(e,new m1e(t))}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._endLineNumber}constructor(e,t){this._startLineNumber=e,this._tokens=t,this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}toString(){return this._tokens.toString(this._startLineNumber)}_updateEndLineNumber(){this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}isEmpty(){return this._tokens.isEmpty()}getLineTokens(e){return this._startLineNumber<=e&&e<=this._endLineNumber?this._tokens.getLineTokens(e-this._startLineNumber):null}getRange(){const e=this._tokens.getRange();return e?new dye(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn):e}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,i,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber,[n,o,s]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new p1e(this._startLineNumber,n),new p1e(this._startLineNumber+s,o)]}applyEdit(e,t){const[i,n,o]=Wze(t);this.acceptEdit(e,i,n,o,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,i,n,o){this._acceptDeleteRange(e),this._acceptInsertText(new lye(e.startLineNumber,e.startColumn),t,i,n,o),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;if(i<0){const e=i-t;return void(this._startLineNumber-=e)}const n=this._tokens.getMaxDeltaLine();if(!(t>=n+1)){if(t<0&&i>=n+1)return this._startLineNumber=0,void this._tokens.clear();if(t<0){const n=-t;this._startLineNumber-=n,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,n,o){if(0===t&&0===i)return;const s=e.lineNumber-this._startLineNumber;s<0?this._startLineNumber+=t:s>=this._tokens.getMaxDeltaLine()+1||this._tokens.acceptInsertText(s,e.column-1,t,i,n,o)}}class m1e{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;i<this._tokenCount;i++)t.push(`(${this._getDeltaLine(i)+e},${this._getStartCharacter(i)}-${this._getEndCharacter(i)})`);return`[${t.join(",")}]`}getMaxDeltaLine(){const e=this._getTokenCount();return 0===e?-1:this._getDeltaLine(e-1)}getRange(){const e=this._getTokenCount();if(0===e)return null;const t=this._getStartCharacter(0),i=this._getDeltaLine(e-1),n=this._getEndCharacter(e-1);return new dye(0,t+1,i,n+1)}_getTokenCount(){return this._tokenCount}_getDeltaLine(e){return this._tokens[4*e]}_getStartCharacter(e){return this._tokens[4*e+1]}_getEndCharacter(e){return this._tokens[4*e+2]}isEmpty(){return 0===this._getTokenCount()}getLineTokens(e){let t=0,i=this._getTokenCount()-1;for(;t<i;){const n=t+Math.floor((i-t)/2),o=this._getDeltaLine(n);if(o<e)t=n+1;else{if(!(o>e)){let o=n;for(;o>t&&this._getDeltaLine(o-1)===e;)o--;let s=n;for(;s<i&&this._getDeltaLine(s+1)===e;)s++;return new f1e(this._tokens.subarray(4*o,4*s+4))}i=n-1}}return this._getDeltaLine(t)===e?new f1e(this._tokens.subarray(4*t,4*t+4)):null}clear(){this._tokenCount=0}removeTokens(e,t,i,n){const o=this._tokens,s=this._tokenCount;let r=0,a=!1,l=0;for(let d=0;d<s;d++){const s=4*d,h=o[s],c=o[s+1],u=o[s+2],g=o[s+3];if((h>e||h===e&&u>=t)&&(h<i||h===i&&c<=n))a=!0;else{if(0===r&&(l=h),a){const e=4*r;o[e]=h-l,o[e+1]=c,o[e+2]=u,o[e+3]=g}r++}}return this._tokenCount=r,l}split(e,t,i,n){const o=this._tokens,s=this._tokenCount,r=[],a=[];let l=r,d=0,h=0;for(let r=0;r<s;r++){const s=4*r,c=o[s],u=o[s+1],g=o[s+2],p=o[s+3];if(c>e||c===e&&g>=t){if(c<i||c===i&&u<=n)continue;l!==a&&(l=a,d=0,h=c)}l[d++]=c-h,l[d++]=u,l[d++]=g,l[d++]=p}return[new m1e(new Uint32Array(r)),new m1e(new Uint32Array(a)),h]}acceptDeleteRange(e,t,i,n,o){const s=this._tokens,r=this._tokenCount,a=n-t;let l=0,d=!1;for(let h=0;h<r;h++){const c=4*h;let u=s[c],g=s[c+1],p=s[c+2];const m=s[c+3];if(u<t||u===t&&p<=i){l++;continue}if(u===t&&g<i)u===n&&p>o?p-=o-i:p=i;else if(u===t&&g===i){if(!(u===n&&p>o)){d=!0;continue}p-=o-i}else if(u<n||u===n&&g<o){if(!(u===n&&p>o)){d=!0;continue}u===t?(g=i,p=g+(p-o)):(g=0,p=g+(p-o))}else if(u>n){if(0===a&&!d){l=r;break}u-=a}else{if(!(u===n&&g>=o))throw new Error("Not possible!");e&&0===u&&(g+=e,p+=e),u-=a,g-=o-i,p-=o-i}const f=4*l;s[f]=u,s[f+1]=g,s[f+2]=p,s[f+3]=m,l++}this._tokenCount=l}acceptInsertText(e,t,i,n,o,s){const r=0===i&&1===n&&(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122),a=this._tokens,l=this._tokenCount;for(let s=0;s<l;s++){const l=4*s;let d=a[l],h=a[l+1],c=a[l+2];if(!(d<e||d===e&&c<t)){if(d===e&&c===t){if(!r)continue;c+=1}else if(d===e&&h<t&&t<c)0===i?c+=n:c=t;else{if(d===e&&h===t&&r)continue;if(d===e)if(d+=i,0===i)h+=n,c+=n;else{const e=c-h;h=o+(h-t),c=h+e}else d+=i}a[l]=d,a[l+1]=h,a[l+2]=c}}}}class f1e{constructor(e){this._tokens=e}getCount(){return this._tokens.length/4}getStartCharacter(e){return this._tokens[4*e+1]}getEndCharacter(e){return this._tokens[4*e+2]}getMetadata(e){return this._tokens[4*e+3]}}var _1e=function(e,t){return function(i,n){t(i,n,e)}};let v1e=class{constructor(e,t,i,n){this._legend=e,this._themeService=t,this._languageService=i,this._logService=n,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new w1e}getMetadata(e,t,i){const n=this._languageService.languageIdCodec.encodeLanguageId(i),o=this._hashTable.get(e,t,n);let s;if(o)s=o.metadata,this._logService.getLevel()===SNe.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${VNe.getForeground(s)}, fontStyle ${VNe.getFontStyle(s).toString(2)}`);else{let o=this._legend.tokenTypes[e];const r=[];if(o){let e=t;for(let t=0;e>0&&t<this._legend.tokenModifiers.length;t++)1&e&&r.push(this._legend.tokenModifiers[t]),e>>=1;e>0&&this._logService.getLevel()===SNe.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),r.push("not-in-legend"));const n=this._themeService.getColorTheme().getTokenStyleMetadata(o,r,i);void 0===n?s=2147483647:(s=0,void 0!==n.italic&&(s|=1|(n.italic?1:0)<<11),void 0!==n.bold&&(s|=2|(n.bold?2:0)<<11),void 0!==n.underline&&(s|=4|(n.underline?4:0)<<11),void 0!==n.strikethrough&&(s|=8|(n.strikethrough?8:0)<<11),n.foreground&&(s|=16|n.foreground<<15),0===s&&(s=2147483647))}else this._logService.getLevel()===SNe.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),s=2147483647,o="not-in-legend";this._hashTable.add(e,t,n,s),this._logService.getLevel()===SNe.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${o}) / ${t} (${r.join(" ")}): foreground ${VNe.getForeground(s)}, fontStyle ${VNe.getFontStyle(s).toString(2)}`)}return s}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,console.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,n,o){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,console.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${n} is outside the previous data (length ${o}).`))}};v1e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([_1e(1,VBe),_1e(2,NLe),_1e(3,yNe)],v1e);class b1e{constructor(e,t,i,n){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=n,this.next=null}}class w1e{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=w1e._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<w1e._SIZES.length?2/3*this._currentLength:0),this._elements=[],w1e._nullOutEntries(this._elements,this._currentLength)}static _nullOutEntries(e,t){for(let i=0;i<t;i++)e[i]=null}_hash2(e,t){return(e<<5)-e+t|0}_hashFunc(e,t,i){return this._hash2(this._hash2(e,t),i)%this._currentLength}get(e,t,i){const n=this._hashFunc(e,t,i);let o=this._elements[n];for(;o;){if(o.tokenTypeIndex===e&&o.tokenModifierSet===t&&o.languageId===i)return o;o=o.next}return null}add(e,t,i,n){if(this._elementsCount++,0!==this._growCount&&this._elementsCount>=this._growCount){const e=this._elements;this._currentLengthIndex++,this._currentLength=w1e._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<w1e._SIZES.length?2/3*this._currentLength:0),this._elements=[],w1e._nullOutEntries(this._elements,this._currentLength);for(const t of e){let e=t;for(;e;){const t=e.next;e.next=null,this._add(e),e=t}}}this._add(new b1e(e,t,i,n))}_add(e){const t=this._hashFunc(e.tokenTypeIndex,e.tokenModifierSet,e.languageId);e.next=this._elements[t],this._elements[t]=e}}function C1e(e){const t=new Uint32Array(function(e){let t=0;if(t+=2,"full"===e.type)t+=1+e.data.length;else{t+=1,t+=3*e.deltas.length;for(const i of e.deltas)i.data&&(t+=i.data.length)}return t}(e));let i=0;if(t[i++]=e.id,"full"===e.type)t[i++]=1,t[i++]=e.data.length,t.set(e.data,i),i+=e.data.length;else{t[i++]=2,t[i++]=e.deltas.length;for(const n of e.deltas)t[i++]=n.start,t[i++]=n.deleteCount,n.data?(t[i++]=n.data.length,t.set(n.data,i),i+=n.data.length):t[i++]=0}return function(e){const t=new Uint8Array(e.buffer,e.byteOffset,4*e.length);return Vve()||function(e){for(let t=0,i=e.length;t<i;t+=4){const i=e[t+0],n=e[t+1],o=e[t+2],s=e[t+3];e[t+0]=s,e[t+1]=o,e[t+2]=n,e[t+3]=i}}(t),eLe.wrap(t)}(t)}w1e._SIZES=[3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143];var y1e=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function S1e(e){return e&&!!e.data}function x1e(e){return e&&Array.isArray(e.edits)}class k1e{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function L1e(e,t){return e.has(t)}function D1e(e,t,i,n,o){return y1e(this,void 0,void 0,(function*(){const s=function(e,t){const i=e.orderedGroups(t);return i.length>0?i[0]:[]}(e,t),r=yield Promise.all(s.map((e=>y1e(this,void 0,void 0,(function*(){let s,r=null;try{s=yield e.provideDocumentSemanticTokens(t,e===i?n:null,o)}catch(e){r=e,s=null}return s&&(S1e(s)||x1e(s))||(s=null),new k1e(e,s,r)})))));for(const e of r){if(e.error)throw e.error;if(e.tokens)return e}return r.length>0?r[0]:null}))}class E1e{constructor(e,t){this.provider=e,this.tokens=t}}function N1e(e,t){const i=e.orderedGroups(t);return i.length>0?i[0]:[]}function I1e(e,t,i,n){return y1e(this,void 0,void 0,(function*(){const o=N1e(e,t),s=yield Promise.all(o.map((e=>y1e(this,void 0,void 0,(function*(){let o;try{o=yield e.provideDocumentRangeSemanticTokens(t,i,n)}catch(e){Cwe(e),o=null}return o&&S1e(o)||(o=null),new E1e(e,o)})))));for(const e of s)if(e.tokens)return e;return s.length>0?s[0]:null}))}pAe.registerCommand("_provideDocumentSemanticTokensLegend",((e,...t)=>y1e(void 0,void 0,void 0,(function*(){const[i]=t;kbe(i instanceof QCe);const n=e.get(xDe).getModel(i);if(!n)return;const{documentSemanticTokensProvider:o}=e.get(ENe),s=function(e,t){const i=e.orderedGroups(t);return i.length>0?i[0]:null}(o,n);return s?s[0].getLegend():e.get(gAe).executeCommand("_provideDocumentRangeSemanticTokensLegend",i)})))),pAe.registerCommand("_provideDocumentSemanticTokens",((e,...t)=>y1e(void 0,void 0,void 0,(function*(){const[i]=t;kbe(i instanceof QCe);const n=e.get(xDe).getModel(i);if(!n)return;const{documentSemanticTokensProvider:o}=e.get(ENe);if(!L1e(o,n))return e.get(gAe).executeCommand("_provideDocumentRangeSemanticTokens",i,n.getFullModelRange());const s=yield D1e(o,n,null,null,nCe.None);if(!s)return;const{provider:r,tokens:a}=s;if(!a||!S1e(a))return;const l=C1e({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),l})))),pAe.registerCommand("_provideDocumentRangeSemanticTokensLegend",((e,...t)=>y1e(void 0,void 0,void 0,(function*(){const[i,n]=t;kbe(i instanceof QCe);const o=e.get(xDe).getModel(i);if(!o)return;const{documentRangeSemanticTokensProvider:s}=e.get(ENe),r=N1e(s,o);if(0===r.length)return;if(1===r.length)return r[0].getLegend();if(!n||!dye.isIRange(n))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),r[0].getLegend();const a=yield I1e(s,o,dye.lift(n),nCe.None);return a?a.provider.getLegend():void 0})))),pAe.registerCommand("_provideDocumentRangeSemanticTokens",((e,...t)=>y1e(void 0,void 0,void 0,(function*(){const[i,n]=t;kbe(i instanceof QCe),kbe(dye.isIRange(n));const o=e.get(xDe).getModel(i);if(!o)return;const{documentRangeSemanticTokensProvider:s}=e.get(ENe),r=yield I1e(s,o,dye.lift(n),nCe.None);return r&&r.tokens?C1e({id:0,type:"full",data:r.tokens.data}):void 0}))));var T1e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},M1e=function(e,t){return function(i,n){t(i,n,e)}};function A1e(e){return e.toString()}function R1e(e){const t=new cEe,i=e.createSnapshot();let n;for(;n=i.read();)t.update(n);return t.digest()}class O1e{constructor(e,t,i){this._modelEventListeners=new Rwe,this.model=e,this._languageSelection=null,this._languageSelectionListener=null,this._modelEventListeners.add(e.onWillDispose((()=>t(e)))),this._modelEventListeners.add(e.onDidChangeLanguage((t=>i(e,t))))}_disposeLanguageSelection(){this._languageSelectionListener&&(this._languageSelectionListener.dispose(),this._languageSelectionListener=null)}dispose(){this._modelEventListeners.dispose(),this._disposeLanguageSelection()}setLanguage(e,t){this._disposeLanguageSelection(),this._languageSelection=e,this._languageSelectionListener=this._languageSelection.onDidChange((()=>this.model.setMode(e.languageId,t))),this.model.setMode(e.languageId,t)}}const P1e=Eve||Dve?1:2;class F1e{constructor(e,t,i,n,o,s,r,a){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=n,this.heapSize=o,this.sha1=s,this.versionId=r,this.alternativeVersionId=a}}let B1e=class e extends Owe{constructor(e,t,i,n,o,s,r,a,l){super(),this._configurationService=e,this._resourcePropertiesService=t,this._themeService=i,this._logService=n,this._undoRedoService=o,this._languageService=s,this._languageConfigurationService=r,this._languageFeatureDebounceService=a,this._onModelAdded=this._register(new $we),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new $we),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new $we),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._semanticStyling=this._register(new z1e(this._themeService,this._languageService,this._logService)),this._register(this._configurationService.onDidChangeConfiguration((e=>this._updateModelOptions(e)))),this._updateModelOptions(void 0),this._register(new H1e(this._semanticStyling,this,this._themeService,this._configurationService,this._languageFeatureDebounceService,l))}static _readModelOptions(e,t){var i;let n=Pbe.tabSize;if(e.editor&&void 0!==e.editor.tabSize){const t=parseInt(e.editor.tabSize,10);isNaN(t)||(n=t),n<1&&(n=1)}let o="tabSize";if(e.editor&&void 0!==e.editor.indentSize&&"tabSize"!==e.editor.indentSize){const t=parseInt(e.editor.indentSize,10);isNaN(t)||(o=Math.max(t,1))}let s=Pbe.insertSpaces;e.editor&&void 0!==e.editor.insertSpaces&&(s="false"!==e.editor.insertSpaces&&Boolean(e.editor.insertSpaces));let r=P1e;const a=e.eol;"\r\n"===a?r=2:"\n"===a&&(r=1);let l=Pbe.trimAutoWhitespace;e.editor&&void 0!==e.editor.trimAutoWhitespace&&(l="false"!==e.editor.trimAutoWhitespace&&Boolean(e.editor.trimAutoWhitespace));let d=Pbe.detectIndentation;e.editor&&void 0!==e.editor.detectIndentation&&(d="false"!==e.editor.detectIndentation&&Boolean(e.editor.detectIndentation));let h=Pbe.largeFileOptimizations;e.editor&&void 0!==e.editor.largeFileOptimizations&&(h="false"!==e.editor.largeFileOptimizations&&Boolean(e.editor.largeFileOptimizations));let c=Pbe.bracketPairColorizationOptions;return(null===(i=e.editor)||void 0===i?void 0:i.bracketPairColorization)&&"object"==typeof e.editor.bracketPairColorization&&(c={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:n,indentSize:o,insertSpaces:s,detectIndentation:d,defaultEOL:r,trimAutoWhitespace:l,largeFileOptimizations:h,bracketPairColorizationOptions:c}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&"string"==typeof i&&"auto"!==i?i:3===Fve||2===Fve?"\n":"\r\n"}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return"boolean"!=typeof e||e}getCreationOptions(t,i,n){let o=this._modelCreationOptionsByLanguageAndResource[t+i];if(!o){const s=this._configurationService.getValue("editor",{overrideIdentifier:t,resource:i}),r=this._getEOL(i,t);o=e._readModelOptions({editor:s,eol:r},n),this._modelCreationOptionsByLanguageAndResource[t+i]=o}return o}_updateModelOptions(t){const i=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const n=Object.keys(this._models);for(let o=0,s=n.length;o<s;o++){const s=n[o],r=this._models[s],a=r.model.getLanguageId(),l=r.model.uri;if(t&&!t.affectsConfiguration("editor",{overrideIdentifier:a,resource:l})&&!t.affectsConfiguration("files.eol",{overrideIdentifier:a,resource:l}))continue;const d=i[a+l],h=this.getCreationOptions(a,l,r.model.isForSimpleWidget);e._setModelOptionsForModel(r.model,h,d)}}static _setModelOptionsForModel(e,t,i){i&&i.defaultEOL!==t.defaultEOL&&1===e.getLineCount()&&e.setEOL(1===t.defaultEOL?0:1),i&&i.detectIndentation===t.detectIndentation&&i.insertSpaces===t.insertSpaces&&i.tabSize===t.tabSize&&i.indentSize===t.indentSize&&i.trimAutoWhitespace===t.trimAutoWhitespace&&Rbe(i.bracketPairColorizationOptions,t.bracketPairColorizationOptions)||(t.detectIndentation?(e.detectIndentation(t.insertSpaces,t.tabSize),e.updateOptions({trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions})):e.updateOptions({insertSpaces:t.insertSpaces,tabSize:t.tabSize,indentSize:t.indentSize,trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions}))}_insertDisposedModel(e){this._disposedModels.set(A1e(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(A1e(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(A1e(e)),t}_ensureDisposedModelsHeapSize(e){if(this._disposedModelsHeapSize>e){const t=[];for(this._disposedModels.forEach((e=>{e.sharesUndoRedoStack||t.push(e)})),t.sort(((e,t)=>e.time-t.time));t.length>0&&this._disposedModelsHeapSize>e;){const e=t.shift();this._removeDisposedModel(e.uri),null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,n){const o=this.getCreationOptions(t,i,n),s=new jje(e,t,o,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(A1e(i))){const e=this._removeDisposedModel(i),t=this._undoRedoService.getElements(i),n=R1e(s)===e.sha1;if(n||e.sharesUndoRedoStack){for(const e of t.past)_Ke(e)&&e.matchesResource(i)&&e.setModel(s);for(const e of t.future)_Ke(e)&&e.matchesResource(i)&&e.setModel(s);this._undoRedoService.setElementsValidFlag(i,!0,(e=>_Ke(e)&&e.matchesResource(i))),n&&(s._overwriteVersionId(e.versionId),s._overwriteAlternativeVersionId(e.alternativeVersionId),s._overwriteInitialUndoRedoSnapshot(e.initialUndoRedoSnapshot))}else null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}const r=A1e(s.uri);if(this._models[r])throw new Error("ModelService: Cannot add model because it already exists!");const a=new O1e(s,(e=>this._onWillDispose(e)),((e,t)=>this._onDidChangeLanguage(e,t)));return this._models[r]=a,a}createModel(e,t,i,n=!1){let o;return t?(o=this._createModelData(e,t.languageId,i,n),this.setMode(o.model,t)):o=this._createModelData(e,tDe,i,n),this._onModelAdded.fire(o.model),o.model}setMode(e,t,i){if(!t)return;const n=this._models[A1e(e.uri)];n&&n.setLanguage(t,i)}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i<n;i++){const n=t[i];e.push(this._models[n].model)}return e}getModel(e){const t=A1e(e),i=this._models[t];return i?i.model:null}getSemanticTokensProviderStyling(e){return this._semanticStyling.get(e)}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===$Te.file||e.scheme===$Te.vscodeRemote||e.scheme===$Te.vscodeUserData||e.scheme===$Te.vscodeNotebookCell||"fake-fs"===e.scheme}_onWillDispose(t){const i=A1e(t.uri),n=this._models[i],o=this._undoRedoService.getUriComparisonKey(t.uri)!==t.uri.toString();let s=!1,r=0;if(o||this._shouldRestoreUndoStack()&&this._schemaShouldMaintainUndoRedoElements(t.uri)){const e=this._undoRedoService.getElements(t.uri);if(e.past.length>0||e.future.length>0){for(const i of e.past)_Ke(i)&&i.matchesResource(t.uri)&&(s=!0,r+=i.heapSize(t.uri),i.setModel(t.uri));for(const i of e.future)_Ke(i)&&i.matchesResource(t.uri)&&(s=!0,r+=i.heapSize(t.uri),i.setModel(t.uri))}}const a=e.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK;if(s)if(!o&&r>a){const e=n.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}else this._ensureDisposedModelsHeapSize(a-r),this._undoRedoService.setElementsValidFlag(t.uri,!1,(e=>_Ke(e)&&e.matchesResource(t.uri))),this._insertDisposedModel(new F1e(t.uri,n.model.getInitialUndoRedoSnapshot(),Date.now(),o,r,R1e(t),t.getVersionId(),t.getAlternativeVersionId()));else if(!o){const e=n.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}delete this._models[i],n.dispose(),delete this._modelCreationOptionsByLanguageAndResource[t.getLanguageId()+t.uri],this._onModelRemoved.fire(t)}_onDidChangeLanguage(t,i){const n=i.oldLanguage,o=t.getLanguageId(),s=this.getCreationOptions(n,t.uri,t.isForSimpleWidget),r=this.getCreationOptions(o,t.uri,t.isForSimpleWidget);e._setModelOptionsForModel(t,r,s),this._onModelModeChanged.fire({model:t,oldLanguageId:n})}};B1e.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20971520,B1e=T1e([M1e(0,SLe),M1e(1,CNe),M1e(2,VBe),M1e(3,yNe),M1e(4,Pje),M1e(5,NLe),M1e(6,dDe),M1e(7,yXe),M1e(8,ENe)],B1e);const W1e="editor.semanticHighlighting";function V1e(e,t,i){var n;const o=null===(n=i.getValue(W1e,{overrideIdentifier:e.getLanguageId(),resource:e.uri}))||void 0===n?void 0:n.enabled;return"boolean"==typeof o?o:t.getColorTheme().semanticHighlighting}let H1e=class extends Owe{constructor(e,t,i,n,o,s){super(),this._watchers=Object.create(null),this._semanticStyling=e;const r=e=>{this._watchers[e.uri.toString()]=new K1e(e,this._semanticStyling,i,o,s)},a=(e,t)=>{t.dispose(),delete this._watchers[e.uri.toString()]},l=()=>{for(const e of t.getModels()){const t=this._watchers[e.uri.toString()];V1e(e,i,n)?t||r(e):t&&a(e,t)}};this._register(t.onModelAdded((e=>{V1e(e,i,n)&&r(e)}))),this._register(t.onModelRemoved((e=>{const t=this._watchers[e.uri.toString()];t&&a(e,t)}))),this._register(n.onDidChangeConfiguration((e=>{e.affectsConfiguration(W1e)&&l()}))),this._register(i.onDidColorThemeChange(l))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};H1e=T1e([M1e(1,xDe),M1e(2,VBe),M1e(3,SLe),M1e(4,yXe),M1e(5,ENe)],H1e);class z1e extends Owe{constructor(e,t,i){super(),this._themeService=e,this._languageService=t,this._logService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange((()=>{this._caches=new WeakMap})))}get(e){return this._caches.has(e)||this._caches.set(e,new v1e(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}}class U1e{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}let K1e=class e extends Owe{constructor(t,i,n,o,s){super(),this._isDisposed=!1,this._model=t,this._semanticStyling=i,this._provider=s.documentSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentSemanticTokens",{min:e.REQUEST_MIN_DELAY,max:e.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new FDe((()=>this._fetchDocumentSemanticTokensNow()),e.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent((()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))}))),this._register(this._model.onDidChangeLanguage((()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)})));const r=()=>{Twe(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const e of this._provider.all(t))"function"==typeof e.onDidChange&&this._documentProvidersChangeListeners.push(e.onDidChange((()=>{this._currentDocumentRequestCancellationTokenSource?this._providersChangedDuringRequest=!0:this._fetchDocumentSemanticTokens.schedule(0)})))};r(),this._register(this._provider.onDidChange((()=>{r(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))}))),this._register(n.onDidColorThemeChange((e=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))}))),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!L1e(this._provider,this._model))return void(this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1));const e=new sCe,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=D1e(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const o=[],s=this._model.onDidChangeContent((e=>{o.push(e)})),r=new Hwe(!1);n.then((e=>{if(this._debounceInformation.update(this._model,r.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),e){const{provider:t,tokens:i}=e,n=this._semanticStyling.get(t);this._setDocumentSemanticTokens(t,i||null,n,o)}else this._setDocumentSemanticTokens(null,null,null,o)}),(e=>{e&&(xwe(e)||"string"==typeof e.message&&-1!==e.message.indexOf("busy"))||wwe(e),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),(o.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))}))}static _copy(e,t,i,n,o){o=Math.min(o,i.length-n,e.length-t);for(let s=0;s<o;s++)i[n+s]=e[t+s]}_setDocumentSemanticTokens(t,i,n,o){const s=this._currentDocumentResponse,r=()=>{(o.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed)t&&i&&t.releaseDocumentSemanticTokens(i.resultId);else if(t&&n){if(!i)return this._model.tokenization.setSemanticTokens(null,!0),void r();if(x1e(i)){if(!s)return void this._model.tokenization.setSemanticTokens(null,!0);if(0===i.edits.length)i={resultId:i.resultId,data:s.data};else{let t=0;for(const e of i.edits)t+=(e.data?e.data.length:0)-e.deleteCount;const o=s.data,r=new Uint32Array(o.length+t);let a=o.length,l=r.length;for(let t=i.edits.length-1;t>=0;t--){const d=i.edits[t];if(d.start>o.length)return n.warnInvalidEditStart(s.resultId,i.resultId,t,d.start,o.length),void this._model.tokenization.setSemanticTokens(null,!0);const h=a-(d.start+d.deleteCount);h>0&&(e._copy(o,a-h,r,l-h,h),l-=h),d.data&&(e._copy(d.data,0,r,l-d.data.length,d.data.length),l-=d.data.length),a=d.start}a>0&&e._copy(o,0,r,0,a),i={resultId:i.resultId,data:r}}}if(S1e(i)){this._currentDocumentResponse=new U1e(t,i.resultId,i.data);const e=function(e,t,i){const n=e.data,o=e.data.length/5|0,s=Math.max(Math.ceil(o/1024),400),r=[];let a=0,l=1,d=0;for(;a<o;){const e=a;let h=Math.min(e+s,o);if(h<o){let t=h;for(;t-1>e&&0===n[5*t];)t--;if(t-1===e){let e=h;for(;e+1<o&&0===n[5*e];)e++;h=e}else h=t}let c=new Uint32Array(4*(h-e)),u=0,g=0,p=0,m=0;for(;a<h;){const e=5*a,o=n[e],s=n[e+1],r=l+o|0,h=0===o?d+s|0:s,f=h+n[e+2]|0,_=n[e+3],v=n[e+4];if(f<=h)t.warnInvalidLengthSemanticTokens(r,h+1);else if(p===r&&m>h)t.warnOverlappingSemanticTokens(r,h+1);else{const e=t.getMetadata(_,v,i);2147483647!==e&&(0===g&&(g=r),c[u]=r-g,c[u+1]=h,c[u+2]=f,c[u+3]=e,u+=4,p=r,m=f)}l=r,d=h,a++}u!==c.length&&(c=c.subarray(0,u));const f=p1e.create(g,c);r.push(f)}return r}(i,n,this._model.getLanguageId());if(o.length>0)for(const t of o)for(const i of e)for(const e of t.changes)i.applyEdit(e.range,e.text);this._model.tokenization.setSemanticTokens(e,!0)}else this._model.tokenization.setSemanticTokens(null,!0);r()}else this._model.tokenization.setSemanticTokens(null,!1)}};K1e.REQUEST_MIN_DELAY=300,K1e.REQUEST_MAX_DELAY=2e3,K1e=T1e([M1e(2,VBe),M1e(3,yXe),M1e(4,ENe)],K1e);var j1e=i(1336),q1e={};q1e.styleTagTransform=zl(),q1e.setAttributes=Bl(),q1e.insert=Pl().bind(null,"head"),q1e.domAPI=Rl(),q1e.insertStyleElement=Vl(),Ml()(j1e.A,q1e),j1e.A&&j1e.A.locals&&j1e.A.locals;var $1e=i(4402),G1e={};G1e.styleTagTransform=zl(),G1e.setAttributes=Bl(),G1e.insert=Pl().bind(null,"head"),G1e.domAPI=Rl(),G1e.insertStyleElement=Vl(),Ml()($1e.A,G1e),$1e.A&&$1e.A.locals&&$1e.A.locals,hRe.white.toString(),hRe.white.toString();class Z1e extends Owe{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._onDidClick=this._register(new $we),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button");const i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,n=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=n||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),e.appendChild(this._element),this._register(oRe.addTarget(this._element)),[LMe.CLICK,nRe.Tap].forEach((e=>{this._register(tMe(this._element,e,(e=>{this.enabled?this._onDidClick.fire(e):DMe(e)})))})),this._register(tMe(this._element,LMe.KEY_DOWN,(e=>{const t=new KIe(e);let i=!1;this.enabled&&(t.equals(3)||t.equals(10))?(this._onDidClick.fire(e),i=!0):t.equals(9)&&(this._element.blur(),i=!0),i&&DMe(t,!0)}))),this._register(tMe(this._element,LMe.MOUSE_OVER,(e=>{this._element.classList.contains("disabled")||this.updateBackground(!0)}))),this._register(tMe(this._element,LMe.MOUSE_OUT,(e=>{this.updateBackground(!1)}))),this.focusTracker=this._register(NMe(this._element)),this._register(this.focusTracker.onDidFocus((()=>{this.enabled&&this.updateBackground(!0)}))),this._register(this.focusTracker.onDidBlur((()=>{this.enabled&&this.updateBackground(!1)})))}getContentElements(e){const t=[];for(let i of TZe(e))if("string"==typeof i){if(i=i.trim(),""===i)continue;const e=document.createElement("span");e.textContent=i,t.push(e)}else t.push(i);return t}updateBackground(e){let t;t=this.options.secondary?e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){this._element.classList.add("monaco-text-button");const t=this.options.supportShortLabel?this._labelElement:this._element;this.options.supportIcons?TMe(t,...this.getContentElements(e)):t.textContent=e,"string"==typeof this.options.title?this._element.title=this.options.title:this.options.title&&(this._element.title=e)}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}}var Y1e=i(206),Q1e={};Q1e.styleTagTransform=zl(),Q1e.setAttributes=Bl(),Q1e.insert=Pl().bind(null,"head"),Q1e.domAPI=Rl(),Q1e.insertStyleElement=Vl(),Ml()(Y1e.A,Q1e),Y1e.A&&Y1e.A.locals&&Y1e.A.locals;class X1e{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=IMe(e,OMe(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){var e,t;this.element.textContent=CSe(this.countFormat,this.count),this.element.title=CSe(this.titleFormat,this.count),this.element.style.backgroundColor=null!==(e=this.styles.badgeBackground)&&void 0!==e?e:"",this.element.style.color=null!==(t=this.styles.badgeForeground)&&void 0!==t?t:"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}var J1e=i(2124),e2e={};e2e.styleTagTransform=zl(),e2e.setAttributes=Bl(),e2e.insert=Pl().bind(null,"head"),e2e.domAPI=Rl(),e2e.insertStyleElement=Vl(),Ml()(J1e.A,e2e),J1e.A&&J1e.A.locals&&J1e.A.locals;const t2e="done",i2e="active",n2e="infinite",o2e="infinite-long-running",s2e="discrete";class r2e extends Owe{constructor(e,t){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new FDe((()=>PMe(this.element)),0)),this.longRunningScheduler=this._register(new FDe((()=>this.infiniteLongRunning()),r2e.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=(null==t?void 0:t.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(i2e,n2e,o2e,s2e),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(t2e),this.element.classList.contains(n2e)?(this.bit.style.opacity="0",e?setTimeout((()=>this.off()),200):this.off()):(this.bit.style.width="inherit",e?setTimeout((()=>this.off()),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(s2e,t2e,o2e),this.element.classList.add(i2e,n2e),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(o2e)}getContainer(){return this.element}}r2e.LONG_RUNNING_INFINITE_THRESHOLD=1e4;var a2e=i(9206),l2e={};l2e.styleTagTransform=zl(),l2e.setAttributes=Bl(),l2e.insert=Pl().bind(null,"head"),l2e.domAPI=Rl(),l2e.insertStyleElement=Vl(),Ml()(a2e.A,l2e),a2e.A&&a2e.A.locals&&a2e.A.locals;class d2e extends QFe{constructor(e){super(),this._onChange=this._register(new $we),this.onChange=this._onChange.event,this._onKeyDown=this._register(new $we),this.onKeyDown=this._onKeyDown.event,this._opts=e,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...sAe.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this.domNode.title=this._opts.title,this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,(e=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),e.preventDefault())})),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,(e=>{if(10===e.keyCode||3===e.keyCode)return this.checked=!this._checked,this._onChange.fire(!0),e.preventDefault(),void e.stopPropagation();this._onKeyDown.fire(e)}))}get enabled(){return"true"!==this.domNode.getAttribute("aria-disabled")}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}width(){return 22}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}var h2e=i(8439),c2e={};c2e.styleTagTransform=zl(),c2e.setAttributes=Bl(),c2e.insert=Pl().bind(null,"head"),c2e.domAPI=Rl(),c2e.insertStyleElement=Vl(),Ml()(h2e.A,c2e),h2e.A&&h2e.A.locals&&h2e.A.locals;const u2e={},g2e=new AZe("quick-input-button-icon-");function p2e(e){if(!e)return;let t;const i=e.dark.toString();return u2e[i]?t=u2e[i]:(t=g2e.nextId(),xMe(`.${t}, .hc-light .${t}`,`background-image: ${VMe(e.light||e.dark)}`),xMe(`.vs-dark .${t}, .hc-black .${t}`,`background-image: ${VMe(e.dark)}`),u2e[i]=t),t}const m2e={ctrlCmd:!1,alt:!1};var f2e,_2e;!function(e){e[e.Blur=1]="Blur",e[e.Gesture=2]="Gesture",e[e.Other=3]="Other"}(f2e||(f2e={})),function(e){e[e.NONE=0]="NONE",e[e.FIRST=1]="FIRST",e[e.SECOND=2]="SECOND",e[e.LAST=3]="LAST"}(_2e||(_2e={})),new class{constructor(e){this.options=e}};const v2e=ove(0,"Match Case"),b2e=ove(0,"Match Whole Word"),w2e=ove(0,"Use Regular Expression");class C2e extends d2e{constructor(e){super({icon:pye.caseSensitive,title:v2e+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class y2e extends d2e{constructor(e){super({icon:pye.wholeWord,title:b2e+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class S2e extends d2e{constructor(e){super({icon:pye.regex,title:w2e+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class x2e{constructor(e,t=0,i=e.length,n=t-1){this.items=e,this.start=t,this.end=i,this.index=n}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class k2e{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._currentPosition()!==this._elements.length-1?this._navigator.next():null}previous(){return 0!==this._currentPosition()?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()===this._elements.length-1}isNowhere(){return null===this._navigator.current()}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new x2e(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(const t of e)this._history.add(t)}get _elements(){const e=[];return this._history.forEach((t=>e.push(t))),e}}var L2e=i(7184),D2e={};D2e.styleTagTransform=zl(),D2e.setAttributes=Bl(),D2e.insert=Pl().bind(null,"head"),D2e.domAPI=Rl(),D2e.insertStyleElement=Vl(),Ml()(L2e.A,D2e),L2e.A&&L2e.A.locals&&L2e.A.locals;const E2e=OMe;class N2e extends QFe{constructor(e,t,i){var n;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new $we),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new $we),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=null!==(n=this.options.tooltip)&&void 0!==n?n:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=IMe(e,E2e(".monaco-inputbox.idle"));const o=this.options.flexibleHeight?"textarea":"input",s=IMe(this.element,E2e(".ibwrapper"));if(this.input=IMe(s,E2e(o+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,(()=>this.element.classList.add("synthetic-focus"))),this.onblur(this.input,(()=>this.element.classList.remove("synthetic-focus"))),this.options.flexibleHeight){this.maxHeight="number"==typeof this.options.flexibleMaxHeight?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=IMe(s,E2e("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new fBe(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),IMe(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll((e=>this.input.scrollTop=e.scrollTop)));const t=this._register(new xBe(document,"selectionchange")),i=zwe.filter(t.event,(()=>{const e=document.getSelection();return(null==e?void 0:e.anchorNode)===s}));this._register(i(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,(()=>this.onValueChange())),this.onblur(this.input,(()=>this.onBlur())),this.onfocus(this.input,(()=>this.onFocus())),this._register(this.ignoreGesture(this.input)),setTimeout((()=>this.updateMirror()),0),this.options.actions&&(this.actionbar=this._register(new eQe(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.input.title=e}setAriaLabel(e){this.ariaLabel=e,e?this.input.setAttribute("aria-label",this.ariaLabel):this.input.removeAttribute("aria-label")}getAriaLabel(){return this.ariaLabel}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return"number"==typeof this.cachedHeight?this.cachedHeight:pMe(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return document.activeElement===this.input}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if("number"!=typeof this.cachedContentHeight||"number"!=typeof this.cachedHeight||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${zMe(i.border,"transparent")}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),null==e?void 0:e.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=cMe(this.element)+"px";let i;this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:i=>{var n,o;if(!this.message)return null;e=IMe(i,E2e(".monaco-inputbox-container")),t();const s={inline:!0,className:"monaco-inputbox-message"},r=this.message.formatContent?kZe(this.message.content,s):function(e,t={}){const i=LZe(t);return i.textContent=e,i}(this.message.content,s);r.classList.add(this.classForType(this.message.type));const a=this.stylesForType(this.message.type);return r.style.backgroundColor=null!==(n=a.background)&&void 0!==n?n:"",r.style.color=null!==(o=a.foreground)&&void 0!==o?o:"",r.style.border=a.border?`1px solid ${a.border}`:"",IMe(e,r),null},onHide:()=>{this.state="closed"},layout:t}),i=3===this.message.type?ove(0,"Error: {0}",this.message.content):2===this.message.type?ove(0,"Warning: {0}",this.message.content):ove(0,"Info: {0}",this.message.content),JMe(i),this.state="open"}_hideMessage(){this.contextViewProvider&&("open"===this.state&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),"open"===this.state&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,t=10===e.charCodeAt(e.length-1)?" ":"";(e+t).replace(/\u000c/g,"")?this.mirror.textContent=e+t:this.mirror.innerText=" ",this.layout()}applyStyles(){var e,t,i;const n=this.options.inputBoxStyles,o=null!==(e=n.inputBackground)&&void 0!==e?e:"",s=null!==(t=n.inputForeground)&&void 0!==t?t:"",r=null!==(i=n.inputBorder)&&void 0!==i?i:"";this.element.style.backgroundColor=o,this.element.style.color=s,this.input.style.backgroundColor="inherit",this.input.style.color=s,this.element.style.border=`1px solid ${zMe(r,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=pMe(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,n=t.selectionEnd,o=t.value;null!==i&&null!==n&&(this.value=o.substr(0,i)+e+o.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,null===(e=this.actionbar)||void 0===e||e.dispose(),super.dispose()}}class I2e extends N2e{constructor(e,t,i){const n=ove(0,"for history"),o=` or ⇅ ${n}`,s=` (⇅ ${n})`;super(e,t,i),this._onDidFocus=this._register(new $we),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new $we),this.onDidBlur=this._onDidBlur.event,this.history=new k2e(i.history,100);const r=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(o)&&!this.placeholder.endsWith(s)&&this.history.getHistory().length){const e=this.placeholder.endsWith(")")?o:s,t=this.placeholder+e;i.showPlaceholderOnFocus&&document.activeElement!==this.input?this.placeholder=t:this.setPlaceHolder(t)}};this.observer=new MutationObserver(((e,t)=>{e.forEach((e=>{e.target.textContent||r()}))})),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,(()=>r())),this.onblur(this.input,(()=>{const e=e=>{if(this.placeholder.endsWith(e)){const t=this.placeholder.slice(0,this.placeholder.length-e.length);return i.showPlaceholderOnFocus?this.placeholder=t:this.setPlaceHolder(t),!0}return!1};e(s)||e(o)}))}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),e&&(this.value=e,eAe(this.value))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,eAe(this.value))}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()||this.history.last()}}var T2e=i(1644),M2e={};M2e.styleTagTransform=zl(),M2e.setAttributes=Bl(),M2e.insert=Pl().bind(null,"head"),M2e.domAPI=Rl(),M2e.insertStyleElement=Vl(),Ml()(T2e.A,M2e),T2e.A&&T2e.A.locals&&T2e.A.locals;const A2e=ove(0,"input");class R2e extends QFe{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=new Rwe,this.additionalToggles=[],this._onDidOptionChange=this._register(new $we),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new $we),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new $we),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new $we),this._onKeyUp=this._register(new $we),this._onCaseSensitiveKeyDown=this._register(new $we),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new $we),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||A2e,this.showCommonFindToggles=!!i.showCommonFindToggles;const n=i.appendCaseSensitiveLabel||"",o=i.appendWholeWordsLabel||"",s=i.appendRegexLabel||"",r=i.history||[],a=!!i.flexibleHeight,l=!!i.flexibleWidth,d=i.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new I2e(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:r,showHistoryHint:i.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:d,inputBoxStyles:i.inputBoxStyles})),this.showCommonFindToggles){this.regex=this._register(new S2e(Object.assign({appendTitle:s,isChecked:!1},i.toggleStyles))),this._register(this.regex.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this._register(this.regex.onKeyDown((e=>{this._onRegexKeyDown.fire(e)}))),this.wholeWords=this._register(new y2e(Object.assign({appendTitle:o,isChecked:!1},i.toggleStyles))),this._register(this.wholeWords.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this.caseSensitive=this._register(new C2e(Object.assign({appendTitle:n,isChecked:!1},i.toggleStyles))),this._register(this.caseSensitive.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this._register(this.caseSensitive.onKeyDown((e=>{this._onCaseSensitiveKeyDown.fire(e)})));const e=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,(t=>{if(t.equals(15)||t.equals(17)||t.equals(9)){const i=e.indexOf(document.activeElement);if(i>=0){let n=-1;t.equals(17)?n=(i+1)%e.length:t.equals(15)&&(n=0===i?e.length-1:i-1),t.equals(9)?(e[i].blur(),this.inputBox.focus()):n>=0&&e[n].focus(),DMe(t,!0)}}}))}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"block":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(null==i?void 0:i.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),null==e||e.appendChild(this.domNode),this._register(tMe(this.inputBox.inputElement,"compositionstart",(e=>{this.imeSessionInProgress=!0}))),this._register(tMe(this.inputBox.inputElement,"compositionend",(e=>{this.imeSessionInProgress=!1,this._onInput.fire()}))),this.onkeydown(this.inputBox.inputElement,(e=>this._onKeyDown.fire(e))),this.onkeyup(this.inputBox.inputElement,(e=>this._onKeyUp.fire(e))),this.oninput(this.inputBox.inputElement,(e=>this._onInput.fire())),this.onmousedown(this.inputBox.inputElement,(e=>this._onMouseDown.fire(e)))}get onDidChange(){return this.inputBox.onDidChange}enable(){var e,t,i;this.domNode.classList.remove("disabled"),this.inputBox.enable(),null===(e=this.regex)||void 0===e||e.enable(),null===(t=this.wholeWords)||void 0===t||t.enable(),null===(i=this.caseSensitive)||void 0===i||i.enable();for(const e of this.additionalToggles)e.enable()}disable(){var e,t,i;this.domNode.classList.add("disabled"),this.inputBox.disable(),null===(e=this.regex)||void 0===e||e.disable(),null===(t=this.wholeWords)||void 0===t||t.disable(),null===(i=this.caseSensitive)||void 0===i||i.disable();for(const e of this.additionalToggles)e.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){var t,i,n,o,s,r;for(const e of this.additionalToggles)e.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.dispose(),this.additionalTogglesDisposables=new Rwe;for(const t of null!=e?e:[])this.additionalTogglesDisposables.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.add(t.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()}))),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display="block"),this.inputBox.paddingRight=(null!==(i=null===(t=this.caseSensitive)||void 0===t?void 0:t.width())&&void 0!==i?i:0)+(null!==(o=null===(n=this.wholeWords)||void 0===n?void 0:n.width())&&void 0!==o?o:0)+(null!==(r=null===(s=this.regex)||void 0===s?void 0:s.width())&&void 0!==r?r:0)+this.additionalToggles.reduce(((e,t)=>e+t.width()),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e,t;return null!==(t=null===(e=this.caseSensitive)||void 0===e?void 0:e.checked)&&void 0!==t&&t}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e,t;return null!==(t=null===(e=this.wholeWords)||void 0===e?void 0:e.checked)&&void 0!==t&&t}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e,t;return null!==(t=null===(e=this.regex)||void 0===e?void 0:e.checked)&&void 0!==t&&t}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;null===(e=this.caseSensitive)||void 0===e||e.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}}const O2e=OMe;class P2e extends Owe{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=e=>tMe(this.findInput.inputBox.inputElement,LMe.KEY_DOWN,(t=>{e(new KIe(t))})),this.onMouseDown=e=>tMe(this.findInput.inputBox.inputElement,LMe.MOUSE_DOWN,(t=>{e(new ZIe(t))})),this.onDidChange=e=>this.findInput.onDidChange(e),this.container=IMe(this.parent,O2e(".quick-input-box")),this.findInput=this._register(new R2e(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}))}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get ariaLabel(){return this.findInput.inputBox.getAriaLabel()}set ariaLabel(e){this.findInput.inputBox.setAriaLabel(e)}get password(){return"password"===this.findInput.inputBox.inputElement.type}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.findInput.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===S$e.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===S$e.Info?1:e===S$e.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===S$e.Info?1:e===S$e.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}var F2e=i(8048),B2e={};B2e.styleTagTransform=zl(),B2e.setAttributes=Bl(),B2e.insert=Pl().bind(null,"head"),B2e.domAPI=Rl(),B2e.insertStyleElement=Vl(),Ml()(F2e.A,B2e),F2e.A&&F2e.A.locals&&F2e.A.locals;class W2e{constructor(e,t){var i;this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=null!==(i=null==t?void 0:t.supportIcons)&&void 0!==i&&i,this.domNode=IMe(e,OMe("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",n){e||(e=""),n&&(e=W2e.escapeNewLines(e,t)),this.didEverRender&&this.text===e&&this.title===i&&Rbe(this.highlights,t)||(this.text=e,this.title=i,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const i of this.highlights){if(i.end===i.start)continue;if(t<i.start){const n=this.text.substring(t,i.start);this.supportIcons?e.push(...TZe(n)):e.push(n),t=i.start}const n=this.text.substring(t,i.end),o=OMe("span.highlight",void 0,...this.supportIcons?TZe(n):[n]);i.extraClasses&&o.classList.add(...i.extraClasses),e.push(o),t=i.end}if(t<this.text.length){const i=this.text.substring(t);this.supportIcons?e.push(...TZe(i)):e.push(i)}TMe(this.domNode,...e),this.title?this.domNode.title=this.title:this.domNode.removeAttribute("title"),this.didEverRender=!0}static escapeNewLines(e,t){let i=0,n=0;return e.replace(/\r\n|\r|\n/g,((e,o)=>{n="\r\n"===e?-1:0,o+=i;for(const e of t)e.end<=o||(e.start>=o&&(e.start+=n),e.end>=o&&(e.end+=n));return i+=n,"⏎"}))}}class V2e{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class H2e extends Owe{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new V2e(IMe(e,OMe(".monaco-icon-label")))),this.labelContainer=IMe(this.domNode.element,OMe(".monaco-icon-label-container"));const i=IMe(this.labelContainer,OMe("span.monaco-icon-name-container"));(null==t?void 0:t.supportHighlights)||(null==t?void 0:t.supportIcons)?this.nameNode=new U2e(i,!!t.supportIcons):this.nameNode=new z2e(i),this.hoverDelegate=null==t?void 0:t.hoverDelegate}get element(){return this.domNode.element}setLabel(e,t,i){const n=["monaco-icon-label"],o=["monaco-icon-label-container"];if(i&&(i.extraClasses&&n.push(...i.extraClasses),i.italic&&n.push("italic"),i.strikethrough&&n.push("strikethrough"),i.disabledCommand&&o.push("disabled")),this.domNode.className=n.join(" "),this.labelContainer.className=o.join(" "),this.setupHover((null==i?void 0:i.descriptionTitle)?this.labelContainer:this.element,null==i?void 0:i.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const e=this.getOrCreateDescriptionNode();e instanceof W2e?(e.set(t||"",i?i.descriptionMatches:void 0,void 0,null==i?void 0:i.labelEscapeNewLines),this.setupHover(e.element,null==i?void 0:i.descriptionTitle)):(e.textContent=t&&(null==i?void 0:i.labelEscapeNewLines)?W2e.escapeNewLines(t,[]):t||"",this.setupHover(e.element,(null==i?void 0:i.descriptionTitle)||""),e.empty=!t)}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),t)if(this.hoverDelegate){const i=xZe(this.hoverDelegate,e,t);i&&this.customHovers.set(e,i)}else!function(e,t){fbe(t)?e.title=mZe(t):(null==t?void 0:t.markdownNotSupportedFallback)?e.title=t.markdownNotSupportedFallback:e.removeAttribute("title")}(e,t);else e.removeAttribute("title")}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new V2e(IMe(this.labelContainer,OMe("span.monaco-icon-description-container"))));(null===(e=this.creationOptions)||void 0===e?void 0:e.supportDescriptionHighlights)?this.descriptionNode=new W2e(IMe(t.element,OMe("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new V2e(IMe(t.element,OMe("span.label-description"))))}return this.descriptionNode}}class z2e{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!Rbe(this.options,t))if(this.label=e,this.options=t,"string"==typeof e)this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=IMe(this.container,OMe("a.label-name",{id:null==t?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i<e.length;i++){const n=e[i],o=(null==t?void 0:t.domId)&&`${null==t?void 0:t.domId}_${i}`;IMe(this.container,OMe("a.label-name",{id:o,"data-icon-label-count":e.length,"data-icon-label-index":i,role:"treeitem"},n)),i<e.length-1&&IMe(this.container,OMe("span.label-separator",void 0,(null==t?void 0:t.separator)||"/"))}}}}class U2e{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!Rbe(this.options,t))if(this.label=e,this.options=t,"string"==typeof e)this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=new W2e(IMe(this.container,OMe("a.label-name",{id:null==t?void 0:t.domId})),{supportIcons:this.supportIcons})),this.singleLabel.set(e,null==t?void 0:t.matches,void 0,null==t?void 0:t.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const i=(null==t?void 0:t.separator)||"/",n=function(e,t,i){if(!i)return;let n=0;return e.map((e=>{const o={start:n,end:n+e.length},s=i.map((e=>$Ze.intersect(o,e))).filter((e=>!$Ze.isEmpty(e))).map((({start:e,end:t})=>({start:e-n,end:t-n})));return n=o.end+t.length,s}))}(e,i,null==t?void 0:t.matches);for(let o=0;o<e.length;o++){const s=e[o],r=n?n[o]:void 0,a=OMe("a.label-name",{id:(null==t?void 0:t.domId)&&`${null==t?void 0:t.domId}_${o}`,"data-icon-label-count":e.length,"data-icon-label-index":o,role:"treeitem"});new W2e(IMe(this.container,a),{supportIcons:this.supportIcons}).set(s,r,void 0,null==t?void 0:t.labelEscapeNewLines),o<e.length-1&&IMe(a,OMe("span.label-separator",void 0,i))}}}}var K2e=i(1968),j2e={};j2e.styleTagTransform=zl(),j2e.setAttributes=Bl(),j2e.insert=Pl().bind(null,"head"),j2e.domAPI=Rl(),j2e.insertStyleElement=Vl(),Ml()(K2e.A,j2e),K2e.A&&K2e.A.locals&&K2e.A.locals;const q2e=OMe;class $2e{constructor(e,t,i){this.os=t,this.keyElements=new Set,this.options=i||Object.create(null),this.labelBackground=this.options.keybindingLabelBackground,this.labelBorder=this.options.keybindingLabelBorder,this.labelBottomBorder=this.options.keybindingLabelBottomBorder,this.labelShadow=this.options.keybindingLabelShadow;const n=this.options.keybindingLabelForeground;this.domNode=IMe(e,q2e(".monaco-keybinding")),n&&(this.domNode.style.color=n),this.didEverRender=!1,e.appendChild(this.domNode)}get element(){return this.domNode}set(e,t){this.didEverRender&&this.keybinding===e&&$2e.areSame(this.matches,t)||(this.keybinding=e,this.matches=t,this.render())}render(){var e;if(this.clear(),this.keybinding){const[t,i]=this.keybinding.getChords();t&&this.renderChord(this.domNode,t,this.matches?this.matches.firstPart:null),i&&(IMe(this.domNode,q2e("span.monaco-keybinding-key-chord-separator",void 0," ")),this.renderChord(this.domNode,i,this.matches?this.matches.chordPart:null));const n=null!==(e=this.options.disableTitle)&&void 0!==e&&e?void 0:this.keybinding.getAriaLabel()||void 0;void 0!==n?this.domNode.title=n:this.domNode.removeAttribute("title")}else this.options&&this.options.renderUnboundKeybindings&&this.renderUnbound(this.domNode);this.didEverRender=!0}clear(){XTe(this.domNode),this.keyElements.clear()}renderChord(e,t,i){const n=XXe.modifierLabels[this.os];t.ctrlKey&&this.renderKey(e,n.ctrlKey,Boolean(null==i?void 0:i.ctrlKey),n.separator),t.shiftKey&&this.renderKey(e,n.shiftKey,Boolean(null==i?void 0:i.shiftKey),n.separator),t.altKey&&this.renderKey(e,n.altKey,Boolean(null==i?void 0:i.altKey),n.separator),t.metaKey&&this.renderKey(e,n.metaKey,Boolean(null==i?void 0:i.metaKey),n.separator);const o=t.keyLabel;o&&this.renderKey(e,o,Boolean(null==i?void 0:i.keyCode),"")}renderKey(e,t,i,n){IMe(e,this.createKeyElement(t,i?".highlight":"")),n&&IMe(e,q2e("span.monaco-keybinding-key-separator",void 0,n))}renderUnbound(e){IMe(e,this.createKeyElement(ove(0,"Unbound")))}createKeyElement(e,t=""){const i=q2e("span.monaco-keybinding-key"+t,void 0,e);return this.keyElements.add(i),this.labelBackground&&(i.style.backgroundColor=this.labelBackground),this.labelBorder&&(i.style.borderColor=this.labelBorder),this.labelBottomBorder&&(i.style.borderBottomColor=this.labelBottomBorder),this.labelShadow&&(i.style.boxShadow=`inset 0 -1px 0 ${this.labelShadow}`),i}static areSame(e,t){return e===t||!e&&!t||!!e&&!!t&&Rbe(e.firstPart,t.firstPart)&&Rbe(e.chordPart,t.chordPart)}}const G2e=new bSe((()=>{const e=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:e,collatorIsNumeric:e.resolvedOptions().numeric}}));new bSe((()=>({collator:new Intl.Collator(void 0,{numeric:!0})}))),new bSe((()=>({collator:new Intl.Collator(void 0,{numeric:!0,sensitivity:"accent"})})));var Z2e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};const Y2e=OMe;class Q2e{get checked(){return!!this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire(e))}constructor(e){this.hidden=!1,this._onChecked=new $we,this.onChecked=this._onChecked.event,Object.assign(this,e)}dispose(){this._onChecked.dispose()}}class X2e{get templateId(){return X2e.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=IMe(e,Y2e(".quick-input-list-entry"));const i=IMe(t.entry,Y2e("label.quick-input-list-label"));t.toDisposeTemplate.push(iMe(i,LMe.CLICK,(e=>{t.checkbox.offsetParent||e.preventDefault()}))),t.checkbox=IMe(i,Y2e("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(iMe(t.checkbox,LMe.CHANGE,(e=>{t.element.checked=t.checkbox.checked})));const n=IMe(i,Y2e(".quick-input-list-rows")),o=IMe(n,Y2e(".quick-input-list-row")),s=IMe(n,Y2e(".quick-input-list-row"));t.label=new H2e(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0});const r=IMe(o,Y2e(".quick-input-list-entry-keybinding"));t.keybinding=new $2e(r,Fve);const a=IMe(s,Y2e(".quick-input-list-label-meta"));return t.detail=new H2e(a,{supportHighlights:!0,supportIcons:!0}),t.separator=IMe(t.entry,Y2e(".quick-input-list-separator")),t.actionBar=new eQe(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,i){i.element=e;const n=e.item?e.item:e.separator;i.checkbox.checked=e.checked,i.toDisposeElement.push(e.onChecked((e=>i.checkbox.checked=e)));const{labelHighlights:o,descriptionHighlights:s,detailHighlights:r}=e,a=Object.create(null);a.matches=o||[],a.descriptionTitle=e.saneDescription,a.descriptionMatches=s||[],"separator"!==n.type?(a.extraClasses=n.iconClasses,a.italic=n.italic,a.strikethrough=n.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item")):i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(e.saneLabel,e.saneDescription,a),i.keybinding.set("separator"===n.type?void 0:n.keybinding),e.saneDetail&&i.detail.setLabel(e.saneDetail,void 0,{matches:r,title:e.saneDetail}),e.item&&e.separator&&e.separator.label?(i.separator.textContent=e.separator.label,i.separator.style.display=""):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!e.separator);const l=n.buttons;l&&l.length?(i.actionBar.push(l.map(((t,i)=>{let o=t.iconClass||(t.iconPath?p2e(t.iconPath):void 0);return t.alwaysVisible&&(o=o?`${o} always-visible`:"always-visible"),{id:`id-${i}`,class:o,enabled:!0,label:"",tooltip:t.tooltip||"",run:()=>{"separator"!==n.type?e.fireButtonTriggered({button:t,item:n}):e.fireSeparatorButtonTriggered({button:t,separator:n})}}})),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){i.toDisposeElement=Twe(i.toDisposeElement),i.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=Twe(e.toDisposeElement),e.toDisposeTemplate=Twe(e.toDisposeTemplate)}}X2e.ID="listelement";class J2e{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return X2e.ID}}var e4e;!function(e){e[e.First=1]="First",e[e.Second=2]="Second",e[e.Last=3]="Last",e[e.Next=4]="Next",e[e.Previous=5]="Previous",e[e.NextPage=6]="NextPage",e[e.PreviousPage=7]="PreviousPage"}(e4e||(e4e={}));class t4e{constructor(e,t,i){this.parent=e,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnLabelMode="fuzzy",this.matchOnMeta=!0,this.sortByLabel=!0,this._onChangedAllVisibleChecked=new $we,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new $we,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new $we,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new $we,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new $we,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new $we,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new $we,this.onKeyDown=this._onKeyDown.event,this._onLeave=new $we,this.onLeave=this._onLeave.event,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=IMe(this.parent,Y2e(".quick-input-list"));const n=new J2e,o=new n4e;this.list=i.createList("QuickInput",this.container,n,[new X2e],{identityProvider:{getId:e=>e.saneLabel},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:o}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown((e=>{const t=new KIe(e);switch(t.keyCode){case 10:this.toggleCheckbox();break;case 31:(Dve?e.metaKey:e.ctrlKey)&&this.list.setFocus(sbe(this.list.length));break;case 16:{const e=this.list.getFocus();1===e.length&&0===e[0]&&this._onLeave.fire();break}case 18:{const e=this.list.getFocus();1===e.length&&e[0]===this.list.length-1&&this._onLeave.fire();break}}this._onKeyDown.fire(t)}))),this.disposables.push(this.list.onMouseDown((e=>{2!==e.browserEvent.button&&e.browserEvent.preventDefault()}))),this.disposables.push(tMe(this.container,LMe.CLICK,(e=>{(e.x||e.y)&&this._onLeave.fire()}))),this.disposables.push(this.list.onMouseMiddleClick((e=>{this._onLeave.fire()}))),this.disposables.push(this.list.onContextMenu((e=>{"number"==typeof e.index&&(e.browserEvent.preventDefault(),this.list.setSelection([e.index]))}))),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onSeparatorButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return zwe.map(this.list.onDidChangeFocus,(e=>e.elements.map((e=>e.item))))}get onDidChangeSelection(){return zwe.map(this.list.onDidChangeSelection,(e=>({items:e.elements.map((e=>e.item)),event:e.browserEvent})))}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let i=0,n=e.length;i<n;i++){const n=e[i];if(!n.hidden){if(!n.checked)return!1;t=!0}}return t}getCheckedCount(){let e=0;const t=this.elements;for(let i=0,n=t.length;i<n;i++)t[i].checked&&e++;return e}getVisibleCount(){let e=0;const t=this.elements;for(let i=0,n=t.length;i<n;i++)t[i].hidden||e++;return e}setAllVisibleChecked(e){try{this._fireCheckedEvents=!1,this.elements.forEach((t=>{t.hidden||(t.checked=e)}))}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=Twe(this.elementDisposables);const t=e=>this.fireButtonTriggered(e),i=e=>this.fireSeparatorButtonTriggered(e);this.inputElements=e,this.elements=e.reduce(((n,o,s)=>{var r,a,l;const d=s&&e[s-1],h=o.label?o.label.replace(/\r?\n/g," "):"",c=_Ze(h).text.trim();let u,g,p,m,f,_;"separator"!==o.type&&(u=o.meta&&o.meta.replace(/\r?\n/g," "),g=o.description&&o.description.replace(/\r?\n/g," "),p=o.detail&&o.detail.replace(/\r?\n/g," "),m=null===(r=o.highlights)||void 0===r?void 0:r.label,f=null===(a=o.highlights)||void 0===a?void 0:a.description,_=null===(l=o.highlights)||void 0===l?void 0:l.detail);const v=o.ariaLabel||[h,g,p].map((e=>{return(t=e)?t.replace(/\$\((.*?)\)/g,((e,t)=>` ${t} `)).trim():"";var t})).filter((e=>!!e)).join(", "),b=this.parent.classList.contains("show-checkboxes");let w;if("separator"===o.type){if(!o.buttons)return n;w=o}else d&&"separator"===d.type&&!d.buttons&&(w=d);const C=new Q2e({hasCheckbox:b,index:s,item:"separator"!==o.type?o:void 0,saneLabel:h,saneSortLabel:c,saneMeta:u,saneAriaLabel:v,saneDescription:g,saneDetail:p,labelHighlights:m,descriptionHighlights:f,detailHighlights:_,checked:!1,separator:w,fireButtonTriggered:t,fireSeparatorButtonTriggered:i});return this.elementDisposables.push(C),this.elementDisposables.push(C.onChecked((()=>this.fireCheckedEvents()))),n.push(C),n}),[]),this.elementsToIndexes=this.elements.reduce(((e,t,i)=>{var n;return e.set(null!==(n=t.item)&&void 0!==n?n:t.separator,i),e}),new Map),this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map((e=>e.item))}setFocusedElements(e){if(this.list.setFocus(e.filter((e=>this.elementsToIndexes.has(e))).map((e=>this.elementsToIndexes.get(e)))),e.length>0){const e=this.list.getFocus()[0];"number"==typeof e&&this.list.reveal(e)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter((e=>this.elementsToIndexes.has(e))).map((e=>this.elementsToIndexes.get(e))))}getCheckedElements(){return this.elements.filter((e=>e.checked)).map((e=>e.item)).filter((e=>!!e))}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const i of e)t.add(i);for(const e of this.elements)e.checked=t.has(e.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===e4e.Second&&this.list.length<2&&(e=e4e.First),e){case e4e.First:this.list.scrollTop=0,this.list.focusFirst(void 0,(e=>!!e.item));break;case e4e.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,(e=>!!e.item));break;case e4e.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,(e=>!!e.item));break;case e4e.Next:{this.list.focusNext(void 0,!0,void 0,(e=>!!e.item));const e=this.list.getFocus()[0];0!==e&&!this.elements[e-1].item&&this.list.firstVisibleIndex>e-1&&this.list.reveal(e-1);break}case e4e.Previous:{this.list.focusPrevious(void 0,!0,void 0,(e=>!!e.item));const e=this.list.getFocus()[0];0!==e&&!this.elements[e-1].item&&this.list.firstVisibleIndex>e-1&&this.list.reveal(e-1);break}case e4e.NextPage:this.list.focusNextPage(void 0,(e=>!!e.item));break;case e4e.PreviousPage:this.list.focusPreviousPage(void 0,(e=>!!e.item))}const t=this.list.getFocus()[0];"number"==typeof t&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}layout(e){this.list.getHTMLElement().style.maxHeight=e?`calc(${44*Math.floor(e/44)}px)`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;const t=e;if((e=e.trim())&&(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail)){let i;this.elements.forEach((n=>{let o;o="fuzzy"===this.matchOnLabelMode?this.matchOnLabel?Ebe(vZe(e,_Ze(n.saneLabel))):void 0:this.matchOnLabel?Ebe(function(e,t){const{text:i,iconOffsets:n}=t;if(!n||0===n.length)return i4e(e,i);const o=xSe(i," "),s=i.length-o.length,r=i4e(e,o);if(r)for(const e of r){const t=n[e.start+s]+s;e.start+=t,e.end+=t}return r}(t,_Ze(n.saneLabel))):void 0;const s=this.matchOnDescription?Ebe(vZe(e,_Ze(n.saneDescription||""))):void 0,r=this.matchOnDetail?Ebe(vZe(e,_Ze(n.saneDetail||""))):void 0,a=this.matchOnMeta?Ebe(vZe(e,_Ze(n.saneMeta||""))):void 0;if(o||s||r||a?(n.labelHighlights=o,n.descriptionHighlights=s,n.detailHighlights=r,n.hidden=!1):(n.labelHighlights=void 0,n.descriptionHighlights=void 0,n.detailHighlights=void 0,n.hidden=!n.item||!n.item.alwaysShow),!this.sortByLabel){const e=n.index&&this.inputElements[n.index-1];i=e&&"separator"===e.type?e:i,i&&!n.hidden&&(n.separator=i,i=void 0)}}))}else this.elements.forEach((e=>{e.labelHighlights=void 0,e.descriptionHighlights=void 0,e.detailHighlights=void 0,e.hidden=!1;const t=e.index&&this.inputElements[e.index-1];e.item&&(e.separator=t&&"separator"===t.type&&!t.buttons?t:void 0)}));const i=this.elements.filter((e=>!e.hidden));if(this.sortByLabel&&e){const t=e.toLowerCase();i.sort(((e,i)=>function(e,t,i){const n=e.labelHighlights||[],o=t.labelHighlights||[];return n.length&&!o.length?-1:!n.length&&o.length?1:0===n.length&&0===o.length?0:function(e,t,i){const n=e.toLowerCase(),o=t.toLowerCase(),s=function(e,t,i){const n=e.toLowerCase(),o=t.toLowerCase(),s=n.startsWith(i),r=o.startsWith(i);if(s!==r)return s?-1:1;if(s&&r){if(n.length<o.length)return-1;if(n.length>o.length)return 1}return 0}(e,t,i);if(s)return s;const r=n.endsWith(i);if(r!==o.endsWith(i))return r?-1:1;const a=function(e,t){const i=e||"",n=t||"",o=G2e.value.collator.compare(i,n);return G2e.value.collatorIsNumeric&&0===o&&i!==n?i<n?-1:1:o}(n,o);return 0!==a?a:n.localeCompare(o)}(e.saneSortLabel,t.saneSortLabel,i)}(e,i,t)))}return this.elementsToIndexes=i.reduce(((e,t,i)=>{var n;return e.set(null!==(n=t.item)&&void 0!==n?n:t.separator,i),e}),new Map),this.list.splice(0,this.list.length,i),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(i.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const i of e)i.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return"none"!==this.container.style.display}dispose(){this.elementDisposables=Twe(this.elementDisposables),this.disposables=Twe(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}fireSeparatorButtonTriggered(e){this._onSeparatorButtonTriggered.fire(e)}style(e){this.list.style(e)}}function i4e(e,t){const i=t.toLowerCase().indexOf(e.toLowerCase());return-1!==i?[{start:i,end:i+e.length}]:null}Z2e([iRe],t4e.prototype,"onDidChangeFocus",null),Z2e([iRe],t4e.prototype,"onDidChangeSelection",null);class n4e{getWidgetAriaLabel(){return ove(0,"Quick Input")}getAriaLabel(e){var t;return(null===(t=e.separator)||void 0===t?void 0:t.label)?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(e.hasCheckbox)return{value:e.checked,onDidChange:e.onChecked}}}var o4e=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const s4e=OMe,r4e={iconClass:sAe.asClassName(pye.quickInputBack),tooltip:ove(0,"Back"),handle:-1};class a4e extends Owe{constructor(e){super(),this.ui=e,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=a4e.noPromptMessage,this._severity=S$e.Ignore,this.onDidTriggerButtonEmitter=this._register(new $we),this.onDidHideEmitter=this._register(new $we),this.onDisposeEmitter=this._register(new $we),this.visibleDisposables=this._register(new Rwe),this.onDidHide=this.onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!Mve;this._ignoreFocusOut=e&&!Mve,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=null!=e?e:[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton((e=>{-1!==this.buttons.indexOf(e)&&this.onDidTriggerButtonEmitter.fire(e)}))),this.ui.show(this),this.visible=!0,this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=f2e.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){var e,t;if(!this.visible)return;const i=this.getTitle();i&&this.ui.title.textContent!==i?this.ui.title.textContent=i:i||" "===this.ui.title.innerHTML||(this.ui.title.innerText=" ");const n=this.getDescription();if(this.ui.description1.textContent!==n&&(this.ui.description1.textContent=n),this.ui.description2.textContent!==n&&(this.ui.description2.textContent=n),this.busy&&!this.busyDelay&&(this.busyDelay=new ODe,this.busyDelay.setIfNotSet((()=>{this.visible&&this.ui.progressBar.infinite()}),800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const e=this.buttons.filter((e=>e===r4e));this.ui.leftActionBar.push(e.map(((e,t)=>{const i=new aAe(`id-${t}`,"",e.iconClass||p2e(e.iconPath),!0,(()=>o4e(this,void 0,void 0,(function*(){this.onDidTriggerButtonEmitter.fire(e)}))));return i.tooltip=e.tooltip||"",i})),{icon:!0,label:!1}),this.ui.rightActionBar.clear();const t=this.buttons.filter((e=>e!==r4e));this.ui.rightActionBar.push(t.map(((e,t)=>{const i=new aAe(`id-${t}`,"",e.iconClass||p2e(e.iconPath),!0,(()=>o4e(this,void 0,void 0,(function*(){this.onDidTriggerButtonEmitter.fire(e)}))));return i.tooltip=e.tooltip||"",i})),{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const i=null!==(t=null===(e=this.toggles)||void 0===e?void 0:e.filter((e=>e instanceof d2e)))&&void 0!==t?t:[];this.ui.inputBox.toggles=i}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const o=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==o&&(this._lastValidationMessage=o,TMe(this.ui.message,...TZe(o))),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?ove(0,"{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==S$e.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}a4e.noPromptMessage=ove(0,"Press 'Enter' to confirm your input or 'Escape' to cancel");class l4e extends a4e{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new $we),this.onWillAcceptEmitter=this._register(new $we),this.onDidAcceptEmitter=this._register(new $we),this.onDidCustomEmitter=this._register(new $we),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._autoFocusOnList=!0,this._keepScrollPosition=!1,this._itemActivation=this.ui.isScreenReaderOptimized()?_2e.NONE:_2e.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new $we),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new $we),this.onDidTriggerItemButtonEmitter=this._register(new $we),this.onDidTriggerSeparatorButtonEmitter=this._register(new $we),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get autoFocusOnList(){return this._autoFocusOnList}set autoFocusOnList(e){this._autoFocusOnList=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?m2e:this.ui.keyMods}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.autoFocusOnList&&(this.canSelectMany||this.ui.list.focus(e4e.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange((e=>{this.doSetValue(e,!0)}))),this.visibleDisposables.add(this.ui.inputBox.onMouseDown((e=>{this.autoFocusOnList||this.ui.list.clearFocus()}))),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown((e=>{switch(e.keyCode){case 18:this.ui.list.focus(e4e.Next),this.canSelectMany&&this.ui.list.domFocus(),DMe(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(e4e.Previous):this.ui.list.focus(e4e.Last),this.canSelectMany&&this.ui.list.domFocus(),DMe(e,!0);break;case 12:this.ui.list.focus(e4e.NextPage),this.canSelectMany&&this.ui.list.domFocus(),DMe(e,!0);break;case 11:this.ui.list.focus(e4e.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),DMe(e,!0);break;case 17:if(!this._canAcceptInBackground)return;if(!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!0));break;case 14:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(e4e.First),DMe(e,!0));break;case 13:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(e4e.Last),DMe(e,!0))}}))),this.visibleDisposables.add(this.ui.onDidAccept((()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)}))),this.visibleDisposables.add(this.ui.onDidCustom((()=>{this.onDidCustomEmitter.fire()}))),this.visibleDisposables.add(this.ui.list.onDidChangeFocus((e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&tbe(e,this._activeItems,((e,t)=>e===t))||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))}))),this.visibleDisposables.add(this.ui.list.onDidChangeSelection((({items:e,event:t})=>{this.canSelectMany?e.length&&this.ui.list.setSelectedElements([]):this.selectedItemsToConfirm!==this._selectedItems&&tbe(e,this._selectedItems,((e,t)=>e===t))||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(t instanceof MouseEvent&&1===t.button))}))),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements((e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&tbe(e,this._selectedItems,((e,t)=>e===t))||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))}))),this.visibleDisposables.add(this.ui.list.onButtonTriggered((e=>this.onDidTriggerItemButtonEmitter.fire(e)))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered((e=>this.onDidTriggerSeparatorButtonEmitter.fire(e)))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return tMe(this.ui.container,LMe.KEY_UP,(e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new KIe(e),i=t.keyCode,n=this._quickNavigate.keybindings.some((e=>{const[n,o]=e.getChords();return!(o||(n.shiftKey&&4===i?t.ctrlKey||t.altKey||t.metaKey:!(n.altKey&&6===i||n.ctrlKey&&5===i||n.metaKey&&57===i)))}));n&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)}))}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.buttons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany,ok:"default"===this.ok?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(i),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let n=this.ariaLabel;if(n||(n=this.placeholder||l4e.DEFAULT_ARIA_LABEL,this.title&&(n+=` - ${this.title}`)),this.ui.inputBox.ariaLabel!==n&&(this.ui.inputBox.ariaLabel=n),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case _2e.NONE:this._itemActivation=_2e.FIRST;break;case _2e.SECOND:this.ui.list.focus(e4e.Second),this._itemActivation=_2e.FIRST;break;case _2e.LAST:this.ui.list.focus(e4e.Last),this._itemActivation=_2e.FIRST;break;default:this.trySelectFirst()}this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",this.ui.setComboboxAccessibility(!0),i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(e4e.First)),this.keepScrollPosition&&(this.scrollTop=e)}}l4e.DEFAULT_ARIA_LABEL=ove(0,"Type to narrow down results.");class d4e extends a4e{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new $we),this.onDidAcceptEmitter=this._register(new $we),this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange((e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))}))),this.visibleDisposables.add(this.ui.onDidAccept((()=>this.onDidAcceptEmitter.fire()))),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}}class h4e extends Owe{constructor(e){super(),this.options=e,this.comboboxAccessibility=!1,this.enabled=!0,this.onDidAcceptEmitter=this._register(new $we),this.onDidCustomEmitter=this._register(new $we),this.onDidTriggerButtonEmitter=this._register(new $we),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new $we),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new $we),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this.parentElement=e.container,this.styles=e.styles,this.registerKeyModsListeners()}registerKeyModsListeners(){const e=e=>{this.keyMods.ctrlCmd=e.ctrlKey||e.metaKey,this.keyMods.alt=e.altKey};this._register(tMe(window,LMe.KEY_DOWN,e,!0)),this._register(tMe(window,LMe.KEY_UP,e,!0)),this._register(tMe(window,LMe.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=IMe(this.parentElement,s4e(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=yMe(e),i=IMe(e,s4e(".quick-input-titlebar")),n=this._register(new eQe(i));n.domNode.classList.add("quick-input-left-action-bar");const o=IMe(i,s4e(".quick-input-title")),s=this._register(new eQe(i));s.domNode.classList.add("quick-input-right-action-bar");const r=IMe(e,s4e(".quick-input-description")),a=IMe(e,s4e(".quick-input-header")),l=IMe(a,s4e("input.quick-input-check-all"));l.type="checkbox",l.setAttribute("aria-label",ove(0,"Toggle all checkboxes")),this._register(iMe(l,LMe.CHANGE,(e=>{const t=l.checked;S.setAllVisibleChecked(t)}))),this._register(tMe(l,LMe.CLICK,(e=>{(e.x||e.y)&&u.setFocus()})));const d=IMe(a,s4e(".quick-input-description")),h=IMe(a,s4e(".quick-input-and-message")),c=IMe(h,s4e(".quick-input-filter")),u=this._register(new P2e(c,this.styles.inputBox,this.styles.toggle));u.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=IMe(c,s4e(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=new X1e(g,{countFormat:ove(0,"{0} Results")},this.styles.countBadge),m=IMe(c,s4e(".quick-input-count"));m.setAttribute("aria-live","polite");const f=new X1e(m,{countFormat:ove(0,"{0} Selected")},this.styles.countBadge),_=IMe(a,s4e(".quick-input-action")),v=new Z1e(_,this.styles.button);v.label=ove(0,"OK"),this._register(v.onDidClick((e=>{this.onDidAcceptEmitter.fire()})));const b=IMe(a,s4e(".quick-input-action")),w=new Z1e(b,this.styles.button);w.label=ove(0,"Custom"),this._register(w.onDidClick((e=>{this.onDidCustomEmitter.fire()})));const C=IMe(h,s4e(`#${this.idPrefix}message.quick-input-message`)),y=new r2e(e,this.styles.progressBar);y.getContainer().classList.add("quick-input-progress");const S=this._register(new t4e(e,this.idPrefix+"list",this.options));this._register(S.onChangedAllVisibleChecked((e=>{l.checked=e}))),this._register(S.onChangedVisibleCount((e=>{p.setCount(e)}))),this._register(S.onChangedCheckedCount((e=>{f.setCount(e)}))),this._register(S.onLeave((()=>{setTimeout((()=>{u.setFocus(),this.controller instanceof l4e&&this.controller.canSelectMany&&S.clearFocus()}),0)}))),this._register(S.onDidChangeFocus((()=>{this.comboboxAccessibility&&this.getUI().inputBox.setAttribute("aria-activedescendant",this.getUI().list.getActiveDescendant()||"")})));const x=NMe(e);return this._register(x),this._register(tMe(e,LMe.FOCUS,(e=>{this.previousFocusElement=e.relatedTarget instanceof HTMLElement?e.relatedTarget:void 0}),!0)),this._register(x.onDidBlur((()=>{this.getUI().ignoreFocusOut||this.options.ignoreFocusOut()||this.hide(f2e.Blur),this.previousFocusElement=void 0}))),this._register(tMe(e,LMe.FOCUS,(e=>{u.setFocus()}))),this._register(tMe(e,LMe.KEY_DOWN,(t=>{const i=new KIe(t);switch(i.keyCode){case 3:DMe(t,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:DMe(t,!0),this.hide(f2e.Gesture);break;case 2:if(!i.altKey&&!i.ctrlKey&&!i.metaKey){const n=[".action-label.codicon"];e.classList.contains("show-checkboxes")?n.push("input"):n.push("input[type=text]"),this.getUI().list.isDisplayed()&&n.push(".monaco-list");const o=e.querySelectorAll(n.join(", "));i.shiftKey&&i.target===o[0]?(DMe(t,!0),o[o.length-1].focus()):i.shiftKey||i.target!==o[o.length-1]||(DMe(t,!0),o[0].focus())}}}))),this.ui={container:e,styleSheet:t,leftActionBar:n,titleBar:i,title:o,description1:r,description2:d,rightActionBar:s,checkAll:l,filterContainer:c,inputBox:u,visibleCountContainer:g,visibleCount:p,countContainer:m,count:f,okContainer:_,ok:v,message:C,customButtonContainer:b,customButton:w,list:S,progressBar:y,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,isScreenReaderOptimized:()=>this.options.isScreenReaderOptimized(),show:e=>this.show(e),hide:()=>this.hide(),setVisibilities:e=>this.setVisibilities(e),setComboboxAccessibility:e=>this.setComboboxAccessibility(e),setEnabled:e=>this.setEnabled(e),setContextKey:e=>this.options.setContextKey(e)},this.updateStyles(),this.ui}pick(e,t={},i=nCe.None){return new Promise(((n,o)=>{let s=e=>{var i;s=n,null===(i=t.onKeyMods)||void 0===i||i.call(t,r.keyMods),n(e)};if(i.isCancellationRequested)return void s(void 0);const r=this.createQuickPick();let a;const l=[r,r.onDidAccept((()=>{if(r.canSelectMany)s(r.selectedItems.slice()),r.hide();else{const e=r.activeItems[0];e&&(s(e),r.hide())}})),r.onDidChangeActive((e=>{const i=e[0];i&&t.onDidFocus&&t.onDidFocus(i)})),r.onDidChangeSelection((e=>{if(!r.canSelectMany){const t=e[0];t&&(s(t),r.hide())}})),r.onDidTriggerItemButton((e=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton(Object.assign(Object.assign({},e),{removeItem:()=>{const t=r.items.indexOf(e.item);if(-1!==t){const e=r.items.slice(),i=e.splice(t,1),n=r.activeItems.filter((e=>e!==i[0])),o=r.keepScrollPosition;r.keepScrollPosition=!0,r.items=e,n&&(r.activeItems=n),r.keepScrollPosition=o}}})))),r.onDidTriggerSeparatorButton((e=>{var i;return null===(i=t.onDidTriggerSeparatorButton)||void 0===i?void 0:i.call(t,e)})),r.onDidChangeValue((e=>{!a||e||1===r.activeItems.length&&r.activeItems[0]===a||(r.activeItems=[a])})),i.onCancellationRequested((()=>{r.hide()})),r.onDidHide((()=>{Twe(l),s(void 0)}))];r.title=t.title,r.canSelectMany=!!t.canPickMany,r.placeholder=t.placeHolder,r.ignoreFocusOut=!!t.ignoreFocusLost,r.matchOnDescription=!!t.matchOnDescription,r.matchOnDetail=!!t.matchOnDetail,r.matchOnLabel=void 0===t.matchOnLabel||t.matchOnLabel,r.autoFocusOnList=void 0===t.autoFocusOnList||t.autoFocusOnList,r.quickNavigate=t.quickNavigate,r.hideInput=!!t.hideInput,r.contextKey=t.contextKey,r.busy=!0,Promise.all([e,t.activeItem]).then((([e,t])=>{a=t,r.busy=!1,r.items=e,r.canSelectMany&&(r.selectedItems=e.filter((e=>"separator"!==e.type&&e.picked))),a&&(r.activeItems=[a])})),r.show(),Promise.resolve(e).then(void 0,(e=>{o(e),r.hide()}))}))}createQuickPick(){const e=this.getUI();return new l4e(e)}createInputBox(){const e=this.getUI();return new d4e(e)}show(e){const t=this.getUI();this.onShowEmitter.fire();const i=this.controller;this.controller=e,null==i||i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(S$e.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),TMe(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,this.setComboboxAccessibility(!1),t.inputBox.ariaLabel="",t.inputBox.toggles=void 0;const n=this.options.backKeybindingLabel();r4e.tooltip=n?ove(0,"Back ({0})",n):ove(0,"Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=!e.description||e.inputBox||e.checkAll?"none":"",t.checkAll.style.display=e.checkAll?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setComboboxAccessibility(e){if(e!==this.comboboxAccessibility){const t=this.getUI();this.comboboxAccessibility=e,this.comboboxAccessibility?(t.inputBox.setAttribute("role","combobox"),t.inputBox.setAttribute("aria-haspopup","true"),t.inputBox.setAttribute("aria-autocomplete","list"),t.inputBox.setAttribute("aria-activedescendant",t.list.getActiveDescendant()||"")):(t.inputBox.removeAttribute("role"),t.inputBox.removeAttribute("aria-haspopup"),t.inputBox.removeAttribute("aria-autocomplete"),t.inputBox.removeAttribute("aria-activedescendant"))}}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t;const i=this.controller;if(i){const n=!(null===(t=this.ui)||void 0===t?void 0:t.container.contains(document.activeElement));if(this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",!n){let e=this.previousFocusElement;for(;e&&!e.offsetParent;)e=Ebe(e.parentElement);(null==e?void 0:e.offsetParent)?(e.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}i.didHide(e)}}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isDisplayed()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(.62*this.dimension.width,h4e.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&.4*this.dimension.height)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:n,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=null!=e?e:"",this.ui.container.style.backgroundColor=null!=t?t:"",this.ui.container.style.color=null!=i?i:"",this.ui.container.style.border=n?`1px solid ${n}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.list.style(this.styles.list);const s=[];this.styles.pickerGroup.pickerGroupBorder&&s.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(`.quick-input-list .quick-input-list-separator-as-item { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(s.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&s.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&s.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&s.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&s.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&s.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),s.push("}"));const r=s.join("\n");r!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=r)}}isDisplayed(){return this.ui&&"none"!==this.ui.container.style.display}}h4e.MAX_WIDTH=600;class c4e{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:Owe.None}}renderElement(e,t,i,n){var o;if(null===(o=i.disposable)||void 0===o||o.dispose(),!i.data)return;const s=this.modelProvider();if(s.isResolved(e))return this.renderer.renderElement(s.get(e),e,i.data,n);const r=new sCe,a=s.resolve(e,r.token);i.disposable={dispose:()=>r.cancel()},this.renderer.renderPlaceholder(e,i.data),a.then((t=>this.renderer.renderElement(t,e,i.data,n)))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class u4e{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}class g4e{constructor(e,t,i,n,o={}){const s=()=>this.model,r=n.map((e=>new c4e(e,s)));this.list=new PYe(e,t,i,r,function(e,t){return Object.assign(Object.assign({},t),{accessibilityProvider:t.accessibilityProvider&&new u4e(e,t.accessibilityProvider)})}(s,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return zwe.map(this.list.onMouseDblClick,(({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:i})))}get onPointer(){return zwe.map(this.list.onPointer,(({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:i})))}get onDidChangeSelection(){return zwe.map(this.list.onDidChangeSelection,(({elements:e,indexes:t,browserEvent:i})=>({elements:e.map((e=>this._model.get(e))),indexes:t,browserEvent:i})))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,sbe(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map((e=>this.model.get(e)))}style(e){this.list.style(e)}dispose(){this.list.dispose()}}var p4e=i(2460),m4e={};m4e.styleTagTransform=zl(),m4e.setAttributes=Bl(),m4e.insert=Pl().bind(null,"head"),m4e.domAPI=Rl(),m4e.insertStyleElement=Vl(),Ml()(p4e.A,m4e),p4e.A&&p4e.A.locals&&p4e.A.locals;const f4e={separatorBorder:hRe.transparent};class _4e{set size(e){this._size=e}get size(){return this._size}get visible(){return void 0===this._cachedVisibleSize}setVisible(e,t){var i,n;e!==this.visible&&(e?(this.size=KZe(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize="number"==typeof t?t:this.size,this.size=0),this.container.classList.toggle("visible",e),null===(n=(i=this.view).setVisible)||void 0===n||n.call(i,e))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){var e;return null===(e=this.view.proportionalLayout)||void 0===e||e}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,n){this.container=e,this.view=t,this.disposable=n,this._cachedVisibleSize=void 0,"number"==typeof i?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e),this.view.layout(this.size,e,t)}dispose(){return this.disposable.dispose(),this.view}}class v4e extends _4e{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class b4e extends _4e{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var w4e,C4e;!function(e){e[e.Idle=0]="Idle",e[e.Busy=1]="Busy"}(w4e||(w4e={})),function(e){e.Distribute={type:"distribute"},e.Split=function(e){return{type:"split",index:e}},e.Invisible=function(e){return{type:"invisible",cachedVisibleSize:e}}}(C4e||(C4e={}));class y4e extends Owe{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){var i,n,o,s,r;super(),this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=w4e.Idle,this._onDidSashChange=this._register(new $we),this._onDidSashReset=this._register(new $we),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=null!==(i=t.orientation)&&void 0!==i?i:0,this.inverseAltBehavior=null!==(n=t.inverseAltBehavior)&&void 0!==n&&n,this.proportionalLayout=null===(o=t.proportionalLayout)||void 0===o||o,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(0===this.orientation?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=IMe(this.el,OMe(".sash-container")),this.viewContainer=OMe(".split-view-container"),this.scrollable=new sBe({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:oMe}),this.scrollableElement=this._register(new _Be(this.viewContainer,{vertical:0===this.orientation?null!==(s=t.scrollbarVisibility)&&void 0!==s?s:1:2,horizontal:1===this.orientation?null!==(r=t.scrollbarVisibility)&&void 0!==r?r:1:2},this.scrollable));const a=this._register(new xBe(this.viewContainer,"scroll")).event;this._register(a((e=>{const t=this.scrollableElement.getScrollPosition(),i=Math.abs(this.viewContainer.scrollLeft-t.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,n=Math.abs(this.viewContainer.scrollTop-t.scrollTop)<=1?void 0:this.viewContainer.scrollTop;void 0===i&&void 0===n||this.scrollableElement.setScrollPosition({scrollLeft:i,scrollTop:n})}))),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll((e=>{e.scrollTopChanged&&(this.viewContainer.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this.viewContainer.scrollLeft=e.scrollLeft)}))),IMe(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||f4e),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach(((e,t)=>{const i=ybe(e.visible)||e.visible?e.size:{type:"invisible",cachedVisibleSize:e.size},n=e.view;this.doAddView(n,i,t,!0)})),this.contentSize=this.viewItems.reduce(((e,t)=>e+t.size),0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,n){this.doAddView(e,t,i,n)}layout(e,t){const i=Math.max(this.size,this.contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let t=0;for(let i=0;i<this.viewItems.length;i++){const n=this.viewItems[i],o=this.proportions[i];"number"==typeof o?t+=o:e-=n.size}for(let i=0;i<this.viewItems.length;i++){const n=this.viewItems[i],o=this.proportions[i];"number"==typeof o&&(n.size=KZe(Math.round(o*e/t),n.minimumSize,n.maximumSize))}}else{const t=sbe(this.viewItems.length),n=t.filter((e=>1===this.viewItems[e].priority)),o=t.filter((e=>2===this.viewItems[e].priority));this.resize(this.viewItems.length-1,e-i,void 0,n,o)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map((e=>e.proportionalLayout?e.size/this.contentSize:void 0)))}onSashStart({sash:e,start:t,alt:i}){for(const e of this.viewItems)e.enabled=!1;const n=this.sashItems.findIndex((t=>t.sash===e)),o=Mwe(tMe(document.body,"keydown",(e=>s(this.sashDragState.current,e.altKey))),tMe(document.body,"keyup",(()=>s(this.sashDragState.current,!1)))),s=(e,t)=>{const i=this.viewItems.map((e=>e.size));let s,r,a=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(t=!t),t)if(n===this.sashItems.length-1){const e=this.viewItems[n];a=(e.minimumSize-e.size)/2,l=(e.maximumSize-e.size)/2}else{const e=this.viewItems[n+1];a=(e.size-e.maximumSize)/2,l=(e.size-e.minimumSize)/2}if(!t){const e=sbe(n,-1),t=sbe(n+1,this.viewItems.length),o=e.reduce(((e,t)=>e+(this.viewItems[t].minimumSize-i[t])),0),a=e.reduce(((e,t)=>e+(this.viewItems[t].viewMaximumSize-i[t])),0),l=0===t.length?Number.POSITIVE_INFINITY:t.reduce(((e,t)=>e+(i[t]-this.viewItems[t].minimumSize)),0),d=0===t.length?Number.NEGATIVE_INFINITY:t.reduce(((e,t)=>e+(i[t]-this.viewItems[t].viewMaximumSize)),0),h=Math.max(o,d),c=Math.min(l,a),u=this.findFirstSnapIndex(e),g=this.findFirstSnapIndex(t);if("number"==typeof u){const e=this.viewItems[u],t=Math.floor(e.viewMinimumSize/2);s={index:u,limitDelta:e.visible?h-t:h+t,size:e.size}}if("number"==typeof g){const e=this.viewItems[g],t=Math.floor(e.viewMinimumSize/2);r={index:g,limitDelta:e.visible?c+t:c-t,size:e.size}}}this.sashDragState={start:e,current:e,index:n,sizes:i,minDelta:a,maxDelta:l,alt:t,snapBefore:s,snapAfter:r,disposable:o}};s(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:n,alt:o,minDelta:s,maxDelta:r,snapBefore:a,snapAfter:l}=this.sashDragState;this.sashDragState.current=e;const d=e-i,h=this.resize(t,d,n,void 0,void 0,s,r,a,l);if(o){const e=t===this.sashItems.length-1,i=this.viewItems.map((e=>e.size)),n=e?t:t+1,o=this.viewItems[n],s=o.size-o.maximumSize,r=o.size-o.minimumSize,a=e?t-1:t+1;this.resize(a,-h,i,void 0,void 0,s,r)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const e of this.viewItems)e.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=KZe(t="number"==typeof t?t:e.size,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(this.state!==w4e.Idle)throw new Error("Cant modify splitview");if(this.state=w4e.Busy,e<0||e>=this.viewItems.length)return;const i=sbe(this.viewItems.length).filter((t=>t!==e)),n=[...i.filter((e=>1===this.viewItems[e].priority)),e],o=i.filter((e=>2===this.viewItems[e].priority)),s=this.viewItems[e];t=KZe(t=Math.round(t),s.minimumSize,Math.min(s.maximumSize,this.size)),s.size=t,this.relayout(n,o),this.state=w4e.Idle}distributeViewSizes(){const e=[];let t=0;for(const i of this.viewItems)i.maximumSize-i.minimumSize>0&&(e.push(i),t+=i.size);const i=Math.floor(t/e.length);for(const t of e)t.size=KZe(i,t.minimumSize,t.maximumSize);const n=sbe(this.viewItems.length),o=n.filter((e=>1===this.viewItems[e].priority)),s=n.filter((e=>2===this.viewItems[e].priority));this.relayout(o,s)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,n){if(this.state!==w4e.Idle)throw new Error("Cant modify splitview");this.state=w4e.Busy;const o=OMe(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));const s=e.onDidChange((e=>this.onViewChange(l,e))),r=Mwe(s,Awe((()=>this.viewContainer.removeChild(o))));let a;a="number"==typeof t?t:"split"===t.type?this.getViewSize(t.index)/2:"invisible"===t.type?{cachedVisibleSize:t.cachedVisibleSize}:e.minimumSize;const l=0===this.orientation?new v4e(o,e,a,r):new b4e(o,e,a,r);if(this.viewItems.splice(i,0,l),this.viewItems.length>1){const e={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},t=0===this.orientation?new bGe(this.sashContainer,{getHorizontalSashTop:e=>this.getSashPosition(e),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},e),{orientation:1})):new bGe(this.sashContainer,{getVerticalSashLeft:e=>this.getSashPosition(e),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},e),{orientation:0})),n=0===this.orientation?e=>({sash:t,start:e.startY,current:e.currentY,alt:e.altKey}):e=>({sash:t,start:e.startX,current:e.currentX,alt:e.altKey}),o=zwe.map(t.onDidStart,n)(this.onSashStart,this),s=zwe.map(t.onDidChange,n)(this.onSashChange,this),r=zwe.map(t.onDidEnd,(()=>this.sashItems.findIndex((e=>e.sash===t)))),a=r(this.onSashEnd,this),l=t.onDidReset((()=>{const e=this.sashItems.findIndex((e=>e.sash===t)),i=sbe(e,-1),n=sbe(e+1,this.viewItems.length),o=this.findFirstSnapIndex(i),s=this.findFirstSnapIndex(n);("number"!=typeof o||this.viewItems[o].visible)&&("number"!=typeof s||this.viewItems[s].visible)&&this._onDidSashReset.fire(e)})),d=Mwe(o,s,a,l,t),h={sash:t,disposable:d};this.sashItems.splice(i-1,0,h)}let d;o.appendChild(e.element),"number"!=typeof t&&"split"===t.type&&(d=[t.index]),n||this.relayout([i],d),this.state=w4e.Idle,n||"number"==typeof t||"distribute"!==t.type||this.distributeViewSizes()}relayout(e,t){const i=this.viewItems.reduce(((e,t)=>e+t.size),0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map((e=>e.size)),n,o,s=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,a,l){if(e<0||e>=this.viewItems.length)return 0;const d=sbe(e,-1),h=sbe(e+1,this.viewItems.length);if(o)for(const e of o)abe(d,e),abe(h,e);if(n)for(const e of n)lbe(d,e),lbe(h,e);const c=d.map((e=>this.viewItems[e])),u=d.map((e=>i[e])),g=h.map((e=>this.viewItems[e])),p=h.map((e=>i[e])),m=d.reduce(((e,t)=>e+(this.viewItems[t].minimumSize-i[t])),0),f=d.reduce(((e,t)=>e+(this.viewItems[t].maximumSize-i[t])),0),_=0===h.length?Number.POSITIVE_INFINITY:h.reduce(((e,t)=>e+(i[t]-this.viewItems[t].minimumSize)),0),v=0===h.length?Number.NEGATIVE_INFINITY:h.reduce(((e,t)=>e+(i[t]-this.viewItems[t].maximumSize)),0),b=Math.max(m,v,s),w=Math.min(_,f,r);let C=!1;if(a){const e=this.viewItems[a.index],i=t>=a.limitDelta;C=i!==e.visible,e.setVisible(i,a.size)}if(!C&&l){const e=this.viewItems[l.index],i=t<l.limitDelta;C=i!==e.visible,e.setVisible(i,l.size)}if(C)return this.resize(e,t,i,n,o,s,r);for(let e=0,i=t=KZe(t,b,w);e<c.length;e++){const t=c[e],n=KZe(u[e]+i,t.minimumSize,t.maximumSize);i-=n-u[e],t.size=n}for(let e=0,i=t;e<g.length;e++){const t=g[e],n=KZe(p[e]-i,t.minimumSize,t.maximumSize);i+=n-p[e],t.size=n}return t}distributeEmptySpace(e){const t=this.viewItems.reduce(((e,t)=>e+t.size),0);let i=this.size-t;const n=sbe(this.viewItems.length-1,-1),o=n.filter((e=>1===this.viewItems[e].priority)),s=n.filter((e=>2===this.viewItems[e].priority));for(const e of s)abe(n,e);for(const e of o)lbe(n,e);"number"==typeof e&&lbe(n,e);for(let e=0;0!==i&&e<n.length;e++){const t=this.viewItems[n[e]],o=KZe(t.size+i,t.minimumSize,t.maximumSize);i-=o-t.size,t.size=o}}layoutViews(){this.contentSize=this.viewItems.reduce(((e,t)=>e+t.size),0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach((e=>e.sash.layout())),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){0===this.orientation?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this.contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this.contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map((t=>e=t.size-t.minimumSize>0||e));e=!1;const i=this.viewItems.map((t=>e=t.maximumSize-t.size>0||e)),n=[...this.viewItems].reverse();e=!1;const o=n.map((t=>e=t.size-t.minimumSize>0||e)).reverse();e=!1;const s=n.map((t=>e=t.maximumSize-t.size>0||e)).reverse();let r=0;for(let e=0;e<this.sashItems.length;e++){const{sash:n}=this.sashItems[e];r+=this.viewItems[e].size;const a=!(t[e]&&s[e+1]),l=!(i[e]&&o[e+1]);if(a&&l){const i=sbe(e,-1),s=sbe(e+1,this.viewItems.length),a=this.findFirstSnapIndex(i),l=this.findFirstSnapIndex(s),d="number"==typeof a&&!this.viewItems[a].visible,h="number"==typeof l&&!this.viewItems[l].visible;d&&o[e]&&(r>0||this.startSnappingEnabled)?n.state=1:h&&t[e]&&(r<this.contentSize||this.endSnappingEnabled)?n.state=2:n.state=0}else n.state=a&&!l?1:!a&&l?2:3}}getSashPosition(e){let t=0;for(let i=0;i<this.sashItems.length;i++)if(t+=this.viewItems[i].size,this.sashItems[i].sash===e)return t;return 0}findFirstSnapIndex(e){for(const t of e){const e=this.viewItems[t];if(e.visible&&e.snap)return t}for(const t of e){const e=this.viewItems[t];if(e.visible&&e.maximumSize-e.minimumSize>0)return;if(!e.visible&&e.snap)return t}}dispose(){super.dispose(),Twe(this.viewItems),this.viewItems=[],this.sashItems.forEach((e=>e.disposable.dispose())),this.sashItems=[]}}var S4e,x4e=i(1516),k4e={};k4e.styleTagTransform=zl(),k4e.setAttributes=Bl(),k4e.insert=Pl().bind(null,"head"),k4e.domAPI=Rl(),k4e.insertStyleElement=Vl(),Ml()(x4e.A,k4e),x4e.A&&x4e.A.locals&&x4e.A.locals;class L4e{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=L4e.TemplateId,this.renderedTemplates=new Set;const n=new Map(t.map((e=>[e.templateId,e])));this.renderers=[];for(const t of e){const e=n.get(t.templateId);if(!e)throw new Error(`Table cell renderer for template id ${t.templateId} not found.`);this.renderers.push(e)}}renderTemplate(e){const t=IMe(e,OMe(".monaco-table-tr")),i=[],n=[];for(let e=0;e<this.columns.length;e++){const o=this.renderers[e],s=IMe(t,OMe(".monaco-table-td",{"data-col-index":e}));s.style.width=`${this.getColumnSize(e)}px`,i.push(s),n.push(o.renderTemplate(s))}const o={container:e,cellContainers:i,cellTemplateData:n};return this.renderedTemplates.add(o),o}renderElement(e,t,i,n){for(let o=0;o<this.columns.length;o++){const s=this.columns[o].project(e);this.renderers[o].renderElement(s,t,i.cellTemplateData[o],n)}}disposeElement(e,t,i,n){for(let o=0;o<this.columns.length;o++){const s=this.renderers[o];if(s.disposeElement){const r=this.columns[o].project(e);s.disposeElement(r,t,i.cellTemplateData[o],n)}}}disposeTemplate(e){for(let t=0;t<this.columns.length;t++)this.renderers[t].disposeTemplate(e.cellTemplateData[t]);XTe(e.container),this.renderedTemplates.delete(e)}layoutColumn(e,t){for(const{cellContainers:i}of this.renderedTemplates)i[e].style.width=`${t}px`}}L4e.TemplateId="row";class D4e{get minimumSize(){var e;return null!==(e=this.column.minimumWidth)&&void 0!==e?e:120}get maximumSize(){var e;return null!==(e=this.column.maximumWidth)&&void 0!==e?e:Number.POSITIVE_INFINITY}get onDidChange(){var e;return null!==(e=this.column.onDidChangeWidthConstraints)&&void 0!==e?e:zwe.None}constructor(e,t){this.column=e,this.index=t,this._onDidLayout=new $we,this.onDidLayout=this._onDidLayout.event,this.element=OMe(".monaco-table-th",{"data-col-index":t,title:e.tooltip},e.label)}layout(e){this._onDidLayout.fire([this.index,e])}}class E4e{get onDidChangeFocus(){return this.list.onDidChangeFocus}get onDidChangeSelection(){return this.list.onDidChangeSelection}get onMouseDblClick(){return this.list.onMouseDblClick}get onPointer(){return this.list.onPointer}get onDidFocus(){return this.list.onDidFocus}get onDidDispose(){return this.list.onDidDispose}constructor(e,t,i,n,o,s){this.virtualDelegate=i,this.domId="table_id_"+ ++E4e.InstanceCount,this.disposables=new Rwe,this.cachedWidth=0,this.cachedHeight=0,this.domNode=IMe(t,OMe(`.monaco-table.${this.domId}`));const r=n.map(((e,t)=>new D4e(e,t))),a={size:r.reduce(((e,t)=>e+t.column.weight),0),views:r.map((e=>({size:e.column.weight,view:e})))};this.splitview=this.disposables.add(new y4e(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:a})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const l=new L4e(n,o,(e=>this.splitview.getViewSize(e)));var d;this.list=this.disposables.add(new PYe(e,this.domNode,(d=i,{getHeight:e=>d.getHeight(e),getTemplateId:()=>L4e.TemplateId}),[l],s)),zwe.any(...r.map((e=>e.onDidLayout)))((([e,t])=>l.layoutColumn(e,t)),null,this.disposables),this.splitview.onDidSashReset((e=>{const t=n.reduce(((e,t)=>e+t.weight),0),i=n[e].weight/t*this.cachedWidth;this.splitview.resizeView(e,i)}),null,this.disposables),this.styleElement=yMe(this.domNode),this.style(NYe)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\ttop: ${this.virtualDelegate.headerRowHeight+1}px;\n\t\t\theight: calc(100% - ${this.virtualDelegate.headerRowHeight}px);\n\t\t}`),this.styleElement.textContent=t.join("\n"),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}E4e.InstanceCount=0,function(e){e[e.Unknown=0]="Unknown",e[e.Twistie=1]="Twistie",e[e.Element=2]="Element",e[e.Filter=3]="Filter"}(S4e||(S4e={}));class N4e extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class I4e{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}}function T4e(e){return"object"==typeof e&&"visibility"in e&&"data"in e}function M4e(e){switch(e){case!0:return 1;case!1:return 0;default:return e}}function A4e(e){return"boolean"==typeof e.collapsible}class R4e{constructor(e,t,i,n={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new eCe,this._onDidChangeCollapseState=new $we,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new $we,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new $we,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new TDe(kDe),this.collapseByDefault=void 0!==n.collapseByDefault&&n.collapseByDefault,this.filter=n.filter,this.autoExpandSingleChildren=void 0!==n.autoExpandSingleChildren&&n.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=jve.empty(),n={}){if(0===e.length)throw new N4e(this.user,"Invalid tree location");n.diffIdentityProvider?this.spliceSmart(n.diffIdentityProvider,e,t,i,n):this.spliceSimple(e,t,i,n)}spliceSmart(e,t,i,n,o,s){var r;void 0===n&&(n=jve.empty()),void 0===s&&(s=null!==(r=o.diffDepth)&&void 0!==r?r:0);const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,i,n,o);const l=[...n],d=t[t.length-1],h=new _Ee({getElements:()=>a.lastDiffIds},{getElements:()=>[...a.children.slice(0,d),...l,...a.children.slice(d+i)].map((t=>e.getId(t.element).toString()))}).ComputeDiff(!1);if(h.quitEarly)return a.lastDiffIds=void 0,this.spliceSimple(t,i,l,o);const c=t.slice(0,-1),u=(t,i,n)=>{if(s>0)for(let r=0;r<n;r++)t--,i--,this.spliceSmart(e,[...c,t,0],Number.MAX_SAFE_INTEGER,l[i].children,o,s-1)};let g=Math.min(a.children.length,d+i),p=l.length;for(const e of h.changes.sort(((e,t)=>t.originalStart-e.originalStart)))u(g,p,g-(e.originalStart+e.originalLength)),g=e.originalStart,p=e.modifiedStart-d,this.spliceSimple([...c,g],e.originalLength,jve.slice(l,p,p+e.modifiedLength),o);u(g,p,g)}spliceSimple(e,t,i=jve.empty(),{onDidCreateNode:n,onDidDeleteNode:o,diffIdentityProvider:s}){const{parentNode:r,listIndex:a,revealed:l,visible:d}=this.getParentNodeWithListIndex(e),h=[],c=jve.map(i,(e=>this.createTreeNode(e,r,r.visible?1:0,l,h,n))),u=e[e.length-1],g=r.children.length>0;let p=0;for(let e=u;e>=0&&e<r.children.length;e--){const t=r.children[e];if(t.visible){p=t.visibleChildIndex;break}}const m=[];let f=0,_=0;for(const e of c)m.push(e),_+=e.renderNodeCount,e.visible&&(e.visibleChildIndex=p+f++);const v=hbe(r.children,u,t,m);s?r.lastDiffIds?hbe(r.lastDiffIds,u,t,m.map((e=>s.getId(e.element).toString()))):r.lastDiffIds=r.children.map((e=>s.getId(e.element).toString())):r.lastDiffIds=void 0;let b=0;for(const e of v)e.visible&&b++;if(0!==b)for(let e=u+m.length;e<r.children.length;e++){const t=r.children[e];t.visible&&(t.visibleChildIndex-=b)}if(r.visibleChildrenCount+=f-b,l&&d){const e=v.reduce(((e,t)=>e+(t.visible?t.renderNodeCount:0)),0);this._updateAncestorsRenderNodeCount(r,_-e),this.list.splice(a,e,h)}if(v.length>0&&o){const e=t=>{o(t),t.children.forEach(e)};v.forEach(e)}this._onDidSplice.fire({insertedNodes:m,deletedNodes:v});const w=r.children.length>0;g!==w&&this.setCollapsible(e.slice(0,-1),w);let C=r;for(;C;){if(2===C.visibility){this.refilterDelayer.trigger((()=>this.refilter()));break}C=C.parent}}rerender(e){if(0===e.length)throw new N4e(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:n}=this.getTreeNodeWithListIndex(e);t.visible&&n&&this.list.splice(i,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:n}=this.getTreeNodeWithListIndex(e);return i&&n?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);void 0===t&&(t=!i.collapsible);const n={collapsible:t};return this.eventBufferer.bufferEvents((()=>this._setCollapseState(e,n)))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const n=this.getTreeNode(e);void 0===t&&(t=!n.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents((()=>this._setCollapseState(e,o)))}_setCollapseState(e,t){const{node:i,listIndex:n,revealed:o}=this.getTreeNodeWithListIndex(e),s=this._setListNodeCollapseState(i,n,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&s&&!A4e(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let n=-1;for(let e=0;e<i.children.length;e++)if(i.children[e].visible){if(n>-1){n=-1;break}n=e}n>-1&&this._setCollapseState([...e,n],t)}return s}_setListNodeCollapseState(e,t,i,n){const o=this._setNodeCollapseState(e,n,!1);if(!i||!e.visible||!o)return o;const s=e.renderNodeCount,r=this.updateNodeAfterCollapseChange(e),a=s-(-1===t?0:1);return this.list.splice(t+1,a,r.slice(1)),o}_setNodeCollapseState(e,t,i){let n;if(e===this.root?n=!1:(A4e(t)?(n=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(n=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):n=!1,n&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!A4e(t)&&t.recursive)for(const i of e.children)n=this._setNodeCollapseState(i,t,!0)||n;return n}expandTo(e){this.eventBufferer.bufferEvents((()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})}))}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,t),this.refilterDelayer.cancel()}createTreeNode(e,t,i,n,o,s){const r={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:"boolean"==typeof e.collapsible?e.collapsible:void 0!==e.collapsed,collapsed:void 0===e.collapsed?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},a=this._filterNode(r,i);r.visibility=a,n&&o.push(r);const l=e.children||jve.empty(),d=n&&0!==a&&!r.collapsed;let h=0,c=1;for(const e of l){const t=this.createTreeNode(e,r,a,d,o,s);r.children.push(t),c+=t.renderNodeCount,t.visible&&(t.visibleChildIndex=h++)}return r.collapsible=r.collapsible||r.children.length>0,r.visibleChildrenCount=h,r.visible=2===a?h>0:1===a,r.visible?r.collapsed||(r.renderNodeCount=c):(r.renderNodeCount=0,n&&o.pop()),null==s||s(r),r}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(!1===e.visible)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,n=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),0===o)return e.visible=!1,e.renderNodeCount=0,!1;n&&i.push(e)}const s=i.length;e.renderNodeCount=e===this.root?0:1;let r=!1;if(e.collapsed&&0===o)e.visibleChildrenCount=0;else{let t=0;for(const s of e.children)r=this._updateNodeAfterFilterChange(s,o,i,n&&!e.collapsed)||r,s.visible&&(s.visibleChildIndex=t++);e.visibleChildrenCount=t}return e!==this.root&&(e.visible=2===o?r:1===o,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-s):(e.renderNodeCount=0,n&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(0!==t)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):1;return"boolean"==typeof i?(e.filterData=void 0,i?1:0):T4e(i)?(e.filterData=i.data,M4e(i.visibility)):(e.filterData=void 0,M4e(i))}hasTreeNode(e,t=this.root){if(!e||0===e.length)return!0;const[i,...n]=e;return!(i<0||i>t.children.length)&&this.hasTreeNode(n,t.children[i])}getTreeNode(e,t=this.root){if(!e||0===e.length)return t;const[i,...n]=e;if(i<0||i>t.children.length)throw new N4e(this.user,"Invalid tree location");return this.getTreeNode(n,t.children[i])}getTreeNodeWithListIndex(e){if(0===e.length)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:n,visible:o}=this.getParentNodeWithListIndex(e),s=e[e.length-1];if(s<0||s>t.children.length)throw new N4e(this.user,"Invalid tree location");const r=t.children[s];return{node:r,listIndex:i,revealed:n,visible:o&&r.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,n=!0,o=!0){const[s,...r]=e;if(s<0||s>t.children.length)throw new N4e(this.user,"Invalid tree location");for(let e=0;e<s;e++)i+=t.children[e].renderNodeCount;return n=n&&!t.collapsed,o=o&&t.visible,0===r.length?{parentNode:t,listIndex:i,revealed:n,visible:o}:this.getParentNodeWithListIndex(r,t.children[s],i+1,n,o)}getNode(e=[]){return this.getTreeNode(e)}getNodeLocation(e){const t=[];let i=e;for(;i.parent;)t.push(i.parent.children.indexOf(i)),i=i.parent;return t.reverse()}getParentNodeLocation(e){return 0===e.length?void 0:1===e.length?[]:function(e){if(0===e.length)throw new Error("Invalid tail call");return[e.slice(0,e.length-1),e[e.length-1]]}(e)[0]}getFirstElementChild(e){const t=this.getTreeNode(e);if(0!==t.children.length)return t.children[0].element}}class O4e{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){const i=this.map.get(e);i&&(i.delete(t),0===i.size&&this.map.delete(e))}forEach(e,t){const i=this.map.get(e);i&&i.forEach(t)}}var P4e,F4e,B4e,W4e=i(1937),V4e={};V4e.styleTagTransform=zl(),V4e.setAttributes=Bl(),V4e.insert=Pl().bind(null,"head"),V4e.domAPI=Rl(),V4e.insertStyleElement=Vl(),Ml()(W4e.A,V4e),W4e.A&&W4e.A.locals&&W4e.A.locals;class H4e extends oYe{constructor(e){super(e.elements.map((e=>e.element))),this.data=e}}function z4e(e){return e instanceof oYe?new H4e(e):e}class U4e{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=Owe.None}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map((e=>e.element)),t)}onDragStart(e,t){var i,n;null===(n=(i=this.dnd).onDragStart)||void 0===n||n.call(i,z4e(e),t)}onDragOver(e,t,i,n,o=!0){const s=this.dnd.onDragOver(z4e(e),t&&t.element,i,n),r=this.autoExpandNode!==t;if(r&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),void 0===t)return s;if(r&&"boolean"!=typeof s&&s.autoExpand&&(this.autoExpandDisposable=RDe((()=>{const e=this.modelProvider(),i=e.getNodeLocation(t);e.isCollapsed(i)&&e.setCollapsed(i,!1),this.autoExpandNode=void 0}),500)),"boolean"==typeof s||!s.accept||void 0===s.bubble||s.feedback)return o?s:{accept:"boolean"==typeof s?s:s.accept,effect:"boolean"==typeof s?void 0:s.effect,feedback:[i]};if(1===s.bubble){const i=this.modelProvider(),o=i.getNodeLocation(t),s=i.getParentNodeLocation(o),r=i.getNode(s),a=s&&i.getListIndex(s);return this.onDragOver(e,r,a,n,!1)}const a=this.modelProvider(),l=a.getNodeLocation(t),d=a.getListIndex(l),h=a.getListRenderCount(l);return Object.assign(Object.assign({},s),{feedback:sbe(d,d+h)})}drop(e,t,i,n){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(z4e(e),t&&t.element,i,n)}onDragEnd(e){var t,i;null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}}class K4e{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){var i,n;null===(n=(i=this.delegate).setDynamicHeight)||void 0===n||n.call(i,e.element,t)}}!function(e){e.None="none",e.OnHover="onHover",e.Always="always"}(P4e||(P4e={}));class j4e{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new Rwe,this.onDidChange=zwe.forEach(e,(e=>this._elements=e),this.disposables)}dispose(){this.disposables.dispose()}}class q4e{constructor(e,t,i,n,o,s={}){var r;this.renderer=e,this.modelProvider=t,this.activeNodes=n,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=q4e.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=Owe.None,this.disposables=new Rwe,this.templateId=e.templateId,this.updateOptions(s),zwe.map(i,(e=>e.node))(this.onDidChangeNodeTwistieState,this,this.disposables),null===(r=e.onDidChangeTwistieState)||void 0===r||r.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(void 0!==e.indent){const t=KZe(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[e,t]of this.renderedNodes)this.renderTreeElement(e,t)}}if(void 0!==e.renderIndentGuides){const t=e.renderIndentGuides!==P4e.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[e,t]of this.renderedNodes)this._renderIndentGuides(e,t);if(this.indentGuidesDisposable.dispose(),t){const e=new Rwe;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,e),this.indentGuidesDisposable=e,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}void 0!==e.hideTwistiesOfChildlessElements&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=IMe(e,OMe(".monaco-tl-row")),i=IMe(t,OMe(".monaco-tl-indent")),n=IMe(t,OMe(".monaco-tl-twistie")),o=IMe(t,OMe(".monaco-tl-contents")),s=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:n,indentGuidesDisposable:Owe.None,templateData:s}}renderElement(e,t,i,n){this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,n)}disposeElement(e,t,i,n){var o,s;i.indentGuidesDisposable.dispose(),null===(s=(o=this.renderer).disposeElement)||void 0===s||s.call(o,e,t,i.templateData,n),"number"==typeof n&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){const i=q4e.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${i}px`,t.indent.style.width=i+this.indent-16+"px",e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...sAe.asClassNameArray(pye.treeItemExpanded));let n=!1;this.renderer.renderTwistie&&(n=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(n||t.twistie.classList.add(...sAe.asClassNameArray(pye.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(XTe(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new Rwe,n=this.modelProvider();for(;;){const o=n.getNodeLocation(e),s=n.getParentNodeLocation(o);if(!s)break;const r=n.getNode(s),a=OMe(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(r)&&a.classList.add("active"),0===t.indent.childElementCount?t.indent.appendChild(a):t.indent.insertBefore(a,t.indent.firstElementChild),this.renderedIndentGuides.add(r,a),i.add(Awe((()=>this.renderedIndentGuides.delete(r,a)))),e=r}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach((e=>{const n=i.getNodeLocation(e);try{const o=i.getParentNodeLocation(n);e.collapsible&&e.children.length>0&&!e.collapsed?t.add(e):o&&t.add(i.getNode(o))}catch(e){}})),this.activeIndentNodes.forEach((e=>{t.has(e)||this.renderedIndentGuides.forEach(e,(e=>e.classList.remove("active")))})),t.forEach((e=>{this.activeIndentNodes.has(e)||this.renderedIndentGuides.forEach(e,(e=>e.classList.add("active")))})),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),Twe(this.disposables)}}q4e.DefaultIndent=8;class $4e{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}constructor(e,t,i){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=i,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new Rwe,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let i=1;if(this._filter){const n=this._filter.filter(e,t);if(i="boolean"==typeof n?n?1:0:T4e(n)?M4e(n.visibility):n,0===i)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:aZe.Default,visibility:i};const n=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(n)?n:[n];for(const e of o){const t=e&&e.toString();if(void 0===t)return{data:aZe.Default,visibility:i};let n;if(this.tree.findMatchType===B4e.Contiguous){const e=t.toLowerCase().indexOf(this._lowercasePattern);if(e>-1){n=[Number.MAX_SAFE_INTEGER,0];for(let t=this._lowercasePattern.length;t>0;t--)n.push(e+t-1)}}else n=dZe(this._pattern,this._lowercasePattern,0,t,t.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(n)return this._matchCount++,1===o.length?{data:n,visibility:i}:{data:{label:t,score:n},visibility:i}}return this.tree.findMode===F4e.Filter?"number"==typeof this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:aZe.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){Twe(this.disposables)}}!function(e){e[e.Highlight=0]="Highlight",e[e.Filter=1]="Filter"}(F4e||(F4e={})),function(e){e[e.Fuzzy=0]="Fuzzy",e[e.Contiguous=1]="Contiguous"}(B4e||(B4e={}));class G4e{get pattern(){return this._pattern}get mode(){return this._mode}set mode(e){e!==this._mode&&(this._mode=e,this.widget&&(this.widget.mode=this._mode),this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e))}get matchType(){return this._matchType}set matchType(e){e!==this._matchType&&(this._matchType=e,this.widget&&(this.widget.matchType=this._matchType),this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,n,o,s={}){var r,a;this.tree=e,this.view=i,this.filter=n,this.contextViewProvider=o,this.options=s,this._pattern="",this.width=0,this._onDidChangeMode=new $we,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new $we,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new $we,this._onDidChangeOpenState=new $we,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new Rwe,this.disposables=new Rwe,this._mode=null!==(r=e.options.defaultFindMode)&&void 0!==r?r:F4e.Highlight,this._matchType=null!==(a=e.options.defaultFindMatchType)&&void 0!==a?a:B4e.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){void 0!==e.defaultFindMode&&(this.mode=e.defaultFindMode),void 0!==e.defaultFindMatchType&&(this.matchType=e.defaultFindMatchType)}onDidSpliceModel(){this.widget&&0!==this.pattern.length&&(this.tree.refilter(),this.render())}render(){var e,t,i,n;const o=this.filter.totalCount>0&&0===this.filter.matchCount;this.pattern&&o?null===(e=this.tree.options.showNotFoundMessage)||void 0===e||e?null===(t=this.widget)||void 0===t||t.showMessage({type:2,content:ove(0,"No elements found.")}):null===(i=this.widget)||void 0===i||i.showMessage({type:2}):null===(n=this.widget)||void 0===n||n.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this._mode===F4e.Filter||this.filter.totalCount>0&&this.filter.matchCount<=1||!aZe.isDefault(e.filterData)}layout(e){var t;this.width=e,null===(t=this.widget)||void 0===t||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}}function Z4e(e){let t=S4e.Unknown;return _Me(e.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?t=S4e.Twistie:_Me(e.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?t=S4e.Element:_Me(e.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(t=S4e.Filter),{browserEvent:e.browserEvent,element:e.element?e.element.element:null,target:t}}function Y4e(e,t){t(e),e.children.forEach((e=>Y4e(e,t)))}class Q4e{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new $we,this.onDidChange=this._onDidChange.event}set(e,t){!(null==t?void 0:t.__forceEvent)&&tbe(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const e=this;this._onDidChange.fire({get elements(){return e.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map((e=>e.element))),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const e=this.createNodeSet(),i=t=>e.delete(t);return t.forEach((e=>Y4e(e,i))),void this.set([...e.values()])}const i=new Set,n=e=>i.add(this.identityProvider.getId(e.element).toString());t.forEach((e=>Y4e(e,n)));const o=new Map,s=e=>o.set(this.identityProvider.getId(e.element).toString(),e);e.forEach((e=>Y4e(e,s)));const r=[];for(const e of this.nodes){const t=this.identityProvider.getId(e.element).toString();if(i.has(t)){const e=o.get(t);e&&r.push(e)}else r.push(e)}if(this.nodes.length>0&&0===r.length){const e=this.getFirstViewElementWithTrait();e&&r.push(e)}this._set(r,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class X4e extends DYe{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(bYe(e.browserEvent.target)||_Ye(e.browserEvent.target)||vYe(e.browserEvent.target))return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,n=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16;let o=!1;if(o="function"==typeof this.tree.expandOnlyOnTwistieClick?this.tree.expandOnlyOnTwistieClick(t.element):!!this.tree.expandOnlyOnTwistieClick,o&&!n&&2!==e.browserEvent.detail)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&2===e.browserEvent.detail)return super.onViewPointer(e);if(t.collapsible){const i=this.tree.getNodeLocation(t),s=e.browserEvent.altKey;if(this.tree.setFocus([i]),this.tree.toggleCollapsed(i,s),o&&n)return}super.onViewPointer(e)}onDoubleClick(e){!e.browserEvent.target.classList.contains("monaco-tl-twistie")&&this.tree.expandOnDoubleClick&&super.onDoubleClick(e)}}class J4e extends PYe{constructor(e,t,i,n,o,s,r,a){super(e,t,i,n,a),this.focusTrait=o,this.selectionTrait=s,this.anchorTrait=r}createMouseController(e){return new X4e(this,e.tree)}splice(e,t,i=[]){if(super.splice(e,t,i),0===i.length)return;const n=[],o=[];let s;i.forEach(((t,i)=>{this.focusTrait.has(t)&&n.push(e+i),this.selectionTrait.has(t)&&o.push(e+i),this.anchorTrait.has(t)&&(s=e+i)})),n.length>0&&super.setFocus(nbe([...super.getFocus(),...n])),o.length>0&&super.setSelection(nbe([...super.getSelection(),...o])),"number"==typeof s&&super.setAnchor(s)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map((e=>this.element(e))),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map((e=>this.element(e))),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(void 0===e?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class e5e{get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return zwe.filter(zwe.map(this.view.onMouseDblClick,Z4e),(e=>e.target!==S4e.Filter))}get onPointer(){return zwe.map(this.view.onPointer,Z4e)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return zwe.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e,t;return null!==(t=null===(e=this.findController)||void 0===e?void 0:e.mode)&&void 0!==t?t:F4e.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e,t;return null!==(t=null===(e=this.findController)||void 0===e?void 0:e.matchType)&&void 0!==t?t:B4e.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get expandOnDoubleClick(){return void 0===this._options.expandOnDoubleClick||this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return void 0===this._options.expandOnlyOnTwistieClick||this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,n,o={}){var s;this._user=e,this._options=o,this.eventBufferer=new eCe,this.onDidChangeFindOpenState=zwe.None,this.disposables=new Rwe,this._onWillRefilter=new $we,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new $we;const r=new K4e(i),a=new tCe,l=new tCe,d=this.disposables.add(new j4e(l.event)),h=new O4e;this.renderers=n.map((e=>new q4e(e,(()=>this.model),a.event,d,h,o)));for(const e of this.renderers)this.disposables.add(e);let c;o.keyboardNavigationLabelProvider&&(c=new $4e(this,o.keyboardNavigationLabelProvider,o.filter),o=Object.assign(Object.assign({},o),{filter:c}),this.disposables.add(c)),this.focus=new Q4e((()=>this.view.getFocusedElements()[0]),o.identityProvider),this.selection=new Q4e((()=>this.view.getSelectedElements()[0]),o.identityProvider),this.anchor=new Q4e((()=>this.view.getAnchorElement()),o.identityProvider),this.view=new J4e(e,t,r,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},function(e,t){return t&&Object.assign(Object.assign({},t),{identityProvider:t.identityProvider&&{getId:e=>t.identityProvider.getId(e.element)},dnd:t.dnd&&new U4e(e,t.dnd),multipleSelectionController:t.multipleSelectionController&&{isSelectionSingleChangeEvent:e=>t.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element})),isSelectionRangeChangeEvent:e=>t.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},accessibilityProvider:t.accessibilityProvider&&Object.assign(Object.assign({},t.accessibilityProvider),{getSetSize(t){const i=e(),n=i.getNodeLocation(t),o=i.getParentNodeLocation(n);return i.getNode(o).visibleChildrenCount},getPosInSet:e=>e.visibleChildIndex+1,isChecked:t.accessibilityProvider&&t.accessibilityProvider.isChecked?e=>t.accessibilityProvider.isChecked(e.element):void 0,getRole:t.accessibilityProvider&&t.accessibilityProvider.getRole?e=>t.accessibilityProvider.getRole(e.element):()=>"treeitem",getAriaLabel:e=>t.accessibilityProvider.getAriaLabel(e.element),getWidgetAriaLabel:()=>t.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:t.accessibilityProvider&&t.accessibilityProvider.getWidgetRole?()=>t.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:t.accessibilityProvider&&t.accessibilityProvider.getAriaLevel?e=>t.accessibilityProvider.getAriaLevel(e.element):e=>e.depth,getActiveDescendantId:t.accessibilityProvider.getActiveDescendantId&&(e=>t.accessibilityProvider.getActiveDescendantId(e.element))}),keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},t.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel:e=>t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)})})}((()=>this.model),o)),{tree:this})),this.model=this.createModel(e,this.view,o),a.input=this.model.onDidChangeCollapseState;const u=zwe.forEach(this.model.onDidSplice,(e=>{this.eventBufferer.bufferEvents((()=>{this.focus.onDidModelSplice(e),this.selection.onDidModelSplice(e)}))}),this.disposables);if(u((()=>null),null,this.disposables),l.input=zwe.chain(zwe.any(u,this.focus.onDidChange,this.selection.onDidChange)).debounce((()=>null),0).map((()=>{const e=new Set;for(const t of this.focus.getNodes())e.add(t);for(const t of this.selection.getNodes())e.add(t);return[...e.values()]})).event,!1!==o.keyboardSupport){const e=zwe.chain(this.view.onKeyDown).filter((e=>!_Ye(e.target))).map((e=>new KIe(e)));e.filter((e=>15===e.keyCode)).on(this.onLeftArrow,this,this.disposables),e.filter((e=>17===e.keyCode)).on(this.onRightArrow,this,this.disposables),e.filter((e=>10===e.keyCode)).on(this.onSpace,this,this.disposables)}if((null===(s=o.findWidgetEnabled)||void 0===s||s)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const e=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new G4e(this,this.model,this.view,c,o.contextViewProvider,e),this.focusNavigationFilter=e=>this.findController.shouldAllowFocus(e),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=zwe.None,this.onDidChangeFindMatchType=zwe.None;this.styleElement=yMe(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===P4e.Always)}updateOptions(e={}){var t;this._options=Object.assign(Object.assign({},this._options),e);for(const t of this.renderers)t.updateOptions(e);this.view.updateOptions(this._options),null===(t=this.findController)||void 0===t||t.updateOptions(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===P4e.Always)}get options(){return this._options}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}domFocus(){this.view.domFocus()}layout(e,t){var i;this.view.layout(e,t),bbe(t)&&(null===(i=this.findController)||void 0===i||i.layout(t))}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),this.styleElement.textContent=i.join("\n"),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){const i=e.map((e=>this.model.getNode(e)));this.selection.set(i,t);const n=e.map((e=>this.model.getListIndex(e))).filter((e=>e>-1));this.view.setSelection(n,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const i=e.map((e=>this.model.getNode(e)));this.focus.set(i,t);const n=e.map((e=>this.model.getListIndex(e))).filter((e=>e>-1));this.view.setFocus(n,t,!0)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);-1!==i&&this.view.reveal(i,t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const e=this.model.getParentNodeLocation(n);if(!e)return;const t=this.model.getListIndex(e);this.view.reveal(t),this.view.setFocus([t])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some((e=>e.visible)))return;const[e]=this.view.getFocus(),t=e+1;this.view.reveal(t),this.view.setFocus([t])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,o)}dispose(){Twe(this.disposables),this.view.dispose()}}class t5e{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new R4e(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare:(e,t)=>i.sorter.compare(e.element,t.element)}),this.identityProvider=i.identityProvider}setChildren(e,t=jve.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=jve.empty(),i){const n=new Set,o=new Set;this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},i),{onDidCreateNode:e=>{var t;if(null===e.element)return;const s=e;if(n.add(s.element),this.nodes.set(s.element,s),this.identityProvider){const e=this.identityProvider.getId(s.element).toString();o.add(e),this.nodesByIdentity.set(e,s)}null===(t=i.onDidCreateNode)||void 0===t||t.call(i,s)},onDidDeleteNode:e=>{var t;if(null===e.element)return;const s=e;if(n.has(s.element)||this.nodes.delete(s.element),this.identityProvider){const e=this.identityProvider.getId(s.element).toString();o.has(e)||this.nodesByIdentity.delete(e)}null===(t=i.onDidDeleteNode)||void 0===t||t.call(i,s)}}))}preserveCollapseState(e=jve.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),jve.map(e,(e=>{let t=this.nodes.get(e.element);if(!t&&this.identityProvider){const i=this.identityProvider.getId(e.element).toString();t=this.nodesByIdentity.get(i)}if(!t)return Object.assign(Object.assign({},e),{children:this.preserveCollapseState(e.children)});const i="boolean"==typeof e.collapsible?e.collapsible:t.collapsible,n=void 0!==e.collapsed?e.collapsed:t.collapsed;return Object.assign(Object.assign({},e),{collapsible:i,collapsed:n,children:this.preserveCollapseState(e.children)})}))}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const n=this.getElementLocation(e);return this.model.setCollapsed(n,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(null===e)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new N4e(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(null===e)throw new N4e(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new N4e(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),n=this.model.getParentNodeLocation(i);return this.model.getNode(n).element}getElementLocation(e){if(null===e)return[];const t=this.nodes.get(e);if(!t)throw new N4e(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function i5e(e){return{element:{elements:[e.element],incompressible:e.incompressible||!1},children:jve.map(jve.from(e.children),i5e),collapsible:e.collapsible,collapsed:e.collapsed}}function n5e(e){const t=[e.element],i=e.incompressible||!1;let n,o;for(;[o,n]=jve.consume(jve.from(e.children),2),1===o.length&&!o[0].incompressible;)e=o[0],t.push(e.element);return{element:{elements:t,incompressible:i},children:jve.map(jve.concat(o,n),n5e),collapsible:e.collapsible,collapsed:e.collapsed}}function o5e(e,t=0){let i;return i=t<e.element.elements.length-1?[o5e(e,t+1)]:jve.map(jve.from(e.children),(e=>o5e(e,0))),0===t&&e.element.incompressible?{element:e.element.elements[t],children:i,incompressible:!0,collapsible:e.collapsible,collapsed:e.collapsed}:{element:e.element.elements[t],children:i,collapsible:e.collapsible,collapsed:e.collapsed}}function s5e(e){return o5e(e,0)}function r5e(e,t,i){return e.element===t?Object.assign(Object.assign({},e),{children:i}):Object.assign(Object.assign({},e),{children:jve.map(jve.from(e.children),(e=>r5e(e,t,i)))})}class a5e{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new t5e(e,t,i),this.enabled=void 0===i.compressionEnabled||i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=jve.empty(),i){const n=i.diffIdentityProvider&&(o=i.diffIdentityProvider,{getId:e=>e.elements.map((e=>o.getId(e).toString())).join("\0")});var o;if(null===e){const e=jve.map(t,this.enabled?n5e:i5e);return void this._setChildren(null,e,{diffIdentityProvider:n,diffDepth:1/0})}const s=this.nodes.get(e);if(!s)throw new N4e(this.user,"Unknown compressed tree node");const r=this.model.getNode(s),a=this.model.getParentNodeLocation(s),l=this.model.getNode(a),d=r5e(s5e(r),e,t),h=(this.enabled?n5e:i5e)(d),c=l.children.map((e=>e===r?h:e));this._setChildren(l.element,c,{diffIdentityProvider:n,diffDepth:r.depth-l.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const t=this.model.getNode().children,i=jve.map(t,s5e),n=jve.map(i,e?n5e:i5e);this._setChildren(null,n,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const n=new Set;this.model.setChildren(e,t,Object.assign(Object.assign({},i),{onDidCreateNode:e=>{for(const t of e.element.elements)n.add(t),this.nodes.set(t,e.element)},onDidDeleteNode:e=>{for(const t of e.element.elements)n.has(t)||this.nodes.delete(t)}}))}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(void 0===e)return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return null===t?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return null===i?null:i.elements[i.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const n=this.getCompressedNode(e);return this.model.setCollapsed(n,t,i)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(null===e)return null;const t=this.nodes.get(e);if(!t)throw new N4e(this.user,`Tree element not found: ${e}`);return t}}const l5e=e=>e[e.length-1];class d5e{get element(){return null===this.node.element?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map((e=>new d5e(this.unwrapper,e)))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}}class h5e{get onDidSplice(){return zwe.map(this.model.onDidSplice,(({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map((e=>this.nodeMapper.map(e))),deletedNodes:t.map((e=>this.nodeMapper.map(e)))})))}get onDidChangeCollapseState(){return zwe.map(this.model.onDidChangeCollapseState,(({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t})))}get onDidChangeRenderNodeCount(){return zwe.map(this.model.onDidChangeRenderNodeCount,(e=>this.nodeMapper.map(e)))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||l5e;const n=e=>this.elementMapper(e.elements);this.nodeMapper=new I4e((e=>new d5e(n,e))),this.model=new a5e(e,function(e,t){return{splice(i,n,o){t.splice(i,n,o.map((t=>e.map(t))))},updateElementHeight(e,i){t.updateElementHeight(e,i)}}}(this.nodeMapper,t),function(e,t){return Object.assign(Object.assign({},t),{identityProvider:t.identityProvider&&{getId:i=>t.identityProvider.getId(e(i))},sorter:t.sorter&&{compare:(e,i)=>t.sorter.compare(e.elements[0],i.elements[0])},filter:t.filter&&{filter:(i,n)=>t.filter.filter(e(i),n)}})}(n,i))}setChildren(e,t=jve.empty(),i={}){this.model.setChildren(e,t,i)}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return null==t?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}class c5e extends e5e{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,n,o={}){super(e,t,i,n,o),this.user=e}setChildren(e,t=jve.empty(),i){this.model.setChildren(e,t,i)}rerender(e){void 0!==e?this.model.rerender(e):this.view.rerender()}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new t5e(e,t,i)}}class u5e{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t){this._compressedTreeNodeProvider=e,this.renderer=t,this.templateId=t.templateId,t.onDidChangeTwistieState&&(this.onDidChangeTwistieState=t.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){const o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);1===o.element.elements.length?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,n)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,n))}disposeElement(e,t,i,n){var o,s,r,a;i.compressedTreeNode?null===(s=(o=this.renderer).disposeCompressedElements)||void 0===s||s.call(o,i.compressedTreeNode,t,i.data,n):null===(a=(r=this.renderer).disposeElement)||void 0===a||a.call(r,e,t,i.data,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return!!this.renderer.renderTwistie&&this.renderer.renderTwistie(e,t)}}!function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);s>3&&r&&Object.defineProperty(t,i,r)}([iRe],u5e.prototype,"compressedTreeNodeProvider",null);class g5e extends c5e{constructor(e,t,i,n,o={}){const s=()=>this,r=n.map((e=>new u5e(s,e)));super(e,t,i,r,function(e,t){return t&&Object.assign(Object.assign({},t),{keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(i){let n;try{n=e().getCompressedTreeNode(i)}catch(e){return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i)}return 1===n.element.elements.length?t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i):t.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(n.element.elements)}}})}(s,o))}setChildren(e,t=jve.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new h5e(e,t,i)}updateOptions(e={}){super.updateOptions(e),void 0!==e.compressionEnabled&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var p5e=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function m5e(e){return Object.assign(Object.assign({},e),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function f5e(e,t){return!!t.parent&&(t.parent===e||f5e(e,t.parent))}class _5e{get element(){return this.node.element.element}get children(){return this.node.children.map((e=>new _5e(e)))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class v5e{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...sAe.asClassNameArray(pye.treeItemLoading)),!0):(t.classList.remove(...sAe.asClassNameArray(pye.treeItemLoading)),!1)}disposeElement(e,t,i,n){var o,s;null===(s=(o=this.renderer).disposeElement)||void 0===s||s.call(o,this.nodeMapper.map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function b5e(e){return{browserEvent:e.browserEvent,elements:e.elements.map((e=>e.element))}}function w5e(e){return{browserEvent:e.browserEvent,element:e.element&&e.element.element,target:e.target}}class C5e extends oYe{constructor(e){super(e.elements.map((e=>e.element))),this.data=e}}function y5e(e){return e instanceof oYe?new C5e(e):e}class S5e{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map((e=>e.element)),t)}onDragStart(e,t){var i,n;null===(n=(i=this.dnd).onDragStart)||void 0===n||n.call(i,y5e(e),t)}onDragOver(e,t,i,n,o=!0){return this.dnd.onDragOver(y5e(e),t&&t.element,i,n)}drop(e,t,i,n){this.dnd.drop(y5e(e),t&&t.element,i,n)}onDragEnd(e){var t,i;null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}}function x5e(e){return e&&Object.assign(Object.assign({},e),{collapseByDefault:!0,identityProvider:e.identityProvider&&{getId:t=>e.identityProvider.getId(t.element)},dnd:e.dnd&&new S5e(e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent:t=>e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},t),{element:t.element})),isSelectionRangeChangeEvent:t=>e.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))},accessibilityProvider:e.accessibilityProvider&&Object.assign(Object.assign({},e.accessibilityProvider),{getPosInSet:void 0,getSetSize:void 0,getRole:e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",isChecked:e.accessibilityProvider.isChecked?t=>{var i;return!!(null===(i=e.accessibilityProvider)||void 0===i?void 0:i.isChecked(t.element))}:void 0,getAriaLabel:t=>e.accessibilityProvider.getAriaLabel(t.element),getWidgetAriaLabel:()=>e.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider.getAriaLevel&&(t=>e.accessibilityProvider.getAriaLevel(t.element)),getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))}),filter:e.filter&&{filter:(t,i)=>e.filter.filter(t.element,i)},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}),sorter:void 0,expandOnlyOnTwistieClick:void 0===e.expandOnlyOnTwistieClick?void 0:"function"!=typeof e.expandOnlyOnTwistieClick?e.expandOnlyOnTwistieClick:t=>e.expandOnlyOnTwistieClick(t.element),defaultFindVisibility:t=>t.hasChildren&&t.stale?1:"number"==typeof e.defaultFindVisibility?e.defaultFindVisibility:void 0===e.defaultFindVisibility?2:e.defaultFindVisibility(t.element)})}function k5e(e,t){t(e),e.children.forEach((e=>k5e(e,t)))}class L5e{get onDidChangeFocus(){return zwe.map(this.tree.onDidChangeFocus,b5e)}get onDidChangeSelection(){return zwe.map(this.tree.onDidChangeSelection,b5e)}get onMouseDblClick(){return zwe.map(this.tree.onMouseDblClick,w5e)}get onPointer(){return zwe.map(this.tree.onPointer,w5e)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,n,o,s={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new $we,this._onDidChangeNodeSlowState=new $we,this.nodeMapper=new I4e((e=>new _5e(e))),this.disposables=new Rwe,this.identityProvider=s.identityProvider,this.autoExpandSingleChildren=void 0!==s.autoExpandSingleChildren&&s.autoExpandSingleChildren,this.sorter=s.sorter,this.collapseByDefault=s.collapseByDefault,this.tree=this.createTree(e,t,i,n,s),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.root=m5e({element:void 0,parent:null,hasChildren:!0}),this.identityProvider&&(this.root=Object.assign(Object.assign({},this.root),{id:null})),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,t,i,n,o){const s=new K4e(i),r=n.map((e=>new v5e(e,this.nodeMapper,this._onDidChangeNodeSlowState.event))),a=x5e(o)||{};return new c5e(e,t,s,r,a)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}setInput(e,t){return p5e(this,void 0,void 0,(function*(){this.refreshPromises.forEach((e=>e.cancel())),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};yield this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&"number"==typeof t.scrollTop&&(this.scrollTop=t.scrollTop)}))}_updateChildren(e=this.root.element,t=!0,i=!1,n,o){return p5e(this,void 0,void 0,(function*(){if(void 0===this.root.element)throw new N4e(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield zwe.toPromise(this._onDidRender.event));const s=this.getDataNode(e);if(yield this.refreshAndRenderNode(s,t,n,o),i)try{this.tree.rerender(s)}catch(e){}}))}rerender(e){if(void 0===e||e===this.root.element)return void this.tree.rerender();const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(i)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}expand(e,t=!1){return p5e(this,void 0,void 0,(function*(){if(void 0===this.root.element)throw new N4e(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield zwe.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i))return!1;if(i.refreshPromise&&(yield this.root.refreshPromise,yield zwe.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i))return!1;const n=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(yield this.root.refreshPromise,yield zwe.toPromise(this._onDidRender.event)),n}))}setSelection(e,t){const i=e.map((e=>this.getDataNode(e)));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map((e=>e.element))}setFocus(e,t){const i=e.map((e=>this.getDataNode(e)));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map((e=>e.element))}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getFirstElementChild(t===this.root?null:t);return i&&i.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new N4e(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,i,n){return p5e(this,void 0,void 0,(function*(){yield this.refreshNode(e,t,i),this.render(e,i,n)}))}refreshNode(e,t,i){return p5e(this,void 0,void 0,(function*(){let n;return this.subTreeRefreshPromises.forEach(((o,s)=>{!n&&function(e,t){return e===t||f5e(e,t)||f5e(t,e)}(s,e)&&(n=o.then((()=>this.refreshNode(e,t,i))))})),n||(e!==this.root&&this.tree.getNode(e).collapsed?(e.hasChildren=!!this.dataSource.hasChildren(e.element),void(e.stale=!0)):this.doRefreshSubTree(e,t,i))}))}doRefreshSubTree(e,t,i){return p5e(this,void 0,void 0,(function*(){let n;e.refreshPromise=new Promise((e=>n=e)),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally((()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)}));try{const n=yield this.doRefreshNode(e,t,i);e.stale=!1,yield HDe.settled(n.map((e=>this.doRefreshSubTree(e,t,i))))}finally{n()}}))}doRefreshNode(e,t,i){return p5e(this,void 0,void 0,(function*(){let n;if(e.hasChildren=!!this.dataSource.hasChildren(e.element),e.hasChildren){const t=this.doGetChildren(e);if(wbe(t))n=Promise.resolve(t);else{const i=ADe(800);i.then((()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)}),(e=>null)),n=t.finally((()=>i.cancel()))}}else n=Promise.resolve(jve.empty());try{const o=yield n;return this.setChildren(e,o,t,i)}catch(t){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),xwe(t))return[];throw t}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}))}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const i=this.dataSource.getChildren(e.element);return wbe(i)?this.processChildren(i):(t=NDe((()=>p5e(this,void 0,void 0,(function*(){return this.processChildren(yield i)})))),this.refreshPromises.set(e,t),t.finally((()=>{this.refreshPromises.delete(e)})))}_onDidChangeCollapseState({node:e,deep:t}){null!==e.element&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(wwe))}setChildren(e,t,i,n){const o=[...t];if(0===e.children.length&&0===o.length)return[];const s=new Map,r=new Map;for(const t of e.children)if(s.set(t.element,t),this.identityProvider){const e=this.tree.isCollapsed(t);r.set(t.id,{node:t,collapsed:e})}const a=[],l=o.map((t=>{const o=!!this.dataSource.hasChildren(t);if(!this.identityProvider){const i=m5e({element:t,parent:e,hasChildren:o});return o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(i.collapsedByDefault=!1,a.push(i)),i}const l=this.identityProvider.getId(t).toString(),d=r.get(l);if(d){const e=d.node;return s.delete(e.element),this.nodes.delete(e.element),this.nodes.set(t,e),e.element=t,e.hasChildren=o,i?d.collapsed?(e.children.forEach((e=>k5e(e,(e=>this.nodes.delete(e.element))))),e.children.splice(0,e.children.length),e.stale=!0):a.push(e):o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(e.collapsedByDefault=!1,a.push(e)),e}const h=m5e({element:t,parent:e,id:l,hasChildren:o});return n&&n.viewState.focus&&n.viewState.focus.indexOf(l)>-1&&n.focus.push(h),n&&n.viewState.selection&&n.viewState.selection.indexOf(l)>-1&&n.selection.push(h),n&&n.viewState.expanded&&n.viewState.expanded.indexOf(l)>-1?a.push(h):o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(h.collapsedByDefault=!1,a.push(h)),h}));for(const e of s.values())k5e(e,(e=>this.nodes.delete(e.element)));for(const e of l)this.nodes.set(e.element,e);return e.children.splice(0,e.children.length,...l),e!==this.root&&this.autoExpandSingleChildren&&1===l.length&&0===a.length&&(l[0].collapsedByDefault=!1,a.push(l[0])),a}render(e,t,i){const n=e.children.map((e=>this.asTreeElement(e,t))),o=i&&Object.assign(Object.assign({},i),{diffIdentityProvider:i.diffIdentityProvider&&{getId:e=>i.diffIdentityProvider.getId(e.element)}});this.tree.setChildren(e===this.root?null:e,n,o),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return i=!(t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1)&&e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?jve.map(e.children,(e=>this.asTreeElement(e,t))):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose()}}class D5e{get element(){return{elements:this.node.element.elements.map((e=>e.element)),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map((e=>new D5e(e)))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class E5e{constructor(e,t,i,n){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderCompressedElements(e,t,i,n){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...sAe.asClassNameArray(pye.treeItemLoading)),!0):(t.classList.remove(...sAe.asClassNameArray(pye.treeItemLoading)),!1)}disposeElement(e,t,i,n){var o,s;null===(s=(o=this.renderer).disposeElement)||void 0===s||s.call(o,this.nodeMapper.map(e),t,i.templateData,n)}disposeCompressedElements(e,t,i,n){var o,s;null===(s=(o=this.renderer).disposeCompressedElements)||void 0===s||s.call(o,this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=Twe(this.disposables)}}class N5e extends L5e{constructor(e,t,i,n,o,s,r={}){super(e,t,i,o,s,r),this.compressionDelegate=n,this.compressibleNodeMapper=new I4e((e=>new D5e(e))),this.filter=r.filter}createTree(e,t,i,n,o){const s=new K4e(i),r=n.map((e=>new E5e(e,this.nodeMapper,(()=>this.compressibleNodeMapper),this._onDidChangeNodeSlowState.event))),a=function(e){const t=e&&x5e(e);return t&&Object.assign(Object.assign({},t),{keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},t.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map((e=>e.element)))})})}(o)||{};return new g5e(e,t,s,r,a)}asTreeElement(e,t){return Object.assign({incompressible:this.compressionDelegate.isIncompressible(e.element)},super.asTreeElement(e,t))}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t){if(!this.identityProvider)return super.render(e,t);const i=e=>this.identityProvider.getId(e).toString(),n=e=>{const t=new Set;for(const n of e){const e=this.tree.getCompressedTreeNode(n===this.root?null:n);if(e.element)for(const n of e.element.elements)t.add(i(n.element))}return t},o=n(this.tree.getSelection()),s=n(this.tree.getFocus());super.render(e,t);const r=this.getSelection();let a=!1;const l=this.getFocus();let d=!1;const h=e=>{const t=e.element;if(t)for(let e=0;e<t.elements.length;e++){const n=i(t.elements[e].element),h=t.elements[t.elements.length-1].element;o.has(n)&&-1===r.indexOf(h)&&(r.push(h),a=!0),s.has(n)&&-1===l.indexOf(h)&&(l.push(h),d=!0)}e.children.forEach(h)};h(this.tree.getCompressedTreeNode(e===this.root?null:e)),a&&this.setSelection(r),d&&this.setFocus(l)}processChildren(e){return this.filter&&(e=jve.filter(e,(e=>{const t="boolean"==typeof(i=this.filter.filter(e,1))?i?1:0:T4e(i)?M4e(i.visibility):M4e(i);var i;if(2===t)throw new Error("Recursive tree visibility not supported in async data compressed trees");return 1===t}))),super.processChildren(e)}}class I5e extends e5e{constructor(e,t,i,n,o,s={}){super(e,t,i,n,s),this.user=e,this.dataSource=o,this.identityProvider=s.identityProvider}createModel(e,t,i){return new t5e(e,t,i)}}new bke("isMac",Dve,ove(0,"Whether the operating system is macOS")),new bke("isLinux",Eve,ove(0,"Whether the operating system is Linux")),new bke("isWindows",Lve,ove(0,"Whether the operating system is Windows")),new bke("isWeb",Ive,ove(0,"Whether the platform is a web browser")),new bke("isMacNative",Dve&&!Ive,ove(0,"Whether the operating system is macOS on a non-browser platform")),new bke("isIOS",Mve,ove(0,"Whether the operating system is iOS")),new bke("isMobile",Ave,ove(0,"Whether the platform is a mobile web browser")),new bke("isDevelopment",!1,!0),new bke("productQualityType","",ove(0,"Quality type of VS Code"));const T5e="inputFocus";new bke(T5e,!1,ove(0,"Whether keyboard focus is inside an input box"));var M5e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},A5e=function(e,t){return function(i,n){t(i,n,e)}};const R5e=zxe("listService"),O5e=new bke("listFocus",!0),P5e=new bke("listSupportsMultiselect",!0),F5e=(Jxe.and(O5e,Jxe.not(T5e)),new bke("listHasSelectionOrFocus",!1)),B5e=new bke("listDoubleSelection",!1),W5e=new bke("listMultiSelection",!1),V5e=new bke("listSelectionNavigation",!1),H5e=new bke("listSupportsFind",!0),z5e=new bke("treeElementCanCollapse",!1),U5e=new bke("treeElementHasParent",!1),K5e=new bke("treeElementCanExpand",!1),j5e=new bke("treeElementHasChild",!1),q5e=new bke("treeFindOpen",!1),$5e="listTypeNavigationMode",G5e="listAutomaticKeyboardNavigation";function Z5e(e,t){const i=e.createScoped(t.getHTMLElement());return O5e.bindTo(i),i}const Y5e="workbench.list.multiSelectModifier",Q5e="workbench.list.openMode",X5e="workbench.list.horizontalScrolling",J5e="workbench.list.defaultFindMode",e3e="workbench.list.typeNavigationMode",t3e="workbench.list.keyboardNavigation",i3e="workbench.list.scrollByPage",n3e="workbench.list.defaultFindMatchType",o3e="workbench.tree.indent",s3e="workbench.tree.renderIndentGuides",r3e="workbench.list.smoothScrolling",a3e="workbench.list.mouseWheelScrollSensitivity",l3e="workbench.list.fastScrollSensitivity",d3e="workbench.tree.expandMode";function h3e(e){return"alt"===e.getValue(Y5e)}class c3e extends Owe{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=h3e(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration(Y5e)&&(this.useAltAsMultipleSelectionModifier=h3e(this.configurationService))})))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:xYe(e)}isSelectionRangeChangeEvent(e){return kYe(e)}}function u3e(e,t){var i;const n=e.get(SLe),o=e.get(jXe),s=new Rwe;return[Object.assign(Object.assign({},t),{keyboardNavigationDelegate:{mightProducePrintableCharacter:e=>o.mightProducePrintableCharacter(e)},smoothScrolling:Boolean(n.getValue(r3e)),mouseWheelScrollSensitivity:n.getValue(a3e),fastScrollSensitivity:n.getValue(l3e),multipleSelectionController:null!==(i=t.multipleSelectionController)&&void 0!==i?i:s.add(new c3e(n)),keyboardNavigationEventFilter:w3e(o),scrollByPage:Boolean(n.getValue(i3e))}),s]}let g3e=class extends PYe{constructor(e,t,i,n,o,s,r,a,l){const d=void 0!==o.horizontalScrolling?o.horizontalScrolling:Boolean(a.getValue(X5e)),[h,c]=l.invokeFunction(u3e,o);super(e,t,i,n,Object.assign(Object.assign({keyboardSupport:!1},h),{horizontalScrolling:d})),this.disposables.add(c),this.contextKeyService=Z5e(s,this),this.listSupportsMultiSelect=P5e.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==o.multipleSelectionSupport),V5e.bindTo(this.contextKeyService).set(Boolean(o.selectionNavigation)),this.listHasSelectionOrFocus=F5e.bindTo(this.contextKeyService),this.listDoubleSelection=B5e.bindTo(this.contextKeyService),this.listMultiSelection=W5e.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=h3e(a),this.disposables.add(this.contextKeyService),this.disposables.add(r.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection((()=>{const e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)}))}))),this.disposables.add(this.onDidChangeFocus((()=>{const e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)}))),this.disposables.add(a.onDidChangeConfiguration((e=>{e.affectsConfiguration(Y5e)&&(this._useAltAsMultipleSelectionModifier=h3e(a));let t={};if(e.affectsConfiguration(X5e)&&void 0===this.horizontalScrolling){const e=Boolean(a.getValue(X5e));t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(i3e)){const e=Boolean(a.getValue(i3e));t=Object.assign(Object.assign({},t),{scrollByPage:e})}if(e.affectsConfiguration(r3e)){const e=Boolean(a.getValue(r3e));t=Object.assign(Object.assign({},t),{smoothScrolling:e})}if(e.affectsConfiguration(a3e)){const e=a.getValue(a3e);t=Object.assign(Object.assign({},t),{mouseWheelScrollSensitivity:e})}if(e.affectsConfiguration(l3e)){const e=a.getValue(l3e);t=Object.assign(Object.assign({},t),{fastScrollSensitivity:e})}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new _3e(this,Object.assign({configurationService:a},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?A0e(e):M0e)}};g3e=M5e([A5e(5,wke),A5e(6,R5e),A5e(7,SLe),A5e(8,Hxe)],g3e);let p3e=class extends g4e{constructor(e,t,i,n,o,s,r,a,l){const d=void 0!==o.horizontalScrolling?o.horizontalScrolling:Boolean(a.getValue(X5e)),[h,c]=l.invokeFunction(u3e,o);super(e,t,i,n,Object.assign(Object.assign({keyboardSupport:!1},h),{horizontalScrolling:d})),this.disposables=new Rwe,this.disposables.add(c),this.contextKeyService=Z5e(s,this),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=P5e.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==o.multipleSelectionSupport),V5e.bindTo(this.contextKeyService).set(Boolean(o.selectionNavigation)),this._useAltAsMultipleSelectionModifier=h3e(a),this.disposables.add(this.contextKeyService),this.disposables.add(r.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(a.onDidChangeConfiguration((e=>{e.affectsConfiguration(Y5e)&&(this._useAltAsMultipleSelectionModifier=h3e(a));let t={};if(e.affectsConfiguration(X5e)&&void 0===this.horizontalScrolling){const e=Boolean(a.getValue(X5e));t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(i3e)){const e=Boolean(a.getValue(i3e));t=Object.assign(Object.assign({},t),{scrollByPage:e})}if(e.affectsConfiguration(r3e)){const e=Boolean(a.getValue(r3e));t=Object.assign(Object.assign({},t),{smoothScrolling:e})}if(e.affectsConfiguration(a3e)){const e=a.getValue(a3e);t=Object.assign(Object.assign({},t),{mouseWheelScrollSensitivity:e})}if(e.affectsConfiguration(l3e)){const e=a.getValue(l3e);t=Object.assign(Object.assign({},t),{fastScrollSensitivity:e})}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new _3e(this,Object.assign({configurationService:a},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?A0e(e):M0e)}dispose(){this.disposables.dispose(),super.dispose()}};p3e=M5e([A5e(5,wke),A5e(6,R5e),A5e(7,SLe),A5e(8,Hxe)],p3e);let m3e=class extends E4e{constructor(e,t,i,n,o,s,r,a,l,d){const h=void 0!==s.horizontalScrolling?s.horizontalScrolling:Boolean(l.getValue(X5e)),[c,u]=d.invokeFunction(u3e,s);super(e,t,i,n,o,Object.assign(Object.assign({keyboardSupport:!1},c),{horizontalScrolling:h})),this.disposables.add(u),this.contextKeyService=Z5e(r,this),this.listSupportsMultiSelect=P5e.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==s.multipleSelectionSupport),V5e.bindTo(this.contextKeyService).set(Boolean(s.selectionNavigation)),this.listHasSelectionOrFocus=F5e.bindTo(this.contextKeyService),this.listDoubleSelection=B5e.bindTo(this.contextKeyService),this.listMultiSelection=W5e.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=h3e(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection((()=>{const e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)}))}))),this.disposables.add(this.onDidChangeFocus((()=>{const e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)}))),this.disposables.add(l.onDidChangeConfiguration((e=>{e.affectsConfiguration(Y5e)&&(this._useAltAsMultipleSelectionModifier=h3e(l));let t={};if(e.affectsConfiguration(X5e)&&void 0===this.horizontalScrolling){const e=Boolean(l.getValue(X5e));t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(i3e)){const e=Boolean(l.getValue(i3e));t=Object.assign(Object.assign({},t),{scrollByPage:e})}if(e.affectsConfiguration(r3e)){const e=Boolean(l.getValue(r3e));t=Object.assign(Object.assign({},t),{smoothScrolling:e})}if(e.affectsConfiguration(a3e)){const e=l.getValue(a3e);t=Object.assign(Object.assign({},t),{mouseWheelScrollSensitivity:e})}if(e.affectsConfiguration(l3e)){const e=l.getValue(l3e);t=Object.assign(Object.assign({},t),{fastScrollSensitivity:e})}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new v3e(this,Object.assign({configurationService:l},s)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?A0e(e):M0e)}dispose(){this.disposables.dispose(),super.dispose()}};m3e=M5e([A5e(6,wke),A5e(7,R5e),A5e(8,SLe),A5e(9,Hxe)],m3e);class f3e extends Owe{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new $we),this.onDidOpen=this._onDidOpen.event,this._register(zwe.filter(this.widget.onDidChangeSelection,(e=>e.browserEvent instanceof KeyboardEvent))((e=>this.onSelectionFromKeyboard(e)))),this._register(this.widget.onPointer((e=>this.onPointer(e.element,e.browserEvent)))),this._register(this.widget.onMouseDblClick((e=>this.onMouseDblClick(e.element,e.browserEvent)))),"boolean"!=typeof(null==t?void 0:t.openOnSingleClick)&&(null==t?void 0:t.configurationService)?(this.openOnSingleClick="doubleClick"!==(null==t?void 0:t.configurationService.getValue(Q5e)),this._register(null==t?void 0:t.configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration(Q5e)&&(this.openOnSingleClick="doubleClick"!==(null==t?void 0:t.configurationService.getValue(Q5e)))})))):this.openOnSingleClick=null===(i=null==t?void 0:t.openOnSingleClick)||void 0===i||i}onSelectionFromKeyboard(e){if(1!==e.elements.length)return;const t=e.browserEvent,i="boolean"!=typeof t.preserveFocus||t.preserveFocus,n="boolean"==typeof t.pinned?t.pinned:!i;this._open(this.getSelectedElement(),i,n,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick)return;if(2===t.detail)return;const i=1===t.button,n=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!0,i,n,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const n=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!1,!0,n,t)}_open(e,t,i,n,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:n,element:e,browserEvent:o})}}class _3e extends f3e{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class v3e extends f3e{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class b3e extends f3e{constructor(e,t){super(e,t)}getSelectedElement(){var e;return null!==(e=this.widget.getSelection()[0])&&void 0!==e?e:void 0}}function w3e(e){let t=!1;return i=>{if(i.toKeyCodeChord().isModifierKey())return!1;if(t)return t=!1,!1;const n=e.softDispatch(i,i.target);return(null==n?void 0:n.enterMultiChord)?(t=!0,!1):(t=!1,!n)}}let C3e=class extends c5e{constructor(e,t,i,n,o,s,r,a,l){const{options:d,getTypeNavigationMode:h,disposable:c}=s.invokeFunction(E3e,o);super(e,t,i,n,d),this.disposables.add(c),this.internals=new N3e(this,o,h,o.overrideStyles,r,a,l),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};C3e=M5e([A5e(5,Hxe),A5e(6,wke),A5e(7,R5e),A5e(8,SLe)],C3e);let y3e=class extends g5e{constructor(e,t,i,n,o,s,r,a,l){const{options:d,getTypeNavigationMode:h,disposable:c}=s.invokeFunction(E3e,o);super(e,t,i,n,d),this.disposables.add(c),this.internals=new N3e(this,o,h,o.overrideStyles,r,a,l),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};y3e=M5e([A5e(5,Hxe),A5e(6,wke),A5e(7,R5e),A5e(8,SLe)],y3e);let S3e=class extends I5e{constructor(e,t,i,n,o,s,r,a,l,d){const{options:h,getTypeNavigationMode:c,disposable:u}=r.invokeFunction(E3e,s);super(e,t,i,n,o,h),this.disposables.add(u),this.internals=new N3e(this,s,c,s.overrideStyles,a,l,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),void 0!==e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};S3e=M5e([A5e(6,Hxe),A5e(7,wke),A5e(8,R5e),A5e(9,SLe)],S3e);let x3e=class extends L5e{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,s,r,a,l,d){const{options:h,getTypeNavigationMode:c,disposable:u}=r.invokeFunction(E3e,s);super(e,t,i,n,o,h),this.disposables.add(u),this.internals=new N3e(this,s,c,s.overrideStyles,a,l,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};x3e=M5e([A5e(6,Hxe),A5e(7,wke),A5e(8,R5e),A5e(9,SLe)],x3e);let k3e=class extends N5e{constructor(e,t,i,n,o,s,r,a,l,d,h){const{options:c,getTypeNavigationMode:u,disposable:g}=a.invokeFunction(E3e,r);super(e,t,i,n,o,s,c),this.disposables.add(g),this.internals=new N3e(this,r,u,r.overrideStyles,l,d,h),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};function L3e(e){const t=e.getValue(J5e);if("highlight"===t)return F4e.Highlight;if("filter"===t)return F4e.Filter;const i=e.getValue(t3e);return"simple"===i||"highlight"===i?F4e.Highlight:"filter"===i?F4e.Filter:void 0}function D3e(e){const t=e.getValue(n3e);return"fuzzy"===t?B4e.Fuzzy:"contiguous"===t?B4e.Contiguous:void 0}function E3e(e,t){var i;const n=e.get(SLe),o=e.get(CQe),s=e.get(wke),r=e.get(Hxe),a=void 0!==t.horizontalScrolling?t.horizontalScrolling:Boolean(n.getValue(X5e)),[l,d]=r.invokeFunction(u3e,t),h=t.additionalScrollHeight;return{getTypeNavigationMode:()=>{const e=s.getContextKeyValue($5e);if("automatic"===e)return dYe.Automatic;if("trigger"===e)return dYe.Trigger;if(!1===s.getContextKeyValue(G5e))return dYe.Trigger;const t=n.getValue(e3e);return"automatic"===t?dYe.Automatic:"trigger"===t?dYe.Trigger:void 0},disposable:d,options:Object.assign(Object.assign({keyboardSupport:!1},l),{indent:"number"==typeof n.getValue(o3e)?n.getValue(o3e):void 0,renderIndentGuides:n.getValue(s3e),smoothScrolling:Boolean(n.getValue(r3e)),defaultFindMode:L3e(n),defaultFindMatchType:D3e(n),horizontalScrolling:a,scrollByPage:Boolean(n.getValue(i3e)),additionalScrollHeight:h,hideTwistiesOfChildlessElements:t.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:null!==(i=t.expandOnlyOnTwistieClick)&&void 0!==i?i:"doubleClick"===n.getValue(d3e),contextViewProvider:o,findWidgetStyles:I0e})}}k3e=M5e([A5e(7,Hxe),A5e(8,wke),A5e(9,R5e),A5e(10,SLe)],k3e);let N3e=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,o,s,r){var a;this.tree=e,this.disposables=[],this.contextKeyService=Z5e(o,e),this.listSupportsMultiSelect=P5e.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==t.multipleSelectionSupport),V5e.bindTo(this.contextKeyService).set(Boolean(t.selectionNavigation)),this.listSupportFindWidget=H5e.bindTo(this.contextKeyService),this.listSupportFindWidget.set(null===(a=t.findWidgetEnabled)||void 0===a||a),this.hasSelectionOrFocus=F5e.bindTo(this.contextKeyService),this.hasDoubleSelection=B5e.bindTo(this.contextKeyService),this.hasMultiSelection=W5e.bindTo(this.contextKeyService),this.treeElementCanCollapse=z5e.bindTo(this.contextKeyService),this.treeElementHasParent=U5e.bindTo(this.contextKeyService),this.treeElementCanExpand=K5e.bindTo(this.contextKeyService),this.treeElementHasChild=j5e.bindTo(this.contextKeyService),this.treeFindOpen=q5e.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=h3e(r),this.updateStyleOverrides(n);const l=()=>{const t=e.getFocus()[0];if(!t)return;const i=e.getNode(t);this.treeElementCanCollapse.set(i.collapsible&&!i.collapsed),this.treeElementHasParent.set(!!e.getParentElement(t)),this.treeElementCanExpand.set(i.collapsible&&i.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(t))},d=new Set;d.add($5e),d.add(G5e),this.disposables.push(this.contextKeyService,s.register(e),e.onDidChangeSelection((()=>{const t=e.getSelection(),i=e.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.hasSelectionOrFocus.set(t.length>0||i.length>0),this.hasMultiSelection.set(t.length>1),this.hasDoubleSelection.set(2===t.length)}))})),e.onDidChangeFocus((()=>{const t=e.getSelection(),i=e.getFocus();this.hasSelectionOrFocus.set(t.length>0||i.length>0),l()})),e.onDidChangeCollapseState(l),e.onDidChangeModel(l),e.onDidChangeFindOpenState((e=>this.treeFindOpen.set(e))),r.onDidChangeConfiguration((n=>{let o={};if(n.affectsConfiguration(Y5e)&&(this._useAltAsMultipleSelectionModifier=h3e(r)),n.affectsConfiguration(o3e)){const e=r.getValue(o3e);o=Object.assign(Object.assign({},o),{indent:e})}if(n.affectsConfiguration(s3e)){const e=r.getValue(s3e);o=Object.assign(Object.assign({},o),{renderIndentGuides:e})}if(n.affectsConfiguration(r3e)){const e=Boolean(r.getValue(r3e));o=Object.assign(Object.assign({},o),{smoothScrolling:e})}if(n.affectsConfiguration(J5e)||n.affectsConfiguration(t3e)){const e=L3e(r);o=Object.assign(Object.assign({},o),{defaultFindMode:e})}if(n.affectsConfiguration(e3e)||n.affectsConfiguration(t3e)){const e=i();o=Object.assign(Object.assign({},o),{typeNavigationMode:e})}if(n.affectsConfiguration(n3e)){const e=D3e(r);o=Object.assign(Object.assign({},o),{defaultFindMatchType:e})}if(n.affectsConfiguration(X5e)&&void 0===t.horizontalScrolling){const e=Boolean(r.getValue(X5e));o=Object.assign(Object.assign({},o),{horizontalScrolling:e})}if(n.affectsConfiguration(i3e)){const e=Boolean(r.getValue(i3e));o=Object.assign(Object.assign({},o),{scrollByPage:e})}if(n.affectsConfiguration(d3e)&&void 0===t.expandOnlyOnTwistieClick&&(o=Object.assign(Object.assign({},o),{expandOnlyOnTwistieClick:"doubleClick"===r.getValue(d3e)})),n.affectsConfiguration(a3e)){const e=r.getValue(a3e);o=Object.assign(Object.assign({},o),{mouseWheelScrollSensitivity:e})}if(n.affectsConfiguration(l3e)){const e=r.getValue(l3e);o=Object.assign(Object.assign({},o),{fastScrollSensitivity:e})}Object.keys(o).length>0&&e.updateOptions(o)})),this.contextKeyService.onDidChangeContext((t=>{t.affectsSome(d)&&e.updateOptions({typeNavigationMode:i()})}))),this.navigator=new b3e(e,Object.assign({configurationService:r},t)),this.disposables.push(this.navigator)}updateOptions(e){void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?A0e(e):M0e)}dispose(){this.disposables=Twe(this.disposables)}};var I3e;N3e=M5e([A5e(4,wke),A5e(5,R5e),A5e(6,SLe)],N3e),RLe.as(BLe).registerConfiguration({id:"workbench",order:7,title:ove(0,"Workbench"),type:"object",properties:{[Y5e]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[ove(0,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),ove(0,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:ove(0,"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[Q5e]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:ove(0,"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[X5e]:{type:"boolean",default:!1,description:ove(0,"Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[i3e]:{type:"boolean",default:!1,description:ove(0,"Controls whether clicks in the scrollbar scroll page by page.")},[o3e]:{type:"number",default:8,minimum:4,maximum:40,description:ove(0,"Controls tree indentation in pixels.")},[s3e]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:ove(0,"Controls whether the tree should render indent guides.")},[r3e]:{type:"boolean",default:!1,description:ove(0,"Controls whether lists and trees have smooth scrolling.")},[a3e]:{type:"number",default:1,markdownDescription:ove(0,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[l3e]:{type:"number",default:5,description:ove(0,"Scrolling speed multiplier when pressing `Alt`.")},[J5e]:{type:"string",enum:["highlight","filter"],enumDescriptions:[ove(0,"Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),ove(0,"Filter elements when searching.")],default:"highlight",description:ove(0,"Controls the default find mode for lists and trees in the workbench.")},[t3e]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[ove(0,"Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),ove(0,"Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),ove(0,"Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:ove(0,"Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:ove(0,"Please use 'workbench.list.defaultFindMode' and\t'workbench.list.typeNavigationMode' instead.")},[n3e]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[ove(0,"Use fuzzy matching when searching."),ove(0,"Use contiguous matching when searching.")],default:"fuzzy",description:ove(0,"Controls the type of matching used when searching lists and trees in the workbench.")},[d3e]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:ove(0,"Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[e3e]:{type:"string",enum:["automatic","trigger"],default:"automatic",description:ove(0,"Controls the how type navigation works in lists and trees in the workbench. When set to 'trigger', type navigation begins once the 'list.triggerTypeNavigation' command is run.")}}}),function(e){e[e.PRESERVE=0]="PRESERVE",e[e.LAST=1]="LAST"}(I3e||(I3e={}));const T3e="workbench.contributions.quickaccess";RLe.add(T3e,new class{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return 0===e.prefix.length?this.defaultProvider=e:this.providers.push(e),this.providers.sort(((e,t)=>t.prefix.length-e.prefix.length)),Awe((()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)}))}getQuickAccessProviders(){return function(e){return e.filter((e=>!!e))}([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){const t=e&&this.providers.find((t=>e.startsWith(t.prefix)))||void 0;return t||this.defaultProvider}});const M3e=zxe("quickInputService");var A3e=function(e,t){return function(i,n){t(i,n,e)}};let R3e=class extends Owe{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=RLe.as(T3e),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){var n;const[o,s]=this.getOrInstantiateProvider(e),r=this.visibleQuickAccess,a=null==r?void 0:r.descriptor;if(r&&s&&a===s)return e===s.prefix||(null==i?void 0:i.preserveValue)||(r.picker.value=e),void this.adjustValueSelection(r.picker,s,i);if(s&&!(null==i?void 0:i.preserveValue)){let t;if(r&&a&&a!==s){const e=r.value.substr(a.prefix.length);e&&(t=`${s.prefix}${e}`)}if(!t){const e=null==o?void 0:o.defaultFilterValue;e===I3e.LAST?t=this.lastAcceptedPickerValues.get(s):"string"==typeof e&&(t=`${s.prefix}${e}`)}"string"==typeof t&&(e=t)}const l=new Rwe,d=l.add(this.quickInputService.createQuickPick());let h;d.value=e,this.adjustValueSelection(d,s,i),d.placeholder=null==s?void 0:s.placeholder,d.quickNavigate=null==i?void 0:i.quickNavigateConfiguration,d.hideInput=!!d.quickNavigate&&!r,("number"==typeof(null==i?void 0:i.itemActivation)||(null==i?void 0:i.quickNavigateConfiguration))&&(d.itemActivation=null!==(n=null==i?void 0:i.itemActivation)&&void 0!==n?n:_2e.SECOND),d.contextKey=null==s?void 0:s.contextKey,d.filterValue=e=>e.substring(s?s.prefix.length:0),(null==s?void 0:s.placeholder)&&(d.ariaLabel=null==s?void 0:s.placeholder),t&&(h=new VDe,l.add(Iwe(d.onWillAccept)((e=>{e.veto(),d.hide()})))),l.add(this.registerPickerListeners(d,o,s,e,null==i?void 0:i.providerOptions));const c=l.add(new sCe);return o&&l.add(o.provide(d,c.token,null==i?void 0:i.providerOptions)),Iwe(d.onDidHide)((()=>{0===d.selectedItems.length&&c.cancel(),l.dispose(),null==h||h.complete(d.selectedItems.slice(0))})),d.show(),t?null==h?void 0:h.p:void 0}adjustValueSelection(e,t,i){var n;let o;o=(null==i?void 0:i.preserveValue)?[e.value.length,e.value.length]:[null!==(n=null==t?void 0:t.prefix.length)&&void 0!==n?n:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,i,n,o){const s=new Rwe,r=this.visibleQuickAccess={picker:e,descriptor:i,value:n};return s.add(Awe((()=>{r===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)}))),s.add(e.onDidChangeValue((e=>{const[i]=this.getOrInstantiateProvider(e);i!==t?this.show(e,{preserveValue:!0,providerOptions:o}):r.value=e}))),i&&s.add(e.onDidAccept((()=>{this.lastAcceptedPickerValues.set(i,e.value)}))),s}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let i=this.mapProviderToDescriptor.get(t);return i||(i=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,i)),[i,t]}};R3e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([A3e(0,M3e),A3e(1,Hxe)],R3e);var O3e=function(e,t){return function(i,n){t(i,n,e)}};let P3e=class extends qBe{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(R3e))),this._quickAccess}constructor(e,t,i,n,o){super(i),this.instantiationService=e,this.contextKeyService=t,this.accessibilityService=n,this.layoutService=o,this._onShow=this._register(new $we),this._onHide=this._register(new $we),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,isScreenReaderOptimized:()=>this.accessibilityService.isScreenReaderOptimized(),backKeybindingLabel:()=>{},setContextKey:e=>this.setContextKey(e),returnFocus:()=>e.focus(),createList:(e,t,i,n,o)=>this.instantiationService.createInstance(g3e,e,t,i,n,o),styles:this.computeStyles()},n=this._register(new h4e(Object.assign(Object.assign({},i),t)));return n.layout(e.dimension,e.offset.quickPickTop),this._register(e.onDidLayout((t=>n.layout(t,e.offset.quickPickTop)))),this._register(n.onShow((()=>{this.resetContextKeys(),this._onShow.fire()}))),this._register(n.onHide((()=>{this.resetContextKeys(),this._onHide.fire()}))),n}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new bke(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),t&&t.get()||(this.resetContextKeys(),null==t||t.set(!0))}resetContextKeys(){this.contexts.forEach((e=>{e.get()&&e.reset()}))}pick(e,t={},i=nCe.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:uRe(pOe),quickInputForeground:uRe(mOe),quickInputTitleBackground:uRe(fOe),widgetBorder:uRe(yRe),widgetShadow:uRe(CRe)},inputBox:N0e,toggle:E0e,countBadge:T0e,button:L0e,progressBar:D0e,keybindingLabel:k0e,list:A0e({listBackground:pOe,listFocusBackground:mPe,listFocusForeground:gPe,listInactiveFocusForeground:gPe,listInactiveSelectionIconForeground:pPe,listInactiveFocusBackground:mPe,listFocusOutline:bRe,listInactiveFocusOutline:bRe}),pickerGroup:{pickerGroupBorder:uRe(vOe),pickerGroupForeground:uRe(_Oe)}}}};P3e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([O3e(0,Hxe),O3e(1,wke),O3e(2,VBe),O3e(3,Lke),O3e(4,eXe)],P3e);var F3e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},B3e=function(e,t){return function(i,n){t(i,n,e)}};let W3e=class extends P3e{constructor(e,t,i,n,o,s){super(t,i,n,o,new oXe(e.getContainerDomNode(),s)),this.host=void 0;const r=H3e.get(e);if(r){const t=r.widget;this.host={_serviceBrand:void 0,get hasContainer(){return!0},get container(){return t.getDomNode()},get dimension(){return e.getLayoutInfo()},get onDidLayout(){return e.onDidLayoutChange},focus:()=>e.focus(),offset:{top:0,quickPickTop:0}}}else this.host=void 0}createController(){return super.createController(this.host)}};W3e=F3e([B3e(1,Hxe),B3e(2,wke),B3e(3,VBe),B3e(4,Lke),B3e(5,Uxe)],W3e);let V3e=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(W3e,e);this.mapEditorToService.set(e,t),Iwe(e.onDidDispose)((()=>{i.dispose(),this.mapEditorToService.delete(e)}))}return t}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},i=nCe.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};V3e=F3e([B3e(0,Hxe),B3e(1,Uxe)],V3e);class H3e{static get(e){return e.getContribution(H3e.ID)}constructor(e){this.editor=e,this.widget=new z3e(this.editor)}dispose(){this.widget.dispose()}}H3e.ID="editor.controller.quickInput";class z3e{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return z3e.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}z3e.ID="editor.contrib.quickInputWidget",RAe(H3e.ID,H3e,4);class U3e{constructor(e,t,i,n,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=o}}const K3e=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;class j3e{constructor(){this._lastColorId=0,this._id2color=[],this._color2id=new Map}getId(e){if(null===e)return 0;const t=e.match(K3e);if(!t)throw new Error("Illegal value for token color: "+e);e=t[1].toUpperCase();let i=this._color2id.get(e);return i||(i=++this._lastColorId,this._color2id.set(e,i),this._id2color[i]=hRe.fromHex("#"+e),i)}getColorMap(){return this._id2color.slice(0)}}class q3e{static createFromRawTokenTheme(e,t){return this.createFromParsedTokenTheme(function(e){if(!e||!Array.isArray(e))return[];const t=[];let i=0;for(let n=0,o=e.length;n<o;n++){const o=e[n];let s=-1;if("string"==typeof o.fontStyle){s=0;const e=o.fontStyle.split(" ");for(let t=0,i=e.length;t<i;t++)switch(e[t]){case"italic":s|=1;break;case"bold":s|=2;break;case"underline":s|=4;break;case"strikethrough":s|=8}}let r=null;"string"==typeof o.foreground&&(r=o.foreground);let a=null;"string"==typeof o.background&&(a=o.background),t[i++]=new U3e(o.token||"",n,s,r,a)}return t}(e),t)}static createFromParsedTokenTheme(e,t){return function(e,t){e.sort(((e,t)=>{const i=function(e,t){return e<t?-1:e>t?1:0}(e.token,t.token);return 0!==i?i:e.index-t.index}));let i=0,n="000000",o="ffffff";for(;e.length>=1&&""===e[0].token;){const t=e.shift();-1!==t.fontStyle&&(i=t.fontStyle),null!==t.foreground&&(n=t.foreground),null!==t.background&&(o=t.background)}const s=new j3e;for(const e of t)s.getId(e);const r=s.getId(n),a=s.getId(o),l=new G3e(i,r,a),d=new Z3e(l);for(let t=0,i=e.length;t<i;t++){const i=e[t];d.insert(i.token,i.fontStyle,s.getId(i.foreground),s.getId(i.background))}return new q3e(s,d)}(e,t)}constructor(e,t){this._colorMap=e,this._root=t,this._cache=new Map}getColorMap(){return this._colorMap.getColorMap()}_match(e){return this._root.match(e)}match(e,t){let i=this._cache.get(t);if(void 0===i){const e=this._match(t),n=function(e){const t=e.match($3e);if(!t)return 0;switch(t[1]){case"comment":return 1;case"string":return 2;case"regex":case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}(t);i=(e.metadata|n<<8)>>>0,this._cache.set(t,i)}return(i|e)>>>0}}const $3e=/\b(comment|string|regex|regexp)\b/;class G3e{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new G3e(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){-1!==e&&(this._fontStyle=e),0!==t&&(this._foreground=t),0!==i&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class Z3e{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(""===e)return this._mainRule;const t=e.indexOf(".");let i,n;-1===t?(i=e,n=""):(i=e.substring(0,t),n=e.substring(t+1));const o=this._children.get(i);return void 0!==o?o.match(n):this._mainRule}insert(e,t,i,n){if(""===e)return void this._mainRule.acceptOverwrite(t,i,n);const o=e.indexOf(".");let s,r;-1===o?(s=e,r=""):(s=e.substring(0,o),r=e.substring(o+1));let a=this._children.get(s);void 0===a&&(a=new Z3e(this._mainRule.clone()),this._children.set(s,a)),a.insert(r,t,i,n)}}const Y3e={base:"vs",inherit:!1,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"001188"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"FF0000"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"FF0000"},{token:"attribute.value",foreground:"0451A5"},{token:"attribute.value.number",foreground:"098658"},{token:"attribute.value.unit",foreground:"098658"},{token:"attribute.value.html",foreground:"0000FF"},{token:"attribute.value.xml",foreground:"0000FF"},{token:"string",foreground:"A31515"},{token:"string.html",foreground:"0000FF"},{token:"string.sql",foreground:"FF0000"},{token:"string.yaml",foreground:"0451A5"},{token:"keyword",foreground:"0000FF"},{token:"keyword.json",foreground:"0451A5"},{token:"keyword.flow",foreground:"AF00DB"},{token:"keyword.flow.scss",foreground:"0000FF"},{token:"operator.scss",foreground:"666666"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[dOe]:"#FFFFFE",[hOe]:"#000000",[kOe]:"#E5EBF1",[XBe]:"#D3D3D3",[JBe]:"#939393",[LOe]:"#ADD6FF4D"}},Q3e={base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"74B0DF"},{token:"variable.predefined",foreground:"4864AA"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"B5CEA8"},{token:"number.hex",foreground:"5BB498"},{token:"regexp",foreground:"B46695"},{token:"annotation",foreground:"cc6666"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"DCDCDC"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"A79873"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"DD6A6F"},{token:"metatag.content.html",foreground:"9CDCFE"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"},{token:"attribute.value.number.css",foreground:"B5CEA8"},{token:"attribute.value.unit.css",foreground:"B5CEA8"},{token:"attribute.value.hex.css",foreground:"D4D4D4"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.json",foreground:"CE9178"},{token:"keyword.flow.scss",foreground:"569CD6"},{token:"operator.scss",foreground:"909090"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[dOe]:"#1E1E1E",[hOe]:"#D4D4D4",[kOe]:"#3A3D41",[XBe]:"#404040",[JBe]:"#707070",[LOe]:"#ADD6FF26"}},X3e={base:"hc-black",inherit:!1,rules:[{token:"",foreground:"FFFFFF",background:"000000"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"1AEBFF"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"FFFFFF"},{token:"regexp",foreground:"C0C0C0"},{token:"annotation",foreground:"569CD6"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"FFFF00"},{token:"delimiter.html",foreground:"FFFF00"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta",foreground:"D4D4D4"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"569CD6"},{token:"metatag.content.html",foreground:"1AEBFF"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key",foreground:"9CDCFE"},{token:"string.value",foreground:"CE9178"},{token:"attribute.name",foreground:"569CD6"},{token:"attribute.value",foreground:"3FF23F"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[dOe]:"#000000",[hOe]:"#FFFFFF",[XBe]:"#FFFFFF",[JBe]:"#FFFFFF"}},J3e={base:"hc-light",inherit:!1,rules:[{token:"",foreground:"292929",background:"FFFFFF"},{token:"invalid",foreground:"B5200D"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"264F70"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"B5200D"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"264F78"},{token:"attribute.value",foreground:"0451A5"},{token:"string",foreground:"A31515"},{token:"string.sql",foreground:"B5200D"},{token:"keyword",foreground:"0000FF"},{token:"keyword.flow",foreground:"AF00DB"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[dOe]:"#FFFFFF",[hOe]:"#292929",[XBe]:"#292929",[JBe]:"#292929"}};class e6e{getIcon(e){const t=nQe();let i=e.defaults;for(;sAe.isThemeIcon(i);){const e=t.getIcon(i.id);if(!e)return;i=e.defaults}return i}}const t6e="vs",i6e="vs-dark",n6e="hc-black",o6e="hc-light",s6e=RLe.as(gRe),r6e=RLe.as(UBe);class a6e{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(l6e(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,hRe.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=d6e(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,hRe.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){return this.getColors().get(e)||(!1!==t?this.getDefault(e):void 0)}getDefault(e){let t=this.defaultColors[e];return t||(t=s6e.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case t6e:return xFe.LIGHT;case n6e:return xFe.HIGH_CONTRAST_DARK;case o6e:return xFe.HIGH_CONTRAST_LIGHT;default:return xFe.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const i=d6e(this.themeData.base);e=i.rules,i.encodedTokensColors&&(t=i.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const t={token:""};i&&(t.foreground=i),n&&(t.background=n),e.push(t)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=q3e.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const n=this.tokenTheme._match([e].concat(t).join(".")).metadata,o=VNe.getForeground(n),s=VNe.getFontStyle(n);return{foreground:o,italic:Boolean(1&s),bold:Boolean(2&s),underline:Boolean(4&s),strikethrough:Boolean(8&s)}}}function l6e(e){return e===t6e||e===i6e||e===n6e||e===o6e}function d6e(e){switch(e){case t6e:return Y3e;case i6e:return Q3e;case n6e:return X3e;case o6e:return J3e}}function h6e(e){const t=d6e(e);return new a6e(e,t)}const c6e=zxe("themeService");var u6e=function(e,t){return function(i,n){t(i,n,e)}};let g6e=class extends Owe{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new $we,this._onDidChangeReducedMotion=new $we,this._accessibilityModeEnabledContext=Dke.bindTo(this._contextKeyService);const n=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration("editor.accessibilitySupport")&&(n(),this._onDidChangeScreenReaderOptimized.fire()),e.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())}))),n(),this._register(this.onDidChangeScreenReaderOptimized((()=>n())));const o=window.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(o)}initReducedMotionListeners(e){if(!this._layoutService.hasContainer)return;this._register(tMe(e,"change",(()=>{this._systemMotionReduced=e.matches,"auto"===this._configMotionReduced&&this._onDidChangeReducedMotion.fire()})));const t=()=>{const e=this.isMotionReduced();this._layoutService.container.classList.toggle("reduce-motion",e),this._layoutService.container.classList.toggle("enable-motion",!e)};t(),this._register(this.onDidChangeReducedMotion((()=>t())))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return"on"===e||"auto"===e&&2===this._accessibilitySupport}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return"on"===e||"auto"===e&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};g6e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([u6e(0,wke),u6e(1,eXe),u6e(2,SLe)],g6e);var p6e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},m6e=function(e,t){return function(i,n){t(i,n,e)}};let f6e=class{constructor(e,t){this._commandService=e,this._hiddenStates=new _6e(t)}createMenu(e,t,i){return new b6e(e,this._hiddenStates,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},i),this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};f6e=p6e([m6e(0,gAe),m6e(1,y0e)],f6e);let _6e=class e{constructor(t){this._storageService=t,this._disposables=new Rwe,this._onDidChange=new $we,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const i=t.get(e._key,0,"{}");this._data=JSON.parse(i)}catch(e){this._data=Object.create(null)}this._disposables.add(t.onDidChangeValue((i=>{if(i.key===e._key){if(!this._ignoreChangeEvent)try{const i=t.get(e._key,0,"{}");this._data=JSON.parse(i)}catch(e){console.log("FAILED to read storage after UPDATE",e)}this._onDidChange.fire()}})))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){var i;return null!==(i=this._hiddenByDefaultCache.get(`${e.id}/${t}`))&&void 0!==i&&i}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){var i,n;const o=this._isHiddenByDefault(e,t),s=null!==(n=null===(i=this._data[e.id])||void 0===i?void 0:i.includes(t))&&void 0!==n&&n;return o?!s:s}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const n=this._data[e.id];if(i)n?n.indexOf(t)<0&&n.push(t):this._data[e.id]=[t];else if(n){const i=n.indexOf(t);i>=0&&function(e,t){const i=e.length-1;t<i&&(e[t]=e[i]),e.pop()}(n,i),0===n.length&&delete this._data[e.id]}this._persist()}reset(e){if(void 0===e)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const t=JSON.stringify(this._data);this._storageService.store(e._key,t,0,0)}finally{this._ignoreChangeEvent=!1}}};_6e._key="menu.hiddenCommands",_6e=p6e([m6e(0,y0e)],_6e);let v6e=class e{constructor(e,t,i,n,o){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=i,this._commandService=n,this._contextKeyService=o,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const t=SAe.getMenuItems(this._id);let i;t.sort(e._compareMenuItems);for(const e of t){const t=e.group||"";i&&i[0]===t||(i=[t,[]],this._menuGroups.push(i)),i[1].push(e),this._collectContextKeys(e)}}_collectContextKeys(t){if(e._fillInKbExprKeys(t.when,this._structureContextKeys),bAe(t)){if(t.command.precondition&&e._fillInKbExprKeys(t.command.precondition,this._preconditionContextKeys),t.command.toggled){const i=t.command.toggled.condition||t.command.toggled;e._fillInKbExprKeys(i,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&SAe.getMenuItems(t.submenu).forEach(this._collectContextKeys,this)}createActionGroups(t){const i=[];for(const n of this._menuGroups){const[o,s]=n,r=[];for(const i of s)if(this._contextKeyService.contextMatchesRules(i.when)){const n=bAe(i);n&&this._hiddenStates.setDefaultState(this._id,i.command.id,!!i.isHiddenByDefault);const o=w6e(this._id,n?i.command:i,this._hiddenStates);if(n)r.push(new kAe(i.command,i.alt,t,o,this._contextKeyService,this._commandService));else{const n=new e(i.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._contextKeyService).createActionGroups(t),s=dAe.join(...n.map((e=>e[1])));s.length>0&&r.push(new xAe(i,o,s))}}r.length>0&&i.push([o,r])}return i}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}static _compareMenuItems(t,i){const n=t.group,o=i.group;if(n!==o){if(!n)return 1;if(!o)return-1;if("navigation"===n)return-1;if("navigation"===o)return 1;const e=n.localeCompare(o);if(0!==e)return e}const s=t.order||0,r=i.order||0;return s<r?-1:s>r?1:e._compareTitles(bAe(t)?t.command.title:t.title,bAe(i)?i.command.title:i.title)}static _compareTitles(e,t){const i="string"==typeof e?e:e.original,n="string"==typeof t?t:t.original;return i.localeCompare(n)}};v6e=p6e([m6e(3,gAe),m6e(4,wke)],v6e);let b6e=class{constructor(e,t,i,n,o){this._disposables=new Rwe,this._menuInfo=new v6e(e,t,i.emitEventsForSubmenuChanges,n,o);const s=new FDe((()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})}),i.eventDebounceDelay);this._disposables.add(s),this._disposables.add(SAe.onDidChangeMenu((t=>{t.has(e)&&s.schedule()})));const r=this._disposables.add(new Rwe);this._onDidChange=new Xwe({onWillAddFirstListener:()=>{r.add(o.onDidChangeContext((e=>{const t=e.affectsSome(this._menuInfo.structureContextKeys),i=e.affectsSome(this._menuInfo.preconditionContextKeys),n=e.affectsSome(this._menuInfo.toggledContextKeys);(t||i||n)&&this._onDidChange.fire({menu:this,isStructuralChange:t,isEnablementChange:i,isToggleChange:n})}))),r.add(t.onDidChange((e=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})})))},onDidRemoveLastListener:r.clear.bind(r),delay:i.eventDebounceDelay,merge:e=>{let t=!1,i=!1,n=!1;for(const o of e)if(t=t||o.isStructuralChange,i=i||o.isEnablementChange,n=n||o.isToggleChange,t&&i&&n)break;return{menu:this,isStructuralChange:t,isEnablementChange:i,isToggleChange:n}}}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};function w6e(e,t,i){const n=void 0!==t.submenu?t.submenu.id:t.id,o="string"==typeof t.title?t.title:t.title.value,s=uAe({id:`hide/${e.id}/${n}`,label:ove(0,"Hide '{0}'",o),run(){i.updateHidden(e,n,!0)}}),r=uAe({id:`toggle/${e.id}/${n}`,label:o,get checked(){return!i.isHidden(e,n)},run(){i.updateHidden(e,n,!!this.checked)}});return{hide:s,toggle:r,get isHidden(){return!r.checked}}}b6e=p6e([m6e(3,gAe),m6e(4,wke)],b6e);var C6e=function(e,t){return function(i,n){t(i,n,e)}},y6e=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let S6e=class extends Owe{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],(yxe||Sxe)&&this.installWebKitWriteTextWorkaround()}installWebKitWriteTextWorkaround(){const e=()=>{const e=new VDe;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=e,navigator.clipboard.write([new ClipboardItem({"text/plain":e.p})]).catch((t=>y6e(this,void 0,void 0,(function*(){t instanceof Error&&"NotAllowedError"===t.name&&e.isRejected||this.logService.error(t)}))))};this.layoutService.hasContainer&&(this._register(tMe(this.layoutService.container,"click",e)),this._register(tMe(this.layoutService.container,"keydown",e)))}writeText(e,t){return y6e(this,void 0,void 0,(function*(){if(t)return void this.mapTextToType.set(t,e);if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return yield navigator.clipboard.writeText(e)}catch(e){console.error(e)}const i=document.activeElement,n=document.body.appendChild(OMe("textarea",{"aria-hidden":!0}));n.style.height="1px",n.style.width="1px",n.style.position="absolute",n.value=e,n.focus(),n.select(),document.execCommand("copy"),i instanceof HTMLElement&&i.focus(),document.body.removeChild(n)}))}readText(e){return y6e(this,void 0,void 0,(function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(e){return console.error(e),""}}))}readFindText(){return y6e(this,void 0,void 0,(function*(){return this.findText}))}writeFindText(e){return y6e(this,void 0,void 0,(function*(){this.findText=e}))}readResources(){return y6e(this,void 0,void 0,(function*(){return this.resources}))}};S6e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([C6e(0,eXe),C6e(1,yNe)],S6e);const x6e="data-keybinding-context";class k6e{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return Object.assign({},this._value)}setValue(e,t){return this._value[e]!==t&&(this._value[e]=t,!0)}removeValue(e){return e in this._value&&(delete this._value[e],!0)}getValue(e){const t=this._value[e];return void 0===t&&this._parent?this._parent.getValue(e):t}}class L6e extends k6e{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}L6e.INSTANCE=new L6e;class D6e extends k6e{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=hJe.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration((e=>{if(7===e.source){const e=Array.from(this._values,(([e])=>e));this._values.clear(),i.fire(new I6e(e))}else{const t=[];for(const i of e.affectedKeys){const e=`config.${i}`,n=this._values.findSuperstr(e);void 0!==n&&(t.push(...jve.map(n,(([e])=>e))),this._values.deleteSuperstr(e)),this._values.has(e)&&(t.push(e),this._values.delete(e))}i.fire(new I6e(t))}}))}dispose(){this._listener.dispose()}getValue(e){if(0!==e.indexOf(D6e._keyPrefix))return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(D6e._keyPrefix.length),i=this._configurationService.getValue(t);let n;switch(typeof i){case"number":case"boolean":case"string":n=i;break;default:n=Array.isArray(i)?JSON.stringify(i):i}return this._values.set(e,n),n}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}D6e._keyPrefix="config.";class E6e{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){void 0===this._defaultValue?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class N6e{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class I6e{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every((t=>e.has(t)))}}class T6e{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every((t=>t.allKeysContainedIn(e)))}}class M6e{constructor(e){this._onDidChangeContext=new Qwe({merge:e=>new T6e(e)}),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new E6e(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new R6e(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return!e||e.evaluate(t)}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new N6e(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new N6e(e))}getContext(e){return this._isDisposed?L6e.INSTANCE:this.getContextValuesContainer(function(e){for(;e;){if(e.hasAttribute(x6e)){const t=e.getAttribute(x6e);return t?parseInt(t,10):NaN}e=e.parentElement}return 0}(e))}}let A6e=class extends M6e{constructor(e){super(0),this._contexts=new Map,this._toDispose=new Rwe,this._lastContextId=0;const t=new D6e(this._myContextId,e,this._onDidChangeContext);this._contexts.set(this._myContextId,t),this._toDispose.add(t)}dispose(){this._onDidChangeContext.dispose(),this._isDisposed=!0,this._toDispose.dispose()}getContextValuesContainer(e){return this._isDisposed?L6e.INSTANCE:this._contexts.get(e)||L6e.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new k6e(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};A6e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,SLe)],A6e);class R6e extends M6e{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=new Pwe,this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(x6e)){let e="";this._domNode.classList&&(e=Array.from(this._domNode.classList.values()).join(", ")),console.error("Element already has context attribute"+(e?": "+e:""))}this._domNode.setAttribute(x6e,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext((e=>{var t;t=this._parent.getContextValuesContainer(this._myContextId).value,e.allKeysContainedIn(new Set(Object.keys(t)))||this._onDidChangeContext.fire(e)}))}dispose(){this._isDisposed||(this._onDidChangeContext.dispose(),this._parent.disposeContext(this._myContextId),this._parentChangeListener.dispose(),this._domNode.removeAttribute(x6e),this._isDisposed=!0)}getContextValuesContainer(e){return this._isDisposed?L6e.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}pAe.registerCommand("_setContext",(function(e,t,i){e.get(wke).createKey(String(t),function(e){return Tbe(e,(e=>"object"==typeof e&&1===e.$mid?QCe.revive(e).toString():e instanceof QCe?e.toString():void 0))}(i))})),pAe.registerCommand({id:"getContextKeyInfo",handler:()=>[...bke.all()].sort(((e,t)=>e.key.localeCompare(t.key))),description:{description:ove(0,"A command that returns information about context keys"),args:[]}}),pAe.registerCommand("_generateContextKeyInfo",(function(){const e=[],t=new Set;for(const i of bke.all())t.has(i.key)||(t.add(i.key),e.push(i));e.sort(((e,t)=>e.key.localeCompare(t.key))),console.log(JSON.stringify(e,void 0,2))}));class O6e{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}}class P6e{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())0===t.outgoing.size&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),n=this.lookupOrInsertNode(t);i.outgoing.set(n.key,n),n.incoming.set(i.key,i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const e of this._nodes.values())e.outgoing.delete(t),e.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new O6e(t,e),this._nodes.set(t,i)),i}isEmpty(){return 0===this._nodes.size}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t}\n\t(-> incoming)[${[...i.incoming.keys()].join(", ")}]\n\t(outgoing ->)[${[...i.outgoing.keys()].join(",")}]\n`);return e.join("\n")}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(const[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const e=this._findCycle(n,t);if(e)return e;t.delete(i)}}}class F6e extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=null!==(t=e.findCycleSlow())&&void 0!==t?t:`UNABLE to detect cycle, dumping graph: \n${e.toString()}`}}class B6e{constructor(e=new C$e,t=!1,i,n=!1){var o;this._services=e,this._strict=t,this._parent=i,this._enableTracing=n,this._activeInstantiations=new Set,this._services.set(Hxe,this),this._globalGraph=n?null!==(o=null==i?void 0:i._globalGraph)&&void 0!==o?o:new P6e((e=>e)):void 0}createChild(e){return new B6e(e,this._strict,this,this._enableTracing)}invokeFunction(e,...t){const i=W6e.traceInvocation(this._enableTracing,e);let n=!1;try{const o={get:e=>{if(n)throw"service accessor is only valid during the invocation of its target method"?new Error("Illegal state: service accessor is only valid during the invocation of its target method"):new Error("Illegal state");const t=this._getOrCreateServiceInstance(e,i);if(!t)throw new Error(`[invokeFunction] unknown service '${e}'`);return t}};return e(o,...t)}finally{n=!0,i.stop()}}createInstance(e,...t){let i,n;return e instanceof ILe?(i=W6e.traceCreation(this._enableTracing,e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=W6e.traceCreation(this._enableTracing,e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){const n=Vxe.getServiceDependencies(e).sort(((e,t)=>e.index-t.index)),o=[];for(const t of n){const n=this._getOrCreateServiceInstance(t.id,i);n||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id}.`,!1),o.push(n)}const s=n.length>0?n[0].index:t.length;if(t.length!==s){console.trace(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${t.length} static arguments`);const i=s-t.length;t=i>0?t.concat(new Array(i)):t.slice(0,s)}return Reflect.construct(e,t.concat(o))}_setServiceInstance(e,t){if(this._services.get(e)instanceof ILe)this._services.set(e,t);else{if(!this._parent)throw new Error("illegalState - setting UNKNOWN service instance");this._parent._setServiceInstance(e,t)}}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof ILe?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){var n;const o=new P6e((e=>e.id.toString()));let s=0;const r=[{id:e,desc:t,_trace:i}];for(;r.length;){const t=r.pop();if(o.lookupOrInsertNode(t),s++>1e3)throw new F6e(o);for(const i of Vxe.getServiceDependencies(t.desc.ctor)){const s=this._getServiceInstanceOrDescriptor(i.id);if(s||this._throwIfStrict(`[createInstance] ${e} depends on ${i.id} which is NOT registered.`,!0),null===(n=this._globalGraph)||void 0===n||n.insertEdge(String(t.id),String(i.id)),s instanceof ILe){const e={id:i.id,desc:s,_trace:t._trace.branch(i.id,!0)};o.insertEdge(t,e),r.push(e)}}}for(;;){const e=o.roots();if(0===e.length){if(!o.isEmpty())throw new F6e(o);break}for(const{data:t}of e){if(this._getServiceInstanceOrDescriptor(t.id)instanceof ILe){const e=this._createServiceInstanceWithOwner(t.id,t.desc.ctor,t.desc.staticArguments,t.desc.supportsDelayedInstantiation,t._trace);this._setServiceInstance(t.id,e)}o.removeNode(t)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,o){if(this._services.get(e)instanceof ILe)return this._createServiceInstance(e,t,i,n,o);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,n,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],n,o){if(n){const n=new B6e(void 0,this._strict,this,this._enableTracing);n._globalGraphImplicitDependency=String(e);const s=new Map,r=new WDe((()=>{const e=n._createInstance(t,i,o);for(const[t,i]of s){const n=e[t];if("function"==typeof n)for(const t of i)n.apply(e,t)}return s.clear(),e}));return new Proxy(Object.create(null),{get(e,t){if(!r.isInitialized&&"string"==typeof t&&(t.startsWith("onDid")||t.startsWith("onWill"))){let e=s.get(t);return e||(e=new $ve,s.set(t,e)),(t,i,n)=>Awe(e.push([t,i,n]))}if(t in e)return e[t];const i=r.value;let n=i[t];return"function"!=typeof n||(n=n.bind(i),e[t]=n),n},set:(e,t,i)=>(r.value[t]=i,!0),getPrototypeOf:e=>t.prototype})}return this._createInstance(t,i,o)}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}class W6e{static traceInvocation(e,t){return e?new W6e(2,t.name||(new Error).stack.split("\n").slice(3,4).join("\n")):W6e._None}static traceCreation(e,t){return e?new W6e(1,t.name):W6e._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new W6e(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;W6e._totals+=e;let t=!1;const i=[`${1===this.type?"CREATE":"CALL"} ${this.name}`,`${function e(i,n){const o=[],s=new Array(i+1).join("\t");for(const[r,a,l]of n._dep)if(a&&l){t=!0,o.push(`${s}CREATES -> ${r}`);const n=e(i+1,l);n&&o.push(n)}else o.push(`${s}uses -> ${r}`);return o.join("\n")}(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${W6e._totals.toFixed(2)}ms)`];(e>2||t)&&W6e.all.add(i.join("\n"))}}W6e.all=new Set,W6e._None=new class extends W6e{constructor(){super(0,null)}stop(){}branch(){return this}},W6e._totals=0;const V6e=new Set([$Te.inMemory,$Te.vscodeSourceControl,$Te.walkThrough,$Te.walkThroughSnippet]);class H6e{constructor(){this._byResource=new NGe,this._byOwner=new Map}set(e,t,i){let n=this._byResource.get(e);n||(n=new Map,this._byResource.set(e,n)),n.set(t,i);let o=this._byOwner.get(t);o||(o=new NGe,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){const i=this._byResource.get(e);return null==i?void 0:i.get(t)}delete(e,t){let i=!1,n=!1;const o=this._byResource.get(e);o&&(i=o.delete(t));const s=this._byOwner.get(t);if(s&&(n=s.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){var t,i,n,o;return"string"==typeof e?null!==(i=null===(t=this._byOwner.get(e))||void 0===t?void 0:t.values())&&void 0!==i?i:jve.empty():QCe.isUri(e)?null!==(o=null===(n=this._byResource.get(e))||void 0===n?void 0:n.values())&&void 0!==o?o:jve.empty():jve.map(jve.concat(...this._byOwner.values()),(e=>e[1]))}}class z6e{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new NGe,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const e=this._data.get(t);e&&this._substract(e);const i=this._resourceStats(t);this._add(i),this._data.set(t,i)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(V6e.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===l1e.Error?t.errors+=1:i===l1e.Warning?t.warnings+=1:i===l1e.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class U6e{constructor(){this._onMarkerChanged=new Xwe({delay:0,merge:U6e._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new H6e,this._stats=new z6e(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(n=i,Array.isArray(n)&&0!==n.length){const n=[];for(const o of i){const i=U6e._toMarker(e,t,o);i&&n.push(i)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}else this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);var n}static _toMarker(e,t,i){let{code:n,severity:o,message:s,source:r,startLineNumber:a,startColumn:l,endLineNumber:d,endColumn:h,relatedInformation:c,tags:u}=i;if(s)return a=a>0?a:1,l=l>0?l:1,d=d>=a?d:a,h=h>0?h:l,{resource:t,owner:e,code:n,severity:o,message:s,source:r,startLineNumber:a,startColumn:l,endLineNumber:d,endColumn:h,relatedInformation:c,tags:u}}changeAll(e,t){const i=[],n=this._data.values(e);if(n)for(const t of n){const n=jve.first(t);n&&(i.push(n.resource),this._data.delete(n.resource,e))}if(ibe(t)){const n=new NGe;for(const{resource:o,marker:s}of t){const t=U6e._toMarker(e,o,s);if(!t)continue;const r=n.get(o);r?r.push(t):(n.set(o,[t]),i.push(o))}for(const[t,i]of n)this._data.set(t,e,i)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const e=this._data.get(i,t);if(e){const t=[];for(const i of e)if(U6e._accept(i,n)){const e=t.push(i);if(o>0&&e===o)break}return t}return[]}if(t||i){const e=this._data.values(null!=i?i:t),s=[];for(const t of e)for(const e of t)if(U6e._accept(e,n)){const t=s.push(e);if(o>0&&t===o)return s}return s}{const e=[];for(const t of this._data.values())for(const i of t)if(U6e._accept(i,n)){const t=e.push(i);if(o>0&&t===o)return e}return e}}static _accept(e,t){return void 0===t||(t&e.severity)===e.severity}static _merge(e){const t=new NGe;for(const i of e)for(const e of i)t.set(e,!0);return Array.from(t.keys())}}function K6e(e,t,i,n,o,s){if(Array.isArray(e)){let r=0;for(const a of e){const e=K6e(a,t,i,n,o,s);if(10===e)return e;e>r&&(r=e)}return r}if("string"==typeof e)return n?"*"===e?5:e===i?10:0:0;if(e){const{language:l,pattern:d,scheme:h,hasAccessToAllModels:c,notebookType:u}=e;if(!n&&!c)return 0;u&&o&&(t=o);let g=0;if(h)if(h===t.scheme)g=10;else{if("*"!==h)return 0;g=5}if(l)if(l===i)g=10;else{if("*"!==l)return 0;g=Math.max(g,5)}if(u)if(u===s)g=10;else{if("*"!==u||void 0===s)return 0;g=Math.max(g,5)}if(d){let e;if(e="string"==typeof d?d:Object.assign(Object.assign({},d),{base:FCe(d.base)}),e!==t.fsPath&&(r=e,a=t.fsPath,!r||"string"!=typeof a||!YJe(r)(a,void 0,undefined)))return 0;g=10}return g}return 0;var r,a}function j6e(e){return"string"!=typeof e&&(Array.isArray(e)?e.every(j6e):!!e.exclusive)}class q6e{constructor(e,t,i,n){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=n}equals(e){var t,i;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&(null===(t=this.notebookUri)||void 0===t?void 0:t.toString())===(null===(i=e.notebookUri)||void 0===i?void 0:i.toString())}}class $6e{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new $we,this.onDidChange=this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),Awe((()=>{if(i){const e=this._entries.indexOf(i);e>=0&&(this._entries.splice(e,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}}))}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const e of this._entries)e._score>0&&t.push(e.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,(e=>t.push(e.provider))),t}orderedGroups(e){const t=[];let i,n;return this._orderedForEach(e,(e=>{i&&n===e._score?i.push(e.provider):(n=e._score,i=[e.provider],t.push(i))})),t}_orderedForEach(e,t){this._updateScores(e);for(const e of this._entries)e._score>0&&t(e)}_updateScores(e){var t,i;const n=null===(t=this._notebookInfoResolver)||void 0===t?void 0:t.call(this,e.uri),o=n?new q6e(e.uri,e.getLanguageId(),n.uri,n.type):new q6e(e.uri,e.getLanguageId(),void 0,void 0);if(!(null===(i=this._lastCandidate)||void 0===i?void 0:i.equals(o))){this._lastCandidate=o;for(const t of this._entries)if(t._score=K6e(t.selector,o.uri,o.languageId,Hke(e),o.notebookUri,o.notebookType),j6e(t.selector)&&t._score>0){for(const e of this._entries)e._score=0;t._score=1e3;break}this._entries.sort($6e._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._score<t._score?1:e._score>t._score?-1:e._time<t._time?1:e._time>t._time?-1:0}}MLe(ENe,class{constructor(){this.referenceProvider=new $6e(this._score.bind(this)),this.renameProvider=new $6e(this._score.bind(this)),this.codeActionProvider=new $6e(this._score.bind(this)),this.definitionProvider=new $6e(this._score.bind(this)),this.typeDefinitionProvider=new $6e(this._score.bind(this)),this.declarationProvider=new $6e(this._score.bind(this)),this.implementationProvider=new $6e(this._score.bind(this)),this.documentSymbolProvider=new $6e(this._score.bind(this)),this.inlayHintsProvider=new $6e(this._score.bind(this)),this.colorProvider=new $6e(this._score.bind(this)),this.codeLensProvider=new $6e(this._score.bind(this)),this.documentFormattingEditProvider=new $6e(this._score.bind(this)),this.documentRangeFormattingEditProvider=new $6e(this._score.bind(this)),this.onTypeFormattingEditProvider=new $6e(this._score.bind(this)),this.signatureHelpProvider=new $6e(this._score.bind(this)),this.hoverProvider=new $6e(this._score.bind(this)),this.documentHighlightProvider=new $6e(this._score.bind(this)),this.selectionRangeProvider=new $6e(this._score.bind(this)),this.foldingRangeProvider=new $6e(this._score.bind(this)),this.linkProvider=new $6e(this._score.bind(this)),this.inlineCompletionsProvider=new $6e(this._score.bind(this)),this.completionProvider=new $6e(this._score.bind(this)),this.linkedEditingRangeProvider=new $6e(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new $6e(this._score.bind(this)),this.documentSemanticTokensProvider=new $6e(this._score.bind(this)),this.documentOnDropEditProvider=new $6e(this._score.bind(this)),this.documentPasteEditProvider=new $6e(this._score.bind(this))}_score(e){var t;return null===(t=this._notebookTypeResolver)||void 0===t?void 0:t.call(this,e)}},1);class G6e extends Owe{constructor(){super(...arguments),this._configurationModel=new FXe}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new FXe;const e=RLe.as(BLe).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const n of e){const e=i[n],o=t[n];void 0!==e?this._configurationModel.addValue(n,e):o?this._configurationModel.addValue(n,o.default):this._configurationModel.removeValue(n)}}}class Z6e extends Owe{constructor(e,t=[]){super(),this.logger=new DNe([e,...t]),this._register(e.onDidChangeLogLevel((e=>this.setLevel(e))))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}error(e,...t){this.logger.error(e,...t)}}var Y6e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Q6e=function(e,t){return function(i,n){t(i,n,e)}},X6e=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class J6e{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new $we}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let e9e=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new Bwe(new J6e(t))):Promise.reject(new Error("Model not found"))}};e9e=Y6e([Q6e(0,xDe)],e9e);class t9e{show(){return t9e.NULL_PROGRESS_RUNNER}showWhile(e,t){return X6e(this,void 0,void 0,(function*(){yield e}))}}t9e.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class i9e{info(e){return this.notify({severity:S$e.Info,message:e})}warn(e){return this.notify({severity:S$e.Warning,message:e})}error(e){return this.notify({severity:S$e.Error,message:e})}notify(e){switch(e.severity){case S$e.Error:console.error(e.message);break;case S$e.Warning:console.warn(e.message);break;default:console.log(e.message)}return i9e.NO_OP}prompt(e,t,i,n){return i9e.NO_OP}status(e,t){return Owe.None}}i9e.NO_OP=new class{};let n9e=class{constructor(e){this._onWillExecuteCommand=new $we,this._onDidExecuteCommand=new $we,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=pAe.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const n=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(e){return Promise.reject(e)}}};n9e=Y6e([Q6e(0,Hxe)],n9e);let o9e=class extends UXe{constructor(e,t,i,n,o,s){super(e,t,i,n,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const r=e=>{const t=new Rwe;t.add(tMe(e,LMe.KEY_DOWN,(e=>{const t=new KIe(e);this._dispatch(t,t.target)&&(t.preventDefault(),t.stopPropagation())}))),t.add(tMe(e,LMe.KEY_UP,(e=>{const t=new KIe(e);this._singleModifierDispatch(t,t.target)&&t.preventDefault()}))),this._domNodeListeners.push(new s9e(e,t))},a=e=>{for(let t=0;t<this._domNodeListeners.length;t++){const i=this._domNodeListeners[t];i.domNode===e&&(this._domNodeListeners.splice(t,1),i.dispose())}},l=e=>{e.getOption(58)||r(e.getContainerDomNode())};this._register(s.onCodeEditorAdd(l)),this._register(s.onCodeEditorRemove((e=>{e.getOption(58)||a(e.getContainerDomNode())}))),s.listCodeEditors().forEach(l);const d=e=>{r(e.getContainerDomNode())};this._register(s.onDiffEditorAdd(d)),this._register(s.onDiffEditorRemove((e=>{a(e.getContainerDomNode())}))),s.listDiffEditors().forEach(d)}addDynamicKeybinding(e,t,i,n){return Mwe(pAe.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){const t=e.map((e=>{var t;return{keybinding:PIe(e.keybinding,Fve),command:null!==(t=e.command)&&void 0!==t?t:null,commandArgs:e.commandArgs,when:e.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}}));return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),Awe((()=>{for(let e=0;e<this._dynamicKeybindings.length;e++)if(this._dynamicKeybindings[e]===t[0])return this._dynamicKeybindings.splice(e,t.length),void this.updateResolver()}))}updateResolver(){this._cachedResolver=null,this._onDidUpdateKeybindings.fire()}_getResolver(){if(!this._cachedResolver){const e=this._toNormalizedKeybindingItems(fAe.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new qXe(e,t,(e=>this._log(e)))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const o of e){const e=o.when||void 0,s=o.keybinding;if(s){const r=nJe.resolveKeybinding(s,Fve);for(const s of r)i[n++]=new ZXe(s,o.command,o.commandArgs,e,t,null,!1)}else i[n++]=new ZXe(void 0,o.command,o.commandArgs,e,t,null,!1)}return i}resolveKeyboardEvent(e){const t=new BIe(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new nJe([t],Fve)}};o9e=Y6e([Q6e(0,wke),Q6e(1,gAe),Q6e(2,LAe),Q6e(3,k$e),Q6e(4,yNe),Q6e(5,Uxe)],o9e);class s9e extends Owe{constructor(e,t){super(),this.domNode=e,this._register(t)}}function r9e(e){return e&&"object"==typeof e&&(!e.overrideIdentifier||"string"==typeof e.overrideIdentifier)&&(!e.resource||e.resource instanceof QCe)}class a9e{constructor(){this._onDidChangeConfiguration=new $we,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new G6e;this._configuration=new VXe(e.reload(),new FXe,new FXe,new FXe),e.dispose()}getValue(e,t){const i="string"==typeof e?e:void 0,n=r9e(e)?e:r9e(t)?t:{};return this._configuration.getValue(i,n,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const t of e){const[e,n]=t;this.getValue(e)!==n&&(this._configuration.updateValue(e,n),i.push(e))}if(i.length>0){const e=new HXe({keys:i,overrides:[]},t,this._configuration);e.source=8,e.sourceConfig=null,this._onDidChangeConfiguration.fire(e)}return Promise.resolve()}updateValue(e,t,i,n){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}}let l9e=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new $we,this.configurationService.onDidChangeConfiguration((e=>{this._onDidChangeConfiguration.fire({affectedKeys:e.affectedKeys,affectsConfiguration:(t,i)=>e.affectsConfiguration(i)})}))}getValue(e,t,i){const n=lye.isIPosition(t)?t:null,o=n?"string"==typeof i?i:void 0:"string"==typeof t?t:void 0,s=e?this.getLanguage(e,n):void 0;return void 0===o?this.configurationService.getValue({resource:e,overrideIdentifier:s}):this.configurationService.getValue(o,{resource:e,overrideIdentifier:s})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};l9e=Y6e([Q6e(0,SLe),Q6e(1,xDe),Q6e(2,NLe)],l9e);let d9e=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&"string"==typeof i&&"auto"!==i?i:Eve||Dve?"\n":"\r\n"}};d9e=Y6e([Q6e(0,SLe)],d9e);class h9e{constructor(){const e=QCe.from({scheme:h9e.SCHEME,authority:"model",path:"/"});this.workspace={id:"4064f6ec-cb38-4ad0-af64-ee6467e63c82",folders:[new uJe({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===h9e.SCHEME?this.workspace.folders[0]:null}}function c9e(e,t,i){if(!t)return;if(!(e instanceof a9e))return;const n=[];Object.keys(t).forEach((e=>{(function(e){return RXe()[`editor.${e}`]||!1})(e)&&n.push([`editor.${e}`,t[e]]),i&&function(e){return RXe()[`diffEditor.${e}`]||!1}(e)&&n.push([`diffEditor.${e}`,t[e]])})),n.length>0&&e.updateValues(n)}h9e.SCHEME="inmemory";let u9e=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return X6e(this,void 0,void 0,(function*(){const t=Array.isArray(e)?e:DXe.convert(e),i=new Map;for(const e of t){if(!(e instanceof EXe))throw new Error("bad edit - only text edits are supported");const t=this._modelService.getModel(e.resource);if(!t)throw new Error("bad edit - model not found");if("number"==typeof e.versionId&&t.getVersionId()!==e.versionId)throw new Error("bad state - model changed in the meantime");let n=i.get(t);n||(n=[],i.set(t,n)),n.push(OXe.replaceMove(dye.lift(e.textEdit.range),e.textEdit.text))}let n=0,o=0;for(const[e,t]of i)e.pushStackElement(),e.pushEditOperations([],t,(()=>[])),e.pushStackElement(),o+=1,n+=t.length;return{ariaSummary:CSe(CJe.bulkEditServiceSummary,n,o),isApplied:n>0}}))}};u9e=Y6e([Q6e(0,xDe)],u9e);let g9e=class extends NJe{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const e=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();e&&(t=e.getContainerDomNode())}return super.showContextView(e,t,i)}};g9e=Y6e([Q6e(0,eXe),Q6e(1,Uxe)],g9e);let p9e=class extends J0e{constructor(e,t,i,n,o,s){super(e,t,i,n,o,s),this.configure({blockMouse:!1})}};var m9e;p9e=Y6e([Q6e(0,LAe),Q6e(1,k$e),Q6e(2,CQe),Q6e(3,jXe),Q6e(4,CAe),Q6e(5,wke)],p9e),MLe(SLe,a9e,0),MLe(wNe,l9e,0),MLe(CNe,d9e,0),MLe(cJe,h9e,0),MLe(oJe,class{getUriLabel(e,t){return"file"===e.scheme?e.fsPath:e.path}getUriBasenameLabel(e){return sKe(e)}},0),MLe(LAe,class{publicLog(e,t){return Promise.resolve(void 0)}publicLog2(e,t){return this.publicLog(e,t)}},0),MLe(sXe,class{confirm(e){return this.doConfirm(e).then((e=>({confirmed:e,checkboxChecked:!1})))}doConfirm(e){let t=e.message;return e.detail&&(t=t+"\n\n"+e.detail),Promise.resolve(window.confirm(t))}show(e,t,i,n){return Promise.resolve({choice:0})}},0),MLe(k$e,i9e,0),MLe(h1e,U6e,0),MLe(NLe,class extends a0e{constructor(){super()}},0),MLe(c6e,class extends Owe{constructor(){super(),this._onColorThemeChange=this._register(new $we),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new $we),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new e6e,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(t6e,h6e(t6e)),this._knownThemes.set(i6e,h6e(i6e)),this._knownThemes.set(n6e,h6e(n6e)),this._knownThemes.set(o6e,h6e(o6e));const e=function(e){const t=new $we,i=nQe();return i.onDidChange((()=>t.fire())),null==e||e.onDidProductIconThemeChange((()=>t.fire())),{onDidChange:t.event,getCSS(){const t=e?e.getProductIconTheme():new e6e,n={},o=e=>{const i=t.getIcon(e);if(!i)return;const o=i.font;return o?(n[o.id]=o.definition,`.codicon-${e.id}:before { content: '${i.fontCharacter}'; font-family: ${HMe(o.id)}; }`):`.codicon-${e.id}:before { content: '${i.fontCharacter}'; }`},s=[];for(const e of i.getIcons()){const t=o(e);t&&s.push(t)}for(const e in n){const t=n[e],i=t.weight?`font-weight: ${t.weight};`:"",o=t.style?`font-style: ${t.style};`:"",r=t.src.map((e=>`${VMe(e.location)} format('${e.format}')`)).join(", ");s.push(`@font-face { src: ${r}; font-family: ${HMe(e)};${i}${o} font-display: block; }`)}return s.join("\n")}}}(this);this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(t6e),this._onOSSchemeChanged(),e.onDidChange((()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),mxe("(forced-colors: active)",(()=>{this._onOSSchemeChanged()}))}registerEditorContainer(e){return bMe(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=yMe(),this._globalStyleElement.className="monaco-colors",this._globalStyleElement.textContent=this._allCSS,this._styleElements.push(this._globalStyleElement)),Owe.None}_registerShadowDomContainer(e){const t=yMe(e);return t.className="monaco-colors",t.textContent=this._allCSS,this._styleElements.push(t),{dispose:()=>{for(let e=0;e<this._styleElements.length;e++)if(this._styleElements[e]===t)return void this._styleElements.splice(e,1)}}}defineTheme(e,t){if(!/^[a-z0-9\-]+$/i.test(e))throw new Error("Illegal theme name!");if(!l6e(t.base)&&!l6e(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new a6e(e,t)),l6e(e)&&this._knownThemes.forEach((t=>{t.base===e&&t.notifyBaseUpdated()})),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;t=this._knownThemes.has(e)?this._knownThemes.get(e):this._knownThemes.get(t6e),this._updateActualTheme(t)}_updateActualTheme(e){e&&this._theme!==e&&(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=window.matchMedia("(forced-colors: active)").matches;if(e!==kFe(this._theme.type)){let t;t=LFe(this._theme.type)?e?n6e:i6e:e?o6e:t6e,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:i=>{t[i]||(e.push(i),t[i]=!0)}};r6e.getThemingParticipants().forEach((e=>e(this._theme,i,this._environment)));const n=[];for(const e of s6e.getColors()){const t=this._theme.getColor(e.id,!0);t&&n.push(`${cRe(e.id)}: ${t.toString()};`)}i.addRule(`.monaco-editor { ${n.join("\n")} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(function(e){const t=[];for(let i=1,n=e.length;i<n;i++){const n=e[i];t[i]=`.mtk${i} { color: ${n}; }`}return t.push(".mtki { font-style: italic; }"),t.push(".mtkb { font-weight: bold; }"),t.push(".mtku { text-decoration: underline; text-underline-position: under; }"),t.push(".mtks { text-decoration: line-through; }"),t.push(".mtks.mtku { text-decoration: underline line-through; text-underline-position: under; }"),t.join("\n")}(o)),this._themeCSS=e.join("\n"),this._updateCSS(),Eye.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._styleElements.forEach((e=>e.textContent=this._allCSS))}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}},0),MLe(yNe,class extends Z6e{constructor(){super(new LNe)}},0),MLe(xDe,B1e,0),MLe(iAe,g1e,0),MLe(wke,A6e,0),MLe(SQe,class{withProgress(e,t,i){return t({report:()=>{}})}},0),MLe(xQe,t9e,0),MLe(y0e,class extends x0e{constructor(){super(),this.applicationStorage=this._register(new b0e(new w0e,{hint:f0e.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new b0e(new w0e,{hint:f0e.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new b0e(new w0e,{hint:f0e.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage((e=>this.emitDidChangeValue(1,e)))),this._register(this.profileStorage.onDidChangeStorage((e=>this.emitDidChangeValue(0,e)))),this._register(this.applicationStorage.onDidChangeStorage((e=>this.emitDidChangeValue(-1,e))))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}},0),MLe(vQe,MNe,0),MLe(LXe,u9e,0),MLe(yJe,class{constructor(){this._neverEmitter=new $we,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}},0),MLe(nAe,e9e,0),MLe(Lke,g6e,0),MLe(R5e,class{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new Rwe,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,i;e!==this._lastFocusedWidget&&(null===(t=this._lastFocusedWidget)||void 0===t||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,null===(i=this._lastFocusedWidget)||void 0===i||i.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new EYe(yMe(),"").style(M0e)),this.lists.some((t=>t.widget===e)))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),e.getHTMLElement()===document.activeElement&&this.setLastFocusedList(e),Mwe(e.onDidFocus((()=>this.setLastFocusedList(e))),Awe((()=>this.lists.splice(this.lists.indexOf(i),1))),e.onDidDispose((()=>{this.lists=this.lists.filter((e=>e!==i)),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)})))}dispose(){this.disposables.dispose()}},0),MLe(gAe,n9e,0),MLe(jXe,o9e,0),MLe(M3e,V3e,0),MLe(CQe,g9e,0),MLe(bXe,a1e,0),MLe(wQe,S6e,0),MLe(yQe,p9e,0),MLe(CAe,f6e,0),MLe(Gxe,class{playAudioCue(e,t){return X6e(this,void 0,void 0,(function*(){}))}},0),function(e){const t=new C$e;for(const[e,i]of ALe())t.set(e,i);const i=new B6e(t,!0);t.set(Hxe,i),e.get=function(e){const n=t.get(e);if(!n)throw new Error("Missing service "+e);return n instanceof ILe?i.invokeFunction((t=>t.get(e))):n};let n=!1;e.initialize=function(e){if(n)return i;n=!0;for(const[e,i]of ALe())t.get(e)||t.set(e,i);for(const i in e)if(e.hasOwnProperty(i)){const n=zxe(i);t.get(n)instanceof ILe&&t.set(n,e[i])}return i}}(m9e||(m9e={}));var f9e=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},_9e=function(e,t){return function(i,n){t(i,n,e)}};let v9e=0,b9e=!1;let w9e=class extends Q$e{constructor(e,t,i,n,o,s,r,a,l,d,h,c){const u=Object.assign({},t);u.ariaLabel=u.ariaLabel||bJe.editorViewAccessibleLabel,u.ariaLabel=u.ariaLabel+";"+bJe.accessibilityHelpMessage,super(e,u,{},i,n,o,s,a,l,d,h,c),this._standaloneKeybindingService=r instanceof o9e?r:null,function(e){if(!e){if(b9e)return;b9e=!0}!function(e){GMe=document.createElement("div"),GMe.className="monaco-aria-container";const t=()=>{const e=document.createElement("div");return e.className="monaco-alert",e.setAttribute("role","alert"),e.setAttribute("aria-atomic","true"),GMe.appendChild(e),e};ZMe=t(),YMe=t();const i=()=>{const e=document.createElement("div");return e.className="monaco-status",e.setAttribute("role","complementary"),e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true"),GMe.appendChild(e),e};QMe=i(),XMe=i(),e.appendChild(GMe)}(e||document.body)}(u.ariaContainerElement)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const n="DYNAMIC_"+ ++v9e,o=Jxe.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,o),n}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),Owe.None;const t=e.id,i=e.label,n=Jxe.and(Jxe.equals("editorId",this.getId()),Jxe.deserialize(e.precondition)),o=e.keybindings,s=Jxe.and(n,Jxe.deserialize(e.keybindingContext)),r=e.contextMenuGroupId||null,a=e.contextMenuOrder||0,l=(t,...i)=>Promise.resolve(e.run(this,...i)),d=new Rwe,h=this.getId()+":"+t;if(d.add(pAe.registerCommand(h,l)),r){const e={command:{id:h,title:i},when:n,group:r,order:a};d.add(SAe.appendMenuItem(wAe.EditorContext,e))}if(Array.isArray(o))for(const e of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(h,e,l,s));const c=new Bze(h,i,i,n,l,this._contextKeyService);return this._actions.set(t,c),d.add(Awe((()=>{this._actions.delete(t)}))),d}_triggerCommand(e,t){if(this._codeEditorService instanceof JQe)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};w9e=f9e([_9e(2,Hxe),_9e(3,Uxe),_9e(4,gAe),_9e(5,wke),_9e(6,jXe),_9e(7,VBe),_9e(8,k$e),_9e(9,Lke),_9e(10,dDe),_9e(11,ENe)],w9e);let C9e=class extends w9e{constructor(e,t,i,n,o,s,r,a,l,d,h,c,u,g,p){const m=Object.assign({},t);c9e(d,m,!1);const f=a.registerEditorContainer(e);"string"==typeof m.theme&&a.setTheme(m.theme),void 0!==m.autoDetectHighContrast&&a.setAutoDetectHighContrast(Boolean(m.autoDetectHighContrast));const _=m.model;let v;if(delete m.model,super(e,m,i,n,o,s,r,a,l,h,g,p),this._configurationService=d,this._standaloneThemeService=a,this._register(f),void 0===_){const e=u.getLanguageIdByMimeType(m.language)||m.language||tDe;v=S9e(c,u,m.value||"",e,void 0),this._ownsModel=!0}else v=_,this._ownsModel=!1;if(this._attachModel(v),v){const e={oldModelUrl:null,newModelUrl:v.uri};this._onDidChangeModel.fire(e)}}dispose(){super.dispose()}updateOptions(e){c9e(this._configurationService,e,!1),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};C9e=f9e([_9e(2,Hxe),_9e(3,Uxe),_9e(4,gAe),_9e(5,wke),_9e(6,jXe),_9e(7,c6e),_9e(8,k$e),_9e(9,SLe),_9e(10,Lke),_9e(11,xDe),_9e(12,NLe),_9e(13,dDe),_9e(14,ENe)],C9e);let y9e=class extends AQe{constructor(e,t,i,n,o,s,r,a,l,d,h){const c=Object.assign({},t);c9e(a,c,!0);const u=s.registerEditorContainer(e);"string"==typeof c.theme&&s.setTheme(c.theme),void 0!==c.autoDetectHighContrast&&s.setAutoDetectHighContrast(Boolean(c.autoDetectHighContrast)),super(e,c,{},h,n,i,o,s,r,l,d),this._configurationService=a,this._standaloneThemeService=s,this._register(u)}dispose(){super.dispose()}updateOptions(e){c9e(this._configurationService,e,!0),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(w9e,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};function S9e(e,t,i,n,o){if(i=i||"",!n){const n=i.indexOf("\n");let s=i;return-1!==n&&(s=i.substring(0,n)),x9e(e,i,t.createByFilepathOrFirstLine(o||null,s),o)}return x9e(e,i,t.createById(n),o)}function x9e(e,t,i,n){return e.createModel(t,i,n)}function k9e(e){const t=m9e.get(jXe);return t instanceof o9e?t.addDynamicKeybindings(e.map((e=>({keybinding:e.keybinding,command:e.command,commandArgs:e.commandArgs,when:Jxe.deserialize(e.when)})))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),Owe.None)}function L9e(e,t){return"boolean"==typeof e?e:t}function D9e(e,t){return"string"==typeof e?e:t}function E9e(e,t=!1){t&&(e=e.map((function(e){return e.toLowerCase()})));const i=function(e){const t={};for(const i of e)t[i]=!0;return t}(e);return t?function(e){return void 0!==i[e.toLowerCase()]&&i.hasOwnProperty(e.toLowerCase())}:function(e){return void 0!==i[e]&&i.hasOwnProperty(e)}}function N9e(e,t){t=t.replace(/@@/g,"");let i,n=0;do{i=!1,t=t.replace(/@(\w+)/g,(function(n,o){i=!0;let s="";if("string"==typeof e[o])s=e[o];else{if(!(e[o]&&e[o]instanceof RegExp))throw void 0===e[o]?bIe(e,"language definition does not contain attribute '"+o+"', used at: "+t):bIe(e,"attribute reference '"+o+"' must be a string, used at: "+t);s=e[o].source}return mIe(s)?"":"(?:"+s+")"})),n++}while(i&&n<5);t=t.replace(/\x01/g,"@");const o=(e.ignoreCase?"i":"")+(e.unicode?"u":"");return new RegExp(t,o)}function I9e(e,t,i,n){let o=-1,s=i,r=i.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);r&&(r[3]&&(o=parseInt(r[3]),r[2]&&(o+=100)),s=r[4]);let a,l="~",d=s;if(s&&0!==s.length?/^\w*$/.test(d)?l="==":(r=s.match(/^(@|!@|~|!~|==|!=)(.*)$/),r&&(l=r[1],d=r[2])):(l="!=",d=""),"~"!==l&&"!~"!==l||!/^(\w|\|)*$/.test(d))if("@"===l||"!@"===l){const i=e[d];if(!i)throw bIe(e,"the @ match target '"+d+"' is not defined, in rule: "+t);if(!function(e,t){if(!t)return!1;if(!Array.isArray(t))return!1;for(const e of t)if("string"!=typeof e)return!1;return!0}(0,i))throw bIe(e,"the @ match target '"+d+"' must be an array of strings, in rule: "+t);const n=E9e(i,e.ignoreCase);a=function(e){return"@"===l?n(e):!n(e)}}else if("~"===l||"!~"===l)if(d.indexOf("$")<0){const t=N9e(e,"^"+d+"$");a=function(e){return"~"===l?t.test(e):!t.test(e)}}else a=function(t,i,n,o){return N9e(e,"^"+wIe(e,d,i,n,o)+"$").test(t)};else if(d.indexOf("$")<0){const t=fIe(e,d);a=function(e){return"=="===l?e===t:e!==t}}else{const t=fIe(e,d);a=function(i,n,o,s,r){const a=wIe(e,t,n,o,s);return"=="===l?i===a:i!==a}}else{const t=E9e(d.split("|"),e.ignoreCase);a=function(e){return"~"===l?t(e):!t(e)}}return-1===o?{name:i,value:n,test:function(e,t,i,n){return a(e,e,t,i,n)}}:{name:i,value:n,test:function(e,t,i,n){const s=function(e,t,i,n){if(n<0)return e;if(n<t.length)return t[n];if(n>=100){n-=100;const e=i.split(".");if(e.unshift(i),n<e.length)return e[n]}return null}(e,t,i,o);return a(s||"",e,t,i,n)}}}function T9e(e,t,i){if(i){if("string"==typeof i)return i;if(i.token||""===i.token){if("string"!=typeof i.token)throw bIe(e,"a 'token' attribute must be of type string, in rule: "+t);{const n={token:i.token};if(i.token.indexOf("$")>=0&&(n.tokenSubst=!0),"string"==typeof i.bracket)if("@open"===i.bracket)n.bracket=1;else{if("@close"!==i.bracket)throw bIe(e,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+t);n.bracket=-1}if(i.next){if("string"!=typeof i.next)throw bIe(e,"the next state must be a string value in rule: "+t);{let o=i.next;if(!/^(@pop|@push|@popall)$/.test(o)&&("@"===o[0]&&(o=o.substr(1)),o.indexOf("$")<0&&!function(e,t){let i=t;for(;i&&i.length>0;){if(e.stateNames[i])return!0;const t=i.lastIndexOf(".");i=t<0?null:i.substr(0,t)}return!1}(e,wIe(e,o,"",[],""))))throw bIe(e,"the next state '"+i.next+"' is not defined in rule: "+t);n.next=o}}return"number"==typeof i.goBack&&(n.goBack=i.goBack),"string"==typeof i.switchTo&&(n.switchTo=i.switchTo),"string"==typeof i.log&&(n.log=i.log),"string"==typeof i.nextEmbedded&&(n.nextEmbedded=i.nextEmbedded,e.usesEmbedded=!0),n}}if(Array.isArray(i)){const n=[];for(let o=0,s=i.length;o<s;o++)n[o]=T9e(e,t,i[o]);return{group:n}}if(i.cases){const n=[];for(const o in i.cases)if(i.cases.hasOwnProperty(o)){const s=T9e(e,t,i.cases[o]);"@default"===o||"@"===o||""===o?n.push({test:void 0,value:s,name:o}):"@eos"===o?n.push({test:function(e,t,i,n){return n},value:s,name:o}):n.push(I9e(e,t,o,s))}const o=e.defaultToken;return{test:function(e,t,i,s){for(const o of n)if(!o.test||o.test(e,t,i,s))return o.value;return o}}}throw bIe(e,"an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: "+t)}return{token:""}}y9e=f9e([_9e(2,Hxe),_9e(3,wke),_9e(4,Uxe),_9e(5,c6e),_9e(6,k$e),_9e(7,SLe),_9e(8,yQe),_9e(9,xQe),_9e(10,wQe)],y9e);class M9e{constructor(e){this.regex=new RegExp(""),this.action={token:""},this.matchOnlyAtLineStart=!1,this.name="",this.name=e}setRegex(e,t){let i;if("string"==typeof t)i=t;else{if(!(t instanceof RegExp))throw bIe(e,"rules must start with a match string or regular expression: "+this.name);i=t.source}this.matchOnlyAtLineStart=i.length>0&&"^"===i[0],this.name=this.name+": "+i,this.regex=N9e(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")")}setAction(e,t){this.action=T9e(e,this.name,t)}}function A9e(e,t){if(!t||"object"!=typeof t)throw new Error("Monarch: expecting a language definition object");const i={};i.languageId=e,i.includeLF=L9e(t.includeLF,!1),i.noThrow=!1,i.maxStack=100,i.start="string"==typeof t.start?t.start:null,i.ignoreCase=L9e(t.ignoreCase,!1),i.unicode=L9e(t.unicode,!1),i.tokenPostfix=D9e(t.tokenPostfix,"."+i.languageId),i.defaultToken=D9e(t.defaultToken,"source"),i.usesEmbedded=!1;const n=t;function o(e,s,r){for(const a of r){let r=a.include;if(r){if("string"!=typeof r)throw bIe(i,"an 'include' attribute must be a string at: "+e);if("@"===r[0]&&(r=r.substr(1)),!t.tokenizer[r])throw bIe(i,"include target '"+r+"' is not defined at: "+e);o(e+"."+r,s,t.tokenizer[r])}else{const t=new M9e(e);if(Array.isArray(a)&&a.length>=1&&a.length<=3)if(t.setRegex(n,a[0]),a.length>=3)if("string"==typeof a[1])t.setAction(n,{token:a[1],next:a[2]});else{if("object"!=typeof a[1])throw bIe(i,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+e);{const e=a[1];e.next=a[2],t.setAction(n,e)}}else t.setAction(n,a[1]);else{if(!a.regex)throw bIe(i,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+e);a.name&&"string"==typeof a.name&&(t.name=a.name),a.matchOnlyAtStart&&(t.matchOnlyAtLineStart=L9e(a.matchOnlyAtLineStart,!1)),t.setRegex(n,a.regex),t.setAction(n,a.action)}s.push(t)}}}if(n.languageId=e,n.includeLF=i.includeLF,n.ignoreCase=i.ignoreCase,n.unicode=i.unicode,n.noThrow=i.noThrow,n.usesEmbedded=i.usesEmbedded,n.stateNames=t.tokenizer,n.defaultToken=i.defaultToken,!t.tokenizer||"object"!=typeof t.tokenizer)throw bIe(i,"a language definition must define the 'tokenizer' attribute as an object");i.tokenizer=[];for(const e in t.tokenizer)if(t.tokenizer.hasOwnProperty(e)){i.start||(i.start=e);const n=t.tokenizer[e];i.tokenizer[e]=new Array,o("tokenizer."+e,i.tokenizer[e],n)}if(i.usesEmbedded=n.usesEmbedded,t.brackets){if(!Array.isArray(t.brackets))throw bIe(i,"the 'brackets' attribute must be defined as an array")}else t.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const s=[];for(const e of t.brackets){let t=e;if(t&&Array.isArray(t)&&3===t.length&&(t={token:t[2],open:t[0],close:t[1]}),t.open===t.close)throw bIe(i,"open and close brackets in a 'brackets' attribute must be different: "+t.open+"\n hint: use the 'bracket' attribute if matching on equal brackets is required.");if("string"!=typeof t.open||"string"!=typeof t.token||"string"!=typeof t.close)throw bIe(i,"every element in the 'brackets' array must be a '{open,close,token}' object or array");s.push({token:t.token+i.tokenPostfix,open:fIe(i,t.open),close:fIe(i,t.close)})}return i.brackets=s,i.noThrow=!0,i}class R9e{constructor(e,t){this._languageId=e,this._actual=t}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if("function"==typeof this._actual.tokenize)return O9e.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new Lye(n.tokens,n.endState)}}class O9e{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let o=0,s=e.length;o<s;o++){const s=e[o];let r=s.startIndex;0===o?r=0:r<n&&(r=n),i[o]=new xye(r,s.scopes,t),n=r}return i}static adaptTokenize(e,t,i,n){const o=t.tokenize(i,n),s=O9e._toClassicTokens(o.tokens,e);let r;return r=o.endState.equals(n)?n:o.endState,new kye(s,r)}tokenize(e,t,i){return O9e.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),n=this._standaloneThemeService.getColorTheme().tokenTheme,o=[];let s=0,r=0;for(let e=0,a=t.length;e<a;e++){const a=t[e],l=n.match(i,a.scopes);if(s>0&&o[s-1]===l)continue;let d=a.startIndex;0===e?d=0:d<r&&(d=r),o[s++]=d,o[s++]=l,r=d}const a=new Uint32Array(s);for(let e=0;e<s;e++)a[e]=o[e];return a}tokenizeEncoded(e,t,i){const n=this._actual.tokenize(e,i),o=this._toBinaryTokens(this._languageService.languageIdCodec,n.tokens);let s;return s=n.endState.equals(i)?i:n.endState,new Lye(o,s)}}function P9e(e){return e&&"function"==typeof e.then}function F9e(e,t){return function(e){return"tokenizeEncoded"in e}(t)?new R9e(e,t):new O9e(e,t,m9e.get(NLe),m9e.get(c6e))}function B9e(e,t){const i={createTokenizationSupport:()=>{return i=this,n=void 0,s=function*(){const i=yield Promise.resolve(t.create());return i?function(e){return"function"==typeof e.getInitialState}(i)?F9e(e,i):new NIe(m9e.get(NLe),m9e.get(c6e),e,A9e(e,i),m9e.get(SLe)):null},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o((function(e){e(i)}))).then(r,a)}l((s=s.apply(i,n||[])).next())}));var i,n,o,s}};return Eye.registerFactory(e,i)}const W9e=zxe("IEditorCancelService"),V9e=new bke("cancellableOperation",!1,ove(0,"Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));MLe(W9e,class{constructor(){this._tokens=new WeakMap}add(e,t){let i,n=this._tokens.get(e);return n||(n=e.invokeWithinContext((e=>({key:V9e.bindTo(e.get(wke)),tokens:new $ve}))),this._tokens.set(e,n)),n.key.set(!0),i=n.tokens.push(t),()=>{i&&(i(),n.key.set(!n.tokens.isEmpty()),i=void 0)}}cancel(e){const t=this._tokens.get(e);if(!t)return;const i=t.tokens.pop();i&&(i.cancel(),t.key.set(!t.tokens.isEmpty()))}},1),MAe(new class extends IAe{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:V9e})}runEditorCommand(e,t){e.get(W9e).cancel(t)}});class H9e{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return"string"==typeof e?e.toLowerCase():e._lower}}var z9e,U9e=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class K9e{static setFormatterSelector(e){return{dispose:K9e._selectors.unshift(e)}}static select(e,t,i){return U9e(this,void 0,void 0,(function*(){if(0===e.length)return;const n=jve.first(K9e._selectors);return n?yield n(e,t,i):void 0}))}}K9e._selectors=new $ve,pAe.registerCommand("_executeFormatRangeProvider",(function(e,...t){return U9e(this,void 0,void 0,(function*(){const[i,n,o]=t;kbe(QCe.isUri(i)),kbe(dye.isIRange(n));const s=e.get(nAe),r=e.get(vQe),a=e.get(ENe),l=yield s.createModelReference(i);try{return function(e,t,i,n,o,s){return U9e(this,void 0,void 0,(function*(){const r=t.documentRangeFormattingEditProvider.ordered(i);for(const t of r){const r=yield Promise.resolve(t.provideDocumentRangeFormattingEdits(i,n,o,s)).catch(Cwe);if(ibe(r))return yield e.computeMoreMinimalEdits(i.uri,r)}}))}(r,a,l.object.textEditorModel,dye.lift(n),o,nCe.None)}finally{l.dispose()}}))})),pAe.registerCommand("_executeFormatDocumentProvider",(function(e,...t){return U9e(this,void 0,void 0,(function*(){const[i,n]=t;kbe(QCe.isUri(i));const o=e.get(nAe),s=e.get(vQe),r=e.get(ENe),a=yield o.createModelReference(i);try{return function(e,t,i,n,o){return U9e(this,void 0,void 0,(function*(){const s=function(e,t,i){const n=[],o=new Set,s=e.ordered(i);for(const e of s)n.push(e),e.extensionId&&o.add(H9e.toKey(e.extensionId));const r=t.ordered(i);for(const e of r){if(e.extensionId){if(o.has(H9e.toKey(e.extensionId)))continue;o.add(H9e.toKey(e.extensionId))}n.push({displayName:e.displayName,extensionId:e.extensionId,provideDocumentFormattingEdits:(t,i,n)=>e.provideDocumentRangeFormattingEdits(t,t.getFullModelRange(),i,n)})}return n}(t.documentFormattingEditProvider,t.documentRangeFormattingEditProvider,i);for(const t of s){const s=yield Promise.resolve(t.provideDocumentFormattingEdits(i,n,o)).catch(Cwe);if(ibe(s))return yield e.computeMoreMinimalEdits(i.uri,s)}}))}(s,r,a.object.textEditorModel,n,nCe.None)}finally{a.dispose()}}))})),pAe.registerCommand("_executeFormatOnTypeProvider",(function(e,...t){return U9e(this,void 0,void 0,(function*(){const[i,n,o,s]=t;kbe(QCe.isUri(i)),kbe(lye.isIPosition(n)),kbe("string"==typeof o);const r=e.get(nAe),a=e.get(vQe),l=e.get(ENe),d=yield r.createModelReference(i);try{return function(e,t,i,n,o,s,r){const a=t.onTypeFormattingEditProvider.ordered(i);return 0===a.length||a[0].autoFormatTriggerCharacters.indexOf(o)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(i,n,o,s,r)).catch(Cwe).then((t=>e.computeMoreMinimalEdits(i.uri,t)))}(a,l,d.object.textEditorModel,lye.lift(n),o,s,nCe.None)}finally{d.dispose()}}))})),vwe.wrappingIndent.defaultValue=0,vwe.glyphMargin.defaultValue=!1,vwe.autoIndent.defaultValue=3,vwe.overviewRulerLanes.defaultValue=2,K9e.setFormatterSelector(((e,t,i)=>Promise.resolve(e[0])));const j9e=pSe();j9e.editor={create:function(e,t,i){return m9e.initialize(i||{}).createInstance(C9e,e,t)},getEditors:function(){return m9e.get(Uxe).listCodeEditors()},getDiffEditors:function(){return m9e.get(Uxe).listDiffEditors()},onDidCreateEditor:function(e){return m9e.get(Uxe).onCodeEditorAdd((t=>{e(t)}))},onDidCreateDiffEditor:function(e){return m9e.get(Uxe).onDiffEditorAdd((t=>{e(t)}))},createDiffEditor:function(e,t,i){return m9e.initialize(i||{}).createInstance(y9e,e,t)},createDiffNavigator:function(e,t){return m9e.initialize({}).createInstance(Ike,e,t)},addCommand:function(e){if("string"!=typeof e.id||"function"!=typeof e.run)throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return pAe.registerCommand(e.id,e.run)},addEditorAction:function(e){if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const t=Jxe.deserialize(e.precondition),i=new Rwe;if(i.add(pAe.registerCommand(e.id,((i,...n)=>IAe.runEditorCommand(i,n,t,((t,i,n)=>Promise.resolve(e.run(i,...n))))))),e.contextMenuGroupId){const n={command:{id:e.id,title:e.label},when:t,group:e.contextMenuGroupId,order:e.contextMenuOrder||0};i.add(SAe.appendMenuItem(wAe.EditorContext,n))}if(Array.isArray(e.keybindings)){const n=m9e.get(jXe);if(n instanceof o9e){const o=Jxe.and(t,Jxe.deserialize(e.keybindingContext));i.add(n.addDynamicKeybindings(e.keybindings.map((t=>({keybinding:t,command:e.id,when:o})))))}else console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService")}return i},addKeybindingRule:function(e){return k9e([e])},addKeybindingRules:k9e,createModel:function(e,t,i){const n=m9e.get(NLe),o=n.getLanguageIdByMimeType(t)||t;return S9e(m9e.get(xDe),n,e,o,i)},setModelLanguage:function(e,t){const i=m9e.get(NLe),n=m9e.get(xDe),o=i.getLanguageIdByMimeType(t)||t||tDe;n.setMode(e,i.createById(o))},setModelMarkers:function(e,t,i){e&&m9e.get(h1e).changeOne(t,e.uri,i)},getModelMarkers:function(e){return m9e.get(h1e).read(e)},removeAllMarkers:function(e){m9e.get(h1e).changeAll(e,[])},onDidChangeMarkers:function(e){return m9e.get(h1e).onMarkerChanged(e)},getModels:function(){return m9e.get(xDe).getModels()},getModel:function(e){return m9e.get(xDe).getModel(e)},onDidCreateModel:function(e){return m9e.get(xDe).onModelAdded(e)},onWillDisposeModel:function(e){return m9e.get(xDe).onModelRemoved(e)},onDidChangeModelLanguage:function(e){return m9e.get(xDe).onModelLanguageChanged((t=>{e({model:t.model,oldLanguage:t.oldLanguageId})}))},createWebWorker:function(e){return function(e,t,i){return new WNe(e,t,i)}(m9e.get(xDe),m9e.get(dDe),e)},colorizeElement:function(e,t){const i=m9e.get(NLe),n=m9e.get(c6e);return n.registerEditorContainer(e),AIe.colorizeElement(n,i,e,t)},colorize:function(e,t,i){const n=m9e.get(NLe);return m9e.get(c6e).registerEditorContainer(document.body),AIe.colorize(n,e,t,i)},colorizeModelLine:function(e,t,i=4){return m9e.get(c6e).registerEditorContainer(document.body),AIe.colorizeModelLine(e,t,i)},tokenize:function(e,t){Eye.getOrCreate(t);const i=function(e){return Eye.get(e)||{getInitialState:()=>CDe,tokenize:(t,i,n)=>yDe(e,n)}}(t),n=DSe(e),o=[];let s=i.getInitialState();for(let e=0,t=n.length;e<t;e++){const t=n[e],r=i.tokenize(t,!0,s);o[e]=r.tokens,s=r.endState}return o},defineTheme:function(e,t){m9e.get(c6e).defineTheme(e,t)},setTheme:function(e){m9e.get(c6e).setTheme(e)},remeasureFonts:function(){Wxe.clearAllFontInfos()},registerCommand:function(e,t){return pAe.registerCommand({id:e,handler:t})},AccessibilitySupport:Nye,ContentWidgetPositionPreference:Oye,CursorChangeReason:Pye,DefaultEndOfLine:Fye,EditorAutoIndentStrategy:Wye,EditorOption:Vye,EndOfLinePreference:Hye,EndOfLineSequence:zye,MinimapPosition:Yye,MouseTargetType:Qye,OverlayWidgetPositionPreference:Xye,OverviewRulerLane:Jye,RenderLineNumbersType:tSe,RenderMinimap:iSe,ScrollbarVisibility:oSe,ScrollType:nSe,TextEditorCursorBlinkingStyle:dSe,TextEditorCursorStyle:hSe,TrackedRangeStickiness:cSe,WrappingIndent:uSe,InjectedTextCursorStops:Kye,PositionAffinity:eSe,ConfigurationChangedEvent:Fbe,BareFontInfo:Pxe,FontInfo:Fxe,TextModelResolvedOptions:Pke,FindMatch:Fke,ApplyUpdateResult:Vbe,LineRange:KEe,LineRangeMapping:zEe,RangeMapping:UEe,EditorType:Tke,EditorOptions:vwe},j9e.languages={register:function(e){eDe.registerLanguage(e)},getLanguages:function(){let e=[];return e=e.concat(eDe.getLanguages()),e},onLanguage:function(e,t){const i=m9e.get(NLe).onDidEncounterLanguage((n=>{n===e&&(i.dispose(),t())}));return i},getEncodedLanguageId:function(e){return m9e.get(NLe).languageIdCodec.encodeLanguageId(e)},setLanguageConfiguration:function(e,t){if(!m9e.get(NLe).isRegisteredLanguageId(e))throw new Error(`Cannot set configuration for unknown language ${e}`);return m9e.get(dDe).register(e,t,100)},setColorMap:function(e){const t=m9e.get(c6e);if(e){const i=[null];for(let t=1,n=e.length;t<n;t++)i[t]=hRe.fromHex(e[t]);t.setColorMapOverride(i)}else t.setColorMapOverride(null)},registerTokensProviderFactory:B9e,setTokensProvider:function(e,t){if(!m9e.get(NLe).isRegisteredLanguageId(e))throw new Error(`Cannot set tokens provider for unknown language ${e}`);return P9e(t)?B9e(e,{create:()=>t}):Eye.register(e,F9e(e,t))},setMonarchTokensProvider:function(e,t){return P9e(t)?B9e(e,{create:()=>t}):Eye.register(e,(t=>new NIe(m9e.get(NLe),m9e.get(c6e),e,A9e(e,t),m9e.get(SLe)))(t))},registerReferenceProvider:function(e,t){return m9e.get(ENe).referenceProvider.register(e,t)},registerRenameProvider:function(e,t){return m9e.get(ENe).renameProvider.register(e,t)},registerCompletionItemProvider:function(e,t){return m9e.get(ENe).completionProvider.register(e,t)},registerSignatureHelpProvider:function(e,t){return m9e.get(ENe).signatureHelpProvider.register(e,t)},registerHoverProvider:function(e,t){return m9e.get(ENe).hoverProvider.register(e,{provideHover:(e,i,n)=>{const o=e.getWordAtPosition(i);return Promise.resolve(t.provideHover(e,i,n)).then((e=>{if(e)return!e.range&&o&&(e.range=new dye(i.lineNumber,o.startColumn,i.lineNumber,o.endColumn)),e.range||(e.range=new dye(i.lineNumber,i.column,i.lineNumber,i.column)),e}))}})},registerDocumentSymbolProvider:function(e,t){return m9e.get(ENe).documentSymbolProvider.register(e,t)},registerDocumentHighlightProvider:function(e,t){return m9e.get(ENe).documentHighlightProvider.register(e,t)},registerLinkedEditingRangeProvider:function(e,t){return m9e.get(ENe).linkedEditingRangeProvider.register(e,t)},registerDefinitionProvider:function(e,t){return m9e.get(ENe).definitionProvider.register(e,t)},registerImplementationProvider:function(e,t){return m9e.get(ENe).implementationProvider.register(e,t)},registerTypeDefinitionProvider:function(e,t){return m9e.get(ENe).typeDefinitionProvider.register(e,t)},registerCodeLensProvider:function(e,t){return m9e.get(ENe).codeLensProvider.register(e,t)},registerCodeActionProvider:function(e,t,i){return m9e.get(ENe).codeActionProvider.register(e,{providedCodeActionKinds:null==i?void 0:i.providedCodeActionKinds,documentation:null==i?void 0:i.documentation,provideCodeActions:(e,i,n,o)=>{const s=m9e.get(h1e).read({resource:e.uri}).filter((e=>dye.areIntersectingOrTouching(e,i)));return t.provideCodeActions(e,i,{markers:s,only:n.only,trigger:n.trigger},o)},resolveCodeAction:t.resolveCodeAction})},registerDocumentFormattingEditProvider:function(e,t){return m9e.get(ENe).documentFormattingEditProvider.register(e,t)},registerDocumentRangeFormattingEditProvider:function(e,t){return m9e.get(ENe).documentRangeFormattingEditProvider.register(e,t)},registerOnTypeFormattingEditProvider:function(e,t){return m9e.get(ENe).onTypeFormattingEditProvider.register(e,t)},registerLinkProvider:function(e,t){return m9e.get(ENe).linkProvider.register(e,t)},registerColorProvider:function(e,t){return m9e.get(ENe).colorProvider.register(e,t)},registerFoldingRangeProvider:function(e,t){return m9e.get(ENe).foldingRangeProvider.register(e,t)},registerDeclarationProvider:function(e,t){return m9e.get(ENe).declarationProvider.register(e,t)},registerSelectionRangeProvider:function(e,t){return m9e.get(ENe).selectionRangeProvider.register(e,t)},registerDocumentSemanticTokensProvider:function(e,t){return m9e.get(ENe).documentSemanticTokensProvider.register(e,t)},registerDocumentRangeSemanticTokensProvider:function(e,t){return m9e.get(ENe).documentRangeSemanticTokensProvider.register(e,t)},registerInlineCompletionsProvider:function(e,t){return m9e.get(ENe).inlineCompletionsProvider.register(e,t)},registerInlayHintsProvider:function(e,t){return m9e.get(ENe).inlayHintsProvider.register(e,t)},DocumentHighlightKind:Bye,CompletionItemKind:Mye,CompletionItemTag:Aye,CompletionItemInsertTextRule:Tye,SymbolKind:aSe,SymbolTag:lSe,IndentAction:Uye,CompletionTriggerKind:Rye,SignatureHelpTriggerKind:rSe,InlayHintKind:jye,InlineCompletionTriggerKind:qye,CodeActionTriggerType:Iye,FoldingRangeKind:Dye},j9e.CancellationTokenSource,j9e.Emitter;const q9e=j9e.KeyCode,$9e=(j9e.KeyMod,j9e.Position),G9e=j9e.Range,Z9e=j9e.Selection,Y9e=j9e.SelectionDirection,Q9e=(j9e.MarkerSeverity,j9e.MarkerTag,j9e.Uri,j9e.Token,j9e.editor);j9e.languages,((null===(z9e=Cve.MonacoEnvironment)||void 0===z9e?void 0:z9e.globalAPI)||"function"==typeof define&&i.amdO)&&(self.monaco=j9e),void 0!==self.require&&"function"==typeof self.require.config&&self.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]}),self.MonacoEnvironment=function(e){return{globalAPI:!1,getWorkerUrl:function(t,n){var o=i.p,s=(o?o.replace(/\/$/,"")+"/":"")+e[n];if(/^((http:)|(https:)|(file:)|(\/\/))/.test(s)){var r=String(window.location),a=r.substr(0,r.length-window.location.hash.length-window.location.search.length-window.location.pathname.length);if(s.substring(0,a.length)!==a){/^(\/\/)/.test(s)&&(s=window.location.protocol+s);var l="/*"+n+"*/",d=new Blob([l+=void 0!==import.meta?'import "'+s+'";':'importScripts("'+s+'");'],{type:"application/javascript"});return URL.createObjectURL(d)}}return s}}}({editorWorkerService:"editor.worker.js"});const X9e={readOnly:65,cursorWidth:20,fontInfo:32},J9e=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function e7e(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||J9e.test(e))}function t7e(e,t){if(!(this instanceof t7e))return new t7e(e,t);this.line=e,this.ch=t}function i7e(e,t,i){e.dispatch(t,i)}let n7e,o7e;String.prototype.normalize?(n7e=function(e){return e.normalize("NFD").toLowerCase()},o7e=function(e){return e.normalize("NFD")}):(n7e=function(e){return e.toLowerCase()},o7e=function(e){return e});var s7e=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};function r7e(e){return new t7e(e.lineNumber-1,e.column-1)}function a7e(e){return new $9e(e.line+1,e.ch+1)}s7e.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(e){var t=this.string.charAt(this.pos);if("string"==typeof e)var i=t==e;else i=t&&(e.test?e.test(t):e(t));if(i)return++this.pos,t},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){throw"not implemented"},indentation:function(){throw"not implemented"},match:function(e,t,i){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var o=function(e){return i?e.toLowerCase():e};if(o(this.string.substr(this.pos,e.length))==o(e))return!1!==t&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};class l7e{constructor(e,t,i,n){this.cm=e,this.id=t,this.lineNumber=i+1,this.column=n+1,e.marks[this.id]=this}clear(){delete this.cm.marks[this.id]}find(){return r7e(this)}}function d7e(e,t=!1){let i=!0,n=q9e[e.keyCode];e.key&&(n=e.key,i=!1);let o=n,s=t;switch(e.keyCode){case q9e.Shift:case q9e.Meta:case q9e.Alt:case q9e.Ctrl:return o;case q9e.Escape:s=!0,o="Esc";break;case q9e.Space:s=!0}return n.startsWith("Key")||n.startsWith("KEY_")?o=n[n.length-1].toLowerCase():n.startsWith("Digit")?o=n.slice(5,6):n.startsWith("Numpad")?o=n.slice(6,7):n.endsWith("Arrow")?(s=!0,o=n.substring(0,n.length-5)):(n.startsWith("US_")||n.startsWith("Bracket")||!o)&&(o=e.browserEvent.key),s||e.altKey||e.ctrlKey||e.metaKey?(e.altKey&&(o=`Alt-${o}`),e.ctrlKey&&(o=`Ctrl-${o}`),e.metaKey&&(o=`Meta-${o}`),e.shiftKey&&(o=`Shift-${o}`)):o=e.key||e.browserEvent.key,1===o.length&&i&&(o=`'${o}'`),o}class h7e{static Pos=t7e;static signal=i7e;static on=function(){};static off=function(){};static addClass=function(){};static rmClass=function(){};static defineOption=function(){};static keyMap={default:function(e){return function(e){return!0}}};static matchingBrackets={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};static isWordChar=e7e;static keyName=d7e;static StringStream=s7e;static e_stop=function(e){return e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,h7e.e_preventDefault(e),!1};static e_preventDefault=function(e){return e.preventDefault?(e.preventDefault(),e.browserEvent&&e.browserEvent.preventDefault()):e.returnValue=!1,!1};static commands={redo:function(e){e.editor.getModel().redo()},undo:function(e){e.editor.getModel().undo()},newlineAndIndent:function(e){e.triggerEditorAction("editor.action.insertLineAfter")}};static lookupKey=function e(t,i,n){"string"==typeof i&&(i=h7e.keyMap[i]);const o="function"==typeof i?i(t):i[t];if(!1===o)return"nothing";if("..."===o)return"multi";if(null!=o&&n(o))return"handled";if(i.fallthrough){if(!Array.isArray(i.fallthrough))return e(t,i.fallthrough,n);for(var s=0;s<i.fallthrough.length;s++){var r=e(t,i.fallthrough[s],n);if(r)return r}}};static defineExtension=function(e,t){h7e.prototype[e]=t};constructor(e){this.editor=e,this.state={keyMap:"vim"},this.marks={},this.$uid=0,this.disposables=[],this.listeners={},this.curOp={},this.attached=!1,this.statusBar=null,this.options={},this.addLocalListeners(),this.ctxInsert=this.editor.createContextKey("insertMode",!0)}attach(){h7e.keyMap.vim.attach(this)}addLocalListeners(){this.disposables.push(this.editor.onDidChangeCursorPosition(this.handleCursorChange),this.editor.onDidChangeModelContent(this.handleChange),this.editor.onKeyDown(this.handleKeyDown))}handleKeyDown=e=>{if(e.browserEvent.defaultPrevented&e.keyCode!==q9e.Escape)return;if(!this.attached)return;const t=d7e(e);if(this.replaceMode&&this.handleReplaceMode(t,e),!t)return;const i=this.state.keyMap;if(h7e.keyMap[i]&&h7e.keyMap[i].call){const n=h7e.keyMap[i].call(t,this);if(n){e.preventDefault(),e.stopPropagation();try{n()}catch(e){console.error(e)}}}};handleReplaceMode(e,t){let i=!1,n=e;const o=this.editor.getPosition();let s=new G9e(o.lineNumber,o.column,o.lineNumber,o.column+1);if(e.startsWith("'"))n=e[1];else if("Enter"===n)n="\n";else{if("Backspace"!==n)return;{const e=this.replaceStack.pop();if(!e)return;i=!0,n=e,s=new G9e(o.lineNumber,o.column,o.lineNumber,o.column-1)}}t.preventDefault(),t.stopPropagation(),this.replaceStack||(this.replaceStack=[]),i||this.replaceStack.push(this.editor.getModel().getValueInRange(s)),this.editor.executeEdits("vim",[{text:n,range:s,forceMoveMarkers:!0}]),i&&this.editor.setPosition(s.getStartPosition())}handleCursorChange=e=>{const{position:t,source:i}=e,{editor:n}=this,o=n.getSelection();if(!this.ctxInsert.get()&&"mouse"===e.source&&o.isEmpty()){const i=n.getModel().getLineMaxColumn(t.lineNumber);if(e.position.column===i)return void n.setPosition(new $9e(e.position.lineNumber,i-1))}this.dispatch("cursorActivity",this,e)};handleChange=e=>{const{changes:t}=e,i={text:t.reduce(((e,t)=>(e.push(t.text),e)),[]),origin:"+input"},n=this.curOp=this.curOp||{};n.changeHandlers||(n.changeHandlers=this.listeners.change&&this.listeners.change.slice()),this.virtualSelectionMode()||(n.lastChange?n.lastChange.next=n.lastChange=i:n.lastChange=n.change=i,this.dispatch("change",this,i))};setOption(e,t){this.state[e]=t,"theme"===e&&Q9e.setTheme(t)}getConfiguration(){const{editor:e}=this;let t=X9e;return"function"==typeof e.getConfiguration?e.getConfiguration():("EditorOption"in Q9e&&(t=Q9e.EditorOption),{readOnly:e.getOption(t.readOnly),viewInfo:{cursorWidth:e.getOption(t.cursorWidth)},fontInfo:e.getOption(t.fontInfo)})}getOption(e){return"readOnly"===e?this.getConfiguration().readOnly:"firstLineNumber"===e?this.firstLine()+1:"indentWithTabs"===e?!this.editor.getModel().getOptions().insertSpaces:"function"==typeof this.editor.getConfiguration?this.editor.getRawConfiguration()[e]:this.editor.getRawOptions()[e]}dispatch(e,...t){const i=this.listeners[e];i&&i.forEach((e=>e(...t)))}on(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)}off(e,t){const i=this.listeners[e];i&&(this.listeners[e]=i.filter((e=>e!==t)))}firstLine(){return 0}lastLine(){return this.lineCount()-1}lineCount(){return this.editor.getModel().getLineCount()}defaultTextHeight(){return 1}getLine(e){if(e<0)return"";const t=this.editor.getModel().getLineCount();return e+1>t&&(e=t-1),this.editor.getModel().getLineContent(e+1)}getAnchorForSelection(e){return e.isEmpty()?e.getPosition():e.getDirection()===Y9e.LTR?e.getStartPosition():e.getEndPosition()}getHeadForSelection(e){return e.isEmpty()?e.getPosition():e.getDirection()===Y9e.LTR?e.getEndPosition():e.getStartPosition()}getCursor(e=null){if(!e)return r7e(this.editor.getPosition());const t=this.editor.getSelection();let i;return i=t.isEmpty()?t.getPosition():"anchor"===e?this.getAnchorForSelection(t):this.getHeadForSelection(t),r7e(i)}getRange(e,t){const i=a7e(e),n=a7e(t);return this.editor.getModel().getValueInRange(G9e.fromPositions(i,n))}getSelection(){var e=[],t=this.editor;return t.getSelections().map((function(i){e.push(t.getModel().getValueInRange(i))})),e.join("\n")}replaceRange(e,t,i){const n=a7e(t),o=i?a7e(i):n;this.editor.executeEdits("vim",[{text:e,range:G9e.fromPositions(n,o)}]),this.pushUndoStop()}pushUndoStop(){this.editor.pushUndoStop()}setCursor(e,t){let i=e;"object"!=typeof e&&(i={},i.line=e,i.ch=t);const n=this.editor.getModel().validatePosition(a7e(i));this.editor.setPosition(a7e(i)),this.editor.revealPosition(n)}somethingSelected(){return!this.editor.getSelection().isEmpty()}operation(e,t){return e()}listSelections(){const e=this.editor.getSelections();return!e.length||this.inVirtualSelectionMode?[{anchor:this.getCursor("anchor"),head:this.getCursor("head")}]:e.map((e=>(e.getPosition(),e.getStartPosition(),e.getEndPosition(),{anchor:this.clipPos(r7e(this.getAnchorForSelection(e))),head:this.clipPos(r7e(this.getHeadForSelection(e)))})))}focus(){this.editor.focus()}setSelections(e,t){const i=!!this.editor.getSelections().length,n=e.map(((e,t)=>{const{anchor:n,head:o}=e;return i?Z9e.fromPositions(a7e(n),a7e(o)):Z9e.fromPositions(a7e(o),a7e(n))}));if(t&&n[t]&&n.push(n.splice(t,1)[0]),!n.length)return;const o=n[0];let s;s=o.getDirection()===Y9e.LTR?o.getEndPosition():o.getStartPosition(),this.editor.setSelections(n),this.editor.revealPosition(s)}setSelection(e,t){const i=G9e.fromPositions(a7e(e),a7e(t));this.editor.setSelection(i)}getSelections(){const{editor:e}=this;return e.getSelections().map((t=>e.getModel().getValueInRange(t)))}replaceSelections(e){const{editor:t}=this;t.getSelections().forEach(((i,n)=>{t.executeEdits("vim",[{range:i,text:e[n],forceMoveMarkers:!1}])}))}toggleOverwrite(e){e?(this.enterVimMode(),this.replaceMode=!0):(this.leaveVimMode(),this.replaceMode=!1,this.replaceStack=[])}charCoords(e,t){return{top:e.line,left:e.ch}}coordsChar(e,t){}clipPos(e){return r7e(this.editor.getModel().validatePosition(a7e(e)))}setBookmark(e,t){const i=new l7e(this,this.$uid++,e.line,e.ch);return t&&t.insertLeft||(i.$insertRight=!0),this.marks[i.id]=i,i}getScrollInfo(){const{editor:e}=this,[t]=e.getVisibleRanges();return{left:0,top:t.startLineNumber-1,height:e.getModel().getLineCount(),clientHeight:t.endLineNumber-t.startLineNumber+1}}triggerEditorAction(e){this.editor.trigger("vim",e)}dispose(){this.dispatch("dispose"),this.removeOverlay(),h7e.keyMap.vim&&h7e.keyMap.vim.detach(this),this.disposables.forEach((e=>e.dispose()))}getInputField(){}getWrapperElement(){}enterVimMode(e=!0){this.ctxInsert.set(!1);const t=this.getConfiguration();this.initialCursorWidth=t.viewInfo.cursorWidth||0,this.editor.updateOptions({cursorWidth:t.fontInfo.typicalFullwidthCharacterWidth,cursorBlinking:"solid"})}leaveVimMode(){this.ctxInsert.set(!0),this.editor.updateOptions({cursorWidth:this.initialCursorWidth||0,cursorBlinking:"blink"})}virtualSelectionMode(){return this.inVirtualSelectionMode}markText(){return{clear:function(){},find:function(){}}}getUserVisibleLines(){const e=this.editor.getVisibleRanges();if(!e.length)return{top:0,bottom:0};const t={top:1/0,bottom:0};return e.reduce(((e,t)=>(t.startLineNumber<e.top&&(e.top=t.startLineNumber),t.endLineNumber>e.bottom&&(e.bottom=t.endLineNumber),e)),t),t.top-=1,t.bottom-=1,t}findPosV(e,t,i){const{editor:n}=this;let o=t,s=i;const r=a7e(e);if("page"===i){const e=n.getLayoutInfo().height,t=this.getConfiguration().fontInfo.lineHeight;o*=Math.floor(e/t),s="line"}return"line"===s&&(r.lineNumber+=o),r7e(r)}findMatchingBracket(e){const t=a7e(e),i=this.editor.getModel();let n;return n=i.bracketPairs?i.bracketPairs.matchBracket(t):i.matchBracket?.(t),n&&2===n.length?{to:r7e(n[t.equals(n[1].getStartPosition())?0:1].getStartPosition())}:{to:null}}findFirstNonWhiteSpaceCharacter(e){return this.editor.getModel().getLineFirstNonWhitespaceColumn(e+1)-1}scrollTo(e,t){(e||t)&&(e||(t<0&&(t=this.editor.getPosition().lineNumber-t),this.editor.setScrollTop(this.editor.getTopForLineNumber(t+1))))}moveCurrentLineTo(e){const{editor:t}=this,i=t.getPosition(),n=G9e.fromPositions(i,i);switch(e){case"top":return void t.revealRangeAtTop(n);case"center":return void t.revealRangeInCenter(n);case"bottom":return void t._revealRange?.(n,4)}}getSearchCursor(e,t){let i=!1,n=!1;e instanceof RegExp&&!e.global&&(i=!e.ignoreCase,e=e.source,n=!0),null==t.ch&&(t.ch=Number.MAX_VALUE);const o=a7e(t),s=this,{editor:r}=this;let a=null;const l=r.getModel(),d=l.findMatches(e,!1,n,i)||[];return{getMatches:()=>d,findNext(){return this.find(!1)},findPrevious(){return this.find(!0)},jumpTo(e){if(!d||!d.length)return!1;var t=d[e];return a=t.range,s.highlightRanges([a],"currentFindMatch"),s.highlightRanges(d.map((e=>e.range)).filter((e=>!e.equalsRange(a)))),a},find(t){if(!d||!d.length)return!1;let r;if(t){const t=a?a.getStartPosition():o;if(r=l.findPreviousMatch(e,t,n,i),!r||!r.range.getStartPosition().isBeforeOrEqual(t))return!1}else{const t=a?l.getPositionAt(l.getOffsetAt(a.getStartPosition())+1):o;if(r=l.findNextMatch(e,t,n,i),!r||!t.isBeforeOrEqual(r.range.getStartPosition()))return!1}return a=r.range,s.highlightRanges([a],"currentFindMatch"),s.highlightRanges(d.map((e=>e.range)).filter((e=>!e.equalsRange(a)))),a},from:()=>a&&r7e(a.getStartPosition()),to:()=>a&&r7e(a.getEndPosition()),replace(e){a&&(r.executeEdits("vim",[{range:a,text:e,forceMoveMarkers:!0}]),a.setEndPosition(r.getPosition()),r.setPosition(a.getStartPosition()))}}}highlightRanges(e,t="findMatch"){const i=`decoration${t}`;return this[i]=this.editor.deltaDecorations(this[i]||[],e.map((e=>({range:e,options:{stickiness:Q9e.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,zIndex:13,className:t,showIfCollapsed:!0}})))),this[i]}addOverlay({query:e},t,i){let n=!1,o=!1;e&&e instanceof RegExp&&!e.global&&(o=!0,n=!e.ignoreCase,e=e.source);const s=this.editor.getModel().findNextMatch(e,this.editor.getPosition(),o,n);s&&s.range&&this.highlightRanges([s.range])}removeOverlay(){["currentFindMatch","findMatch"].forEach((e=>{this.editor.deltaDecorations(this[`decoration${e}`]||[],[])}))}scrollIntoView(e){e&&this.editor.revealPosition(a7e(e))}moveH(e,t){if("char"!==t)return;const i=this.editor.getPosition();this.editor.setPosition(new $9e(i.lineNumber,i.column+e))}scanForBracket(e,t,i,n){const{bracketRegex:o}=n;let s=a7e(e);const r=this.editor.getModel(),a=(-1===t?r.findPreviousMatch:r.findNextMatch).bind(r),l=[];let d=0;for(;;){if(d>10)return;const e=a(o.source,s,!0,!0,null,!0),i=e.matches[0];if(void 0===e)return;const n=h7e.matchingBrackets[i];if(n&&">"===n.charAt(1)==t>0)l.push(i);else{if(0===l.length)return{pos:r7e(e.range.getStartPosition())};l.pop()}s=r.getPositionAt(r.getOffsetAt(e.range.getStartPosition())+t),d+=1}}indexFromPos(e){return this.editor.getModel().getOffsetAt(a7e(e))}posFromIndex(e){return r7e(this.editor.getModel().getPositionAt(e))}indentLine(e,t=!0){const{editor:i}=this;let n;n=i._getViewModel?i._getViewModel().cursorConfig:i._getCursors().context.config;const o=new $9e(e+1,1),s=Z9e.fromPositions(o,o);i.executeCommand("vim",new cVe(s,{isUnshift:!t,tabSize:n.tabSize,indentSize:n.indentSize,insertSpaces:n.insertSpaces,useTabStops:n.useTabStops,autoIndent:n.autoIndent}))}setStatusBar(e){this.statusBar=e}openDialog(e,t,i){if(this.statusBar)return this.statusBar.setSec(e,t,i)}openNotification(e){this.statusBar&&this.statusBar.showNotification(e)}smartIndent(){this.editor.getAction("editor.action.formatSelection").run()}moveCursorTo(e){const t=this.editor.getPosition();"start"===e?t.column=1:"end"===e&&(t.column=this.editor.getModel().getLineMaxColumn(t.lineNumber)),this.editor.setPosition(t)}execCommand(e){switch(e){case"goLineLeft":this.moveCursorTo("start");break;case"goLineRight":this.moveCursorTo("end");break;case"indentAuto":this.smartIndent()}}}const c7e=h7e;var u7e=c7e.Pos;function g7e(e,t){var i=e.state.vim;if(!i||i.insertMode)return t.head;var n=i.sel.head;return n?i.visualBlock&&t.head.line!=n.line?void 0:t.from()!=t.anchor||t.empty()||t.head.line!=n.line||t.head.ch==n.ch?t.head:new u7e(t.head.line,t.head.ch-1):t.head}var p7e=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"g<Up>",type:"keyToKey",toKeys:"gk"},{keys:"g<Down>",type:"keyToKey",toKeys:"gj"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h",context:"normal"},{keys:"<Del>",type:"keyToKey",toKeys:"x",context:"normal"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B",context:"normal"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b",context:"normal"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"<Ins>",type:"keyToKey",toKeys:"i",context:"normal"},{keys:"<Ins>",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"g$",type:"motion",motion:"moveToEndOfDisplayLine"},{keys:"g^",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"g0",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<character>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<character>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"gn",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!0}},{keys:"gN",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!1}},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"<C-u>",type:"operatorMotion",operator:"delete",motion:"moveToStartOfLine",context:"insert"},{keys:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-w>",type:"idle",context:"normal"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"gi",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"lastEdit"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"gI",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"bol"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"<C-q>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"gJ",type:"action",action:"joinLines",actionArgs:{keepSpaces:!0},isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<character>",type:"action",action:"replayMacro"},{keys:"q<character>",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"<C-r>",type:"action",action:"redo"},{keys:"m<character>",type:"action",action:"setMark"},{keys:'"<character>',type:"action",action:"setRegister"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z<CR>",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"<C-t>",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"<C-d>",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a<character>",type:"motion",motion:"textObjectManipulation"},{keys:"i<character>",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],m7e=p7e.length,f7e=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"unmap"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"vglobal",shortName:"v"},{name:"global",shortName:"g"}];c7e.Vim=function(){function e(e,i){e.attached=!1,this==c7e.keyMap.vim&&(e.options.$customCursor=null),i&&i.attach==t||function(e){e.setOption("disableInput",!1),e.off("cursorActivity",qe),e.state.vim=null,Me&&clearTimeout(Me),e.leaveVimMode()}(e)}function t(e,i){this==c7e.keyMap.vim&&(e.attached=!0,e.curOp&&(e.curOp.selectionChanged=!0),e.options.$customCursor=g7e),i&&i.attach==t||function(e){e.setOption("disableInput",!0),e.setOption("showCursorWhenSelecting",!1),c7e.signal(e,"vim-mode-change",{mode:"normal"}),e.on("cursorActivity",qe),T(e),e.enterVimMode()}(e)}function i(e,t){if(t){if(this[e])return this[e];var i=function(e){if("'"==e.charAt(0))return e.charAt(1);if("AltGraph"===e)return!1;var t=e.split(/-(?!$)/),i=t[t.length-1];if(1==t.length&&1==t[0].length)return!1;if(2==t.length&&"Shift"==t[0]&&1==i.length)return!1;for(var s=!1,r=0;r<t.length;r++){var a=t[r];a in n?t[r]=n[a]:s=!0,a in o&&(t[r]=o[a])}return!!s&&(v(i)&&(t[t.length-1]=i.toLowerCase()),"<"+t.join("-")+">")}(e);if(!i)return!1;var s=A.findKey(t,i);return"function"==typeof s&&c7e.signal(t,"vim-keypress",i),s}}c7e.defineOption("vimMode",!1,(function(e,t,i){t&&"vim"!=e.getOption("keyMap")?e.setOption("keyMap","vim"):!t&&i!=c7e.Init&&/^vim/.test(e.getOption("keyMap"))&&e.setOption("keyMap","default")}));var n={Shift:"S",Ctrl:"C",Alt:"A",Cmd:"D",Mod:"A",CapsLock:""},o={Enter:"CR",Backspace:"BS",Delete:"Del",Insert:"Ins"},s=/[\d]/,r=[c7e.isWordChar,function(e){return e&&!c7e.isWordChar(e)&&!/\s/.test(e)}],a=[function(e){return/\S/.test(e)}];function l(e,t){for(var i=[],n=e;n<e+t;n++)i.push(String.fromCharCode(n));return i}var d,h=l(65,26),c=l(97,26),u=l(48,10),g=[].concat(h,c,u,["<",">"]),p=[].concat(h,c,u,["-",'"',".",":","_","/"]);try{d=new RegExp("^[\\p{Lu}]$","u")}catch(e){d=/^[A-Z]$/}function m(e,t){return t>=e.firstLine()&&t<=e.lastLine()}function f(e){return/^[a-z]$/.test(e)}function _(e){return s.test(e)}function v(e){return d.test(e)}function b(e){return/^\s*$/.test(e)}function w(e){return-1!=".?!".indexOf(e)}function C(e,t){for(var i=0;i<t.length;i++)if(t[i]==e)return!0;return!1}var y={};function S(e,t,i,n,o){if(void 0===t&&!o)throw Error("defaultValue is required unless callback is provided");if(i||(i="string"),y[e]={type:i,defaultValue:t,callback:o},n)for(var s=0;s<n.length;s++)y[n[s]]=y[e];t&&x(e,t)}function x(e,t,i,n){var o=y[e],s=(n=n||{}).scope;if(!o)return new Error("Unknown option: "+e);if("boolean"==o.type){if(t&&!0!==t)return new Error("Invalid argument: "+e+"="+t);!1!==t&&(t=!0)}o.callback?("local"!==s&&o.callback(t,void 0),"global"!==s&&i&&o.callback(t,i)):("local"!==s&&(o.value="boolean"==o.type?!!t:t),"global"!==s&&i&&(i.state.vim.options[e]={value:t}))}function k(e,t,i){var n=y[e],o=(i=i||{}).scope;if(!n)return new Error("Unknown option: "+e);if(n.callback){var s=t&&n.callback(void 0,t);return"global"!==o&&void 0!==s?s:"local"!==o?n.callback():void 0}return((s="global"!==o&&t&&t.state.vim.options[e])||"local"!==o&&n||{}).value}S("filetype",void 0,"string",["ft"],(function(e,t){if(void 0!==t){if(void 0===e)return"null"==(i=t.getOption("mode"))?"":i;var i=""==e?"null":e;t.setOption("mode",i)}}));var L,D,E=function(){var e=100,t=-1,i=0,n=0,o=new Array(e);function s(s,r){(t+=r)>i?t=i:t<n&&(t=n);var a=o[(e+t)%e];if(a&&!a.find()){var l,d=r>0?1:-1,h=s.getCursor();do{if((a=o[(e+(t+=d))%e])&&(l=a.find())&&!Y(h,l))break}while(t<i&&t>n)}return a}return{cachedCursor:void 0,add:function(s,r,a){var l=o[t%e];function d(i){var n=++t%e,r=o[n];r&&r.clear(),o[n]=s.setBookmark(i)}if(l){var h=l.find();h&&!Y(h,r)&&d(r)}else d(r);d(a),i=t,(n=t-e+1)<0&&(n=0)},find:function(e,i){var n=t,o=s(e,i);return t=n,o&&o.find()},move:s}},N=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};function I(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=N()}function T(e){return e.state.vim||(e.state.vim={inputState:new R,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},insertMode:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:null,sel:{},options:{}}),e.state.vim}function M(){for(var e in L={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:E(),macroModeState:new I,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new F({}),searchHistoryController:new B,exCommandHistoryController:new B},y){var t=y[e];t.value=t.defaultValue}}I.prototype={exitMacroRecordMode:function(){var e=L.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1},enterMacroRecordMode:function(e,t){var i=L.registerController.getRegister(t);i&&(i.clear(),this.latestRegister=t,e.openDialog&&(this.onRecordingDone=e.openDialog(document.createTextNode("(recording)["+t+"]"),null,{bottom:!0})),this.isRecording=!0)}};var A={buildKeyMap:function(){},getRegisterController:function(){return L.registerController},resetVimGlobalState_:M,getVimGlobalState_:function(){return L},maybeInitVimState_:T,suppressErrorLogging:!1,InsertModeKey:$e,map:function(e,t,i){He.map(e,t,i)},unmap:function(e,t){return He.unmap(e,t)},noremap:function(e,t,i){function n(e){return e?[e]:["normal","insert","visual"]}for(var o=n(i),s=p7e.length,r=s-m7e;r<s&&o.length;r++){var a=p7e[r];if(!(a.keys!=t||i&&a.context&&a.context!==i||"ex"===a.type.substr(0,2)||"key"===a.type.substr(0,3))){var l={};for(var d in a)l[d]=a[d];l.keys=e,i&&!l.context&&(l.context=i),this._mapCommand(l);var h=n(a.context);o=o.filter((function(e){return-1===h.indexOf(e)}))}}},mapclear:function(e){var t=p7e.length,i=m7e,n=p7e.slice(0,t-i);if(p7e=p7e.slice(t-i),e)for(var o=n.length-1;o>=0;o--){var s=n[o];if(e!==s.context)if(s.context)this._mapCommand(s);else{var r=["normal","insert","visual"];for(var a in r)if(r[a]!==e){var l={};for(var d in s)l[d]=s[d];l.context=r[a],this._mapCommand(l)}}}},setOption:x,getOption:k,defineOption:S,defineEx:function(e,t,i){if(t){if(0!==e.indexOf(t))throw new Error('(Vim.defineEx) "'+t+'" is not a prefix of "'+e+'", command not registered')}else t=e;Ve[e]=i,He.commandMap_[t]={name:e,shortName:t,type:"api"}},handleKey:function(e,t,i){var n=this.findKey(e,t,i);if("function"==typeof n)return n()},findKey:function(e,t,i){var n,o=T(e);function s(){if("<Esc>"==t){if(o.visualMode)de(e);else{if(!o.insertMode)return;ze(e)}return O(e),!0}}return n=o.insertMode?function(){if(s())return!0;for(var i=o.inputState.keyBuffer=o.inputState.keyBuffer+t,n=1==t.length,r=W.matchCommand(i,p7e,o.inputState,"insert");i.length>1&&"full"!=r.type;){i=o.inputState.keyBuffer=i.slice(1);var a=W.matchCommand(i,p7e,o.inputState,"insert");"none"!=a.type&&(r=a)}if("none"==r.type)return O(e),!1;if("partial"==r.type)return D&&window.clearTimeout(D),D=window.setTimeout((function(){o.insertMode&&o.inputState.keyBuffer&&O(e)}),k("insertModeEscKeysTimeout")),!n;if(D&&window.clearTimeout(D),n){for(var l=e.listSelections(),d=0;d<l.length;d++){var h=l[d].head;e.replaceRange("",q(h,0,-(i.length-1)),h,"+input")}L.macroModeState.lastInsertModeChanges.changes.pop()}return O(e),r.command}():function(){if(function(){var n=L.macroModeState;if(n.isRecording){if("q"==t)return n.exitMacroRecordMode(),O(e),!0;"mapping"!=i&&function(e,t){if(!e.isPlaying){var i=e.latestRegister,n=L.registerController.getRegister(i);n&&n.pushText(t)}}(n,t)}}()||s())return!0;var n=o.inputState.keyBuffer=o.inputState.keyBuffer+t;if(/^[1-9]\d*$/.test(n))return!0;if(!(l=/^(\d*)(.*)$/.exec(n)))return O(e),!1;var r=o.visualMode?"visual":"normal",a=l[2]||l[1];o.inputState.operatorShortcut&&o.inputState.operatorShortcut.slice(-1)==a&&(a=o.inputState.operatorShortcut);var l,d=W.matchCommand(a,p7e,o.inputState,r);return"none"==d.type?(O(e),!1):"partial"==d.type||(o.inputState.keyBuffer="",(l=/^(\d*)(.*)$/.exec(n))[1]&&"0"!=l[1]&&o.inputState.pushRepeatDigit(l[1]),d.command)}(),!1===n?o.insertMode||1!==t.length?void 0:function(){return!0}:!0===n?function(){return!0}:function(){return e.operation((function(){e.curOp.isVimOp=!0;try{"keyToKey"==n.type?function(i){for(var n;i;)n=/<\w+-.+?>|<\w+>|./.exec(i),t=n[0],i=i.substring(n.index+t.length),A.handleKey(e,t,"mapping")}(n.toKeys):W.processCommand(e,o,n)}catch(t){throw e.state.vim=void 0,T(e),A.suppressErrorLogging||console.log(t),t}finally{e.curOp.isVimOp=!1}return!0}))}},handleEx:function(e,t){He.processCommand(e,t)},defineMotion:function(e,t){V[e]=t},defineAction:function(e,t){U[e]=t},defineOperator:function(e,t){z[e]=t},mapCommand:function(e,t,i,n,o){var s={keys:e,type:t};for(var r in s[t]=i,s[t+"Args"]=n,o)s[r]=o[r];Ue(s)},_mapCommand:Ue,defineRegister:function(e,t){var i=L.registerController.registers;if(!e||1!=e.length)throw Error("Register name must be 1 character");if(i[e])throw Error("Register already defined "+e);i[e]=t,p.push(e)},exitVisualMode:de,exitInsertMode:ze};function R(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=null}function O(e,t){e.state.vim.inputState=new R,c7e.signal(e,"vim-command-done",t)}function P(e,t,i){this.clear(),this.keyBuffer=[e||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!t,this.blockwise=!!i}function F(e){this.registers=e,this.unnamedRegister=e['"']=new P,e["."]=new P,e[":"]=new P,e["/"]=new P}function B(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}R.prototype.pushRepeatDigit=function(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)},R.prototype.getRepeat=function(){var e=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(e=1,this.prefixRepeat.length>0&&(e*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(e*=parseInt(this.motionRepeat.join(""),10))),e},P.prototype={setText:function(e,t,i){this.keyBuffer=[e||""],this.linewise=!!t,this.blockwise=!!i},pushText:function(e,t){t&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(e)},pushInsertModeChanges:function(e){this.insertModeChanges.push(N(e))},pushSearchQuery:function(e){this.searchQueries.push(e)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},F.prototype={pushText:function(e,t,i,n,o){if("_"!==e){n&&"\n"!==i.charAt(i.length-1)&&(i+="\n");var s=this.isValidRegister(e)?this.getRegister(e):null;if(s)v(e)?s.pushText(i,n):s.setText(i,n,o),this.unnamedRegister.setText(s.toString(),n);else{switch(t){case"yank":this.registers[0]=new P(i,n,o);break;case"delete":case"change":-1==i.indexOf("\n")?this.registers["-"]=new P(i,n):(this.shiftNumericRegisters_(),this.registers[1]=new P(i,n))}this.unnamedRegister.setText(i,n,o)}}},getRegister:function(e){return this.isValidRegister(e)?(e=e.toLowerCase(),this.registers[e]||(this.registers[e]=new P),this.registers[e]):this.unnamedRegister},isValidRegister:function(e){return e&&C(e,p)},shiftNumericRegisters_:function(){for(var e=9;e>=2;e--)this.registers[e]=this.getRegister(""+(e-1))}},B.prototype={nextMatch:function(e,t){var i=this.historyBuffer,n=t?-1:1;null===this.initialPrefix&&(this.initialPrefix=e);for(var o=this.iterator+n;t?o>=0:o<i.length;o+=n)for(var s=i[o],r=0;r<=s.length;r++)if(this.initialPrefix==s.substring(0,r))return this.iterator=o,s;return o>=i.length?(this.iterator=i.length,this.initialPrefix):o<0?e:void 0},pushInput:function(e){var t=this.historyBuffer.indexOf(e);t>-1&&this.historyBuffer.splice(t,1),e.length&&this.historyBuffer.push(e)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var W={matchCommand:function(e,t,i,n){var o,s=function(e,t,i,n){for(var o,s=[],r=[],a=0;a<t.length;a++){var l=t[a];"insert"==i&&"insert"!=l.context||l.context&&l.context!=i||n.operator&&"action"==l.type||!(o=$(e,l.keys))||("partial"==o&&s.push(l),"full"==o&&r.push(l))}return{partial:s.length&&s,full:r.length&&r}}(e,t,n,i);if(!s.full&&!s.partial)return{type:"none"};if(!s.full&&s.partial)return{type:"partial"};for(var r=0;r<s.full.length;r++){var a=s.full[r];o||(o=a)}if("<character>"==o.keys.slice(-11)){var l=function(e){var t=/^.*(<[^>]+>)$/.exec(e),i=t?t[1]:e.slice(-1);if(i.length>1)switch(i){case"<CR>":i="\n";break;case"<Space>":i=" ";break;default:i=""}return i}(e);if(!l)return{type:"none"};i.selectedCharacter=l}return{type:"full",command:o}},processCommand:function(e,t,i){switch(t.inputState.repeatOverride=i.repeatOverride,i.type){case"motion":this.processMotion(e,t,i);break;case"operator":this.processOperator(e,t,i);break;case"operatorMotion":this.processOperatorMotion(e,t,i);break;case"action":this.processAction(e,t,i);break;case"search":this.processSearch(e,t,i);break;case"ex":case"keyToEx":this.processEx(e,t,i)}},processMotion:function(e,t,i){t.inputState.motion=i.motion,t.inputState.motionArgs=j(i.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,i){var n=t.inputState;if(n.operator){if(n.operator==i.operator)return n.motion="expandToLine",n.motionArgs={linewise:!0},void this.evalInput(e,t);O(e)}n.operator=i.operator,n.operatorArgs=j(i.operatorArgs),i.keys.length>1&&(n.operatorShortcut=i.keys),i.exitVisualBlock&&(t.visualBlock=!1,ae(e)),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,i){var n=t.visualMode,o=j(i.operatorMotionArgs);o&&n&&o.visualLine&&(t.visualLine=!0),this.processOperator(e,t,i),n||this.processMotion(e,t,i)},processAction:function(e,t,i){var n=t.inputState,o=n.getRepeat(),s=!!o,r=j(i.actionArgs)||{};n.selectedCharacter&&(r.selectedCharacter=n.selectedCharacter),i.operator&&this.processOperator(e,t,i),i.motion&&this.processMotion(e,t,i),(i.motion||i.operator)&&this.evalInput(e,t),r.repeat=o||1,r.repeatIsExplicit=s,r.registerName=n.registerName,O(e),t.lastMotion=null,i.isEdit&&this.recordLastEdit(t,n,i),U[i.action](e,r,t)},processSearch:function(e,t,i){if(e.getSearchCursor){var n=i.searchArgs.forward,o=i.searchArgs.wholeWordOnly;Se(e).setReversed(!n);var s=n?"/":"?",r=Se(e).getQuery(),a=e.getScrollInfo();switch(i.searchArgs.querySrc){case"prompt":var l=L.macroModeState;l.isPlaying?u(c=l.replaySearchQueries.shift(),!0,!1):Ie(e,{onClose:function(t){e.scrollTo(a.left,a.top),u(t,!0,!0);var i=L.macroModeState;i.isRecording&&function(e,t){if(!e.isPlaying){var i=e.latestRegister,n=L.registerController.getRegister(i);n&&n.pushSearchQuery&&n.pushSearchQuery(t)}}(i,t)},prefix:s,desc:"(JavaScript regexp)",onKeyUp:function(t,i,o){var s,r,l,d=c7e.keyName(t);"Up"==d||"Down"==d?(s="Up"==d,r=t.target?t.target.selectionEnd:0,o(i=L.searchHistoryController.nextMatch(i,s)||""),r&&t.target&&(t.target.selectionEnd=t.target.selectionStart=Math.min(r,t.target.value.length))):"Left"!=d&&"Right"!=d&&"Ctrl"!=d&&"Alt"!=d&&"Shift"!=d&&L.searchHistoryController.reset();try{l=Te(e,i,!0,!0)}catch(t){}l?e.scrollIntoView(Re(e,!n,l),30):(Oe(e),e.scrollTo(a.left,a.top))},onKeyDown:function(t,i,n){var o=c7e.keyName(t);"Esc"==o||"Ctrl-C"==o||"Ctrl-["==o||"Backspace"==o&&""==i?(L.searchHistoryController.pushInput(i),L.searchHistoryController.reset(),Te(e,r),Oe(e),e.scrollTo(a.left,a.top),c7e.e_stop(t),O(e),n(),e.focus()):"Up"==o||"Down"==o?c7e.e_stop(t):"Ctrl-U"==o&&(c7e.e_stop(t),n(""))}});break;case"wordUnderCursor":var d=ce(e,!1,0,!1,!0),h=!0;if(d||(d=ce(e,!1,0,!1,!1),h=!1),!d)return;var c=e.getLine(d.start.line).substring(d.start.ch,d.end.ch);c=h&&o?"\\b"+c+"\\b":c.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1"),L.jumpList.cachedCursor=e.getCursor(),e.setCursor(d.start),u(c,!0,!1)}}function u(n,o,s){L.searchHistoryController.pushInput(n),L.searchHistoryController.reset();try{Te(e,n,o,s)}catch(t){return Ne(e,"Invalid regex: "+n),void O(e)}W.processMotion(e,t,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:i.searchArgs.toJumplist}})}},processEx:function(e,t,i){function n(t){L.exCommandHistoryController.pushInput(t),L.exCommandHistoryController.reset(),He.processCommand(e,t)}function o(t,i,n){var o,s,r=c7e.keyName(t);("Esc"==r||"Ctrl-C"==r||"Ctrl-["==r||"Backspace"==r&&""==i)&&(L.exCommandHistoryController.pushInput(i),L.exCommandHistoryController.reset(),c7e.e_stop(t),O(e),n(),e.focus()),"Up"==r||"Down"==r?(c7e.e_stop(t),o="Up"==r,s=t.target?t.target.selectionEnd:0,n(i=L.exCommandHistoryController.nextMatch(i,o)||""),s&&t.target&&(t.target.selectionEnd=t.target.selectionStart=Math.min(s,t.target.value.length))):"Ctrl-U"==r?(c7e.e_stop(t),n("")):"Left"!=r&&"Right"!=r&&"Ctrl"!=r&&"Alt"!=r&&"Shift"!=r&&L.exCommandHistoryController.reset()}"keyToEx"==i.type?He.processCommand(e,i.exArgs.input):t.visualMode?Ie(e,{onClose:n,prefix:":",value:"'<,'>",onKeyDown:o,selectValueOnOpen:!1}):Ie(e,{onClose:n,prefix:":",onKeyDown:o})},evalInput:function(e,t){var i,n,o,s=t.inputState,r=s.motion,a=s.motionArgs||{},l=s.operator,d=s.operatorArgs||{},h=s.registerName,c=t.sel,u=Z(t.visualMode?K(e,c.head):e.getCursor("head")),g=Z(t.visualMode?K(e,c.anchor):e.getCursor("anchor")),p=Z(u),m=Z(g);if(l&&this.recordLastEdit(t,s),(o=void 0!==s.repeatOverride?s.repeatOverride:s.getRepeat())>0&&a.explicitRepeat?a.repeatIsExplicit=!0:(a.noRepeat||!a.explicitRepeat&&0===o)&&(o=1,a.repeatIsExplicit=!1),s.selectedCharacter&&(a.selectedCharacter=d.selectedCharacter=s.selectedCharacter),a.repeat=o,O(e),r){var f=V[r](e,u,a,t,s);if(t.lastMotion=V[r],!f)return;if(a.toJumplist){var _=L.jumpList,v=_.cachedCursor;v?(ue(e,v,f),delete _.cachedCursor):ue(e,u,f)}f instanceof Array?(n=f[0],i=f[1]):i=f,i||(i=Z(u)),t.visualMode?(t.visualBlock&&i.ch===1/0||(i=K(e,i)),n&&(n=K(e,n)),n=n||m,c.anchor=n,c.head=i,ae(e),be(e,t,"<",Q(n,i)?n:i),be(e,t,">",Q(n,i)?i:n)):l||(i=K(e,i),e.setCursor(i.line,i.ch))}if(l){if(d.lastSel){n=m;var w=d.lastSel,C=Math.abs(w.head.line-w.anchor.line),y=Math.abs(w.head.ch-w.anchor.ch);i=w.visualLine?new u7e(m.line+C,m.ch):w.visualBlock?new u7e(m.line+C,m.ch+y):w.head.line==w.anchor.line?new u7e(m.line,m.ch+y):new u7e(m.line+C,m.ch),t.visualMode=!0,t.visualLine=w.visualLine,t.visualBlock=w.visualBlock,c=t.sel={anchor:n,head:i},ae(e)}else t.visualMode&&(d.lastSel={anchor:Z(c.anchor),head:Z(c.head),visualBlock:t.visualBlock,visualLine:t.visualLine});var S,x,k,D,E;if(t.visualMode){if(S=X(c.head,c.anchor),x=J(c.head,c.anchor),k=t.visualLine||d.linewise,E=le(e,{anchor:S,head:x},D=t.visualBlock?"block":k?"line":"char"),k){var N=E.ranges;if("block"==D)for(var I=0;I<N.length;I++)N[I].head.ch=te(e,N[I].head.line);else"line"==D&&(N[0].head=new u7e(N[0].head.line+1,0))}}else{if(S=Z(n||m),Q(x=Z(i||p),S)){var T=S;S=x,x=T}(k=a.linewise||d.linewise)?function(e,t,i){t.ch=0,i.ch=0,i.line++}(0,S,x):a.forward&&function(e,t,i){var n=e.getRange(t,i);if(/\n\s*$/.test(n)){var o=n.split("\n");o.pop();for(var s=o.pop();o.length>0&&s&&b(s);s=o.pop())i.line--,i.ch=0;s?(i.line--,i.ch=te(e,i.line)):i.ch=0}}(e,S,x),E=le(e,{anchor:S,head:x},D="char",!a.inclusive||k)}e.setSelections(E.ranges,E.primary),t.lastMotion=null,d.repeat=o,d.registerName=h,d.linewise=k;var M=z[l](e,d,E.ranges,m,i);t.visualMode&&de(e,null!=M),M&&e.setCursor(M)}},recordLastEdit:function(e,t,i){var n=L.macroModeState;n.isPlaying||(e.lastEditInputState=t,e.lastEditActionCommand=i,n.lastInsertModeChanges.changes=[],n.lastInsertModeChanges.expectCursorActivityForChange=!1,n.lastInsertModeChanges.visualBlock=e.visualBlock?e.sel.head.line-e.sel.anchor.line:0)}},V={moveToTopLine:function(e,t,i){var n=Pe(e).top+i.repeat-1;return new u7e(n,he(e.getLine(n)))},moveToMiddleLine:function(e){var t=Pe(e),i=Math.floor(.5*(t.top+t.bottom));return new u7e(i,he(e.getLine(i)))},moveToBottomLine:function(e,t,i){var n=Pe(e).bottom-i.repeat+1;return new u7e(n,he(e.getLine(n)))},expandToLine:function(e,t,i){return new u7e(t.line+i.repeat-1,1/0)},findNext:function(e,t,i){var n=Se(e),o=n.getQuery();if(o){var s=!i.forward;return s=n.isReversed()?!s:s,Ae(e,o),Re(e,s,o,i.repeat)}},findAndSelectNextInclusive:function(e,t,i,n,o){var s=Se(e),r=s.getQuery();if(r){var a=!i.forward,l=function(e,t,i,n,o){return void 0===n&&(n=1),e.operation((function(){var s=e.getCursor(),r=e.getSearchCursor(i,s),a=r.find(!t);!o.visualMode&&a&&Y(r.from(),s)&&r.find(!t);for(var l=0;l<n;l++)if(!(a=r.find(t))&&!(r=e.getSearchCursor(i,t?new u7e(e.lastLine()):new u7e(e.firstLine(),0))).find(t))return;return[r.from(),r.to()]}))}(e,a=s.isReversed()?!a:a,r,i.repeat,n);if(l){if(o.operator)return l;var d=l[0],h=new u7e(l[1].line,l[1].ch-1);if(n.visualMode){(n.visualLine||n.visualBlock)&&(n.visualLine=!1,n.visualBlock=!1,c7e.signal(e,"vim-mode-change",{mode:"visual",subMode:""}));var c=n.sel.anchor;if(c)return s.isReversed()?i.forward?[c,d]:[c,h]:i.forward?[c,h]:[c,d]}else n.visualMode=!0,n.visualLine=!1,n.visualBlock=!1,c7e.signal(e,"vim-mode-change",{mode:"visual",subMode:""});return a?[h,d]:[d,h]}}},goToMark:function(e,t,i,n){var o=Fe(e,n,i.selectedCharacter);return o?i.linewise?{line:o.line,ch:he(e.getLine(o.line))}:o:null},moveToOtherHighlightedEnd:function(e,t,i,n){if(n.visualBlock&&i.sameLine){var o=n.sel;return[K(e,new u7e(o.anchor.line,o.head.ch)),K(e,new u7e(o.head.line,o.anchor.ch))]}return[n.sel.head,n.sel.anchor]},jumpToMark:function(e,t,i,n){for(var o=t,s=0;s<i.repeat;s++){var r=o;for(var a in n.marks)if(f(a)){var l=n.marks[a].find();if(!((i.forward?Q(l,r):Q(r,l))||i.linewise&&l.line==r.line)){var d=Y(r,o),h=i.forward?ee(r,l,o):ee(o,l,r);(d||h)&&(o=l)}}}return i.linewise&&(o=new u7e(o.line,he(e.getLine(o.line)))),o},moveByCharacters:function(e,t,i){var n=t,o=i.repeat,s=i.forward?n.ch+o:n.ch-o;return new u7e(n.line,s)},moveByLines:function(e,t,i,n){var o=t,s=o.ch;switch(n.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:s=n.lastHPos;break;default:n.lastHPos=s}var r=i.repeat+(i.repeatOffset||0),a=i.forward?o.line+r:o.line-r,l=e.firstLine(),d=e.lastLine(),h=e.findPosV(o,i.forward?r:-r,"line",n.lastHSPos);return(i.forward?h.line>a:h.line<a)&&(a=h.line,s=h.ch),a<l&&o.line==l?this.moveToStartOfLine(e,t,i,n):a>d&&o.line==d?_e(e,t,i,n,!0):(i.toFirstChar&&(s=he(e.getLine(a)),n.lastHPos=s),n.lastHSPos=e.charCoords(new u7e(a,s),"div").left,new u7e(a,s))},moveByDisplayLines:function(e,t,i,n){var o=t;switch(n.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:n.lastHSPos=e.charCoords(o,"div").left}var s=i.repeat;if((a=e.findPosV(o,i.forward?s:-s,"line",n.lastHSPos)).hitSide)if(i.forward)var r={top:e.charCoords(a,"div").top+8,left:n.lastHSPos},a=e.coordsChar(r,"div");else{var l=e.charCoords(new u7e(e.firstLine(),0),"div");l.left=n.lastHSPos,a=e.coordsChar(l,"div")}return n.lastHPos=a.ch,a},moveByPage:function(e,t,i){var n=t,o=i.repeat;return e.findPosV(n,i.forward?o:-o,"page")},moveByParagraph:function(e,t,i){var n=i.forward?1:-1;return Ce(e,t,i.repeat,n)},moveBySentence:function(e,t,i){var n=i.forward?1:-1;return function(e,t,i,n){function o(e,t){if(t.pos+t.dir<0||t.pos+t.dir>=t.line.length){if(t.ln+=t.dir,!m(e,t.ln))return t.line=null,t.ln=null,void(t.pos=null);t.line=e.getLine(t.ln),t.pos=t.dir>0?0:t.line.length-1}else t.pos+=t.dir}function s(e,t,i,n){var s=""===(d=e.getLine(t)),r={line:d,ln:t,pos:i,dir:n},a={ln:r.ln,pos:r.pos},l=""===r.line;for(o(e,r);null!==r.line;){if(a.ln=r.ln,a.pos=r.pos,""===r.line&&!l)return{ln:r.ln,pos:r.pos};if(s&&""!==r.line&&!b(r.line[r.pos]))return{ln:r.ln,pos:r.pos};!w(r.line[r.pos])||s||r.pos!==r.line.length-1&&!b(r.line[r.pos+1])||(s=!0),o(e,r)}var d=e.getLine(a.ln);a.pos=0;for(var h=d.length-1;h>=0;--h)if(!b(d[h])){a.pos=h;break}return a}function r(e,t,i,n){var s={line:e.getLine(t),ln:t,pos:i,dir:n},r={ln:s.ln,pos:null},a=""===s.line;for(o(e,s);null!==s.line;){if(""===s.line&&!a)return null!==r.pos?r:{ln:s.ln,pos:s.pos};if(w(s.line[s.pos])&&null!==r.pos&&(s.ln!==r.ln||s.pos+1!==r.pos))return r;""===s.line||b(s.line[s.pos])||(a=!1,r={ln:s.ln,pos:s.pos}),o(e,s)}var l=e.getLine(r.ln);r.pos=0;for(var d=0;d<l.length;++d)if(!b(l[d])){r.pos=d;break}return r}for(var a={ln:t.line,pos:t.ch};i>0;)a=n<0?r(e,a.ln,a.pos,n):s(e,a.ln,a.pos,n),i--;return new u7e(a.ln,a.pos)}(e,t,i.repeat,n)},moveByScroll:function(e,t,i,n){var o,s=e.getScrollInfo(),r=i.repeat;r||(r=s.clientHeight/(2*e.defaultTextHeight()));var a=e.charCoords(t,"local");if(i.repeat=r,!(o=V.moveByDisplayLines(e,t,i,n)))return null;var l=e.charCoords(o,"local");return e.scrollTo(null,s.top+l.top-a.top),o},moveByWords:function(e,t,i){return function(e,t,i,n,o,s){var r=Z(t),a=[];(n&&!o||!n&&o)&&i++;for(var l=!(n&&o),d=0;d<i;d++){var h=fe(e,t,n,s,l);if(!h){var c=te(e,e.lastLine());a.push(n?{line:e.lastLine(),from:c,to:c}:{line:0,from:0,to:0});break}a.push(h),t=new u7e(h.line,n?h.to-1:h.from)}var u=a.length!=i,g=a[0],p=a.pop();return n&&!o?(u||g.from==r.ch&&g.line==r.line||(p=a.pop()),new u7e(p.line,p.from)):n&&o?new u7e(p.line,p.to-1):!n&&o?(u||g.to==r.ch&&g.line==r.line||(p=a.pop()),new u7e(p.line,p.to)):new u7e(p.line,p.from)}(e,t,i.repeat,!!i.forward,!!i.wordEnd,!!i.bigWord)},moveTillCharacter:function(e,t,i){var n=ve(e,i.repeat,i.forward,i.selectedCharacter),o=i.forward?-1:1;return ge(o,i),n?(n.ch+=o,n):null},moveToCharacter:function(e,t,i){var n=i.repeat;return ge(0,i),ve(e,n,i.forward,i.selectedCharacter)||t},moveToSymbol:function(e,t,i){return function(e,t,i,n){var o=Z(e.getCursor()),s=i?1:-1,r=i?e.lineCount():-1,a=o.ch,l=o.line,d=e.getLine(l),h={lineText:d,nextCh:d.charAt(a),lastCh:null,index:a,symb:n,reverseSymb:(i?{")":"(","}":"{"}:{"(":")","{":"}"})[n],forward:i,depth:0,curMoveThrough:!1},c=pe[n];if(!c)return o;var u=me[c].init,g=me[c].isComplete;for(u&&u(h);l!==r&&t;){if(h.index+=s,h.nextCh=h.lineText.charAt(h.index),!h.nextCh){if(l+=s,h.lineText=e.getLine(l)||"",s>0)h.index=0;else{var p=h.lineText.length;h.index=p>0?p-1:0}h.nextCh=h.lineText.charAt(h.index)}g(h)&&(o.line=l,o.ch=h.index,t--)}return h.nextCh||h.curMoveThrough?new u7e(l,h.index):o}(e,i.repeat,i.forward,i.selectedCharacter)||t},moveToColumn:function(e,t,i,n){var o=i.repeat;return n.lastHPos=o-1,n.lastHSPos=e.charCoords(t,"div").left,function(e,t){var i=e.getCursor().line;return K(e,new u7e(i,t-1))}(e,o)},moveToEol:function(e,t,i,n){return _e(e,t,i,n,!1)},moveToFirstNonWhiteSpaceCharacter:function(e,t){var i=t;return new u7e(i.line,he(e.getLine(i.line)))},moveToMatchedSymbol:function(e,t){var i=t,n=i.line,o=i.ch;if(o<e.getLine(n).length){var s="<"===o||">"===o?/[(){}[\]<>]/:/[(){}[\]]/;return e.findMatchingBracket(new u7e(n,o),{bracketRegex:s}).to}return i},moveToStartOfLine:function(e,t){return new u7e(t.line,0)},moveToLineOrEdgeOfDocument:function(e,t,i){var n=i.forward?e.lastLine():e.firstLine();return i.repeatIsExplicit&&(n=i.repeat-e.getOption("firstLineNumber")),new u7e(n,he(e.getLine(n)))},moveToStartOfDisplayLine:function(e){return e.execCommand("goLineLeft"),e.getCursor()},moveToEndOfDisplayLine:function(e){e.execCommand("goLineRight");var t=e.getCursor();return"before"==t.sticky&&t.ch--,t},textObjectManipulation:function(e,t,i,n){var o=i.selectedCharacter;"b"==o?o="(":"B"==o&&(o="{");var s,r=!i.textObjectInner;if({"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"}[o])s=function(e,t,i,n){var o,s,r=t,a={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[i],l={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[i],d=e.getLine(r.line).charAt(r.ch)===l?1:0;if(o=e.scanForBracket(new u7e(r.line,r.ch+d),-1,void 0,{bracketRegex:a}),s=e.scanForBracket(new u7e(r.line,r.ch+d),1,void 0,{bracketRegex:a}),!o||!s)return{start:r,end:r};if(o=o.pos,s=s.pos,o.line==s.line&&o.ch>s.ch||o.line>s.line){var h=o;o=s,s=h}return n?s.ch+=1:o.ch+=1,{start:o,end:s}}(e,t,o,r);else if({"'":!0,'"':!0,"`":!0}[o])s=function(e,t,i,n){var o,s,r,a,l=Z(t),d=e.getLine(l.line).split(""),h=d.indexOf(i);if(l.ch<h?l.ch=h:h<l.ch&&d[l.ch]==i&&(s=l.ch,--l.ch),d[l.ch]!=i||s)for(r=l.ch;r>-1&&!o;r--)d[r]==i&&(o=r+1);else o=l.ch+1;if(o&&!s)for(r=o,a=d.length;r<a&&!s;r++)d[r]==i&&(s=r);return o&&s?(n&&(--o,++s),{start:new u7e(l.line,o),end:new u7e(l.line,s)}):{start:l,end:l}}(e,t,o,r);else if("W"===o)s=ce(e,r,0,!0);else if("w"===o)s=ce(e,r,0,!1);else if("p"===o)if(s=Ce(e,t,i.repeat,0,r),i.linewise=!0,n.visualMode)n.visualLine||(n.visualLine=!0);else{var a=n.inputState.operatorArgs;a&&(a.linewise=!0),s.end.line--}else{if("t"!==o)return null;s=function(e,t,i){var n=t;if(!c7e.findMatchingTag||!c7e.findEnclosingTag)return{start:n,end:n};var o=c7e.findMatchingTag(e,t)||c7e.findEnclosingTag(e,t);return o&&o.open&&o.close?i?{start:o.open.from,end:o.close.to}:{start:o.open.to,end:o.close.from}:{start:n,end:n}}(e,t,r)}return e.state.vim.visualMode?function(e,t,i){var n,o=e.state.vim.sel,s=o.head,r=o.anchor;return Q(i,t)&&(n=i,i=t,t=n),Q(s,r)?(s=X(t,s),r=J(r,i)):(r=X(t,r),-1==(s=q(s=J(s,i),0,-1)).ch&&s.line!=e.firstLine()&&(s=new u7e(s.line-1,te(e,s.line-1)))),[r,s]}(e,s.start,s.end):[s.start,s.end]},repeatLastCharacterSearch:function(e,t,i){var n=L.lastCharacterSearch,o=i.repeat,s=i.forward===n.forward,r=(n.increment?1:0)*(s?-1:1);e.moveH(-r,"char"),i.inclusive=!!s;var a=ve(e,o,s,n.selectedCharacter);return a?(a.ch+=r,a):(e.moveH(r,"char"),t)}};function H(e,t){for(var i=[],n=0;n<t;n++)i.push(e);return i}var z={change:function(e,t,i){var n,o,s=e.state.vim,r=i[0].anchor,a=i[0].head;if(s.visualMode)if(t.fullLine)a.ch=Number.MAX_VALUE,a.line--,e.setSelection(r,a),o=e.getSelection(),e.replaceSelections(""),n=r;else{o=e.getSelection();var l=H("",i.length);e.replaceSelections(l),n=X(i[0].head,i[0].anchor)}else{o=e.getRange(r,a);var d=s.lastEditInputState||{};if("moveByWords"==d.motion&&!b(o)){var h=/\s+$/.exec(o);h&&d.motionArgs&&d.motionArgs.forward&&(a=q(a,0,-h[0].length),o=o.slice(0,-h[0].length))}var c=new u7e(r.line-1,Number.MAX_VALUE),u=e.firstLine()==e.lastLine();a.line>e.lastLine()&&t.linewise&&!u?e.replaceRange("",c,a):e.replaceRange("",r,a),t.linewise&&(u||(e.setCursor(c),c7e.commands.newlineAndIndent(e)),r.ch=Number.MAX_VALUE),n=r}L.registerController.pushText(t.registerName,"change",o,t.linewise,i.length>1),U.enterInsertMode(e,{head:n},e.state.vim)},delete:function(e,t,i){var n,o;e.pushUndoStop();var s=e.state.vim;if(s.visualBlock){o=e.getSelection();var r=H("",i.length);e.replaceSelections(r),n=X(i[0].head,i[0].anchor)}else{var a=i[0].anchor,l=i[0].head;t.linewise&&l.line!=e.firstLine()&&a.line==e.lastLine()&&a.line==l.line-1&&(a.line==e.firstLine()?a.ch=0:a=new u7e(a.line-1,te(e,a.line-1))),o=e.getRange(a,l),e.replaceRange("",a,l),n=a,t.linewise&&(n=V.moveToFirstNonWhiteSpaceCharacter(e,a))}return L.registerController.pushText(t.registerName,"delete",o,t.linewise,s.visualBlock),K(e,n)},indent:function(e,t,i){var n=e.state.vim,o=i[0].anchor.line,s=n.visualBlock?i[i.length-1].anchor.line:i[0].head.line,r=n.visualMode?t.repeat:1;t.linewise&&s--,e.pushUndoStop();for(var a=o;a<=s;a++)for(var l=0;l<r;l++)e.indentLine(a,t.indentRight);return e.pushUndoStop(),V.moveToFirstNonWhiteSpaceCharacter(e,i[0].anchor)},indentAuto:function(e,t,i){return e.execCommand("indentAuto"),V.moveToFirstNonWhiteSpaceCharacter(e,i[0].anchor)},changeCase:function(e,t,i,n,o){for(var s=e.getSelections(),r=[],a=t.toLower,l=0;l<s.length;l++){var d=s[l],h="";if(!0===a)h=d.toLowerCase();else if(!1===a)h=d.toUpperCase();else for(var c=0;c<d.length;c++){var u=d.charAt(c);h+=v(u)?u.toLowerCase():u.toUpperCase()}r.push(h)}return e.replaceSelections(r),t.shouldMoveCursor?o:!e.state.vim.visualMode&&t.linewise&&i[0].anchor.line+1==i[0].head.line?V.moveToFirstNonWhiteSpaceCharacter(e,n):t.linewise?n:X(i[0].anchor,i[0].head)},yank:function(e,t,i,n){var o=e.state.vim,s=e.getSelection(),r=o.visualMode?X(o.sel.anchor,o.sel.head,i[0].head,i[0].anchor):n;return L.registerController.pushText(t.registerName,"yank",s,t.linewise,o.visualBlock),r}},U={jumpListWalk:function(e,t,i){if(!i.visualMode){var n=t.repeat,o=t.forward,s=L.jumpList.move(e,o?n:-n),r=s?s.find():void 0;r=r||e.getCursor(),e.setCursor(r)}},scroll:function(e,t,i){if(!i.visualMode){var n=t.repeat||1,o=e.defaultTextHeight(),s=e.getScrollInfo().top,r=o*n,a=t.forward?s+r:s-r,l=Z(e.getCursor()),d=e.charCoords(l,"local");if(t.forward)a>d.top?(l.line+=(a-d.top)/o,l.line=Math.ceil(l.line),e.setCursor(l),d=e.charCoords(l,"local"),e.scrollTo(null,d.top)):e.scrollTo(null,a);else{var h=a+e.getScrollInfo().clientHeight;h<d.bottom?(l.line-=(d.bottom-h)/o,l.line=Math.floor(l.line),e.setCursor(l),d=e.charCoords(l,"local"),e.scrollTo(null,d.bottom-e.getScrollInfo().clientHeight)):e.scrollTo(null,a)}}},scrollToCursor:function(e,t){var i=e.getCursor().line,n=e.charCoords(new u7e(i,0),"local"),o=e.getScrollInfo().clientHeight,s=n.top,r=n.bottom-s;switch(t.position){case"center":s=s-o/2+r;break;case"bottom":s=s-o+r}e.moveCurrentLineTo(s)},replayMacro:function(e,t,i){var n=t.selectedCharacter,o=t.repeat,s=L.macroModeState;for("@"==n?n=s.latestRegister:s.latestRegister=n;o--;)Ke(e,i,s,n)},enterMacroRecordMode:function(e,t){var i=L.macroModeState,n=t.selectedCharacter;L.registerController.isValidRegister(n)&&i.enterMacroRecordMode(e,n)},toggleOverwrite:function(e){e.state.overwrite?(e.toggleOverwrite(!1),e.setOption("keyMap","vim-insert"),c7e.signal(e,"vim-mode-change",{mode:"insert"})):(e.toggleOverwrite(!0),e.setOption("keyMap","vim-replace"),c7e.signal(e,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(e,t,i){if(!e.getOption("readOnly")){i.insertMode=!0,i.insertModeRepeat=t&&t.repeat||1;var n=t?t.insertAt:null,o=i.sel,s=t.head||e.getCursor("head"),r=e.listSelections().length;if("eol"==n)s=new u7e(s.line,te(e,s.line));else if("bol"==n)s=new u7e(s.line,0);else if("charAfter"==n)s=q(s,0,1);else if("firstNonBlank"==n)s=V.moveToFirstNonWhiteSpaceCharacter(e,s);else if("startOfSelectedArea"==n){if(!i.visualMode)return;i.visualBlock?(s=new u7e(Math.min(o.head.line,o.anchor.line),Math.min(o.head.ch,o.anchor.ch)),r=Math.abs(o.head.line-o.anchor.line)+1):s=o.head.line<o.anchor.line?o.head:new u7e(o.anchor.line,0)}else if("endOfSelectedArea"==n){if(!i.visualMode)return;i.visualBlock?(s=new u7e(Math.min(o.head.line,o.anchor.line),Math.max(o.head.ch,o.anchor.ch)+1),r=Math.abs(o.head.line-o.anchor.line)+1):s=o.head.line>=o.anchor.line?q(o.head,0,1):new u7e(o.anchor.line,0)}else if("inplace"==n){if(i.visualMode)return}else"lastEdit"==n&&(s=Be(e)||s);e.setOption("disableInput",!1),t&&t.replace?(e.toggleOverwrite(!0),e.setOption("keyMap","vim-replace"),c7e.signal(e,"vim-mode-change",{mode:"replace"})):(e.toggleOverwrite(!1),e.setOption("keyMap","vim-insert"),c7e.signal(e,"vim-mode-change",{mode:"insert"})),L.macroModeState.isPlaying||(e.on("change",je),c7e.on(e.getInputField(),"keydown",Ge)),i.visualMode&&de(e),se(e,s,r)}},toggleVisualMode:function(e,t,i){var n,o=t.repeat,s=e.getCursor();i.visualMode?i.visualLine^t.linewise||i.visualBlock^t.blockwise?(i.visualLine=!!t.linewise,i.visualBlock=!!t.blockwise,c7e.signal(e,"vim-mode-change",{mode:"visual",subMode:i.visualLine?"linewise":i.visualBlock?"blockwise":""}),ae(e)):de(e):(i.visualMode=!0,i.visualLine=!!t.linewise,i.visualBlock=!!t.blockwise,n=K(e,new u7e(s.line,s.ch+o-1)),i.sel={anchor:s,head:n},c7e.signal(e,"vim-mode-change",{mode:"visual",subMode:i.visualLine?"linewise":i.visualBlock?"blockwise":""}),ae(e),be(e,i,"<",X(s,n)),be(e,i,">",J(s,n)))},reselectLastSelection:function(e,t,i){var n=i.lastSelection;if(i.visualMode&&re(e,i),n){var o=n.anchorMark.find(),s=n.headMark.find();if(!o||!s)return;i.sel={anchor:o,head:s},i.visualMode=!0,i.visualLine=n.visualLine,i.visualBlock=n.visualBlock,ae(e),be(e,i,"<",X(o,s)),be(e,i,">",J(o,s)),c7e.signal(e,"vim-mode-change",{mode:"visual",subMode:i.visualLine?"linewise":i.visualBlock?"blockwise":""})}},joinLines:function(e,t,i){var n,o;if(i.visualMode){if(n=e.getCursor("anchor"),Q(o=e.getCursor("head"),n)){var s=o;o=n,n=s}o.ch=te(e,o.line)-1}else{var r=Math.max(t.repeat,2);n=e.getCursor(),o=K(e,new u7e(n.line+r-1,1/0))}for(var a=0,l=n.line;l<o.line;l++){a=te(e,n.line),s=new u7e(n.line+1,te(e,n.line+1));var d=e.getRange(n,s);d=t.keepSpaces?d.replace(/\r?\n/g,""):d.replace(/\r?\n\s*/g," "),e.replaceRange(d,n,s)}var h=new u7e(n.line,a);i.visualMode&&de(e,!1),e.setCursor(h)},newLineAndEnterInsertMode:function(e,t,i){if(!e.getOption("readOnly")){i.insertMode=!0;var n=Z(e.getCursor());n.line!==e.firstLine()||t.after?(n.line=t.after?n.line:n.line-1,n.ch=te(e,n.line),e.setCursor(n),(c7e.commands.newlineAndIndentContinueComment||c7e.commands.newlineAndIndent)(e)):(e.replaceRange("\n",new u7e(e.firstLine(),0)),e.setCursor(e.firstLine(),0)),this.enterInsertMode(e,{repeat:t.repeat},i)}},paste:function(e,t,i){var n=Z(e.getCursor()),o=L.registerController.getRegister(t.registerName);if(u=o.toString()){if(t.matchIndent){var s=e.getOption("tabSize"),r=function(e){var t=e.split("\t").length-1,i=e.split(" ").length-1;return t*s+1*i},a=e.getLine(e.getCursor().line),l=r(a.match(/^\s*/)[0]),d=u.replace(/\n$/,""),h=u!==d,c=r(u.match(/^\s*/)[0]),u=d.replace(/^\s*/gm,(function(t){var i=l+(r(t)-c);if(i<0)return"";if(e.getOption("indentWithTabs")){var n=Math.floor(i/s);return Array(n+1).join("\t")}return Array(i+1).join(" ")}));u+=h?"\n":""}t.repeat>1&&(u=Array(t.repeat+1).join(u));var g,p,m=o.linewise,f=o.blockwise;if(f){u=u.split("\n"),m&&u.pop();for(var _=0;_<u.length;_++)u[_]=""==u[_]?" ":u[_];n.ch+=t.after?1:0,n.ch=Math.min(te(e,n.line),n.ch)}else m?i.visualMode?u=i.visualLine?u.slice(0,-1):"\n"+u.slice(0,u.length-1)+"\n":t.after?(u="\n"+u.slice(0,u.length-1),n.ch=te(e,n.line)):n.ch=0:n.ch+=t.after?1:0;if(i.visualMode){var v;i.lastPastedText=u;var b=function(e,t){var i=t.lastSelection;return t.visualMode?function(){var t=e.listSelections(),i=t[0],n=t[t.length-1];return[Q(i.anchor,i.head)?i.anchor:i.head,Q(n.anchor,n.head)?n.head:n.anchor]}():function(){var t=e.getCursor(),n=e.getCursor(),o=i.visualBlock;if(o){var s=o.width,r=o.height;n=new u7e(t.line+r,t.ch+s);for(var a=[],l=t.line;l<n.line;l++){var d={anchor:new u7e(l,t.ch),head:new u7e(l,n.ch)};a.push(d)}e.setSelections(a)}else{var h=i.anchorMark.find(),c=i.headMark.find(),u=c.line-h.line,g=c.ch-h.ch;n={line:n.line+u,ch:u?n.ch:g+n.ch},i.visualLine&&(t=new u7e(t.line,0),n=new u7e(n.line,te(e,n.line))),e.setSelection(t,n)}return[t,n]}()}(e,i),w=b[0],C=b[1],y=e.getSelection(),S=e.listSelections(),x=new Array(S.length).join("1").split("1");i.lastSelection&&(v=i.lastSelection.headMark.find()),L.registerController.unnamedRegister.setText(y),f?(e.replaceSelections(x),C=new u7e(w.line+u.length-1,w.ch),e.setCursor(w),oe(e,C),e.replaceSelections(u),g=w):i.visualBlock?(e.replaceSelections(x),e.setCursor(w),e.replaceRange(u,w,w),g=w):(e.replaceRange(u,w,C),g=e.posFromIndex(e.indexFromPos(w)+u.length-1)),v&&(i.lastSelection.headMark=e.setBookmark(v)),m&&(g.ch=0)}else if(f){for(e.setCursor(n),_=0;_<u.length;_++){var k=n.line+_;k>e.lastLine()&&e.replaceRange("\n",new u7e(k,0)),te(e,k)<n.ch&&ne(e,k,n.ch)}e.setCursor(n),oe(e,new u7e(n.line+u.length-1,n.ch)),e.replaceSelections(u),g=n}else e.replaceRange(u,n),m&&t.after?g=new u7e(n.line+1,he(e.getLine(n.line+1))):m&&!t.after?g=new u7e(n.line,he(e.getLine(n.line))):!m&&t.after?(p=e.indexFromPos(n),g=e.posFromIndex(p+u.length-1)):(p=e.indexFromPos(n),g=e.posFromIndex(p+u.length));i.visualMode&&de(e,!1),e.setCursor(g)}},undo:function(e,t){e.operation((function(){G(e,c7e.commands.undo,t.repeat)(),e.setCursor(e.getCursor("anchor"))}))},redo:function(e,t){G(e,c7e.commands.redo,t.repeat)()},setRegister:function(e,t,i){i.inputState.registerName=t.selectedCharacter},setMark:function(e,t,i){be(e,i,t.selectedCharacter,e.getCursor())},replace:function(e,t,i){var n,o,s=t.selectedCharacter,r=e.getCursor(),a=e.listSelections();if(i.visualMode)r=e.getCursor("start"),o=e.getCursor("end");else{var l=e.getLine(r.line);(n=r.ch+t.repeat)>l.length&&(n=l.length),o=new u7e(r.line,n)}if("\n"==s)i.visualMode||e.replaceRange("",r,o),(c7e.commands.newlineAndIndentContinueComment||c7e.commands.newlineAndIndent)(e);else{var d=e.getRange(r,o);if(d=d.replace(/[^\n]/g,s),i.visualBlock){var h=new Array(e.getOption("tabSize")+1).join(" ");d=(d=e.getSelection()).replace(/\t/g,h).replace(/[^\n]/g,s).split("\n"),e.replaceSelections(d)}else e.replaceRange(d,r,o);i.visualMode?(r=Q(a[0].anchor,a[0].head)?a[0].anchor:a[0].head,e.setCursor(r),de(e,!1)):e.setCursor(q(o,0,-1))}},incrementNumberToken:function(e,t){for(var i,n,o,s,r=e.getCursor(),a=e.getLine(r.line),l=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi;null!==(i=l.exec(a))&&(o=(n=i.index)+i[0].length,!(r.ch<o)););if((t.backtrack||!(o<=r.ch))&&i){var d=i[2]||i[4],h=i[3]||i[5],c=t.increase?1:-1,u={"0b":2,0:8,"":10,"0x":16}[d.toLowerCase()];s=(parseInt(i[1]+h,u)+c*t.repeat).toString(u);var g=d?new Array(h.length-s.length+1+i[1].length).join("0"):"";s="-"===s.charAt(0)?"-"+d+g+s.substr(1):d+g+s;var p=new u7e(r.line,n),m=new u7e(r.line,o);e.replaceRange(s,p,m),e.setCursor(new u7e(r.line,n+s.length-1))}},repeatLastEdit:function(e,t,i){if(i.lastEditInputState){var n=t.repeat;n&&t.repeatIsExplicit?i.lastEditInputState.repeatOverride=n:n=i.lastEditInputState.repeatOverride||n,Ze(e,i,n,!1)}},indent:function(e,t){e.indentLine(e.getCursor().line,t.indentRight)},exitInsertMode:ze};function K(e,t){var i=e.state.vim,n=i.insertMode||i.visualMode,o=Math.min(Math.max(e.firstLine(),t.line),e.lastLine()),s=te(e,o)-1+!!n,r=Math.min(Math.max(0,t.ch),s);return new u7e(o,r)}function j(e){var t={};for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function q(e,t,i){return"object"==typeof t&&(i=t.ch,t=t.line),new u7e(e.line+t,e.ch+i)}function $(e,t){if("<character>"==t.slice(-11)){var i=t.length-11,n=e.slice(0,i),o=t.slice(0,i);return n==o&&e.length>i?"full":0==o.indexOf(n)&&"partial"}return e==t?"full":0==t.indexOf(e)&&"partial"}function G(e,t,i){return function(){for(var n=0;n<i;n++)t(e)}}function Z(e){return new u7e(e.line,e.ch)}function Y(e,t){return e.ch==t.ch&&e.line==t.line}function Q(e,t){return e.line<t.line||e.line==t.line&&e.ch<t.ch}function X(e,t){return arguments.length>2&&(t=X.apply(void 0,Array.prototype.slice.call(arguments,1))),Q(e,t)?e:t}function J(e,t){return arguments.length>2&&(t=J.apply(void 0,Array.prototype.slice.call(arguments,1))),Q(e,t)?t:e}function ee(e,t,i){var n=Q(e,t),o=Q(t,i);return n&&o}function te(e,t){return e.getLine(t).length}function ie(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function ne(e,t,i){var n=te(e,t),o=new Array(i-n+1).join(" ");e.setCursor(new u7e(t,n)),e.replaceRange(o,e.getCursor())}function oe(e,t){var i=[],n=e.listSelections(),o=Z(e.clipPos(t)),s=!Y(t,o),r=function(e,t){for(var i=0;i<e.length;i++){var n=Y(e[i].anchor,t),o=Y(e[i].head,t);if(n||o)return i}return-1}(n,e.getCursor("head")),a=Y(n[r].head,n[r].anchor),l=n.length-1,d=l-r>r?l:0,h=n[d].anchor,c=Math.min(h.line,o.line),u=Math.max(h.line,o.line),g=h.ch,p=o.ch,m=n[d].head.ch-g,f=p-g;m>0&&f<=0?(g++,s||p--):m<0&&f>=0?(g--,a||p++):m<0&&-1==f&&(g--,p++);for(var _=c;_<=u;_++){var v={anchor:new u7e(_,g),head:new u7e(_,p)};i.push(v)}return e.setSelections(i),t.ch=p,h.ch=g,h}function se(e,t,i){for(var n=[],o=0;o<i;o++){var s=q(t,o,0);n.push({anchor:s,head:s})}e.setSelections(n,0)}function re(e,t){var i=t.sel.anchor,n=t.sel.head;t.lastPastedText&&(n=e.posFromIndex(e.indexFromPos(i)+t.lastPastedText.length),t.lastPastedText=null),t.lastSelection={anchorMark:e.setBookmark(i),headMark:e.setBookmark(n),anchor:Z(i),head:Z(n),visualMode:t.visualMode,visualLine:t.visualLine,visualBlock:t.visualBlock}}function ae(e,t,i){var n=e.state.vim,o=le(e,t=t||n.sel,i=i||n.visualLine?"line":n.visualBlock?"block":"char",!0);e.setSelections(o.ranges,o.primary)}function le(e,t,i,n){var o=Z(t.head),s=Z(t.anchor);if("char"==i){var r=n||Q(t.head,t.anchor)?0:1,a=Q(t.head,t.anchor)?1:0;return o=q(t.head,0,r),{ranges:[{anchor:s=q(t.anchor,0,a),head:o}],primary:0}}if("line"==i){if(Q(t.head,t.anchor))o.ch=0,s.ch=te(e,s.line);else{s.ch=0;var l=e.lastLine();o.line>l&&(o.line=l),o.ch=te(e,o.line)}return{ranges:[{anchor:s,head:o}],primary:0}}if("block"==i){var d=Math.min(s.line,o.line),h=s.ch,c=Math.max(s.line,o.line),u=o.ch;h<u?u+=1:h+=1;for(var g=c-d+1,p=o.line==d?0:g-1,m=[],f=0;f<g;f++)m.push({anchor:new u7e(d+f,h),head:new u7e(d+f,u)});return{ranges:m,primary:p}}}function de(e,t){var i=e.state.vim;!1!==t&&e.setCursor(K(e,i.sel.head)),re(e,i),i.visualMode=!1,i.visualLine=!1,i.visualBlock=!1,i.insertMode||c7e.signal(e,"vim-mode-change",{mode:"normal"})}function he(e){if(!e)return 0;var t=e.search(/\S/);return-1==t?e.length:t}function ce(e,t,i,n,o){for(var s=function(e){var t=e.getCursor("head");return 1==e.getSelection().length&&(t=X(t,e.getCursor("anchor"))),t}(e),l=e.getLine(s.line),d=s.ch,h=o?r[0]:a[0];!h(l.charAt(d));)if(++d>=l.length)return null;n?h=a[0]:(h=r[0])(l.charAt(d))||(h=r[1]);for(var c=d,u=d;h(l.charAt(c))&&c<l.length;)c++;for(;h(l.charAt(u))&&u>=0;)u--;if(u++,t){for(var g=c;/\s/.test(l.charAt(c))&&c<l.length;)c++;if(g==c){for(var p=u;/\s/.test(l.charAt(u-1))&&u>0;)u--;u||(u=p)}}return{start:new u7e(s.line,u),end:new u7e(s.line,c)}}function ue(e,t,i){Y(t,i)||L.jumpList.add(e,t,i)}function ge(e,t){L.lastCharacterSearch.increment=e,L.lastCharacterSearch.forward=t.forward,L.lastCharacterSearch.selectedCharacter=t.selectedCharacter}var pe={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},me={bracket:{isComplete:function(e){if(e.nextCh===e.symb){if(e.depth++,e.depth>=1)return!0}else e.nextCh===e.reverseSymb&&e.depth--;return!1}},section:{init:function(e){e.curMoveThrough=!0,e.symb=(e.forward?"]":"[")===e.symb?"{":"}"},isComplete:function(e){return 0===e.index&&e.nextCh===e.symb}},comment:{isComplete:function(e){var t="*"===e.lastCh&&"/"===e.nextCh;return e.lastCh=e.nextCh,t}},method:{init:function(e){e.symb="m"===e.symb?"{":"}",e.reverseSymb="{"===e.symb?"}":"{"},isComplete:function(e){return e.nextCh===e.symb}},preprocess:{init:function(e){e.index=0},isComplete:function(e){if("#"===e.nextCh){var t=e.lineText.match(/^#(\w+)/)[1];if("endif"===t){if(e.forward&&0===e.depth)return!0;e.depth++}else if("if"===t){if(!e.forward&&0===e.depth)return!0;e.depth--}if("else"===t&&0===e.depth)return!0}return!1}}};function fe(e,t,i,n,o){var s=t.line,l=t.ch,d=e.getLine(s),h=i?1:-1,c=n?a:r;if(o&&""==d){if(s+=h,d=e.getLine(s),!m(e,s))return null;l=i?0:d.length}for(;;){if(o&&""==d)return{from:0,to:0,line:s};for(var u=h>0?d.length:-1,g=u,p=u;l!=u;){for(var f=!1,_=0;_<c.length&&!f;++_)if(c[_](d.charAt(l))){for(g=l;l!=u&&c[_](d.charAt(l));)l+=h;if(f=g!=(p=l),g==t.ch&&s==t.line&&p==g+h)continue;return{from:Math.min(g,p+1),to:Math.max(g,p),line:s}}f||(l+=h)}if(!m(e,s+=h))return null;d=e.getLine(s),l=h>0?0:d.length}}function _e(e,t,i,n,o){var s=new u7e(t.line+i.repeat-1,1/0),r=e.clipPos(s);return r.ch--,o||(n.lastHPos=1/0,n.lastHSPos=e.charCoords(r,"div").left),s}function ve(e,t,i,n){for(var o,s=e.getCursor(),r=s.ch,a=0;a<t;a++){if(-1==(o=we(r,e.getLine(s.line),n,i,!0)))return null;r=o}return new u7e(e.getCursor().line,o)}function be(e,t,i,n){C(i,g)&&(t.marks[i]&&t.marks[i].clear(),t.marks[i]=e.setBookmark(n))}function we(e,t,i,n,o){var s;return n?-1==(s=t.indexOf(i,e+1))||o||(s-=1):-1==(s=t.lastIndexOf(i,e-1))||o||(s+=1),s}function Ce(e,t,i,n,o){var s,r=t.line,a=e.firstLine(),l=e.lastLine(),d=r;function h(t){return!e.getLine(t)}function c(e,t,i){return i?h(e)!=h(e+t):!h(e)&&h(e+t)}if(n){for(;a<=d&&d<=l&&i>0;)c(d,n)&&i--,d+=n;return new u7e(d,0)}var u=e.state.vim;if(u.visualLine&&c(r,1,!0)){var g=u.sel.anchor;c(g.line,-1,!0)&&(o&&g.line==r||(r+=1))}var p=h(r);for(d=r;d<=l&&i;d++)c(d,1,!0)&&(o&&h(d)==p||i--);for(s=new u7e(d,0),d>l&&!p?p=!0:o=!1,d=r;d>a&&(o&&h(d)!=p&&d!=r||!c(d,-1,!0));d--);return{start:new u7e(d,0),end:s}}function ye(){}function Se(e){var t=e.state.vim;return t.searchState_||(t.searchState_=new ye)}function xe(e,t){var i=ke(e,t)||[];if(!i.length)return[];var n=[];if(0===i[0]){for(var o=0;o<i.length;o++)"number"==typeof i[o]&&n.push(e.substring(i[o]+1,i[o+1]));return n}}function ke(e,t){t||(t="/");for(var i=!1,n=[],o=0;o<e.length;o++){var s=e.charAt(o);i||s!=t||n.push(o),i=!i&&"\\"==s}return n}S("pcre",!0,"boolean"),ye.prototype={getQuery:function(){return L.query},setQuery:function(e){L.query=e},getOverlay:function(){return this.searchOverlay},setOverlay:function(e){this.searchOverlay=e},isReversed:function(){return L.isReversed},setReversed:function(e){L.isReversed=e},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(e){this.annotate=e}};var Le={"\\n":"\n","\\r":"\r","\\t":"\t"},De={"\\/":"/","\\\\":"\\","\\n":"\n","\\r":"\r","\\t":"\t","\\&":"&"};function Ee(e){"string"==typeof e&&(e=document.createElement(e));for(var t,i=1;i<arguments.length;i++)if(t=arguments[i])if("object"!=typeof t&&(t=document.createTextNode(t)),t.nodeType)e.appendChild(t);else for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&("$"===n[0]?e.style[n.slice(1)]=t[n]:e.setAttribute(n,t[n]));return e}function Ne(e,t){var i=Ee("pre",{$color:"red",class:"cm-vim-message"},t);e.openNotification?e.openNotification(i,{bottom:!0,duration:5e3}):alert(i.innerText)}function Ie(e,t){var i,n,o=(i=t.prefix,n=t.desc,Ee(document.createDocumentFragment(),Ee("span",{$fontFamily:"monospace",$whiteSpace:"pre"},i,Ee("input",{type:"text",autocorrect:"off",autocapitalize:"off",spellcheck:"false"})),n&&Ee("span",{$color:"#888"},n)));if(e.openDialog)e.openDialog(o,t.onClose,{onKeyDown:t.onKeyDown,onKeyUp:t.onKeyUp,bottom:!0,selectValueOnOpen:!1,value:t.value});else{var s="";"string"!=typeof t.prefix&&t.prefix&&(s+=t.prefix.textContent),t.desc&&(s+=" "+t.desc),t.onClose(prompt(s,""))}}function Te(e,t,i,n){if(t){var o=Se(e),s=function(e,t,i){if(L.registerController.getRegister("/").setText(e),e instanceof RegExp)return e;var n,o,s=ke(e,"/");return s.length?(n=e.substring(0,s[0]),o=-1!=e.substring(s[0]).indexOf("i")):n=e,n?(k("pcre")||(n=function(e){for(var t=!1,i=[],n=-1;n<e.length;n++){var o=e.charAt(n)||"",s=e.charAt(n+1)||"",r=s&&-1!="|(){".indexOf(s);t?("\\"===o&&r||i.push(o),t=!1):"\\"===o?(t=!0,s&&-1!="}".indexOf(s)&&(r=!0),r&&"\\"!==s||i.push(o)):(i.push(o),r&&"\\"!==s&&i.push("\\"))}return i.join("")}(n)),i&&(t=/^[^A-Z]*$/.test(n)),new RegExp(n,t||o?"im":"m")):null}(t,!!i,!!n);if(s)return Ae(e,s),function(e,t){if(e instanceof RegExp&&t instanceof RegExp){for(var i=["global","multiline","ignoreCase","source"],n=0;n<i.length;n++){var o=i[n];if(e[o]!==t[o])return!1}return!0}return!1}(s,o.getQuery())||o.setQuery(s),s}}var Me=0;function Ae(e,t){clearTimeout(Me),Me=setTimeout((function(){if(e.state.vim){var i=Se(e),n=i.getOverlay();n&&t==n.query||(n&&e.removeOverlay(n),n=function(e){if("^"==e.source.charAt(0))var t=!0;return{token:function(i){if(!t||i.sol()){var n=i.match(e,!1);if(n)return 0==n[0].length?(i.next(),"searching"):i.sol()||(i.backUp(1),e.exec(i.next()+n[0]))?(i.match(e),"searching"):(i.next(),null);for(;!i.eol()&&(i.next(),!i.match(e,!1)););}else i.skipToEnd()},query:e}}(t),e.addOverlay(n),e.showMatchesOnScrollbar&&(i.getScrollbarAnnotate()&&i.getScrollbarAnnotate().clear(),i.setScrollbarAnnotate(e.showMatchesOnScrollbar(t))),i.setOverlay(n))}}),50)}function Re(e,t,i,n){return void 0===n&&(n=1),e.operation((function(){for(var o=e.getCursor(),s=e.getSearchCursor(i,o),r=0;r<n;r++){var a=s.find(t);if(0==r&&a&&Y(s.from(),o)){var l=t?s.from():s.to();(a=s.find(t))&&!a[0]&&Y(s.from(),l)&&e.getLine(l.line).length==l.ch&&(a=s.find(t))}if(!a&&!(s=e.getSearchCursor(i,t?new u7e(e.lastLine()):new u7e(e.firstLine(),0))).find(t))return}return s.from()}))}function Oe(e){var t=Se(e);e.removeOverlay(Se(e).getOverlay()),t.setOverlay(null),t.getScrollbarAnnotate()&&(t.getScrollbarAnnotate().clear(),t.setScrollbarAnnotate(null))}function Pe(e){var t=e.getScrollInfo(),i=e.coordsChar({left:0,top:6+t.top},"local"),n=t.clientHeight-10+t.top,o=e.coordsChar({left:0,top:n},"local");return{top:i.line,bottom:o.line}}function Fe(e,t,i){if("'"==i||"`"==i)return L.jumpList.find(e,-1)||new u7e(0,0);if("."==i)return Be(e);var n=t.marks[i];return n&&n.find()}function Be(e){for(var t=e.doc.history.done,i=t.length;i--;)if(t[i].changes)return Z(t[i].changes[0].to)}var We=function(){this.buildCommandMap_()};We.prototype={processCommand:function(e,t,i){var n=this;e.operation((function(){e.curOp.isVimOp=!0,n._processCommand(e,t,i),e.curOp.isVimOp=!1}))},_processCommand:function(e,t,i){var n=e.state.vim,o=L.registerController.getRegister(":"),s=o.toString();n.visualMode&&de(e);var r=new c7e.StringStream(t);o.setText(t);var a,l,d=i||{};d.input=t;try{this.parseInput_(e,r,d)}catch(t){throw Ne(e,t.toString()),t}if(d.commandName){if(a=this.matchCommand_(d.commandName)){if(l=a.name,a.excludeFromCommandHistory&&o.setText(s),this.parseCommandArgs_(r,d,a),"exToKey"==a.type){for(var h=0;h<a.toKeys.length;h++)A.handleKey(e,a.toKeys[h],"mapping");return}if("exToEx"==a.type)return void this.processCommand(e,a.toInput)}}else void 0!==d.line&&(l="move");if(l)try{Ve[l](e,d),a&&a.possiblyAsync||!d.callback||d.callback()}catch(t){throw Ne(e,t.toString()),t}else Ne(e,'Not an editor command ":'+t+'"')},parseInput_:function(e,t,i){t.eatWhile(":"),t.eat("%")?(i.line=e.firstLine(),i.lineEnd=e.lastLine()):(i.line=this.parseLineSpec_(e,t),void 0!==i.line&&t.eat(",")&&(i.lineEnd=this.parseLineSpec_(e,t)));var n=t.match(/^(\w+|!!|@@|[!#&*<=>@~])/);return i.commandName=n?n[1]:t.match(/.*/)[0],i},parseLineSpec_:function(e,t){var i=t.match(/^(\d+)/);if(i)return parseInt(i[1],10)-1;switch(t.next()){case".":return this.parseLineSpecOffset_(t,e.getCursor().line);case"$":return this.parseLineSpecOffset_(t,e.lastLine());case"'":var n=t.next(),o=Fe(e,e.state.vim,n);if(!o)throw new Error("Mark not set");return this.parseLineSpecOffset_(t,o.line);case"-":case"+":return t.backUp(1),this.parseLineSpecOffset_(t,e.getCursor().line);default:return void t.backUp(1)}},parseLineSpecOffset_:function(e,t){var i=e.match(/^([+-])?(\d+)/);if(i){var n=parseInt(i[2],10);"-"==i[1]?t-=n:t+=n}return t},parseCommandArgs_:function(e,t,i){if(!e.eol()){t.argString=e.match(/.*/)[0];var n=i.argDelimiter||/\s+/,o=ie(t.argString).split(n);o.length&&o[0]&&(t.args=o)}},matchCommand_:function(e){for(var t=e.length;t>0;t--){var i=e.substring(0,t);if(this.commandMap_[i]){var n=this.commandMap_[i];if(0===n.name.indexOf(e))return n}}return null},buildCommandMap_:function(){this.commandMap_={};for(var e=0;e<f7e.length;e++){var t=f7e[e],i=t.shortName||t.name;this.commandMap_[i]=t}},map:function(e,t,i){if(":"!=e&&":"==e.charAt(0)){if(i)throw Error("Mode not supported for ex mappings");var n=e.substring(1);":"!=t&&":"==t.charAt(0)?this.commandMap_[n]={name:n,type:"exToEx",toInput:t.substring(1),user:!0}:this.commandMap_[n]={name:n,type:"exToKey",toKeys:t,user:!0}}else if(":"!=t&&":"==t.charAt(0)){var o={keys:e,type:"keyToEx",exArgs:{input:t.substring(1)}};i&&(o.context=i),p7e.unshift(o)}else o={keys:e,type:"keyToKey",toKeys:t},i&&(o.context=i),p7e.unshift(o)},unmap:function(e,t){if(":"!=e&&":"==e.charAt(0)){if(t)throw Error("Mode not supported for ex mappings");var i=e.substring(1);if(this.commandMap_[i]&&this.commandMap_[i].user)return delete this.commandMap_[i],!0}else for(var n=e,o=0;o<p7e.length;o++)if(n==p7e[o].keys&&p7e[o].context===t)return p7e.splice(o,1),!0}};var Ve={colorscheme:function(e,t){!t.args||t.args.length<1?Ne(e,e.getOption("theme")):e.setOption("theme",t.args[0])},map:function(e,t,i){var n=t.args;!n||n.length<2?e&&Ne(e,"Invalid mapping: "+t.input):He.map(n[0],n[1],i)},imap:function(e,t){this.map(e,t,"insert")},nmap:function(e,t){this.map(e,t,"normal")},vmap:function(e,t){this.map(e,t,"visual")},unmap:function(e,t,i){var n=t.args;(!n||n.length<1||!He.unmap(n[0],i))&&e&&Ne(e,"No such mapping: "+t.input)},move:function(e,t){W.processCommand(e,e.state.vim,{type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:t.line+1})},set:function(e,t){var i=t.args,n=t.setCfg||{};if(!i||i.length<1)e&&Ne(e,"Invalid mapping: "+t.input);else{var o=i[0].split("="),s=o[0],r=o[1],a=!1;if("?"==s.charAt(s.length-1)){if(r)throw Error("Trailing characters: "+t.argString);s=s.substring(0,s.length-1),a=!0}void 0===r&&"no"==s.substring(0,2)&&(s=s.substring(2),r=!1);var l=y[s]&&"boolean"==y[s].type;if(l&&null==r&&(r=!0),!l&&void 0===r||a){var d=k(s,e,n);d instanceof Error?Ne(e,d.message):Ne(e,!0===d||!1===d?" "+(d?"":"no")+s:" "+s+"="+d)}else{var h=x(s,r,e,n);h instanceof Error&&Ne(e,h.message)}}},setlocal:function(e,t){t.setCfg={scope:"local"},this.set(e,t)},setglobal:function(e,t){t.setCfg={scope:"global"},this.set(e,t)},registers:function(e,t){var i=t.args,n=L.registerController.registers,o="----------Registers----------\n\n";if(i){i=i.join("");for(var s=0;s<i.length;s++)r=i.charAt(s),L.registerController.isValidRegister(r)&&(o+='"'+r+" "+(n[r]||new P).toString()+"\n")}else for(var r in n){var a=n[r].toString();a.length&&(o+='"'+r+" "+a+"\n")}Ne(e,o)},sort:function(e,t){var i,n,o,s,r,a=function(){if(t.argString){var e=new c7e.StringStream(t.argString);if(e.eat("!")&&(i=!0),e.eol())return;if(!e.eatSpace())return"Invalid arguments";var a=e.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!a&&!e.eol())return"Invalid arguments";if(a[1]){n=-1!=a[1].indexOf("i"),o=-1!=a[1].indexOf("u");var l=-1!=a[1].indexOf("d")||-1!=a[1].indexOf("n")&&1,d=-1!=a[1].indexOf("x")&&1,h=-1!=a[1].indexOf("o")&&1;if(l+d+h>1)return"Invalid arguments";s=(l?"decimal":d&&"hex")||h&&"octal"}a[2]&&(r=new RegExp(a[2].substr(1,a[2].length-2),n?"i":""))}}();if(a)Ne(e,a+": "+t.argString);else{var l=t.line||e.firstLine(),d=t.lineEnd||t.line||e.lastLine();if(l!=d){var h=new u7e(l,0),c=new u7e(d,te(e,d)),u=e.getRange(h,c).split("\n"),g=r||("decimal"==s?/(-?)([\d]+)/:"hex"==s?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==s?/([0-7]+)/:null),p="decimal"==s?10:"hex"==s?16:"octal"==s?8:null,m=[],f=[];if(s||r)for(var _=0;_<u.length;_++){var v=r?u[_].match(r):null;v&&""!=v[0]?m.push(v):!r&&g.exec(u[_])?m.push(u[_]):f.push(u[_])}else f=u;if(m.sort(r?function(e,t){var o;return i&&(o=e,e=t,t=o),n&&(e[0]=e[0].toLowerCase(),t[0]=t[0].toLowerCase()),e[0]<t[0]?-1:1}:C),r)for(_=0;_<m.length;_++)m[_]=m[_].input;else s||f.sort(C);if(u=i?m.concat(f):f.concat(m),o){var b,w=u;for(u=[],_=0;_<w.length;_++)w[_]!=b&&u.push(w[_]),b=w[_]}e.replaceRange(u.join("\n"),h,c)}}function C(e,t){var o;i&&(o=e,e=t,t=o),n&&(e=e.toLowerCase(),t=t.toLowerCase());var r=s&&g.exec(e),a=s&&g.exec(t);return r?(r=parseInt((r[1]+r[2]).toLowerCase(),p))-(a=parseInt((a[1]+a[2]).toLowerCase(),p)):e<t?-1:1}},vglobal:function(e,t){this.global(e,t)},global:function(e,t){var i=t.argString;if(i){var n,o="v"===t.commandName[0],s=void 0!==t.line?t.line:e.firstLine(),r=t.lineEnd||t.line||e.lastLine(),a=function(e){return xe(e,"/")}(i),l=i;if(a.length&&(l=a[0],n=a.slice(1,a.length).join("/")),l)try{Te(e,l,!0,!0)}catch(t){return void Ne(e,"Invalid regex: "+l)}for(var d=Se(e).getQuery(),h=[],c=s;c<=r;c++){var u=e.getLineHandle(c);d.test(u.text)!==o&&h.push(n?u:u.text)}if(n){var g=0,p=function(){if(g<h.length){var t=h[g++],i=e.getLineNumber(t);if(null==i)return void p();var o=i+1+n;He.processCommand(e,o,{callback:p})}};p()}else Ne(e,h.join("\n"))}else Ne(e,"Regular Expression missing from global")},substitute:function(e,t){if(!e.getSearchCursor)throw new Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var i,n,o,s,r=t.argString,a=r?xe(r,r[0]):[],l="",d=!1,h=!1;if(a.length)i=a[0],k("pcre")&&""!==i&&(i=new RegExp(i).source),void 0!==(l=a[1])&&(l=k("pcre")?function(e){for(var t=new c7e.StringStream(e),i=[];!t.eol();){for(;t.peek()&&"\\"!=t.peek();)i.push(t.next());var n=!1;for(var o in De)if(t.match(o,!0)){n=!0,i.push(De[o]);break}n||i.push(t.next())}return i.join("")}(l.replace(/([^\\])&/g,"$1$$&")):function(e){for(var t=!1,i=[],n=-1;n<e.length;n++){var o=e.charAt(n)||"",s=e.charAt(n+1)||"";Le[o+s]?(i.push(Le[o+s]),n++):t?(i.push(o),t=!1):"\\"===o?(t=!0,_(s)||"$"===s?i.push("$"):"/"!==s&&"\\"!==s&&i.push("\\")):("$"===o&&i.push("$"),i.push(o),"/"===s&&i.push("\\"))}return i.join("")}(l),L.lastSubstituteReplacePart=l),n=a[2]?a[2].split(" "):[];else if(r&&r.length)return void Ne(e,"Substitutions should be of the form :s/pattern/replace/");if(n&&(o=n[0],s=parseInt(n[1]),o&&(-1!=o.indexOf("c")&&(d=!0),-1!=o.indexOf("g")&&(h=!0),i=k("pcre")?i+"/"+o:i.replace(/\//g,"\\/")+"/"+o)),i)try{Te(e,i,!0,!0)}catch(t){return void Ne(e,"Invalid regex: "+i)}if(void 0!==(l=l||L.lastSubstituteReplacePart)){var c=Se(e).getQuery(),u=void 0!==t.line?t.line:e.getCursor().line,g=t.lineEnd||u;u==e.firstLine()&&g==e.lastLine()&&(g=1/0),s&&(g=(u=g)+s-1);var p=K(e,new u7e(u,0)),m=e.getSearchCursor(c,p);e.pushUndoStop(),function(e,t,i,n,o,s,r,a,l){e.state.vim.exMode=!0;var d,h,c,u=!1;function g(){e.operation((function(){for(;!u;)p(),m();f()}))}function p(){var t=e.getRange(s.from(),s.to()).replace(r,a),i=s.to().line;s.replace(t),h=s.to().line,o+=h-i,c=h<i}function m(){for(;l=void 0,g=void 0,l=d&&Z(s.to()),(g=s.findNext())&&!g[0]&&l&&Y(s.from(),l)&&(g=s.findNext()),g&&(t=s.from(),r=n,a=o,"number"!=typeof t&&(t=t.line),r instanceof Array?C(t,r):"number"==typeof a?t>=r&&t<=a:t==r);)if(i||s.from().line!=h||c)return e.scrollIntoView(s.from(),30),e.setSelection(s.from(),s.to()),d=s.from(),void(u=!1);var t,r,a,l,g;u=!0}function f(t){if(t&&t(),e.focus(),d){e.setCursor(d);var i=e.state.vim;i.exMode=!1,i.lastHPos=i.lastHSPos=d.ch}l&&l()}if(m(),!u)return t?void Ie(e,{prefix:Ee("span","replace with ",Ee("strong",a)," (y/n/a/q/l)"),onKeyDown:function(t,i,n){switch(c7e.e_stop(t),c7e.keyName(t)){case"Y":p(),m();break;case"N":m();break;case"A":var o=l;l=void 0,e.operation(g),l=o;break;case"L":p();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":f(n)}return u&&f(n),!0}}):(g(),void(l&&l()));Ne(e,"No matches for "+r.source)}(e,d,h,u,g,m,c,l,t.callback)}else Ne(e,"No previous substitute regular expression")},redo:c7e.commands.redo,undo:c7e.commands.undo,write:function(e){c7e.commands.save?c7e.commands.save(e):e.save&&e.save()},nohlsearch:function(e){Oe(e)},yank:function(e){var t=Z(e.getCursor()).line,i=e.getLine(t);L.registerController.pushText("0","yank",i,!0,!0)},delmarks:function(e,t){if(t.argString&&ie(t.argString))for(var i=e.state.vim,n=new c7e.StringStream(ie(t.argString));!n.eol();){n.eatSpace();var o=n.pos;if(!n.match(/[a-zA-Z]/,!1))return void Ne(e,"Invalid argument: "+t.argString.substring(o));var s=n.next();if(n.match("-",!0)){if(!n.match(/[a-zA-Z]/,!1))return void Ne(e,"Invalid argument: "+t.argString.substring(o));var r=s,a=n.next();if(!(f(r)&&f(a)||v(r)&&v(a)))return void Ne(e,"Invalid argument: "+r+"-");var l=r.charCodeAt(0),d=a.charCodeAt(0);if(l>=d)return void Ne(e,"Invalid argument: "+t.argString.substring(o));for(var h=0;h<=d-l;h++){var c=String.fromCharCode(l+h);delete i.marks[c]}}else delete i.marks[s]}else Ne(e,"Argument required")}},He=new We;function ze(e){var t=e.state.vim,i=L.macroModeState,n=L.registerController.getRegister("."),o=i.isPlaying,s=i.lastInsertModeChanges;o||(e.off("change",je),c7e.off(e.getInputField(),"keydown",Ge)),!o&&t.insertModeRepeat>1&&(Ze(e,t,t.insertModeRepeat-1,!0),t.lastEditInputState.repeatOverride=t.insertModeRepeat),delete t.insertModeRepeat,t.insertMode=!1,e.setCursor(e.getCursor().line,e.getCursor().ch-1),e.setOption("keyMap","vim"),e.setOption("disableInput",!0),e.toggleOverwrite(!1),n.setText(s.changes.join("")),c7e.signal(e,"vim-mode-change",{mode:"normal"}),i.isRecording&&function(e){if(!e.isPlaying){var t=e.latestRegister,i=L.registerController.getRegister(t);i&&i.pushInsertModeChanges&&i.pushInsertModeChanges(e.lastInsertModeChanges)}}(i),e.enterVimMode()}function Ue(e){p7e.unshift(e)}function Ke(e,t,i,n){var o=L.registerController.getRegister(n);if(":"==n)return o.keyBuffer[0]&&He.processCommand(e,o.keyBuffer[0]),void(i.isPlaying=!1);var s=o.keyBuffer,r=0;i.isPlaying=!0,i.replaySearchQueries=o.searchQueries.slice(0);for(var a=0;a<s.length;a++)for(var l,d,h=s[a];h;)if(d=(l=/<\w+-.+?>|<\w+>|./.exec(h))[0],h=h.substring(l.index+d.length),A.handleKey(e,d,"macro"),t.insertMode){var c=o.insertModeChanges[r++].changes;L.macroModeState.lastInsertModeChanges.changes=c,Ye(e,c,1),ze(e)}i.isPlaying=!1}function je(e,t){var i=L.macroModeState,n=i.lastInsertModeChanges;if(!i.isPlaying)for(;t;){if(n.expectCursorActivityForChange=!0,n.ignoreCount>1)n.ignoreCount--;else if("+input"==t.origin||"paste"==t.origin||void 0===t.origin){var o=e.listSelections().length;o>1&&(n.ignoreCount=o);var s=t.text.join("\n");n.maybeReset&&(n.changes=[],n.maybeReset=!1),s&&(e.state.overwrite&&!/\n/.test(s)?n.changes.push([s]):n.changes.push(s))}t=t.next}}function qe(e){var t=e.state.vim;if(t.insertMode){var i=L.macroModeState;if(i.isPlaying)return;var n=i.lastInsertModeChanges;n.expectCursorActivityForChange?n.expectCursorActivityForChange=!1:n.maybeReset=!0}else e.curOp.isVimOp||function(e,t){var i=e.getCursor("anchor"),n=e.getCursor("head");t.visualMode&&!e.somethingSelected()?de(e,!1):t.visualMode||t.insertMode||!e.somethingSelected()||(t.visualMode=!0,t.visualLine=!1,c7e.signal(e,"vim-mode-change",{mode:"visual"})),t.visualMode?(t.sel={anchor:i,head:n},be(e,t,"<",X(n,i)),be(e,t,">",J(n,i))):t.insertMode||(t.lastHPos=e.getCursor().ch)}(e,t)}function $e(e){this.keyName=e}function Ge(e){var t=L.macroModeState.lastInsertModeChanges,i=c7e.keyName(e);i&&(-1==i.indexOf("Delete")&&-1==i.indexOf("Backspace")||c7e.lookupKey(i,"vim-insert",(function(){return t.maybeReset&&(t.changes=[],t.maybeReset=!1),t.changes.push(new $e(i)),!0})))}function Ze(e,t,i,n){var o=L.macroModeState;o.isPlaying=!0;var s=!!t.lastEditActionCommand,r=t.inputState;function a(){s?W.processAction(e,t,t.lastEditActionCommand):W.evalInput(e,t)}function l(i){if(o.lastInsertModeChanges.changes.length>0){i=t.lastEditActionCommand?i:1;var n=o.lastInsertModeChanges;Ye(e,n.changes,i)}}if(t.inputState=t.lastEditInputState,s&&t.lastEditActionCommand.interlaceInsertRepeat)for(var d=0;d<i;d++)a(),l(1);else n||a(),l(i);t.inputState=r,t.insertMode&&!n&&ze(e),o.isPlaying=!1}function Ye(e,t,i){function n(t){return"string"==typeof t?c7e.commands[t](e):t(e),!0}var o=e.getCursor("head"),s=L.macroModeState.lastInsertModeChanges.visualBlock;s&&(se(e,o,s+1),i=e.listSelections().length,e.setCursor(o));for(var r=0;r<i;r++){s&&e.setCursor(q(o,r,0));for(var a=0;a<t.length;a++){var l=t[a];if(l instanceof $e)c7e.lookupKey(l.keyName,"vim-insert",n);else if("string"==typeof l)window.cm=e,e.replaceSelections(l);else{var d=e.getCursor(),h=q(d,0,l[0].length);e.replaceRange(l[0],d,h),e.setCursor(h)}}}s&&e.setCursor(q(o,0,1))}return c7e.keyMap.vim={attach:t,detach:e,call:i},S("insertModeEscKeysTimeout",200,"number"),c7e.keyMap["vim-insert"]={fallthrough:["default"],attach:t,detach:e,call:i},c7e.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:t,detach:e,call:i},M(),A}();const _7e=c7e;class v7e{constructor(e,t,i=null){this.node=e,this.modeInfoNode=document.createElement("span"),this.secInfoNode=document.createElement("span"),this.notifNode=document.createElement("span"),this.notifNode.className="vim-notification",this.keyInfoNode=document.createElement("span"),this.keyInfoNode.setAttribute("style","float: right"),this.node.appendChild(this.modeInfoNode),this.node.appendChild(this.secInfoNode),this.node.appendChild(this.notifNode),this.node.appendChild(this.keyInfoNode),this.toggleVisibility(!1),this.editor=t,this.sanitizer=i}setMode(e){"visual"!==e.mode?this.setText(`--${e.mode.toUpperCase()}--`):"linewise"===e.subMode?this.setText("--VISUAL LINE--"):"blockwise"===e.subMode?this.setText("--VISUAL BLOCK--"):this.setText("--VISUAL--")}setKeyBuffer(e){this.keyInfoNode.textContent=e}setSec(e,t,i){if(this.notifNode.textContent="",void 0===e)return this.closeInput;this.setInnerHtml_(this.secInfoNode,e);const n=this.secInfoNode.querySelector("input");return n&&(n.focus(),this.input={callback:t,options:i,node:n},i&&(i.selectValueOnOpen&&n.select(),i.value&&(n.value=i.value)),this.addInputListeners()),this.closeInput}setText(e){this.modeInfoNode.textContent=e}toggleVisibility(e){this.node.style.display=e?"block":"none",this.input&&this.removeInputListeners(),clearInterval(this.notifTimeout)}closeInput=()=>{this.removeInputListeners(),this.input=null,this.setSec(""),this.editor&&this.editor.focus()};clear=()=>{this.setInnerHtml_(this.node,"")};inputKeyUp=e=>{const{options:t}=this.input;t&&t.onKeyUp&&t.onKeyUp(e,e.target.value,this.closeInput)};inputKeyInput=e=>{const{options:t}=this.input;t&&t.onKeyInput&&t.onKeyUp(e,e.target.value,this.closeInput)};inputBlur=()=>{const{options:e}=this.input;e.closeOnBlur&&this.closeInput()};inputKeyDown=e=>{const{options:t,callback:i}=this.input;t&&t.onKeyDown&&t.onKeyDown(e,e.target.value,this.closeInput)||((27===e.keyCode||t&&!1!==t.closeOnEnter&&13==e.keyCode)&&(this.input.node.blur(),e.stopPropagation(),this.closeInput()),13===e.keyCode&&i&&(e.stopPropagation(),e.preventDefault(),i(e.target.value)))};addInputListeners(){const{node:e}=this.input;e.addEventListener("keyup",this.inputKeyUp),e.addEventListener("keydown",this.inputKeyDown),e.addEventListener("input",this.inputKeyInput),e.addEventListener("blur",this.inputBlur)}removeInputListeners(){if(!this.input||!this.input.node)return;const{node:e}=this.input;e.removeEventListener("keyup",this.inputKeyUp),e.removeEventListener("keydown",this.inputKeyDown),e.removeEventListener("input",this.inputKeyInput),e.removeEventListener("blur",this.inputBlur)}showNotification(e){const t=document.createElement("span");this.setInnerHtml_(t,e),this.notifNode.textContent=t.textContent,this.notifTimeout=setTimeout((()=>{this.notifNode.textContent=""}),5e3)}setInnerHtml_(e,t){for(;e.childNodes.length;)e.removeChild(e.childNodes[0]);t&&(this.sanitizer?e.appendChild(this.sanitizer(t)):e.appendChild(t))}}const b7e={comments:{},brackets:[["[","]"],["(",")"]],autoClosingPairs:[{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],surroundingPairs:[{open:"[",close:"]"},{open:"(",close:")"}],wordPattern:new RegExp("[^\\s,{}\\[\\]()<>:#]+")},w7e={defaultToken:"",tokenPostfix:".prompt",keywords:["lora","hypernet","AND","BREAK"],brackets:[{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],escapes:/\\./,tokenizer:{root:[[/[a-zA-Z]\w*/,{cases:{"@keywords":"keyword","@default":"identifier"}}],{include:"@whitespace"},{include:"@numbers"},[/[,:]/,"delimiter"],[/[\[\]()<>]/,"@brackets"]],whitespace:[[/\s+/,"white"]],numbers:[[/-?(\d*\.)?\d+/,"number"]]}},C7e=Object.assign({},b7e,{comments:Object.assign({},b7e.comments,{lineComment:"#"}),brackets:b7e.brackets.concat([["{","}"]]),autoClosingPairs:b7e.autoClosingPairs.concat([{open:"{",close:"}"}]),surroundingPairs:b7e.surroundingPairs.concat([{open:"{",close:"}"}])}),y7e=Object.assign({},w7e,{brackets:w7e.brackets.concat([{open:"{",close:"}",token:"delimiter.curly"}]),tokenizer:Object.assign({},w7e.tokenizer,{root:[[/[a-zA-Z]\w*/,{cases:{"@keywords":"keyword","@default":"identifier"}}],{include:"@whitespace"},{include:"@numbers"},[/[,:|]/,"delimiter"],[/[{}\[\]()<>]/,"@brackets"]],whitespace:w7e.tokenizer.whitespace.concat([[/(^#.*$)/,"comment"]])})});var S7e="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},x7e=[],k7e=[],L7e="undefined"!=typeof Uint8Array?Uint8Array:Array,D7e=!1;function E7e(){D7e=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)x7e[t]=e[t],k7e[e.charCodeAt(t)]=t;k7e["-".charCodeAt(0)]=62,k7e["_".charCodeAt(0)]=63}function N7e(e,t,i){for(var n,o,s=[],r=t;r<i;r+=3)n=(e[r]<<16)+(e[r+1]<<8)+e[r+2],s.push(x7e[(o=n)>>18&63]+x7e[o>>12&63]+x7e[o>>6&63]+x7e[63&o]);return s.join("")}function I7e(e){var t;D7e||E7e();for(var i=e.length,n=i%3,o="",s=[],r=16383,a=0,l=i-n;a<l;a+=r)s.push(N7e(e,a,a+r>l?l:a+r));return 1===n?(t=e[i-1],o+=x7e[t>>2],o+=x7e[t<<4&63],o+="=="):2===n&&(t=(e[i-2]<<8)+e[i-1],o+=x7e[t>>10],o+=x7e[t>>4&63],o+=x7e[t<<2&63],o+="="),s.push(o),s.join("")}function T7e(e,t,i,n,o){var s,r,a=8*o-n-1,l=(1<<a)-1,d=l>>1,h=-7,c=i?o-1:0,u=i?-1:1,g=e[t+c];for(c+=u,s=g&(1<<-h)-1,g>>=-h,h+=a;h>0;s=256*s+e[t+c],c+=u,h-=8);for(r=s&(1<<-h)-1,s>>=-h,h+=n;h>0;r=256*r+e[t+c],c+=u,h-=8);if(0===s)s=1-d;else{if(s===l)return r?NaN:1/0*(g?-1:1);r+=Math.pow(2,n),s-=d}return(g?-1:1)*r*Math.pow(2,s-n)}function M7e(e,t,i,n,o,s){var r,a,l,d=8*s-o-1,h=(1<<d)-1,c=h>>1,u=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:s-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,r=h):(r=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-r))<1&&(r--,l*=2),(t+=r+c>=1?u/l:u*Math.pow(2,1-c))*l>=2&&(r++,l/=2),r+c>=h?(a=0,r=h):r+c>=1?(a=(t*l-1)*Math.pow(2,o),r+=c):(a=t*Math.pow(2,c-1)*Math.pow(2,o),r=0));o>=8;e[i+g]=255&a,g+=p,a/=256,o-=8);for(r=r<<o|a,d+=o;d>0;e[i+g]=255&r,g+=p,r/=256,d-=8);e[i+g-p]|=128*m}var A7e={}.toString,R7e=Array.isArray||function(e){return"[object Array]"==A7e.call(e)};function O7e(){return F7e.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function P7e(e,t){if(O7e()<t)throw new RangeError("Invalid typed array length");return F7e.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=F7e.prototype:(null===e&&(e=new F7e(t)),e.length=t),e}function F7e(e,t,i){if(!(F7e.TYPED_ARRAY_SUPPORT||this instanceof F7e))return new F7e(e,t,i);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return V7e(this,e)}return B7e(this,e,t,i)}function B7e(e,t,i,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,i,n){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===i&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,i):new Uint8Array(t,i,n),F7e.TYPED_ARRAY_SUPPORT?(e=t).__proto__=F7e.prototype:e=H7e(e,t),e}(e,t,i,n):"string"==typeof t?function(e,t,i){if("string"==typeof i&&""!==i||(i="utf8"),!F7e.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var n=0|K7e(t,i),o=(e=P7e(e,n)).write(t,i);return o!==n&&(e=e.slice(0,o)),e}(e,t,i):function(e,t){if(U7e(t)){var i=0|z7e(t.length);return 0===(e=P7e(e,i)).length||t.copy(e,0,0,i),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?P7e(e,0):H7e(e,t);if("Buffer"===t.type&&R7e(t.data))return H7e(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function W7e(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function V7e(e,t){if(W7e(t),e=P7e(e,t<0?0:0|z7e(t)),!F7e.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function H7e(e,t){var i=t.length<0?0:0|z7e(t.length);e=P7e(e,i);for(var n=0;n<i;n+=1)e[n]=255&t[n];return e}function z7e(e){if(e>=O7e())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+O7e().toString(16)+" bytes");return 0|e}function U7e(e){return!(null==e||!e._isBuffer)}function K7e(e,t){if(U7e(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return _8e(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return v8e(e).length;default:if(n)return _8e(e).length;t=(""+t).toLowerCase(),n=!0}}function j7e(e,t,i){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return r8e(this,t,i);case"utf8":case"utf-8":return i8e(this,t,i);case"ascii":return o8e(this,t,i);case"latin1":case"binary":return s8e(this,t,i);case"base64":return t8e(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a8e(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function q7e(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function $7e(e,t,i,n,o){if(0===e.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=o?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(o)return-1;i=e.length-1}else if(i<0){if(!o)return-1;i=0}if("string"==typeof t&&(t=F7e.from(t,n)),U7e(t))return 0===t.length?-1:G7e(e,t,i,n,o);if("number"==typeof t)return t&=255,F7e.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):G7e(e,[t],i,n,o);throw new TypeError("val must be string, number or Buffer")}function G7e(e,t,i,n,o){var s,r=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;r=2,a/=2,l/=2,i/=2}function d(e,t){return 1===r?e[t]:e.readUInt16BE(t*r)}if(o){var h=-1;for(s=i;s<a;s++)if(d(e,s)===d(t,-1===h?0:s-h)){if(-1===h&&(h=s),s-h+1===l)return h*r}else-1!==h&&(s-=s-h),h=-1}else for(i+l>a&&(i=a-l),s=i;s>=0;s--){for(var c=!0,u=0;u<l;u++)if(d(e,s+u)!==d(t,u)){c=!1;break}if(c)return s}return-1}function Z7e(e,t,i,n){i=Number(i)||0;var o=e.length-i;n?(n=Number(n))>o&&(n=o):n=o;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var r=0;r<n;++r){var a=parseInt(t.substr(2*r,2),16);if(isNaN(a))return r;e[i+r]=a}return r}function Y7e(e,t,i,n){return b8e(_8e(t,e.length-i),e,i,n)}function Q7e(e,t,i,n){return b8e(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,n)}function X7e(e,t,i,n){return Q7e(e,t,i,n)}function J7e(e,t,i,n){return b8e(v8e(t),e,i,n)}function e8e(e,t,i,n){return b8e(function(e,t){for(var i,n,o,s=[],r=0;r<e.length&&!((t-=2)<0);++r)n=(i=e.charCodeAt(r))>>8,o=i%256,s.push(o),s.push(n);return s}(t,e.length-i),e,i,n)}function t8e(e,t,i){return 0===t&&i===e.length?I7e(e):I7e(e.slice(t,i))}function i8e(e,t,i){i=Math.min(e.length,i);for(var n=[],o=t;o<i;){var s,r,a,l,d=e[o],h=null,c=d>239?4:d>223?3:d>191?2:1;if(o+c<=i)switch(c){case 1:d<128&&(h=d);break;case 2:128==(192&(s=e[o+1]))&&(l=(31&d)<<6|63&s)>127&&(h=l);break;case 3:s=e[o+1],r=e[o+2],128==(192&s)&&128==(192&r)&&(l=(15&d)<<12|(63&s)<<6|63&r)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:s=e[o+1],r=e[o+2],a=e[o+3],128==(192&s)&&128==(192&r)&&128==(192&a)&&(l=(15&d)<<18|(63&s)<<12|(63&r)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),o+=c}return function(e){var t=e.length;if(t<=n8e)return String.fromCharCode.apply(String,e);for(var i="",n=0;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=n8e));return i}(n)}F7e.TYPED_ARRAY_SUPPORT=void 0===S7e.TYPED_ARRAY_SUPPORT||S7e.TYPED_ARRAY_SUPPORT,O7e(),F7e.poolSize=8192,F7e._augment=function(e){return e.__proto__=F7e.prototype,e},F7e.from=function(e,t,i){return B7e(null,e,t,i)},F7e.TYPED_ARRAY_SUPPORT&&(F7e.prototype.__proto__=Uint8Array.prototype,F7e.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&F7e[Symbol.species]),F7e.alloc=function(e,t,i){return function(e,t,i,n){return W7e(t),t<=0?P7e(e,t):void 0!==i?"string"==typeof n?P7e(e,t).fill(i,n):P7e(e,t).fill(i):P7e(e,t)}(null,e,t,i)},F7e.allocUnsafe=function(e){return V7e(null,e)},F7e.allocUnsafeSlow=function(e){return V7e(null,e)},F7e.isBuffer=w8e,F7e.compare=function(e,t){if(!U7e(e)||!U7e(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,n=t.length,o=0,s=Math.min(i,n);o<s;++o)if(e[o]!==t[o]){i=e[o],n=t[o];break}return i<n?-1:n<i?1:0},F7e.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},F7e.concat=function(e,t){if(!R7e(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return F7e.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var n=F7e.allocUnsafe(t),o=0;for(i=0;i<e.length;++i){var s=e[i];if(!U7e(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,o),o+=s.length}return n},F7e.byteLength=K7e,F7e.prototype._isBuffer=!0,F7e.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)q7e(this,t,t+1);return this},F7e.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)q7e(this,t,t+3),q7e(this,t+1,t+2);return this},F7e.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)q7e(this,t,t+7),q7e(this,t+1,t+6),q7e(this,t+2,t+5),q7e(this,t+3,t+4);return this},F7e.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?i8e(this,0,e):j7e.apply(this,arguments)},F7e.prototype.equals=function(e){if(!U7e(e))throw new TypeError("Argument must be a Buffer");return this===e||0===F7e.compare(this,e)},F7e.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},F7e.prototype.compare=function(e,t,i,n,o){if(!U7e(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||i>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=i)return 0;if(n>=o)return-1;if(t>=i)return 1;if(this===e)return 0;for(var s=(o>>>=0)-(n>>>=0),r=(i>>>=0)-(t>>>=0),a=Math.min(s,r),l=this.slice(n,o),d=e.slice(t,i),h=0;h<a;++h)if(l[h]!==d[h]){s=l[h],r=d[h];break}return s<r?-1:r<s?1:0},F7e.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},F7e.prototype.indexOf=function(e,t,i){return $7e(this,e,t,i,!0)},F7e.prototype.lastIndexOf=function(e,t,i){return $7e(this,e,t,i,!1)},F7e.prototype.write=function(e,t,i,n){if(void 0===t)n="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)n=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var o=this.length-t;if((void 0===i||i>o)&&(i=o),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return Z7e(this,e,t,i);case"utf8":case"utf-8":return Y7e(this,e,t,i);case"ascii":return Q7e(this,e,t,i);case"latin1":case"binary":return X7e(this,e,t,i);case"base64":return J7e(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e8e(this,e,t,i);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},F7e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var n8e=4096;function o8e(e,t,i){var n="";i=Math.min(e.length,i);for(var o=t;o<i;++o)n+=String.fromCharCode(127&e[o]);return n}function s8e(e,t,i){var n="";i=Math.min(e.length,i);for(var o=t;o<i;++o)n+=String.fromCharCode(e[o]);return n}function r8e(e,t,i){var n=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>n)&&(i=n);for(var o="",s=t;s<i;++s)o+=f8e(e[s]);return o}function a8e(e,t,i){for(var n=e.slice(t,i),o="",s=0;s<n.length;s+=2)o+=String.fromCharCode(n[s]+256*n[s+1]);return o}function l8e(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function d8e(e,t,i,n,o,s){if(!U7e(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<s)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}function h8e(e,t,i,n){t<0&&(t=65535+t+1);for(var o=0,s=Math.min(e.length-i,2);o<s;++o)e[i+o]=(t&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function c8e(e,t,i,n){t<0&&(t=4294967295+t+1);for(var o=0,s=Math.min(e.length-i,4);o<s;++o)e[i+o]=t>>>8*(n?o:3-o)&255}function u8e(e,t,i,n,o,s){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function g8e(e,t,i,n,o){return o||u8e(e,0,i,4),M7e(e,t,i,n,23,4),i+4}function p8e(e,t,i,n,o){return o||u8e(e,0,i,8),M7e(e,t,i,n,52,8),i+8}F7e.prototype.slice=function(e,t){var i,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),F7e.TYPED_ARRAY_SUPPORT)(i=this.subarray(e,t)).__proto__=F7e.prototype;else{var o=t-e;i=new F7e(o,void 0);for(var s=0;s<o;++s)i[s]=this[s+e]}return i},F7e.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||l8e(e,t,this.length);for(var n=this[e],o=1,s=0;++s<t&&(o*=256);)n+=this[e+s]*o;return n},F7e.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||l8e(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},F7e.prototype.readUInt8=function(e,t){return t||l8e(e,1,this.length),this[e]},F7e.prototype.readUInt16LE=function(e,t){return t||l8e(e,2,this.length),this[e]|this[e+1]<<8},F7e.prototype.readUInt16BE=function(e,t){return t||l8e(e,2,this.length),this[e]<<8|this[e+1]},F7e.prototype.readUInt32LE=function(e,t){return t||l8e(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},F7e.prototype.readUInt32BE=function(e,t){return t||l8e(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},F7e.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||l8e(e,t,this.length);for(var n=this[e],o=1,s=0;++s<t&&(o*=256);)n+=this[e+s]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},F7e.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||l8e(e,t,this.length);for(var n=t,o=1,s=this[e+--n];n>0&&(o*=256);)s+=this[e+--n]*o;return s>=(o*=128)&&(s-=Math.pow(2,8*t)),s},F7e.prototype.readInt8=function(e,t){return t||l8e(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},F7e.prototype.readInt16LE=function(e,t){t||l8e(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},F7e.prototype.readInt16BE=function(e,t){t||l8e(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},F7e.prototype.readInt32LE=function(e,t){return t||l8e(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},F7e.prototype.readInt32BE=function(e,t){return t||l8e(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},F7e.prototype.readFloatLE=function(e,t){return t||l8e(e,4,this.length),T7e(this,e,!0,23,4)},F7e.prototype.readFloatBE=function(e,t){return t||l8e(e,4,this.length),T7e(this,e,!1,23,4)},F7e.prototype.readDoubleLE=function(e,t){return t||l8e(e,8,this.length),T7e(this,e,!0,52,8)},F7e.prototype.readDoubleBE=function(e,t){return t||l8e(e,8,this.length),T7e(this,e,!1,52,8)},F7e.prototype.writeUIntLE=function(e,t,i,n){e=+e,t|=0,i|=0,n||d8e(this,e,t,i,Math.pow(2,8*i)-1,0);var o=1,s=0;for(this[t]=255&e;++s<i&&(o*=256);)this[t+s]=e/o&255;return t+i},F7e.prototype.writeUIntBE=function(e,t,i,n){e=+e,t|=0,i|=0,n||d8e(this,e,t,i,Math.pow(2,8*i)-1,0);var o=i-1,s=1;for(this[t+o]=255&e;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+i},F7e.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||d8e(this,e,t,1,255,0),F7e.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},F7e.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||d8e(this,e,t,2,65535,0),F7e.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):h8e(this,e,t,!0),t+2},F7e.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||d8e(this,e,t,2,65535,0),F7e.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):h8e(this,e,t,!1),t+2},F7e.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||d8e(this,e,t,4,4294967295,0),F7e.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):c8e(this,e,t,!0),t+4},F7e.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||d8e(this,e,t,4,4294967295,0),F7e.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):c8e(this,e,t,!1),t+4},F7e.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*i-1);d8e(this,e,t,i,o-1,-o)}var s=0,r=1,a=0;for(this[t]=255&e;++s<i&&(r*=256);)e<0&&0===a&&0!==this[t+s-1]&&(a=1),this[t+s]=(e/r|0)-a&255;return t+i},F7e.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*i-1);d8e(this,e,t,i,o-1,-o)}var s=i-1,r=1,a=0;for(this[t+s]=255&e;--s>=0&&(r*=256);)e<0&&0===a&&0!==this[t+s+1]&&(a=1),this[t+s]=(e/r|0)-a&255;return t+i},F7e.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||d8e(this,e,t,1,127,-128),F7e.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},F7e.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||d8e(this,e,t,2,32767,-32768),F7e.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):h8e(this,e,t,!0),t+2},F7e.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||d8e(this,e,t,2,32767,-32768),F7e.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):h8e(this,e,t,!1),t+2},F7e.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||d8e(this,e,t,4,2147483647,-2147483648),F7e.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):c8e(this,e,t,!0),t+4},F7e.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||d8e(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),F7e.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):c8e(this,e,t,!1),t+4},F7e.prototype.writeFloatLE=function(e,t,i){return g8e(this,e,t,!0,i)},F7e.prototype.writeFloatBE=function(e,t,i){return g8e(this,e,t,!1,i)},F7e.prototype.writeDoubleLE=function(e,t,i){return p8e(this,e,t,!0,i)},F7e.prototype.writeDoubleBE=function(e,t,i){return p8e(this,e,t,!1,i)},F7e.prototype.copy=function(e,t,i,n){if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);var o,s=n-i;if(this===e&&i<t&&t<n)for(o=s-1;o>=0;--o)e[o+t]=this[o+i];else if(s<1e3||!F7e.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+t]=this[o+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+s),t);return s},F7e.prototype.fill=function(e,t,i,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!F7e.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;var s;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(s=t;s<i;++s)this[s]=e;else{var r=U7e(e)?e:_8e(new F7e(e,n).toString()),a=r.length;for(s=0;s<i-t;++s)this[s+t]=r[s%a]}return this};var m8e=/[^+\/0-9A-Za-z-_]/g;function f8e(e){return e<16?"0"+e.toString(16):e.toString(16)}function _8e(e,t){var i;t=t||1/0;for(var n=e.length,o=null,s=[],r=0;r<n;++r){if((i=e.charCodeAt(r))>55295&&i<57344){if(!o){if(i>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(r+1===n){(t-=3)>-1&&s.push(239,191,189);continue}o=i;continue}if(i<56320){(t-=3)>-1&&s.push(239,191,189),o=i;continue}i=65536+(o-55296<<10|i-56320)}else o&&(t-=3)>-1&&s.push(239,191,189);if(o=null,i<128){if((t-=1)<0)break;s.push(i)}else if(i<2048){if((t-=2)<0)break;s.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;s.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return s}function v8e(e){return function(e){var t,i,n,o,s,r;D7e||E7e();var a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s="="===e[a-2]?2:"="===e[a-1]?1:0,r=new L7e(3*a/4-s),n=s>0?a-4:a;var l=0;for(t=0,i=0;t<n;t+=4,i+=3)o=k7e[e.charCodeAt(t)]<<18|k7e[e.charCodeAt(t+1)]<<12|k7e[e.charCodeAt(t+2)]<<6|k7e[e.charCodeAt(t+3)],r[l++]=o>>16&255,r[l++]=o>>8&255,r[l++]=255&o;return 2===s?(o=k7e[e.charCodeAt(t)]<<2|k7e[e.charCodeAt(t+1)]>>4,r[l++]=255&o):1===s&&(o=k7e[e.charCodeAt(t)]<<10|k7e[e.charCodeAt(t+1)]<<4|k7e[e.charCodeAt(t+2)]>>2,r[l++]=o>>8&255,r[l++]=255&o),r}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(m8e,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function b8e(e,t,i,n){for(var o=0;o<n&&!(o+i>=t.length||o>=e.length);++o)t[o+i]=e[o];return o}function w8e(e){return null!=e&&(!!e._isBuffer||C8e(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&C8e(e.slice(0,0))}(e))}function C8e(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}class y8e extends Error{constructor(e,t,i,...n){Array.isArray(t)&&(t=t.join(" ").trim()),super(t),void 0!==Error.captureStackTrace&&Error.captureStackTrace(this,y8e),this.code=e;for(const e of n)for(const t in e){const n=e[t];this[t]=w8e(n)?n.toString(i.encoding):null==n?n:JSON.parse(JSON.stringify(n))}}}const S8e=function(e){const t=[];for(let n=0,o=e.length;n<o;n++){const o=e[n];if(null==o||!1===o)t[n]={disabled:!0};else if("string"==typeof o)t[n]={name:o};else{if("object"!=typeof(i=o)||null===i||Array.isArray(i))throw new y8e("CSV_INVALID_COLUMN_DEFINITION",["Invalid column definition:","expect a string or a literal object,",`got ${JSON.stringify(o)} at position ${n}`]);if("string"!=typeof o.name)throw new y8e("CSV_OPTION_COLUMNS_MISSING_NAME",["Option columns missing name:",`property "name" is required at position ${n}`,"when column is an object literal"]);t[n]=o}}var i;return t};class x8e{constructor(e=100){this.size=e,this.length=0,this.buf=F7e.allocUnsafe(e)}prepend(e){if(w8e(e)){const t=this.length+e.length;if(t>=this.size&&(this.resize(),t>=this.size))throw Error("INVALID_BUFFER_STATE");const i=this.buf;this.buf=F7e.allocUnsafe(this.size),e.copy(this.buf,0),i.copy(this.buf,e.length),this.length+=e.length}else{const t=this.length++;t===this.size&&this.resize();const i=this.clone();this.buf[0]=e,i.copy(this.buf,1,0,t)}}append(e){const t=this.length++;t===this.size&&this.resize(),this.buf[t]=e}clone(){return F7e.from(this.buf.slice(0,this.length))}resize(){const e=this.length;this.size=2*this.size;const t=F7e.allocUnsafe(this.size);this.buf.copy(t,0,0,e),this.buf=t}toString(e){return e?this.buf.slice(0,this.length).toString(e):Uint8Array.prototype.slice.call(this.buf.slice(0,this.length))}toJSON(){return this.toString("utf8")}reset(){this.length=0}}const k8e=function(e){return{bomSkipped:!1,bufBytesStart:0,castField:e.cast_function,commenting:!1,error:void 0,enabled:1===e.from_line,escaping:!1,escapeIsQuote:w8e(e.escape)&&w8e(e.quote)&&0===F7e.compare(e.escape,e.quote),expectedRecordLength:Array.isArray(e.columns)?e.columns.length:void 0,field:new x8e(20),firstLineToHeaders:e.cast_first_line_to_header,needMoreDataSize:Math.max(null!==e.comment?e.comment.length:0,...e.delimiter.map((e=>e.length)),null!==e.quote?e.quote.length:0),previousBuf:void 0,quoting:!1,stop:!1,rawBuffer:new x8e(100),record:[],recordHasError:!1,record_length:0,recordDelimiterMaxLength:0===e.record_delimiter.length?0:Math.max(...e.record_delimiter.map((e=>e.length))),trimChars:[F7e.from(" ",e.encoding)[0],F7e.from("\t",e.encoding)[0]],wasQuoting:!1,wasRowDelimiter:!1,timchars:[F7e.from(F7e.from([13],"utf8").toString(),e.encoding),F7e.from(F7e.from([10],"utf8").toString(),e.encoding),F7e.from(F7e.from([12],"utf8").toString(),e.encoding),F7e.from(F7e.from([32],"utf8").toString(),e.encoding),F7e.from(F7e.from([9],"utf8").toString(),e.encoding)]}},L8e=function(e){const t={};for(const n in e)t[(i=n,i.replace(/([A-Z])/g,(function(e,t){return"_"+t.toLowerCase()})))]=e[n];var i;if(void 0===t.encoding||!0===t.encoding)t.encoding="utf8";else if(null===t.encoding||!1===t.encoding)t.encoding=null;else if("string"!=typeof t.encoding&&null!==t.encoding)throw new y8e("CSV_INVALID_OPTION_ENCODING",["Invalid option encoding:","encoding must be a string or null to return a buffer,",`got ${JSON.stringify(t.encoding)}`],t);if(void 0===t.bom||null===t.bom||!1===t.bom)t.bom=!1;else if(!0!==t.bom)throw new y8e("CSV_INVALID_OPTION_BOM",["Invalid option bom:","bom must be true,",`got ${JSON.stringify(t.bom)}`],t);if(t.cast_function=null,void 0===t.cast||null===t.cast||!1===t.cast||""===t.cast)t.cast=void 0;else if("function"==typeof t.cast)t.cast_function=t.cast,t.cast=!0;else if(!0!==t.cast)throw new y8e("CSV_INVALID_OPTION_CAST",["Invalid option cast:","cast must be true or a function,",`got ${JSON.stringify(t.cast)}`],t);if(void 0===t.cast_date||null===t.cast_date||!1===t.cast_date||""===t.cast_date)t.cast_date=!1;else if(!0===t.cast_date)t.cast_date=function(e){const t=Date.parse(e);return isNaN(t)?e:new Date(t)};else if("function"!=typeof t.cast_date)throw new y8e("CSV_INVALID_OPTION_CAST_DATE",["Invalid option cast_date:","cast_date must be true or a function,",`got ${JSON.stringify(t.cast_date)}`],t);if(t.cast_first_line_to_header=null,!0===t.columns)t.cast_first_line_to_header=void 0;else if("function"==typeof t.columns)t.cast_first_line_to_header=t.columns,t.columns=!0;else if(Array.isArray(t.columns))t.columns=S8e(t.columns);else{if(void 0!==t.columns&&null!==t.columns&&!1!==t.columns)throw new y8e("CSV_INVALID_OPTION_COLUMNS",["Invalid option columns:","expect an array, a function or true,",`got ${JSON.stringify(t.columns)}`],t);t.columns=!1}if(void 0===t.group_columns_by_name||null===t.group_columns_by_name||!1===t.group_columns_by_name)t.group_columns_by_name=!1;else{if(!0!==t.group_columns_by_name)throw new y8e("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","expect an boolean,",`got ${JSON.stringify(t.group_columns_by_name)}`],t);if(!1===t.columns)throw new y8e("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","the `columns` mode must be activated."],t)}if(void 0===t.comment||null===t.comment||!1===t.comment||""===t.comment)t.comment=null;else if("string"==typeof t.comment&&(t.comment=F7e.from(t.comment,t.encoding)),!w8e(t.comment))throw new y8e("CSV_INVALID_OPTION_COMMENT",["Invalid option comment:","comment must be a buffer or a string,",`got ${JSON.stringify(t.comment)}`],t);if(void 0===t.comment_no_infix||null===t.comment_no_infix||!1===t.comment_no_infix)t.comment_no_infix=!1;else if(!0!==t.comment_no_infix)throw new y8e("CSV_INVALID_OPTION_COMMENT",["Invalid option comment_no_infix:","value must be a boolean,",`got ${JSON.stringify(t.comment_no_infix)}`],t);const n=JSON.stringify(t.delimiter);if(Array.isArray(t.delimiter)||(t.delimiter=[t.delimiter]),0===t.delimiter.length)throw new y8e("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${n}`],t);if(t.delimiter=t.delimiter.map((function(e){if(null==e||!1===e)return F7e.from(",",t.encoding);if("string"==typeof e&&(e=F7e.from(e,t.encoding)),!w8e(e)||0===e.length)throw new y8e("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${n}`],t);return e})),void 0===t.escape||!0===t.escape?t.escape=F7e.from('"',t.encoding):"string"==typeof t.escape?t.escape=F7e.from(t.escape,t.encoding):null!==t.escape&&!1!==t.escape||(t.escape=null),null!==t.escape&&!w8e(t.escape))throw new Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(t.escape)}`);if(void 0===t.from||null===t.from)t.from=1;else{if("string"==typeof t.from&&/\d+/.test(t.from)&&(t.from=parseInt(t.from)),!Number.isInteger(t.from))throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(t.from)}`);if(t.from<0)throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(e.from)}`)}if(void 0===t.from_line||null===t.from_line)t.from_line=1;else{if("string"==typeof t.from_line&&/\d+/.test(t.from_line)&&(t.from_line=parseInt(t.from_line)),!Number.isInteger(t.from_line))throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(e.from_line)}`);if(t.from_line<=0)throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(e.from_line)}`)}if(void 0===t.ignore_last_delimiters||null===t.ignore_last_delimiters)t.ignore_last_delimiters=!1;else if("number"==typeof t.ignore_last_delimiters)t.ignore_last_delimiters=Math.floor(t.ignore_last_delimiters),0===t.ignore_last_delimiters&&(t.ignore_last_delimiters=!1);else if("boolean"!=typeof t.ignore_last_delimiters)throw new y8e("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS",["Invalid option `ignore_last_delimiters`:","the value must be a boolean value or an integer,",`got ${JSON.stringify(t.ignore_last_delimiters)}`],t);if(!0===t.ignore_last_delimiters&&!1===t.columns)throw new y8e("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS",["The option `ignore_last_delimiters`","requires the activation of the `columns` option"],t);if(void 0===t.info||null===t.info||!1===t.info)t.info=!1;else if(!0!==t.info)throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(t.info)}`);if(void 0===t.max_record_size||null===t.max_record_size||!1===t.max_record_size)t.max_record_size=0;else if(Number.isInteger(t.max_record_size)&&t.max_record_size>=0);else{if("string"!=typeof t.max_record_size||!/\d+/.test(t.max_record_size))throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(t.max_record_size)}`);t.max_record_size=parseInt(t.max_record_size)}if(void 0===t.objname||null===t.objname||!1===t.objname)t.objname=void 0;else if(w8e(t.objname)){if(0===t.objname.length)throw new Error("Invalid Option: objname must be a non empty buffer");null===t.encoding||(t.objname=t.objname.toString(t.encoding))}else if("string"==typeof t.objname){if(0===t.objname.length)throw new Error("Invalid Option: objname must be a non empty string")}else if("number"!=typeof t.objname)throw new Error(`Invalid Option: objname must be a string or a buffer, got ${t.objname}`);if(void 0!==t.objname)if("number"==typeof t.objname){if(!1!==t.columns)throw Error("Invalid Option: objname index cannot be combined with columns or be defined as a field")}else if(!1===t.columns)throw Error("Invalid Option: objname field must be combined with columns or be defined as an index");if(void 0===t.on_record||null===t.on_record)t.on_record=void 0;else if("function"!=typeof t.on_record)throw new y8e("CSV_INVALID_OPTION_ON_RECORD",["Invalid option `on_record`:","expect a function,",`got ${JSON.stringify(t.on_record)}`],t);if(void 0!==t.on_skip&&null!==t.on_skip&&"function"!=typeof t.on_skip)throw new Error(`Invalid Option: on_skip must be a function, got ${JSON.stringify(t.on_skip)}`);if(null===t.quote||!1===t.quote||""===t.quote)t.quote=null;else if(void 0===t.quote||!0===t.quote?t.quote=F7e.from('"',t.encoding):"string"==typeof t.quote&&(t.quote=F7e.from(t.quote,t.encoding)),!w8e(t.quote))throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(t.quote)}`);if(void 0===t.raw||null===t.raw||!1===t.raw)t.raw=!1;else if(!0!==t.raw)throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(t.raw)}`);if(void 0===t.record_delimiter)t.record_delimiter=[];else if("string"==typeof t.record_delimiter||w8e(t.record_delimiter)){if(0===t.record_delimiter.length)throw new y8e("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer,",`got ${JSON.stringify(t.record_delimiter)}`],t);t.record_delimiter=[t.record_delimiter]}else if(!Array.isArray(t.record_delimiter))throw new y8e("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer,",`got ${JSON.stringify(t.record_delimiter)}`],t);if(t.record_delimiter=t.record_delimiter.map((function(e,i){if("string"!=typeof e&&!w8e(e))throw new y8e("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer",`at index ${i},`,`got ${JSON.stringify(e)}`],t);if(0===e.length)throw new y8e("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer",`at index ${i},`,`got ${JSON.stringify(e)}`],t);return"string"==typeof e&&(e=F7e.from(e,t.encoding)),e})),"boolean"==typeof t.relax_column_count);else{if(void 0!==t.relax_column_count&&null!==t.relax_column_count)throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(t.relax_column_count)}`);t.relax_column_count=!1}if("boolean"==typeof t.relax_column_count_less);else{if(void 0!==t.relax_column_count_less&&null!==t.relax_column_count_less)throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(t.relax_column_count_less)}`);t.relax_column_count_less=!1}if("boolean"==typeof t.relax_column_count_more);else{if(void 0!==t.relax_column_count_more&&null!==t.relax_column_count_more)throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(t.relax_column_count_more)}`);t.relax_column_count_more=!1}if("boolean"==typeof t.relax_quotes);else{if(void 0!==t.relax_quotes&&null!==t.relax_quotes)throw new Error(`Invalid Option: relax_quotes must be a boolean, got ${JSON.stringify(t.relax_quotes)}`);t.relax_quotes=!1}if("boolean"==typeof t.skip_empty_lines);else{if(void 0!==t.skip_empty_lines&&null!==t.skip_empty_lines)throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(t.skip_empty_lines)}`);t.skip_empty_lines=!1}if("boolean"==typeof t.skip_records_with_empty_values);else{if(void 0!==t.skip_records_with_empty_values&&null!==t.skip_records_with_empty_values)throw new Error(`Invalid Option: skip_records_with_empty_values must be a boolean, got ${JSON.stringify(t.skip_records_with_empty_values)}`);t.skip_records_with_empty_values=!1}if("boolean"==typeof t.skip_records_with_error);else{if(void 0!==t.skip_records_with_error&&null!==t.skip_records_with_error)throw new Error(`Invalid Option: skip_records_with_error must be a boolean, got ${JSON.stringify(t.skip_records_with_error)}`);t.skip_records_with_error=!1}if(void 0===t.rtrim||null===t.rtrim||!1===t.rtrim)t.rtrim=!1;else if(!0!==t.rtrim)throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(t.rtrim)}`);if(void 0===t.ltrim||null===t.ltrim||!1===t.ltrim)t.ltrim=!1;else if(!0!==t.ltrim)throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(t.ltrim)}`);if(void 0===t.trim||null===t.trim||!1===t.trim)t.trim=!1;else if(!0!==t.trim)throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(t.trim)}`);if(!0===t.trim&&!1!==e.ltrim?t.ltrim=!0:!0!==t.ltrim&&(t.ltrim=!1),!0===t.trim&&!1!==e.rtrim?t.rtrim=!0:!0!==t.rtrim&&(t.rtrim=!1),void 0===t.to||null===t.to)t.to=-1;else{if("string"==typeof t.to&&/\d+/.test(t.to)&&(t.to=parseInt(t.to)),!Number.isInteger(t.to))throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify(e.to)}`);if(t.to<=0)throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(e.to)}`)}if(void 0===t.to_line||null===t.to_line)t.to_line=-1;else{if("string"==typeof t.to_line&&/\d+/.test(t.to_line)&&(t.to_line=parseInt(t.to_line)),!Number.isInteger(t.to_line))throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(e.to_line)}`);if(t.to_line<=0)throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(e.to_line)}`)}return t},D8e=function(e){return e.every((e=>null==e||e.toString&&""===e.toString().trim()))},E8e={utf8:F7e.from([239,187,191]),utf16le:F7e.from([255,254])},N8e=[],I8e={},T8e={threshold:100,filteredTags:[],isRplaceUnderscore:!1,loadedCSV:{},enabledCSV:[]},M8e=()=>T8e.isRplaceUnderscore,A8e=e=>!!isNaN(e.count)||e.count>T8e.threshold,R8e=(e,t,i=!1)=>{I8e[e]&&!i?Array.prototype.push.apply(I8e[e],t):I8e[e]=t.slice()},O8e=()=>{N8e.length=0,T8e.filteredTags.length=0},P8e=(e,t)=>{T8e.loadedCSV[e]=t,T8e.enabledCSV.includes(e)||T8e.enabledCSV.push(e),F8e(t,e)},F8e=(e,t)=>{for(const i of function(e,t={}){"string"==typeof e&&(e=F7e.from(e));const i=t&&t.objname?{}:[],n=function(e={}){const t=L8e(e);return{info:{bytes:0,comment_lines:0,empty_lines:0,invalid_field_length:0,lines:1,records:0},original_options:e,options:t,state:k8e(t),__needMoreData:function(e,t,i){if(i)return!1;const{encoding:n,escape:o,quote:s}=this.options,{quoting:r,needMoreDataSize:a,recordDelimiterMaxLength:l}=this.state;return t-e-1<Math.max(a,0===l?F7e.from("\r\n",n).length:l,r?(null===o?0:o.length)+s.length:0,r?s.length+l:0)},parse:function(e,t,i,n){const{bom:o,comment_no_infix:s,encoding:r,from_line:a,ltrim:l,max_record_size:d,raw:h,relax_quotes:c,rtrim:u,skip_empty_lines:g,to:p,to_line:m}=this.options;let{comment:f,escape:_,quote:v,record_delimiter:b}=this.options;const{bomSkipped:w,previousBuf:C,rawBuffer:y,escapeIsQuote:S}=this.state;let x;if(void 0===C){if(void 0===e)return void n();x=e}else x=void 0!==C&&void 0===e?C:F7e.concat([C,e]);if(!1===w)if(!1===o)this.state.bomSkipped=!0;else if(x.length<3){if(!1===t)return void(this.state.previousBuf=x)}else{for(const e in E8e)if(0===E8e[e].compare(x,0,E8e[e].length)){const t=E8e[e].length;this.state.bufBytesStart+=t,x=x.slice(t),this.options=L8e({...this.original_options,encoding:e}),({comment:f,escape:_,quote:v}=this.options);break}this.state.bomSkipped=!0}const k=x.length;let L;for(L=0;L<k&&!this.__needMoreData(L,k,t);L++){if(!0===this.state.wasRowDelimiter&&(this.info.lines++,this.state.wasRowDelimiter=!1),-1!==m&&this.info.lines>m)return this.state.stop=!0,void n();!1===this.state.quoting&&0===b.length&&this.__autoDiscoverRecordDelimiter(x,L)&&(b=this.options.record_delimiter);const e=x[L];if(!0===h&&y.append(e),13!==e&&10!==e||!1!==this.state.wasRowDelimiter||(this.state.wasRowDelimiter=!0),!0===this.state.escaping)this.state.escaping=!1;else{if(null!==_&&!0===this.state.quoting&&this.__isEscape(x,L,e)&&L+_.length<k){if(!S){this.state.escaping=!0,L+=_.length-1;continue}if(this.__isQuote(x,L+_.length)){this.state.escaping=!0,L+=_.length-1;continue}}if(!1===this.state.commenting&&this.__isQuote(x,L))if(!0===this.state.quoting){const t=x[L+v.length],i=u&&this.__isCharTrimable(x,L+v.length),n=null!==f&&this.__compareBytes(f,x,L+v.length,t),o=this.__isDelimiter(x,L+v.length,t),s=0===b.length?this.__autoDiscoverRecordDelimiter(x,L+v.length):this.__isRecordDelimiter(t,x,L+v.length);if(null!==_&&this.__isEscape(x,L,e)&&this.__isQuote(x,L+_.length))L+=_.length-1;else{if(!t||o||s||n||i){this.state.quoting=!1,this.state.wasQuoting=!0,L+=v.length-1;continue}if(!1===c){const e=this.__error(new y8e("CSV_INVALID_CLOSING_QUOTE",["Invalid Closing Quote:",`got "${String.fromCharCode(t)}"`,`at line ${this.info.lines}`,"instead of delimiter, record delimiter, trimable character","(if activated) or comment"],this.options,this.__infoField()));if(void 0!==e)return e}else this.state.quoting=!1,this.state.wasQuoting=!0,this.state.field.prepend(v),L+=v.length-1}}else{if(0===this.state.field.length){this.state.quoting=!0,L+=v.length-1;continue}if(!1===c){const e=this.__infoField(),t=Object.keys(E8e).map((e=>!!E8e[e].equals(this.state.field.toString())&&e)).filter(Boolean)[0],i=this.__error(new y8e("INVALID_OPENING_QUOTE",["Invalid Opening Quote:",`a quote is found on field ${JSON.stringify(e.column)} at line ${e.lines}, value is ${JSON.stringify(this.state.field.toString(r))}`,t?`(${t} bom)`:void 0],this.options,e,{field:this.state.field}));if(void 0!==i)return i}}if(!1===this.state.quoting){const t=this.__isRecordDelimiter(e,x,L);if(0!==t){if(this.state.commenting&&!1===this.state.wasQuoting&&0===this.state.record.length&&0===this.state.field.length)this.info.comment_lines++;else{if(!1===this.state.enabled&&this.info.lines+(!0===this.state.wasRowDelimiter?1:0)>=a){this.state.enabled=!0,this.__resetField(),this.__resetRecord(),L+=t-1;continue}if(!0===g&&!1===this.state.wasQuoting&&0===this.state.record.length&&0===this.state.field.length){this.info.empty_lines++,L+=t-1;continue}this.info.bytes=this.state.bufBytesStart+L;const e=this.__onField();if(void 0!==e)return e;this.info.bytes=this.state.bufBytesStart+L+t;const o=this.__onRecord(i);if(void 0!==o)return o;if(-1!==p&&this.info.records>=p)return this.state.stop=!0,void n()}this.state.commenting=!1,L+=t-1;continue}if(this.state.commenting)continue;if(null!==f&&(!1===s||0===this.state.record.length&&0===this.state.field.length)&&0!==this.__compareBytes(f,x,L,e)){this.state.commenting=!0;continue}const o=this.__isDelimiter(x,L,e);if(0!==o){this.info.bytes=this.state.bufBytesStart+L;const e=this.__onField();if(void 0!==e)return e;L+=o-1;continue}}}if(!1===this.state.commenting&&0!==d&&this.state.record_length+this.state.field.length>d)return this.__error(new y8e("CSV_MAX_RECORD_SIZE",["Max Record Size:","record exceed the maximum number of tolerated bytes",`of ${d}`,`at line ${this.info.lines}`],this.options,this.__infoField()));const t=!1===l||!0===this.state.quoting||0!==this.state.field.length||!this.__isCharTrimable(x,L),o=!1===u||!1===this.state.wasQuoting;if(!0!==t||!0!==o){if(!0!==u||this.__isCharTrimable(x,L)){!1===t&&(L+=this.__isCharTrimable(x,L)-1);continue}return this.__error(new y8e("CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",["Invalid Closing Quote:","found non trimable byte after quote",`at line ${this.info.lines}`],this.options,this.__infoField()))}this.state.field.append(e)}if(!0===t)if(!0===this.state.quoting){const e=this.__error(new y8e("CSV_QUOTE_NOT_CLOSED",["Quote Not Closed:",`the parsing is finished with an opening quote at line ${this.info.lines}`],this.options,this.__infoField()));if(void 0!==e)return e}else if(!0===this.state.wasQuoting||0!==this.state.record.length||0!==this.state.field.length){this.info.bytes=this.state.bufBytesStart+L;const e=this.__onField();if(void 0!==e)return e;const t=this.__onRecord(i);if(void 0!==t)return t}else!0===this.state.wasRowDelimiter?this.info.empty_lines++:!0===this.state.commenting&&this.info.comment_lines++;else this.state.bufBytesStart+=L,this.state.previousBuf=x.slice(L);!0===this.state.wasRowDelimiter&&(this.info.lines++,this.state.wasRowDelimiter=!1)},__onRecord:function(e){const{columns:t,group_columns_by_name:i,encoding:n,info:o,from:s,relax_column_count:r,relax_column_count_less:a,relax_column_count_more:l,raw:d,skip_records_with_empty_values:h}=this.options,{enabled:c,record:u}=this.state;if(!1===c)return this.__resetRecord();const g=u.length;if(!0===t)return!0===h&&D8e(u)?void this.__resetRecord():this.__firstLineToColumns(u);if(!1===t&&0===this.info.records&&(this.state.expectedRecordLength=g),g!==this.state.expectedRecordLength){const e=!1===t?new y8e("CSV_RECORD_INCONSISTENT_FIELDS_LENGTH",["Invalid Record Length:",`expect ${this.state.expectedRecordLength},`,`got ${g} on line ${this.info.lines}`],this.options,this.__infoField(),{record:u}):new y8e("CSV_RECORD_INCONSISTENT_COLUMNS",["Invalid Record Length:",`columns length is ${t.length},`,`got ${g} on line ${this.info.lines}`],this.options,this.__infoField(),{record:u});if(!0===r||!0===a&&g<this.state.expectedRecordLength||!0===l&&g>this.state.expectedRecordLength)this.info.invalid_field_length++,this.state.error=e;else{const t=this.__error(e);if(t)return t}}if(!0===h&&D8e(u))this.__resetRecord();else{if(!0===this.state.recordHasError)return this.__resetRecord(),void(this.state.recordHasError=!1);if(this.info.records++,1===s||this.info.records>=s){const{objname:s}=this.options;if(!1!==t){const r={};for(let e=0,n=u.length;e<n;e++)void 0===t[e]||t[e].disabled||(!0===i&&void 0!==r[t[e].name]?Array.isArray(r[t[e].name])?r[t[e].name]=r[t[e].name].concat(u[e]):r[t[e].name]=[r[t[e].name],u[e]]:r[t[e].name]=u[e]);if(!0===d||!0===o){const t=Object.assign({record:r},!0===d?{raw:this.state.rawBuffer.toString(n)}:{},!0===o?{info:this.__infoRecord()}:{}),i=this.__push(void 0===s?t:[r[s],t],e);if(i)return i}else{const t=this.__push(void 0===s?r:[r[s],r],e);if(t)return t}}else if(!0===d||!0===o){const t=Object.assign({record:u},!0===d?{raw:this.state.rawBuffer.toString(n)}:{},!0===o?{info:this.__infoRecord()}:{}),i=this.__push(void 0===s?t:[u[s],t],e);if(i)return i}else{const t=this.__push(void 0===s?u:[u[s],u],e);if(t)return t}}this.__resetRecord()}},__firstLineToColumns:function(e){const{firstLineToHeaders:t}=this.state;try{const i=void 0===t?e:t.call(null,e);if(!Array.isArray(i))return this.__error(new y8e("CSV_INVALID_COLUMN_MAPPING",["Invalid Column Mapping:","expect an array from column function,",`got ${JSON.stringify(i)}`],this.options,this.__infoField(),{headers:i}));const n=S8e(i);return this.state.expectedRecordLength=n.length,this.options.columns=n,void this.__resetRecord()}catch(e){return e}},__resetRecord:function(){!0===this.options.raw&&this.state.rawBuffer.reset(),this.state.error=void 0,this.state.record=[],this.state.record_length=0},__onField:function(){const{cast:e,encoding:t,rtrim:i,max_record_size:n}=this.options,{enabled:o,wasQuoting:s}=this.state;if(!1===o)return this.__resetField();let r=this.state.field.toString(t);if(!0===i&&!1===s&&(r=r.trimRight()),!0===e){const[e,t]=this.__cast(r);if(void 0!==e)return e;r=t}this.state.record.push(r),0!==n&&"string"==typeof r&&(this.state.record_length+=r.length),this.__resetField()},__resetField:function(){this.state.field.reset(),this.state.wasQuoting=!1},__push:function(e,t){const{on_record:i}=this.options;if(void 0!==i){const t=this.__infoRecord();try{e=i.call(null,e,t)}catch(e){return e}if(null==e)return}t(e)},__cast:function(e){const{columns:t,relax_column_count:i}=this.options;if(!0===Array.isArray(t)&&i&&this.options.columns.length<=this.state.record.length)return[void 0,void 0];if(null!==this.state.castField)try{const t=this.__infoField();return[void 0,this.state.castField.call(null,e,t)]}catch(e){return[e]}if(this.__isFloat(e))return[void 0,parseFloat(e)];if(!1!==this.options.cast_date){const t=this.__infoField();return[void 0,this.options.cast_date.call(null,e,t)]}return[void 0,e]},__isCharTrimable:function(e,t){return((e,t)=>{const{timchars:i}=this.state;e:for(let n=0;n<i.length;n++){const o=i[n];for(let i=0;i<o.length;i++)if(o[i]!==e[t+i])continue e;return o.length}return 0})(e,t)},__isFloat:function(e){return e-parseFloat(e)+1>=0},__compareBytes:function(e,t,i,n){if(e[0]!==n)return 0;const o=e.length;for(let n=1;n<o;n++)if(e[n]!==t[i+n])return 0;return o},__isDelimiter:function(e,t,i){const{delimiter:n,ignore_last_delimiters:o}=this.options;if(!0===o&&this.state.record.length===this.options.columns.length-1)return 0;if(!1!==o&&"number"==typeof o&&this.state.record.length===o-1)return 0;e:for(let o=0;o<n.length;o++){const s=n[o];if(s[0]===i){for(let i=1;i<s.length;i++)if(s[i]!==e[t+i])continue e;return s.length}}return 0},__isRecordDelimiter:function(e,t,i){const{record_delimiter:n}=this.options,o=n.length;e:for(let s=0;s<o;s++){const o=n[s],r=o.length;if(o[0]===e){for(let e=1;e<r;e++)if(o[e]!==t[i+e])continue e;return o.length}}return 0},__isEscape:function(e,t,i){const{escape:n}=this.options;if(null===n)return!1;const o=n.length;if(n[0]===i){for(let i=0;i<o;i++)if(n[i]!==e[t+i])return!1;return!0}return!1},__isQuote:function(e,t){const{quote:i}=this.options;if(null===i)return!1;const n=i.length;for(let o=0;o<n;o++)if(i[o]!==e[t+o])return!1;return!0},__autoDiscoverRecordDelimiter:function(e,t){const{encoding:i}=this.options,n=[F7e.from("\r\n",i),F7e.from("\n",i),F7e.from("\r",i)];e:for(let i=0;i<n.length;i++){const o=n[i].length;for(let s=0;s<o;s++)if(n[i][s]!==e[t+s])continue e;return this.options.record_delimiter.push(n[i]),this.state.recordDelimiterMaxLength=n[i].length,n[i].length}return 0},__error:function(e){const{encoding:t,raw:i,skip_records_with_error:n}=this.options,o="string"==typeof e?new Error(e):e;return n?(this.state.recordHasError=!0,void(void 0!==this.options.on_skip&&this.options.on_skip(o,i?this.state.rawBuffer.toString(t):void 0))):o},__infoDataSet:function(){return{...this.info,columns:this.options.columns}},__infoRecord:function(){const{columns:e,raw:t,encoding:i}=this.options;return{...this.__infoDataSet(),error:this.state.error,header:!0===e,index:this.state.record.length,raw:t?this.state.rawBuffer.toString(i):void 0}},__infoField:function(){const{columns:e}=this.options,t=Array.isArray(e);return{...this.__infoRecord(),column:!0===t?e.length>this.state.record.length?e[this.state.record.length].name:null:this.state.record.length,quoting:this.state.wasQuoting}}}}(t),o=e=>{void 0===n.options.objname?i.push(e):i[e[0]]=e[1]},s=()=>{},r=n.parse(e,!1,o,s);if(void 0!==r)throw r;const a=n.parse(void 0,!0,o,s);if(void 0!==a)throw a;return i}(e,{columns:["tag","category","count","alias"]})){const e=isNaN(i.count)?i.count:(+i.count).toLocaleString(),n=t?[`(${t})`,e].join(" "):e,o={label:{label:i.tag,description:n},kind:eve.CompletionItemKind.Value,insertText:W8e(i.tag),count:i.count};N8e.push(o),A8e(o)&&T8e.filteredTags.push(o);for(const e of i.alias.split(",")){if(0===e.length)continue;const t={label:{label:e,detail:` -> ${i.tag}`,description:n},kind:eve.CompletionItemKind.Value,insertText:W8e(i.tag),count:i.count};N8e.push(t),A8e(t)&&T8e.filteredTags.push(t)}}},B8e=()=>Object.keys(T8e.loadedCSV),W8e=e=>e.replaceAll(/([\(\)\[\]])/g,"\\$1"),V8e={triggerCharacters:"<1234567890".split(""),provideCompletionItems:function(e,t,i){let n=((e,t)=>{const i=e.getWordUntilPosition(t),n=e.getWordAtPosition(t);return n?{startColumn:i.startColumn,endColumn:n.endColumn,word:n.word}:i})(e,t);const o=e.getValueInRange({startLineNumber:t.lineNumber,startColumn:n.startColumn-1,endLineNumber:t.lineNumber,endColumn:n.startColumn}),s=i.triggerCharacter||o;let r;r="<"===s?[]:T8e.filteredTags.map((e=>Object.assign({range:{startLineNumber:t.lineNumber,startColumn:n.startColumn,endLineNumber:t.lineNumber,endColumn:n.endColumn}},e,T8e.isRplaceUnderscore?{insertText:e.insertText.replaceAll("_"," ")}:{})));const a=[];for(const[e,i]of Object.entries(I8e))if("embedding"!==e||"<"!==s)for(const o of i){const i=W8e(o),r=`${e}:${i}:1.0`;a.push({label:{label:i,description:e},kind:eve.CompletionItemKind.Text,insertText:"embedding"===e?i:"<"===s?r:`<${r}>`,detail:e,range:{startLineNumber:t.lineNumber,startColumn:n.startColumn,endLineNumber:t.lineNumber,endColumn:n.endColumn}})}return{suggestions:r.concat(a)}}},H8e=function(e,t){const i=U8e(t.context),n=new Wt;fu._menuItems.set(i,n);for(let i=0,o=t.actions.length;i<o;++i){const o=t.actions[i];"number"!=typeof o.order&&(o.order=i),o.groupId||(o.groupId=t.group),K8e(e,o);const s=e.getSupportedActions().find((e=>e.label===o.label&&e.id.endsWith(o.id))).id,r=fu._menuItems.get(gu.EditorContext),a=j8e(r,s);a&&n.push(a)}fu._menuItems.get(gu.EditorContext).push({group:t.group,order:t.order,submenu:i,title:t.title})},z8e=e=>gu._instances.get(e),U8e=e=>z8e(e)||new gu(e),K8e=function(e,t){const i=e.addAction({id:t.id,label:t.label,run:t.run,contextMenuOrder:t.order,contextMenuGroupId:t.groupId}),n=e.getSupportedActions().find((e=>e.label===t.label&&e.id.endsWith(t.id))).id,o=fu._menuItems.get(gu.EditorContext),s=q8e(o,n);return s&&s.element&&s.element.command&&t.commandOptions&&Object.assign(s.element.command,t.commandOptions),i},j8e=(e,t)=>{const i=q8e(e,t);return i?(e._remove(i),i.element):null},q8e=(e,t)=>{let i=e._first;do{if(i.element?.command?.id===t)return i;i=i.next}while(void 0!==i);return null};var $8e=Object.defineProperty,G8e=(e,t,i)=>((e,t,i)=>t in e?$8e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i)(e,"symbol"!=typeof t?t+"":t,i),Z8e=class{constructor(e){G8e(this,"_distinctEvent"),G8e(this,"_boundedEvents",[]),this._distinctEvent=e?.distinctEvent??!1}get boundedEvents(){return this._boundedEvents}dispose(){this.unbindAll(),this._boundedEvents=[]}bind(e,t,i,n,o=""){let s=Array.isArray(t)?t:[t];if("function"==typeof e?.forEach)e.forEach((e=>{for(let t of s)(!this._distinctEvent||this._distinctEvent&&!this.hasBinding(e,t))&&(e.addEventListener(t,i,n),this._boundedEvents.push({element:e,eventName:t,listener:i,groupName:o}))}));else for(let t of s)(!this._distinctEvent||this._distinctEvent&&!this.hasBinding(e,t))&&(e.addEventListener(t,i,n),this._boundedEvents.push({element:e,eventName:t,listener:i,groupName:o}))}hasBinding(e,t){return this._boundedEvents.some((i=>i.element===e&&(!t||i.eventName===t)))}unbind(e,t,i){if(e){let n=Array.isArray(e)?e:[e],o=Array.isArray(t)?t||"":[t||""];for(let e of n){i||(i=this._boundedEvents.find((i=>{if(i.element===e&&(!t||i.eventName===t))return i.listener})));for(let t of o)e?.removeEventListener?.(t,i)}}}unbindAll(e){if(e){let t=Array.isArray(e)?e:[e];for(let e=this._boundedEvents.length-1;e>=0;--e){let i=this._boundedEvents[e];if(t.some((e=>e===i.groupName))){let{element:t,eventName:n,listener:o}=i;this.unbind(t,n,o),this._boundedEvents.splice(e,1)}}}else for(;this._boundedEvents.length>0;){let e=this._boundedEvents.pop(),{element:t,eventName:i,listener:n}=e;this.unbind(t,i,n)}}},Y8e=typeof window<"u"&&void 0!==window.multipleSelect?window.multipleSelect:{locales:{}};Y8e.locales["en-US"]={formatSelectAll:()=>"[Select all]",formatAllSelected:()=>"All selected",formatCountSelected:(e,t)=>`${e} of ${t} selected`,formatNoMatchesFound:()=>"No matches found",formatOkButton:()=>"OK"};var Q8e=Y8e.locales,X8e={name:"",placeholder:"",classes:"",classPrefix:"",data:void 0,locale:void 0,selectAll:!0,single:void 0,singleRadio:!1,multiple:!1,hideOptgroupCheckboxes:!1,multipleWidth:80,width:void 0,dropWidth:void 0,maxHeight:250,maxHeightUnit:"px",position:"bottom",displayValues:!1,displayTitle:!1,displayDelimiter:", ",minimumCountSelected:3,ellipsis:!1,isOpen:!1,keepOpen:!1,openOnHover:!1,container:null,filter:!1,filterGroup:!1,filterPlaceholder:"",filterAcceptOnEnter:!1,filterByDataLength:void 0,customFilter(e){let{text:t,label:i,search:n}=e;return(i||t||"").includes(n)},showClear:!1,autoAdjustDropHeight:!1,autoAdjustDropPosition:!1,autoAdjustDropWidthByTextSize:!1,adjustedHeightPadding:10,useSelectOptionLabel:!1,useSelectOptionLabelToHtml:!1,navigationHighlight:!0,infiniteScroll:!1,virtualScroll:!0,cssStyler:()=>null,textTemplate:e=>e.innerHTML.trim(),labelTemplate:e=>e.label,onOpen:()=>!1,onClose:()=>!1,onCheckAll:()=>!1,onUncheckAll:()=>!1,onFocus:()=>!1,onBlur:()=>!1,onOptgroupClick:()=>!1,onBeforeClick:()=>!0,onClick:()=>!1,onFilter:()=>!1,onFilterClear:()=>!1,onClear:()=>!1,onAfterCreate:()=>!1,onDestroy:()=>!1,onAfterDestroy:()=>!1,onDestroyed:()=>!1};Object.assign(X8e,Q8e["en-US"]);var J8e={BLOCK_ROWS:50,CLUSTER_BLOCKS:4,DEFAULTS:X8e,METHODS:["init","getOptions","refreshOptions","getSelects","setSelects","enable","disable","open","close","check","uncheck","checkAll","uncheckAll","checkInvert","focus","blur","refresh","destroy"]};function eet(e){let t=Object.prototype.toString.call(e).slice(8,-1).toLowerCase();return"object"===t?(()=>{let t={};for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=eet(e[i]));return t})():"array"===t?e.map((e=>eet(e))):e}function tet(e){return null!=e&&""!==e}function iet(e,t,i){if(Array.isArray(e))for(let n of e){if(n[t]===i||n[t]===""+ +n[t]&&+n[t]===i)return n;if("optgroup"===n.type)for(let e of n.children)if(e&&(e[t]===i||e[t]===""+ +e[t]&&+e[t]===i))return e}}function net(e){return Object.keys(e).forEach((t=>void 0===e[t]?delete e[t]:"")),e}function oet(e,t){if("string"!=typeof e)return e;if("function"==typeof t)return t(e);if("function"==typeof e.normalize)return e.normalize("NFD").replace(/[\u0300-\u036F]/g,"");throw new Error("[Multiple-Select-Vanilla] `normalize()` function is not defined, you can optionally provide a custom parser via the `diacriticParser` option.")}function set(e){let t=0,i=0,n=0,o=0,s=window.innerHeight??0,r=window.innerWidth??0,a={left:window.pageXOffset||document.documentElement.scrollLeft||0,top:window.pageYOffset||document.documentElement.scrollTop||0},l=a.top,d=a.left,h=uet(e);if(h){let e=h.top??0,a=h.left??0;i=e-l,t=s-(e-l),n=a-d,o=r-(a-d)}return{top:i,bottom:t,left:n,right:o}}function ret(e=""){return e.split(" ").filter((e=>e))}function aet(e,t,i){let n=document.createElement(e);return t&&Object.keys(t).forEach((e=>{let i=t[e];"object"==typeof i?Object.assign(n[e],i):n[e]=t[e]})),i?.appendChild&&i.appendChild(n),n}function det(e,t,i){let n=e.props?.innerHTML?function(e,t){let{[t]:i,...n}=e;return n}(e.props,"innerHTML"):e.props,o=aet(e.tagName,function(e,t){return"object"==typeof e?Object.fromEntries(t?Object.entries(e).filter((([e,i])=>!tet(i)&&!t.includes(e)||tet(i))):Object.entries(e).filter((([e,t])=>tet(t)))):e}(n,["className","title","style"]),t),s=i;if(s||(s=o),e.props.innerHTML&&(o.innerHTML=e.props.innerHTML),e.attrs)for(let t of Object.keys(e.attrs))o.setAttribute(t,e.attrs[t]);if(e.children)for(let t of e.children)det(t,o,s);return t?.appendChild(o),o}function het(e){return e.hasOwnProperty("tagName")?det(e):document.createElement("li")}function cet(e){for(;e?.firstChild;)e.lastChild&&e.removeChild(e.lastChild);return e}function uet(e){if(!e)return;let t=e?.getBoundingClientRect?.(),i=0,n=0,o=0,s=0;return void 0!==t?.top&&void 0!==t.left&&(i=t.top+window.pageYOffset,n=t.left+window.pageXOffset,s=t.right,o=t.bottom),{top:i,left:n,bottom:o,right:s}}function get(e,t,i){if(!e)return 0;let n=Number.parseFloat(e.style[i]);if(!n||Number.isNaN(n)){switch(t){case"outer":n=e["width"===i?"offsetWidth":"offsetHeight"];break;case"scroll":n=e["width"===i?"scrollWidth":"scrollHeight"];break;default:n=e["width"===i?"clientWidth":"clientHeight"]}n=e.getBoundingClientRect()[i]}if(!n||Number.isNaN(n)){let t=e.style.display,o=e.style.position;e.style.display="block",e.style.position="absolute";let s=window.getComputedStyle(e)[i];n=Number.parseFloat(s),Number.isNaN(n)&&(n=0),e.style.display=t,e.style.position=o}return n||0}function pet(e,t){let i=null,n=e?.parentElement;for(;n;){let[e,o,s,r]=t.match(/^([a-z]*)([#.]{1})([a-z\-]+)$/i)||[];if(s&&r)for(let e of r.replace(s,"").split(" "))n.classList.contains(e)&&(o?n?.tagName.toLowerCase()===o&&(i=n):i=n);n=n.parentElement}return i}function met(e,t){e?.style&&(e.style.display="none"===e.style.display&&!1!==t||!0===t?"block":"none")}var fet=class{constructor(e){G8e(this,"clusterRows"),G8e(this,"cache"),G8e(this,"scrollEl"),G8e(this,"blockHeight"),G8e(this,"clusterHeight"),G8e(this,"contentEl"),G8e(this,"parentEl"),G8e(this,"itemHeight"),G8e(this,"lastCluster"),G8e(this,"scrollTop"),G8e(this,"dataStart"),G8e(this,"dataEnd"),G8e(this,"rows"),G8e(this,"destroy"),G8e(this,"callback"),G8e(this,"sanitizer"),this.rows=e.rows,this.scrollEl=e.scrollEl,this.contentEl=e.contentEl,this.parentEl=e.contentEl?.parentElement,this.callback=e.callback,this.cache={},this.scrollTop=this.scrollEl.scrollTop,this.initDOM(this.rows),this.scrollEl.scrollTop=this.scrollTop,this.lastCluster=0;let t=()=>{this.lastCluster!==(this.lastCluster=this.getNum())&&(this.initDOM(this.rows),this.callback())};this.scrollEl.addEventListener("scroll",t,!1),this.destroy=()=>{this.scrollEl.removeEventListener("scroll",t,!1),cet(this.contentEl)}}reset(e){this.lastCluster=0,this.cache={},cet(this.contentEl),this.initDOM(e)}initDOM(e){if(typeof this.clusterHeight>"u"){this.cache.scrollTop=this.scrollEl.scrollTop;let t=het(e[0]);this.contentEl.appendChild(t),this.contentEl.appendChild(t),this.contentEl.appendChild(t),this.cache.data=[e[0]],this.getRowsHeight()}let t=this.initData(e,this.getNum()),i=this.checkChanges("data",t.rows),n=this.checkChanges("top",t.topOffset),o=this.checkChanges("bottom",t.bottomOffset);cet(this.contentEl),i&&n?(t.topOffset&&this.contentEl.appendChild(this.getExtra("top",t.topOffset)),t.rows.forEach((e=>this.contentEl.appendChild(het(e)))),t.bottomOffset&&this.contentEl.appendChild(this.getExtra("bottom",t.bottomOffset))):o&&this.contentEl.lastChild&&(this.contentEl.lastChild.style.height=`${t.bottomOffset}px`)}getRowsHeight(){if(typeof this.itemHeight>"u"){let e=this.parentEl?.style.display||"";this.parentEl&&(""===e||"none"===e)&&(this.parentEl.style.display="block");let t=this.contentEl.children,i=t[Math.floor(t.length/2)];this.itemHeight=i.offsetHeight,this.parentEl&&(this.parentEl.style.display=e)}this.blockHeight=this.itemHeight*J8e.BLOCK_ROWS,this.clusterRows=J8e.BLOCK_ROWS*J8e.CLUSTER_BLOCKS,this.clusterHeight=this.blockHeight*J8e.CLUSTER_BLOCKS}getNum(){this.scrollTop=this.scrollEl.scrollTop;let e=(this.clusterHeight||0)-(this.blockHeight||0);return e&&Math.floor(this.scrollTop/e)||0}initData(e,t){if(e.length<J8e.BLOCK_ROWS)return{topOffset:0,bottomOffset:0,rowsAbove:0,rows:e};let i=Math.max((this.clusterRows-J8e.BLOCK_ROWS)*t,0),n=i+this.clusterRows,o=Math.max(i*this.itemHeight,0),s=Math.max((e.length-n)*this.itemHeight,0),r=[],a=i;o<1&&a++;for(let t=i;t<n;t++)e[t]&&r.push(e[t]);return this.dataStart=i,this.dataEnd=n,{topOffset:o,bottomOffset:s,rowsAbove:a,rows:r}}checkChanges(e,t){let i=t!==this.cache[e];return this.cache[e]=t,i}getExtra(e,t){let i=document.createElement("li");return i.className=`virtual-scroll-${e}`,t&&(i.style.height=`${t}px`),i}},_et=".ms-select-all, ul li[data-key]",vet=class{constructor(e,t){this.elm=e,G8e(this,"_bindEventService"),G8e(this,"isAllSelected",!1),G8e(this,"isPartiallyAllSelected",!1),G8e(this,"fromHtml",!1),G8e(this,"choiceElm"),G8e(this,"selectClearElm"),G8e(this,"closeElm"),G8e(this,"clearSearchIconElm"),G8e(this,"filterText",""),G8e(this,"updateData",[]),G8e(this,"data",[]),G8e(this,"dataTotal"),G8e(this,"dropElm"),G8e(this,"okButtonElm"),G8e(this,"filterParentElm"),G8e(this,"lastFocusedItemKey",""),G8e(this,"lastMouseOverPosition",""),G8e(this,"ulElm"),G8e(this,"parentElm"),G8e(this,"labelElm"),G8e(this,"selectAllParentElm"),G8e(this,"selectAllElm"),G8e(this,"searchInputElm"),G8e(this,"selectGroupElms"),G8e(this,"selectItemElms"),G8e(this,"noResultsElm"),G8e(this,"options"),G8e(this,"selectAllName",""),G8e(this,"selectGroupName",""),G8e(this,"selectItemName",""),G8e(this,"scrolledByMouse",!1),G8e(this,"openDelayTimer"),G8e(this,"updateDataStart"),G8e(this,"updateDataEnd"),G8e(this,"virtualScroll"),G8e(this,"_currentHighlightIndex",-1),G8e(this,"_currentSelectedElm"),G8e(this,"isMoveUpRecalcRequired",!1),G8e(this,"locales",{}),this.options=Object.assign({},J8e.DEFAULTS,this.elm.dataset,t),this._bindEventService=new Z8e({distinctEvent:!0})}get isRenderAsHtml(){return this.options.renderOptionLabelAsHtml||this.options.useSelectOptionLabelToHtml}init(){this.initLocale(),this.initContainer(),this.initData(),this.initSelected(!0),this.initFilter(),this.initDrop(),this.initView(),this.options.onAfterCreate()}destroy(e=!0){this.elm&&this.parentElm&&(this.options.onDestroy({hardDestroy:e}),e&&this.options.onHardDestroy(),this.elm.parentElement&&this.parentElm.parentElement&&this.elm.parentElement.insertBefore(this.elm,this.parentElm.parentElement.firstChild),this.elm.classList.remove("ms-offscreen"),this._bindEventService.unbindAll(),this.virtualScroll?.destroy(),this.dropElm?.remove(),this.dropElm=void 0,this.parentElm.parentNode?.removeChild(this.parentElm),this.fromHtml&&(delete this.options.data,this.fromHtml=!1),this.options.onAfterDestroy({hardDestroy:e}),e&&(this.options.onAfterHardDestroy?.(),Object.keys(this.options).forEach((e=>delete this[e]))))}initLocale(){if(this.options.locale){if("object"==typeof this.options.locale)return void Object.assign(this.options,this.options.locale);let e=window.multipleSelect.locales,t=this.options.locale.split(/-|_/);if(t[0]=t[0].toLowerCase(),t[1]&&(t[1]=t[1].toUpperCase()),e[this.options.locale])Object.assign(this.options,e[this.options.locale]);else if(e[t.join("-")])Object.assign(this.options,e[t.join("-")]);else{if(!e[t[0]])throw new Error(`[multiple-select-vanilla] invalid locales "${this.options.locale}", make sure to import it before using it`);Object.assign(this.options,e[t[0]])}}}initContainer(){let e=this.elm.getAttribute("name")||this.options.name||"";this.options.classes&&this.elm.classList.add(this.options.classes),this.options.classPrefix&&(this.elm.classList.add(this.options.classPrefix),this.options.size&&this.elm.classList.add(`${this.options.classPrefix}-${this.options.size}`)),this.elm.style.display="none",this.labelElm=this.elm.closest("label"),!this.labelElm&&this.elm.id&&(this.labelElm=document.createElement("label"),this.labelElm.htmlFor=this.elm.id),this.labelElm?.querySelector("input")&&(this.labelElm=null),typeof this.options.single>"u"&&(this.options.single=!this.elm.multiple),this.parentElm=aet("div",{className:ret(`ms-parent ${this.elm.className||""} ${this.options.classes}`).join(" "),dataset:{test:"sel"}}),this.options.darkMode&&this.parentElm.classList.add("ms-dark-mode");let t=this.elm.getAttribute("title")||"";t&&(this.parentElm.title=t),this.options.placeholder=this.options.placeholder||this.elm.getAttribute("placeholder")||"",this.choiceElm=aet("button",{className:"ms-choice",type:"button"},this.parentElm),this.options.labelId&&(this.choiceElm.id=this.options.labelId,this.choiceElm.setAttribute("aria-labelledby",this.options.labelId)),this.choiceElm.appendChild(aet("span",{className:"ms-placeholder",textContent:this.options.placeholder})),this.options.showClear&&(this.selectClearElm=aet("div",{className:"ms-icon ms-icon-close"}),this.selectClearElm.style.display="none",this.choiceElm.appendChild(this.selectClearElm)),this.choiceElm.appendChild(aet("div",{className:"ms-icon ms-icon-caret"})),this.dropElm=aet("div",{className:`ms-drop ${this.options.position}`,ariaExpanded:"false"},this.parentElm),this.options.darkMode&&this.dropElm.classList.add("ms-dark-mode"),e&&(this.dropElm.dataset.name=e);let i=this.elm.getAttribute("data-test")||this.options.dataTest;i&&(this.parentElm.dataset.test=i,this.dropElm.dataset.test=i),this.closeElm=this.choiceElm.querySelector(".ms-icon-close"),this.options.dropWidth&&(this.dropElm.style.width="string"==typeof this.options.dropWidth?this.options.dropWidth:`${this.options.dropWidth}px`),function(e,t){e.parentNode?.insertBefore(t,e.nextSibling)}(this.elm,this.parentElm),this.elm.disabled&&(this.choiceElm.classList.add("disabled"),this.choiceElm.disabled=!0),this.selectAllName=`selectAll${e}`,this.selectGroupName=`selectGroup${e}`,this.selectItemName=`selectItem${e}`,this.options.keepOpen||(this._bindEventService.unbindAll("body-click"),this._bindEventService.bind(document.body,"click",(e=>{this.getEventTarget(e)===this.choiceElm||pet(this.getEventTarget(e),".ms-choice")===this.choiceElm||(this.getEventTarget(e)===this.dropElm||pet(this.getEventTarget(e),".ms-drop")!==this.dropElm&&this.getEventTarget(e)!==this.elm)&&this.options.isOpen&&this.close("body.click")}),void 0,"body-click"))}initData(){let e=[];if(this.options.data){if(Array.isArray(this.options.data))this.data=this.options.data.map((e=>"string"==typeof e||"number"==typeof e?{text:e,value:e}:e));else if("object"==typeof this.options.data){for(let[t,i]of Object.entries(this.options.data))e.push({value:t,text:`${i}`});this.data=e}}else this.elm.childNodes.forEach((t=>{let i=this.initRow(t);i&&e.push(i)})),this.options.data=e,this.data=e,this.fromHtml=!0;this.dataTotal=function(e){let t=0;return e.forEach(((e,i)=>{"optgroup"===e.type?(e._key=`group_${i}`,e.visible=typeof e.visible>"u"||e.visible,e.children.forEach(((e,n)=>{e&&(e.visible=typeof e?.visible>"u"||e.visible,e.divider||(e._key=`option_${i}_${n}`,t+=1))}))):(e.visible=typeof e.visible>"u"||e.visible,e.divider||(e._key=`option_${i}`,t+=1))})),t}(this.data||[])}initRow(e,t){let i={};return"option"===e.tagName?.toLowerCase()?(i.type="option",i.text=this.options.textTemplate(e),i.value=e.value,i.visible=!0,i.selected=!!e.selected,i.disabled=t||e.disabled,i.classes=e.getAttribute("class")||"",i.title=e.getAttribute("title")||"",e.dataset.value&&(i._value=e.dataset.value),Object.keys(e.dataset).length&&(i._data=e.dataset,i._data.divider&&(i.divider=i._data.divider)),i):"optgroup"===e.tagName?.toLowerCase()?(i.type="optgroup",i.label=this.options.labelTemplate(e),i.visible=!0,i.selected=!!e.selected,i.disabled=e.disabled,i.children=[],Object.keys(e.dataset).length&&(i._data=e.dataset),e.childNodes.forEach((e=>{i.children.push(this.initRow(e,i.disabled))})),i):null}initDrop(){this.initList(),this.update(!0),this.options.isOpen&&this.open(10),this.options.openOnHover&&this.parentElm&&(this._bindEventService.bind(this.parentElm,"mouseover",(()=>this.open(null))),this._bindEventService.bind(this.parentElm,"mouseout",(()=>this.close("hover.mouseout"))))}initFilter(){if(this.filterText="",this.options.filter||!this.options.filterByDataLength)return;let e=0;for(let t of this.data||[])"optgroup"===t.type?e+=t.children.length:e+=1;this.options.filter=e>this.options.filterByDataLength}initList(){if(this.options.filter&&(this.filterParentElm=aet("div",{className:"ms-search"},this.dropElm),this.filterParentElm.appendChild(aet("input",{autocomplete:"off",autocapitalize:"off",spellcheck:!1,type:"text",placeholder:this.options.filterPlaceholder||"🔎︎"})),this.options.showSearchClear&&this.filterParentElm.appendChild(aet("span",{className:"ms-icon ms-icon-close"}))),this.options.selectAll&&!this.options.single){let e=this.elm.getAttribute("name")||this.options.name||"";this.selectAllParentElm=aet("div",{className:"ms-select-all",dataset:{key:"select_all"}});let t=document.createElement("label"),i="ms-icon "+(this.isAllSelected?"ms-icon-check":this.isPartiallyAllSelected?"ms-icon-minus":"ms-icon-uncheck"),n=aet("div",{className:"icon-checkbox-container"},t);aet("input",{type:"checkbox",ariaChecked:String(this.isAllSelected),checked:this.isAllSelected,dataset:{name:`selectAll${e}`}},n),aet("div",{className:i},n),t.appendChild(aet("span",{textContent:this.formatSelectAll()})),this.selectAllParentElm.appendChild(t),this.dropElm?.appendChild(this.selectAllParentElm)}this.ulElm=document.createElement("ul"),this.ulElm.role="combobox",this.ulElm.ariaExpanded="false",this.ulElm.ariaMultiSelectable=String(!this.options.single),this.dropElm?.appendChild(this.ulElm),this.options.showOkButton&&!this.options.single&&(this.okButtonElm=aet("button",{className:"ms-ok-button",type:"button",textContent:this.formatOkButton()},this.dropElm)),this.initListItems()}initListItems(){let e=0,t=this.getListRows();if(this.options.selectAll&&!this.options.single&&(e=-1),t.length>J8e.BLOCK_ROWS*J8e.CLUSTER_BLOCKS){let i=this.dropElm&&"none"!==this.dropElm?.style.display;!i&&this.dropElm&&(this.dropElm.style.left="-10000",this.dropElm.style.display="block",this.dropElm.ariaExpanded="true");let n=()=>{if(this.virtualScroll){this._currentHighlightIndex=0,this.updateDataStart=this.virtualScroll.dataStart+e,this.updateDataEnd=this.virtualScroll.dataEnd+e,this.updateDataStart<0&&(this.updateDataStart=0,this._currentHighlightIndex=0);let t=this.getDataLength();this.updateDataEnd>t&&(this.updateDataEnd=t),this.ulElm&&(this.isMoveUpRecalcRequired?this.recalculateArrowMove("up"):this.virtualScroll.dataStart>this.updateDataStart&&this.recalculateArrowMove("down"))}};this.ulElm&&(this.virtualScroll?this.virtualScroll.reset(t):this.virtualScroll=new fet({rows:t,scrollEl:this.ulElm,contentEl:this.ulElm,sanitizer:this.options.sanitizer,callback:()=>{n(),this.events()}})),n(),!i&&this.dropElm&&(this.dropElm.style.left="0",this.dropElm.style.display="none",this.dropElm.ariaExpanded="false")}else this.ulElm&&(cet(this.ulElm),t.forEach((e=>this.ulElm.appendChild(het(e))))),this.updateDataStart=0,this.updateDataEnd=this.updateData.length;return this.events(),t}getEventTarget(e){return e.composedPath?e.composedPath()[0]:e.target}getListRows(){let e=[];return this.updateData=[],this.data?.forEach((t=>e.push(...this.initListItem(t)))),this.options.infiniteScroll&&e.push({tagName:"li",props:{className:"ms-infinite-option",role:"option"}}),e.push({tagName:"li",props:{className:"ms-no-results",textContent:this.formatNoMatchesFound()}}),e}initListItem(e,t=0){let i=e?.title||"",n=this.options.multiple?"multiple":"",o=this.options.single?"radio":"checkbox",s=!!e?.selected,r=this.options.single&&!this.options.singleRadio,a="";if(!e?.visible)return[];if(this.updateData.push(e),r&&(a="hide-radio "),e.selected&&(a+="selected "),"optgroup"===e.type){let t,i=[];if(this.options.hideOptgroupCheckboxes||this.options.single)t={tagName:"span",props:{dataset:{name:this.selectGroupName,key:e._key}}};else{let i={tagName:"input",props:{type:"checkbox",dataset:{name:this.selectGroupName,key:e._key},checked:s,disabled:e.disabled}};t=r?i:{tagName:"div",props:{className:"icon-checkbox-container"+("radio"===o?" radio":"")},children:[i,{tagName:"div",props:{className:"ms-icon "+(s?"radio"===o?"ms-icon-radio":"ms-icon-check":"ms-icon-uncheck")}}]}}!a.includes("hide-radio")&&(this.options.hideOptgroupCheckboxes||this.options.single)&&(a+="hide-radio ");let n={tagName:"span",props:{}};this.applyAsTextOrHtmlWhenEnabled(n.props,e.label);let l={tagName:"li",props:{className:ret(`group${this.options.single||e.disabled?" disabled":""} ${a}`).join(" "),role:"option",ariaSelected:String(s),dataset:{key:e._key}},children:[{tagName:"label",props:{className:ret("optgroup"+(this.options.single||e.disabled?" disabled":"")).join(" ")},children:[t,n]}]},d=this.options.cssStyler(e);return d&&(l.props.style=d),i.push(l),e.children.forEach((e=>i.push(...this.initListItem(e,1)))),i}if(a+=e.classes||"",t&&this.options.single&&(a+=`option-level-${t} `),e.divider)return[{tagName:"li",props:{className:"option-divider"}}];let l=n||a?(n+a).trim():"";e.disabled&&(l+=" disabled");let d=e.disabled?"disabled":"",h={tagName:"span",props:{}};this.applyAsTextOrHtmlWhenEnabled(h.props,e.text);let c={tagName:"input",props:{type:o,value:encodeURI(e.value),dataset:{key:e._key,name:this.selectItemName},checked:s,disabled:!!e.disabled}};e.selected&&(c.attrs={checked:"checked"});let u={tagName:"div",props:{className:"icon-checkbox-container"+("radio"===o?" radio":"")},children:[c,{tagName:"div",props:{className:"ms-icon "+(c.props.checked?"radio"===o?"ms-icon-radio":"ms-icon-check":"ms-icon-uncheck")}}]},g={tagName:"li",props:{role:"option",title:i,ariaSelected:String(s),dataset:{key:e._key}},children:[{tagName:"label",props:{className:d},children:[r?c:u,h]}]};l&&(g.props.className=l);let p=this.options.cssStyler(e);return p&&(g.props.style=p),[g]}initSelected(e=!1){let t=0;for(let e of this.data||[])if("optgroup"===e.type){let i=e.children.filter((e=>e?.selected&&!e.disabled&&e.visible)).length;e.children.length&&(e.selected=!this.options.single&&i&&i===e.children.filter((e=>e&&!e.disabled&&e.visible&&!e.divider)).length),t+=i}else t+=e.selected&&!e.disabled&&e.visible?1:0;this.isAllSelected=this.data?.filter((e=>e.selected&&!e.disabled&&e.visible)).length===this.data?.filter((e=>!e.disabled&&e.visible&&!e.divider)).length,this.isPartiallyAllSelected=!this.isAllSelected&&t>0,e||(this.isAllSelected?this.options.onCheckAll():0===t&&this.options.onUncheckAll())}initView(){let e;window.getComputedStyle?(e=window.getComputedStyle(this.elm).width,"auto"===e&&(e=get(this.dropElm,"outer","width")+20)):e=get(this.elm,"outer","width")+20,this.parentElm.style.width=`${this.options.width||e}px`,this.elm.classList.add("ms-offscreen")}events(){this._bindEventService.unbindAll(["ok-button","search-input","select-all-checkbox","input-checkbox-list","group-checkbox-list","hover-highlight","arrow-highlight","option-list-scroll"]),this.clearSearchIconElm=this.filterParentElm?.querySelector(".ms-icon-close"),this.searchInputElm=this.dropElm?.querySelector(".ms-search input"),this.selectAllElm=this.dropElm?.querySelector(`input[data-name="${this.selectAllName}"]`),this.selectGroupElms=this.dropElm?.querySelectorAll(`input[data-name="${this.selectGroupName}"],span[data-name="${this.selectGroupName}"]`),this.selectItemElms=this.dropElm?.querySelectorAll(`input[data-name="${this.selectItemName}"]:enabled`),this.noResultsElm=this.dropElm?.querySelector(".ms-no-results");let e=e=>{e.preventDefault(),!this.getEventTarget(e).classList.contains("ms-icon-close")&&(this.options.isOpen?this.close("toggle.close"):this.open())};this.labelElm&&this._bindEventService.bind(this.labelElm,"click",(t=>{"label"===this.getEventTarget(t).nodeName.toLowerCase()&&(e(t),(!this.options.filter||!this.options.isOpen)&&this.focus(),t.stopPropagation())})),this._bindEventService.bind(this.choiceElm,"click",e),this.options.onFocus&&this._bindEventService.bind(this.choiceElm,"focus",this.options.onFocus),this.options.onBlur&&this._bindEventService.bind(this.choiceElm,"blur",this.options.onBlur),this._bindEventService.bind(this.parentElm,"keydown",(e=>{"Escape"===e.code&&this.handleEscapeKey()})),this.closeElm&&this._bindEventService.bind(this.closeElm,"click",(e=>{e.preventDefault(),this._checkAll(!1,!0),this.initSelected(!1),this.updateSelected(),this.update(),this.options.onClear()})),this.clearSearchIconElm&&this._bindEventService.bind(this.clearSearchIconElm,"click",(e=>{e.preventDefault(),this.searchInputElm&&(this.searchInputElm.value="",this.searchInputElm.focus()),this._currentHighlightIndex=-1,this.moveHighlightDown(),this.filter(),this.options.onFilterClear()})),this.searchInputElm&&(this._bindEventService.bind(this.searchInputElm,"keydown",(e=>{"Tab"===e.code&&e.shiftKey&&this.close("key.shift+tab")}),void 0,"search-input"),this._bindEventService.bind(this.searchInputElm,"keyup",(e=>{if(this.options.filterAcceptOnEnter&&["Enter","Space"].includes(e.code)&&this.searchInputElm?.value){if(this.options.single){let e=[];this.selectItemElms?.forEach((t=>{"none"!==t.closest("li")?.style.display&&e.push(t)})),e.length&&e[0].hasAttribute("data-name")&&this.setSelects([e[0].value])}else this.selectAllElm?.click();return this.close(`key.${e.code.toLowerCase()}`),void this.focus()}this.filter()}),void 0,"search-input")),this.selectAllElm&&this._bindEventService.bind(this.selectAllElm,"click",(e=>this._checkAll(e.currentTarget?.checked)),void 0,"select-all-checkbox"),this.okButtonElm&&this._bindEventService.bind(this.okButtonElm,"click",(t=>{e(t),t.stopPropagation()}),void 0,"ok-button"),this.selectGroupElms&&this._bindEventService.bind(this.selectGroupElms,"click",(e=>{let t=e.currentTarget,i=t.checked,n=iet(this.data,"_key",t.dataset.key);this._checkGroup(n,i),this.options.onOptgroupClick(net({label:n.label,selected:n.selected,data:n._data,children:n.children.map((e=>{if(e)return net({text:e.text,value:e.value,selected:e.selected,disabled:e.disabled,data:e._data})}))}))}),void 0,"group-checkbox-list"),this.selectItemElms&&this._bindEventService.bind(this.selectItemElms,"click",(e=>{let t=e.currentTarget,i=t.checked,n=iet(this.data,"_key",t.dataset.key),o=()=>{this.options.single&&this.options.isOpen&&!this.options.keepOpen&&this.close("selection")};!1!==this.options.onBeforeClick(n)?(this._check(n,i),this.options.onClick(net({text:n.text,value:n.value,selected:n.selected,data:n._data})),o()):o()}),void 0,"input-checkbox-list"),this.lastFocusedItemKey&&this.dropElm&&this.dropElm.querySelector(`li[data-key=${this.lastFocusedItemKey}]`)?.focus(),this.options.navigationHighlight&&this.dropElm&&(this._bindEventService.bind(this.dropElm,"mouseover",(e=>{let t=this.getEventTarget(e).closest(".ms-select-all")||this.getEventTarget(e).closest("li");if(this.dropElm?.contains(t)&&this.lastMouseOverPosition!==`${e.clientX}:${e.clientY}`){let e=this.dropElm?.querySelectorAll(_et)||[],i=Array.from(e).findIndex((e=>e.dataset.key===t.dataset.key));this._currentHighlightIndex!==i&&!t.classList.contains("disabled")&&(this._currentSelectedElm=t,this._currentHighlightIndex=i,this.changeCurrentOptionHighlight(t))}this.lastMouseOverPosition=`${e.clientX}:${e.clientY}`}),void 0,"hover-highlight"),this._bindEventService.bind(this.dropElm,"keydown",(e=>{switch(e.key){case"ArrowUp":e.preventDefault(),this.moveHighlightUp();break;case"ArrowDown":e.preventDefault(),this.moveHighlightDown();break;case"Escape":this.handleEscapeKey();break;case"Enter":case" ":if(document.activeElement!==this.okButtonElm){let t=this.getEventTarget(e).closest(".ms-select-all")||this.getEventTarget(e).closest("li");if(" "===e.key&&this.options.filter||this.options.filterAcceptOnEnter&&!t)return;e.preventDefault(),this._currentSelectedElm?.querySelector("input")?.click(),this.options.single&&(this.choiceElm.focus(),this.lastFocusedItemKey=this.choiceElm?.dataset.key||"")}break;case"Tab":e.preventDefault(),e.shiftKey?document.activeElement===this.okButtonElm?(this.focusSelectAllOrList(),this.highlightCurrentOption()):(this.close("key.shift+tab"),this.choiceElm.focus()):(this.changeCurrentOptionHighlight(),this.okButtonElm?.focus())}}),void 0,"arrow-highlight")),this.ulElm&&this.options.infiniteScroll&&this._bindEventService.bind(this.ulElm,"scroll",this.infiniteScrollHandler.bind(this),void 0,"option-list-scroll")}handleEscapeKey(){this.options.keepOpen||(this.close("key.escape"),this.choiceElm.focus())}infiniteScrollHandler(e,t,i){let n=!1;e&&this.getEventTarget(e)&&this.ulElm&&this.scrolledByMouse?this.getEventTarget(e).scrollTop+this.getEventTarget(e).clientHeight===this.ulElm.scrollHeight&&(n=!0):void 0!==t&&t+1===i&&(n=!0),n&&this.ulElm&&(this.virtualScroll?this.initListItems():this.ulElm.scrollTop=0,this._currentHighlightIndex=0,this.highlightCurrentOption())}open(e=0){return new Promise((t=>{null!==e&&e>=0?(window.clearTimeout(this.openDelayTimer),this.openDelayTimer=window.setTimeout((()=>{this.openDrop(),t()}),e)):(this.openDrop(),t())}))}openDrop(){if(!this.dropElm||this.choiceElm?.classList.contains("disabled"))return;if(this.options.isOpen=!0,this.parentElm.classList.add("ms-parent-open"),this.choiceElm?.querySelector("div.ms-icon-caret")?.classList.add("open"),this.dropElm.style.display="block",this.dropElm.ariaExpanded="true",this.selectAllElm?.parentElement&&(this.selectAllElm.parentElement.style.display="inline-flex"),this.noResultsElm&&(this.noResultsElm.style.display="none"),this.getDataLength()||(this.selectAllElm?.parentElement&&(this.selectAllElm.parentElement.style.display="none"),this.noResultsElm&&(this.noResultsElm.style.display="block")),this.options.container){let e,t=uet(this.dropElm);this.options.container instanceof Node?e=this.options.container:"string"==typeof this.options.container&&(e="body"===this.options.container?document.body:document.querySelector(this.options.container)),e.appendChild(this.dropElm),this.dropElm.style.top=`${t?.top??0}px`,this.dropElm.style.left=`${t?.left??0}px`,this.dropElm.style.minWidth="auto",this.dropElm.style.width=`${get(this.parentElm,"outer","width")}px`}let e=this.options.minHeight,t=this.options.maxHeight;"row"===this.options.maxHeightUnit&&(t=get(this.dropElm.querySelector("ul>li"),"outer","height")*this.options.maxHeight),this.ulElm??=this.dropElm.querySelector("ul"),this.ulElm&&(e&&(this.ulElm.style.minHeight=`${e}px`),this.ulElm.style.maxHeight=`${t}px`),this.dropElm.querySelectorAll(".multiple").forEach((e=>{e.style.width=`${this.options.multipleWidth}px`})),this.getDataLength()&&this.options.filter?(this.searchInputElm&&(this.searchInputElm.value="",this.searchInputElm.focus()),this.filter(!0)):this.focusSelectAllOrList(),this._currentHighlightIndex<0?this.moveHighlightDown():this.highlightCurrentOption(),this.options.autoAdjustDropWidthByTextSize&&this.adjustDropWidthByText();let i=this.options.position;if(this.options.autoAdjustDropHeight){if(this.options.autoAdjustDropPosition){let{bottom:e,top:t}=set(this.dropElm);i=e<this.dropElm.getBoundingClientRect().height&&t>e?"top":"bottom"}this.adjustDropHeight(i)}this.options.autoAdjustDropPosition&&this.adjustDropPosition(!0),this.options.onOpen()}focusSelectAllOrList(){this.selectAllElm?this.selectAllElm.focus():this.ulElm&&(this.ulElm.tabIndex=0,this.ulElm.focus())}highlightCurrentOption(){let e=this.dropElm?.querySelectorAll(_et)||[];if(this._currentHighlightIndex<=e.length){let t=e[this._currentHighlightIndex];t&&(this.lastFocusedItemKey=t.dataset.key||"",this._currentSelectedElm=t,this.scrolledByMouse=!1,t.scrollIntoView({block:"nearest"}),this.changeCurrentOptionHighlight(t),window.setTimeout((()=>this.scrolledByMouse=!0),10))}}changeCurrentOptionHighlight(e){e?.classList.add("highlighted"),(this.dropElm?.querySelectorAll(".ms-select-all.highlighted, ul li[data-key].highlighted")||[]).forEach((t=>{t!==e&&t.classList.remove("highlighted")}))}moveHighlightDown(){let e=this.dropElm?.querySelectorAll(_et)||[],t=e.length;this._currentHighlightIndex<t-1?(this._currentHighlightIndex++,e[this._currentHighlightIndex]?.classList.contains("disabled")&&this.moveHighlightDown()):this.options.infiniteScroll&&this.infiniteScrollHandler(null,this._currentHighlightIndex,t),this.highlightCurrentOption()}moveHighlightUp(){let e=this.dropElm?.querySelectorAll(_et)||[],t=this.options.single?0:1;if(this.virtualScroll&&this._currentHighlightIndex<=t&&this.updateDataStart>0&&this.ulElm){let t=e[this._currentHighlightIndex+(this.options.single?0:1)],i=t?.dataset.key;return this.lastFocusedItemKey=i,this.ulElm.scrollTop=this.ulElm.scrollTop-t?.getBoundingClientRect().height||10,void(this.isMoveUpRecalcRequired=!0)}this._currentHighlightIndex>0&&(this._currentHighlightIndex--,e[this._currentHighlightIndex]?.classList.contains("disabled")&&this.moveHighlightUp()),this.highlightCurrentOption()}recalculateArrowMove(e){let t=this.dropElm?.querySelectorAll(_et)||[],i=Array.from(t).findIndex((e=>e.dataset.key===this.lastFocusedItemKey));this._currentHighlightIndex=i-1,"down"===e?this.moveHighlightDown():"up"===e&&(this.moveHighlightUp(),this.isMoveUpRecalcRequired=!1)}close(e){this.options.isOpen=!1,this.parentElm.classList.remove("ms-parent-open"),this.choiceElm?.querySelector("div.ms-icon-caret")?.classList.remove("open"),this.dropElm&&(this.dropElm.style.display="none",this.dropElm.ariaExpanded="false",this.options.container&&(this.parentElm.appendChild(this.dropElm),this.dropElm.style.top="auto",this.dropElm.style.left="auto")),this.options.onClose(e)}applyAsTextOrHtmlWhenEnabled(e,t){e||(e={}),this.isRenderAsHtml?e.innerHTML="function"==typeof this.options.sanitizer?this.options.sanitizer(t):t:e.textContent=t}update(e=!1){let t=this.getSelects(),i=this.getSelects("text");this.options.displayValues&&(i=t);let n=this.choiceElm?.querySelector("span"),o=t.length,s=null,r=()=>{if(this.options.useSelectOptionLabel||this.options.useSelectOptionLabelToHtml){let e=t.join(this.options.displayDelimiter);return this.options.useSelectOptionLabelToHtml?e.replace(/(\b)(on[a-z]+)(\s*)=([^>]*)|javascript:([^>]*)[^>]*|(<\s*)(\/*)script([<>]*).*(<\s*)(\/*)script(>*)|(<|<)(\/*)(script|script defer)(.*)(>|>|>">)/gi,""):e}return i.join(this.options.displayDelimiter)};if(n){if(0===o){let e=this.options.placeholder||"";n.classList.add("ms-placeholder"),this.applyAsTextOrHtmlWhenEnabled(n,e)}else s=o<this.options.minimumCountSelected?r():this.formatAllSelected()&&o===this.dataTotal?this.formatAllSelected():this.options.ellipsis&&o>this.options.minimumCountSelected?`${i.slice(0,this.options.minimumCountSelected).join(this.options.displayDelimiter)}...`:this.formatCountSelected(o,this.dataTotal)&&o>this.options.minimumCountSelected?this.formatCountSelected(o,this.dataTotal):r();if(null!==s&&(n?.classList.remove("ms-placeholder"),this.applyAsTextOrHtmlWhenEnabled(n,s)),this.options.showClear&&this.selectClearElm){let e=s?"block":"none";this.selectClearElm.style.display=e}if(this.options.displayTitle){let e=this.options.useSelectOptionLabel||this.options.useSelectOptionLabelToHtml?"value":"text";n.title=this.getSelects(e).join(this.options.displayDelimiter)}}let a=this.getSelects();this.options.single?this.elm.value=a.length?a[0]:"":Array.from(this.elm.options).forEach((e=>{e.selected=a.some((t=>t===e.value))})),e||this.elm.dispatchEvent(new Event("change"))}updateSelected(e){for(let e=this.updateDataStart;e<this.updateDataEnd;e++){let t=this.updateData[e],i=this.dropElm?.querySelector(`input[data-key=${t._key}]`);if(i){i.checked=t.selected;let e=i.closest("li"),n=e?.querySelector(".icon-checkbox-container div");e&&(t.selected&&!e.classList.contains("selected")?(e.classList.add("selected"),e.ariaSelected="true",n&&(n.className="ms-icon ms-icon-"+("radio"===i.type?"radio":"check"))):t.selected||(e.classList.remove("selected"),e.ariaSelected="false",n&&(n.className="ms-icon ms-icon-uncheck")))}}let t=0===this.data?.filter((e=>e.visible)).length;if(this.selectAllElm){this.selectAllElm.ariaChecked=String(this.isAllSelected);let e=this.dropElm?.querySelector(".ms-select-all .icon-checkbox-container div");if(e){let t="";t=this.isAllSelected?"ms-icon-check":this.isPartiallyAllSelected?"ms-icon-minus":"ms-icon-uncheck",e.className=`ms-icon ${t}`}this.selectAllElm.checked=this.isAllSelected,met(this.selectAllElm.closest("li"),!t)}met(this.noResultsElm,t),this.virtualScroll&&(this.virtualScroll.rows=e??this.getListRows())}getData(){return this.options.data}getDataLength(){return this.data?.length??0}getOptions(e=!0){let t=Object.assign({},this.options);return delete t.data,e?eet(t):this.options}refreshOptions(e){(function(e,t,i=!1){let n=Object.keys(e),o=Object.keys(t);if(i&&n.length!==o.length)return!1;for(let i of n)if(o.includes(i)&&e[i]!==t[i])return!1;return!0})(this.options,e,!0)||(this.options=Object.assign(this.options,e),this.destroy(!1),this.init())}getDropElement(){return this.dropElm}getParentElement(){return this.parentElm}getSelects(e="value"){let t=[];for(let i of this.data||[])if("optgroup"===i.type){let n=i.children.filter((e=>e?.selected));if(!n.length)continue;if("value"===e||this.options.single)t.push(...n.map((t=>"value"===e&&t._value||t[e])));else{let o=[];o.push("["),o.push(i.label),o.push(`: ${n.map((t=>t[e])).join(", ")}`),o.push("]"),t.push(o.join(""))}}else i.selected&&t.push("value"===e&&i._value||i[e]);return t}setSelects(e,t="value",i=!1){let n=!1,o=i=>{for(let o of i){let i=!1;if("text"===t){let t=document.createElement("div");this.applyAsTextOrHtmlWhenEnabled(t,o.text),i=e.includes(t.textContent?.trim()??"")}else i=e.includes(o._value||o.value),!i&&o.value===""+ +o.value&&(i=e.includes(+o.value));o.selected!==i&&(n=!0),o.selected=i}};for(let e of this.data||[])"optgroup"===e.type?o(e.children):o([e]);n&&(this.initSelected(i),this.updateSelected(),this.update(i))}enable(){this.choiceElm&&(this.choiceElm.classList.remove("disabled"),this.choiceElm.disabled=!1)}disable(){this.choiceElm&&(this.choiceElm?.classList.add("disabled"),this.choiceElm.disabled=!0)}check(e){let t=iet(this.data,"value",e);t&&this._check(t,!0)}uncheck(e){let t=iet(this.data,"value",e);t&&this._check(t,!1)}_check(e,t){this.options.single&&this._checkAll(!1,!0),e.selected=t,this.initSelected(),this.updateSelected(),this.update()}checkAll(){this._checkAll(!0)}uncheckAll(){this._checkAll(!1)}_checkAll(e,t){for(let i of this.data||[])"optgroup"===i.type?this._checkGroup(i,e,!0):!i.disabled&&!i.divider&&(t||i.visible)&&(i.selected=e);t||(this.initSelected(),this.updateSelected(),this.update())}_checkGroup(e,t,i){e.selected=t,e.children.forEach((e=>{e&&!e.disabled&&!e.divider&&(i||e.visible)&&(e.selected=t)})),i||(this.initSelected(),this.updateSelected(),this.update())}checkInvert(){if(!this.options.single){for(let e of this.data||[])if("optgroup"===e.type)for(let t of e.children)t&&(t.divider||(t.selected=!t.selected));else e&&!e.divider&&(e.selected=!e.selected);this.initSelected(),this.updateSelected(),this.update()}}focus(){this.choiceElm?.focus(),this.options.onFocus()}blur(){this.choiceElm?.blur(),this.options.onBlur()}refresh(){this.destroy(!1),this.init()}filter(e){let t=this.searchInputElm?.value.trim()??"",i=t.toLowerCase();if(this.filterText===i)return;this.filterText=i;for(let e of this.data||[])if("optgroup"===e.type)if(this.options.filterGroup){let n=`${e?.label??""}`;if(null!=e){let o=this.options.customFilter({label:oet(n.toString().toLowerCase(),this.options.diacriticParser),search:oet(i,this.options.diacriticParser),originalLabel:n,originalSearch:t,row:e});e.visible=o;for(let t of e.children)t&&(t.visible=o)}}else{for(let n of e.children)if(null!=n){let o=`${n?.text??""}`;n.visible=this.options.customFilter({text:oet(o.toString().toLowerCase(),this.options.diacriticParser),search:oet(i,this.options.diacriticParser),originalText:o,originalSearch:t,row:n,parent:e})}e.visible=e.children.filter((e=>e?.visible)).length>0}else{let n=`${e?.text??""}`;e.visible=this.options.customFilter({text:oet(n.toString().toLowerCase(),this.options.diacriticParser),search:oet(i,this.options.diacriticParser),originalText:n,originalSearch:t,row:e})}let n=this.initListItems();this.initSelected(e),this.updateSelected(n),e||this.options.onFilter(t)}adjustDropHeight(e){let t="top"!==e,i=(this.filterParentElm?.getBoundingClientRect().height??0)+(this.okButtonElm?.getBoundingClientRect().height??0)+(this.options.single?0:this.selectAllParentElm?.getBoundingClientRect().height??0)+5,{bottom:n,top:o}=set(this.parentElm),s=this.options.maxHeight;if(s=t?n-i-this.options.adjustedHeightPadding:o-i-this.options.adjustedHeightPadding,!this.options.maxHeight||this.options.maxHeight&&s<this.options.maxHeight){let e=this.dropElm?.querySelector("ul");return e&&(e.style.maxHeight=`${s}px`),!0}return!1}adjustDropPosition(e){let t="bottom";if(this.dropElm&&this.parentElm){let{bottom:i,top:n}=set(this.dropElm),{top:o,left:s}=uet(this.parentElm),r=this.dropElm.getBoundingClientRect().height,a=this.dropElm.getBoundingClientRect().width,l=document.body.offsetWidth||window.innerWidth,d=this.parentElm.getBoundingClientRect().width;if(i>r)t="bottom";else if(r>i&&n>i){if(this.options.container){let i=o-r;i<0&&(i=0),(i>0||e)&&(t="top",this.dropElm.style.top=`${i<0?0:i}px`)}else t="top",this.dropElm.classList.add(t);this.dropElm.classList.remove("bottom")}l-a<s&&(this.dropElm.style.left=s-(a-d)+"px")}return t}adjustDropWidthByText(){if(this.dropElm){let e=this.parentElm.scrollWidth;(this.options.dropWidth||this.options.width)&&(e=this.options.dropWidth||this.options.width||0);let t=this.dropElm.querySelector(".ms-select-all span"),i=this.dropElm.querySelector("ul"),n=26,o=t?.clientWidth??0+n,s=i.scrollHeight>i.clientHeight?this.getScrollbarWidth():0,r=0;this.dropElm.querySelectorAll("li label").forEach((e=>{e.scrollWidth>r&&(r=e.scrollWidth)})),r+=n+s,r<o&&(r=o),this.options.maxWidth&&r>this.options.maxWidth&&(r=this.options.maxWidth),this.options.minWidth&&r<this.options.minWidth&&(r=this.options.minWidth),("100%"===e||+e<r)&&(this.dropElm.style.width=`${r}px`,this.dropElm.style.maxWidth=`${r}px`)}}getScrollbarWidth(){let e=document.createElement("div");e.style.visibility="hidden",e.style.width="100px",document.body.appendChild(e);let t=e.offsetWidth;e.style.overflow="scroll";let i=document.createElement("div");i.style.width="100%",e.appendChild(i);let n=i.offsetWidth;return e.parentNode?.removeChild(e),t-n}formatAllSelected(){return this.options.allSelectedText||this.options.formatAllSelected()}formatCountSelected(e,t){return this.options.countSelectedText?this.options.countSelectedText.replace("#",`${e}`).replace("%",`${t}`):this.options.formatCountSelected(e,t)}formatNoMatchesFound(){return this.options.noMatchesFoundText||this.options.formatNoMatchesFound()}formatOkButton(){return this.options.okButtonText||this.options.formatOkButton()}formatSelectAll(){return this.options.selectAllText||this.options.formatSelectAll()}},bet=(e,t)=>"string"==typeof e?wet(document.querySelectorAll(e),t):e instanceof Node?wet([e],t):wet(e,t);function wet(e,t){let i=Array.from(e),n=[];for(let e=0;e<i.length;e++){let o=i[e];try{void 0!==o._multipleSelect&&(o._multipleSelect.destroy(),delete o._multipleSelect),o._multipleSelect=new vet(o,t||{}),o._multipleSelect.init();let i=o._multipleSelect.getOptions(!1);i.onHardDestroy=()=>delete o._multipleSelect,i.onAfterHardDestroyed=()=>n[e]=null,n.push(o._multipleSelect)}catch(e){console.error(e)}}return 1===n.length?n[0]:n}bet.defaults=J8e.DEFAULTS,bet.locales={...Q8e},bet.methods=J8e.METHODS,typeof window<"u"&&(window.multipleSelect=bet);var Cet=i(6458),yet={};yet.styleTagTransform=zl(),yet.setAttributes=Bl(),yet.insert=Pl().bind(null,"head"),yet.domAPI=Rl(),yet.insertStyleElement=Vl(),Ml()(Cet.A,yet),Cet.A&&Cet.A.locals&&Cet.A.locals;var xet=i(3462),ket={};ket.styleTagTransform=zl(),ket.setAttributes=Bl(),ket.insert=Pl().bind(null,"head"),ket.domAPI=Rl(),ket.insertStyleElement=Vl(),Ml()(xet.A,ket);const Let=xet.A&&xet.A.locals?xet.A.locals:void 0;var Det=Object.getOwnPropertyNames,Eet=Object.getOwnPropertySymbols,Net=Object.prototype.hasOwnProperty;function Iet(e,t){return function(i,n,o){return e(i,n,o)&&t(i,n,o)}}function Tet(e){return function(t,i,n){if(!t||!i||"object"!=typeof t||"object"!=typeof i)return e(t,i,n);var o=n.cache,s=o.get(t),r=o.get(i);if(s&&r)return s===i&&r===t;o.set(t,i),o.set(i,t);var a=e(t,i,n);return o.delete(t),o.delete(i),a}}function Met(e){return Det(e).concat(Eet(e))}var Aet=Object.hasOwn||function(e,t){return Net.call(e,t)};function Ret(e,t){return e===t||!e&&!t&&e!=e&&t!=t}var Oet=Object.getOwnPropertyDescriptor,Pet=Object.keys;function Fet(e,t,i){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!i.equals(e[n],t[n],n,n,e,t,i))return!1;return!0}function Bet(e,t){return Ret(e.getTime(),t.getTime())}function Wet(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Vet(e,t){return e===t}function Het(e,t,i){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var o,s,r=new Array(n),a=e.entries(),l=0;(o=a.next())&&!o.done;){for(var d=t.entries(),h=!1,c=0;(s=d.next())&&!s.done;)if(r[c])c++;else{var u=o.value,g=s.value;if(i.equals(u[0],g[0],l,c,e,t,i)&&i.equals(u[1],g[1],u[0],g[0],e,t,i)){h=r[c]=!0;break}c++}if(!h)return!1;l++}return!0}var zet=Ret;function Uet(e,t,i){var n=Pet(e),o=n.length;if(Pet(t).length!==o)return!1;for(;o-- >0;)if(!Yet(e,t,i,n[o]))return!1;return!0}function Ket(e,t,i){var n,o,s,r=Met(e),a=r.length;if(Met(t).length!==a)return!1;for(;a-- >0;){if(!Yet(e,t,i,n=r[a]))return!1;if(o=Oet(e,n),s=Oet(t,n),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable))return!1}return!0}function jet(e,t){return Ret(e.valueOf(),t.valueOf())}function qet(e,t){return e.source===t.source&&e.flags===t.flags}function $et(e,t,i){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var o,s,r=new Array(n),a=e.values();(o=a.next())&&!o.done;){for(var l=t.values(),d=!1,h=0;(s=l.next())&&!s.done;){if(!r[h]&&i.equals(o.value,s.value,o.value,s.value,e,t,i)){d=r[h]=!0;break}h++}if(!d)return!1}return!0}function Get(e,t){var i=e.length;if(t.length!==i)return!1;for(;i-- >0;)if(e[i]!==t[i])return!1;return!0}function Zet(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function Yet(e,t,i,n){return!("_owner"!==n&&"__o"!==n&&"__v"!==n||!e.$$typeof&&!t.$$typeof)||Aet(t,n)&&i.equals(e[n],t[n],n,n,e,t,i)}var Qet=Array.isArray,Xet="function"==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView:null,Jet=Object.assign,ett=Object.prototype.toString.call.bind(Object.prototype.toString);var ttt=itt();function itt(e){void 0===e&&(e={});var t=e.circular,i=void 0!==t&&t,n=e.createInternalComparator,o=e.createState,s=e.strict,r=void 0!==s&&s,a=function(e){var t=e.circular,i=e.createCustomConfig,n=e.strict,o={areArraysEqual:n?Ket:Fet,areDatesEqual:Bet,areErrorsEqual:Wet,areFunctionsEqual:Vet,areMapsEqual:n?Iet(Het,Ket):Het,areNumbersEqual:zet,areObjectsEqual:n?Ket:Uet,arePrimitiveWrappersEqual:jet,areRegExpsEqual:qet,areSetsEqual:n?Iet($et,Ket):$et,areTypedArraysEqual:n?Ket:Get,areUrlsEqual:Zet,unknownTagComparators:void 0};if(i&&(o=Jet({},o,i(o))),t){var s=Tet(o.areArraysEqual),r=Tet(o.areMapsEqual),a=Tet(o.areObjectsEqual),l=Tet(o.areSetsEqual);o=Jet({},o,{areArraysEqual:s,areMapsEqual:r,areObjectsEqual:a,areSetsEqual:l})}return o}(e),l=function(e){var t=e.areArraysEqual,i=e.areDatesEqual,n=e.areErrorsEqual,o=e.areFunctionsEqual,s=e.areMapsEqual,r=e.areNumbersEqual,a=e.areObjectsEqual,l=e.arePrimitiveWrappersEqual,d=e.areRegExpsEqual,h=e.areSetsEqual,c=e.areTypedArraysEqual,u=e.areUrlsEqual,g=e.unknownTagComparators;return function(e,p,m){if(e===p)return!0;if(null==e||null==p)return!1;var f=typeof e;if(f!==typeof p)return!1;if("object"!==f)return"number"===f?r(e,p,m):"function"===f&&o(e,p,m);var _=e.constructor;if(_!==p.constructor)return!1;if(_===Object)return a(e,p,m);if(Qet(e))return t(e,p,m);if(null!=Xet&&Xet(e))return c(e,p,m);if(_===Date)return i(e,p,m);if(_===RegExp)return d(e,p,m);if(_===Map)return s(e,p,m);if(_===Set)return h(e,p,m);var v,b=ett(e);if("[object Date]"===b)return i(e,p,m);if("[object RegExp]"===b)return d(e,p,m);if("[object Map]"===b)return s(e,p,m);if("[object Set]"===b)return h(e,p,m);if("[object Object]"===b)return"function"!=typeof e.then&&"function"!=typeof p.then&&a(e,p,m);if("[object URL]"===b)return u(e,p,m);if("[object Error]"===b)return n(e,p,m);if("[object Arguments]"===b)return a(e,p,m);if("[object Boolean]"===b||"[object Number]"===b||"[object String]"===b)return l(e,p,m);if(g){var w=g[b];if(!w){var C=null!=(v=e)?v[Symbol.toStringTag]:void 0;C&&(w=g[C])}if(w)return w(e,p,m)}return!1}}(a),d=n?n(l):function(e){return function(t,i,n,o,s,r,a){return e(t,i,a)}}(l);return function(e){var t=e.circular,i=e.comparator,n=e.createState,o=e.equals,s=e.strict;if(n)return function(e,r){var a=n(),l=a.cache,d=void 0===l?t?new WeakMap:void 0:l,h=a.meta;return i(e,r,{cache:d,equals:o,meta:h,strict:s})};if(t)return function(e,t){return i(e,t,{cache:new WeakMap,equals:o,meta:void 0,strict:s})};var r={cache:void 0,equals:o,meta:void 0,strict:s};return function(e,t){return i(e,t,r)}}({circular:i,comparator:l,createState:o,equals:d,strict:r})}itt({strict:!0}),itt({circular:!0}),itt({circular:!0,strict:!0}),itt({createInternalComparator:function(){return Ret}}),itt({strict:!0,createInternalComparator:function(){return Ret}}),itt({circular:!0,createInternalComparator:function(){return Ret}}),itt({circular:!0,createInternalComparator:function(){return Ret},strict:!0}),(e=>{for(const{id:t,lang:i}of e)eve.register({id:t}),eve.setMonarchTokensProvider(t,i.language),eve.setLanguageConfiguration(t,i.conf),eve.registerCompletionItemProvider(t,V8e)})([{id:"sd-prompt",lang:o},{id:"sd-dynamic-prompt",lang:s}]);const ntt="monacoPromptEditor",ott=[8,9,10,11,12,14,16,18,20,22,24,26,28,36,48],stt={instances:{}};let rtt=0,att=null;const ltt={NORMAL:"NORMAL",VIM:"VIM"};class dtt extends HTMLElement{elements={};mode=ltt.NORMAL;monaco;theme;showHeader;vim;textareaDescriptor;textareaDisplay;onChangeShowHeaderCallbacks;onChangeShowHeaderBeforeSyncCallbacks;onChangeShowLineNumbersCallbacks;onChangeShowLineNumbersBeforeSyncCallbacks;onChangeShowMinimapCallbacks;onChangeShowMinimapBeforeSyncCallbacks;onChangeReplaceUnderscoreCallbacks;onChangeReplaceUnderscoreBeforeSyncCallbacks;onChangeThemeCallbacks;onChangeThemeBeforeSyncCallbacks;onChangeModeCallbacks;onChangeModeBeforeSyncCallbacks;onChangeLanguageCallbacks;onChangeLanguageBeforeSyncCallbacks;onChangeFontSizeCallbacks;onChangeFontSizeBeforeSyncCallbacks;onChangeFontFamilyCallbacks;onChangeFontFamilyBeforeSyncCallbacks;onChangeAutoCompleteToggleCallbacks;onChangeAutoCompleteToggleBeforeSyncCallbacks;_id;constructor(e,t={}){super(),this._id=rtt++,this.textareaDescriptor=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),"value");const i=this.elements.container=this.attachShadow({mode:"open"}),n=this.elements.header=document.createElement("header"),o=this.elements.main=document.createElement("main"),s=this.elements.footer=document.createElement("footer"),r=this.elements.inner=document.createElement("div"),a=this.elements.monaco=document.createElement("div"),l=this.elements.status=document.createElement("div");o.appendChild(a),s.appendChild(l),r.appendChild(n),r.appendChild(o),r.appendChild(s),i.appendChild(r),r.classList.add(Let.inner),o.classList.add(Let.main),n.classList.add(Let.header),s.classList.add(Let.footer),a.classList.add(Let.monaco),l.classList.add(Let.status),this.onChangeShowHeaderCallbacks=[],this.onChangeShowHeaderBeforeSyncCallbacks=[],this.onChangeShowLineNumbersCallbacks=[],this.onChangeShowLineNumbersBeforeSyncCallbacks=[],this.onChangeShowMinimapCallbacks=[],this.onChangeShowMinimapBeforeSyncCallbacks=[],this.onChangeReplaceUnderscoreCallbacks=[],this.onChangeReplaceUnderscoreBeforeSyncCallbacks=[],this.onChangeThemeCallbacks=[],this.onChangeThemeBeforeSyncCallbacks=[],this.onChangeModeCallbacks=[],this.onChangeModeBeforeSyncCallbacks=[],this.onChangeLanguageCallbacks=[],this.onChangeLanguageBeforeSyncCallbacks=[],this.onChangeFontSizeCallbacks=[],this.onChangeFontSizeBeforeSyncCallbacks=[],this.onChangeFontFamilyCallbacks=[],this.onChangeFontFamilyBeforeSyncCallbacks=[],this.onChangeAutoCompleteToggleCallbacks=[],this.onChangeAutoCompleteToggleBeforeSyncCallbacks=[];const d=this.monaco=J_e.create(a,{value:e.value,bracketPairColorization:{enabled:!0},automaticLayout:!0,wordWrap:"on"});this.polyfillMonacoEditorConfiguration(),this.showHeader=!0,this.theme=this.getThemeId(),this.changeMode(ltt.VIM),d.onDidFocusEditorWidget((()=>{att=this.getInstanceId()})),t.focus&&d.focus(),d.getModel()?.onDidChangeContent((t=>{this.textareaDescriptor.set?.call(e,this.monaco.getValue());const i=new InputEvent("input");Object.defineProperty(i,"target",{writable:!1,value:e}),e.dispatchEvent(i)})),t.handleTextAreaValue&&this.hookTextAreaElement(e),this.initHeader(),t.autoLayout&&this.handleResize(),this.copyStyleToShadow(),this.textareaDisplay=e.style.display,e.style.display="none";const h=this.elements.main.querySelector(".overflow-guard");this.elements.overflowGuard=h;const c=this.elements.main.querySelector(".overflowingContentWidgets");this.elements.overflowContent=c;const u=this.elements.main.querySelector(".overflowingOverlayWidgets");this.elements.overflowOverlay=u,this.fixedOverflowWidgetWorkaround([c,u],t),this.updateAutoComplete(),this.setContextMenu(),this.setSettings(Object.assign({},this.getSettings(),{csvToggle:Object.fromEntries(T8e.enabledCSV.slice().map((e=>[this.createContextKey("csv",e),!0])))}),!0),this.setEventHandler(),stt.instances[this._id]=this}getCurrentFocus(){return stt&&stt.instances?null===att?null:stt.instances[att]?stt.instances[att]:(console.warn("instance not found: ",att,stt.instances),null):null}dispose(){if(this.monaco){const e=this.monaco.getModel();e&&e.dispose(),this.monaco.dispose()}delete stt.instances[this._id]}fixedOverflowWidgetWorkaround(e,t){const i=this.elements.overflowGuard;i.style.position="absolute";for(const t of e)t.style.position="fixed";const n=i.querySelector(".scrollbar.vertical");n&&(n.style.zIndex="6"),this.setOverlayZIndex(10),"number"==typeof t.overlayZIndex&&this.setOverlayZIndex(t.overlayZIndex)}createContextKey(...e){return[ntt,...e].join(".")}setContextMenu(){K8e(this.monaco,{id:"header",label:"Show Header",order:0,groupId:"monaco-prompt-editor",run:()=>{this.changeShowHeader(!this.getContext(this.createContextKey("showHeader"))),this.syncShowHeader()},commandOptions:{toggled:{condition:Ac.deserialize(this.createContextKey("showHeader"))}}}),K8e(this.monaco,{id:"minimap",label:"Show Minimap",order:1,groupId:"monaco-prompt-editor",run:()=>{this.changeShowMinimap(!this.getContext(this.createContextKey("minimap"))),this.syncMinimap()},commandOptions:{toggled:{condition:Ac.deserialize(this.createContextKey("minimap"))}}}),K8e(this.monaco,{id:"line_numbers_show",label:"LineNum",order:2,groupId:"monaco-prompt-editor",run:()=>{this.changeShowLineNumbers(!this.getContext(this.createContextKey("lineNumbers"))),this.syncLineNumbers()},commandOptions:{toggled:{condition:Ac.deserialize(this.createContextKey("lineNumbers"))}}}),K8e(this.monaco,{id:"underscore_replace",label:"Replace Underscore",order:3,groupId:"monaco-prompt-editor",run:()=>{this.changeReplaceUnderscore(!this.getContext(this.createContextKey("replaceUnderscore"))),this.syncReplaceUnderscore()},commandOptions:{toggled:{condition:Ac.deserialize(this.createContextKey("replaceUnderscore"))}}}),H8e(this.monaco,{title:"FontSize",context:["MonacoPromptEditorFontSize",this._id].join("_"),group:"monaco-prompt-editor",order:4,actions:ott.map((e=>({id:["fontsize",e].join("_"),label:""+e,run:()=>{this.changeFontSize(e),this.syncFontSize()},commandOptions:{toggled:{condition:Ac.deserialize(`${this.createContextKey("fontSize")} == ${e}`)}}})))}),this.monaco.addAction({id:"fontfamily",label:"FontFamily",run:()=>{this.monaco.invokeWithinContext((async e=>{const t=e.get(LD).createInputBox();t.placeholder="input font family",t.value=this.monaco.getOption(J_e.EditorOption.fontFamily),t.onDidAccept((()=>{this.changeFontFamily(t.value),this.syncFontFamily(),t.dispose()})),t.show()}))},contextMenuOrder:5,contextMenuGroupId:"monaco-prompt-editor"}),H8e(this.monaco,{title:"Language",context:["MonacoPromptEditorLanguage",this._id].join("_"),group:"monaco-prompt-editor",order:6,actions:eve.getLanguages().map((e=>({id:["language",e.id].join("_"),label:e.id,run:()=>{this.changeLanguage(e.id),this.syncLanguage()},commandOptions:{toggled:{condition:Ac.deserialize(`${this.createContextKey("language")} == ${e.id}`)}}})))}),H8e(this.monaco,{title:"KeyBindings",context:["MonacoPromptEditorKeyBindings",this._id].join("_"),group:"monaco-prompt-editor",order:7,actions:Object.values(ltt).map((e=>({id:["keybinding",e].join("_"),label:e,run:()=>{this.changeMode(e),this.syncKeyBindings()},commandOptions:{toggled:{condition:Ac.deserialize(`${this.createContextKey("keybinding")} == ${e}`)}}})))}),H8e(this.monaco,{title:"Theme",context:["MonacoPromptEditorTheme",this._id].join("_"),group:"monaco-prompt-editor",order:8,actions:Object.keys(this._mapToObject(this.monaco._themeService._knownThemes)).map((e=>({id:["theme",e].join("_"),label:e,run:()=>{this.changeTheme(e),this.syncTheme()},commandOptions:{toggled:{condition:Ac.deserialize(`${this.createContextKey("theme")} == ${e}`)}}})))})}createOrUpdateSubMenu(e,t,i,n,o){const s=[t,this.getInstanceId()].join("_"),r={title:e,context:s,group:i,order:n,actions:o};return z8e(s)||H8e(this.monaco,r),s}removeSubMenu(e){(e=>{const t=z8e(e);if(!t)throw new Error(`MenuId(${e}) is not found`);console.log("remove submenu:",t),fu._menuItems.delete(t)})(e)}updateAutoComplete(){const e=B8e();this.createOrUpdateSubMenu("Autocomplete","AutoComplete","AutoComplete",9,e.map((e=>{const t=e.split(".",2)[0],i=this.createContextKey("csv",t);return{id:["autocomplete",t].join("_"),label:t,run:()=>{const e=this.getContext(i);this.changeAutoCompleteToggle(i,!e,!0),this.syncAutoCompleteToggle()},commandOptions:{toggled:{condition:Ac.equals(i,!0)}}}}))),this.updateAutoCompleteHeader()}getCurrentEnableAutoCompleteToggle(){return Object.entries(this.getLocalContextValues("csv")).filter((([e,t])=>t)).map((([e,t])=>e.split(".").pop()))}updateAutoCompleteHeader(){const e=B8e(),t=this.getCurrentEnableAutoCompleteToggle();let i;if(this.elements.autocomplete)i=this.elements.autocomplete,i.refreshOptions({data:e});else{const t=document.createElement("label"),n=document.createElement("div"),o=document.createElement("select");t.textContent="AutoComplete",n.appendChild(o),n.style.display="inline-block",n.style.marginLeft="0.5rem",t.appendChild(n),this.elements.header.appendChild(t),this.elements.autocompleteElement=t,o.classList.add("multiple-select");const s=e=>{e.getParentElement().querySelector(".ms-choice").classList.add(Let["ms-choice"])};i=bet(o,{filter:!0,single:!1,showSearchClear:!0,data:e,width:"24rem",selectAll:!1,onClick:e=>{const t=this.createContextKey("csv",e.value),i=e.selected;this.changeAutoCompleteToggle(t,i,!0),this.syncAutoCompleteToggle()},onAfterCreate:()=>{this.elements.autocomplete&&s(this.elements.autocomplete)}}),s(i),this.elements.autocomplete=i}i.setSelects(t)}updateAutoCompleteHeaderToggle(){const e=this.elements.autocomplete;e&&e.setSelects(this.getCurrentEnableAutoCompleteToggle())}setEventHandler(){this.monaco.onDidChangeConfiguration((e=>{e.hasChanged(J_e.EditorOption.fontSize)&&this.changeFontSize(this.monaco.getOption(J_e.EditorOption.fontSize),!1),e.hasChanged(J_e.EditorOption.fontFamily)&&this.changeFontFamily(this.monaco.getOption(J_e.EditorOption.fontFamily),!1)}))}setOverlayZIndex(e){this.elements.overflowContent&&(this.elements.overflowContent.style.zIndex=""+e,this.elements.overflowOverlay&&(this.elements.overflowOverlay.style.zIndex=""+(e+1)))}setContext(e,t){const i=this.monaco._contextKeyService;i.getContextValuesContainer(i._myContextId).setValue(e,t)}getContext(e){const t=this.monaco._contextKeyService;return t.getContextValuesContainer(t._myContextId).getValue(e)}getContextValues(){const e=this.monaco._contextKeyService;return e.getContextValuesContainer(e._myContextId).value}getLocalContextValues(...e){const t=this.getContextValues(),i=this.createContextKey(...e)+".";return Object.fromEntries(Object.entries(t).filter((([e,t])=>e.startsWith(i))))}changeMode(e){if(this.mode!==e){this.mode===ltt.VIM&&(this.vim.dispose(),this.vim=null),e===ltt.VIM&&(this.vim=function(e,t=null,i=v7e,n=null){const o=new _7e(e);if(!t)return o.attach(),o;const s=new i(t,e,n);let r="";return o.on("vim-mode-change",(e=>{s.setMode(e)})),o.on("vim-keypress",(e=>{":"===e?r="":r+=e,s.setKeyBuffer(r)})),o.on("vim-command-done",(()=>{r="",s.setKeyBuffer(r)})),o.on("dispose",(function(){s.toggleVisibility(!1),s.closeInput(),s.clear()})),s.toggleVisibility(!0),o.setStatusBar(s),o.attach(),o}(this.monaco,this.elements.status)),this.mode=e,this.setContext(this.createContextKey("keybinding"),this.mode),this.elements.keyBindings&&(this.elements.keyBindings.value=e);for(const e of this.onChangeModeCallbacks)e()}}changeTheme(e){this.theme=e,this.elements.theme&&(this.elements.theme.value=e),this.monaco._themeService.setTheme(this.theme),this.setContext(this.createContextKey("theme"),this.theme);for(const e of this.onChangeThemeCallbacks)e()}changeLanguage(e){this.elements.language&&(this.elements.language.value=e);const t=this.monaco.getModel();J_e.setModelLanguage(t,e),this.setContext(this.createContextKey("language"),e);for(const e of this.onChangeLanguageCallbacks)e()}changeShowHeader(e){this.showHeader=e,this.setContext(this.createContextKey("showHeader"),e),this.toggleHeader();for(const e of this.onChangeShowHeaderCallbacks)e()}changeShowLineNumbers(e){this.elements.lineNumbers&&(this.elements.lineNumbers.checked=e),this.monaco.updateOptions({lineNumbers:e?"on":"off"}),this.setContext(this.createContextKey("lineNumbers"),e);for(const e of this.onChangeShowLineNumbersCallbacks)e()}changeShowMinimap(e,t=!1){this.elements.minimap&&(this.elements.minimap.checked=e),this.monaco.updateOptions({minimap:{enabled:e}}),this.setContext(this.createContextKey("minimap"),e);for(const e of this.onChangeShowMinimapCallbacks)e()}changeReplaceUnderscore(e){var t;this.elements.replaceUnderscore&&(this.elements.replaceUnderscore.checked=e),t=e,T8e.isRplaceUnderscore=t,this.setContext(this.createContextKey("replaceUnderscore"),e);for(const e of this.onChangeReplaceUnderscoreCallbacks)e()}changeFontSize(e,t=!0){this.elements.fontsize&&(this.elements.fontsize.value=""+e),t&&this.monaco.updateOptions({fontSize:e}),this.setContext(this.createContextKey("fontSize"),e);for(const e of this.onChangeFontSizeCallbacks)e()}changeFontFamily(e,t=!0){t&&this.monaco.updateOptions({fontFamily:e}),this.setContext(this.createContextKey("fontFamily"),e);for(const e of this.onChangeFontFamilyCallbacks)e()}changeAutoCompleteToggle(e,t,i=!1){const n=i?e:this.createContextKey("csv",e);this.setContext(n,t),this.updateAutoCompleteHeaderToggle();for(const e of this.onChangeAutoCompleteToggleCallbacks)e()}polyfillMonacoEditorConfiguration(){"function"!=typeof this.monaco.getConfiguration&&(this.monaco.getConfiguration=()=>{const e={};for(const[t,i]of Object.entries(J_e.EditorOptions)){const n=this.monaco.getOption(i.id);e[t]=n,"cursorWidth"===t&&(e.viewInfo||={},e.viewInfo[t]=n)}return e})}getThemeId(){return this.monaco._themeService._theme.id}getInstanceId(){return this._id}setValue(e){if(void 0===e)return;if(e===this.monaco.getValue())return;const t=this.monaco.getPosition();this.monaco.setValue(e),this.monaco.setPosition(t)}hookTextAreaElement(e){const t=this,i=this.textareaDescriptor;Object.defineProperty(e,"value",{set:function(e){return t.setValue(e),i.set.call(this,e)},get:i.get})}initHeader(){const e=this.elements.header;for(const{label:t,title:i,callback:n,isEnabledCallback:o,toggleCallback:s}of[{label:"Minimap",callback:(e,t)=>{this.elements.minimap=t},isEnabledCallback:()=>this.monaco.getOption(J_e.EditorOption.minimap).enabled,toggleCallback:e=>{this.syncMinimap()}},{label:"LineNum",callback:(e,t)=>{this.elements.lineNumbers=t},isEnabledCallback:()=>this.monaco.getOption(J_e.EditorOption.lineNumbers).renderType!==J_e.RenderLineNumbersType.Off,toggleCallback:e=>{this.syncLineNumbers()}},{label:"Underscore",title:"Replace Underscore -> Space (AutoComplete)",callback:(e,t)=>{this.elements.replaceUnderscore=t},isEnabledCallback:()=>M8e(),toggleCallback:e=>{this.syncReplaceUnderscore()}}])e.appendChild(this.createCheckbox(t,n,o,s,i));for(const{label:t,data:i,callback:n,isSelectedCallback:o,changeCallback:s,getValue:r}of[{label:"FontSize",data:this._arrayToObject(ott),callback:(e,t)=>{this.elements.fontsize=t},isSelectedCallback:e=>+e===this.monaco.getOption(J_e.EditorOption.fontSize),changeCallback:e=>{const t=+e.target.value;this.changeFontSize(t),this.syncFontSize()}},{label:"Language",data:this._arrayToObject(eve.getLanguages().map((e=>e.id))),callback:(e,t)=>{this.elements.language=t},isSelectedCallback:e=>e===this.monaco.getModel().getLanguageId(),changeCallback:e=>{e.target.value,this.syncLanguage()}},{label:"KeyBindings",data:ltt,callback:(e,t)=>{this.elements.keyBindings=t},isSelectedCallback:e=>e===this.mode,changeCallback:e=>{e.target.value,this.syncKeyBindings()}},{label:"Theme",data:this._mapToObject(this.monaco._themeService._knownThemes),callback:(e,t)=>{this.elements.theme=t},isSelectedCallback:e=>e.id===this.theme,changeCallback:e=>{const t=e.target.value;this.getThemeId()!==t&&this.syncTheme()},getValue:e=>e.id}])e.appendChild(this.createSelect(t,i,n,o,s,r));e.addEventListener("contextmenu",(e=>{e.stopPropagation(),e.preventDefault()})),e.querySelectorAll("header > *").forEach((e=>{e.style.marginRight="1rem"}))}syncLanguage(){if(!this.elements.language)return;const e=this.elements.language.value;for(const e of this.onChangeLanguageBeforeSyncCallbacks)e();htt((t=>{t.changeLanguage(e)}))}syncKeyBindings(){if(!this.elements.keyBindings)return;const e=this.elements.keyBindings.value;for(const e of this.onChangeModeBeforeSyncCallbacks)e();htt((t=>{t.changeMode(e)})),this.monaco.focus()}syncTheme(){if(!this.elements.theme)return;const e=this.elements.theme.value;for(const e of this.onChangeThemeBeforeSyncCallbacks)e();htt((t=>{t.changeTheme(e)}))}syncShowHeader(){for(const e of this.onChangeShowHeaderBeforeSyncCallbacks)e();htt((e=>{e.changeShowHeader(this.showHeader)}))}syncLineNumbers(){if(!this.elements.lineNumbers)return;const e=this.elements.lineNumbers.checked;for(const e of this.onChangeShowLineNumbersBeforeSyncCallbacks)e();htt((t=>{t.changeShowLineNumbers(e)}))}syncMinimap(){if(!this.elements.minimap)return;const e=this.elements.minimap.checked;for(const e of this.onChangeShowMinimapBeforeSyncCallbacks)e();htt((t=>{t.changeShowMinimap(e)}))}syncReplaceUnderscore(){if(!this.elements.replaceUnderscore)return;const e=this.elements.replaceUnderscore.checked;for(const e of this.onChangeReplaceUnderscoreBeforeSyncCallbacks)e();htt((t=>{t.changeReplaceUnderscore(e)}))}syncFontSize(){const e=this.getContext(this.createContextKey("fontSize"));for(const e of this.onChangeFontSizeBeforeSyncCallbacks)e();htt((t=>{t.changeFontSize(e)}))}syncFontFamily(){const e=this.getContext(this.createContextKey("fontFamily"));for(const e of this.onChangeFontFamilyBeforeSyncCallbacks)e();htt((t=>{t.changeFontFamily(e)}))}updateAutoCompleteToggle(){const e=this.getLocalContextValues("csv");(e=>{const t=((e,t)=>{const i={equal:!0,add:[],remove:[]},n=new Map(t.map((e=>[e,!0])));for(const t of e)n.has(t)?n.delete(t):(i.equal=!1,i.remove.push(t));n.size>0&&(i.equal=!1);for(const e of n.keys())i.add.push(e);return i})(T8e.enabledCSV,e);if(!t.equal){T8e.enabledCSV=e,t.remove.length>0?O8e():t.add.length>0&&(e=t.add);for(const t of e){const e=T8e.loadedCSV[t];e?F8e(e,t):console.error(`"${t}" is not loaded`)}}})(Object.entries(e).filter((([e,t])=>t)).map((([e,t])=>e.split(".").slice(-1)[0])))}syncAutoCompleteToggle(){const e=this.getLocalContextValues("csv");this.updateAutoCompleteToggle();for(const e of this.onChangeAutoCompleteToggleBeforeSyncCallbacks)e();htt((t=>{for(const[i,n]of Object.entries(e))t.changeAutoCompleteToggle(i,n,!0)}))}createCheckbox(e,t,i,n,o){const s=document.createElement("label"),r=document.createElement("input");return Object.assign(s.style,{display:"flex"}),r.checked=i(),r.type="checkbox",r.addEventListener("change",n),s.textContent=e,s.prepend(r),o&&(s.title=o),t(s,r),s}createSelect(e,t,i,n,o,s,r=!1){const a=document.createElement("label");Object.assign(a.style,{display:"flex"});const l=document.createElement("select");r&&(l.multiple=!0,l.size=1),Object.assign(l.style,{marginLeft:"0.5rem"});for(const[e,i]of Object.entries(t)){const t=document.createElement("option");t.textContent=e,t.value="function"==typeof s?s(i):i,n(i)&&(t.selected=!0),l.appendChild(t)}return l.addEventListener("change",o),a.textContent=e,a.appendChild(l),i(a,l),a}_mapToObject(e){const t={};return e.forEach(((e,i)=>{t[i]=e})),t}_arrayToObject(e){const t={};return e.forEach((e=>{t[e]=e})),t}handleResize(){const e=(e,t)=>{const i=this.elements.main;i&&(this.toggleHeader(),this.parentElement&&(i.style.height=this.parentElement.clientHeight+"px"),this.monaco.layout())},t=new MutationObserver(e),i=new IntersectionObserver(e,{root:document.documentElement});t.observe(this,{attributes:!0,attributeFilter:["style"]}),i.observe(this)}toggleHeader(){const e=this.elements.header,t=this.elements.inner;if(!e||!t)return;if(!this.showHeader)return void(e.style.display="none");e.style.display="block";const i=e.getBoundingClientRect(),n=t.getBoundingClientRect();i.width<=n.width&&i.height<=n.height&&i.top>=n.top&&i.left>=n.left&&i.bottom<=n.bottom&&i.right<=n.right?e.style.removeProperty("display"):e.style.display="none"}copyStyleToShadow(){document.head.querySelectorAll("style").forEach((e=>{this.elements.container.appendChild(e.cloneNode(!0))}))}getSettings(){return{minimap:this.elements.minimap?.checked,showHeader:this.showHeader,lineNumbers:this.elements.lineNumbers?.checked,replaceUnderscore:M8e(),language:this.monaco.getModel().getLanguageId(),theme:this.theme,mode:this.mode,fontSize:this.getContext(this.createContextKey("fontSize")),fontFamily:this.getContext(this.createContextKey("fontFamily")),csvToggle:this.getLocalContextValues("csv")}}setSettings(e,t=!1){const i=this.getSettings();if(void 0===e.minimap||!t&&e.minimap===i.minimap||this.changeShowMinimap(e.minimap),void 0===e.showHeader||!t&&e.showHeader===i.showHeader||this.changeShowHeader(e.showHeader),void 0===e.lineNumbers||!t&&e.lineNumbers===i.lineNumbers||this.changeShowLineNumbers(e.lineNumbers),void 0===e.replaceUnderscore||!t&&e.replaceUnderscore===i.replaceUnderscore||this.changeReplaceUnderscore(e.replaceUnderscore),void 0===e.language||!t&&e.language===i.language||this.changeLanguage(e.language),void 0===e.theme||!t&&e.theme===i.theme||this.changeTheme(e.theme),void 0===e.mode||!t&&e.mode===i.mode||this.changeMode(e.mode),void 0===e.fontSize||!t&&e.fontSize===i.fontSize||this.changeFontSize(e.fontSize),void 0===e.fontFamily||!t&&e.fontFamily===i.fontFamily||this.changeFontFamily(e.fontFamily),void 0!==e.csvToggle&&(t||!ttt(e.csvToggle,i.csvToggle))){for(const[t,n]of Object.entries(e.csvToggle))i.csvToggle[t]!==n&&this.changeAutoCompleteToggle(t,n,!0);this.updateAutoCompleteToggle()}}onChangeShowHeader(e){this.onChangeShowHeaderCallbacks.push(e)}onChangeShowHeaderBeforeSync(e){this.onChangeShowHeaderBeforeSyncCallbacks.push(e)}onChangeShowLineNumbers(e){this.onChangeShowLineNumbersCallbacks.push(e)}onChangeShowLineNumbersBeforeSync(e){this.onChangeShowLineNumbersBeforeSyncCallbacks.push(e)}onChangeShowMinimap(e){this.onChangeShowMinimapCallbacks.push(e)}onChangeShowMinimapBeforeSync(e){this.onChangeShowMinimapBeforeSyncCallbacks.push(e)}onChangeReplaceUnderscore(e){this.onChangeReplaceUnderscoreCallbacks.push(e)}onChangeReplaceUnderscoreBeforeSync(e){this.onChangeReplaceUnderscoreBeforeSyncCallbacks.push(e)}onChangeTheme(e){this.onChangeThemeCallbacks.push(e)}onChangeThemeBeforeSync(e){this.onChangeThemeBeforeSyncCallbacks.push(e)}onChangeMode(e){this.onChangeModeCallbacks.push(e)}onChangeModeBeforeSync(e){this.onChangeModeBeforeSyncCallbacks.push(e)}onChangeLanguage(e){this.onChangeLanguageCallbacks.push(e)}onChangeLanguageBeforeSync(e){this.onChangeLanguageBeforeSyncCallbacks.push(e)}onChangeFontSize(e){this.onChangeFontSizeCallbacks.push(e)}onChangeFontSizeBeforeSync(e){this.onChangeFontSizeBeforeSyncCallbacks.push(e)}onChangeFontFamily(e){this.onChangeFontFamilyCallbacks.push(e)}onChangeFontFamilyBeforeSync(e){this.onChangeFontFamilyBeforeSyncCallbacks.push(e)}onChangeAutoCompleteToggle(e){this.onChangeAutoCompleteToggleCallbacks.push(e)}onChangeAutoCompleteToggleBeforeSync(e){this.onChangeAutoCompleteToggleBeforeSyncCallbacks.push(e)}onChange(e){this.onChangeShowHeader(e),this.onChangeShowLineNumbers(e),this.onChangeShowMinimap(e),this.onChangeReplaceUnderscore(e),this.onChangeTheme(e),this.onChangeMode(e),this.onChangeLanguage(e),this.onChangeFontSize(e),this.onChangeFontFamily(e),this.onChangeAutoCompleteToggle(e)}onChangeBeforeSync(e){this.onChangeShowHeaderBeforeSync(e),this.onChangeShowLineNumbersBeforeSync(e),this.onChangeShowMinimapBeforeSync(e),this.onChangeReplaceUnderscoreBeforeSync(e),this.onChangeThemeBeforeSync(e),this.onChangeModeBeforeSync(e),this.onChangeLanguageBeforeSync(e),this.onChangeFontSizeBeforeSync(e),this.onChangeFontFamilyBeforeSync(e),this.onChangeAutoCompleteToggleBeforeSync(e)}getLinesTable(e,t,i){this.elements.main.querySelector(".view-lines");const n=this.monaco.getModel();if(!n)throw new Error("Model not found in Monaco Editor");const o=Math.min(i,n.getLineCount()),s=document.createElement("div"),r=document.createElement("style"),a=document.createElement("table");s.appendChild(r),r.textContent=`@scope { ${this.monaco._themeService._themeCSS} }`,a.classList.add(Let["find-lines-table"],"monaco-editor");const l=new PV({options:this.monaco.getOptions()},this.getThemeId());for(let t=Math.max(e,1);t<=o;++t){const e=document.createElement("tr"),i=document.createElement("td"),o=document.createElement("td");i.textContent=t,i.classList.add(Let["find-line-number"]),o.classList.add(Let["find-line-content"]);const s=n.getLineDecorations(t),r=this.monaco._modelData.view,d=Object.assign(r._context.viewLayout.getLinesViewportData(),{startLineNumber:t,endLineNumber:t+1}),h=new az(r._selections,d,r._context.viewLayout.getWhitespaceViewportData(),r._context.viewModel).getViewLineRenderingData(t),c=s.map((e=>new kj(e.range,e.options.inlineClassName,e.options.inlineClassNameAffectsLetterSpacing?3:0))),u=n.getLineContent(t),g=WB.filter(c,t,1,u.length+1),p=new KB(l.useMonospaceOptimizations,l.canUseHalfwidthRightwardsArrow,u,h.continuesWithWrappedLine,h.isBasicASCII,h.containsRTL,0,n.tokenization.getLineTokens(t),g,h.tabSize,h.startVisibleColumn,l.spaceWidth,l.middotWidth,l.wsmiddotWidth,l.stopRenderingLineAfter,l.renderWhitespace,l.renderControlCharacters,l.fontLigatures!==eP.OFF,null),m=new Xg(1e4);GB(p,m),0===u.length?o.innerHTML=" ":o.innerHTML=m.build(),e.appendChild(i),e.appendChild(o),a.appendChild(e)}return s.appendChild(a),s}addCustomSuggest(e){const t=ctt[e];if(!t)throw new Error(`Custom Suggest Context not found: ${e}`);const i=t.createSuggest;if(!i)throw new Error(`create suggest function not found: ${e}`);const n=t.keybinding;this.monaco.addCommand(n,(()=>{const e=this.getCurrentFocus();if(null===e)return;if(e&&e.mode===ltt.VIM&&e.vim&&"vim-insert"!==e.vim.state.keyMap)return;const t=e.getContext(e.createContextKey("language")),n=(o=i,s=()=>{r&&setTimeout((()=>{r.dispose()}),0)},{provideCompletionItems:async function(e,t,i){const n=await o();return n.forEach((e=>{e.kind||(e.kind=eve.CompletionItemKind.Text),e.range={startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:t.lineNumber,endColumn:t.column}})),{suggestions:n,dispose:()=>{s()}}}});var o,s;const r=eve.registerCompletionItemProvider(t,n);e.monaco.getContribution(Hie.ID).triggerSuggest(new Set([n]))}))}}window.customElements.define("prompt-editor",dtt);const htt=e=>{for(const t of Object.keys(stt.instances).sort())if(e(stt.instances[t]))break},ctt={},utt=(e,t,i)=>{ctt[e]={keybinding:t,createSuggest:i},htt((t=>{t.addCustomSuggest(e)}))},gtt=()=>{B8e(),htt((e=>{e.updateAutoComplete()}))},ptt=(e,t)=>{const i=P8e.call(void 0,e,t);return gtt(),i},mtt=()=>{const e=O8e.call(void 0);return gtt(),e},ftt=X_e,_tt=Q_e,vtt=eve.CompletionItemKind,btt=eve.CompletionItemInsertTextRule,wtt=JSON.parse('{"A$":"/webui-monaco-prompt","L7":"/webui-monaco-prompt-embeddings","tw":"/webui-monaco-prompt-snippets","pf":"/webui-monaco-prompt-csv"}'),Ctt="webui-monaco-prompt";return(e=>{let t=!1;const i=[{keybinding:ftt.chord(ftt.CtrlCmd|_tt.KeyM,ftt.CtrlCmd|_tt.KeyM),model:"sd-models"},{keybinding:ftt.chord(ftt.CtrlCmd|_tt.KeyM,ftt.CtrlCmd|_tt.KeyL),model:"loras"},{keybinding:ftt.chord(ftt.CtrlCmd|_tt.KeyM,ftt.CtrlCmd|_tt.KeyE),model:"embeddings"},{keybinding:ftt.chord(ftt.CtrlCmd|_tt.KeyM,ftt.CtrlCmd|_tt.KeyH),model:"hypernetworks"},{keybinding:ftt.chord(ftt.CtrlCmd|_tt.KeyM,ftt.CtrlCmd|_tt.KeyA),model:"sd-vae"}];for(const{keybinding:e,model:t}of i)utt(t,e,(async()=>{const e=[],i=await fetch(`/sdapi/v1/${t}`).then((e=>e.json()));switch(t){case"sd-models":case"sd-vae":i.forEach((t=>{const i=t.model_name;e.push({label:i,kind:vtt.File,insertText:i})}));break;case"hypernetworks":i.forEach((t=>{const i=t.name;e.push({label:i,kind:vtt.File,insertText:i})}));break;case"embeddings":Object.keys(i.loaded).forEach((t=>{const i=t;e.push({label:i,kind:vtt.File,insertText:i})}));break;case"loras":i.forEach((t=>{const i=t.name;e.push({label:i,kind:vtt.File,insertText:i})}));break;default:throw new Error("Unknown model type: "+t)}return e}));utt("snippet",ftt.chord(ftt.CtrlCmd|_tt.KeyM,ftt.CtrlCmd|_tt.KeyS),(async()=>{const e=[],t=await fetch(wtt.tw).then((e=>e.json()));for(const n of t){const t=`**${i=n.insertText,i.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}**`;e.push({label:n.label,kind:vtt.Snippet,insertText:n.insertText,insertTextRules:btt.InsertAsSnippet,detail:n.path,documentation:{supportHtml:!0,value:n.documentation?[t,n.documentation].join("<br><br>"):t}})}var i;return e})),onUiUpdate((async()=>{if(t)return;t=!0;const n=gradioApp();await(async()=>{const e=await fetch(wtt.L7).then((e=>e.json())).catch((e=>new Error(`fetch error: ${e}`)));e&&e.loaded&&(console.log(Ctt,"load","embedding",Object.keys(e.loaded)),R8e("embedding",Object.keys(e.loaded),!0));for(const[e,t]of[["lora","setting_sd_lora"],["hypernet","setting_sd_hypernetwork"],["lyco","setting_sd_lyco"]]){const i=gradio_config.components.filter((e=>e.props.elem_id===t&&e.props.choices))[0];if(!i)continue;const n=i.props.choices.slice();"None"===n[0]&&n.shift(),console.log(Ctt,"load",e,n),R8e(e,n,!0)}})();let o=!1;onUiUpdate((async()=>{if(o)return;const e=["txt2img_prompt","txt2img_neg_prompt","img2img_prompt","img2img_neg_prompt"];for(const t of e)if(null===n.getElementById(t))return;const t=["txt2img_edit_style_prompt","txt2img_edit_style_neg_prompt","img2img_edit_style_prompt","img2img_edit_style_neg_prompt"],s=["file_edit_box_id","sddp-wildcard-file-editor"];o=!0;let r=null;const a=await fetch(wtt.A$,{method:"GET"}).then((e=>e.json())).catch((e=>console.error("fetch error:",wtt.A$,e)));for(const o of e.concat(t,s)){const e=n.getElementById(o);if(!e)continue;const s=e.querySelector("textarea"),l=new dtt(s,{autoLayout:!0,handleTextAreaValue:!0,overlayZIndex:99999});for(const{keybinding:e,model:t}of i)l.addCustomSuggest(t);l.addCustomSuggest("snippet"),l.addEventListener("keydown",(e=>{switch(e.key){case"Esc":case"Escape":e.stopPropagation()}})),s.parentElement?s.parentElement.append(l):e.append(l),Object.assign(l.style,{resize:"vertical",overflow:"overlay",display:"block",height:"100%",minHeight:"20rem",width:"100%"}),t.includes(o)&&new IntersectionObserver((e=>{l.handleResize()})).observe(l),l.setSettings(a);const d=async()=>{const e=l.getSettings();if(ttt(r,e))return;r=e;const t=await fetch(wtt.A$,{method:"POST",body:JSON.stringify(e)}).then((e=>e.json())).catch((e=>console.error("fetch error:",wtt.A$,e)));t.success||console.error("fetch failed:",t)};l.onChange(d)}}));const s=await fetch(wtt.pf).then((e=>e.json())).catch((e=>new Error(`fetch error: ${e}`))),r=e.pathname.split("/").slice(0,-2);for(const e of s){const t=r.concat(["csv",e]).join("/")+".csv";mtt(),fetch(t).then((e=>e.text())).then((i=>{console.log("add:",e,t),ptt(e,i)}))}const a=[],l=[{id:"txt2img_textual_inversion_cards",type:"embedding"},{id:"txt2img_hypernetworks_cards",type:"hypernet"},{id:"txt2img_lora_cards",type:"lora"},{id:"txt2img_lycoris_cards",type:"lyco"}];var d;d=()=>{for(const e of l){const t=n.getElementById(e.id),i=[];t&&t.querySelectorAll(".card .name").forEach((e=>{const t=e.textContent;t&&i.push(t)})),0!=i.length&&(console.log(Ctt,"refresh",e.type,i),R8e(e.type,i,!0))}},a.push(d),onUiUpdate((function(e){for(const t of e){const e=t.target;if(e&&e.closest&&e.closest("#txt2img_extra_tabs")){a.forEach((e=>e()));break}}}))}))})(new URL(document.currentScript.src)),{}})())); |